# HG changeset patch # User William Roberts # Date 1279812746 -3600 # Node ID 7a2f5f2dfe61402d1c82ab4b48884f7d4fbe70b0 # Parent e8be2c2e049d80182214d8516d36fc26b7f2b49e# Parent 5554410e16f58f176d4c0be749f3c24fb9ebbaaa Catchup to latest Symbian^4 diff -r e8be2c2e049d -r 7a2f5f2dfe61 inc/musavasettings.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/inc/musavasettings.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,146 @@ +/* +* 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: This interface is used by +* clients to get and availability setting for Video Charging +* +*/ + + +#ifndef __MUSAVASETTINGS_H__ +#define __MUSAVASETTINGS_H__ + +// INCLUDES +#include +#include +#include +#include + +class MMusAvaSettingsObserver; + +/** + * Defines setting interface for the MusAvailability Plug-in + * + * ECOM clients set and get setting are used by MusAvailability Plug-in. + * + * @lib musavailabilityplugin.lib + */ + +class MMusAvaSettings + { + +public: + + enum TManualActivation + { + EActivationNotExecuted, + EActivationExecuted, + EActivationAllowed, + EActivationNotAllowed + }; +public: + + /** + * Returns the fast mode value + * + * @return The fast mode value. + */ + virtual MusSettingsKeys::TFastMode FastMode() const; + + + /** + * Returns the manual activation + * + */ + virtual TManualActivation ManualActivation(); + + /** + * Returns the telephone number of remote host of active CS call. + * + * @return The telephone number. + */ + virtual const TDesC& TelNumber() const; + + /** + * Returns the contact name of remote host of active CS call. + * + * @return The contact name. + */ + virtual const TDesC& ContactName() const; + + /** + * Returns the possible SIP addresses of the remote host. + * + * @return The SIP addresses in an array. + */ + virtual const MDesCArray& SipAddresses() const; + + /** + * Returns the proposal for the remote host SIP address. + * + * @return The telephone number. + */ + virtual const TDesC& SipAddressProposal() const; + + /** + * Returns the contact id of the remote host. + * + * @return The contact id; KErrNotFound, if not found any. + */ + virtual TInt ContactId() const; + + /** + * Returns the supported video codecs. + * + * @return The video codecs + */ + virtual const MDesCArray& VideoCodecs() const; + + /** + * Returns the supported audio codecs. + * + * @return The supported audio codecs. + */ + virtual const MDesCArray& AudioCodecs() const; + + /** + * Returns the id of the preferable SIP profile. + * + * @return The SIP profile id. + */ + virtual TInt SipProfileId() const; + + /** + * Sets the settings observer pointer + * + */ + virtual void SetObserver( MMusAvaSettingsObserver& aObserver ); + + /* + * Gets the settings observer pointer + * + */ + MMusAvaSettingsObserver* Observer(); + + /** + * Sets the for the manual activation + * + */ + virtual void SetManualActivation( TManualActivation aManualActivation ); + + }; + +#include "musavasettings.inl" + +#endif + diff -r e8be2c2e049d -r 7a2f5f2dfe61 inc/musavasettings.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/inc/musavasettings.inl Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,170 @@ +/* +* 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: ECOM interface default implementation. +* +*/ + + +#ifndef MUSAVASETTING_INL +#define MUSAVASETTING_INL + +#include "musavasettings.h" + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline MusSettingsKeys::TFastMode MMusAvaSettings::FastMode() const + { + User::Leave( KErrNotSupported ); + return MusSettingsKeys::EFastModeOff; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline MMusAvaSettings::TManualActivation MMusAvaSettings::ManualActivation() + { + User::Leave( KErrNotSupported ); + return MMusAvaSettings::EActivationNotExecuted; + } +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline const TDesC& MMusAvaSettings::TelNumber() const + { + User::Leave( KErrNotSupported ); + + // this line is never reached; exists only to avoid warning + return KNullDesC(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline const TDesC& MMusAvaSettings::ContactName() const + { + User::Leave( KErrNotSupported ); + + // this line is never reached; exists only to avoid warning + return KNullDesC(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline const MDesCArray& MMusAvaSettings::SipAddresses() const + { + User::Leave( KErrNotSupported ); + + // this line is never reached; exists only to avoid warning + return ( MDesCArray& ) KErrNotSupported; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline const TDesC& MMusAvaSettings::SipAddressProposal() const + { + User::Leave( KErrNotSupported ); + + // this line is never reached; exists only to avoid warning + return KNullDesC(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline TInt MMusAvaSettings::ContactId() const + { + User::Leave( KErrNotSupported ); + + // this line is never reached; exists only to avoid warning + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline const MDesCArray& MMusAvaSettings::VideoCodecs() const + { + User::Leave( KErrNotSupported ); + + // this line is never reached; exists only to avoid warning + return ( MDesCArray& ) KErrNotSupported; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline const MDesCArray& MMusAvaSettings::AudioCodecs() const + { + User::Leave( KErrNotSupported ); + + // this line is never reached; exists only to avoid warning + return ( MDesCArray& ) KErrNotSupported; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline TInt MMusAvaSettings::SipProfileId() const + { + User::Leave( KErrNotSupported ); + + // this line is never reached; exists only to avoid warning + return KErrNotSupported; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline void MMusAvaSettings::SetObserver( MMusAvaSettingsObserver& /*aObserver*/ ) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline MMusAvaSettingsObserver* MMusAvaSettings::Observer() + { + return NULL; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline void MMusAvaSettings::SetManualActivation( TManualActivation /*aManualActivation*/ ) + { + User::Leave( KErrNotSupported ); + } + + +#endif // MUSAVASETTING_INL diff -r e8be2c2e049d -r 7a2f5f2dfe61 inc/muscallmonitorobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/inc/muscallmonitorobserver.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,53 @@ +/* +* 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: Observer for listening status of current cs call +* +*/ + + +#ifndef MUSCALLMONITOROBSERVER_H +#define MUSCALLMONITOROBSERVER_H + +#include +#include + +/** + * Observer for the monitor + * + * @lib musaoplugin.dll + */ +class MMusCallMonitorObserver + { + +public: // type definitions + + virtual void CallConnectedL( const TDesC& aTelNumber, TBool aIsSipUri ) = 0; + + virtual void CallHoldL( const TDesC& aTelNumber, TBool aIsSipUri ) = 0; + + virtual void ConferenceCallL() = 0; + + virtual void NoActiveCallL() = 0; + + /** + * + */ + virtual TBool ResolveAddressesL( const TDesC& /*aContactId*/, + CDesCArrayFlat*& /*aContactsArray*/) + { + return EFalse; + } + }; + +#endif // MUSCALLMONITOROBSERVER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 inc/muscleanupresetanddestroy.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/inc/muscleanupresetanddestroy.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,58 @@ +/* +* 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 __CLEANUPRESETANDDESTROY_H__ +#define __CLEANUPRESETANDDESTROY_H__ + +// INCLUDES +#include + +// CLASS DEFINITION +/** + * Template class for cleaning up arrays that have a ResetAndDestroy() function. + * To be used with the CleanupStack. + */ +template +class MusCleanupResetAndDestroy + { + public: // New functions + + inline static void PushL( T& aRef ); + + private: // New functions + + static void ResetAndDestroy( TAny *aPtr ); + + }; + +// INLINE FUNCTIONS +template +inline void MusCleanupResetAndDestroy< T >::PushL( T& aRef ) + { + CleanupStack::PushL( TCleanupItem( &ResetAndDestroy, &aRef ) ); + } + +template +void MusCleanupResetAndDestroy::ResetAndDestroy( TAny *aPtr ) + { ( static_cast< T* >( aPtr ) )->ResetAndDestroy(); } + +template +inline void MusCleanupResetAndDestroyPushL( T& aRef ) + { MusCleanupResetAndDestroy< T >::PushL( aRef ); } + + +#endif // __CLEANUPRESETANDDESTROY_H__ diff -r e8be2c2e049d -r 7a2f5f2dfe61 inc/muscommon.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/inc/muscommon.h Thu Jul 22 16:32:26 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: ?Description +* +*/ + + + +#ifndef MUSCOMMON_H +#define MUSCOMMON_H + +#include +#include + +namespace Mus + { + // sip uids for client resolver cooperation + // for invitations + const TUid KAllowedSipInvite = { 0x1002000 }; + const TUid KNotAllowedSipInvite = { 0x1002001 }; + + // for options + const TUid KSipOptions = { 0x1002002 }; + + // resource availability + enum TMusResourceAvailability + { + EMusAvailable, // resource available + EMusNotAvailable // resource not available + }; + + // multimediasharing environmental error codes + enum TMusError + { + ENoActiveCall = 1, // no active call -> sharing not possible, error + EConferenceCall, // current call is a conf call -> error + ECallInHold, // current call is on hold -> error + ENoNetwork, // there's no packet network -> error + ERoamingNetwork, // sharing not allowed when roaming -> error + ENoSipProfile, // there's no sip profile -> error + ESipRegistrationFailed, // sip registration failed -> error + ESipOptionsFailed // sip options revealed that the remote host is + // not capable of video sharing -> error + }; + + // values for application startup behavior (have same effect as command + // enumerations of CApaCommandLine) + const TUint KMusCommandLetterRun = 'R'; + const TUint KMusCommandLetterBackground = 'B'; + + } + +#endif // MUSMANAGERCOMMON_H + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 inc/musfactorysettings.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/inc/musfactorysettings.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,62 @@ +/* +* 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: This interface is used by +* clients to get and availability setting for Video Charging +* +*/ + + +#ifndef __MUSFACTORYSETTINGS_H__ +#define __MUSFACTORYSETTINGS_H__ + +// INCLUDES +#include +#include +#include +#include + +class MMusAvaSettingsObserver; + +/** + * Utility function to check the factory configurations. + * @lib musaoplugin.lib + */ + +class MusFactorySettings + { +public: + /** + * Checks from the factory settings whether call type is supported. + * @aCallType : Type of the call retrived from Tsy apis. + * + * @return ETrue if supported else EFalse. + * Leaves when cenrep key is not found or cenrep related error happens. + */ + static TBool IsSupportedL(const TPSCTsyCallType& aCallType); + + /** + * Checks from the factory settings whether network type is supported. + * @aNetworkType : Type of the network + * + * @return ETrue if supported else EFalse. + * Leaves when cenrep key is not found or cenrep related error happens. + */ + static TBool IsSupportedL(const RMobilePhone::TMobilePhoneNetworkMode& aNetworkType); + + }; + +#include "musfactorysettings.inl" + +#endif + diff -r e8be2c2e049d -r 7a2f5f2dfe61 inc/musfactorysettings.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/inc/musfactorysettings.inl Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,108 @@ +/* +* 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: +* +*/ + + +#ifndef MUSFACTROYSETTINGS_INL +#define MUSFACTORYSETTINGS_INL + + +#include "musfactorysettings.h" +#include "mussettingskeys.h" +#include "mussettings.h" +#include "muslogger.h" + +// ----------------------------------------------------------------------------- +// Checks from the factory settings ( central repository ) +// whether call type is supported. +// ----------------------------------------------------------------------------- +// +inline TBool MusFactorySettings::IsSupportedL( + const TPSCTsyCallType& aCallType) + { + MusSettingsKeys::TAllowedCSOnly allowedCallType = + MultimediaSharingSettings::AllowedCSOnlySettingL(); + if( allowedCallType == MusSettingsKeys::EAllowedCSOnly && + aCallType != EPSCTsyCallTypeCSVoice ) + { + MUS_LOG( "mus: [MUSAO] <-> MusFactorySettings::IsSupportedL Call : EFalse" ) + return EFalse; + } + MUS_LOG( "mus: [MUSAO] <-> MusFactorySettings::IsSupportedL Call : ETrue" ) + return ETrue; + } + + +// ----------------------------------------------------------------------------- +// Checks from the factory settings ( central repository ) +// whether network type is supported. +// ----------------------------------------------------------------------------- +// +inline TBool MusFactorySettings::IsSupportedL( + const RMobilePhone::TMobilePhoneNetworkMode& aNetworkType) + { + MUS_LOG1( "mus: [MUSAO] -> MusFactorySettings::IsSupportedL Network :%d", aNetworkType ) + + TBool networkSupported = EFalse; + TInt onlyIn3GNetwork = MusSettingsKeys::EAllowedAllBearers; + // Check from Central Repository that do we Only support in 3G or All Networks. + // if key is not found then behave like default ie AllowedAllBearers. + TRAP_IGNORE( onlyIn3GNetwork = MultimediaSharingSettings::Allowed3GOnlySettingL() ); + if( onlyIn3GNetwork == MusSettingsKeys::EAllowedAllBearers ) + { + networkSupported = ETrue; + } + else + { + switch( aNetworkType ) + { + case RMobilePhone::ENetworkModeWcdma: + case RMobilePhone::ENetworkModeTdcdma: + case RMobilePhone::ENetworkModeCdma95: + case RMobilePhone::ENetworkModeCdma2000: + { + networkSupported = ETrue; + break; + } + + case RMobilePhone::ENetworkModeGsm: + { + TInt edgeDtmSupport = KErrNone; + + // We Will throw an Activation Error for the Mandatory Settings if + // they are not found. + + edgeDtmSupport = MultimediaSharingSettings::EdgeDtmSupportSettingL(); + + if( edgeDtmSupport == MusSettingsKeys::EDtmModeAllowed ) + { + networkSupported = ETrue; + } + else + { + networkSupported = EFalse; + } + break; + } + } + } + MUS_LOG1( "mus: [MUSAO] <- MusFactorySettings::IsSupportedL (%d)", networkSupported ) + + return networkSupported; + } + + +#endif // MUSFACTROYSETTINGS_INL diff -r e8be2c2e049d -r 7a2f5f2dfe61 inc/musindicatorapi.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/inc/musindicatorapi.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,220 @@ +/* +* 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: Provides means for confirmation query and availability + indications. +* +*/ + + + +#ifndef C_MUSINDICATORAPI_H +#define C_MUSINDICATORAPI_H + + +#include "musindicatorobserver.h" +#include "musunittesting.h" +#include "mussoundplayerobserver.h" +#include +#include + + +class CMusIndicatorDsa; +class CAknGlobalMsgQuery; +class CMusSoundPlayer; + + +/** + * MusIndicatorApi provides means to show notes and indicate availability + * of videosharing to user. + * + * @code + * // Shows roaming activation query + * if ( MusIndicatorApi::ConfirmationQueryL( + * MusIndicatorApi::EVsRoamingActivationQuery ) ) + * { + * // respond to user response "yes" + * } + * else + * { + * // respond to user response "no" + * } + * @endcode + * + * @lib musindicator.lib + */ +class CMusIndicatorApi : public CActive, MMusSoundPlayerObserver + { + +public: + + /** Different notes */ + enum TVsPopupQuery + { + EVsRoamingActivationQuery /** + * Displays a query prompting for + * activation of VS when roaming. + */ + }; + + /** + * Two-phased constructor. + * + * @param aObserver Reference to observer interface. + * return Pointer to newly created instance of CMusIndicatorApi. + */ + IMPORT_C static CMusIndicatorApi* NewL( + MMusIndicatorObserver& aObserver ); + + /** + * Two-phased constructor. + * + * @param aObserver Reference to observer interface. + * return Pointer to newly created instance of CMusIndicatorApi. + */ + IMPORT_C static CMusIndicatorApi* NewLC( + MMusIndicatorObserver& aObserver ); + + + /** + * Two-phased constructor. + * + * return Pointer to newly created instance of CMusIndicatorApi. + */ + IMPORT_C static CMusIndicatorApi* NewL(); + + /** + * Destructor. + */ + ~CMusIndicatorApi(); + + /** + * Shows a global query to user. + * + * @param aQuery Identifies displayed query. + * @return Boolean value indicating if user accepted the query. + */ + IMPORT_C static TBool ConfirmationQueryL( TVsPopupQuery aQuery ); + + /** + * Indicates availability of video sharing. + */ + IMPORT_C void IndicateAvailabilityL(); + +protected: + +// from base class CActive. + + /** + * From CActive. + * Handles completion of an outstanding asynchronous request. + */ + virtual void RunL(); + + /** + * From CActive. + * Cancels an outstanding asynchronous request. + */ + virtual void DoCancel(); + + /** + * From CActive. + * Handles a leave occurring in the request completion event handler RunL. + * + * @param aError Error code of occured leave. + */ + virtual TInt RunError( TInt aError ); + +// from base class MMusSoundPlayerObserver. + + /** + * From MMusSoundPlayerObserver. + * Notifies of sound playing complete. + * + * @param aError Errorcode associated with playback. + */ + virtual void PlaySoundComplete( TInt aError ); + +private: + + CMusIndicatorApi( MMusIndicatorObserver* aObserver ); + + void ConstructL(); + + /** + * Indicating availability of VS. + * + * @param aShown ETrue set indicator on and EFalse to Indicator off. + */ + void Indicator( TBool aShown ); + + /** + * Plays indication tone. + */ + void PlayToneL(); + + /** + * Returns text from a resource file for a specified note/query. + * + * @param aQuery Identifies displayed query. + * @return Text associated with specified query. Ownership is transferred. + */ + static HBufC* NoteTextLC( TVsPopupQuery aQuery ); + + /** + * Asynchronous query. Result returned via observer interface. + */ + void ShowLiveSharingQueryL( TBool aPlayTone ); + + static TInt LiveSharingQueryTimeout( TAny* aThis ); + + void StartLiveSharingL(); + void ToggleIndicatorL(); + TBool IsSubscriber() const; + + +private: // data + + /** + * Pointer to indicator window + * Own. + */ + CMusIndicatorDsa* iIndicatorWindow; + + /** + * Pointer to global msg query. + * Own. + */ + CAknGlobalMsgQuery* iQuery; + + /** + * Sound player. + * Own. + */ + CMusSoundPlayer* iSoundPlayer; + + /** + * Reference to observer interface. + * Own. + */ + MMusIndicatorObserver* iObserver; + + CPeriodic* iLiveSharingQueryTimeout; + + RProperty iProperty; + + MUS_UNITTEST( UT_CMusIndicatorApi ) + + }; + +#endif // C_MUSINDICATORAPI_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 inc/musindicatorobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/inc/musindicatorobserver.h Thu Jul 22 16:32:26 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: Observer interface for MuS indicator. +* +*/ + + +#ifndef MUSINDICATOROBSERVER_H +#define MUSINDICATOROBSERVER_H + +#include + +/** + * This abstract class contains a method to start live video sharing. + */ +class MMusIndicatorObserver + { +public: + + /** + * Starts live video sharing. + */ + virtual void StartLiveSharingL() = 0; + + }; + +#endif // MUSINDICATOROBSERVER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 inc/muslogger.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/inc/muslogger.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,148 @@ +/* +* 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: ?Description +* +*/ + + +#ifndef MUSLOGGER_H +#define MUSLOGGER_H + +// Disabled PC_lint warning for "Undefined preprocessor variable 'UNIT_TESTING'" +/*lint -e553 */ +#if ( !_DEBUG || UNIT_TESTING ) // release or unit test build; no logs + +#define MUS_LOG_TDESC( aPrefix, aString ) +#define MUS_LOG_TDESC8( aPrefix, aString ) +#define MUS_LOG( aFmt ) +#define MUS_LOG1( aFmt, aVar1 ) +#define MUS_LOG2( aFmt, aVar1, aVar2 ) +#define MUS_LOG3( aFmt, aVar1, aVar2, aVar3 ) + +#else // debug build; logs + +#include +#include + +_LIT( KMusLogDir, "mus" ); // MultimediaSharing logging directory. +_LIT( KMusLogFile, "musdebug.txt" ); // MultimediaSharing log file name. + +// File logging can be disabled by commenting above definition. +#define MUS_FILE_LOGGING_ENABLED + +#if ( defined __WINSCW__ ) || ( defined __WINS__ ) +// No sense to have file logging enabled in wins +#undef MUS_FILE_LOGGING_ENABLED +#endif + +#ifdef MUS_FILE_LOGGING_ENABLED +const TBool KMusFileLoggingEnabled = ETrue; +#else +const TBool KMusFileLoggingEnabled = EFalse; +#endif + +#define MUS_LOG_TDESC( aPrefix, aString )\ + {\ + _LIT( KLogPrefix, aPrefix );\ + HBufC* logString = HBufC::NewLC( KLogPrefix().Length()+\ + aString.Length() );\ + logString->Des().Append( KLogPrefix() );\ + logString->Des().Append( aString );\ + if ( KMusFileLoggingEnabled )\ + {\ + RFileLogger::Write( KMusLogDir, KMusLogFile,\ + EFileLoggingModeAppend,\ + *logString );\ + }\ + RDebug::Print( *logString );\ + CleanupStack::PopAndDestroy( logString );\ + } + +#define MUS_LOG_TDESC8( aPrefix, aString )\ + {\ + _LIT8( KLogPrefix8, aPrefix );\ + HBufC8* logString8 = HBufC8::NewLC( KLogPrefix8().Length()+\ + aString.Length() );\ + logString8->Des().Append( KLogPrefix8() );\ + logString8->Des().Append( aString );\ + if ( KMusFileLoggingEnabled )\ + {\ + RFileLogger::Write( KMusLogDir, KMusLogFile,\ + EFileLoggingModeAppend,\ + *logString8 );\ + }\ + RDebug::RawPrint( *logString8 );\ + CleanupStack::PopAndDestroy( logString8 );\ + } + +#define MUS_LOG( aFmt )\ + {\ + _LIT( KLogMsg, aFmt );\ + if ( KMusFileLoggingEnabled )\ + {\ + RFileLogger::WriteFormat( KMusLogDir, KMusLogFile,\ + EFileLoggingModeAppend,\ + KLogMsg() );\ + }\ + RDebug::Print( KLogMsg() );\ + } + +#define MUS_LOG1( aFmt, aVar1 )\ + {\ + _LIT( KLogMsg, aFmt );\ + if ( KMusFileLoggingEnabled )\ + {\ + RFileLogger::WriteFormat( KMusLogDir, KMusLogFile,\ + EFileLoggingModeAppend,\ + KLogMsg(), aVar1 );\ + }\ + RDebug::Print( KLogMsg(), aVar1 );\ + } + +#define MUS_LOG2( aFmt, aVar1, aVar2 )\ + {\ + _LIT( KLogMsg, aFmt );\ + if ( KMusFileLoggingEnabled )\ + {\ + RFileLogger::WriteFormat( KMusLogDir, KMusLogFile,\ + EFileLoggingModeAppend,\ + KLogMsg(), aVar1, aVar2 );\ + }\ + RDebug::Print( KLogMsg(), aVar1, aVar2 );\ + } + +#define MUS_LOG3( aFmt, aVar1, aVar2, aVar3 )\ + {\ + _LIT( KLogMsg, aFmt );\ + if ( KMusFileLoggingEnabled )\ + {\ + RFileLogger::WriteFormat( KMusLogDir, KMusLogFile,\ + EFileLoggingModeAppend,\ + KLogMsg(), aVar1, aVar2, aVar3 );\ + }\ + RDebug::Print( KLogMsg(), aVar1, aVar2, aVar3 );\ + } + +#endif + +#define LEAVE_IF_NOT( x, y ) \ + if( x != y && x != KErrNone )\ + {\ + MUS_LOG1( "mus: [ ] Leaving with code %d", x )\ + User::Leave( x );\ + } + +#endif // MUSLOGGER_H + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 inc/musresourcefinderutil.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/inc/musresourcefinderutil.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,66 @@ +/* +* 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: The ECOM interface implementation. +* +*/ + + +#ifndef MUSRESOURCEFINDER_H +#define MUSRESOURCEFINDER_H + +#include "musunittesting.h" + +#include +#include + +// possible locations of compiled resource file + +_LIT( KMusResourceRom, "z:\\resource\\" ); +_LIT( KMusResourceRam, "c:\\resource\\" ); + +_LIT( KMusAppResourceRom, "z:\\resource\\apps\\" ); +_LIT( KMusAppResourceRam, "c:\\resource\\apps\\" ); + + + +class MusResourceFinderUtil + { + MUS_UNITTEST( UT_MusResourceFinderUtil ) + + public: + /** + * Returns the full path of resource file name from Resource Dir + * Note : This function will leave with KErrNotFound + * If the file is not found in Rom or Ram. + */ + static HBufC* ResourcePathL( const TDesC& aFileName ); + + /** + * Returns the full path of resource file name from App Resource Dir + * Note : This function will leave with KErrNotFound + * If the file is not found in Rom or Ram. + */ + static HBufC* AppResourcePathL( const TDesC& aFileName ); + + /** + * Checks the Existence of File + * Returns ETrue if Exist else EFalse + */ + static TBool IsExistL( const TDesC& aFileNameWithPath ); + + }; + +#include "musresourcefinderutil.inl" + +#endif // MUSRESOURCEFINDER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 inc/musresourcefinderutil.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/inc/musresourcefinderutil.inl Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,197 @@ +/* +* 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: Utility Class for Rom / Ram file finder. +* +*/ + +#ifndef MUSRESOURCEFINDERUTIL_INL +#define MUSRESOURCEFINDERUTIL_INL + +#include "musresourcefinderutil.h" +#include "muslogger.h" + +#include + + +// ----------------------------------------------------------------------------- +// Returns the full path of filename of the resource file from Resource dir +// ----------------------------------------------------------------------------- +// + +inline HBufC* MusResourceFinderUtil::ResourcePathL( const TDesC& aFileName ) + { + MUS_LOG( "[COMMON] -> MusResourceFinderUtil::ResourcePathL" ) + + RFs fs; + User::LeaveIfError( fs.Connect() ); + CleanupClosePushL( fs ); + + // here extra one chracter length is added because of some strange chineese + // resource extension reason. + HBufC* fileName = HBufC::NewLC(KMusResourceRam().Length() + + aFileName.Length() + 1 ); + TPtr fileNamePtr = fileName -> Des(); + fileNamePtr.Copy(KMusResourceRam()); + fileNamePtr.Append(aFileName); + + bool resourceFileFound = false; + + //check for resource and variant file in RAM + + if (!resourceFileFound) + { + if(fileName->Length()Length() MusResourceFinderUtil::AppResourcePathL" ) + + RFs fs; + User::LeaveIfError( fs.Connect() ); + CleanupClosePushL( fs ); + + // here extra one chracter length is added because of some strange chineese + // resource extension reason. + HBufC* fileName = HBufC::NewLC(KMusAppResourceRam().Length() + + aFileName.Length() + 1 ); + TPtr fileNamePtr = fileName -> Des(); + fileNamePtr.Copy(KMusAppResourceRam()); + fileNamePtr.Append(aFileName); + if( BaflUtils::FileExists( fs, *fileName ) ) // Check in Ram + { + MUS_LOG_TDESC( "[COMMON] File Found in Ram (C:) -> " , aFileName ) + } + else + { + fileNamePtr.Copy(KMusAppResourceRom()); + fileNamePtr.Append(aFileName); + if( BaflUtils::FileExists( fs, *fileName) ) + { + MUS_LOG_TDESC( "[COMMON] File Found in Rom (Z:) -> " , aFileName ) + } + else + { + MUS_LOG_TDESC( "[COMMON] File Not Found -> " , aFileName ) + MUS_LOG( "[COMMON] Returning Rom File by default") + // Return Rom path since that will be default in real product + // if that doesnt exist , it is upto sub system to handle this + // because some cases it will not be mandatory file + fileNamePtr.Copy(KMusAppResourceRom()); + fileNamePtr.Append(aFileName); + } + } + if(fileName->Length() " , fileNamePtr ) + MUS_LOG( "[COMMON] <- MusResourceFinderUtil::AppResourcePathL" ) + return fileName; + } + + +// ----------------------------------------------------------------------------- +// Returns ETrue if File Exist else EFalse +// ----------------------------------------------------------------------------- +// + +inline TBool MusResourceFinderUtil::IsExistL( const TDesC& aFileNameWithPath ) + { + MUS_LOG( "[COMMON] -> MusResourceFinderUtil::IsExist" ) + TBool exist = EFalse; + RFs fs; + User::LeaveIfError( fs.Connect() ); + CleanupClosePushL( fs ); + if( BaflUtils::FileExists( fs, aFileNameWithPath ) ) // Check file + { + MUS_LOG_TDESC( "[COMMON] File Exists -> " , aFileNameWithPath ) + exist = ETrue ; + } + else + { + MUS_LOG_TDESC( "[COMMON] File Not Found -> " , aFileNameWithPath ) + exist = EFalse; + } + CleanupStack::PopAndDestroy(); // fs + MUS_LOG( "[COMMON] <- MusResourceFinderUtil::IsExist" ) + return exist; + } + +#endif // MUSRESOURCEFINDERUTIL_INL + +// end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 inc/mussesseioninformationapi.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/inc/mussesseioninformationapi.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,83 @@ +/* +* 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: ?Description +* +*/ + + +#ifndef MUSSESSIONINFORMATIONAPI_H +#define MUSSESSIONINFORMATIONAPI_H + +#include +#include "musuid.hrh" + +/** + * A namespace container for MultimediaSharing Resource API constants. + * + * @since S60 v3.2 + */ +namespace NMusSessionInformationApi + { + /** The category of these P&S properties. */ +#ifndef UNIT_TESTING + const TUid KCategoryUid = { 0x101F85EE }; // UID3 of AlwaysOnlineServer +#else + const TUid KCategoryUid = { 0x01700a21 }; // UID3 of EunitTest of AO +#endif + + /** Contains the call event state */ + const TInt KMusCallEvent( 0x1028239F ); + + /** Contains the telephone number of call */ + const TInt KMusTelNumber( 0x102823A0 ); + + /** Contains the Number of Active Calls */ + const TInt KMusCallCount( 0x102823A1 ); + + /** Contains the possible values of call event */ + enum TMusCallEvent + { + ENoCall, + ECallConnected, + ECallHold, + EConferenceCall + }; + + /** Contains the call direction */ + const TInt KMusCallDirection( 0x102823A2 ); + + /** Contains the call direction */ + enum TMusCallDirection + { + ENoDirection, + ECallOrginated, + ECallTerminated + }; + + /** Contains the state of options response. */ + const TInt KMUSForbidden( 0x102823A3 ); + /** Contains the possible values of options response. */ + enum TMUSForbidden + { + EMUSAllowed = 1, + EMUSForbidden + }; + /** Contains the call provider information. ( For example Skype ) + * This string will be used to parse the corresponding ecom plugin + * which implements the livecomms engine api + */ + const TInt KMUSCallProvider( 0x102823A4 ); + } + +#endif // MUSRESOURCEPROPERTIES_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 inc/mussessionproperties.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/inc/mussessionproperties.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,67 @@ +/* +* 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: ?Description +* +*/ + + +#ifndef MUSPSKEYS_H +#define MUSPSKEYS_H + +#include "musuid.hrh" +#include "musdomainpskeys.h" + +namespace NMusSessionApi + { + // category uid + const TUid KCategoryUid = { KMusManagerServerUid }; + + // session p&s keys + const TInt KUseCase( 0x11 ); // of type MultimediaSharing::TMusUseCase + const TInt KStatus( KMusAvailabilityStatus ); // of type MultimediaSharing::TMusAvailabilityStatus + const TInt KTelNumber( 0x13 ); + const TInt KRemoteSipAddress( 0x14 ); + const TInt KRemoteSipAddressProposal( 0x15); + const TInt KContactId( 0x16 ); + + // read this property bitwise + const TInt KAudioCodecs( 0x17 ); + enum TAudioCodecs + { + EAmrNb = 0x1, + EAmrWb = 0x2 + }; + + // read this property bitwise + const TInt KVideoCodecs( 0x18 ); + enum TVideoCodecs + { + EH263Video = 0x1, + EH264Video = 0x2 + }; + + const TInt KSignalingMode( 0x19 ); + enum TSignalingMode + { + EIetfMode, + EImsMode + }; + + const TInt KSipProfileId( 0x1A ); + const TInt KContactName( 0x1B ); + const TInt KMusIndicatorStatus( KMusIndicator ); + const TInt KFastMode( 0x1D ); + } + +#endif // MUSPSKEYS_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 inc/mussettings.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/inc/mussettings.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,335 @@ +/* +* 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: ?Description +* Name : mussettingskeys.h + +* Version : %version: 10 % << Don't touch! Updated by Synergy at check-out. +* +*/ + + +#ifndef MUSSETTINGS_H +#define MUSSETTINGS_H + +#include "mussettingskeys.h" + +/** + * A namespace container for MultimediaSharing Settings API constants. + */ +class MultimediaSharingSettings + { +public: + + /** + * Returns the cenrep configured value for KFastStartupMode key. + * + * @return Current KVideoDirection Key value from cenrep. + */ + static MusSettingsKeys::TFastMode FastStartupModeL(); + + + /** + * Returns the cenrep configured value for KVideoBandwidth key. + * + * @return Current KVideoBandwidth Key value from cenrep. + */ + static TInt VideoBandwidthSettingL(); + + /** + * Returns the cenrep configured value for KVideoDirection key. + * + * @return Current KVideoDirection Key value from cenrep. + */ + static MusSettingsKeys::TVideoDirection VideoDirectionL(); + + + /** + * Returns the cenrep configured value for KCameraUsage key. + * + * @return Current KCameraUsage Key value from cenrep. + */ + static MusSettingsKeys::TUseCamera CameraUsageL(); + + /** + * Returns the cenrep configured value for AllowedCSOnly key. + * + * @return Current AllowedCSOnly Key value from cenrep. + */ + static MusSettingsKeys::TAllowedCSOnly AllowedCSOnlySettingL(); + + /** + * Returns the cenrep configured value for Allowed3GOnly key. + * + * @return Current Allowed3GOnly Key value from cenrep. + */ + static MusSettingsKeys::TAllowed3GOnly Allowed3GOnlySettingL(); + + /** + * Returns current MS activation setting. + * + * @return Current MS activation setting. + */ + static MusSettingsKeys::TActivation ActivationSettingL(); + + /** + * Sets the MS activation setting + * + * @param + */ + static void SetActivationSettingL( MusSettingsKeys::TActivation aActivationSetting ); + + /** + * Returns + * + * @return + */ + static MusSettingsKeys::TOperatorVariant + MultimediaSharingSettings::OperatorVariantSettingL(); + + /** + * Sets + * + * @param + */ + static void MultimediaSharingSettings::SetOperatorVariantSettingL( + MusSettingsKeys::TOperatorVariant aVariantSetting ); + + /** + * Returns + * + * @return + */ + static MusSettingsKeys::TAuditoryNotification AuditoryNotificationSettingL(); + + /** + * Sets + * + * @param + */ + static void SetAuditoryNotificationSettingL( + MusSettingsKeys::TAuditoryNotification aNotificationSetting ); + + /** + * Returns + * + * @return + */ + static MusSettingsKeys::TPopupNotification PopupNotificationSettingL(); + + /** + * Sets + * + * @param + */ + static void SetPopupNotificationSettingL( + MusSettingsKeys::TPopupNotification aNotificationSetting ); + + /** + * Returns + * + * @return + */ + static MusSettingsKeys::TPopupNotificationType PopupNotificationTypeSettingL(); + + /** + * Sets + * + * @param + */ + static void SetPopupNotificationTypeSettingL( + MusSettingsKeys::TPopupNotificationType aNotificationSetting ); + + /** + * Returns + * + * @return + */ + static MusSettingsKeys::TEdgeDtmSupport EdgeDtmSupportSettingL(); + + /** + * Sets + * + * @param + */ + static void SetEdgeDtmSupportSettingL( + MusSettingsKeys::TEdgeDtmSupport aSetting ); + + /** + * Returns + * + * @return + */ + static MusSettingsKeys::TForceInternetSignaling ForceInternetSignalingSettingL(); + + /** + * Sets + * + * @param + */ + static void SetForceInternetSignalingSettingL( + MusSettingsKeys::TForceInternetSignaling aSetting ); + + /** + * Returns + * + * @return + */ + static MusSettingsKeys::TAutoRecord AutoRecordSettingL(); + + /** + * Sets + * + * @param + */ + static void SetAutoRecordSettingL( MusSettingsKeys::TAutoRecord aSetting ); + + /** + * Returns + * + * @return + */ + static TInt VideoLocationSettingL(); + + /** + * Sets + * + * @param + */ + static void SetVideoLocationSettingL( TInt aSetting ); + + /** + * Returns + * + * @return + */ + static TInt SipProfileSettingL(); + + /** + * Sets + * + * @param + */ + static void SetSipProfileSettingL( TInt aSetting ); + + /** + * Returns + * + * @return + */ + static MusSettingsKeys::TUiOrientation UiOrientationSettingL(); + + /** + * Sets + * + * @param + */ + static void SetUiOrientationSettingL( + MusSettingsKeys::TUiOrientation aOrientationSetting ); + + /** + * Returns + * + * @return + */ + static MusSettingsKeys::TCapabilityQuery CapabilityQuerySettingL(); + + /** + * Sets + * + * @param + */ + static void SetCapabilityQuerySettingL( + MusSettingsKeys::TCapabilityQuery aOrientationSetting ); + + /** + * Returns resource availability which is read from cenrep. + * + * @return + */ + static void ResourceAvailability(MusSettingsKeys::TAvailability &aCamera, + MusSettingsKeys::TAvailability &aKeypad); + + /** + * Returns resource usuability which is read from cenrep. + * + * @return + */ + static void ResourceUsability(MusSettingsKeys::TUsability &aCamera, + MusSettingsKeys::TUsability &aKeypad, + MusSettingsKeys::TUsability &aVideoplayer); + + /** + * @return Concatenation of encoder configuration information. + * Information has been divided to tokens separated by a semicolon. + * Keys will read from cenrep. Ownership is transferred. + */ + static HBufC8* EncoderConfigInfoLC(); + + + + /** + * @param A concatenation of encoder configuration information + */ + static void SetEncoderConfigInfoL( const TDesC8& aConfigInfo ); + + /** + * + */ + static TUid EncodingDeviceL(); + + /** + * For internal usage only. Use direct getters/setters for each setting. + * + * @param + * @return + */ + static TInt GetPropertyValueL( TUint32 aKey ); + + /** + * For internal usage only. Use direct getters/setters for each setting. + * + * @param + * @return + */ + static HBufC16* GetPropertyValueLC( TUint32 aKey ); + + /** + * For internal usage only. Use direct getters/setters for each setting. + * + * @param + * @param + */ + static void SetPropertyValueL( TUint32 aKey, const TDesC& aValue ); + + /** + * For internal usage only. Use direct getters/setters for each setting. + * + * @param + * @param + */ + static void SetPropertyValueL( TUint32 aKey, TInt aValue ); + + /** + * If Encoding device set to KMusDisableAVC (0x0fffffff) returns ETrue + * else otherwise. + * Means AVC will be disabled when encoding device cenrep configuration + * set to 0x0fffffff. + */ + static TBool IsAvcDisabled(); + + }; + +#include "mussettings.inl" + +#endif // MUSSETTINGS_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 inc/mussettings.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/inc/mussettings.inl Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,686 @@ +/* +* 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: ?Description +* Version : %version: 20 % << Don't touch! Updated by Synergy at check-out. +* +*/ + + +#ifndef MUSSETTINGS_INL +#define MUSSETTINGS_INL + +#include "mussettings.h" +#include "mussettingskeys.h" +#include "muslogger.h" +#include "mussipprofileutils.h" + +#include + +const TInt32 KMusDisableAVC = 0x0fffffff; + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline TInt MultimediaSharingSettings::GetPropertyValueL( TUint32 aKey ) + { + TInt value( KErrNotFound ); + + CRepository* repository = CRepository::NewLC( + MusSettingsKeys::KRepositoryUid ); + + User::LeaveIfError(repository->Get( aKey, value )); + + CleanupStack::PopAndDestroy( repository ); + + return value; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline void MultimediaSharingSettings::SetPropertyValueL( TUint32 aKey, + TInt aValue ) + { + CRepository* repository = CRepository::NewLC( + MusSettingsKeys::KRepositoryUid ); + + User::LeaveIfError(repository->Set( aKey, aValue )); + + CleanupStack::PopAndDestroy( repository ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline HBufC16* MultimediaSharingSettings::GetPropertyValueLC( TUint32 aKey ) + { + TBuf16 value; + + CRepository* repository = CRepository::NewLC( + MusSettingsKeys::KRepositoryUid ); + + User::LeaveIfError( repository->Get( aKey, value ) ); + + CleanupStack::PopAndDestroy( repository ); + + return value.AllocLC(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline void MultimediaSharingSettings::SetPropertyValueL( + TUint32 aKey, + const TDesC16& aValue ) + { + CRepository* repository = CRepository::NewLC( + MusSettingsKeys::KRepositoryUid ); + + User::LeaveIfError(repository->Set( aKey, aValue )); + + CleanupStack::PopAndDestroy( repository ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline MusSettingsKeys::TActivation + MultimediaSharingSettings::ActivationSettingL() + { + MUS_LOG( "mus: [MUSSET] -> MultimediaSharingSettings::ActivationSettingL()" ) + TInt value = GetPropertyValueL( MusSettingsKeys::KActivation ); + MUS_LOG1( "mus: [MUSSET] <- MultimediaSharingSettings::ActivationSettingL( %d )", + value ) + return ( MusSettingsKeys::TActivation ) value; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline void MultimediaSharingSettings::SetActivationSettingL( + MusSettingsKeys::TActivation aActivationSetting ) + { + MUS_LOG1( "mus: [MUSSET] -> MultimediaSharingSettings::SetActivationSettingL( %d )", + ( TInt ) aActivationSetting ) + SetPropertyValueL( MusSettingsKeys::KActivation, aActivationSetting ); + MUS_LOG( "mus: [MUSSET] <- MultimediaSharingSettings::SetActivationSettingL()" ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline MusSettingsKeys::TOperatorVariant + MultimediaSharingSettings::OperatorVariantSettingL() + { + MUS_LOG( "mus: [MUSSET] -> MultimediaSharingSettings::OperatorVariantSettingL()" ) + TInt value = GetPropertyValueL( MusSettingsKeys::KOperatorVariant ); + MUS_LOG1( "mus: [MUSSET] <- MultimediaSharingSettings::OperatorVariantSettingL( %d )", + value ) + return ( MusSettingsKeys::TOperatorVariant ) value; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline void MultimediaSharingSettings::SetOperatorVariantSettingL( + MusSettingsKeys::TOperatorVariant aVariantSetting ) + { + MUS_LOG1( "mus: [MUSSET] -> MultimediaSharingSettings::SetOperatorVariantSettingL( %d )", + ( TInt ) aVariantSetting ) + SetPropertyValueL( MusSettingsKeys::KOperatorVariant, ( TInt ) aVariantSetting ); + MUS_LOG( "mus: [MUSSET] <- MultimediaSharingSettings::SetOperatorVariantSettingL()" ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline MusSettingsKeys::TAuditoryNotification + MultimediaSharingSettings::AuditoryNotificationSettingL() + { + MUS_LOG( "mus: [MUSSET] -> MultimediaSharingSettings::AuditoryNotificationSettingL()" ) + TInt value = GetPropertyValueL( MusSettingsKeys::KAuditoryNotification ); + MUS_LOG1( "mus: [MUSSET] <- MultimediaSharingSettings::AuditoryNotificationSettingL( %d )", + value ) + return ( MusSettingsKeys::TAuditoryNotification ) value; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline void MultimediaSharingSettings::SetAuditoryNotificationSettingL( + MusSettingsKeys::TAuditoryNotification aNotificationSetting ) + { + MUS_LOG1( "mus: [MUSSET] -> MultimediaSharingSettings::SetAuditoryNotificationSettingL( %d )", + ( TInt ) aNotificationSetting ) + SetPropertyValueL( MusSettingsKeys::KAuditoryNotification, ( TInt ) aNotificationSetting ); + MUS_LOG( "mus: [MUSSET] <- MultimediaSharingSettings::SetAuditoryNotificationSettingL()" ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline MusSettingsKeys::TPopupNotification + MultimediaSharingSettings::PopupNotificationSettingL() + { + MUS_LOG( "mus: [MUSSET] -> MultimediaSharingSettings::PopupNotificationSettingL()" ) + TInt value = GetPropertyValueL( MusSettingsKeys::KPopupNotification ); + MUS_LOG1( "mus: [MUSSET] <- MultimediaSharingSettings::PopupNotificationSettingL( %d )", + value ) + return ( MusSettingsKeys::TPopupNotification ) value; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline void MultimediaSharingSettings::SetPopupNotificationSettingL( + MusSettingsKeys::TPopupNotification aNotificationSetting ) + { + MUS_LOG1( "mus: [MUSSET] -> MultimediaSharingSettings::SetPopupNotificationSettingL( %d )", + ( TInt ) aNotificationSetting ) + SetPropertyValueL( MusSettingsKeys::KPopupNotification, + ( TInt ) aNotificationSetting ); + MUS_LOG( "mus: [MUSSET] <- MultimediaSharingSettings::SetPopupNotificationSettingL()" ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline MusSettingsKeys::TPopupNotificationType + MultimediaSharingSettings::PopupNotificationTypeSettingL() + { + MUS_LOG( "mus: [MUSSET] -> MultimediaSharingSettings::PopupNotificationTypeSettingL()" ) + TInt value = GetPropertyValueL( MusSettingsKeys::KPopupNotificationType ); + MUS_LOG1( "mus: [MUSSET] <- MultimediaSharingSettings::PopupNotificationTypeSettingL( %d )", + value ) + return ( MusSettingsKeys::TPopupNotificationType ) value; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline void MultimediaSharingSettings::SetPopupNotificationTypeSettingL( + MusSettingsKeys::TPopupNotificationType aNotificationSetting ) + { + MUS_LOG1( "mus: [MUSSET] -> MultimediaSharingSettings::SetActivationSettingL( %d )", + ( TInt ) aNotificationSetting ) + SetPropertyValueL( MusSettingsKeys::KPopupNotificationType, ( TInt ) aNotificationSetting ); + MUS_LOG( "mus: [MUSSET] <- MultimediaSharingSettings::SetActivationSettingL()" ) + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline MusSettingsKeys::TEdgeDtmSupport + MultimediaSharingSettings::EdgeDtmSupportSettingL() + { + MUS_LOG( "mus: [MUSSET] -> MultimediaSharingSettings::EdgeDtmSupportSettingL()" ) + TInt value = GetPropertyValueL( MusSettingsKeys::KEdgeDtmSupport ); + MUS_LOG1( "mus: [MUSSET] <- MultimediaSharingSettings::EdgeDtmSupportSettingL( %d )", + value ) + return ( MusSettingsKeys::TEdgeDtmSupport ) value; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline void MultimediaSharingSettings::SetEdgeDtmSupportSettingL( + MusSettingsKeys::TEdgeDtmSupport aSetting ) + { + MUS_LOG1( "mus: [MUSSET] -> MultimediaSharingSettings::SetEdgeDtmSupportSettingL( %d )", + ( TInt ) aSetting ) + SetPropertyValueL( MusSettingsKeys::KEdgeDtmSupport, ( TInt ) aSetting ); + MUS_LOG( "mus: [MUSSET] <- MultimediaSharingSettings::SetEdgeDtmSupportSettingL()" ) + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline MusSettingsKeys::TForceInternetSignaling + MultimediaSharingSettings::ForceInternetSignalingSettingL() + { + MUS_LOG( "mus: [MUSSET] -> MultimediaSharingSettings::ForceInternetSignalingSettingL()" ) + TInt value = GetPropertyValueL( MusSettingsKeys::KForceInternetSignaling ); + MUS_LOG1( "mus: [MUSSET] <- MultimediaSharingSettings::ForceInternetSignalingSettingL( %d )", + value ) + return ( MusSettingsKeys::TForceInternetSignaling ) value; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline void MultimediaSharingSettings::SetForceInternetSignalingSettingL( + MusSettingsKeys::TForceInternetSignaling aSetting ) + { + MUS_LOG1( "mus: [MUSSET] -> MultimediaSharingSettings::SetSessionSetupMethodSettingL( %d )", + ( TInt ) aSetting ) + SetPropertyValueL( MusSettingsKeys::KForceInternetSignaling, ( TInt ) aSetting ); + MUS_LOG( "mus: [MUSSET] <- MultimediaSharingSettings::SetSessionSetupMethodSettingL()" ) + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline MusSettingsKeys::TAutoRecord + MultimediaSharingSettings::AutoRecordSettingL() + { + MUS_LOG( "mus: [MUSSET] -> MultimediaSharingSettings::AutoRecordSettingL()" ) + TInt value = GetPropertyValueL( MusSettingsKeys::KAutoRecord ); + MUS_LOG1( "mus: [MUSSET] <- MultimediaSharingSettings::AutoRecordSettingL( %d )", + value ) + return ( MusSettingsKeys::TAutoRecord ) value; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline void MultimediaSharingSettings::SetAutoRecordSettingL( + MusSettingsKeys::TAutoRecord aSetting ) + { + MUS_LOG1( "mus: [MUSSET] -> MultimediaSharingSettings::SetActivationSettingL( %d )", + ( TInt ) aSetting ) + SetPropertyValueL( MusSettingsKeys::KAutoRecord, ( TInt ) aSetting ); + MUS_LOG( "mus: [MUSSET] <- MultimediaSharingSettings::SetActivationSettingL()" ) + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline TInt MultimediaSharingSettings::VideoLocationSettingL() + { + MUS_LOG( "mus: [MUSSET] -> MultimediaSharingSettings::VideoLocationSettingL()" ) + TInt value = GetPropertyValueL( MusSettingsKeys::KVideoLocation ); + MUS_LOG1( "mus: [MUSSET] <- MultimediaSharingSettings::VideoLocationSettingL( %d )", + value ) + return value; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline void MultimediaSharingSettings::SetVideoLocationSettingL( + TInt aSetting ) + { + MUS_LOG1( "mus: [MUSSET] -> MultimediaSharingSettings::SetVideoLocationSettingL( %d )", + ( TInt ) aSetting ) + SetPropertyValueL( MusSettingsKeys::KVideoLocation, ( TInt ) aSetting ); + MUS_LOG( "mus: [MUSSET] <- MultimediaSharingSettings::SetVideoLocationSettingL()" ) + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline TInt MultimediaSharingSettings::SipProfileSettingL() + { + MUS_LOG( "mus: [MUSSET] -> MultimediaSharingSettings::SipProfileSettingL()" ) + TInt value = GetPropertyValueL( MusSettingsKeys::KSipProfileId ); + MUS_LOG1( "mus: [MUSSET] <- MultimediaSharingSettings::SipProfileSettingL( %d )", + value ) + return value; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline void MultimediaSharingSettings::SetSipProfileSettingL( TInt aSetting ) + { + MUS_LOG1( "mus: [MUSSET] -> MultimediaSharingSettings::SetSipProfileSettingL( %d )", + ( TInt ) aSetting ) + + TInt oldProfileId = GetPropertyValueL( MusSettingsKeys::KSipProfileId ); + + if( oldProfileId != KErrNotFound && oldProfileId != KErrNone ) + { + MusSipProfileUtils::RemoveContactHeaderL( oldProfileId ); + } + + SetPropertyValueL( MusSettingsKeys::KSipProfileId, ( TInt ) aSetting ); + + MusSipProfileUtils::InsertContactHeaderL( aSetting ); + + MUS_LOG( "mus: [MUSSET] <- MultimediaSharingSettings::SetSipProfileSettingL()" ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline MusSettingsKeys::TUiOrientation + MultimediaSharingSettings::UiOrientationSettingL() + { + MUS_LOG( "mus: [MUSSET] -> MultimediaSharingSettings::UiOrientationSettingL()" ) + TInt value = GetPropertyValueL( MusSettingsKeys::KUiOrientation ); + MUS_LOG1( "mus: [MUSSET] <- MultimediaSharingSettings::UiOrientationSettingL( %d )", + value ) + return ( MusSettingsKeys::TUiOrientation ) value; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline void MultimediaSharingSettings::SetUiOrientationSettingL( + MusSettingsKeys::TUiOrientation aOrientationSetting ) + { + MUS_LOG1( "mus: [MUSSET] -> MultimediaSharingSettings::SetActivationSettingL( %d )", + ( TInt ) aOrientationSetting ) + SetPropertyValueL( MusSettingsKeys::KUiOrientation, + ( TInt ) aOrientationSetting ); + MUS_LOG( "mus: [MUSSET] <- MultimediaSharingSettings::SetActivationSettingL()" ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline MusSettingsKeys::TCapabilityQuery + MultimediaSharingSettings::CapabilityQuerySettingL() + { + MUS_LOG( "mus: [MUSSET] -> MultimediaSharingSettings::CapabilityQuerySettingL()" ) + TInt value = GetPropertyValueL( MusSettingsKeys::KCapabilityQuery ); + MUS_LOG1( "mus: [MUSSET] <- MultimediaSharingSettings::CapabilityQuerySettingL( %d )", + value ) + return ( MusSettingsKeys::TCapabilityQuery ) value; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline void MultimediaSharingSettings::SetCapabilityQuerySettingL( + MusSettingsKeys::TCapabilityQuery aOrientationSetting ) + { + MUS_LOG1( "mus: [MUSSET] -> MultimediaSharingSettings::SetActivationSettingL( %d )", + ( TInt ) aOrientationSetting ) + SetPropertyValueL( MusSettingsKeys::KCapabilityQuery, + ( TInt ) aOrientationSetting ); + MUS_LOG( "mus: [MUSSET] <- MultimediaSharingSettings::SetActivationSettingL()" ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline void MultimediaSharingSettings::ResourceAvailability( + MusSettingsKeys::TAvailability &aCamera, + MusSettingsKeys::TAvailability &aKeypad) + { + MUS_LOG( "mus: [MUSSET] -> MultimediaSharingSettings::ResourceAvailability()" ) + TInt value = GetPropertyValueL( MusSettingsKeys::KProductModeVariation ); + // count 3 bit ,bit->100 = 4 (int) for camera + aCamera = (value&4) ? MusSettingsKeys::EAvailabilityDynamic + : MusSettingsKeys::EAvailabilityStatic; + // count 6 bit ,bit->100000 = 32 (int) for keypad + aKeypad = (value&32) ? MusSettingsKeys::EAvailabilityDynamic + : MusSettingsKeys::EAvailabilityStatic; + + MUS_LOG2( "mus: [MUSSET] <- MultimediaSharingSettings::ResourceAvailability \ + Camera = %d, Keypad = %d", aCamera,aKeypad) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline void MultimediaSharingSettings::ResourceUsability( + MusSettingsKeys::TUsability &aCamera, + MusSettingsKeys::TUsability &aKeypad, + MusSettingsKeys::TUsability &aVideoplayer) + { + MUS_LOG( "mus: [MUSSET] -> MultimediaSharingSettings::ResourceUsability()" ) + TInt value = GetPropertyValueL( MusSettingsKeys::KProductModeVariation ); + MUS_LOG1( "mus: [MUSSET] product mode variation cenrep Key value = %d",value ) + // Mask bit 1&2 with 11=3 + TInt tempValue = value&3 ; + aCamera = (tempValue < 3) ? ( MusSettingsKeys::TUsability )tempValue + : MusSettingsKeys::EUsabilityAlways; + + // Left shift 3 bits and mask bit 1&2 with 11=3 so we get bits for keypad + value = value >> 3; + tempValue = value&3 ; + aKeypad = ( tempValue < 3 ) ? ( MusSettingsKeys::TUsability ) tempValue + : MusSettingsKeys::EUsabilityAlways; + + // Left shift again 3 bits mask bit 1&2 with 11=3,so we get bits for videoplayer + value = value >> 3; + tempValue = value&3 ; + aVideoplayer = ( tempValue < 3 ) ? ( MusSettingsKeys::TUsability )tempValue + : MusSettingsKeys::EUsabilityAlways; + + MUS_LOG3( "mus: [MUSSET] Camera = %d, Keypad = %d,Videoplayer = %d",\ + aCamera,aKeypad,aVideoplayer ) + MUS_LOG( "mus: [MUSSET] <- MultimediaSharingSettings::ResourceUsability()" ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline HBufC8* MultimediaSharingSettings::EncoderConfigInfoLC() + { + MUS_LOG( "mus: [MUSSET] -> MultimediaSharingSettings::EncoderConfigInfoLC()" ) + + TBuf8 keys; + + CRepository* repository = CRepository::NewLC( + MusSettingsKeys::KRepositoryUid ); + + User::LeaveIfError( repository->Get( + MusSettingsKeys::KEncoderConfigurationInfo, + keys ) ); + + CleanupStack::PopAndDestroy( repository ); + + MUS_LOG_TDESC8( "mus: [MUSSET] Keys: ", keys ) + MUS_LOG( "mus: [MUSSET] <- MultimediaSharingSettings::EncoderConfigInfoLC()" ) + + return keys.AllocLC(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline void MultimediaSharingSettings::SetEncoderConfigInfoL( + const TDesC8& aConfigKeys ) + { + MUS_LOG( "mus: [MUSSET] -> MultimediaSharingSettings::SetEncoderConfigInfoL()" ) + + CRepository* repository = CRepository::NewLC( + MusSettingsKeys::KRepositoryUid ); + + User::LeaveIfError( repository->Set( + MusSettingsKeys::KEncoderConfigurationInfo, + aConfigKeys ) ); + + CleanupStack::PopAndDestroy( repository ); + + MUS_LOG( "mus: [MUSSET] <- MultimediaSharingSettings::SetEncoderConfigInfoL()" ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline TUid MultimediaSharingSettings::EncodingDeviceL() + { + MUS_LOG( "mus: [MUSSET] -> MultimediaSharingSettings::EncodingDeviceL()" ) + + TInt value = GetPropertyValueL( MusSettingsKeys::KEncodingDevice ); + + MUS_LOG( "mus: [MUSSET] <- MultimediaSharingSettings::EncodingDeviceL()") + + return TUid::Uid( value ); + } + +// ----------------------------------------------------------------------------- +// Returns the cenrep configured value for KAllowOnlyWithActiveCSCall key. +// ----------------------------------------------------------------------------- +// +inline MusSettingsKeys::TAllowedCSOnly + MultimediaSharingSettings::AllowedCSOnlySettingL() + { + MUS_LOG( "mus: [MUSSET] -> MultimediaSharingSettings::AllowedCSOnlySettingL()" ) + TInt value = GetPropertyValueL( MusSettingsKeys::KAllowOnlyWithActiveCSCall ); + MUS_LOG1( "mus: [MUSSET] <- MultimediaSharingSettings::AllowedCSOnlySettingL( %d )", + value ) + return ( MusSettingsKeys::TAllowedCSOnly ) value; + } + +// ----------------------------------------------------------------------------- +// Returns the cenrep configured value for KAllowOnlyIn3GNetwork key. +// ----------------------------------------------------------------------------- +// +inline MusSettingsKeys::TAllowed3GOnly + MultimediaSharingSettings::Allowed3GOnlySettingL() + { + MUS_LOG( "mus: [MUSSET] -> MultimediaSharingSettings::Allowed3GOnlySettingL()" ) + TInt value = GetPropertyValueL( MusSettingsKeys::KAllowOnlyIn3GNetwork ); + MUS_LOG1( "mus: [MUSSET] <- MultimediaSharingSettings::Allowed3GOnlySettingL( %d )", + value ) + return ( MusSettingsKeys::TAllowed3GOnly ) value; + } + + +// ----------------------------------------------------------------------------- +// Returns the cenrep configured value for KCameraUsage key. +// ----------------------------------------------------------------------------- +// +inline MusSettingsKeys::TUseCamera + MultimediaSharingSettings::CameraUsageL() + { + MUS_LOG( "mus: [MUSSET] -> MultimediaSharingSettings::CameraUsageL()" ) + TInt value = GetPropertyValueL( MusSettingsKeys::KCameraUsage ); + MUS_LOG1( "mus: [MUSSET] <- MultimediaSharingSettings::CameraUsageL( %d )", + value ) + return ( MusSettingsKeys::TUseCamera ) value; + } + + +// ----------------------------------------------------------------------------- +// Returns the cenrep configured value for KVideoDirection key. +// ----------------------------------------------------------------------------- +inline MusSettingsKeys::TVideoDirection + MultimediaSharingSettings::VideoDirectionL() + { + MUS_LOG( "mus: [MUSSET] -> MultimediaSharingSettings::VideoDirectionL()" ) + TInt value = GetPropertyValueL( MusSettingsKeys::KVideoDirection ); + MUS_LOG1( "mus: [MUSSET] <- MultimediaSharingSettings::VideoDirectionL( %d )", + value ) + return ( MusSettingsKeys::TVideoDirection ) value; + } + +// ----------------------------------------------------------------------------- +// Returns the cenrep configured value for KVideoBandwidth key. +// ----------------------------------------------------------------------------- +inline TInt MultimediaSharingSettings::VideoBandwidthSettingL() + { + MUS_LOG( "mus: [MUSSET] -> MultimediaSharingSettings::VideoBandwidthSettingL()" ) + TInt value = GetPropertyValueL( MusSettingsKeys::KVideoBandwidth ); + MUS_LOG1( "mus: [MUSSET] <- MultimediaSharingSettings::VideoBandwidthSettingL( %d )", + value ) + return value; + } + +// ----------------------------------------------------------------------------- +// Returns the cenrep configured value for KFastStartupMode key. +// ----------------------------------------------------------------------------- +inline MusSettingsKeys::TFastMode + MultimediaSharingSettings::FastStartupModeL() + { + MUS_LOG( "mus: [MUSSET] -> MultimediaSharingSettings::FastStartupModeL()" ) + TInt value = GetPropertyValueL( MusSettingsKeys::KFastStartupMode ); + MUS_LOG1( "mus: [MUSSET] <- MultimediaSharingSettings::FastStartupModeL( %d )", + value ) + return ( MusSettingsKeys::TFastMode ) value; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline TBool MultimediaSharingSettings::IsAvcDisabled() + { + MUS_LOG( "mus: [MUSSET] -> MultimediaSharingSettings::IsAvcDisabled()" ) + TInt value = 0; + TRAPD(err, value =GetPropertyValueL( MusSettingsKeys::KEncodingDevice )); + if( err==KErrNone && value == KMusDisableAVC ) + { + MUS_LOG( "mus: [MUSSET] <- MultimediaSharingSettings::IsAvcDisabled() true") + return ETrue; + } + MUS_LOG( "mus: [MUSSET] <- MultimediaSharingSettings::IsAvcDisabled() false") + return EFalse; + } + +#endif // MUSSETTINGS_INL diff -r e8be2c2e049d -r 7a2f5f2dfe61 inc/mussipobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/inc/mussipobserver.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,61 @@ +/* +* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 observer class for monitoring SIP profiles. +* +*/ + + +#ifndef MMUSSIPOBSERVER_H +#define MMUSSIPOBSERVER_H + +#include +#include + +/** +* @publishedAll +* @released +* +* The observer class for monitoring SIP profiles. +* Class must be implemented by the user in order to +* observe changes in the SIP profiles. +*/ +class MMusSipObserver : public MSIPObserver + { +public: // from MSIPObserver + + /** + * A SIP request has been received from the network. + * This function is called when the SIP request was received using such + * an IAP, for which the application has not created a CSIPConnection + * object. + * @pre aTransaction != 0 + * @param aIapId The IapId from which the SIP request was received. + * @param aTransaction contains local address, remote address of a SIP + * message, as well as optional SIP message method, headers and + * body. The ownership is transferred. + */ + virtual void IncomingRequest( TUint32 /*aIapId*/, + CSIPServerTransaction* /*aTransaction*/ ) { } + + /** + * The received SIP request time-outed and it is invalid i.e. cannot be used + * anymore. + * This will be called if the user fails to create a SIP connection and + * does not send an appropriate SIP response. + * @param aTransaction The time-outed transaction. + */ + virtual void TimedOut(CSIPServerTransaction& /*aTransaction*/ ) { } + }; + +#endif // MMUSSIPOBSERVER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 inc/mussipprofileregistryobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/inc/mussipprofileregistryobserver.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,57 @@ +/* +* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 observer class for monitoring SIP profiles. +* +*/ + + +#ifndef MMUSSIPPROFILEREGISTRYOBSERVER_H +#define MMUSSIPPROFILEREGISTRYOBSERVER_H + +#include +#include + +/** +* @publishedAll +* @released +* +* The observer class for monitoring SIP profiles. +* Class must be implemented by the user in order to +* observe changes in the SIP profiles. +*/ +class MMusSipProfileRegistryObserver : public MSIPProfileRegistryObserver + { +public: // from MSIPProfileRegistryObserver + + /** + * An event related to SIP Profile has accorred + * @param aProfileId a profile Id + * @param aEvent an occurred event + **/ + virtual void ProfileRegistryEventOccurred( + TUint32 /*aProfileId*/, + MSIPProfileRegistryObserver::TEvent /*aEvent*/ ) { } + + /** + * An asynchronous error has occurred related to SIP profile + * Event is send to those observers, who have the + * corresponding profile instantiated. + * @param aProfileId the id of failed profile + * @param aError an occurred error + */ + virtual void ProfileRegistryErrorOccurred( TUint32 /*aProfileId*/, + TInt /*aError*/ ) { } + }; + +#endif // MMUSSIPPROFILEREGISTRYOBSERVER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 inc/mussipprofileutils.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/inc/mussipprofileutils.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,71 @@ +/* +* 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: This interface is used by +* clients to get and availability setting for Video Charging +* +*/ + + +#ifndef __MUSSIPPROFILEUTILS_H__ +#define __MUSSIPPROFILEUTILS_H__ + +// INCLUDES +#include "mussipprofileregistryobserver.h" +#include "mussipobserver.h" + +#include + +class CSIPManagedProfile; +class MDesC8Array; +class CDesC8ArrayFlat; + +/** + * Defines setting interface for the MusAvailability Plug-in + * + * ECOM clients set and get setting are used by MusAvailability Plug-in. + * + * @lib musavailabilityplugin.lib + */ + +class MusSipProfileUtils : public MMusSipProfileRegistryObserver, + public MMusSipObserver + { +public: + + inline static void InsertContactHeaderL( TInt aSipProfileId ); + + inline static void RemoveContactHeaderL( TInt aSipProfileId ); + +private: + + inline static void AddFeatureTagL( CSIPManagedProfile& aProfile ); + + inline static void RemoveFeatureTagL( CSIPManagedProfile& aProfile ); + + inline static CDesC8ArrayFlat* AddVsTagLC( const MDesC8Array& aArray ); + + inline static CDesC8ArrayFlat* RemoveVsTagLC( const MDesC8Array& aArray, TInt aIndex ); + + inline static TInt VsTagIndex( const MDesC8Array& aArray ); + + inline MusSipProfileUtils(); + + inline ~MusSipProfileUtils(); + + }; + +#include "mussipprofileutils.inl" + +#endif // __MUSSIPPROFILEUTILS_H__ + diff -r e8be2c2e049d -r 7a2f5f2dfe61 inc/mussipprofileutils.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/inc/mussipprofileutils.inl Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,257 @@ +/* +* 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: ECOM interface default implementation. +* +*/ + + +#ifndef MUSSIPPROFILEUTILS_INL +#define MUSSIPPROFILEUTILS_INL + +#include "musavasettings.h" +#include "muslogger.h" + +#include +#include +#include +#include + +_LIT8( KVsTag, "+g.3gpp.cs-voice" ); + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline TInt MusSipProfileUtils::VsTagIndex( const MDesC8Array& aArray ) + { + MUS_LOG( "mus: [MUSSET] -> MusSipProfileUtils::VsTagIndex( )" ) + + for( TInt i(0); iAppendL( aArray.MdcaPoint( i ) ); + } + array->AppendL( KVsTag() ); + + return array; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline CDesC8ArrayFlat* MusSipProfileUtils::RemoveVsTagLC( + const MDesC8Array& aArray, + TInt aIndex ) + { + CDesC8ArrayFlat* array + = new( ELeave ) CDesC8ArrayFlat( aArray.MdcaCount() + 1 ); + CleanupStack::PushL( array ); + + for( TInt i(0); iAppendL( aArray.MdcaPoint( i ) ); + } + } + return array; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// + +inline void MusSipProfileUtils::RemoveFeatureTagL( CSIPManagedProfile& aProfile ) + { + //MDesC8Array* params; + const MDesC8Array* params; + + aProfile.GetParameter( KSIPContactHeaderParams, params ); + + MUS_LOG( "mus: [MUSSET] Handling contact header params" ) + + TInt index( KErrNotFound ); + if( params ) + { + index = MusSipProfileUtils::VsTagIndex( *params ); + + if( index != KErrNotFound ) + { + MUS_LOG( "mus: [MUSSET] No VS-specific contact header param set yet, setting it..." ) + const CDesC8ArrayFlat* newParams + = RemoveVsTagLC( *params, index ); + aProfile.SetParameter( KSIPContactHeaderParams, + *newParams ); + CleanupStack::PopAndDestroy(); + } + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline void MusSipProfileUtils::AddFeatureTagL( CSIPManagedProfile& aProfile ) + { + const MDesC8Array* params; + + aProfile.GetParameter( KSIPContactHeaderParams, params ); + + MUS_LOG( "mus: [MUSSET] Handling contact header params" ) + + TInt index( KErrNotFound ); + if( params ) + { + index = MusSipProfileUtils::VsTagIndex( *params ); + + if( index == KErrNotFound ) + { + MUS_LOG( "mus: [MUSSET] No VS-specific contact header param set yet, setting it..." ) + const CDesC8ArrayFlat* newParams + = AddVsTagLC( *params ); + aProfile.SetParameter( KSIPContactHeaderParams, + *newParams ); + CleanupStack::PopAndDestroy(); + } + } + + if( !params ) + { + MUS_LOG( "mus: [MUSSET] No VS-specific contact header param set yet, setting it..." ) + CDesC8ArrayFlat* newParams + = new( ELeave ) CDesC8ArrayFlat( 1 ); + CleanupStack::PushL( newParams ); + newParams->AppendL( KVsTag() ); + aProfile.SetParameter( KSIPContactHeaderParams, + *newParams ); + CleanupStack::PopAndDestroy(); + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline void MusSipProfileUtils::InsertContactHeaderL( TInt aSipProfileId ) + { + MUS_LOG1( "mus: [MUSSET] -> MusSipProfileUtils::InsertContactHeaderL( %d )", + aSipProfileId ) + MusSipProfileUtils* utils = new( ELeave ) MusSipProfileUtils(); + + CleanupStack::PushL( utils ); + + MUS_LOG( "mus: [MUSSET] Opening SIP profile registry" ) + + CSIPManagedProfileRegistry* registry + = CSIPManagedProfileRegistry::NewLC( *utils ); + + MUS_LOG1( "mus: [MUSSET] Looking for profile for id %d", + aSipProfileId ) + + CSIPManagedProfile* profile = NULL; + + TRAPD( err, profile = static_cast< CSIPManagedProfile* >( + registry->ProfileL( aSipProfileId ) ) ); + if ( err == KErrNone ) + { + CleanupStack::PushL( profile ); + MUS_LOG( "mus: [MUSSET] Corresponding profile found" ) + AddFeatureTagL( *profile ); + registry->SaveL( *profile ); + CleanupStack::PopAndDestroy( profile ); + } + CleanupStack::PopAndDestroy( registry ); + CleanupStack::PopAndDestroy( utils ); + + MUS_LOG( "mus: [MUSSET] <- MusSipProfileUtils::InsertContactHeaderL()" ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline void MusSipProfileUtils::RemoveContactHeaderL( TInt aSipProfileId ) + { + MUS_LOG1( "mus: [MUSSET] -> MusSipProfileUtils::RemoveContactHeaderL( %d )", + aSipProfileId ) + MusSipProfileUtils* utils = new( ELeave ) MusSipProfileUtils(); + + CleanupStack::PushL( utils ); + + CSIPManagedProfileRegistry* registry = + CSIPManagedProfileRegistry::NewLC( *utils ); + + CSIPManagedProfile* profile = NULL; + + TRAPD( err, profile = static_cast< CSIPManagedProfile* > + ( registry->ProfileL( aSipProfileId ) ) ); + if ( err == KErrNone ) + { + CleanupStack::PushL( profile ); + MUS_LOG( "mus: [MUSSET] Corresponding profile found" ) + RemoveFeatureTagL( *profile ); + registry->SaveL( *profile ); + CleanupStack::PopAndDestroy( profile ); + } + + CleanupStack::PopAndDestroy( registry ); + CleanupStack::PopAndDestroy( utils ); + MUS_LOG( "mus: [MUSSET] <- MusSipProfileUtils::RemoveContactHeaderL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline MusSipProfileUtils::MusSipProfileUtils() + { + + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +inline MusSipProfileUtils::~MusSipProfileUtils() + { + + } + +#endif // MUSSIPPROFILEUTILS_INL diff -r e8be2c2e049d -r 7a2f5f2dfe61 inc/mussoundplayerobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/inc/mussoundplayerobserver.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,47 @@ +/* +* 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 interface for CMusSoundPlayer. +* +*/ + + + +#ifndef M_MUSSOUNDPLAYEROBSERVER_H +#define M_MUSSOUNDPLAYEROBSERVER_H + + +#include + + +/** + * Observer interface for CMusSoundPlayer. + * Provides notify of sound playing status. + * + * @lib musindicator.lib + */ +class MMusSoundPlayerObserver + { +public: + + /** + * Notifies of sound playing complete. + * + * @param aError Errorcode associated with playback. + */ + virtual void PlaySoundComplete( TInt aError ) = 0; + + }; + + +#endif // M_MUSSOUNDPLAYEROBSERVER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 inc/musuid.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/inc/musuid.hrh Thu Jul 22 16:32:26 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: ?Description +* +*/ + + +#ifndef MUSUID_HRH +#define MUSUID_HRH + +// uids of the mus binaries + +#define KMusAiwProviderUid 0x10282389 +#define KMusSipCrPluginUid 0x1028238A +#define KMusAoPluginUid 0x1028238B +#define KMusManagerClientUid 0x1028238C +#define KMusManagerServerUid 0x1028238D +#define KMusAvaPluginUid 0x1028238E +#define KMusSettingsUiUid 0x1028238F +#define KMusWpAdapterUid 0x10282390 +#define KMusUiUid 0x10282391 +#define KMusEngineUid 0x10282392 +#define KMusIndicatorUid 0x10282396 + +// interface identifier of availability plug-in + +#define KMusAvaPluginInterfaceUid 0x10282393 + +#endif + +//end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 inc/musunittesting.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/inc/musunittesting.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,36 @@ +/* +* 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: ?Description +* +*/ + + + +#ifndef MUSUNITTESTING_H +#define MUSUNITTESTING_H + +#ifdef UNIT_TESTING // if unit testing + + #define MUS_UNITTEST( aClassName ) friend class aClassName; + +#else + + #define MUS_UNITTEST( aClassName ) + +#endif // UNIT_TESTING + + +#endif // MUSUNITTESTING_H + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 inc/musversionnumbers.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/inc/musversionnumbers.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,35 @@ +/* +* 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: ?Description +* +*/ + + +#ifndef MUSVERSIONNUMBERS_HRH +#define MUSVERSIONNUMBERS_HRH + + +/** Binary version number to be used in MMSharing related mmp-files. Major + * version number can be changed only when there is binary break. + */ +#define KMusBinaryVersionNumber 10.0 + +/** ECom version number to be used in MMSharing related ECom registeration + * resource files. + * NOTE: Version number in ECom registeration resource file is saved as one + * byte, so 255 is the maximum version number. + */ +#define KMusEcomVersionNumber 1 + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 layers.sysdef.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/layers.sysdef.xml Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,19 @@ + + +]> + + + + + + + + + + + + + + + \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/Conf/multimediasharing.confml Binary file mmsharing/Conf/multimediasharing.confml has changed diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/Conf/multimediasharing_1028238B.crml Binary file mmsharing/Conf/multimediasharing_1028238B.crml has changed diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/cenrep/1028238b.txt Binary file mmsharing/cenrep/1028238b.txt has changed diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/cenrep/backup_registration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/cenrep/backup_registration.xml Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,7 @@ + + + + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/cenrep/keys_multimediasharing.xls Binary file mmsharing/cenrep/keys_multimediasharing.xls has changed diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/group/group.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/group/group.pro Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,36 @@ +# +# 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 += "../mmshshared/loc/mus.loc APP_LAYER_LOC_EXPORT_PATH(mus.loc)" + :BLD_INF_RULES.prj_exports += "../mmshshared/loc/musoperator.loc APP_LAYER_LOC_EXPORT_PATH(musoperator.loc)" + :BLD_INF_RULES.prj_exports += "../Conf/multimediasharing.confml APP_LAYER_CONFML(multimediasharing.confml)" + :BLD_INF_RULES.prj_exports += "../Conf/multimediasharing_1028238B.crml APP_LAYER_CRML(multimediasharing_1028238B.crml)" + :BLD_INF_RULES.prj_exports += "../cenrep/backup_registration.xml /epoc32/data/z/private/1028238D/backup_registration.xml" + + :BLD_INF_RULES.prj_mmpfiles += $$LITERAL_HASH"include \"../mmshavailability/group/bld.inf\"" + :BLD_INF_RULES.prj_mmpfiles += $$LITERAL_HASH"include \"../mmshindicator/group/bld.inf\"" + :BLD_INF_RULES.prj_mmpfiles += $$LITERAL_HASH"include \"../mmshmanagercli/group/bld.inf\"" + :BLD_INF_RULES.prj_mmpfiles += $$LITERAL_HASH"include \"../mmshmanagersrv/group/bld.inf\"" + :BLD_INF_RULES.prj_mmpfiles += $$LITERAL_HASH"include \"../mmshengine/group/bld.inf\"" +} + +SUBDIRS += ../livecommsui +SUBDIRS += ../mmshapp diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/inc/musavainterface.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/inc/musavainterface.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,147 @@ +/* +* Copyright (c) 2005-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: ECOM interface definition. This interface is used by +* clients to get availability for Video Charging +* +*/ + + + +#ifndef __MUSAVAINTERFACE_H__ +#define __MUSAVAINTERFACE_H__ + +// SYSTEM +#include "musavaobserver.h" +#include +#include + +class MMusAvaObserver; +class MMusAvaSettings; +class MMusAvaObserver; +class MMusAvaSettingsObserver; + + +/** + * Interface class definition + * + * ECOM interface definition for MusAvailability Plug-in + * + * @lib musavailabilityplugin.lib + * @since S60 v3.2 + */ + + +class CMusAvaInterface : public CBase + { +public: + + // Constructors and destructor + + /** + * Two-phased constructor + * + * @since S60 v3.2 + * @param aObserver Pointer to observer intercase + * @return Returns pointer to CMusAvaInterface object + */ + + static CMusAvaInterface* NewL(); + + /** + * Destructor + * + * @since S60 v3.2 + * @param + * @return + */ + virtual ~CMusAvaInterface(); + +public: + + /** + * Called by the ECOM framework when MusAvailability Plug-in is request + * retuns setting interface for the client. + * + * @since S60 v3.2 + * @return CMusAvaSettings + */ + virtual MMusAvaSettings& Settings() = 0; + + /** + * Called by the ECOM framework when MusAvailability Plug-in is for + * setting Observer interface for the client. + * + * @since S60 v3.2 + * @param aObserver Obser interface + * @return + */ + virtual void SetObserver( MMusAvaObserver& aObserver ) = 0; + + /** + * Called by the ECOM framework when MusAvailability Plug-in is for + * setting Observer interface for the client. + * + * @since S60 v3.2 + * @param aObserver MMusAvaObserver interface + */ + virtual void SetSettingsObserver( MMusAvaSettingsObserver& aObserver ) =0; + + + /** + * Called by the ECOM framework when MusAvailability Plug-in is request + * to investigate availabilites for the client. + * + * @since S60 v3.2 + * @param + * @return + */ + virtual void StartL() = 0; + + /** + * Called by the ECOM framework when MusAvailability Plug-in is request + * to stop investigate or monitoring availabilites for the client. + * + * @since S60 v3.2 + * @param + * @return + */ + virtual void Stop() = 0; + +// TBD: COMMENTS + virtual MMusAvaObserver::TAvailabilityName CurrentAvailability() = 0; // tbd:availabilityname + virtual MMusAvaObserver::TAvailabilityStatus AvailabilityStatus() = 0; + virtual TBool MinimumAvailability() = 0; + virtual TBool MandatoryAvailability() = 0; + virtual TBool ExtensionAvailability() = 0; + virtual TBool Available( MMusAvaObserver::TAvailabilityName aAvailability ) = 0; + virtual MMusAvaObserver::TAvailabilityStatus AvailabilityState( MMusAvaObserver::TAvailabilityName aAvailability ) = 0; + virtual void PrepareForReceivedInviteL() = 0; + +private: //Data + + /** + * Instance identifier key. When instance of an + * implementation is created by ECOM framework, the + * framework will assign UID for it. The UID is used in + * destructor to notify framework that this instance is + * being destroyed and resources can be released. + */ + TUid iDtor_ID_Key; + + }; + +#include "musavainterface.inl" + +#endif + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/inc/musavainterface.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/inc/musavainterface.inl Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,74 @@ +/* +* Copyright (c) 2005-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: ECOM interface default implementation. +* +*/ + + +//USER +#include "musavaobserver.h" +#include "musuid.hrh" +#include "muscleanupresetanddestroy.h" + +// --------------------------------------------------------------------------------- +// C++ Destructor. +// +// --------------------------------------------------------------------------------- +// +inline CMusAvaInterface::~CMusAvaInterface() + { + REComSession::DestroyedImplementation( iDtor_ID_Key ); + } + + +// --------------------------------------------------------------------------------- +// CMusAvaInterface::NewL +// Two-phased constructor. +// --------------------------------------------------------------------------------- +// +inline CMusAvaInterface* CMusAvaInterface::NewL() + + { + // Find implementation for our interface. + // - KClientInterfaceUid is the UID of our custom ECOM + // interface. + // - This call will leave, if the plugin architecture cannot find + // implementation. + // - The returned pointer points to one of our interface implementation + // instances. + RImplInfoPtrArray pluginArray; + MusCleanupResetAndDestroy::PushL( pluginArray ); + + TUid interfaceUid = { KMusAvaPluginInterfaceUid }; + + REComSession::ListImplementationsL( interfaceUid, pluginArray ); + + if( pluginArray.Count() > 0 ) + { + CImplementationInformation* info = pluginArray[ 0 ]; + TAny* interface = REComSession::CreateImplementationL( + info->ImplementationUid(), + _FOFF( CMusAvaInterface , iDtor_ID_Key ) ); + + CleanupStack::PopAndDestroy();//pluginArray + //pluginArray.ResetAndDestroy(); + return reinterpret_cast ( interface ); + } + + CleanupStack::PopAndDestroy();//pluginArray + User::Leave( KErrNotFound ); + // to avoid compiler warning + return NULL; + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/inc/musavaobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/inc/musavaobserver.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,166 @@ +/* +* Copyright (c) 2005-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: This observer is used by +* ECOM clients to get function call from the availability Plug-in +* +*/ + + + +#ifndef MMUSAVAOBSERVER +#define MMUSAVAOBSERVER + +#include + + +/** + * MusAvailability Observer base class + * + * Observer interface for ECOM clients. + * + * @lib musavailabilityplugin.lib + * @since S60 v3.2 + */ + +class MMusAvaObserver + { + +public: + + /** Status definition */ + enum TAvailabilityStatus + { + + /** Availability Error States */ + + /** Manual Activation*/ + EMusAvaManualActivation = -13, + /** Unsuccessfull response with response code 403 */ + EMusAvaFailureCode = -12, + + /** SIP options query not available. */ + EMusAvaOptionNotAvailable = -11, + + /** No SIP profile. */ + EMusAvaStatusNoSipProfile = -10, + + /** Not Registered / Registering failed. */ + EMusAvaStatusNotRegistered = -9, + + /** No Call. */ + EMusAvaStatusNoCall = -8, + + /** Call on hold. */ + EMusAvaStatusCallOnHold = -7, + + /** Call on hold. */ + EMusAvaStatusConferenceCall = -6, + + /** Connection error. */ + EMusAvaConnectionErr = -5, + + /** User not allow roaming. */ + EMusAvaRoamingError = -4, + + /** User not allow to start application. */ + EMusActivationError = -3, + + /** SIP Options returned a negative/erroneous result */ + EMusAvaNegativeSipOptions = -2, + + /** Network bearer type is insuitable. */ + EMusAvaNetworkType = -1, + + /** Availability States */ + + /** No availability query is made. */ + EMusAvaStatusNotExecuted = 0, + EMusAvaStatusInProgress = 1, + EMusAvaStatusAvailable = 2, + /** options query pending */ + EMusAvaStatusOptionsSent = 3, + /** options query is not sent */ + EMusAvaStatusOptionsNotSent = 4, + /** Edge/DTM is configured but unsupported */ + EMusAvaEdgeDtmStatusUnknown = 5, + + }; + + /** Status definition */ + enum TAvailabilityName + { + /** No defined.*/ + EMusAvaNameNotDefined, + + // Always on class availabilities -> + + /** Invite handler.*/ + EMusAvaInviteHandler, + + // Minimum class availabilities -> + + /** Default Option handler.*/ + EMusAvaDefaultOptionHandler, + + /** Settings Availability */ + EMusAvaNameSetting, + + /** Sipprofile must exist */ + EMusAvaNameSipprofileExist, + + /** NetworkStatus.*/ + EMusAvaNameNetworkStatus, + + /** ContactStatus.*/ + EMusAvaNameContactStatus, + + /** Bearer Status.*/ + EMusAvaBearerStatus, + + // Mandatory class availabilities -> + + /** Registration.*/ + EMusAvaNameRegistration, + + // Extension class availabilities -> + + /** Option handler.*/ + EMusAvaOptionHandler, + + // Full availability -> + + /** Full availability, all availabilities go */ + EMusAvaFullAvailability + }; + +public: + + /** + * Availability report + * + * @since S60 v3.2 + * @param aStatus New status for availability. + */ + virtual void AvailabilityChanged( + TAvailabilityName aName, + TAvailabilityStatus aStatus ) = 0; + + virtual void AvailabilityError( + TAvailabilityName aName, + TAvailabilityStatus aStatus ) = 0; + + }; + + +#endif //MMUSAVAOBSERVER diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/inc/musavasettingsobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/inc/musavasettingsobserver.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,60 @@ +/* +* Copyright (c) 2005-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: This interface is used by +* clients to get and availability setting for Video Charging +* +*/ + + +#ifndef __MUSAVASETTINGSOBSERVER_H__ +#define __MUSAVASETTINGSOBSERVER_H__ + +// INCLUDES +#include +#include + +#include "musmanagercommon.h" + +/** + * Defines setting interface for the MusAvailability Plug-in + * + * ECOM clients set and get setting are used by MusAvailability Plug-in. + * + * @lib musavailabilityplugin.lib + * @since S60 v3.2 + */ + +class MMusAvaSettingsObserver + { +public: + enum TApplicationState + { + EApplicationStateNotDefined, + EApplicationNotRunning, + EApplicationIsRunning + }; + +public: + + virtual TApplicationState ApplicationState() = 0; + + virtual TBool OptionAllowed() = 0; + + virtual void StartApplicationL( MultimediaSharing::TMusUseCase aUseCase ) = 0; + + }; + + +#endif // __MUSAVASETTINGSOBSERVER_H__ + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/inc/musmanageripccommon.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/inc/musmanageripccommon.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,113 @@ +/* +* 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: ?Description +* +*/ + + + +#ifndef MUSMANAGERIPCCOMMON_H +#define MUSMANAGERIPCCOMMON_H + +#include + +#include "musuid.hrh" + +_LIT( KMusManagerServerName,"musmanagerserver" ); +_LIT( KMusManagerServerFilename, "musmanagerserver" ); +_LIT( KMusManagerServerSemaphoreName, "musmanagerserverSemaphore" ); + +const TUid KServerUid3 = { KMusManagerServerUid }; + +#if (defined (__WINS__) || defined(__WINSCW__)) +static const TUint KServerMinHeapSize = 0x1000; // 4K +static const TUint KServerMaxHeapSize = 0x80000; // 512K (Should be enough) +#endif + +// The server version. +// A version must be specified when creating a session with the server +const TUint KMusManagerServerMajorVersionNumber=0; +const TUint KMusManagerServerMinorVersionNumber=1; +const TUint KMusManagerServerBuildVersionNumber=1; + +// A container for incoming buffer sizes +class TMusManagerMessageBufSizes + { +public: + + TMusManagerMessageBufSizes() + : iHeaderBufSize(0), + iContentBufSize(0) {} + + TMusManagerMessageBufSizes(TInt aHeaderBufSize, TInt aContentBufSize) + : iHeaderBufSize(aHeaderBufSize), + iContentBufSize(aContentBufSize) {} + + TMusManagerMessageBufSizes(const TMusManagerMessageBufSizes& aSizes) + : iHeaderBufSize(aSizes.iHeaderBufSize), + iContentBufSize(aSizes.iContentBufSize) {} + + TInt iHeaderBufSize; + TInt iContentBufSize; + }; + + +// Oper. codes used in passing IPC messages between C/S-client and C/S-server +enum TMusManagerIpcFunctions + { + // No capabilities required 0-3 + EMusManagerIpcAvailabilityQuery, // Asynchronous receive + EMusManagerIpcInvestigateAvailability, + EMusManagerIpcInvitationReceived, + EMusManagerIpcOptionsReceived, + EMusManagerIpcStartMultimediaSharing, + EMusManagerIpcStopMultimediaSharing, + EMusManagerIpcStartObservingAvailability, + EMusManagerIpcMonitorAvailability, + EMusManagerIpcCancelMonitoring, + EMusManagerIpcHandleCommand + }; + + +// Indexes used in IPC parameter array passed between C/S-client and C/S-server +// +// All the parameters except EMusManagerIpcArgMessage are packed into package buffers +// to enable IPC parameter in-out behaviour. +// +// NOTE: Remember to update the types in comments if the actual types change. +// +enum TMusManagerIpcArguments + { + EMusManagerIpcArgAvailability = 0, // Type: TUint32 + EMusManagerIpcArgChannelUid = 0, // Type: TUid + EMusManagerIpcArgUseCase = 0, // Type: TInt + EMusManagerIpcArgSipResponse = 1, // Type: TDes8/TDesC8 + EMusManagerIpcArgSipRequest = 1, // Type: TDesC8 + EMusManagerIpcArgBufSizes = 2, // Type: TMusManagerMessageBufSizes + EMusManagerIpcArgSipMessageContent = 2, // Type: TDes8/TDesC8 + EMusManagerIpcArgResolverUid = 3, // Type: TUid + EMusManagerIpcArgRequestStatus = 0, // Type: TRequestStatus + EMusManagerIpcArgAvailabilityStatus = 1, // Type: TAvailabilityStatus + EMusManagerIpcArgCommandType = 0 // Type: TCommandType + }; + +enum TMusManagerIpcResponses + { + EMusManagerChannelComplete = 1, + EMusManagerClientNotFound + }; + +#endif // MUSMANAGERIPCCOMMON_H + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/bwins/livecommsuiu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/bwins/livecommsuiu.def Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,5 @@ +EXPORTS + ?terminateSession@LcViewManager@@QAEXXZ @ 1 NONAME ; void LcViewManager::terminateSession(void) + ??1LcViewManager@@UAE@XZ @ 2 NONAME ; LcViewManager::~LcViewManager(void) + ??0LcViewManager@@QAE@ABVQString@@0@Z @ 3 NONAME ; LcViewManager::LcViewManager(class QString const &, class QString const &) + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/eabi/livecommsuiu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/eabi/livecommsuiu.def Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,8 @@ +EXPORTS + _ZN13LcViewManager16terminateSessionEv @ 1 NONAME + _ZN13LcViewManagerC1ERK7QStringS2_ @ 2 NONAME + _ZN13LcViewManagerC2ERK7QStringS2_ @ 3 NONAME + _ZN13LcViewManagerD0Ev @ 4 NONAME + _ZN13LcViewManagerD1Ev @ 5 NONAME + _ZN13LcViewManagerD2Ev @ 6 NONAME + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/inc/lceffecthandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/inc/lceffecthandler.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,96 @@ +/* +* 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 LCEFFECTHANDLER_H +#define LCEFFECTHANDLER_H + +#include +#include + +class HbWidget; +class LcUiEngine; + +/** + * + */ +class LcEffectHandler : public QObject +{ + Q_OBJECT + friend class UT_LcEffectHandler; + friend class UT_LcView; + +public: + + enum DissapperEffect{ + NormalDissappear, + DissappearToFlip + }; + + explicit LcEffectHandler(LcUiEngine& engine, + HbWidget* sharedVideo, + HbWidget* sharedVideoOverlay, + HbWidget* receivedVideo, + HbWidget* receivedVideoOverlay); + ~LcEffectHandler(); + + void setVisibility(HbWidget* widget, bool visible); + + void setDissappearEffect( LcEffectHandler::DissapperEffect aEffectType ); + + bool isSwapInProgress(); + + void startEffects(); + +signals: + void swapCompleted(); + void loadSwapLayout(); + +public slots: + + void showSendWindow(); + void showReceiveWindow(); + void hideSendWindow(); + void hideReceiveWindow(); + void windowAppearComplete( HbEffect::EffectStatus status ); + void windowDisappearComplete( HbEffect::EffectStatus status ); + void windowDisappearToFlipComplete( HbEffect::EffectStatus status ); + void windowFlipComplete( HbEffect::EffectStatus status ); + void windowSwapSharedComplete( HbEffect::EffectStatus status ); + void windowSwapReceivedComplete( HbEffect::EffectStatus status ); + void swap(); + +private: + void startEffect( HbWidget* widget, const char *effectId, const char *callBack = "" ); + bool isSharedVideoAtTop() const; + bool videosSideBySide() const; + void handleSwapCompletion(); + void initializeSwap(); + +private: //data + + LcUiEngine& mEngine; + HbWidget* mSharedVideo; + HbWidget* mSharedVideoOverlay; + HbWidget* mReceivedVideo; + HbWidget* mReceivedVideoOverlay; + + QString mEffectCallBack; + bool mSwapSharedCompleted; + bool mSwapReceivedCompleted; + bool mSwapInProgress; +}; + +#endif // LCEFFECTHANDLER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/inc/lcexport.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/inc/lcexport.h Thu Jul 22 16:32:26 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: +* +*/ +#ifndef LCEXPORT_H +#define LCEXPORT_H + +#include + +#if !defined(UNIT_TESTING) +#if !defined(LIVECOMMS_EXPORT) +#if defined(LIVECOMMSUI_LIB) +#define LIVECOMMS_EXPORT Q_DECL_EXPORT +#else +#define LIVECOMMS_EXPORT Q_DECL_IMPORT +#endif +#endif +#else +#define LIVECOMMS_EXPORT +#endif +#endif // LCEXPORT_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/inc/lclogger.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/inc/lclogger.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,104 @@ +/* +* 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: ?Description +* +*/ + + +#ifndef LCLOGGER_H +#define LCLOGGER_H + +#include + + +// Disabled PC_lint warning for "Undefined preprocessor variable 'UNIT_TESTING'" +//lint -e553 +#if ( !defined(_DEBUG) || defined(QT_NO_DEBUG_OUTPUT) ) // release or unit test build; no logs + +#define LC_QDEBUG( a ) +#define LC_QDEBUG_2( a, b) +#define LC_QDEBUG_3( a, b, c) +#define LC_QDEBUG_4( a, b, c, d) +#define LC_QWARNING( a ) +#define LC_QWARNING_2( a, b ) +#define LC_QCRITICAL( a ) +#define LC_QCRITICAL_2( a, b ) +#define LC_QCRITICAL_3( a, b, c) + +#else // debug build; logs + + +const char lcDebugPrefix[] = "Debug: "; +const char lcWarningPrefix[] = "Warning: "; +const char lcCriticalPrefix[] = "Critical: "; +const char lcFatalPrefix[] = "Fatal: "; + +#include // RDebug +#include +#include +#include +#include +#include + +const char lcLogFile[] = "C:/logs/mus/musdebug.txt";// MultimediaSharing logging file. + + +#define LC_QDEBUG( a )\ + qDebug() << a; + +#define LC_QDEBUG_2( a, b)\ + qDebug() << a << b; + +#define LC_QDEBUG_3( a, b, c)\ + qDebug() << a << b << c; + +#define LC_QDEBUG_4( a, b, c, d)\ + qDebug() << a << b << c << d; + +#define LC_QWARNING( a )\ + qWarning() << a; + +#define LC_QWARNING_2( a, b )\ + qWarning() << a << b; + +#define LC_QCRITICAL( a )\ + qCritical() << a; + +#define LC_QCRITICAL_2( a, b )\ + qCritical() << a << b; + +#define LC_QCRITICAL_3( a, b, c)\ + qCritical() << a << b << c; + + +// File logging can be disabled by commenting above definition. +#define LCUI_FILE_LOGGING_ENABLED + +#if ( defined __WINSCW__ ) || ( defined __WINS__ ) +// No sense to have file logging enabled in wins +#undef LCUI_FILE_LOGGING_ENABLED +#endif + +#ifdef LCUI_FILE_LOGGING_ENABLED +const bool lcFileLoggingEnabled = ETrue; +#else +const bool lcFileLoggingEnabled = EFalse; +#endif + + +#endif + +#endif // LCLOGGER_H + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/inc/lcuicomponentrepository.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/inc/lcuicomponentrepository.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,107 @@ +/* +* 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 LCUICOMPONENTREPOSITORY_H +#define LCUICOMPONENTREPOSITORY_H + +#include +#include +#include +#include + +class LcView; +class QAction; +class HbProgressDialog; +class HbDialog; +class LcUiEngine; +class HbMenu; +class HbMessageBox; + +class LcUiComponentRepository : public HbDocumentLoader +{ + friend class UT_LcUiComponentRepository; + +public: + + explicit LcUiComponentRepository(LcUiEngine& engine); + ~LcUiComponentRepository(); + +public: + + LcView* idleView(); + LcView* receiveView(); + LcView* receiveOnlyView(); + LcView* twowayView(); + LcView* sendView(); + LcView* allInOneView(); + + HbDialog* acceptQuery(); + HbProgressDialog* invitingNote(); + HbProgressDialog* waitingNote(); + HbDialog* recipientQuery(); + HbDialog* shareOwnVideoQuery(); + void sharedVideoContextMenuActions( HbMenu* menu, LcView& view ); + bool loadLayout( const QString& layoutName ); + // returns the currently loaded layout name + QString layout()const; + // returns the previously loaded layout name + QString previousLayout()const; + +private: //from HbDocumentLoader + + QObject *createObject(const QString& type, const QString &name); + +private: + + LcView* loadView( QObjectList& components, + const QString& viewId, + const QString& xmlFile ); + void connectActions( LcView& view ) const; + bool connect( QAction& hbAction, LcView& view ) const; + +private: + + QString mLastLoadedView; + + LcUiEngine& mEngine; + + QObjectList mIdleViewComponents; + QObjectList mReceiveViewComponents; + QObjectList mSendViewComponents; + QObjectList mTwowayViewComponents; + QObjectList mAllInOneViewComponents; + QObjectList mReceiveOnlyViewComponents; + + QHash* mSlots; + + LcView* mIdleView; + LcView* mReceiveView; + LcView* mSendView; + LcView* mTwowayView; + LcView* mAllInOneView; + LcView* mReceiveOnlyView; + + HbDialog* mAcceptQuery; + HbProgressDialog* mInvitingNote; + HbProgressDialog* mWaitingNote; + HbDialog* mRecipientQuery; + HbMessageBox* mShareOwnVideoQuery; + + QString mLayout; + QString mPreviousLayout; +}; + +#endif // LCUICOMPONENTREPOSITORY_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/inc/lcuidefs.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/inc/lcuidefs.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,161 @@ +/* +* 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 LCUIDEFS_H_ +#define LCUIDEFS_H_ + +#include + +class LcUtil { + +public: + + inline static void asyncSlotCall( QObject* instance, const char* slot ) + { + QMetaObject::invokeMethod(instance, slot, Qt::QueuedConnection ); + } + + inline static void asyncSlotCall( QObject* instance, const char* slot, QGenericArgument arg ) + { + QMetaObject::invokeMethod(instance, slot, Qt::QueuedConnection, arg ); + } +}; + +// Panic the current thread +#if ( defined __WINSCW__ ) || ( defined __WINS__ ) || ( defined __ARMV5__ ) +#include +#define LC_PANIC() User::Invariant() +#else +#define LC_PANIC() +#endif + +#define LC_MCC_WINDOW_FACTOR 50 + +#define LC_NOTE_ON_TOP 20 + +#define LC_NOTE_TIMEOUT 3000 + +#define DESC_TO_QSTRING( desc )\ + QString::fromRawData( reinterpret_cast(desc.Ptr()), desc.Length()); + +#define LC_INVITING "Inviting..." +#define LC_WAITING_VIDEO "Waiting for shared video..." +#define LC_OK "OK" +#define LC_CANCEL "Cancel" +#define LC_ACCEPT_SESSION "Accept incoming session from" +#define LC_RECIPIENT_QUERY "Enter recipient address:" + +#ifndef QT_TESTLIB_LIB +const char lcIdleViewFile[] = ":/xml/lcidleview.docml"; +const char lcReceiveViewFile[] = ":/xml/lcreceiveview.docml"; +const char lcReceiveOnlyViewFile[] = ":/xml/lcreceiveonlyview.docml"; +const char lcSendViewFile[] = ":/xml/lcsendview.docml"; +const char lcTwowayViewFile[] = ":/xml/lctwowayview.docml"; +const char lcAllInOneViewFile[] = ":/xml/lcvtview.docml"; +#else +const char lcIdleViewFile[] = "c:/lcidleview.docml"; +const char lcReceiveViewFile[] = "C:/lcreceiveview.docml"; +const char lcReceiveOnlyViewFile[] = "C:/lcreceiveonlyview.docml"; +const char lcSendViewFile[] = "C:/lcsendview.docml"; +const char lcTwowayViewFile[] = "C:/lctwowayview.docml"; +const char lcAllInOneViewFile[] = "C:/lcvtview.docml"; + +#endif + +const char lcLcViewTypeName[] = "LcView"; + +//view ids +const char lcViewIdleId[] = "lc_view_idle"; +const char lcViewReceiveId[] = "lc_view_recv"; +const char lcViewReceiveOnlyId[] = "lc_view_recvonly"; +const char lcViewSendId[] = "lc_view_send"; +const char lcViewTwowayId[] = "lc_view_twoway"; +const char lcViewAllInOneId[] = "lc_view_allinone"; + +//widget ids +const char lcIconContactId[] = "lc_icon_contact"; +const char lcLabelRecipientId[] = "lc_label_recipient"; +const char lcLabelDurationId[] = "lc_label_duration"; +const char lcWidgetRecvVideoId[] = "lc_widget_recvvideo"; +const char lcWidgetSendVideoId[] = "lc_widget_sendvideo"; +const char lcWidgetRecvVideoId2[] = "lc_widget_recvvideo2"; +const char lcWidgetSendVideoId2[] = "lc_widget_sendvideo2"; +const char lcButtonEndCall[] = "lc_button_endCall"; +const char lcWidgetDialpad[] = "lc_label_dialpad"; + +//action ids +const char lcActFullscreenId[] = "lc_act_fullscreen"; +const char lcActVideopreferenceId[] = "lc_act_videopreference"; +const char lcActDialerId[] = "lc_act_dialer"; +const char lcActEndactivecallId[] = "lc_act_endactivecall"; +const char lcActStopSharingId[] = "lc_act_stopsharing"; +const char lcActEnableCameraId[] = "lc_act_enablecamera"; +const char lcActMuteId[] = "lc_act_mute"; +const char lcActGalleryId[] = "lc_act_gallery"; +const char lcActChangeCameraId[] = "lc_act_changecamera"; +const char lcActMenuChangeCameraId[] = "lc_act_menu_changecamera"; +const char lcActAdjustVideoId[] = "lc_act_adjustvideo"; +const char lcActShareImageId[] = "lc_act_shareimage"; +const char lcActSwapViewsId[] = "lc_act_swapviews"; +const char lcActSwitchToVoiceCallId[] = "lc_act_switchtovoicecall"; +const char lcActDisableCameraId[] = "lc_act_disablecamera"; +const char lcActMenuDisableCameraId[] = "lc_act_menu_disablecamera"; +const char lcActSpeakerId[] = "lc_act_speaker"; +const char lcActOpenKeypadId[] = "lc_act_openkeypad"; + + +//layouts ids +const char lcLayoutLandscapeDefaultId[] = "landscape"; //Main window - received content +const char lcLayoutFullscreenId[] = "fullscreen"; +const char lcLayoutLandscapeSwappedId[] = "lc_layout_landscape_swapped";//Main window - sent content +const char lcLayoutLandscapeDialpadId[] = "lc_layout_landscape_dialpad"; // Dialpad layout + + +//translations Id +const char lcTranslationsDirectory[] = ":/translations"; +const char lcTranslationsFileNameDefault[] = "livecommsui_en_GB"; +const char lcTranslationsFileName[] = "livecommsui_"; + +//icon names +const char lcIconNameUnmuteMic[] = "qtg_mono_mic_unmute"; +const char lcIconNameMuteMic[] = "qtg_mono_mic_mute"; +const char lcIconNameHandset[] = "qtg_mono_mobile"; +const char lcIconNameLoudspeaker[] = "qtg_mono_speaker"; +const char lcIconNameMainCamera[] = "qtg_mono_change_cam_mode"; +const char lcIconNameSecondaryCamera[] = "qtg_mono_change_cam_mode"; +const char lcIconNameEnableCamera[] = "qtg_mono_camcorder"; +const char lcIconNameDisableCamera[] = "qtg_mono_camcorder_off"; + +const char lcIconNameBlackWin[] = ":/black_win.bmp"; + + +//effects +const char lcEffectWinAppear[] = ":/win_appear.fxml"; +const char lcEffectWinDisappear[] = ":/win_disappear.fxml"; +const char lcEffectWinFlip[] = ":/win_flip.fxml"; +const char lcEffectWinSwapDown[] = ":/win_swap_down.fxml"; +const char lcEffectWinSwapUp[] = ":/win_swap_up.fxml"; + +const char lcEffectWinId[] = "vidwindow"; +const char lcEffectWinAppearId[] = "appear"; +const char lcEffectWinDisappearId[] = "disappear"; +const char lcEffectWinFlipId[] = "flip"; +const char lcEffectWinSwapDownId[] = "swapDown"; +const char lcEffectWinSwapUpId[] = "swapUp"; + +const char lcEffectWinDefaultCallback[] = "windowDisappearComplete"; + +#endif /* LCUIDEFS_H_ */ diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/inc/lcvideowidget.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/inc/lcvideowidget.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,43 @@ +/* +* 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 LCVIDEOWIDGET_H +#define LCVIDEOWIDGET_H + +#include + + +class LcVideoWidget : public HbTransparentWindow +{ + Q_OBJECT + +public: + + explicit LcVideoWidget(QGraphicsItem *parent = 0, bool showVideo = true); + ~LcVideoWidget(); + void setShowVideo(bool showVideo); + bool isShowingVideo(); + void setLocalPlayer(bool local){mLocalPlayer = local ;}; + +public: // From HbTransparentWindow + void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, + QWidget *widget = 0); +private: + bool mShowVideo; + bool mLocalPlayer; +}; + +#endif // LCVIDEOWIDGET_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/inc/lcview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/inc/lcview.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,151 @@ +/* +* 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 LCVIEW_H +#define LCVIEW_H + +#include + +//temp +#define LC_UNMUTE_TEXT "Unmute" +#define LC_MUTE_TEXT "Mute" +#define LC_HANDSET_TEXT "Handset" +#define LC_SPEAKER_TEXT "Speaker" + +class LcUiEngine; +class LcUiComponentRepository; +class HbLabel; +class HbMessageBox; +class HbAction; +class HbPushButton; +class HbTransparentWindow; +class HbMenu; +class LcVideoWidget; +class LcEffectHandler; +class Dialpad; +class DialpadVtKeyHandler; + +class LcView : public HbView +{ + Q_OBJECT + friend class UT_LcView; + friend class UT_LcUiComponentRepository; + +public: + + explicit LcView(LcUiEngine& engine, LcUiComponentRepository& repository); + ~LcView(); + +public: + + void init(); + void activated(); + void deactivated(); + QString currentLayout(); + +public slots: + + void endVideoSession(); + void disableCamera(); + void mute(); + void changeCamera(); + void switchToVoiceCall(); + void speaker(); + void updateVideoRects(); + void swap(); + void shareImage(); + void updateSwapLayout(); + void menuAboutToShow(); + void back(); +//temp + void notSupported(); + +private slots: + + void setMuteActionToUnmute(); + void setMuteActionToMute(); + void setCameraActionToMain(); + void setCameraActionToSecondary(); + void setSpeakerActionToHandset(); + void setSpeakerActionToSpeaker(); + void setCameraActionToDisable(); + void setCameraActionToEnable(); + void disableControls(); + void enableControls(); + void watchInactivity(); + +protected: // From HbView + + void gestureEvent(QGestureEvent *event); + +protected slots: + void openDialpad(); + virtual void dialpadOpened(); + virtual void dialpadClosed(); + virtual void dialpadEditorTextChanged(); + +protected: + void setDialpadPosition(); + +private: // fullscreen + void timerEvent( QTimerEvent * event ); + void toFullScreen( bool fullscreen ); + +private: + void createNotSupportedNote(); + void createContextMenu(); + QRectF translateRectForOrientation(const QRectF& origRect); + QPointF translatePointForOrientation(const QPointF& origPoint); + void setVisibility( QGraphicsItem* item, bool visible ); + void addOptionsMenuActions(); + void gestureLongPress( QPointF coords ); + void gestureShortPress(); + bool isVideoPositionedCorrectly( LcVideoWidget* mVideoWidget ); + bool isPositioned(); + +private://not owned + + LcUiEngine& mEngine; + LcUiComponentRepository& mRepository; + HbLabel* mRecipient; + HbLabel* mDuration; + HbLabel* mContactIcon; + LcVideoWidget* mSharedVideoWidget; + LcVideoWidget* mReceivedVideoWidget; + HbAction* mChangeCameraAction; + HbAction* mMuteAction; + HbAction* mSpeakerAction; + HbAction* mDisableCameraAction; + HbAction* mDisableCameraMenuAction; + HbMessageBox* mNotSupportedNote; + HbPushButton* mEndCallButton; + + LcVideoWidget* mReceivedVideoEffectOverlay; + LcVideoWidget* mSharedVideoEffectOverlay; + LcEffectHandler* mEffectHandler; + +private: + + HbMenu* mItemContextMenu; + bool mIsOptionMenuOpen; + Dialpad* mDialpad; // Not owned + DialpadVtKeyHandler* mDialpadVtKeyHandler; + int timerId; + bool isViewReady; +}; + + +#endif // LCVIEW_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/inc/lcviewmanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/inc/lcviewmanager.h Thu Jul 22 16:32:26 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: +* +*/ +#ifndef LCVIEWMANAGER_H +#define LCVIEWMANAGER_H + +#include +#include + +class LcViewManagerPrivate; +class HbMainWindow; + +/** + * + */ +class LcViewManager : public QObject +{ + Q_OBJECT + friend class UT_LcUiViewManager; + +public: // The exported API + + LIVECOMMS_EXPORT LcViewManager( + const QString &engineName, + const QString &applicationDisplayName); + + LIVECOMMS_EXPORT ~LcViewManager(); + +public slots: + + //terminateSession will close engine session asynchronously + //when session is closed application will be also closed + LIVECOMMS_EXPORT void terminateSession(); + +private: //data + + LcViewManagerPrivate* d_ptr; +}; + +#endif // LCVIEWMANAGER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/inc/lcviewmanager_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/inc/lcviewmanager_p.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,92 @@ +/* +* 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 LCVIEWMANAGER_P_H +#define LCVIEWMANAGER_P_H + +#include + +class HbMainWindow; +class LcUiEngine; +class LcUiComponentRepository; +class LcView; +class HbAction; + +#include + +class LcMainWindow : public HbMainWindow + { + Q_OBJECT + +public: + + LcMainWindow(); + virtual ~LcMainWindow(); + +protected: // From HbMainWindow + + bool event(QEvent *event); + +signals: + + void appFocusGained(); + void appFocusLost(); + +private: + friend class UT_LcUiViewManager; + }; + +class LcViewManagerPrivate : public QObject +{ + Q_OBJECT + friend class UT_LcUiViewManager; + +public: + + explicit LcViewManagerPrivate(const QString &engineName, + const QString &applicationDisplayName); + ~LcViewManagerPrivate(); + + //this will close engine session asynchronously + //when session is closed application will be also closed + void terminateSession(); + +public slots: + void changeView(); + //for layout switch + void prepareOrientationChange(); + +private slots: + void closeApp(); + void activateCurrentView(bool startup); + +private: + + void startEngine(); + void setCurrentView(bool startup=false); + LcView* currentView(); + +private: //data + + LcMainWindow mMainWindow; + LcUiEngine* mEngine; + LcUiComponentRepository* mRepository; + +private: + friend class UT_LcUiViewManager; +}; + +#endif // LCVIEWMANAGER_P_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/livecommsui.qrc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/livecommsui.qrc Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,20 @@ + + + resources/hbpushbutton_color.css + + + resources/lcviews/lcidleview.docml + resources/lcviews/lcreceiveview.docml + resources/lcviews/lcreceiveonlyview.docml + resources/lcviews/lcsendview.docml + resources/lcviews/lctwowayview.docml + resources/lcviews/lcvtview.docml + + + resources/win_appear.fxml + resources/win_disappear.fxml + resources/win_flip.fxml + resources/win_swap_down.fxml + resources/win_swap_up.fxml + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/resources/hbpushbutton_color.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/resources/hbpushbutton_color.css Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,10 @@ +/* For End Call button */ +HbPushButton[state = "normal"]::icon +{ + color: var(qtc_callhandling_reject_normal); +} + +HbPushButton[state = "pressed"]::icon +{ + color: var(qtc_callhandling_reject_pressed); +} diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/resources/lcviews.uip Binary file mmsharing/livecommsui/lcui/resources/lcviews.uip has changed diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/resources/lcviews/lcidleview.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/resources/lcviews/lcidleview.docml Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + +
+ + + + + +
diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/resources/lcviews/lcreceiveView.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/resources/lcviews/lcreceiveView.docml Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,190 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/resources/lcviews/lcreceiveonlyView.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/resources/lcviews/lcreceiveonlyView.docml Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,185 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/resources/lcviews/lcsendview.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/resources/lcviews/lcsendview.docml Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,200 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/resources/lcviews/lctwowayview.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/resources/lcviews/lctwowayview.docml Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,214 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/resources/lcviews/lcvtview.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/resources/lcviews/lcvtview.docml Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,256 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/resources/win_appear.fxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/resources/win_appear.fxml Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,14 @@ + + + + + + +0.6 + +1.0 +0.0 + + + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/resources/win_disappear.fxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/resources/win_disappear.fxml Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,15 @@ + + + + + + +0.6 + +0.2 +1.0 + + + + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/resources/win_flip.fxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/resources/win_flip.fxml Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,41 @@ + + + + + + +3.0 + +0 +-90 +90 +0 + + + +0.5 + + +0.5 + + +0 + + +1 + + +0 + + +3.0 + +1.0 +0.0 +0.0 +1.0 + + + + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/resources/win_swap_down.fxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/resources/win_swap_down.fxml Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,35 @@ + + + + + 5.0 + + + + + + + + + + 245 + + + + 5.0 + 1.0 + 0.2 + 0.2 + 2.0 + + + + 5.0 + 1.0 + 0.2 + 0.2 + 2.0 + + + + \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/resources/win_swap_up.fxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/resources/win_swap_up.fxml Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,35 @@ + + + + + 5.0 + + + + + + + + + + 94 + + + + 5.0 + 1.0 + 0.2 + 0.2 + 0.5 + + + + 5.0 + 1.0 + 0.2 + 0.2 + 0.5 + + + + \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/src/lceffecthandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/src/lceffecthandler.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,379 @@ +/* +* 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: +* +*/ + +//USER +#include "lceffecthandler.h" +#include "lclogger.h" +#include "lcuidefs.h" +#include "lcuiengine.h" + +//SYSTEM +#include +#include + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +LcEffectHandler::LcEffectHandler(LcUiEngine& engine, + HbWidget* sharedVideo, + HbWidget* sharedVideoOverlay, + HbWidget* receivedVideo, + HbWidget* receivedVideoOverlay) : + mEngine(engine), + mSharedVideo(sharedVideo), + mSharedVideoOverlay(sharedVideoOverlay), + mReceivedVideo(receivedVideo), + mReceivedVideoOverlay(receivedVideoOverlay), + mSwapSharedCompleted(false), + mSwapReceivedCompleted(false), + mSwapInProgress(false) +{ + HbEffect::add(lcEffectWinId, lcEffectWinDisappear, lcEffectWinDisappearId ); + HbEffect::add(lcEffectWinId, lcEffectWinAppear, lcEffectWinAppearId ); + HbEffect::add(lcEffectWinId, lcEffectWinFlip, lcEffectWinFlipId ); + HbEffect::add(lcEffectWinId, lcEffectWinSwapDown, lcEffectWinSwapDownId ); + HbEffect::add(lcEffectWinId, lcEffectWinSwapUp, lcEffectWinSwapUpId ); + + mEffectCallBack = lcEffectWinDefaultCallback; +} + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +LcEffectHandler::~LcEffectHandler() +{ +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void LcEffectHandler::setVisibility(HbWidget* widget, bool visible) +{ + if ( !HbEffect::effectRunning( widget )) { + widget->setVisible( visible ); + } +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void LcEffectHandler::setDissappearEffect( + LcEffectHandler::DissapperEffect aEffectType ) +{ + if ( aEffectType == LcEffectHandler::DissappearToFlip ) { + mEffectCallBack = "windowDisappearToFlipComplete"; + } else if ( aEffectType == LcEffectHandler::NormalDissappear ) { + mEffectCallBack = "windowDisappearComplete"; + } else { + mEffectCallBack = lcEffectWinDefaultCallback; + } +} +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void LcEffectHandler::showSendWindow() +{ + LC_QDEBUG( "livecomms [UI] -> LcEffectHandler::showSendWindow()" ) + if ( mSharedVideo ) { + if ( mSwapSharedCompleted || !HbEffect::effectRunning( mSharedVideoOverlay )) { + startEffect( mSharedVideoOverlay, + lcEffectWinAppearId, "windowAppearComplete" ); + + mSharedVideo->show(); + } else { + LC_QDEBUG( "livecomms [UI] LcEffectHandler: postponed due ongoing animation" ) + } + } + LC_QDEBUG( "livecomms [UI] <- LcEffectHandler::showSendWindow()" ) +} + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void LcEffectHandler::showReceiveWindow() +{ + LC_QDEBUG( "livecomms [UI] -> LcEffectHandler::showReceiveWindow()" ) + if ( mReceivedVideo ) { + if ( mSwapReceivedCompleted || !HbEffect::effectRunning( mReceivedVideoOverlay )) { + startEffect( mReceivedVideoOverlay, + lcEffectWinAppearId, "windowAppearComplete" ); + mReceivedVideo->show(); + } else { + LC_QDEBUG( "livecomms [UI] LcEffectHandler: postponed due ongoing animation" ) + } + } + LC_QDEBUG( "livecomms [UI] <- LcEffectHandler::showReceiveWindow()" ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void LcEffectHandler::hideSendWindow() +{ + LC_QDEBUG( "livecomms [UI] -> LcEffectHandler::hideSendWindow()" ) + if ( mSharedVideo && mSharedVideo->isVisible() ) { + startEffect( mSharedVideoOverlay, + lcEffectWinDisappearId, mEffectCallBack.toAscii().data() ); + mSharedVideo->hide(); + } + + mEffectCallBack = lcEffectWinDefaultCallback; + LC_QDEBUG( "livecomms [UI] <- LcEffectHandlerLcEffectHandler::hideSendWindow()" ) +} + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void LcEffectHandler::hideReceiveWindow() +{ + LC_QDEBUG( "livecomms [UI] -> LcEffectHandler::hideReceiveWindow()" ) + if ( mReceivedVideo && mReceivedVideo->isVisible() ) { + startEffect( mReceivedVideoOverlay, + lcEffectWinDisappearId, "windowDisappearComplete" ); + mReceivedVideo->hide(); + } + + LC_QDEBUG( "livecomms [UI] <- LcEffectHandler::hideReceiveWindow()" ) +} + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void LcEffectHandler::swap() +{ + LC_QDEBUG( "livecomms [UI] -> LcEffectHandler::swap()" ) + + // Emit the signal which triggers to loading of new swapped section + mSwapInProgress = true; + emit loadSwapLayout(); + + startEffects(); + + LC_QDEBUG( "livecomms [UI] <- LcEffectHandler::swap()" ) +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void LcEffectHandler::startEffects() +{ + if( mSharedVideo && mReceivedVideo ) { + + mSwapSharedCompleted = false; + mSwapReceivedCompleted = false; + + startEffect( mSharedVideoOverlay, lcEffectWinDisappearId, "windowSwapSharedComplete" ); + startEffect( mReceivedVideoOverlay, lcEffectWinDisappearId, "windowSwapReceivedComplete" ); + + mSharedVideo->hide(); + mReceivedVideo->hide(); + } + +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void LcEffectHandler::startEffect( + HbWidget* widget, const char *effectId, const char *callBack ) +{ + LC_QDEBUG( "livecomms [UI] -> LcEffectHandler::startEffect()" ) + if( widget ) { + widget->setOpacity(1.0); // Previous effect might have set opacity to zero + widget->show(); + LC_QDEBUG_2( "livecomms [UI] window: ", widget->geometry() ) + LC_QDEBUG_2( "livecomms [UI] effect name: ", QString(effectId) ) + HbEffect::start( widget, lcEffectWinId, effectId, this, callBack ); + } + LC_QDEBUG( "livecomms [UI] <- LcEffectHandler::startEffect()" ) +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void LcEffectHandler::windowAppearComplete(HbEffect::EffectStatus status) +{ + Q_UNUSED(status); + LC_QDEBUG( "livecomms [UI] -> LcEffectHandler::windowAppearComplete()" ) + + if ( status.item && status.item == mSharedVideoOverlay && + !HbEffect::effectRunning( mSharedVideoOverlay ) ) { + mSharedVideoOverlay->hide(); + + } + if ( status.item && status.item == mReceivedVideoOverlay && + !HbEffect::effectRunning( mReceivedVideoOverlay ) ) { + mReceivedVideoOverlay->hide(); + + } + + LC_QDEBUG( "livecomms [UI] <- LcEffectHandler::windowAppearComplete()" ) +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void LcEffectHandler::windowDisappearComplete(HbEffect::EffectStatus status) +{ + Q_UNUSED(status); + LC_QDEBUG( "livecomms [UI] -> LcEffectHandler::windowDisappearComplete()" ) + LC_QDEBUG( "livecomms [UI] <- LcEffectHandler::windowDisappearComplete()" ) +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void LcEffectHandler::windowDisappearToFlipComplete(HbEffect::EffectStatus status) +{ + Q_UNUSED(status); + LC_QDEBUG( "livecomms [UI] -> LcEffectHandler::windowDisappearToFlipComplete()" ) + if( mSharedVideo ) { + mSharedVideo->hide(); + startEffect( mSharedVideoOverlay, lcEffectWinFlipId, "windowFlipComplete" ); + } + LC_QDEBUG( "livecomms [UI] <- LcEffectHandler::windowDisappearToFlipComplete()" ) +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void LcEffectHandler::windowFlipComplete(HbEffect::EffectStatus status) +{ + Q_UNUSED(status); + LC_QDEBUG( "livecomms [UI] -> LcEffectHandler::flipHideComplete()" ) + if( mEngine.isLocalPlayerPlaying() ) { + showSendWindow(); + } + LC_QDEBUG( "livecomms [UI] <- LcEffectHandler::flipHideComplete()" ) +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void LcEffectHandler::windowSwapSharedComplete(HbEffect::EffectStatus status) +{ + Q_UNUSED(status); + LC_QDEBUG( "livecomms [UI] -> LcEffectHandler::windowSwapSharedComplete()" ) + if( mSharedVideo ) { + LC_QDEBUG_2( "livecomms [UI] window: ", mSharedVideo->geometry() ) + LC_QDEBUG_2( "livecomms [UI] effect window: ", mSharedVideoOverlay->geometry() ) + + mSwapSharedCompleted = true; + + handleSwapCompletion(); + } + LC_QDEBUG( "livecomms [UI] <- LcEffectHandler::windowSwapSharedComplete()" ) +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void LcEffectHandler::windowSwapReceivedComplete(HbEffect::EffectStatus status) +{ + Q_UNUSED(status); + LC_QDEBUG( "livecomms [UI] -> LcEffectHandler::windowSwapReceivedComplete()" ) + if( mReceivedVideo ) { + LC_QDEBUG_2( "livecomms [UI] window: ", mReceivedVideo->geometry() ) + LC_QDEBUG_2( "livecomms [UI] effect window: ", mReceivedVideoOverlay->geometry() ) + + mSwapReceivedCompleted = true; + + handleSwapCompletion(); + } + LC_QDEBUG( "livecomms [UI] <- LcEffectHandler::windowSwapReceivedComplete()" ) +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +bool LcEffectHandler::isSharedVideoAtTop() const +{ + return ( mSharedVideo && mReceivedVideo && + mSharedVideo->geometry().top() < mReceivedVideo->geometry().top()); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +bool LcEffectHandler::videosSideBySide() const +{ + return ( mSharedVideo && mReceivedVideo && + mSharedVideo->geometry().top() == mReceivedVideo->geometry().top() ); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void LcEffectHandler::handleSwapCompletion() +{ + LC_QDEBUG( "livecomms [UI] -> LcEffectHandler::handleSwapCompletion()" ) + if ( mSwapSharedCompleted && mSwapReceivedCompleted ){ + LC_QDEBUG( "livecomms [UI] Both swaps done, complete" ) + + emit swapCompleted(); + + if( mEngine.isLocalPlayerPlaying() ) { + showSendWindow(); + } + if( mEngine.isRemotePlayerPlaying() ) { + showReceiveWindow(); + } + + mSwapInProgress = false; + } + LC_QDEBUG( "livecomms [UI] <- LcEffectHandler::handleSwapCompletion()" ) +} + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +bool LcEffectHandler::isSwapInProgress() +{ + return mSwapInProgress; +} + + +// End of file + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/src/lcuicomponentrepository.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/src/lcuicomponentrepository.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,589 @@ +/* +* 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: +* +*/ + +//USER +#include "lcuicomponentrepository.h" +#include "lcview.h" +#include "lcuidefs.h" +#include "lclogger.h" +#include "lcuiengine.h" +#include "lcvideowidget.h" + +//SYSTEM +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// ----------------------------------------------------------------------------- +// LcUiComponentRepository::LcUiComponentRepository +// ----------------------------------------------------------------------------- +// +LcUiComponentRepository::LcUiComponentRepository(LcUiEngine& engine) + : HbDocumentLoader(), + mEngine(engine), + mSlots(0), + mIdleView(0), + mReceiveView(0), + mSendView(0), + mTwowayView(0), + mAllInOneView(0), + mReceiveOnlyView(0), + mAcceptQuery(0), + mInvitingNote(0), + mWaitingNote(0), + mRecipientQuery(0), + mShareOwnVideoQuery(0) +{ + LC_QDEBUG( "livecomms [UI] -> LcUiComponentRepository::LcUiComponentRepository()" ) + + mSlots = new QHash; + mSlots->insert( lcActFullscreenId, SLOT( notSupported() ) ); + mSlots->insert( lcActVideopreferenceId, SLOT( notSupported() ) ); + mSlots->insert( lcActDialerId, SLOT( notSupported() ) ); + mSlots->insert( lcActEndactivecallId, SLOT( notSupported() ) ); + mSlots->insert( lcActStopSharingId, SLOT( endVideoSession() ) ); + mSlots->insert( lcActEnableCameraId, SLOT( disableCamera() ) ); + mSlots->insert( lcActMuteId, SLOT( mute() ) ); + mSlots->insert( lcActGalleryId, SLOT( notSupported() ) ); + mSlots->insert( lcActChangeCameraId, SLOT( notSupported() ) ); + mSlots->insert( lcActAdjustVideoId, SLOT( notSupported() ) ); + mSlots->insert( lcActShareImageId, SLOT( notSupported() ) ); + mSlots->insert( lcActSwapViewsId, SLOT( swap() ) ); + mSlots->insert( lcActSwitchToVoiceCallId, SLOT( switchToVoiceCall() ) ); + mSlots->insert( lcActOpenKeypadId, SLOT( openDialpad() ) ); + mSlots->insert( lcActDisableCameraId, SLOT( disableCamera() ) ); + mSlots->insert( lcActSpeakerId, SLOT( speaker() ) ); + + mSlots->insert( lcActMenuDisableCameraId, SLOT( disableCamera() ) ); + mSlots->insert( lcActMenuChangeCameraId, SLOT( notSupported() ) ); + + LC_QDEBUG( "livecomms [UI] <- LcUiComponentRepository::LcUiComponentRepository()" ) +} + +// ----------------------------------------------------------------------------- +// LcUiComponentRepository::~LcUiComponentRepository +// ----------------------------------------------------------------------------- +// +LcUiComponentRepository::~LcUiComponentRepository() +{ + LC_QDEBUG( "livecomms [UI] -> LcUiComponentRepository::~LcUiComponentRepository()" ) + + delete mSlots; + + mIdleViewComponents.clear(); + mReceiveViewComponents.clear(); + mSendViewComponents.clear(); + mTwowayViewComponents.clear(); + mAllInOneViewComponents.clear(); + mReceiveOnlyViewComponents.clear(); + + delete mAcceptQuery; + delete mInvitingNote; + delete mWaitingNote; + delete mRecipientQuery; + delete mShareOwnVideoQuery; + + LC_QDEBUG( "livecomms [UI] <- LcUiComponentRepository::~LcUiComponentRepository()" ) +} + +// ----------------------------------------------------------------------------- +// LcUiComponentRepository::createObject +// ----------------------------------------------------------------------------- +// +QObject* LcUiComponentRepository::createObject( + const QString& type, const QString &name) +{ + QObject* object = 0; + + if ( type == lcLcViewTypeName || + name == lcViewIdleId || + name == lcViewReceiveId || + name == lcViewReceiveOnlyId || + name == lcViewAllInOneId || + name == lcViewSendId || + name == lcViewTwowayId ) { + LC_QDEBUG_2( "-> LcUiComponentRepository::createObject() ", + "- creating LcView -" ) + object = new LcView( mEngine, *this ); + } + else if ( name == lcWidgetSendVideoId ) { + LC_QDEBUG_2( "-> LcUiComponentRepository::createObject() ", + "- creating shared video widget -" ) + object = new LcVideoWidget(); + static_cast(object)->setLocalPlayer(true); + } + else if ( name == lcWidgetSendVideoId2 ) { + LC_QDEBUG_2( "-> LcUiComponentRepository::createObject() ", + "- creating shared video widget effect overlay -" ) + object = new LcVideoWidget(0, false); + static_cast(object)->setLocalPlayer(true); + } + else if ( name == lcWidgetRecvVideoId ) { + LC_QDEBUG_2( "-> LcUiComponentRepository::createObject() ", + "- creating received video widget -" ) + object = new LcVideoWidget(); + static_cast(object)->setLocalPlayer(false); + + } + else if ( name == lcWidgetRecvVideoId2 ) { + LC_QDEBUG_2( "-> LcUiComponentRepository::createObject() ", + "- creating received video widget effect overlay -" ) + object = new LcVideoWidget(0, false); + static_cast(object)->setLocalPlayer(false); + } + else if ( name == lcButtonEndCall ){ + object = HbDocumentLoader::createObject( type, name ); + HbFrameDrawer*frameDrawer = new HbFrameDrawer("qtg_fr_btn_red_normal",HbFrameDrawer::NinePieces); + static_cast(object)->setFrameBackground(frameDrawer); + HbStyleLoader::registerFilePath(":/hbpushbutton_color.css"); + } + else if ( name == lcWidgetDialpad ){ + HbMainWindow* pWindow = HbInstance::instance()->allMainWindows().at(0); + if( pWindow ){ + object = new Dialpad( *pWindow ); + } + } + else { + object = HbDocumentLoader::createObject( type, name ); + } + if (object) { + object->setObjectName(name); + } + + LC_QDEBUG_2( "livecomms [UI] <- LcUiComponentRepository::createObject(), name=", name ) + + return object; +} + +// ----------------------------------------------------------------------------- +// LcUiComponentRepository::idleView +// ----------------------------------------------------------------------------- +// +LcView* LcUiComponentRepository::idleView() +{ + LC_QDEBUG( "livecomms [UI] -> LcUiComponentRepository::idleView()" ); + + reset(); + setObjectTree( mIdleViewComponents ); + + if ( !mIdleView ) { + mIdleView = loadView( + mIdleViewComponents, lcViewIdleId, lcIdleViewFile ); + } + LC_QDEBUG( "livecomms [UI] <- LcUiComponentRepository::idleView()" ); + return mIdleView; +} + +// ----------------------------------------------------------------------------- +// LcUiComponentRepository::receiveView +// ----------------------------------------------------------------------------- +// +LcView* LcUiComponentRepository::receiveView() +{ + LC_QDEBUG( "livecomms [UI] -> LcUiComponentRepository::receiveView()" ); + + reset(); + setObjectTree( mReceiveViewComponents ); + if ( !mReceiveView ) { + mReceiveView = loadView( + mReceiveViewComponents, lcViewReceiveId, lcReceiveViewFile ); + } + LC_QDEBUG( "livecomms [UI] <- LcUiComponentRepository::receiveView()" ); + return mReceiveView; +} + +// ----------------------------------------------------------------------------- +// LcUiComponentRepository::receiveOnlyView +// ----------------------------------------------------------------------------- +// +LcView* LcUiComponentRepository::receiveOnlyView() +{ + LC_QDEBUG( "livecomms [UI] -> LcUiComponentRepository::receiveOnlyView()" ); + + reset(); + setObjectTree( mReceiveOnlyViewComponents ); + if ( !mReceiveOnlyView ) { + mReceiveOnlyView = loadView( + mReceiveOnlyViewComponents, lcViewReceiveOnlyId, lcReceiveOnlyViewFile ); + } + LC_QDEBUG( "livecomms [UI] <- LcUiComponentRepository::receiveOnlyView()" ); + return mReceiveOnlyView; +} + +// ----------------------------------------------------------------------------- +// LcUiComponentRepository::twowayView +// ----------------------------------------------------------------------------- +// +LcView* LcUiComponentRepository::twowayView() +{ + LC_QDEBUG( "livecomms [UI] -> LcUiComponentRepository::twowayView()" ); + + reset(); + setObjectTree( mTwowayViewComponents ); + if ( !mTwowayView ) { + mTwowayView = loadView( + mTwowayViewComponents, lcViewTwowayId, lcTwowayViewFile ); + } + LC_QDEBUG( "livecomms [UI] <- LcUiComponentRepository::twowayView()" ); + return mTwowayView; +} + +// ----------------------------------------------------------------------------- +// LcUiComponentRepository::sendView +// ----------------------------------------------------------------------------- +// +LcView* LcUiComponentRepository::sendView() +{ + LC_QDEBUG( "livecomms [UI] -> LcUiComponentRepository::sendView()" ); + + reset(); + setObjectTree( mSendViewComponents ); + if ( !mSendView ) { + mSendView = + loadView( mSendViewComponents, lcViewSendId, lcSendViewFile ); + } + LC_QDEBUG( "livecomms [UI] <- LcUiComponentRepository::sendView()" ); + return mSendView; +} + +// ----------------------------------------------------------------------------- +// LcUiComponentRepository::allInOneView +// ----------------------------------------------------------------------------- +// +LcView* LcUiComponentRepository::allInOneView() +{ + LC_QDEBUG( "livecomms [UI] -> LcUiComponentRepository::allInOneView()" ); + + reset(); + setObjectTree( mAllInOneViewComponents ); + if ( !mAllInOneView ) { + mAllInOneView = loadView( + mAllInOneViewComponents, lcViewAllInOneId, lcAllInOneViewFile ); + } + LC_QDEBUG( "livecomms [UI] <- LcUiComponentRepository::allInOneView()" ); + return mAllInOneView; +} + +// ----------------------------------------------------------------------------- +// LcUiComponentRepository::acceptQuery +// ----------------------------------------------------------------------------- +// +HbDialog* LcUiComponentRepository::acceptQuery() +{ + LC_QDEBUG( "livecomms [UI] -> LcUiComponentRepository::acceptQuery()" ); + + if ( !mAcceptQuery ) { + mAcceptQuery = new HbDialog(); + HbAction* acceptAction = new HbAction( LC_OK ); + HbAction* rejectAction = new HbAction( LC_CANCEL ); + mAcceptQuery->addAction(acceptAction); + mAcceptQuery->addAction(rejectAction); + mAcceptQuery->setVisible(false); + HbLabel* label = new HbLabel( LC_ACCEPT_SESSION ); + mAcceptQuery->setHeadingWidget(label); + HbLabel* label2 = new HbLabel(); + mAcceptQuery->setContentWidget(label2); + mAcceptQuery->setTimeout(0); + mAcceptQuery->setDismissPolicy(HbDialog::NoDismiss); + } + LC_QDEBUG( "livecomms [UI] <- LcUiComponentRepository::acceptQuery()" ); + return mAcceptQuery; +} + +// ----------------------------------------------------------------------------- +// LcUiComponentRepository::invitingNote +// ----------------------------------------------------------------------------- +// +HbProgressDialog* LcUiComponentRepository::invitingNote() +{ + LC_QDEBUG( "livecomms [UI] -> LcUiComponentRepository::invitingNote()" ); + + if ( !mInvitingNote ) { + mInvitingNote = new HbProgressDialog(); + mInvitingNote->setVisible(false); + mInvitingNote->setText( LC_INVITING ); + HbAction* rejectAction = new HbAction( LC_CANCEL ); + mInvitingNote->addAction(rejectAction); + } + LC_QDEBUG( "livecomms [UI] <- LcUiComponentRepository::invitingNote()" ); + return mInvitingNote; +} + +// ----------------------------------------------------------------------------- +// LcUiComponentRepository::waitingNote +// ----------------------------------------------------------------------------- +// +HbProgressDialog* LcUiComponentRepository::waitingNote() +{ + LC_QDEBUG( "livecomms [UI] -> LcUiComponentRepository::waitingNote()" ); + + if ( !mWaitingNote ) { + mWaitingNote = new HbProgressDialog(); + mWaitingNote->setVisible(false); + HbAction* rejectAction = new HbAction( LC_CANCEL ); + mWaitingNote->addAction(rejectAction); + mWaitingNote->setText( LC_WAITING_VIDEO ); + } + LC_QDEBUG( "livecomms [UI] <- LcUiComponentRepository::waitingNote()" ); + return mWaitingNote; +} + +// ----------------------------------------------------------------------------- +// LcUiComponentRepository::recipientQuery +// ----------------------------------------------------------------------------- +// +HbDialog* LcUiComponentRepository::recipientQuery() +{ + LC_QDEBUG( "livecomms [UI] -> LcUiComponentRepository::recipientQuery()" ); + + if ( !mRecipientQuery ) { + mRecipientQuery = new HbDialog(); + HbLabel* label = new HbLabel( LC_RECIPIENT_QUERY ); + mRecipientQuery->setHeadingWidget(label); + mRecipientQuery->setTimeout(HbDialog::NoTimeout); + mRecipientQuery->setDismissPolicy(HbDialog::TapOutside); + HbAction* acceptAction = new HbAction( LC_OK ); + HbAction* rejectAction = new HbAction( LC_CANCEL ); + mRecipientQuery->addAction(acceptAction); + mRecipientQuery->addAction(rejectAction); + mRecipientQuery->setVisible(false); + } + LC_QDEBUG( "livecomms [UI] <- LcUiComponentRepository::recipientQuery()" ); + return mRecipientQuery; +} + +// ----------------------------------------------------------------------------- +// LcUiComponentRepository::shareOwnVideoQuery +// ----------------------------------------------------------------------------- +// +HbDialog* LcUiComponentRepository::shareOwnVideoQuery() +{ + LC_QDEBUG( "livecomms [UI] -> LcUiComponentRepository::shareOwnVideoQuery()" ); + + if ( !mShareOwnVideoQuery ) { + mShareOwnVideoQuery = new HbMessageBox( HbMessageBox::MessageTypeQuestion ); + mShareOwnVideoQuery->setStandardButtons( HbMessageBox::Yes | HbMessageBox::No ); + mShareOwnVideoQuery->setText( hbTrId( "txt_vt_info_allow_own_image_to_be_sent" )); + mShareOwnVideoQuery->setZValue(LC_NOTE_ON_TOP); + mShareOwnVideoQuery->setTimeout( HbDialog::NoTimeout ); + mShareOwnVideoQuery->setDismissPolicy( HbDialog::NoDismiss ); + mShareOwnVideoQuery->setVisible(false); + } + LC_QDEBUG( "livecomms [UI] <- LcUiComponentRepository::shareOwnVideoQuery()" ); + return mShareOwnVideoQuery; +} + +// ----------------------------------------------------------------------------- +// LcUiComponentRepository::sharedVideoContextMenuActions +// ----------------------------------------------------------------------------- +// +void LcUiComponentRepository::sharedVideoContextMenuActions( HbMenu* menu, LcView& view ) +{ + Q_UNUSED(view) + LC_QDEBUG( + "livecomms [UI] -> LcUiComponentRepository::sharedVideoContextMenuActions()" ); + + menu->actions().clear(); + //due stubs in unit tests, qobject_cast cannot be used. + //Using static_cast instead + HbAction* swap = static_cast( findObject( lcActSwapViewsId ) ); + HbAction* changeCamera = + static_cast( findObject( lcActMenuChangeCameraId ) ); + + HbAction* disableCamera = + static_cast( findObject( lcActMenuDisableCameraId ) ); + HbAction* enableCamera = + static_cast( findObject( lcActEnableCameraId ) ); + + if ( swap ) { + LC_QDEBUG_2( "Adding ", swap->text() ); + menu->addAction( swap ); + } + if ( changeCamera ) { + LC_QDEBUG_2( "Adding ", changeCamera->text() ); + menu->addAction( changeCamera ); + } + if ( mEngine.isLocalPlayerPlaying() ) { + if ( disableCamera ) { + LC_QDEBUG_2( "Adding ", disableCamera->text() ); + menu->addAction( disableCamera ); + } + } else { + if ( enableCamera ) { + LC_QDEBUG_2( "Adding ", enableCamera->text() ); + menu->addAction( enableCamera ); + } + } + + + LC_QDEBUG( + "livecomms [UI] <- LcUiComponentRepository::sharedVideoContextMenuActions()" ); +} + +// ----------------------------------------------------------------------------- +// LcUiComponentRepository::loadView +// ----------------------------------------------------------------------------- +// +LcView* LcUiComponentRepository::loadView( QObjectList& components, + const QString& viewId, + const QString& xmlFile ) +{ + LC_QDEBUG( "livecomms [UI] -> LcUiComponentRepository::loadView()" ); + + LcView* view = 0; + bool ok( false ); + // Load the XML file + components = load( xmlFile, &ok ); + + if ( !ok ) { + LC_QCRITICAL_3( "! loading of XML file ", xmlFile , " failed !" ) + return 0; + } + + mLastLoadedView = xmlFile; + + ok = loadLayout( lcLayoutLandscapeDefaultId ); + if ( !ok ) { + LC_QCRITICAL( "! loading of layout failed !" ) + return 0; + } + + view = qobject_cast( findWidget( viewId ) ); + if ( view ) { + connectActions( *view ); + view->init(); + } + + LC_QDEBUG( "livecomms [UI] <- LcUiComponentRepository::loadView()" ); + return view; +} + + +// ----------------------------------------------------------------------------- +// LcUiComponentRepository::connectActions +// ----------------------------------------------------------------------------- +// +void LcUiComponentRepository::connectActions( LcView& view ) const +{ + LC_QDEBUG( "livecomms [UI] -> LcUiComponentRepository::connectActions()" ); + foreach( QAction* hbAction, view.menu()->actions() ) { + connect( *hbAction, view ); + } + foreach( QAction* hbAction, view.toolBar()->actions() ) { + connect( *hbAction, view ); + } + + HbAction* changeCamera = + static_cast( findObject( lcActMenuChangeCameraId ) ); + HbAction* disableCamera = + static_cast( findObject( lcActMenuDisableCameraId ) ); + HbAction* enableCamera = + static_cast( findObject( lcActEnableCameraId ) ); + + QObject::connect( changeCamera, SIGNAL(triggered()), + &view, SLOT(notSupported()) ); + + QObject::connect( disableCamera, SIGNAL(triggered()), + &view, SLOT(disableCamera()) ); + + QObject::connect( enableCamera, SIGNAL(triggered()), + &view, SLOT(disableCamera()) ); + + LC_QDEBUG( "livecomms [UI] <- LcUiComponentRepository::connectActions()" ) +} + +// ----------------------------------------------------------------------------- +// LcUiComponentRepository::connect +// ----------------------------------------------------------------------------- +// +bool LcUiComponentRepository::connect( QAction& hbAction, LcView& view ) const +{ + LC_QDEBUG_2( "livecomms [UI] -> LcUiComponentRepository::connect() action=", + hbAction.objectName() ) + + const char* method = mSlots->value( hbAction.objectName() ); + bool slotFound = ( QString( method ).length() > 0 ); + + if ( slotFound ) { + QObject::connect( &hbAction, SIGNAL(triggered()), &view, method ); + } + + LC_QDEBUG( "livecomms [UI] <- LcUiComponentRepository::connect()" ) + + return slotFound; +} + + +// ----------------------------------------------------------------------------- +// LcUiComponentRepository::loadLayout +// ----------------------------------------------------------------------------- +// +bool LcUiComponentRepository::loadLayout( const QString& layoutName ) + { + LC_QDEBUG( "livecomms [UI] -> LcUiComponentRepository::loadLayout()" ) + bool ok( false ); + + if ( mLastLoadedView.length() > 0) { + LC_QDEBUG_4( "layout = ", layoutName, ", view =", mLastLoadedView ) + + QObjectList objects = load( mLastLoadedView, layoutName, &ok ); + if (!ok) { + LC_QCRITICAL( "! loading of XML failed !" ) + } + else{ + mPreviousLayout = mLayout; + mLayout = layoutName; + } + } else { + LC_QCRITICAL( "! not loading layout, since view is not loaded!" ) + } + + LC_QDEBUG( "livecomms [UI] <- LcUiComponentRepository::loadLayout()" ) + return ok; + } + +// ----------------------------------------------------------------------------- +// LcUiComponentRepository::layout()const +// ----------------------------------------------------------------------------- +// +QString LcUiComponentRepository::layout()const + { + LC_QDEBUG_2( "livecomms [UI] -> LcUiComponentRepository::layout()",mLayout ) + return mLayout; + } + +// ----------------------------------------------------------------------------- +// LcUiComponentRepository::previousLayout()const +// ----------------------------------------------------------------------------- +// +QString LcUiComponentRepository::previousLayout()const + { + LC_QDEBUG_2( "livecomms [UI] -> LcUiComponentRepository::previousLayout()", + mPreviousLayout ) + return mPreviousLayout; + } +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/src/lcvideowidget.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/src/lcvideowidget.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,105 @@ +/* +* 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: +* +*/ + +//USER +#include "lcvideowidget.h" + +//SYSTEM +#include + +const qreal lcVideoWidgetCornerRounding = 10.0; + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +LcVideoWidget::LcVideoWidget(QGraphicsItem *parent, bool showVideo) : + HbTransparentWindow(parent), + mShowVideo(showVideo) +{ + setFlag(QGraphicsItem::ItemUsesExtendedStyleOption, true); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +LcVideoWidget::~LcVideoWidget() +{ +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void LcVideoWidget::paint( + QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) +{ + Q_UNUSED(widget) + QPointF initialPosition(0,0); + + //Workaround: widgets positioning takes time, do not paint if they are not + //positioned correctly. + + if ( this->pos() != initialPosition ) { + + painter->save(); + if ( mShowVideo ){ + + QPainter::CompositionMode origCompositionMode = painter->compositionMode(); + painter->setCompositionMode(QPainter::CompositionMode_Source); + #if ( defined __WINSCW__ ) || ( defined __WINS__ ) + if( mLocalPlayer ){ + painter->setBrush(QColor(Qt::darkGreen)); + }else{ + painter->setBrush(QColor(Qt::darkRed)); + } + #else + painter->setBrush(QColor(0,0,0,0)); + #endif + painter->drawRoundedRect( option->exposedRect, + lcVideoWidgetCornerRounding, lcVideoWidgetCornerRounding); + + painter->setCompositionMode(origCompositionMode); // restore + } else { + painter->setBrush(QColor(0,0,0,255)); + painter->drawRoundedRect( option->exposedRect, + lcVideoWidgetCornerRounding, lcVideoWidgetCornerRounding); + } + painter->restore(); + } +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void LcVideoWidget::setShowVideo(bool showVideo) +{ + mShowVideo = showVideo; +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +bool LcVideoWidget::isShowingVideo() +{ + return mShowVideo; +} + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/src/lcview.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/src/lcview.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,1041 @@ +/* +* 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: +* +*/ +//USER +#include "lcview.h" +#include "lclogger.h" +#include "lcuiengine.h" +#include "lcuidefs.h" +#include "lcuicomponentrepository.h" +#include "lceffecthandler.h" +#include "lcvideowidget.h" + +//SYSTEM +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#if ( defined __WINSCW__ ) || ( defined __WINS__ ) +const int inActivityTimeout = 5000; //5 secs +#else +const int inActivityTimeout = 2000; //2 secs +#endif + +// ----------------------------------------------------------------------------- +// LcView::LcView +// ----------------------------------------------------------------------------- +// +LcView::LcView(LcUiEngine& engine, LcUiComponentRepository& repository) + : HbView(0), + mEngine(engine), + mRepository(repository), + mRecipient(0), + mDuration(0), + mContactIcon(0), + mSharedVideoWidget(0), + mReceivedVideoWidget(0), + mChangeCameraAction(0), + mMuteAction(0), + mSpeakerAction(0), + mDisableCameraAction(0), + mDisableCameraMenuAction(0), + mNotSupportedNote(0), + mEndCallButton(0), + mReceivedVideoEffectOverlay(0), + mSharedVideoEffectOverlay(0), + mEffectHandler(0), + mItemContextMenu(0), + mIsOptionMenuOpen(false), + mDialpad(0), + timerId(0), + mDialpadVtKeyHandler(0), + isViewReady(0) +{ + LC_QDEBUG( "livecomms [UI] -> LcView::LcView()" ) + + createNotSupportedNote(); + + // For LiveComms views Dock Wiget Item is explicitly hidden. + hideItems(Hb::DockWidgetItem); + + //Subscribe to the gesture events. + grabGesture(Qt::TapGesture,Qt::DontStartGestureOnChildren); + + LC_QDEBUG( "livecomms [UI] <- LcView::LcView()" ) +} + + +// ----------------------------------------------------------------------------- +// LcView::~LcView +// ----------------------------------------------------------------------------- +// +LcView::~LcView() +{ + LC_QDEBUG( "livecomms [UI] -> LcView::~LcView()" ) + + // Un-subscribe to the gesture events. + ungrabGesture(Qt::TapGesture); + + delete mEffectHandler; + delete mNotSupportedNote; + delete mDialpadVtKeyHandler; + + LC_QDEBUG( "livecomms [UI] <- LcView::~LcView()" ) +} + +// ----------------------------------------------------------------------------- +// LcView::init +// ----------------------------------------------------------------------------- +// +void LcView::init() +{ + LC_QDEBUG( "livecomms [UI] -> LcView::init()" ) + //find member widgets from repository + //( can be also found by browsing this view itself ) + + //due stubs in unit tests, qobject_cast cannot be used. Using static_cast instead + mRecipient = + static_cast( mRepository.findWidget( lcLabelRecipientId ) ); + mDuration = + static_cast( mRepository.findWidget( lcLabelDurationId ) ); + mContactIcon = + static_cast( mRepository.findWidget( lcIconContactId ) ); + mSharedVideoWidget = + static_cast( + mRepository.findWidget( lcWidgetSendVideoId ) ); + mReceivedVideoWidget = + static_cast( + mRepository.findWidget( lcWidgetRecvVideoId ) ); + mChangeCameraAction = + static_cast( mRepository.findObject( lcActChangeCameraId ) ); + mMuteAction = + static_cast( mRepository.findObject( lcActMuteId ) ); + mSpeakerAction = + static_cast( mRepository.findObject( lcActSpeakerId ) ); + mDisableCameraAction = + static_cast( mRepository.findObject( lcActDisableCameraId ) ); + + mDisableCameraMenuAction = + static_cast( mRepository.findObject( lcActMenuDisableCameraId ) ); + + mEndCallButton = + static_cast( mRepository.findObject( lcButtonEndCall ) ); + + if ( mEndCallButton ) { + connect( mEndCallButton, SIGNAL(clicked()), this, SLOT(endVideoSession())); + } + + if ( mSharedVideoWidget ) { + mSharedVideoEffectOverlay = static_cast( + mRepository.findWidget( lcWidgetSendVideoId2 ) ); + if ( mSharedVideoEffectOverlay ) { + mSharedVideoEffectOverlay->show(); + } + } + + mReceivedVideoEffectOverlay = + static_cast( mRepository.findWidget( lcWidgetRecvVideoId2 ) ); + + if ( mReceivedVideoEffectOverlay ) { + mReceivedVideoEffectOverlay->show(); + } + + // swap + mEffectHandler = new LcEffectHandler( mEngine, + mSharedVideoWidget, mSharedVideoEffectOverlay, + mReceivedVideoWidget, mReceivedVideoEffectOverlay); + connect( mEffectHandler, SIGNAL(swapCompleted()), this, SLOT(updateVideoRects()) ); + connect( mEffectHandler, SIGNAL(loadSwapLayout()), this, SLOT(updateSwapLayout()) ); + + // menu + if ( menu()) { + connect( menu(), SIGNAL(aboutToShow()), this, SLOT(menuAboutToShow()) ); + connect( menu(), SIGNAL(aboutToHide()), this, SLOT(watchInactivity()) ); + } + + // Set up navigation action. + setNavigationAction(new HbAction(Hb::BackNaviAction, this)); + connect(navigationAction(), SIGNAL(triggered()), this, + SLOT(back())); + + // dialpad + mDialpad = static_cast ( mRepository.findWidget("lc_label_dialpad") ); + connect( mDialpad, SIGNAL(aboutToClose()), this, SLOT(dialpadClosed()) ); + connect( mDialpad, SIGNAL(aboutToOpen()), this, SLOT(dialpadOpened()) ); + connect( &mDialpad->editor(), SIGNAL( contentsChanged() ), this, SLOT( dialpadEditorTextChanged() ) ); + HbMainWindow* pWindow = HbInstance::instance()->allMainWindows().at(0); + if( pWindow && mDialpad ){ + mDialpadVtKeyHandler = new DialpadVtKeyHandler( mDialpad,*pWindow ); + } + + // inactivity + connect( this, SIGNAL( contentFullScreenChanged() ), this, SLOT( watchInactivity() ) ) ; + + // deactivate fullscreen and it inturn starts inactivity timeout + toFullScreen( false ); + + if ( mSharedVideoWidget ) { + connect( mSharedVideoWidget, SIGNAL( xChanged() ), this, + SLOT( updateVideoRects() ), Qt::QueuedConnection ); + connect( mSharedVideoWidget, SIGNAL( yChanged() ), this, + SLOT( updateVideoRects() ) , Qt::QueuedConnection); + } + if ( mReceivedVideoWidget ) { + connect( mReceivedVideoWidget, SIGNAL( xChanged() ), this, + SLOT( updateVideoRects() ), Qt::QueuedConnection ); + connect( mReceivedVideoWidget, SIGNAL( yChanged() ), this, + SLOT( updateVideoRects() ), Qt::QueuedConnection ); + } + + LC_QDEBUG( "livecomms [UI] <- LcView::init()" ) +} + + +// ----------------------------------------------------------------------------- +// LcView::updateVideoRects +// ----------------------------------------------------------------------------- +// +void LcView::updateVideoRects() +{ + LC_QDEBUG( "livecomms [UI] -> LcView::updateVideoRects()" ) + + QRectF sharedContentRect; + QRectF receivedContentRect; + + //Workaround: widgets positioning takes time, do not inform to the + //engine for rendering if co-ordinates of the videos are incorrect. + + if ( isPositioned() ) { + + if ( mSharedVideoWidget ) { + sharedContentRect = mSharedVideoWidget->geometry(); + sharedContentRect.moveTop( + sharedContentRect.y() + mapToParent(scenePos()).y()); + sharedContentRect = translateRectForOrientation(sharedContentRect); + mEffectHandler->setVisibility( + mSharedVideoWidget, mEngine.isLocalPlayerPlaying()); + } + + if ( mReceivedVideoWidget ) { + receivedContentRect = mReceivedVideoWidget->geometry(); + receivedContentRect.moveTop( + receivedContentRect.y() + mapToParent(scenePos()).y()); + receivedContentRect = translateRectForOrientation(receivedContentRect); + mEffectHandler->setVisibility( + mReceivedVideoWidget, mEngine.isRemotePlayerPlaying()); + } + + mEngine.setContentAreas( sharedContentRect, receivedContentRect ); + mEngine.setOrientation( HbInstance::instance()->allMainWindows().at(0)->orientation() ); + mEngine.updateSession(); + } + LC_QDEBUG( "livecomms [UI] <- LcView::updateVideoRects()" ) +} + +// ----------------------------------------------------------------------------- +// LcView::swap +// ----------------------------------------------------------------------------- +// +void LcView::swap() +{ + LC_QDEBUG( "livecomms [UI] -> LcView::swap()" ) + if ( mEffectHandler ){ + mEffectHandler->swap(); + } + LC_QDEBUG( "livecomms [UI] <- LcView::swap()" ) +} + + +// ----------------------------------------------------------------------------- +// LcView::updateSwapLayout +// ----------------------------------------------------------------------------- +// + +void LcView::updateSwapLayout() +{ + mRepository.loadLayout( currentLayout() ); + toFullScreen( true ); +} + +// ----------------------------------------------------------------------------- +// LcView::activated +// ----------------------------------------------------------------------------- +// +void LcView::activated() +{ + LC_QDEBUG( "livecomms [UI] -> LcView::activated()" ) + updateVideoRects(); + + //synchronize with engine + + if ( mEngine.mainCamera() ) { + setCameraActionToSecondary(); + } else { + setCameraActionToMain(); + } + + if ( mEngine.isMuted() ) { + setMuteActionToUnmute(); + } else { + setMuteActionToMute(); + } + + if ( mEngine.isSpeakerOn() ) { + setSpeakerActionToHandset(); + } else { + setSpeakerActionToSpeaker(); + } + + if ( mChangeCameraAction ) { + connect( + &mEngine, SIGNAL(cameraChangedToMain()), + this, SLOT(setCameraActionToSecondary()) ); + connect( + &mEngine, SIGNAL(cameraChangedToSecondary()), + this, SLOT(setCameraActionToMain())); + } + + if ( mMuteAction ) { + connect( + &mEngine, SIGNAL(muted()), + this, SLOT(setMuteActionToUnmute()) ); + connect( + &mEngine, SIGNAL(unmuted()), + this, SLOT(setMuteActionToMute())); + } + + if ( mSpeakerAction ) { + connect( &mEngine, SIGNAL(speakerEnabled()), + this, SLOT(setSpeakerActionToHandset()) ); + connect( &mEngine, SIGNAL(speakerDisabled()), + this, SLOT(setSpeakerActionToSpeaker()) ); + } + + if ( mDisableCameraAction ) { + connect( + &mEngine, SIGNAL(cameraDisabled()), + this, SLOT(setCameraActionToEnable()) ); + connect( + &mEngine, SIGNAL(cameraEnabled()), + this, SLOT(setCameraActionToDisable())); + } + + connect( &mEngine, SIGNAL(blocked()), this, SLOT(disableControls()) ); + connect( &mEngine, SIGNAL(unblocked()), this, SLOT(enableControls()) ); + + if ( mDuration ) { + // TODO: clearing is needed for label in order to + // get text changed. Seems like bug in orbit side. + // This causes that duration is not changed. Workaround + // would be to call clear always when duration changes. + mDuration->clear(); + connect( + &mEngine, SIGNAL(sessionDurationChanged(const QString &)), + mDuration, SLOT(setPlainText(const QString &)) ); + } + + if ( mRecipient ){ + mRecipient->clear(); + mRecipient->setPlainText( mEngine.recipient() ); + connect( + &mEngine, SIGNAL(recipientChanged(const QString &)), + mRecipient, SLOT(setPlainText(const QString &)) ); + } + + if ( mSharedVideoWidget ) { + connect( &mEngine, SIGNAL(localPlayerPlaying()), + mEffectHandler, SLOT(showSendWindow()) ); + connect( &mEngine, SIGNAL(localPlayerPaused()), + mEffectHandler, SLOT(hideSendWindow()) ); + } + + if ( mReceivedVideoWidget ) { + connect( &mEngine, SIGNAL(remotePlayerPlaying()), + mEffectHandler, SLOT(showReceiveWindow()) ); + connect( &mEngine, SIGNAL(remotePlayerPaused()), + mEffectHandler, SLOT(hideReceiveWindow()) ); + } + + mEngine.setCurrentView(this); + + LC_QDEBUG( "livecomms [UI] <- LcView::activated()" ) +} + +// ----------------------------------------------------------------------------- +// LcView::deactivated +// ----------------------------------------------------------------------------- +// +void LcView::deactivated() +{ + LC_QDEBUG( "livecomms [UI] -> LcView::deactivated()" ) + QRectF sharedContentRect;//null area + QRectF receivedContentRect;//null area + + mEngine.setContentAreas( sharedContentRect, receivedContentRect ); + disconnect( &mEngine, 0, this, 0 ); + + LC_QDEBUG( "livecomms [UI] <- LcView::deactivated()" ) +} + +// ----------------------------------------------------------------------------- +// LcView::notSupported +// ----------------------------------------------------------------------------- +// +void LcView::notSupported() +{ + LC_QDEBUG( "livecomms [UI] -> LcView::notSupported()" ) + + mNotSupportedNote->show(); + toFullScreen( false ); + + LC_QDEBUG( "livecomms [UI] <- LcView::notSupported()" ) +} + +// ----------------------------------------------------------------------------- +// LcView::shareImage +// ----------------------------------------------------------------------------- +// +void LcView::shareImage() +{ + LC_QDEBUG( "livecomms [UI] -> LcView::shareImage()" ) + const char localImageName[] = "c:\\data\\local.jpg"; + QString fileName = QString::fromAscii(localImageName); + mEngine.shareImage(fileName); + LC_QDEBUG( "livecomms [UI] <- LcView::shareImage()" ) +} + +// ----------------------------------------------------------------------------- +// LcView::endVideoSession +// ----------------------------------------------------------------------------- +// +void LcView::endVideoSession() +{ + LC_QDEBUG( "livecomms [UI] -> LcView::endVideoSession()" ) + + mEngine.stop(); + + LC_QDEBUG( "livecomms [UI] <- LcView::endVideoSession()" ) + +} + +// ----------------------------------------------------------------------------- +// LcView::disableCamera +// ----------------------------------------------------------------------------- +// +void LcView::disableCamera() +{ + LC_QDEBUG( "livecomms [UI] -> LcView::disableCamera()" ) + + mEffectHandler->setDissappearEffect( LcEffectHandler::NormalDissappear ); + mEngine.toggleDisableCamera(); + toFullScreen( mEngine.fullScreenMode() ); + + LC_QDEBUG( "livecomms [UI] <- LcView::disableCamera()" ) +} + +// ----------------------------------------------------------------------------- +// LcView::mute +// ----------------------------------------------------------------------------- +// +void LcView::mute() +{ + LC_QDEBUG( "livecomms [UI] -> LcView::mute()" ) + + mEngine.toggleMute(); + toFullScreen( false ); + + LC_QDEBUG( "livecomms [UI] <- LcView::mute()" ) +} + +// ----------------------------------------------------------------------------- +// LcView::changeCamera +// ----------------------------------------------------------------------------- +// +void LcView::changeCamera() +{ + LC_QDEBUG( "livecomms [UI] -> LcView::changeCamera()" ) + + mEffectHandler->setDissappearEffect( LcEffectHandler::DissappearToFlip ); + mEngine.toggleCamera(); + toFullScreen( false ); + + LC_QDEBUG( "livecomms [UI] <- LcView::changeCamera()" ) +} + +// ----------------------------------------------------------------------------- +// LcView::switchToVoiceCall +// ----------------------------------------------------------------------------- +// +void LcView::switchToVoiceCall() +{ + LC_QDEBUG( "livecomms [UI] -> LcView::switchToVoiceCall()" ) + + mEngine.stop(); + + LC_QDEBUG( "livecomms [UI] <- LcView::switchToVoiceCall()" ) +} + +// ----------------------------------------------------------------------------- +// LcView::speaker +// ----------------------------------------------------------------------------- +// +void LcView::speaker() +{ + LC_QDEBUG( "livecomms [UI] -> LcView::speaker()" ) + + mEngine.toggleSpeaker(); + toFullScreen( false ); + + LC_QDEBUG( "livecomms [UI] <- LcView::speaker()" ) +} + +// ----------------------------------------------------------------------------- +// LcView::setCameraActionToMain +// ----------------------------------------------------------------------------- +// +void LcView::setCameraActionToMain() +{ + LC_QDEBUG( "livecomms [UI] -> LcView::setCameraActionToMain()" ) + + if ( mChangeCameraAction ){ + mChangeCameraAction->setIcon (HbIcon( lcIconNameMainCamera )); + } + LC_QDEBUG( "livecomms [UI] <- LcView::setCameraActionToMain()" ) +} + +// ----------------------------------------------------------------------------- +// LcView::setCameraActionToSecondary +// ----------------------------------------------------------------------------- +// +void LcView::setCameraActionToSecondary() +{ + LC_QDEBUG( "livecomms [UI] -> LcView::setCameraActionToSecondary()" ) + + if ( mChangeCameraAction ){ + mChangeCameraAction->setIcon (HbIcon( lcIconNameSecondaryCamera )); + } + LC_QDEBUG( "livecomms [UI] <- LcView::setCameraActionToSecondary()" ) +} + +// ----------------------------------------------------------------------------- +// LcView::setMuteActionToUnmute +// ----------------------------------------------------------------------------- +// +void LcView::setMuteActionToUnmute() +{ + LC_QDEBUG( "livecomms [UI] -> LcView::setMuteActionToUnmute()" ) + + if ( mMuteAction ){ + mMuteAction->setIcon (HbIcon( lcIconNameUnmuteMic )); + } + LC_QDEBUG( "livecomms [UI] <- LcView::setMuteActionToUnmute()" ) +} + +// ----------------------------------------------------------------------------- +// LcView::setMuteActionToMute +// ----------------------------------------------------------------------------- +// +void LcView::setMuteActionToMute() +{ + LC_QDEBUG( "livecomms [UI] -> LcView::setMuteActionToMute()" ) + if ( mMuteAction ){ + mMuteAction->setIcon (HbIcon( lcIconNameMuteMic )); + } + LC_QDEBUG( "livecomms [UI] <- LcView::setMuteActionToMute()" ) +} + +// ----------------------------------------------------------------------------- +// LcView::setSpeakerActionToHandset +// ----------------------------------------------------------------------------- +// +void LcView::setSpeakerActionToHandset() +{ + LC_QDEBUG( "livecomms [UI] -> LcView::setSpeakerActionToHandset()" ) + if ( mSpeakerAction ){ + mSpeakerAction->setIcon (HbIcon( lcIconNameHandset )); + } + LC_QDEBUG( "livecomms [UI] <- LcView::setSpeakerActionToHandset()" ) +} + +// ----------------------------------------------------------------------------- +// LcView::setSpeakerActionToSpeaker +// ----------------------------------------------------------------------------- +// +void LcView::setSpeakerActionToSpeaker() +{ + LC_QDEBUG( "livecomms [UI] -> LcView::setSpeakerActionToSpeaker()" ) + if ( mSpeakerAction ){ + mSpeakerAction->setIcon( HbIcon( lcIconNameLoudspeaker )); + } + LC_QDEBUG( "livecomms [UI] <- LcView::setSpeakerActionToSpeaker()" ) +} + +// ----------------------------------------------------------------------------- +// LcView::setCameraActionToEnable +// ----------------------------------------------------------------------------- +// +void LcView::setCameraActionToEnable() +{ + LC_QDEBUG( "livecomms [UI] -> LcView::setCameraActionToEnable()" ) + + if ( mDisableCameraAction ){ + mDisableCameraAction->setIcon( HbIcon( lcIconNameEnableCamera )); + } + if ( mDisableCameraMenuAction ){ + // TODO: get text from repository as loc id is not the same for mus + mDisableCameraMenuAction->setText( hbTrId( "txt_vt_menu_enable_camera" )); + } + + LC_QDEBUG( "livecomms [UI] <- LcView::setCameraActionToEnable()" ) +} + +// ----------------------------------------------------------------------------- +// LcView::setCameraActionToDisable +// ----------------------------------------------------------------------------- +// +void LcView::setCameraActionToDisable() +{ + LC_QDEBUG( "livecomms [UI] -> LcView::setCameraActionToDisable()" ) + + if ( mDisableCameraAction ){ + mDisableCameraAction->setIcon (HbIcon( lcIconNameDisableCamera )); + } + if ( mDisableCameraMenuAction ){ + // TODO: get text from repository as loc id is not the same for mus + mDisableCameraMenuAction->setText( hbTrId( "txt_vt_menu_disable_camera" )); + } + + LC_QDEBUG( "livecomms [UI] <- LcView::setCameraActionToDisable()" ) +} + +// ----------------------------------------------------------------------------- +// LcView::disableControls +// ----------------------------------------------------------------------------- +// +void LcView::disableControls() +{ + LC_QDEBUG( "livecomms [UI] -> LcView::disableControls()" ) + menu()->setEnabled( false ); + toolBar()->setEnabled( false ); + LC_QDEBUG( "livecomms [UI] <- LcView::disableControls()" ) +} + +// ----------------------------------------------------------------------------- +// LcView::enableControls +// ----------------------------------------------------------------------------- +// +void LcView::enableControls() +{ + LC_QDEBUG( "livecomms [UI] -> LcView::enableControls()" ) + menu()->setEnabled( true ); + toolBar()->setEnabled( true ); + LC_QDEBUG( "livecomms [UI] <- LcView::enableControls()" ) +} + +// ----------------------------------------------------------------------------- +// LcView::gestureEvent +// ----------------------------------------------------------------------------- +// +void LcView::gestureEvent(QGestureEvent *event) +{ + LC_QDEBUG( "livecomms [UI] -> LcView::gestureEvent()" ) + if(HbTapGesture *tap = static_cast(event->gesture(Qt::TapGesture))) { + if ((tap->state() == Qt::GestureUpdated) && + (tap->tapStyleHint() == HbTapGesture::TapAndHold)) { + gestureLongPress(translatePointForOrientation(tap->position())); + } + + else if ( (tap->state() == Qt::GestureFinished ) && + ( tap->tapStyleHint() == HbTapGesture::Tap)) { + + gestureShortPress(); + } + } + LC_QDEBUG( "livecomms [UI] <- LcView::gestureEvent()" ) +} + + +// ----------------------------------------------------------------------------- +// LcView::gestureLongPress +// ----------------------------------------------------------------------------- +// +void LcView::gestureLongPress(QPointF coords) +{ + LC_QDEBUG_2( "livecomms [UI] -> LcView::gestureLongPress(), coords:", coords ) + + bool sharedHit = false; + + if ( mSharedVideoWidget && mSharedVideoWidget->windowFrameGeometry().contains(coords) ) { + LC_QDEBUG( "livecomms [UI] LcView mapped to mSharedVideoWidget" ) + sharedHit = true; + } + + if ( sharedHit ) { + LC_QDEBUG( "livecomms [UI] LcView mapped to mSharedVideoWidget" ) + + createContextMenu(); + mRepository.sharedVideoContextMenuActions( mItemContextMenu, *this ); + + if ( mItemContextMenu->actions().count() > 0 ) { + mItemContextMenu->open(this); + } + } + + LC_QDEBUG( "livecomms [UI] <- LcView::gestureLongPress()" ) +} + + + +// ----------------------------------------------------------------------------- +// LcView::gestureShortPress +// ----------------------------------------------------------------------------- +// +void LcView::gestureShortPress() +{ + LC_QDEBUG( "livecomms [UI] -> LcView::gestureShortPress()" ) + toFullScreen( !mEngine.fullScreenMode() ); + LC_QDEBUG( "livecomms [UI] <- LcView::gestureShortPress()" ) +} + +// ----------------------------------------------------------------------------- +// LcView::createNotSupportedNote +// ----------------------------------------------------------------------------- +// +void LcView::createNotSupportedNote() +{ + LC_QDEBUG( "livecomms [UI] -> LcView::createNotSupportedNote()" ) + + if ( !mNotSupportedNote ){ + mNotSupportedNote = new HbMessageBox(QString("Not supported")); + mNotSupportedNote->setTimeout(HbDialog::StandardTimeout); + mNotSupportedNote->setZValue(LC_NOTE_ON_TOP); + mNotSupportedNote->hide(); + } + + LC_QDEBUG( "livecomms [UI] <- LcView::createNotSupportedNote()" ) +} + + + +// ----------------------------------------------------------------------------- +// LcView::createContextMenu +// ----------------------------------------------------------------------------- +// +void LcView::createContextMenu() +{ + LC_QDEBUG( "livecomms [UI] -> LcView::createContextMenu()" ) + + // mItemContextMenu is destroyed upon close + mItemContextMenu = new HbMenu(); + mItemContextMenu->setDismissPolicy(HbDialog::TapOutside); + mItemContextMenu->setTimeout(HbDialog::ContextMenuTimeout); + mItemContextMenu->setAttribute(Qt::WA_DeleteOnClose); + + LC_QDEBUG( "livecomms [UI] <- LcView::createContextMenu()" ) +} + +// ----------------------------------------------------------------------------- +// LcView::currentLayout +// ----------------------------------------------------------------------------- +// +QString LcView::currentLayout() +{ + QString layout( lcLayoutLandscapeDefaultId ); + + if ( mEffectHandler->isSwapInProgress() && + mSharedVideoWidget && + mReceivedVideoWidget && + mSharedVideoWidget->geometry().left() > mReceivedVideoWidget->geometry().left() ) { + + layout = lcLayoutLandscapeSwappedId; + } + + LC_QDEBUG_2( "livecomms [UI] -> LcView::currentLayout()", layout ) + return layout; +} + + +// ----------------------------------------------------------------------------- +// LcView::menuAboutToShow +// ----------------------------------------------------------------------------- +// +void LcView::menuAboutToShow() +{ + LC_QDEBUG( "livecomms [UI] -> LcView::menuAboutToShow()" ) + toFullScreen( false ); + LC_QDEBUG( "livecomms [UI] <- LcView::menuAboutToShow()" ) +} + +// ----------------------------------------------------------------------------- +// LcView::translateRectForOrientation +// Video windows at engine side do not change their coordinate system +// when orientation at orbit UI changes. Therefore we need to convert video +// rects from landscape coordinate system to portait coordinate system. +// NOTE: Landscape orientation has different rotation in emulator than in HW. +// ----------------------------------------------------------------------------- +// +QRectF LcView::translateRectForOrientation(const QRectF& origRect) +{ + QRectF newRect = origRect; + QMatrix m; +#if ( defined __WINSCW__ ) || ( defined __WINS__ ) + m.rotate(270); + newRect = m.mapRect(newRect); + newRect.translate(0,HbInstance::instance()->allMainWindows().at(0)->rect().height()); +#else + m.rotate(90); + newRect = m.mapRect(newRect); + newRect.translate(HbInstance::instance()->allMainWindows().at(0)->rect().width(),0); +#endif + return newRect; +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +QPointF LcView::translatePointForOrientation(const QPointF& origPoint) +{ + QPointF newPoint = origPoint; + QMatrix m; +#if ( defined __WINSCW__ ) || ( defined __WINS__ ) + m.translate(HbInstance::instance()->allMainWindows().at(0)->rect().height(),0); + m.rotate(90); + newPoint = m.map(newPoint); +#else + m.translate(0,HbInstance::instance()->allMainWindows().at(0)->rect().width()); + m.rotate(270); + newPoint = m.map(newPoint); +#endif + return newPoint; +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void LcView::setVisibility( QGraphicsItem* item, bool visible ) +{ + if ( item ) { + item->setVisible(visible); + } +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void LcView::addOptionsMenuActions() +{ + HbAction* swapAction = static_cast( + mRepository.findObject(lcActSwapViewsId)); + menu()->addAction(swapAction); + + HbAction* openKeypadAction = static_cast( + mRepository.findObject(lcActOpenKeypadId)); + menu()->addAction(openKeypadAction); +} + +// ----------------------------------------------------------------------------- +// LcView::openDialpad() +// ----------------------------------------------------------------------------- +// +void LcView::openDialpad() +{ + LC_QDEBUG("livecomms [UI] -> LcView::openDialpad()") + mRepository.loadLayout( lcLayoutLandscapeDialpadId ); + if ( mEffectHandler )mEffectHandler->startEffects(); + mDialpad->openDialpad(); + mDialpad->setCallButtonEnabled(false); + menu()->clearActions(); + LC_QDEBUG("livecomms [UI] <- LcView::openDialpad()") +} + +// ----------------------------------------------------------------------------- +// LcView::dialpadOpened() +// ----------------------------------------------------------------------------- +// +void LcView::dialpadOpened() +{ + LC_QDEBUG("livecomms [UI] <-> LcView::dialpadOpened()") + toolBar()->setVisible( false ); + setTitleBarVisible( true ); +} + +// ----------------------------------------------------------------------------- +// LcView::dialpadClosed() +// ----------------------------------------------------------------------------- +// +void LcView::dialpadClosed() +{ + LC_QDEBUG("livecomms [UI] -> LcView::dialpadClosed()") + mDialpad->editor().setText(QString()); + addOptionsMenuActions(); + // switch back to the previous layout + QString pLayout = mRepository.previousLayout(); + QString layout; + bool isSwapped = (pLayout == lcLayoutLandscapeDefaultId) + ? false : true; + layout = (isSwapped) ? + lcLayoutLandscapeSwappedId : lcLayoutLandscapeDefaultId; + + mRepository.loadLayout( layout ); + if ( mEffectHandler ){ + mEffectHandler->startEffects(); + } + toFullScreen(false); + LC_QDEBUG("livecomms [UI] <- LcView::dialpadClosed()") +} + +// ----------------------------------------------------------------------------- +// LcView::dialpadEditorTextChanged() +// ----------------------------------------------------------------------------- +// +void LcView::dialpadEditorTextChanged() +{ + LC_QDEBUG_2("livecomms [UI] -> Dial Pad Field ", mDialpad->editor().text()); + + if ( mDialpad->editor().text().length() > 0 ) { + LC_QDEBUG_2("livecomms [UI] -> Last Dialled Charcter ", mDialpad->editor().text().right(1)); + bool dialPadStatus = mEngine.SendDialTone(mDialpad->editor().text().right(1).at(0)); + LC_QDEBUG_2("livecomms [UI] -> Dialpad Send Tone Status ",dialPadStatus) + } +} + +// ----------------------------------------------------------------------------- +// LcView::back +// ----------------------------------------------------------------------------- +// +void LcView::back() +{ + LC_QDEBUG("livecomms [UI] -> LcView::back()") + if ( mDialpad && mDialpad->isOpen()) { + LC_QDEBUG("livecomms [UI] - Closing dialpad") + mDialpad->closeDialpad(); + } else { + mEngine.minimize(); + } + + LC_QDEBUG("livecomms [UI] <- LcView::back()") +} + +// ----------------------------------------------------------------------------- +// LcView::timerEvent +// ----------------------------------------------------------------------------- +// +void LcView::timerEvent( QTimerEvent * event ) +{ + if ( event->timerId() == timerId ){ + LC_QDEBUG("livecomms [UI] -> LcView::timerEvent() inActivity Timeout") + killTimer( timerId ); + toFullScreen(true); + } +} + +// ----------------------------------------------------------------------------- +// LcView::watchInactivity +// ----------------------------------------------------------------------------- +// +void LcView::watchInactivity() +{ + if( !mEngine.fullScreenMode() && !( mDialpad && mDialpad->isOpen() ) ){ + LC_QDEBUG("livecomms [UI] - LcView::watchInactivity() start watching inactivity") + killTimer( timerId ); + timerId = startTimer( inActivityTimeout ); + } +} + +// ----------------------------------------------------------------------------- +// LcView::toFullScreen utility function +// ----------------------------------------------------------------------------- +// +void LcView::toFullScreen( bool fullscreen ) +{ + LC_QDEBUG_2("livecomms [UI] - LcView::toFullScreen(),",fullscreen) + if( menu()->isVisible() || ( mDialpad && mDialpad->isOpen() ) ) return; + mEngine.setFullScreenMode( fullscreen ); + setTitleBarVisible( !fullscreen ); + setStatusBarVisible( !fullscreen ); + toolBar()->setVisible( !fullscreen ); + setVisibility( mEndCallButton, !fullscreen ); + setVisibility( mDuration, !fullscreen ); + setVisibility( mRecipient, !fullscreen ); + emit contentFullScreenChanged(); +} + + +// ----------------------------------------------------------------------------- +// LcView::isVideoPositionedCorrectly utility function +// ----------------------------------------------------------------------------- +// +bool LcView::isVideoPositionedCorrectly( LcVideoWidget* mVideoWidget ) +{ + LC_QDEBUG("livecomms [UI] -> LcView::isVideoPositionedCorrectly()") + LC_QDEBUG("livecomms [UI] <- LcView::isVideoPositionedCorrectly()") + QPointF initialPosition(0,0); + return ( !mVideoWidget || + (( mVideoWidget ) && ( mVideoWidget->pos()!= initialPosition ))); +} + +// ----------------------------------------------------------------------------- +// LcView::isPositioned utility function +// hack style since orbit give viewready much earlier and widgets do not have +// proper co-ordinates. +// ----------------------------------------------------------------------------- +// +bool LcView::isPositioned() +{ + LC_QDEBUG("livecomms [UI] -> LcView::isPositioned()") + // at first time check for video positions if they are not ready + // wait for x or y changed event and recheck position. + // After firsttime it will work. + if( !isViewReady ){ + isViewReady = isVideoPositionedCorrectly( mSharedVideoWidget ) && + isVideoPositionedCorrectly( mReceivedVideoWidget ); + if( isViewReady ){ + if ( mSharedVideoWidget ) { + disconnect( mSharedVideoWidget, SIGNAL( xChanged() ), this, + SLOT( updateVideoRects() ) ); + disconnect( mSharedVideoWidget, SIGNAL( yChanged() ), this, + SLOT( updateVideoRects() ) ); + } + if ( mReceivedVideoWidget ) { + disconnect( mReceivedVideoWidget, SIGNAL( xChanged() ), this, + SLOT( updateVideoRects() ) ); + disconnect( mReceivedVideoWidget, SIGNAL( yChanged() ), this, + SLOT( updateVideoRects() ) ); + } + } + } + LC_QDEBUG_2("livecomms [UI] - LcView::isPositioned(),",isViewReady) + return isViewReady; +} +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/src/lcviewmanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/src/lcviewmanager.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,59 @@ +/* +* 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: +* +*/ + +//USER +#include "lcviewmanager.h" +#include "lcviewmanager_p.h" +#include "lclogger.h" + + + +// ----------------------------------------------------------------------------- +// LcViewManager::LcViewManager +// ----------------------------------------------------------------------------- +// +LcViewManager::LcViewManager( const QString &engineName, + const QString &applicationDisplayName) +{ + + d_ptr = new LcViewManagerPrivate( engineName, applicationDisplayName ); + +} + + +// ----------------------------------------------------------------------------- +// LcViewManager::~LcViewManager +// ----------------------------------------------------------------------------- +// +LcViewManager::~LcViewManager() +{ + delete d_ptr; +} + + +// ----------------------------------------------------------------------------- +// LcViewManager::terminateSession +// ----------------------------------------------------------------------------- +// +void LcViewManager::terminateSession() +{ + d_ptr->terminateSession(); +} + + +// End of file + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/src/lcviewmanager_p.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/src/lcviewmanager_p.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,279 @@ +/* +* 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: +* +*/ + +// USER INCLUDES +#include "lcviewmanager_p.h" +#include "lcuicomponentrepository.h" +#include "lcuidefs.h" +#include "lcuiengine.h" +#include "lcview.h" +#include "lclogger.h" + +// SYSTEM INCLUDES +#include +#include +#include +#include +#include +#include +#include + +// CONSTANTS +#define LC_VIEWMANAGER_SLOT_ACTIVATE_CURRENT_VIEW "activateCurrentView" + + + +// ----------------------------------------------------------------------------- +// LcMainWindow::LcMainWindow +// ----------------------------------------------------------------------------- +// +LcMainWindow::LcMainWindow() : + HbMainWindow(0, Hb::WindowFlagFixedHorizontal | Hb::WindowFlagTransparent) +{ + // TODO: remove flag WindowFlagFixedHorizontal if portait layout + // is going to be supported. +} + +// ----------------------------------------------------------------------------- +// LcMainWindow::~LcMainWindow +// ----------------------------------------------------------------------------- +// +LcMainWindow::~LcMainWindow() +{ +} + +// ----------------------------------------------------------------------------- +// LcMainWindow::event +// ----------------------------------------------------------------------------- +// +bool LcMainWindow::event(QEvent *event) +{ + if ( event->type() == QEvent::FocusIn ){ + LC_QDEBUG( "livecomms [UI] -> LcMainWindow::event(), focus in" ) + emit appFocusGained(); + } else if ( event->type() == QEvent::FocusOut ){ + LC_QDEBUG( "livecomms [UI] -> LcMainWindow::event(), focus out" ) + emit appFocusLost(); + } + return HbMainWindow::event(event); +} + +// ----------------------------------------------------------------------------- +// LcViewManagerPrivate::LcViewManagerPrivate +// ----------------------------------------------------------------------------- +// +LcViewManagerPrivate::LcViewManagerPrivate( + const QString& engineName, + const QString& applicationDisplayName) : + mEngine( 0 ), + mRepository( 0 ) +{ + LC_QDEBUG( "livecomms [UI] -> LcViewManagerPrivate::LcViewManagerPrivate()" ) + + mEngine = new LcUiEngine( engineName, applicationDisplayName ); + mRepository = new LcUiComponentRepository( *mEngine ); + setCurrentView( true ); + + connect(&mMainWindow, SIGNAL(appFocusGained()), mEngine, SLOT(maximize())); + connect(&mMainWindow, SIGNAL(appFocusLost()), mEngine, SLOT(minimize())); + + LC_QDEBUG( "livecomms [UI] <- LcViewManagerPrivate::LcViewManagerPrivate()" ) +} + +// ----------------------------------------------------------------------------- +// LcViewManagerPrivate::~LcViewManagerPrivate +// ----------------------------------------------------------------------------- +// +LcViewManagerPrivate::~LcViewManagerPrivate() +{ + LC_QDEBUG( "livecomms [UI] -> LcViewManagerPrivate::~LcViewManagerPrivate()" ) + + QList views = mMainWindow.views(); + foreach( HbView* view, views ){ + mMainWindow.removeView(view); + } + delete mRepository; + delete mEngine; + + LC_QDEBUG( "livecomms [UI] <- LcViewManagerPrivate::~LcViewManagerPrivate()" ) +} + +// ----------------------------------------------------------------------------- +// LcViewManagerPrivate::terminateSession +// ----------------------------------------------------------------------------- +// +void LcViewManagerPrivate::terminateSession() +{ + LC_QDEBUG( "livecomms [UI] -> LcViewManagerPrivate::terminateSession" ) + mEngine->stop(); + LC_QDEBUG( "livecomms [UI] <- LcViewManagerPrivate::terminateSession" ) +} + + +// ----------------------------------------------------------------------------- +// LcViewManagerPrivate::prepareOrientationChange +// ----------------------------------------------------------------------------- +// +void LcViewManagerPrivate::prepareOrientationChange() +{ + LC_QDEBUG( "livecomms [UI] -> LcViewManagerPrivate::prepareOrientationChange()" ) + LC_QDEBUG( "livecomms [UI] <- LcViewManagerPrivate::prepareOrientationChange()" ) +} + +// ----------------------------------------------------------------------------- +// LcViewManagerPrivate::activateCurrentView +// ----------------------------------------------------------------------------- +// +void LcViewManagerPrivate::activateCurrentView(bool startup) +{ + LC_QDEBUG( "livecomms [UI] -> LcViewManagerPrivate::activateCurrentView()" ) + if ( mMainWindow.currentView() ) { + static_cast( mMainWindow.currentView() )->activated(); + } + + if ( startup ){ + LC_QDEBUG( "livecomms [UI] Start engine" ) + startEngine(); + } + LC_QDEBUG( "livecomms [UI] <- LcViewManagerPrivate::activateCurrentView()" ) +} + +// ----------------------------------------------------------------------------- +// LcViewManagerPrivate::startEngine +// ----------------------------------------------------------------------------- +// +void LcViewManagerPrivate::startEngine() +{ + connect(mEngine, SIGNAL(layoutChanged()), this, SLOT(changeView()), + Qt::QueuedConnection ); + connect(mEngine, SIGNAL(stopped()), this, SLOT(closeApp()), + Qt::QueuedConnection ); + + mEngine->setUiComponents( mRepository->invitingNote(), + mRepository->waitingNote(), + mRepository->acceptQuery(), + mRepository->recipientQuery(), + mRepository->shareOwnVideoQuery() ); + mEngine->start(); +} + +// ----------------------------------------------------------------------------- +// LcViewManagerPrivate::setCurrentView +// ----------------------------------------------------------------------------- +// +void LcViewManagerPrivate::setCurrentView(bool startup) +{ + LC_QDEBUG( "livecomms [UI] -> LcViewManagerPrivate::setCurrentView()" ) + + LcView* currView = currentView(); + + bool found(false); + foreach ( HbView* view, mMainWindow.views() ){ + found |= ( view == currView ); + } + if ( !found ){ + mMainWindow.addView( currView ); + } + mMainWindow.setCurrentView( currView ); + + LcUtil::asyncSlotCall( + this, LC_VIEWMANAGER_SLOT_ACTIVATE_CURRENT_VIEW, Q_ARG( bool, startup ) ); + + LC_QDEBUG( "livecomms [UI] <- LcViewManagerPrivate::setCurrentView()" ) +} + +// ----------------------------------------------------------------------------- +// LcViewManagerPrivate::currentView +// ----------------------------------------------------------------------------- +// +LcView* LcViewManagerPrivate::currentView() +{ + LC_QDEBUG( "livecomms [UI] -> LcViewManagerPrivate::currentView()" ) + + LcViewLayoutHint hint = mEngine->viewLayout(); + LcView* nextView = 0; + + switch ( hint ) { + case Lc_ReceivedViewLayout: + LC_QDEBUG( "livecomms [UI] - switching to receive view -" ) + nextView = mRepository->receiveView(); + break; + case Lc_ReceivedOnlyViewLayout: + LC_QDEBUG( "livecomms [UI] - switching to receive only view -" ) + nextView = mRepository->receiveOnlyView(); + break; + case Lc_AllInOneViewLayout: + LC_QDEBUG( "livecomms [UI] - switching to allinone view -" ) + nextView = mRepository->allInOneView(); + break; + case Lc_TwowayViewLayout: + LC_QDEBUG( "livecomms [UI] - switching to twoway view -" ) + nextView = mRepository->twowayView(); + break; + case Lc_SharedViewLayout: + LC_QDEBUG( "livecomms [UI] - switching to send view -" ) + nextView = mRepository->sendView(); + break; + default: + LC_QDEBUG( "livecomms [UI] - switching to idle view -" ) + nextView = mRepository->idleView(); + break; + } + if ( !nextView && hint > Lc_IdleViewLayout ) { + LC_QDEBUG( "livecomms [UI] ! could not get view !" ) + LC_QDEBUG( "livecomms [UI] - switching to idle view -" ) + nextView = mRepository->idleView(); + } + + if ( !nextView ) { + LC_QCRITICAL( "livecomms [UI] ! still could not get view !. ABORT" ) + LC_PANIC(); + } + + LC_QDEBUG( "livecomms [UI] <- LcViewManagerPrivate::currentView()" ) + return nextView; +} + +// ----------------------------------------------------------------------------- +// LcViewManagerPrivate::changeView +// ----------------------------------------------------------------------------- +// +void LcViewManagerPrivate::changeView() +{ + LC_QDEBUG( "livecomms [UI] -> LcViewManagerPrivate::changeView()" ) + + LcView* currentView = static_cast( mMainWindow.currentView() ); + currentView->deactivated(); + setCurrentView(); + + LC_QDEBUG( "livecomms [UI] <- LcViewManagerPrivate::changeView()" ) +} + +// ----------------------------------------------------------------------------- +// LcViewManagerPrivate::closeApp +// ----------------------------------------------------------------------------- +// +void LcViewManagerPrivate::closeApp() +{ + LC_QDEBUG( "livecomms [UI] -> LcViewManagerPrivate::closeApp()" ) + + qApp->exit(0); + + LC_QDEBUG( "livecomms [UI] <- LcViewManagerPrivate::closeApp()" ) +} + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/data/20021341.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/data/20021341.rss Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,40 @@ +/* +* 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 "registryinfov2.rh" + +RESOURCE REGISTRY_INFO theInfo + { + resource_format_version = RESOURCE_FORMAT_VERSION_2; + dll_uid = 0x20021341; + interfaces = + { + INTERFACE_INFO + { + interface_uid = 0x20021340; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x20021341; + version_no = 1; + default_data = "MultimediaSharing"; + } + }; + } + }; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/group/bld.inf Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,23 @@ +/* +* 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 + +PRJ_MMPFILES +dummymusengineplugin.mmp + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/group/dummymusengineplugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/group/dummymusengineplugin.mmp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,82 @@ +/* +* 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 + +TARGET musengineplugin.dll +TARGETTYPE PLUGIN +UID 0x10009D8D 0x20021341 +VENDORID VID_DEFAULT +CAPABILITY CAP_ECOM_PLUGIN + +SOURCEPATH ../data +START RESOURCE 20021341.rss +TARGET musengineplugin.rsc +END + +SOURCEPATH ../src +SOURCE musenginepluginentry.cpp +SOURCE musengsessionmanager.cpp + + +SOURCE musengmcesession.cpp +SOURCE musengtwowaysession.cpp +SOURCE musengcamerahandler.cpp +SOURCE musengvideoplayerbase.cpp +SOURCE musenglocalvideoplayer.cpp +SOURCE musenglivevideoplayer.cpp +SOURCE musengremotevideoplayer.cpp +SOURCE svptimer.cpp +SOURCE mccdatasender.cpp +SOURCE mccdatareceiver.cpp musenglivesession.cpp + +/* +SOURCE musengmceoutsession.cpp +SOURCE musenglivesession.cpp +SOURCE musengreceivesession.cpp +SOURCE musengtwowayrecvsession.cpp + +SOURCE musengtelephoneutils.cpp +SOURCE musengsessiondurationtimer.cpp +SOURCE musengclipsession.cpp +SOURCE musenguriparser.cpp +SOURCE musengmceutils.cpp +SOURCE mussipprofilehandler.cpp +SOURCE musengclipvideoplayer.cpp +*/ + +USERINCLUDE ../inc +USERINCLUDE ../../../../../../inc +USERINCLUDE ../../../../../mmshengine/inc + +APP_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/ecom + +LIBRARY euser.lib +LIBRARY bafl.lib +LIBRARY inetprotutil.lib +LIBRARY phoneclient.lib +LIBRARY centralrepository.lib +LIBRARY sipprofilecli.lib +LIBRARY sipclient.lib +LIBRARY sipcodec.lib +LIBRARY mceclient.lib +LIBRARY drmcommon.lib +LIBRARY charconv.lib +LIBRARY telephonyaudiorouting.lib +LIBRARY cntmodel.lib ecom.lib +DEBUGLIBRARY flogger.lib diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/inc/mccdatareceiver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/inc/mccdatareceiver.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,63 @@ +/* +* 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: +* +*/ + + + + +#ifndef MCCDATARECEIVER_H +#define MCCDATARECEIVER_H +#include +#include + +#include "mccdatareceiverobserver.h" +#include "mccdatastructures.h" + + +// CLASS DECLARATION + +/** +* CMccDataReceiver class declaration +*/ +class CMccDataReceiver : public CActive + { + public: + + static CMccDataReceiver* NewL( MMccDataReceiverObserver& aObserver ); + + ~CMccDataReceiver(); + + TDataMessage iInitData; + + public: // From CActive + + void DoCancel(); + void RunL(); + TInt RunError(TInt aError); + + private: + CMccDataReceiver( MMccDataReceiverObserver& aObserver ); + void ConstructL(); // second construction phase + + private: + + RMsgQueue iMsgQueue; + MMccDataReceiverObserver* iObserver; + + }; + + +#endif \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/inc/mccdatareceiverobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/inc/mccdatareceiverobserver.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,41 @@ +/* +* 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: +* +*/ + + + + +#ifndef MCCDATARECEIVEROBSERVER_H +#define MCCDATARECEIVEROBSERVER_H + +#include +#include "mccdatastructures.h" + +// CLASS DECLARATION + +/** +* CMccDataReceiver class declaration +*/ +class MMccDataReceiverObserver + { + public: + + virtual void DataReceived( const TDataMessage& aData ) = 0; + + }; + + +#endif \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/inc/mccdatasender.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/inc/mccdatasender.h Thu Jul 22 16:32:26 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: +* +*/ + + + + +#ifndef MCCDATASENDER_H +#define MCCDATASENDER_H +#include +#include + +#include "mccdatastructures.h" + + +// CLASS DECLARATION + +/** +* CMccPeriodicRunner class declaration +*/ +class CMccDataSender : public CActive + { + public: + + static CMccDataSender* NewL(); + + ~CMccDataSender(); + + public: + + void Send( const TDataMessage& aData ); + + public: // From CActive + + void DoCancel(); + void RunL(); + TInt RunError(TInt aError); + + private: + CMccDataSender(); + void ConstructL(); // second construction phase + + private: + + RMsgQueue iMsgQueue; + TDataMessage iBuffer; + + }; + + +#endif \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/inc/mccdatastructures.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/inc/mccdatastructures.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,48 @@ +/* +* 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: +* +*/ + + + + +#ifndef MCCDATASTRUCTURES_H +#define MCCDATASTRUCTURES_H + +#include + +enum TDataId +{ + EUninitialized, + EInitComplete, + EEstablish, + EProceeding, + EEstablished, + ETerminate, + ETerminated +}; + +class TDataMessage +{ +public: + TDataId iDataId; + TInt iDataIntValue; + TBuf<50> iDataBufValue; + +}; + + + +#endif \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/inc/musengcamerahandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/inc/musengcamerahandler.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,111 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef MUSHENGCAMERAHANDLER_H +#define MUSHENGCAMERAHANDLER_H + +// USER +#include "lccameracontrol.h" +#include "lcbrightnesscontrol.h" +#include "lczoomcontrol.h" + +// SYSTEM +#include +#include + + +// CLASS + +class TMusEngCameraHandler : + 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: + + TMusEngCameraHandler(); + + TInt ZoomStepSize( TInt64& aTime ); + + private: + + enum TCurrentCamera + { + ECameraNotAvailable = KErrNotFound, + EBackCamera = 0, + EFrontCamera = 1 + }; + + + private: // Data + + + TCameraInfo iCameraInfo; + + TInt iDefaultBrightness; + + TInt64 iZoomInTime; + + TInt64 iZoomOutTime; + + TInt iSmallZoomStep; + + TInt iBigZoomStep; + + TCurrentCamera iCurrentCamera; + }; + +#endif + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/inc/musengdisplayhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/inc/musengdisplayhandler.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,109 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef MUSHENGDISPLAYHANDLER_H +#define MUSHENGDISPLAYHANDLER_H + + +#include + +// CLASS DECLARATION + +/** +* An Interface for display services +* +* @lib museng.lib +* @since S60 v3.2 +*/ +class MMusEngDisplayHandler + { + + public: + + /* + * Defines possible rotations + */ + enum TDisplayOrientation + { + EPortrait, // Normal + ELandscape // 90 degree's clockwise rotation + }; + + /** + * Returns currently assigned drawing area + * + * @return TRect This session drawing area rectangle + */ + virtual TRect Rect() const = 0; + + /** + * Sets new drawing area + * + * @param TRect This session new drawing area rectangle + */ + virtual void SetRectL( const TRect& aRect ) = 0; + + /** + * Sets secondary rect (e.g. viewfinder in twoway session) + * @param TRect This session new secondary drawing area rectangle + */ + virtual void SetSecondaryRectL( const TRect& aSecondaryRect ) = 0; + + /** + * Gets secondary rect. + * @return TRect This session secondary drawing area rectangle + */ + virtual TRect SecondaryRect() const = 0; + + /** + * Enables or disables display. Call to this function is considered + * as a permission or denial to draw to the display. + */ + virtual void EnableDisplayL( TBool aEnable ) = 0; + + /** + * Check whether display is enabled + */ + virtual TBool IsDisplayEnabled() = 0; + + /** + * Returns current display orientation. + * + * @pre Session is ongoing + * @return Current display orientation + * @leave KErrNotReady if precondition is not fullfilled + */ + virtual TDisplayOrientation OrientationL() = 0; + + /** + * Sets display orientation. + * + * @pre Session is ongoing + * @return Sets display orientation + * @leave KErrNotReady if precondition is not fullfilled + */ + virtual void SetOrientationL( TDisplayOrientation aOrientation ) = 0; + + /** + * Check if display is actively displaying content + * @return ETrue if is displaying content, otherwise EFalse + */ + virtual TBool IsDisplayActive() = 0; + }; + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/inc/musenglivesession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/inc/musenglivesession.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,86 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef MUSHENGLIVESESSION_H +#define MUSHENGLIVESESSION_H + +// USER +#include "musengmcesession.h" + +// SYSTEM +#include + +// FORWARD DECLARATIONS +class MMusEngLiveSessionObserver; +class CMceDisplaySink; +class MMusEngTwoWaySessionObserver; +class CMusEngRemoteVideoPlayer; + + +class CMusEngLiveSession : public CMusEngMceSession + { + public: + /** + * Creates new MultimediaSharing Live session. + * @return CMusEngLiveSession* New instanse of specified class + */ + static CMusEngLiveSession* NewL(); + + + public: + + /** + * Destructor + */ + ~CMusEngLiveSession(); + + public: + + void EnableDisplayL( TBool aEnable ); + + void SetOrientationL( MMusEngDisplayHandler::TDisplayOrientation aOrientation ); + + void EstablishLcSessionL(); + + void TerminateLcSessionL(); + + public: + + /** + * Sets both remote (receiving video) and local (viewfinder) rects. + * + */ + void SetRectsL( const TRect& aRemoteRect, + const TRect& aLocalRect ); + + private: + + /** + * Constructor + */ + CMusEngLiveSession(); + + /** + * Second-phase constructor + */ + void ConstructL(); + + }; + +#endif + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/inc/musenglivevideoplayer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/inc/musenglivevideoplayer.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,83 @@ +/* +* 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 MUSHENGLIVEVIDEOPLAYER_H +#define MUSHENGLIVEVIDEOPLAYER_H + +// INCLUDES +#include "musenglocalvideoplayer.h" +#include "lcdestinationfilecontrol.h" + +// FORWARD DECLARATIONS +class CMceSession; +class TMusEngCameraHandler; + +// CLASS DECLARATION +class CMusEngLiveVideoPlayer : + public CMusEngLocalVideoPlayer, + public MLcDestinationFileControl + { + public: // Constructors and destructor + + static CMusEngLiveVideoPlayer* NewL( + MMusEngDisplayHandler& aDisplayHandler, + TMusEngCameraHandler& aCameraHandler, + MLcAudioControl& aLcAudioControl ); + + ~CMusEngLiveVideoPlayer(); + + public: // From MLcVideoPlayer + + TBool LcIsPlayingL(); + + void LcPlayL(); + + void LcPauseL(); + + MLcCameraControl* LcCameraControl(); + + MLcDestinationFileControl* LcDestinationFileControl(); + + MLcZoomControl* LcZoomControl(); + + MLcBrightnessControl* LcBrightnessControl(); + + public: // From MLcDestinationFileControl + + void SetLcFileNameL( const TFileName& aFileName ); + + TFileName& LcFileName(); + + void LcRecordL( TBool aRecord ); + + TBool LcIsRecording(); + + private: // Constructors + + CMusEngLiveVideoPlayer( + MMusEngDisplayHandler& aDisplayHandler, + TMusEngCameraHandler& aCameraHandler, + MLcAudioControl& aLcAudioControl ); + + private: // Data + + TFileName iFileName; + TMusEngCameraHandler& iCameraHandler; + }; + +#endif // MUSHENGLIVEVIDEOPLAYER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/inc/musenglocalvideoplayer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/inc/musenglocalvideoplayer.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,47 @@ +/* +* 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 MUSHENGLOCALVIDEOPLAYER_H +#define MUSHENGLOCALVIDEOPLAYER_H + +// INCLUDES +#include "musengvideoplayerbase.h" + +// CLASS DECLARATION +class CMusEngLocalVideoPlayer : public CMusEngVideoPlayerBase + { + public: // Constructors and destructor + + ~CMusEngLocalVideoPlayer(); + + public: // from CMusEngVideoPlayerBase + + TLcVideoPlayerState LcVideoPlayerState() const; + + void SetLcWindowRectL( TRect aRect ); + + TRect LcWindowRect(); + + protected: // Constructors + + CMusEngLocalVideoPlayer( + MMusEngDisplayHandler& aDisplayHandler, + MLcAudioControl& aLcAudioControl ); + }; + +#endif // MUSHENGLOCALVIDEOPLAYER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/inc/musenglogger.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/inc/musenglogger.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,301 @@ +/* +* 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: ?Description +* +*/ + + +#ifndef MUSENGLOGGER_H +#define MUSENGLOGGER_H + + +#include "muslogger.h" + +#if ( !_DEBUG || UNIT_TESTING ) // release or unit test build; no logs + +#define MUS_ENG_LOG_SESSION_STATE( aSession ) +#define MUS_ENG_LOG_SESSION_STATE_AND_STATUS( aSession, aStatusCode, aReasonPhrase ) +#define MUS_ENG_LOG_STREAM_STATE( aStream ) +#define MUS_ENG_LOG_SINK_STATES( aStream ) +#define MUS_ENG_LOG_SOURCE_STATE( aSource ) +#define MUS_ENG_LOG_SINK_STATE( aSink ) +#define MUS_ENG_LOG_STATUS( aStatusCode, aReasonPhrase ) + +#else // debug build; logs + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define MUS_ENG_LOG_SESSION_STATE( aSession )\ + {\ + TBuf<15> state;\ + switch ( (aSession).State() )\ + {\ + case CMceSession::EIdle:\ + {\ + state = _L("EIdle");\ + break;\ + }\ + case CMceSession::EOffering :\ + {\ + state = _L("EOffering");\ + break;\ + }\ + case CMceSession::EIncoming:\ + {\ + state = _L("EIncoming");\ + break;\ + }\ + case CMceSession::EReserving :\ + {\ + state = _L("EReserving");\ + break;\ + }\ + case CMceSession::EAnswering :\ + {\ + state = _L("EAnswering");\ + break;\ + }\ + case CMceSession::EProceeding :\ + {\ + state = _L("EProceeding");\ + break;\ + }\ + case CMceSession::EEstablished:\ + {\ + state = _L("EEstablished");\ + break;\ + }\ + case CMceSession::ECancelling:\ + {\ + state = _L("ECancelling");\ + break;\ + }\ + case CMceSession::ETerminating:\ + {\ + state = _L("ETerminating");\ + break;\ + }\ + case CMceSession::ETerminated:\ + {\ + state = _L("ETerminated");\ + break;\ + }\ + default:\ + {\ + state = _L("Unknown");\ + break;\ + }\ + }\ + MUS_LOG_TDESC( "mus: [ENGINE] Session state is ", state )\ + } + + +#define MUS_ENG_LOG_SESSION_STATE_AND_STATUS( aSession, aStatusCode, aReasonPhrase )\ + {\ + MUS_ENG_LOG_SESSION_STATE( aSession )\ + MUS_ENG_LOG_STATUS( aStatusCode, aReasonPhrase )\ + } + + +#define MUS_ENG_LOG_STREAM_STATE( aStream )\ + {\ + TBuf<20> streamState;\ + switch ( (aStream).State() )\ + {\ + case CMceMediaStream::EUninitialized:\ + {\ + streamState = _L("EIdle");\ + break;\ + }\ + case CMceMediaStream::EInitialized:\ + {\ + streamState = _L("EInitialized");\ + break;\ + }\ + case CMceMediaStream::EBuffering:\ + {\ + streamState = _L("EBuffering");\ + break;\ + }\ + case CMceMediaStream::EIdle:\ + {\ + streamState = _L("EIdle");\ + break;\ + }\ + case CMceMediaStream::EStreaming:\ + {\ + streamState = _L("EStreaming");\ + break;\ + }\ + case CMceMediaStream::EDisabled:\ + {\ + streamState = _L("EDisabled");\ + break;\ + }\ + case CMceMediaStream::ENoResources:\ + {\ + streamState = _L("ENoResources");\ + break;\ + }\ + case CMceMediaStream::ETranscodingRequired:\ + {\ + streamState = _L("ETranscodingRequired");\ + break;\ + }\ + case CMceMediaStream::ETranscoding:\ + {\ + streamState = _L("ETranscoding");\ + break;\ + }\ + default:\ + {\ + streamState = _L("Unknown");\ + break;\ + }\ + }\ + if ( (aStream).Type() == KMceAudio )\ + {\ + MUS_LOG_TDESC( "mus: [ENGINE] AudioStream state is ", streamState )\ + }\ + else\ + {\ + MUS_LOG_TDESC( "mus: [ENGINE] VideoStream state is ", streamState )\ + }\ + MUS_ENG_LOG_SOURCE_STATE( (aStream).Source() )\ + MUS_ENG_LOG_SINK_STATES( (aStream) )\ + } + + +#define MUS_ENG_LOG_SINK_STATES( aStream )\ + {\ + for ( TInt sinkIndex = 0; sinkIndex < aStream.Sinks().Count(); ++sinkIndex )\ + {\ + MUS_ENG_LOG_SINK_STATE( aStream.Sinks()[ sinkIndex ] )\ + }\ + } + + +#define MUS_ENG_LOG_SOURCE_STATE( aSource )\ + {\ + if ( aSource )\ + {\ + TBuf<10> sourceState;\ + if ( aSource->IsEnabled() )\ + {\ + sourceState = _L("enabled");\ + }\ + else\ + {\ + sourceState = _L("disabled");\ + }\ + switch ( aSource->Type() )\ + {\ + case KMceCameraSource:\ + {\ + MUS_LOG_TDESC( " CameraSource is ", sourceState )\ + break;\ + }\ + case KMceFileSource:\ + {\ + MUS_LOG_TDESC( " FileSource is ", sourceState )\ + break;\ + }\ + case KMceRTPSource:\ + {\ + MUS_LOG_TDESC( " RtpSource is ", sourceState )\ + break;\ + }\ + default:\ + {\ + MUS_LOG_TDESC( " UnknownSource is ", sourceState )\ + break;\ + }\ + }\ + }\ + else\ + {\ + MUS_LOG( " No source in stream" )\ + }\ + } + +#define MUS_ENG_LOG_SINK_STATE( aSink )\ + {\ + if ( aSink )\ + {\ + TBuf<10> sinkState;\ + if ( aSink->IsEnabled() )\ + {\ + sinkState = _L("enabled");\ + }\ + else\ + {\ + sinkState = _L("disabled");\ + }\ + switch ( aSink->Type() )\ + {\ + case KMceDisplaySink:\ + {\ + MUS_LOG_TDESC( " DisplaySink is ", sinkState )\ + break;\ + }\ + case KMceSpeakerSink:\ + {\ + MUS_LOG_TDESC( " SpeakerSink is ", sinkState )\ + break;\ + }\ + case KMceRTPSink:\ + {\ + MUS_LOG_TDESC( " RtpSink is ", sinkState )\ + break;\ + }\ + case KMceFileSink:\ + {\ + MUS_LOG_TDESC( " FileSink is ", sinkState )\ + break;\ + }\ + default:\ + {\ + MUS_LOG_TDESC( " UnknownSink is ", sinkState )\ + break;\ + }\ + }\ + }\ + } + + +#define MUS_ENG_LOG_STATUS( aStatusCode, aReasonPhrase )\ + {\ + MUS_LOG1( " StatusCode is %d", aStatusCode )\ + HBufC16* reasonPhrase = HBufC16::NewLC( aReasonPhrase.Length() );\ + reasonPhrase->Des().Copy( aReasonPhrase );\ + MUS_LOG_TDESC( " ReasonPhrase is ",(*reasonPhrase) )\ + CleanupStack::PopAndDestroy( reasonPhrase );\ + } + + + +#endif // _DEBUG + + +#endif // MUSENGLOGGER_H + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/inc/musengmcesession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/inc/musengmcesession.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,285 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef MUSENGMCESESSION_H +#define MUSENGMCESESSION_H + +// USER +#include "musengcamerahandler.h" +#include "musengdisplayhandler.h" +#include "lcsession.h" +#include "lcaudiocontrol.h" +#include "svptimerobserver.h" + +#include + + +// FORWARD DECLARATIONS +class CContactTextField; +class CPbkContactItem; +class CPbkContactEngine; +class MLcSessionObserver; +class CMusEngLiveVideoPlayer; +class CMusEngRemoteVideoPlayer; +class CSVPTimer; + + +// CONSTANTS + +_LIT8( KMusEngAcceptContactHeader, + "Accept-Contact: *;+g.3gpp.cs-voice; explicit" ); +_LIT8( KMusAcceptHeader, + "Accept: application/sdp" ); +_LIT8( KMusEngSessionSdpLineXApplication, "a=X-application:com.nokia.rtvs\r\n" ); +_LIT8( KMusEngSessionSdpLineApplication , "a=application:com.gsma.rts\r\n" ); +_LIT8( KMusEngSessionSdpLineType, "a=type:videolive\r\n" ); +_LIT8( KMusEngSessionSdpLineBandwidthLine , "b=AS:" ); +_LIT8( KMusEngSessionSdpLineBandwidthField , "b=AS:85\r\n" ); +_LIT8( KMusEngSessionSdpLineTiasLine , "b=TIAS:" ); +_LIT8( KMusPPreferredIdentity, "P-Preferred-Identity" ); +_LIT8( KMusEngNewLine , "\r\n" ); + +const TInt KMusTiasMultiplier = 1000; +const TUint8 KMusEngRtpKeepAliveTimer = 5; +const TUint8 KMusEngKeepAlivePayloadTypeVideoH263 = 96; +const TUint8 KMusEngKeepAlivePayloadTypeAudio = 97; +const TUint8 KMusEngKeepAlivePayloadTypeVideoAvc = 98; + +// CLASS DECLARATION + +/** +* Base class for Multimedia Sharing Engine MCE sessions, inherited by +* CMusEngLiveSession CMusEngClipSession and CMusEngReceiveSession. +* +* CMusEngMceSession encapsulates CMCESession and simplifies use of +* MCE Sessions to user interface. Also splits observers messy events +* to simplified function calls. +* +* @lib musengine.lib +*/ +class CMusEngMceSession : public CBase, + public MLcSession, + public MLcAudioControl, + public MMusEngDisplayHandler, + public MSVPTimerObserver + { + public: + + /** + * Destructor + */ + ~CMusEngMceSession(); + + void SetRemoteL( const TDesC& aRemote ); + + public: // from MSVPTimerObserver + + virtual void TimedOut( TInt aTimerId ); + + + public: // from MMusEngDisplayHandler + + /** + * Returns currently assigned drawing area + * + * @return TRect This session drawing area rectangle + */ + TRect Rect() const; + + /** + * Sets new drawing area + * + * @param TRect This session new drawing area rectangle + */ + void SetRectL( const TRect& aRect ); + + /** + * Sets secondary rect (e.g. viewfinder in twoway session) + * @param TRect This session new secondary drawing area rectangle + */ + void SetSecondaryRectL( const TRect& aSecondaryRect ); + + /** + * Gets secondary rect. + * @return TRect This session secondary drawing area rectangle + */ + virtual TRect SecondaryRect() const; + + /** + * Returns current display orientation. + * + * @pre Session is ongoing + * @return Current display orientation + * @leave KErrNotReady if precondition is not fullfilled + */ + TDisplayOrientation OrientationL(); + + /** + * Sets display orientation. + * + * @pre Session is ongoing + * @return Sets display orientation + * @leave KErrNotReady if precondition is not fullfilled + */ + void SetOrientationL( TDisplayOrientation aOrientation ); + + /** + * Permission to draw on screen device. + * + * @pre Session is ongoing + */ + void EnableDisplayL( TBool aEnable ); + + /** + * Implements virtual from MMusEngDisplayHandler + * + * @pre Session is ongoing + */ + TBool IsDisplayEnabled(); + + /** + * Implements virtual from MMusEngDisplayHandler + * + * @pre Session is ongoing + */ + TBool IsDisplayActive(); + + + public: // From MMusEngAudioRoutingObserver + + void AudioRoutingChanged(); + + + public: // From MLcSession + + virtual void UpdateLcSessionL(); + + virtual TLcSessionState LcSessionState() const; + + void SetLcSessionObserver( MLcSessionObserver* aObserver ); + + void SetLcUiProvider( MLcUiProvider* aUiProvider ); + + virtual MLcVideoPlayer* RemoteVideoPlayer(); + + virtual MLcVideoPlayer* LocalVideoPlayer(); + + virtual const TDesC& LocalDisplayName(); + + virtual const TDesC& RemoteDisplayName(); + + TInt SetParameter( TInt aId, TInt aValue ); + + TInt ParameterValue( TInt aId ); + + TBool IsBackgroundStartup(); + + TInt SetForegroundStatus( TBool aIsForeground ); + + const TDesC& RemoteDetails(); + + 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(); + + + protected: // CONSTRUCTORS + + /** + * Constructor + * + */ + CMusEngMceSession(); + + /** + * Second-phase constructor + */ + void ConstructL(); + + protected: // Data + + /** + * Drawing area rect. + */ + TRect iRect; + + /** + * ETrue if operator specific behavior is expected + */ + TBool iOperatorVariant; + + /** + * Session state for MLcSession + */ + MLcSession::TLcSessionState iLcSessionState; + + TMusEngCameraHandler iCameraHandler; + + CMusEngLiveVideoPlayer* iLiveVideoPlayer; + CMusEngRemoteVideoPlayer* iRemoteVideoPlayer; + TRect iSetRemoteRect; + TRect iSetLocalRect; + CSVPTimer* iTimer; + TLcSessionState lLcSessionState; + HBufC* iRemoteAddress; + + private: // Data + + /** + * The session observer, if present. + */ + MLcSessionObserver* iLcSessionObserver; + + /** + * The UI provider, if present. + */ + MLcUiProvider* iLcUiProvider; + + /** + * Value indicates whether session was started in background mode. + * (see IsBackgroundStartup()). Once sending of video started, + * iBackground is set to EFalse + */ + TBool iBackground; + + + }; + +#endif // MUSENGMCESESSION_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/inc/musengremotevideoplayer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/inc/musengremotevideoplayer.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,58 @@ +/* +* 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 MUSHENGREMOTEVIDEOPLAYER_H +#define MUSHENGREMOTEVIDEOPLAYER_H + +// INCLUDES +#include +#include "musengvideoplayerbase.h" + +// FORWARD DECLARATIONS +class CMceSession; +class MLcWindow; +class MLcAudioControl; + +// CLASS DECLARATION +class CMusEngRemoteVideoPlayer : public CMusEngVideoPlayerBase + { + public: // Constructors and destructor + + static CMusEngRemoteVideoPlayer* NewL( MMusEngDisplayHandler& aDisplayHandler, + MLcAudioControl& aLcAudioControl ); + + ~CMusEngRemoteVideoPlayer(); + + + public: // from CMusEngVideoPlayerBase + + TLcVideoPlayerState LcVideoPlayerState() const; + + TBool LcIsPlayingL(); + + private: // Constructors + + CMusEngRemoteVideoPlayer( MMusEngDisplayHandler& aDisplayHandler, + MLcAudioControl& aLcAudioControl ); + void ConstructL(); + + private: // Data + + }; + +#endif // MUSHENGREMOTEVIDEOPLAYER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/inc/musengsessionmanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/inc/musengsessionmanager.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,61 @@ +/* +* 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 CMUSENGSESSIONMANAGER_H +#define CMUSENGSESSIONMANAGER_H + +// INCLUDES +#include "lcengine.h" +#include "mccdatareceiverobserver.h" + +// FORWARD DECLARATIONS +class MLcSession; +class CMusEngMceSession; +class MLcUiProvider; +class CMccDataReceiver; +class CMccDataSender; + +class CMusEngSessionManager : public CLcEngine, public MMccDataReceiverObserver + { + public: + + static CMusEngSessionManager* NewL(); + ~CMusEngSessionManager(); + + void DataReceived( const TDataMessage& aData ); + + public: // From CLcEngine + + MLcSession& Session(); + + private: // Constructors + + CMusEngSessionManager(); + void ConstructL(); + + private: // Data + + CMusEngMceSession* iSession; + + CMccDataReceiver* iMsgReceiver; + CMccDataSender* iMsgSender; + + }; + +#endif // CMUSENGSESSIONMANAGER_H + +// end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/inc/musengtwowayrecvsession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/inc/musengtwowayrecvsession.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,141 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef MUSHENGTWOWAYRECVSESSION_H +#define MUSHENGTWOWAYRECVSESSION_H + +// USER +#include "musengreceivesession.h" +#include "musunittesting.h" +#include "mussettings.h" +#include "musengcamerahandler.h" + +// SYSTEM +#include + +// FORWARD DECLARATIONS +class CMceDisplaySink; +class CMceStreamBundle; +class CMusEngLiveVideoPlayer; + + +class CMusEngTwoWayRecvSession : public CMusEngReceiveSession + { + MUS_UNITTEST( UT_CMusEngTwoWayRecvSession ) + + + public: + /** + * Creates new MultimediaSharing two-way receive session. + * @return CMusEngTwoWayRecvSession* New instanse of specified class + */ + static CMusEngTwoWayRecvSession* NewL(); + + public: + + /** + * Destructor + */ + ~CMusEngTwoWayRecvSession(); + + public: + + void EnableDisplayL( TBool aEnable ); + + CMusEngMceSession::TDisplayOrientation OrientationL(); + + void SetOrientationL( TDisplayOrientation aOrientation ); + + public: + + /** + * Sets both remote (receiving video) and local (viewfinder) rects. + * + */ + void SetRectsL( const TRect& aRemoteRect, + const TRect& aLocalRect ); + + /** + * Gets camera handler (can be used for zooming etc.) + */ + TMusEngCameraHandler& Camera(); + + public: // from MLcSession + + MLcVideoPlayer* LocalVideoPlayer(); + + protected: // From CMusEngReceiveSession + + /** + * Sets local rect (viewfinder). + * + */ + void SetSecondaryRectL( const TRect& aSecondaryRect ); + + /** + * Gets local rect (viewfinder). + * + */ + TRect SecondaryRect() const; + + void CompleteSessionStructureL(); + + void RectChangedL(); + + private: + + /** + * Constructor + */ + CMusEngTwoWayRecvSession(); + + /** + * Second-phase constructor + */ + void ConstructL(); + + private: + + void CompleteSessionStructureAudioPartL( + const RPointerArray& aStreams, + CMceStreamBundle& aLocalBundle, + CMceMediaStream* aVideoInStream, + CMceMediaStream* aVideoOutStream ); + + void CompleteSessionStructureInStreamL( CMceMediaStream& aVideoInStream, + CMceStreamBundle& aLocalBundle ); + + void CompleteSessionStructureOutStreamL( CMceMediaStream& aVideoOutStream ); + + + private: + + TRect iLocalRect; + + TMusEngCameraHandler iCameraHandler; + + /// The live video player implementing MLcVideoPlayer + CMusEngLiveVideoPlayer* iLiveVideoPlayer; + + TRect iSetRemoteRect; + TRect iSetLocalRect; + + }; + +#endif + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/inc/musengtwowaysession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/inc/musengtwowaysession.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,87 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef MUSHENGTWOWAYSESSION_H +#define MUSHENGTWOWAYSESSION_H + +// USER +#include "musengmcesession.h" + +// SYSTEM +#include + +// FORWARD DECLARATIONS +class MMusEngLiveSessionObserver; +class CMceDisplaySink; +class MMusEngTwoWaySessionObserver; +class CMusEngRemoteVideoPlayer; + + +class CMusEngTwoWaySession : public CMusEngMceSession + { + public: + /** + * Creates new MultimediaSharing Live session. + * @return CMusEngTwoWaySession* New instanse of specified class + */ + static CMusEngTwoWaySession* NewL(); + + + public: + + /** + * Destructor + */ + ~CMusEngTwoWaySession(); + + public: + + void EnableDisplayL( TBool aEnable ); + + void SetOrientationL( MMusEngDisplayHandler::TDisplayOrientation aOrientation ); + + void EstablishLcSessionL(); + + void TerminateLcSessionL(); + + MLcVideoPlayer* RemoteVideoPlayer(); + public: + + /** + * Sets both remote (receiving video) and local (viewfinder) rects. + * + */ + void SetRectsL( const TRect& aRemoteRect, + const TRect& aLocalRect ); + + private: + + /** + * Constructor + */ + CMusEngTwoWaySession(); + + /** + * Second-phase constructor + */ + void ConstructL(); + + }; + +#endif + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/inc/musengvideoplayerbase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/inc/musengvideoplayerbase.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,87 @@ +/* +* 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 MUSHENGVIDEOPLAYERBASE_H +#define MUSHENGVIDEOPLAYERBASE_H + +// INCLUDES +#include +#include "lcvideoplayer.h" +#include "lcwindow.h" + +// FORWARD DECLARATIONS +class TMusEngCameraHandler; +class MMusEngDisplayHandler; + +// CLASS DECLARATION +class CMusEngVideoPlayerBase : + public CBase, public MLcVideoPlayer, public MLcWindow + { + public: // Constructors and destructor + + ~CMusEngVideoPlayerBase(); + + public: // From MLcVideoPlayer + + virtual void LcPlayL(MLcVideoPlayer::TLcVideoPlayerSource aSource); + + + virtual void LcPauseL(); + + MLcWindow* LcWindow(); + + virtual MLcCameraControl* LcCameraControl(); + + virtual MLcSourceFileControl* LcSourceFileControl(); + + virtual MLcDestinationFileControl* LcDestinationFileControl(); + + MLcAudioControl* LcAudioControl(); + + virtual MLcZoomControl* LcZoomControl(); + + virtual 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 + + CMusEngVideoPlayerBase( + MMusEngDisplayHandler& aDisplayHandler, + MLcAudioControl& aLcAudioControl ); + + protected: // Data + + MMusEngDisplayHandler& iDisplayHandler; + MLcAudioControl& iLcAudioControl; + }; + +#endif // MUSHENGVIDEOPLAYERBASE_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/inc/svptimer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/inc/svptimer.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,112 @@ +/* +* 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: Timer services for SVP +* +*/ + + + +#ifndef SVPTIMER_H +#define SVPTIMER_H + +#include + +class MSVPTimerObserver; + +/** + * SVP timer + * + * Provides timer service for SVP + * + * @lib + * @since S60 3.2 + */ +class CSVPTimer : public CTimer + { + +public: + + /** + * Two-phased constructor. + */ + static CSVPTimer* NewL( MSVPTimerObserver& aObserver, + TInt aTimerId ); + + /** + * Destructor. + */ + virtual ~CSVPTimer(); + +public: // new methods + + /** + * Sets the timer to be fired after given number of milliseconds. + * @since Series 60 3.2 + * @param aMilliSeconds Time in milliseconds + * @return + */ + void SetTime( TInt aMilliSeconds ); + + /** + * Stops the timer. + * @since Series 60 3.2 + * @return + */ + void Stop(); + + /** + * Returns the Timer ID + * @since Series 60 3.2 + * @return TInt The timer ID. + */ + TInt Id() const; + +public: // methods from base classes + + /** + * From CActive Called when an aychronic request is completed. + * @since Series 60 3.0 + * @param None + * @return None + */ + void RunL(); + +private: + + /** + * C++ default constructor. + */ + CSVPTimer( MSVPTimerObserver& aObserver, TInt aTimerId ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + +private: // data + + /** + * Reference to the observer. + */ + MSVPTimerObserver& iObserver; + + /** + * The timer ID, given to observer when the timer fires. + * Timers can be identifies with this ID. + */ + TInt iId; + + }; + +#endif // SVPTIMER_H \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/inc/svptimerobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/inc/svptimerobserver.h Thu Jul 22 16:32:26 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: Observer for SVP timer +* +*/ + + +#ifndef SVPTIMEROBSERVER_H +#define SVPTIMEROBSERVER_H + +#include + +/** + * SVP timer observer + * + * Observer for SVP timer + * + * @lib + * @since S60 3.2 + */ +class MSVPTimerObserver + { + +public: // New functions + + /** + * Notifies, that the previously set timer has now expired. + * Implemented by the class using the timer. + * @since Series 60 3.2 + * @param TInt aTimerId The ID of the timer. Observer can identify + * timers from each other with this ID. + * @return + */ + virtual void TimedOut( TInt aTimerId ) = 0; + + + }; + +#endif // SVPTIMEROBSERVER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/install/lcui_update_udeb.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/install/lcui_update_udeb.pkg Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,46 @@ +; +; 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: +; +; A package file for creating an installation file for Multimediasharing +; which updates Multimediasharing binaries from ROM (eclipsing) + +; Supported languages +&EN + +; Header +#{"MultimediaSharing"},(0x10282491),1,0,0,TYPE=PU + +; Localised Vendor name +%{"Symbian"} + +; Unique Vendor name +:"Symbian" + +; ----------------------------------------------------------------------------------- + +;Multimediasharing binaries + +; User interface DOCMLs +"\epoc32\data\z\data\others\lcidleview.docml"-"!:\data\others\lcidleview.docml" +"\epoc32\data\z\data\others\lcreceiveview.docml"-"!:\data\others\lcreceiveview.docml" +"\epoc32\data\z\data\others\lcsendview.docml"-"!:\data\others\lcsendview.docml" +"\epoc32\data\z\data\others\lctwowayview.docml"-"!:\data\others\lctwowayview.docml" +"\epoc32\data\z\data\others\lcvtview.docml"-"!:\data\others\lcvtview.docml" +"\epoc32\data\z\data\others\lcreceiveonlyview.docml"-"!:\data\others\lcreceiveonlyview.docml" + +; Engine +;"\epoc32\release\armv5\udeb\musengineplugin.dll"-"!:\sys\bin\musengineplugin.dll" +;"\epoc32\data\z\resource\plugins\musengineplugin.rsc"-"!:\resource\plugins\musengineplugin.rsc" + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/install/lcui_update_urel.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/install/lcui_update_urel.pkg Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,46 @@ +; +; 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: +; +; A package file for creating an installation file for Multimediasharing +; which updates Multimediasharing binaries from ROM (eclipsing) + +; Supported languages +&EN + +; Header +#{"MultimediaSharing"},(0x10282491),1,0,0,TYPE=PU + +; Localised Vendor name +%{"Symbian"} + +; Unique Vendor name +:"Symbian" + +; ----------------------------------------------------------------------------------- + +;Multimediasharing binaries + +; User interface XMLs +"\epoc32\data\z\data\others\lcidleview.docml"-"!:\data\others\lcidleview.docml" +"\epoc32\data\z\data\others\lcreceiveview.docml"-"!:\data\others\lcreceiveview.docml" +"\epoc32\data\z\data\others\lcsendview.docml"-"!:\data\others\lcsendview.docml" +"\epoc32\data\z\data\others\lctwowayview.docml"-"!:\data\others\lctwowayview.docml" +"\epoc32\data\z\data\others\lcvtview.docml"-"!:\data\others\lcvtview.docml" +"\epoc32\data\z\data\others\lcreceiveonlyview.docml"-"!:\data\others\lcreceiveonlyview.docml" + +; Engine +;"\epoc32\release\armv5\urel\musengineplugin.dll"-"!:\sys\bin\musengineplugin.dll" +;"\epoc32\data\z\resource\plugins\musengineplugin.rsc"-"!:\resource\plugins\musengineplugin.rsc" + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/install/sis_update_udeb.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/install/sis_update_udeb.bat Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,18 @@ +rem +rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +rem All rights reserved. +rem This component and the accompanying materials are made available +rem under the terms of "Eclipse Public License v1.0" +rem which accompanies this distribution, and is available +rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +rem +rem Initial Contributors: +rem Nokia Corporation - initial contribution. +rem +rem Contributors: +rem +rem Description: +rem + +makesis lcui_update_udeb.pkg udeb_lcui_update.sis + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/install/sis_update_urel.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/install/sis_update_urel.bat Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,17 @@ +rem +rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +rem All rights reserved. +rem This component and the accompanying materials are made available +rem under the terms of "Eclipse Public License v1.0" +rem which accompanies this distribution, and is available +rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +rem +rem Initial Contributors: +rem Nokia Corporation - initial contribution. +rem +rem Contributors: +rem +rem Description: +rem + +makesis lcui_update_urel.pkg urel_lcui_update.sis diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/src/mccdatareceiver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/src/mccdatareceiver.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,107 @@ +/* +* 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: +* +*/ + + +// INCLUDE FILES +#include "mccdatareceiver.h" + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CMccDataReceiver::CMccDataReceiver +// ----------------------------------------------------------------------------- +// +CMccDataReceiver::CMccDataReceiver( MMccDataReceiverObserver& aObserver ) + : CActive( EPriorityStandard ), iObserver( &aObserver ) + { + CActiveScheduler::Add(this); + } + +// ----------------------------------------------------------------------------- +// CMccDataReceiver::ConstructL +// ----------------------------------------------------------------------------- +// +void CMccDataReceiver::ConstructL() + { + + TInt err = iMsgQueue.CreateGlobal(_L("IP-VT-Queue2"), 5, EOwnerProcess ); + if ( err ) + { + User::LeaveIfError( iMsgQueue.OpenGlobal(_L("IP-VT-Queue2"))); + } + + iMsgQueue.ReceiveBlocking( iInitData ); + + iMsgQueue.NotifyDataAvailable( iStatus ); + SetActive(); + } + +// ----------------------------------------------------------------------------- +// CMccDataReceiver::NewL +// ----------------------------------------------------------------------------- +// +CMccDataReceiver* CMccDataReceiver::NewL( MMccDataReceiverObserver& aObserver ) + { + CMccDataReceiver* self = + new ( ELeave ) CMccDataReceiver( aObserver ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CMccDataReceiver::~CMccDataReceiver +// ----------------------------------------------------------------------------- +// +CMccDataReceiver::~CMccDataReceiver() + { + Cancel(); + iMsgQueue.Close(); + } + +// ----------------------------------------------------------------------------- +// CMccDataReceiver::DoCancel +// ----------------------------------------------------------------------------- +// +void CMccDataReceiver::DoCancel() + { + iMsgQueue.CancelDataAvailable(); + } + +// ----------------------------------------------------------------------------- +// CMccDataReceiver::RunL +// ----------------------------------------------------------------------------- +// +void CMccDataReceiver::RunL() + { + TDataMessage buffer; + iMsgQueue.Receive( buffer ); + iObserver->DataReceived( buffer ); + iMsgQueue.NotifyDataAvailable( iStatus ); + SetActive(); + } + +// ----------------------------------------------------------------------------- +// CMccDataReceiver::RunError +// ----------------------------------------------------------------------------- +// +TInt CMccDataReceiver::RunError(TInt /*aError*/) + { + return KErrNone; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/src/mccdatasender.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/src/mccdatasender.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,122 @@ +/* +* 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: +* +*/ + + +// INCLUDE FILES +#include "mccdatasender.h" + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CMccDataSender::CMccDataSender +// ----------------------------------------------------------------------------- +// +CMccDataSender::CMccDataSender( ) + : CActive( EPriorityStandard ) + { + CActiveScheduler::Add(this); + } + +// ----------------------------------------------------------------------------- +// CMccDataSender::ConstructL +// ----------------------------------------------------------------------------- +// +void CMccDataSender::ConstructL() + { + TInt err = iMsgQueue.CreateGlobal(_L("IP-VT-Queue1"), 5, EOwnerProcess ); + if ( err ) + { + User::LeaveIfError( iMsgQueue.OpenGlobal(_L("IP-VT-Queue1"))); + } + } + +// ----------------------------------------------------------------------------- +// CMccDataSender::NewL +// ----------------------------------------------------------------------------- +// +CMccDataSender* CMccDataSender::NewL( ) + { + CMccDataSender* self = + new ( ELeave ) CMccDataSender(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CMccDataSender::Send +// ----------------------------------------------------------------------------- +// +void CMccDataSender::Send( const TDataMessage& aData ) +{ + TInt err = iMsgQueue.Send( aData ); + + if ( err == KErrOverflow ) + { + if ( !IsActive() ) + { + iBuffer = aData; + iMsgQueue.NotifySpaceAvailable( iStatus ); + SetActive(); + } + else + { + // TODO + // BUFFER OR DROP + } + } + } + +// ----------------------------------------------------------------------------- +// CMccDataSender::~CMccDataSender +// ----------------------------------------------------------------------------- +// +CMccDataSender::~CMccDataSender() + { + Cancel(); + iMsgQueue.Close(); + } + +// ----------------------------------------------------------------------------- +// CMccDataSender::DoCancel +// ----------------------------------------------------------------------------- +// +void CMccDataSender::DoCancel() + { + iMsgQueue.CancelSpaceAvailable(); + } + +// ----------------------------------------------------------------------------- +// CMccDataSender::RunL +// ----------------------------------------------------------------------------- +// +void CMccDataSender::RunL() + { + iMsgQueue.Send( iBuffer ); + iBuffer.iDataId = EUninitialized; + } + +// ----------------------------------------------------------------------------- +// CMccDataSender::RunError +// ----------------------------------------------------------------------------- +// +TInt CMccDataSender::RunError(TInt /*aError*/) + { + return KErrNone; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/src/musengcamerahandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/src/musengcamerahandler.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,227 @@ +/* +* Copyright (c) 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: +* +*/ + + +// USER +#include "musengcamerahandler.h" +#include "musenglogger.h" + + +// SYSTEM +#include + +const TInt KMaxBrightness = 100; +const TInt KMinBrightness = -100; +const TInt KBrightnessStepSize = 10; + + +//Number of big and small zoom steps on Zoom scale +const TInt KZoomBigStepCount = 15; +const TInt KZoomSmallStepCount = KZoomBigStepCount*2; +const TInt KZoomStepMinSize = 1; + +const TInt64 KZoomFasterTime = 333333; // 1/3 second + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TMusEngCameraHandler::TMusEngCameraHandler() : + iDefaultBrightness( 0 ), + iZoomInTime(0), + iZoomOutTime(0), + iSmallZoomStep( KZoomStepMinSize ), + iBigZoomStep( KZoomStepMinSize ), + iCurrentCamera( TMusEngCameraHandler::ECameraNotAvailable ) + { + } + +// ----------------------------------------------------------------------------- +// From MLcCameraControl +// ----------------------------------------------------------------------------- +// +TInt TMusEngCameraHandler::LcCameraCountL() + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::LcCameraCountL()" ) + + return 2; + } + +// ----------------------------------------------------------------------------- +// From MLcCameraControl +// ----------------------------------------------------------------------------- +// +TInt TMusEngCameraHandler::CurrentLcCameraIndex() + { + return iCurrentCamera; + } + +// ----------------------------------------------------------------------------- +// From MLcCameraControl +// ----------------------------------------------------------------------------- +// +void TMusEngCameraHandler::ToggleLcCameraL() + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::ToggleLcCamera()" ) + } + +// ----------------------------------------------------------------------------- +// From MLcBrightnessControl +// ----------------------------------------------------------------------------- +// +TInt TMusEngCameraHandler::MinLcBrightnessL() + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::MinLcBrightnessL()" ) + + // minimum brightness is not in camera info, but a constant + + MUS_LOG1( "mus: [ENGINE] <- TMusEngCameraHandler::MinLcBrightnessL(): %d", + KMinBrightness ) + + return KMinBrightness; + } + +// ----------------------------------------------------------------------------- +// From MLcBrightnessControl +// ----------------------------------------------------------------------------- +// +TInt TMusEngCameraHandler::MaxLcBrightnessL() + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::MaxLcBrightnessL()" ) + + // maximum brightness is not in camera info, but a constant + + MUS_LOG1( "mus: [ENGINE] <- TMusEngCameraHandler::MaxLcBrightnessL(): %d", + KMaxBrightness ) + + return KMaxBrightness; + } + +// ----------------------------------------------------------------------------- +// From MLcBrightnessControl +// ----------------------------------------------------------------------------- +// +TInt TMusEngCameraHandler::LcBrightnessL() + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::LcBrightnessL()" ) + + return 5; + } + +// ----------------------------------------------------------------------------- +// From MLcBrightnessControl +// ----------------------------------------------------------------------------- +// +void TMusEngCameraHandler::SetLcBrightnessL( TInt aValue ) + { + MUS_LOG1( "mus: [ENGINE] -> TMusEngCameraHandler::SetLcBrightnessL( %d )", + aValue ) + + + MUS_LOG( "mus: [ENGINE] <- TMusEngCameraHandler::SetLcBrightnessL()" ) + } + +// ----------------------------------------------------------------------------- +// From MLcBrightnessControl +// ----------------------------------------------------------------------------- +// +void TMusEngCameraHandler::IncreaseLcBrightnessL() + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::IncreaseLcBrightnessL()" ) + + MUS_LOG( "mus: [ENGINE] <- TMusEngCameraHandler::IncreaseLcBrightnessL()" ) + } + +// ----------------------------------------------------------------------------- +// From MLcBrightnessControl +// ----------------------------------------------------------------------------- +// +void TMusEngCameraHandler::DecreaseLcBrightnessL() + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::DecreaseLcBrightnessL()" ) + + MUS_LOG( "mus: [ENGINE] <- TMusEngCameraHandler::DecreaseLcBrightnessL()" ) + } + +// ----------------------------------------------------------------------------- +// From MLcZoomControl +// ----------------------------------------------------------------------------- +// +TInt TMusEngCameraHandler::MinLcZoomL() + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::MinLcZoomL()" ) + + return 1; + } + +// ----------------------------------------------------------------------------- +// From MLcZoomControl +// ----------------------------------------------------------------------------- +// +TInt TMusEngCameraHandler::MaxLcZoomL() + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::MaxLcZoomL()" ) + + return 10; + } + +// ----------------------------------------------------------------------------- +// From MLcZoomControl +// ----------------------------------------------------------------------------- +// +TInt TMusEngCameraHandler::LcZoomValueL() + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::LcZoomValueL" ) + + + return 5; + } + +// ----------------------------------------------------------------------------- +// From MLcZoomControl +// ----------------------------------------------------------------------------- +// +void TMusEngCameraHandler::SetLcZoomValueL( TInt aValue ) + { + MUS_LOG1( "mus: [ENGINE] -> TMusEngCameraHandler::SetLcZoomValueL( %d )", + aValue ) + + MUS_LOG( "mus: [ENGINE] <- MusEngCameraHandler::SetLcZoomValueL()" ) + } + +// ----------------------------------------------------------------------------- +// From MLcZoomControl +// ----------------------------------------------------------------------------- +// +void TMusEngCameraHandler::LcZoomInL() + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::LcZoomInL()" ) + + MUS_LOG( "mus: [ENGINE] <- TMusEngCameraHandler::LcZoomInL()" ) + } + +// ----------------------------------------------------------------------------- +// From MLcZoomControl +// ----------------------------------------------------------------------------- +// +void TMusEngCameraHandler::LcZoomOutL() + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::LcZoomOutL()" ) + + MUS_LOG( "mus: [ENGINE] <- TMusEngCameraHandler::LcZoomOutL()" ) + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/src/musengclipvideoplayer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/src/musengclipvideoplayer.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,535 @@ +/* +* 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: +* +*/ + +// USER +#include "musengclipvideoplayer.h" +#include "musengcamerahandler.h" +#include "musengmceutils.h" +#include "musengdisplayhandler.h" +#include "muslogger.h" + +// SYSTEM +#include +#include +#include +#include + +// CONSTANTS +const TInt64 KMicroSecondsInOneSecond = 1000000; +const TInt KFastWindingFactor = 4; + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngClipVideoPlayer* CMusEngClipVideoPlayer::NewL( + MMusEngDisplayHandler& aDisplayHandler, + MLcAudioControl& aLcAudioControl ) + { + return new( ELeave )CMusEngClipVideoPlayer( + aDisplayHandler, aLcAudioControl ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngClipVideoPlayer::CMusEngClipVideoPlayer( + MMusEngDisplayHandler& aDisplayHandler, + MLcAudioControl& aLcAudioControl ) : + CMusEngLocalVideoPlayer( aDisplayHandler, aLcAudioControl ) + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngClipVideoPlayer::~CMusEngClipVideoPlayer() + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMusEngClipVideoPlayer::HasClipEnded() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngClipVideoPlayer::HasClipEnded" ) + + TBool hasClipEnded( EFalse ); + + if ( iMceSession ) + { + CMceVideoStream* videoOut = NULL; + + TRAPD( err, + videoOut = MusEngMceUtils::GetVideoOutStreamL( *iMceSession ) ); + if ( err != KErrNone ) + { + MUS_LOG1( "mus: [ENGINE] Error in GetVideoOutStreamL %d", err ) + return EFalse; + } + + CMceFileSource* filesource = NULL; + TRAP( err, filesource = MusEngMceUtils::GetFileSourceL( *iMceSession ) ) + + if ( err == KErrNone ) + { + TTimeIntervalMicroSeconds position; + TTimeIntervalMicroSeconds duration; + TRAP( err, position = filesource->PositionL() ); + TRAPD( err2, duration = filesource->DurationL() ); + if ( err != KErrNone || err2 != KErrNone ) + { + return EFalse; + } + + MUS_LOG2( "mus: [ENGINE] position = %Ld, duration = %Ld", + position.Int64(), duration.Int64() ) + + hasClipEnded = + ( position.Int64() == 0 && + !filesource->IsEnabled() && + videoOut->State() == CMceMediaStream::EDisabled ); + } + } + + if ( hasClipEnded ) + { + iDelayFileEndingPos = 0; + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngClipVideoPlayer::HasClipEnded" ) + + return hasClipEnded; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngClipVideoPlayer::SetBufferingPeriod( + const TTimeIntervalMicroSeconds& aPeriod ) + { + iBufferingPeriod = aPeriod; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +TBool CMusEngClipVideoPlayer::LcIsPlayingL() + { + __ASSERT_ALWAYS( iMceSession, User::Leave( KErrNotReady ) ); + return ( MusEngMceUtils::GetFileSourceL( *iMceSession )->IsEnabled() ); + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +void CMusEngClipVideoPlayer::LcPlayL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngClipVideoPlayer::LcPlayL" ) + + __ASSERT_ALWAYS( iMceSession, User::Leave( KErrNotReady ) ); + CMceFileSource* file = MusEngMceUtils::GetFileSourceL( *iMceSession ); + + if ( !file->IsEnabled() ) + { + file->EnableL(); + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngClipVideoPlayer::LcPlayL" ) + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +void CMusEngClipVideoPlayer::LcPauseL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngClipVideoPlayer::LcPauseL" ) + + __ASSERT_ALWAYS( iMceSession, User::Leave( KErrNotReady ) ); + CMceFileSource* file = MusEngMceUtils::GetFileSourceL( *iMceSession ); + + if ( file->IsEnabled() ) + { + file->DisableL(); + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngClipVideoPlayer::LcPauseL" ) + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcSourceFileControl* CMusEngClipVideoPlayer::LcSourceFileControl() + { + return this; + } + +// ----------------------------------------------------------------------------- +// From MLcSourceFileControl +// ----------------------------------------------------------------------------- +// +void CMusEngClipVideoPlayer::SetLcFileNameL( const TFileName& aFileName ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngClipVideoPlayer::SetLcFileNameL" ) + + __ASSERT_ALWAYS( !IsProtectedFileL( aFileName ), + User::Leave( KErrPermissionDenied ) ); + + if ( iMceSession ) + { + CMceFileSource* file = MusEngMceUtils::GetFileSourceL( *iMceSession ); + file->UpdateL( aFileName ); + } + + iFileName = aFileName; + MUS_LOG( "mus: [ENGINE] <- CMusEngClipVideoPlayer::SetLcFileNameL" ) + } + +// ----------------------------------------------------------------------------- +// From MLcSourceFileControl +// ----------------------------------------------------------------------------- +// +TFileName& CMusEngClipVideoPlayer::LcFileName() + { + return iFileName; + } + +// ----------------------------------------------------------------------------- +// From MLcSourceFileControl +// Since MCE does not at the moment support SetFastForwardL function, this +// functionality is implemented by taking a timestamp when forwarding is +// started and calculating a new position when it is ended. +// ----------------------------------------------------------------------------- +// +void CMusEngClipVideoPlayer::LcFastForwardL( TBool aUseFFWD ) + { + MUS_LOG1( "mus: [ENGINE] -> CMusEngClipVideoPlayer::FastForward( %d )", + aUseFFWD ) + + __ASSERT_ALWAYS( iMceSession, User::Leave( KErrNotReady ) ); + + CMceFileSource* file = MusEngMceUtils::GetFileSourceL( *iMceSession ); + + if ( aUseFFWD ) + { + // Ignore if we are already fastforwarding + if ( iFFWDStartTime.Int64() > 0 ) + { + return; + } + + // Stop rewinding if ongoing, else just pause file source + if ( iFRWDStartTime.Int64() > 0 ) + { + LcFastRewindL( EFalse ); + } + else + { + file->DisableL(); + } + + // Get timestamp for starttime + iFFWDStartTime.HomeTime(); + } + else + { + // Leave if we are not fastforwarding + if ( iFFWDStartTime.Int64() == 0 ) + { + User::Leave( KErrAlreadyExists ); + } + + // Set new position + file->SetPositionL( PositionMicroSecondsL( ETrue ) ); + + // Reset timer + iFFWDStartTime = TTime( 0 ); + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngClipVideoPlayer::FastForward" ) + } + +// ----------------------------------------------------------------------------- +// From MLcSourceFileControl +// Since MCE does not at the moment support SetFastRewindL function, this +// functionality is implemented by taking a timestamp when rewinding is +// started and calculating a new position when it is ended. +// ----------------------------------------------------------------------------- +// +void CMusEngClipVideoPlayer::LcFastRewindL( TBool aUseFRWD ) + { + MUS_LOG1( "mus: [ENGINE] -> CMusEngClipVideoPlayer::FastRewind( %d )", + aUseFRWD ) + + __ASSERT_ALWAYS( iMceSession, User::Leave( KErrNotReady ) ); + + CMceFileSource* file = MusEngMceUtils::GetFileSourceL( *iMceSession ); + + if ( aUseFRWD ) + { + // Ignore if we are already fastrewinding + if ( iFRWDStartTime.Int64() > 0 ) + { + return; + } + + // Stop fastforwarding if ongoing, else just pause file source + if ( iFFWDStartTime.Int64() > 0 ) + { + LcFastForwardL( EFalse ); + } + else + { + file->DisableL(); + } + + // Get timestamp for starttime + iFRWDStartTime.HomeTime(); + } + else + { + // Leave if we are not fastrewinding + if ( iFRWDStartTime.Int64() == 0 ) + { + User::Leave( KErrAlreadyExists ); + } + + // Set new position + file->SetPositionL( PositionMicroSecondsL( ETrue ) ); + + // Reset timer + iFRWDStartTime = TTime( 0 ); + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngClipVideoPlayer::FastRewind" ) + } + +// ----------------------------------------------------------------------------- +// From MLcSourceFileControl +// ----------------------------------------------------------------------------- +// +TTimeIntervalSeconds CMusEngClipVideoPlayer::LcFileDurationL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngClipVideoPlayer::DurationL" ) + + __ASSERT_ALWAYS( iMceSession, User::Leave( KErrNotReady ) ); + + CMceFileSource* file = MusEngMceUtils::GetFileSourceL( *iMceSession ); + + TTimeIntervalMicroSeconds duration = file->DurationL(); + + MUS_LOG( "mus: [ENGINE] <- CMusEngClipVideoPlayer::DurationL" ) + + return TTimeIntervalSeconds( static_cast< TInt >( + duration.Int64() / KMicroSecondsInOneSecond ) ); + } + +// ----------------------------------------------------------------------------- +// From MLcSourceFileControl +// ----------------------------------------------------------------------------- +// +TTimeIntervalSeconds CMusEngClipVideoPlayer::LcFilePositionL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngClipVideoPlayer::LcFilePositionL" ) + + TTimeIntervalMicroSeconds currentPosition = PositionMicroSecondsL(); + + MUS_LOG1( "mus: [ENGINE] <- CMusEngClipVideoPlayer::LcFilePositionL, %d", + currentPosition.Int64() ) + + return TTimeIntervalSeconds( static_cast< TInt >( + currentPosition.Int64() / KMicroSecondsInOneSecond ) ); + } + +// ----------------------------------------------------------------------------- +// From MLcSourceFileControl +// ----------------------------------------------------------------------------- +// +void CMusEngClipVideoPlayer::SetLcFilePositionL( + const TTimeIntervalSeconds& aPosition ) + { + MUS_LOG1( "mus: [ENGINE] -> CMusEngClipVideoPlayer::SetPositionL ( %d )", + aPosition.Int() ) + + __ASSERT_ALWAYS( iMceSession, User::Leave( KErrNotReady ) ); + + CMceFileSource* file = MusEngMceUtils::GetFileSourceL( *iMceSession ); + + TTimeIntervalMicroSeconds position( + KMicroSecondsInOneSecond * static_cast< TInt64 >( aPosition.Int() ) ); + + if ( position == 0 ) + { + iRewindedToBeginning = ETrue; + } + + file->SetPositionL( position ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngClipVideoPlayer::SetPositionL ()" ) + } + +// ----------------------------------------------------------------------------- +// Check is file DRM protected. +// ----------------------------------------------------------------------------- +// +TBool CMusEngClipVideoPlayer::IsProtectedFileL( const TDesC& aClipFile ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngClipVideoPlayer::IsProtectedFileL(...)" ) + + TBool isDRMProtected = EFalse; + DRMCommon* drmapi = DRMCommon::NewL(); + CleanupStack::PushL( drmapi ); + + User::LeaveIfError( drmapi->Connect() ); + //Check DRM file protection + User::LeaveIfError( drmapi->IsProtectedFile( aClipFile, isDRMProtected ) ); + drmapi->Disconnect(); + + CleanupStack::PopAndDestroy( drmapi ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngClipVideoPlayer::IsProtectedFileL(...)" ) + return isDRMProtected; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TTimeIntervalMicroSeconds CMusEngClipVideoPlayer::PositionMicroSecondsL( + TBool aActualPosition ) + { + __ASSERT_ALWAYS( iMceSession, User::Leave( KErrNotReady ) ); + + CMceFileSource* file = MusEngMceUtils::GetFileSourceL( *iMceSession ); + + TTimeIntervalMicroSeconds position = file->PositionL(); + TTimeIntervalMicroSeconds duration = file->DurationL(); + + TTimeIntervalMicroSeconds calculatedPosition; + + // Adjust position if we are fastforwarding or -rewinding + if ( iFFWDStartTime.Int64() != 0 ) + { + TTime now; + now.HomeTime(); + calculatedPosition = KFastWindingFactor * + now.MicroSecondsFrom( iFFWDStartTime ).Int64() + + position.Int64(); + if ( calculatedPosition > duration ) + { + calculatedPosition = duration; + } + } + else if ( iFRWDStartTime.Int64() != 0 ) + { + TTime now; + now.HomeTime(); + calculatedPosition = position.Int64() - + KFastWindingFactor * + now.MicroSecondsFrom( iFRWDStartTime ).Int64(); + if ( calculatedPosition < 0 ) + { + calculatedPosition = 0; + } + + if ( calculatedPosition == 0 ) + { + iRewindedToBeginning = ETrue; + } + } + else + { + calculatedPosition = position; + } + + if ( !aActualPosition ) + { + calculatedPosition = + GetVideoSinkRelativeFilePos( calculatedPosition, duration ); + } + + return calculatedPosition; + } + +// ----------------------------------------------------------------------------- +// Modifies file position if position has reached end before clip has ended. +// File position is not going in sync with local video playback as playback +// buffers media before starting playing. +// ----------------------------------------------------------------------------- +// +TTimeIntervalMicroSeconds CMusEngClipVideoPlayer::GetVideoSinkRelativeFilePos( + const TTimeIntervalMicroSeconds& aActualPosition, + const TTimeIntervalMicroSeconds& aDuration ) + { + MUS_LOG1( "mus: [ENGINE] PositionMicroSecondsL, pos before mod:%d", + aActualPosition.Int64() ) + + TTimeIntervalMicroSeconds tempCalculatedPosition( aActualPosition ); + + if ( iDelayFileEndingPos != 0 ) + { + iDelayFileEndingPos = aDuration; + tempCalculatedPosition = iDelayFileEndingPos; + } + else + { + // FRWD can go to zero even if clip has not ended, do not modify + // time in such situation. + if ( aActualPosition == 0 && + !HasClipEnded() && + iFRWDStartTime.Int64() == 0 && + !iRewindedToBeginning ) + { + const TInt KMusDelayEndingModifier = 2; + iDelayFileEndingPos = aDuration.Int64() - + iBufferingPeriod.Int64() / KMusDelayEndingModifier; + tempCalculatedPosition = iDelayFileEndingPos; + if ( iPreviousPos > tempCalculatedPosition ) + { + tempCalculatedPosition = iPreviousPos; + } + } + else + { + iDelayFileEndingPos = 0; + } + + if ( iRewindedToBeginning && aActualPosition > 0 ) + { + iRewindedToBeginning = EFalse; + } + + if ( tempCalculatedPosition < 0 ) + { + tempCalculatedPosition = 0; + } + } + + iPreviousPos = tempCalculatedPosition; + + return tempCalculatedPosition; + } + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/src/musenginepluginentry.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/src/musenginepluginentry.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,42 @@ +/* +* 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 "musengsessionmanager.h" +#include +#include + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +const TImplementationProxy KMusEnginePluginImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( 0x20021341, CMusEngSessionManager::NewL ) + }; + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount ) + { + aTableCount = sizeof( KMusEnginePluginImplementationTable ) / + sizeof( TImplementationProxy ); + + return KMusEnginePluginImplementationTable; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/src/musenglivesession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/src/musenglivesession.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,149 @@ +/* +* Copyright (c) 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: +* +*/ + + +// USER +#include "musenglivesession.h" +#include "lcsessionobserver.h" +#include "musenglogger.h" +#include "musengremotevideoplayer.h" +#include "musenglivevideoplayer.h" +#include "svptimer.h" + + +const TInt KMusEngJitterBufferLength = 51; //Must be bigger than treshold +// Using following value increases treshold buffer to 1 second from +// default 100 ms +const TInt KMusEngJitterBufferTreshold = 50; + +const TUint32 KMusEngTwoWayReceivingActivityTimeout = 5000; // 5 seconds +// 6 seconds keepalive timer, needs to be more than receiving timeout +const TUint8 KMusEngTwoWayRtpKeepAliveTimer = 6; + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngLiveSession* CMusEngLiveSession::NewL() + { + CMusEngLiveSession* self = new( ELeave )CMusEngLiveSession(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngLiveSession::~CMusEngLiveSession() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngLiveSession::~CMusEngLiveSession()" ) + + MUS_LOG( "mus: [ENGINE] <- CMusEngLiveSession::~CMusEngLiveSession()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngLiveSession::EnableDisplayL( TBool aEnable ) + { + MUS_LOG1( "mus: [ENGINE] -> CMusEngLiveSession::EnableDisplayL() %d", + aEnable ) + + MUS_LOG( "mus: [ENGINE] <- CMusEngLiveSession::EnableDisplayL()") + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngLiveSession::SetOrientationL( TDisplayOrientation aOrientation ) + { + MUS_LOG1( "mus: [ENGINE] -> CMusEngLiveSession::SetOrientationL() %d", + aOrientation ) + + + MUS_LOG( "mus: [ENGINE] <- CMusEngLiveSession::SetOrientationL()" ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngLiveSession::SetRectsL( + const TRect& aRemoteRect, + const TRect& aLocalRect ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngLiveSession::SetRectsL()" ) + + MUS_LOG( "mus: [ENGINE] <- CMusEngLiveSession::SetRectsL()" ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngLiveSession::CMusEngLiveSession() + : CMusEngMceSession() + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngLiveSession::ConstructL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngLiveSession::ConstructL()" ) + + CMusEngMceSession::ConstructL(); + + MUS_LOG( "mus: [ENGINE] <- CMusEngLiveSession::ConstructL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngLiveSession::EstablishLcSessionL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngLiveSession::EstablishLcSessionL" ) + + iTimer = CSVPTimer::NewL( *this, 1 ); + iTimer->SetTime(2000); + + MUS_LOG( "mus: [ENGINE] <- CMusEngLiveSession::EstablishLcSessionL" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngLiveSession::TerminateLcSessionL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngLiveSession::TerminateLcSessionL" ) + + MUS_LOG( "mus: [ENGINE] <- CMusEngLiveSession::TerminateLcSessionL" ) + } + + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/src/musenglivevideoplayer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/src/musenglivevideoplayer.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,166 @@ +/* +* 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: +* +*/ + +// USER +#include "musenglivevideoplayer.h" +#include "musengcamerahandler.h" +#include "musengdisplayhandler.h" +#include "musenglogger.h" + +// SYSTEM +#include + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngLiveVideoPlayer* CMusEngLiveVideoPlayer::NewL( + MMusEngDisplayHandler& aDisplayHandler, + TMusEngCameraHandler& aCameraHandler, + MLcAudioControl& aLcAudioControl ) + { + return new( ELeave )CMusEngLiveVideoPlayer( + aDisplayHandler, aCameraHandler, aLcAudioControl ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngLiveVideoPlayer::CMusEngLiveVideoPlayer( + MMusEngDisplayHandler& aDisplayHandler, + TMusEngCameraHandler& aCameraHandler, + MLcAudioControl& aLcAudioControl ) : + CMusEngLocalVideoPlayer( aDisplayHandler, aLcAudioControl ), + iCameraHandler( aCameraHandler ) + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngLiveVideoPlayer::~CMusEngLiveVideoPlayer() + { + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +TBool CMusEngLiveVideoPlayer::LcIsPlayingL() + { +// return iCameraHandler.IsPlayingL(); + return ETrue; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +void CMusEngLiveVideoPlayer::LcPlayL() + { +// iCameraHandler.PlayL(); + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +void CMusEngLiveVideoPlayer::LcPauseL() + { +// iCameraHandler.PauseL(); + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcCameraControl* CMusEngLiveVideoPlayer::LcCameraControl() + { + return &iCameraHandler; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcDestinationFileControl* CMusEngLiveVideoPlayer::LcDestinationFileControl() + { + return this; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcZoomControl* CMusEngLiveVideoPlayer::LcZoomControl() + { + return &iCameraHandler; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcBrightnessControl* CMusEngLiveVideoPlayer::LcBrightnessControl() + { + return &iCameraHandler; + } + +// ----------------------------------------------------------------------------- +// From MLcFileControl +// ----------------------------------------------------------------------------- +// +void CMusEngLiveVideoPlayer::SetLcFileNameL( const TFileName& aFileName ) + { + iFileName = aFileName; + } + +// ----------------------------------------------------------------------------- +// From MLcFileControl +// ----------------------------------------------------------------------------- +// +TFileName& CMusEngLiveVideoPlayer::LcFileName() + { + return iFileName; + } + +// ----------------------------------------------------------------------------- +// From MLcDestinationFileControl +// ----------------------------------------------------------------------------- +// +void CMusEngLiveVideoPlayer::LcRecordL( TBool aRecord ) + { + MUS_LOG1( "mus: [ENGINE] -> CMusEngLiveVideoPlayer::LcRecordL(( %d )", + aRecord ) + + MUS_LOG( "mus: [ENGINE] <- CMusEngLiveVideoPlayer::LcRecordL" ) + } + +// ----------------------------------------------------------------------------- +// From MLcDestinationFileControl +// ----------------------------------------------------------------------------- +// +TBool CMusEngLiveVideoPlayer::LcIsRecording() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngLiveVideoPlayer::LcIsRecording()" ) + + TBool isEnabled( EFalse ); + + return isEnabled; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/src/musenglocalvideoplayer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/src/musenglocalvideoplayer.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,69 @@ +/* +* 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: +* +*/ + +// USER +#include "musenglocalvideoplayer.h" +#include "musengdisplayhandler.h" + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngLocalVideoPlayer::CMusEngLocalVideoPlayer( + MMusEngDisplayHandler& aDisplayHandler, + MLcAudioControl& aLcAudioControl ) : + CMusEngVideoPlayerBase( aDisplayHandler, aLcAudioControl ) + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngLocalVideoPlayer::~CMusEngLocalVideoPlayer() + { + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcVideoPlayer::TLcVideoPlayerState +CMusEngLocalVideoPlayer::LcVideoPlayerState() const + { + return MLcVideoPlayer::EPlaying; + } + + +// ----------------------------------------------------------------------------- +// From MLcWindow +// ----------------------------------------------------------------------------- +// +void CMusEngLocalVideoPlayer::SetLcWindowRectL( TRect aRect ) + { + iDisplayHandler.SetSecondaryRectL( aRect ); + } + +// ----------------------------------------------------------------------------- +// From MLcWindow +// ----------------------------------------------------------------------------- +// +TRect CMusEngLocalVideoPlayer::LcWindowRect() + { + return iDisplayHandler.SecondaryRect(); + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/src/musengmcesession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/src/musengmcesession.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,662 @@ +/* +* Copyright (c) 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: +* +*/ + + +// USER +#include "musengmcesession.h" +#include "lcsessionobserver.h" +#include "musenglogger.h" +#include "lcuiprovider.h" +#include "lcvideoplayer.h" +#include "musengremotevideoplayer.h" +#include "musenglivevideoplayer.h" + +// SYSTEM +#include +#include + +#include +#include +#include + + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngMceSession::CMusEngMceSession() + { + iBackground = IsBackgroundStartup(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::ConstructL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::ConstructL()" ) + + iLiveVideoPlayer = CMusEngLiveVideoPlayer::NewL( *this, iCameraHandler, *this ); + iLcSessionState = MLcSession::EUninitialized; + + MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::ConstructL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngMceSession::~CMusEngMceSession() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::~CMusEngMceSession()" ) + + delete iRemoteAddress; + delete iRemoteVideoPlayer; + delete iLiveVideoPlayer; + MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::~CMusEngMceSession()" ) + } + +// ----------------------------------------------------------------------------- +// From MMusEngDisplayHandler +// ----------------------------------------------------------------------------- +// +TRect CMusEngMceSession::Rect() const + { + MUS_LOG( "mus: [ENGINE] CMusEngMceSession::Rect()" ) + return iRect; + } + +// ----------------------------------------------------------------------------- +// From MMusEngDisplayHandler +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::SetRectL( const TRect& aRect ) + { + MUS_LOG( "mus: [ENGINE] CMusEngSession::SetRectL()" ) + iRect = aRect; + } + +// ----------------------------------------------------------------------------- +// From MMusEngDisplayHandler +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::SetSecondaryRectL( const TRect& aSecondaryRect ) + { + MUS_LOG( "mus: [ENGINE] CMusEngMceSession::SetSecondaryRectL()" ) + + // Same rect is set by primary and secondary setters + iRect = aSecondaryRect; + } + +// ----------------------------------------------------------------------------- +// From MMusEngDisplayHandler +// ----------------------------------------------------------------------------- +// +TRect CMusEngMceSession::SecondaryRect() const + { + MUS_LOG( "mus: [ENGINE] CMusEngMceSession::SecondaryRect()" ) + return iRect; + } + +#if 0 + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWaySession::SetSecondaryRectL( const TRect& aSecondaryRect ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWaySession::SetSecondaryRectL()" ) + + iLocalRect = aSecondaryRect; + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWaySession::SetSecondaryRectL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TRect CMusEngTwoWaySession::SecondaryRect() const + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWaySession::SecondaryRect()" ) + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWaySession::SecondaryRect()" ) + return iLocalRect; + } + +#endif + +// ----------------------------------------------------------------------------- +// From MMusEngDisplayHandler +// ----------------------------------------------------------------------------- +// +MMusEngDisplayHandler::TDisplayOrientation CMusEngMceSession::OrientationL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::RotationL()" ) + return MMusEngDisplayHandler::EPortrait; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::SetOrientationL( TDisplayOrientation aOrientation ) + { + MUS_LOG1( "mus: [ENGINE] -> CMusEngMceSession::SetOrientationL() %d", + aOrientation ) + + MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::SetOrientationL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::EnableDisplayL( TBool aEnable ) + { + MUS_LOG1( "mus: [ENGINE] -> CMusEngMceSession::EnableDisplay() %d", + aEnable ) + + MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::EnableDisplay()") + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMusEngMceSession::IsDisplayEnabled() + { + TBool enabled( EFalse ); + return enabled; + } + +// ----------------------------------------------------------------------------- +// From MMusEngDisplayHandler +// ----------------------------------------------------------------------------- +// +TBool CMusEngMceSession::IsDisplayActive() + { + return ( IsDisplayEnabled() ); + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +MLcSession::TLcSessionState CMusEngMceSession::LcSessionState() const + { + MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::LcSessionState()" ) + + TLcSessionState lcSessionState = MLcSession::EUninitialized; + +/* + if ( iSession ) + { + switch( iSession->State() ) + { + case CMceSession::EIdle: + { + lcSessionState = MLcSession::EInitialized; + break; + } + case CMceSession::EIncoming: + case CMceSession::EProceeding: + case CMceSession::EReserving: + { + lcSessionState = MLcSession::EReceived; + break; + } + + case CMceSession::EOffering: + case CMceSession::EAnswering: + { + lcSessionState = MLcSession::EOpening; + break; + } + case CMceSession::EEstablished: + { + lcSessionState = MLcSession::EOpen; + break; + } + case CMceSession::ECancelling: + case CMceSession::ETerminating: + { + lcSessionState = MLcSession::EClosing; + break; + } + case CMceSession::ETerminated: + { + lcSessionState = MLcSession::EClosed; + break; + } + default: + { + lcSessionState = MLcSession::EUninitialized; + break; + } + } + } +*/ + + return iLcSessionState; + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::SetLcSessionObserver( MLcSessionObserver* aObserver ) + { + iLcSessionObserver = aObserver; + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::SetLcUiProvider( MLcUiProvider* aUiProvider ) + { + iLcUiProvider = aUiProvider; + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +MLcVideoPlayer* CMusEngMceSession::RemoteVideoPlayer() + { + return iRemoteVideoPlayer; + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +MLcVideoPlayer* CMusEngMceSession::LocalVideoPlayer() + { + return iLiveVideoPlayer; + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +const TDesC& CMusEngMceSession::LocalDisplayName() + { + return KNullDesC; + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +const TDesC& CMusEngMceSession::RemoteDisplayName() + { + return *iRemoteAddress; + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +TInt CMusEngMceSession::SetParameter( TInt /*aId*/, TInt /*aValue*/ ) + { + return KErrNotSupported; + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +TInt CMusEngMceSession::ParameterValue( TInt /*aId*/ ) + { + return KErrNotSupported; + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +TBool CMusEngMceSession::IsBackgroundStartup() + { + return EFalse; + } + +// ----------------------------------------------------------------------------- +// From MLcAudioControl +// ----------------------------------------------------------------------------- +// +TBool CMusEngMceSession::IsLcAudioMutedL() + { + return EFalse; + } + +// ----------------------------------------------------------------------------- +// From MLcAudioControl +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::MuteLcAudioL( TBool aMute ) + { + } + +// ----------------------------------------------------------------------------- +// From MLcAudioControl +// ----------------------------------------------------------------------------- +// +TBool CMusEngMceSession::IsLcMicMutedL() + { + return EFalse; + } + +// ----------------------------------------------------------------------------- +// From MLcAudioControl +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::MuteLcMicL( TBool aMute ) + { + } + +// ----------------------------------------------------------------------------- +// From MLcAudioControl +// ----------------------------------------------------------------------------- +// +TBool CMusEngMceSession::IsEnablingLcLoudspeakerAllowed() + { + return ETrue; + } + +// ----------------------------------------------------------------------------- +// From MLcAudioControl +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::EnableLcLoudspeakerL( TBool aEnabled ) + { + } + +// ----------------------------------------------------------------------------- +// From MLcAudioControl +// ----------------------------------------------------------------------------- +// +TBool CMusEngMceSession::IsLcLoudspeakerEnabled() + { + return ETrue; + } + +// ----------------------------------------------------------------------------- +// From MLcAudioControl +// ----------------------------------------------------------------------------- +// +TInt CMusEngMceSession::LcVolumeL() + { + return 5; + } + +// ----------------------------------------------------------------------------- +// From MLcAudioControl +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::SetLcVolumeL( TInt aValue ) + { + } + +// ----------------------------------------------------------------------------- +// From MLcAudioControl +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::IncreaseLcVolumeL() + { + } + +// ----------------------------------------------------------------------------- +// From MLcAudioControl +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::DecreaseLcVolumeL() + { + } + + +// ----------------------------------------------------------------------------- +// From MLcAudioControl +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::TimedOut( TInt aTimerId ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::TimedOut()" ) + + iLcSessionState = MLcSession::EOpen; + + if ( iLcSessionObserver ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::TimedOut(), StateChanged" ) + iLcSessionObserver->StateChanged( *this ); + } + +/* + switch( aTimerId ) + { + case CMceSession::EIdle: + { + lcSessionState = MLcSession::EInitialized; + break; + } + case CMceSession::EIncoming: + case CMceSession::EProceeding: + case CMceSession::EReserving: + { + lcSessionState = MLcSession::EReceived; + break; + } + + case CMceSession::EOffering: + case CMceSession::EAnswering: + { + lcSessionState = MLcSession::EOpening; + break; + } + case CMceSession::EEstablished: + { + lcSessionState = MLcSession::EOpen; + break; + } + case CMceSession::ECancelling: + case CMceSession::ETerminating: + { + lcSessionState = MLcSession::EClosing; + break; + } + case CMceSession::ETerminated: + { + lcSessionState = MLcSession::EClosed; + break; + } + default: + { + lcSessionState = MLcSession::EUninitialized; + break; + } + } +*/ + MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::TimedOut()" ) + } + + + +TInt CMusEngMceSession::SetForegroundStatus( TBool aIsForeground ) + { + MUS_LOG1( "mus: [ENGINE] -> CMusEngMceSession::SetForegroundStatus() %d", + aIsForeground ) + /* + if ( aIsForeground ) + { + // Only clear the bg info, do not ever enable it again + iBackground = EFalse; + } + */ + return KErrNone; + } + +_LIT( KIpVtEngStubRemoteDetails, "5556567844" ); + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +const TDesC& CMusEngMceSession::RemoteDetails() + { + return KIpVtEngStubRemoteDetails(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::SetRemoteL( const TDesC& aRemote ) +{ + iRemoteAddress = aRemote.AllocL(); +} + +#if 0 + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::InformObserverAboutSessionStateChange() + { + if ( iLcSessionObserver ) + { + iLcSessionObserver->StateChanged( *this ); + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::InformObserverAboutSessionUpdate() + { + if ( iLcSessionObserver ) + { + iLcSessionObserver->Updated( *this ); + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::InformObserverAboutSessionFailure( TInt aReason ) + { + if ( iLcSessionObserver ) + { + iLcSessionObserver->Failed( *this, aReason ); + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::InformObserverAboutPlayerStateChange( + MLcVideoPlayer* aPlayer ) + { + if ( iLcSessionObserver && aPlayer ) + { + iLcSessionObserver->StateChanged( *aPlayer ); + } + + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::InformUiProviderAboutReceivingStart() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::InformUiProviderAboutReceivingStart()" ) + if ( iBackground && iLcUiProvider ) + { + MUS_LOG( "mus: [ENGINE] receiving started in BG mode, switching to FG" ) + iLcUiProvider->HandleForegroundStatus( ETrue ); + iBackground = EFalse; + } + MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::InformUiProviderAboutReceivingStart()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::InformObserverAboutPlayerUpdate( + MLcVideoPlayer* aPlayer ) + { + if ( iLcSessionObserver && aPlayer ) + { + iLcSessionObserver->Updated( *aPlayer ); + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::InformObserverAboutPlayerFailure( + MLcVideoPlayer* aPlayer, + TInt aReason ) + { + if ( iLcSessionObserver && aPlayer ) + { + iLcSessionObserver->Failed( *aPlayer, aReason ); + } + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +MLcUiProvider& CMusEngMceSession::LcUiProviderL() + { + __ASSERT_ALWAYS( iLcUiProvider, User::Leave( KErrNotReady ) ); + return *iLcUiProvider; + } +#endif + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::UpdateLcSessionL() + { + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +TBool CMusEngMceSession::SendDialTone( TChar aKey ) + { + return ETrue; + } + + + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/src/musengmceutils.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/src/musengmceutils.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,594 @@ +/* +* 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: Utilities to get and set profile used with SWIS. +* +*/ + + + +// USER + +#include "musengmceutils.h" +#include "muslogger.h" + +// SYSTEM + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + + + +// ----------------------------------------------------------------------------- +// Tells if parameter stream is a video stream with RTP source +// ----------------------------------------------------------------------------- +// +TBool MusEngMceUtils::IsVideoInStream( CMceMediaStream& aStream ) + { + return ( aStream.Type() == KMceVideo && + aStream.Source() && + aStream.Source()->Type() == KMceRTPSource ); + } + +// ----------------------------------------------------------------------------- +// Tells if parameter stream is a video stream with RTP sink +// ----------------------------------------------------------------------------- +// +TBool MusEngMceUtils::IsVideoOutStream( CMceMediaStream& aStream ) + { + TBool isOutStream( EFalse ); + if ( aStream.Type() == KMceVideo ) + { + CMceMediaSink* rtpSink = MusEngMceUtils::GetMediaSink( + aStream, + KMceRTPSink ); + + isOutStream = ( rtpSink != NULL ); + } + return isOutStream; + } + +// ----------------------------------------------------------------------------- +// Tells if parameter stream is an audio stream with RTP source +// ----------------------------------------------------------------------------- +// +TBool MusEngMceUtils::IsAudioInStream( CMceMediaStream& aStream ) + { + return ( aStream.Type() == KMceAudio && + aStream.Source() && + aStream.Source()->Type() == KMceRTPSource ); + } + + +// ----------------------------------------------------------------------------- +// Gets handle to video stream with RTP sink. +// ----------------------------------------------------------------------------- +// +CMceVideoStream* MusEngMceUtils::GetVideoOutStreamL( CMceSession& aSession ) + { + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::GetVideoOutStreamL()" ) + + const RPointerArray& streams = aSession.Streams(); + + CMceVideoStream* videoOut = NULL; + + for ( TInt i = 0; i < streams.Count(); ++i ) + { + if ( MusEngMceUtils::IsVideoOutStream( *streams[i] ) ) + { + __ASSERT_ALWAYS( !videoOut, User::Leave( KErrOverflow ) ); + + videoOut = static_cast( streams[i] ); + } + + // Check if bound stream is a video stream with RTP sink. + if ( streams[i]->BoundStream() && + MusEngMceUtils::IsVideoOutStream( streams[i]->BoundStreamL() ) ) + { + __ASSERT_ALWAYS( !videoOut, User::Leave( KErrOverflow ) ); + + videoOut = static_cast( + &streams[i]->BoundStreamL() ); + } + } + + __ASSERT_ALWAYS( videoOut, User::Leave( KErrNotFound ) ); + + MUS_LOG( "mus: [ENGINE] <- MusEngMceUtils::GetVideoOutStreamL()" ) + + return videoOut; + } + + +// ----------------------------------------------------------------------------- +// Gets handle to video stream with RTP source. +// ----------------------------------------------------------------------------- +// +CMceVideoStream* MusEngMceUtils::GetVideoInStreamL( CMceSession& aSession ) + { + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::GetVideoInStreamL()" ) + + const RPointerArray& streams = aSession.Streams(); + + CMceVideoStream* videoIn = NULL; + + for ( TInt i = 0; i < streams.Count(); ++i ) + { + if ( MusEngMceUtils::IsVideoInStream( *streams[i] ) ) + + { + __ASSERT_ALWAYS( !videoIn, User::Leave( KErrOverflow ) ); + + videoIn = static_cast( streams[i] ); + } + + // Check if bound stream is a video stream with RTP souce. + if ( streams[i]->BoundStream() && + MusEngMceUtils::IsVideoInStream( streams[i]->BoundStreamL() ) ) + { + __ASSERT_ALWAYS( !videoIn, User::Leave( KErrOverflow ) ); + + videoIn = static_cast( + &streams[i]->BoundStreamL() ); + } + } + + __ASSERT_ALWAYS( videoIn, User::Leave( KErrNotFound ) ); + + MUS_LOG( "mus: [ENGINE] <- MusEngMceUtils::GetVideoInStreamL()" ) + + return videoIn; + } + + +// ----------------------------------------------------------------------------- +// Gets handle to video stream with file sink +// ----------------------------------------------------------------------------- +// +CMceVideoStream* MusEngMceUtils::GetRecordingStream( CMceSession& aSession ) + { + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::GetRecordingStreamL()" ) + + const RPointerArray& streams = aSession.Streams(); + + CMceVideoStream* recordingStream = NULL; + + for ( TInt i = 0; i < streams.Count(); ++i ) + { + if ( streams[i]->Type() == KMceVideo ) + { + if ( MusEngMceUtils::GetMediaSink( *streams[i], KMceFileSink ) ) + { + recordingStream = static_cast( streams[i] ); + } + } + } + + MUS_LOG( "mus: [ENGINE] <- MusEngMceUtils::GetRecordingStreamL()" ) + + return recordingStream; + } + + +// ----------------------------------------------------------------------------- +// Gets handle to a media sink of spesified type contained by a mediastream. +// ----------------------------------------------------------------------------- +// +CMceMediaSink* MusEngMceUtils::GetMediaSink( CMceMediaStream& aStream, + TMceSinkType aType, + TMceSourceType aAssociatedSourceType ) + { + const RPointerArray& sinks = aStream.Sinks(); + for ( TInt i = 0; i < sinks.Count(); ++i ) + { + if ( sinks[i]->Type() == aType && + ( aAssociatedSourceType == KMusEngNoAssociatedSourceType || + aStream.Source()->Type() == aAssociatedSourceType ) ) + { + return sinks[i]; + } + } + + return NULL; + } + + +// ----------------------------------------------------------------------------- +// Gets handle to a media sink of spesified type contained by a mediastream. +// ----------------------------------------------------------------------------- +// +CMceMediaSink* MusEngMceUtils::GetMediaSinkL( CMceMediaStream& aStream, + TMceSinkType aType, + TMceSourceType aAssociatedSourceType ) + { + + CMceMediaSink* sink = MusEngMceUtils::GetMediaSink( aStream, aType, aAssociatedSourceType ); + + __ASSERT_ALWAYS( sink, User::Leave( KErrNotFound ) ); + + return sink; + } + + +// ----------------------------------------------------------------------------- +// Gets handle to a media sink of spesified type contained by a session. +// ----------------------------------------------------------------------------- +// +CMceMediaSink* MusEngMceUtils::GetMediaSink( CMceSession& aSession, + TMceSinkType aType, + TMceSourceType aAssociatedSourceType, + TBool aStrictMatch ) + { + CMceMediaSink* sink = NULL; + + TRAP_IGNORE( sink = MusEngMceUtils::GetMediaSinkL( + aSession, aType, aAssociatedSourceType, aStrictMatch ) ) + + return sink; + } + + +// ----------------------------------------------------------------------------- +// Gets handle to a media sink of spesified type contained by a session. +// ----------------------------------------------------------------------------- +// +CMceMediaSink* MusEngMceUtils::GetMediaSinkL( CMceSession& aSession, + TMceSinkType aType, + TMceSourceType aAssociatedSourceType, + TBool aStrictMatch ) + { + CMceMediaSink* sink = NULL; + + const RPointerArray& streams = aSession.Streams(); + + for ( TInt i = 0; i < streams.Count(); ++i ) + { + sink = MusEngMceUtils::GetMediaSink( *streams[i], aType, aAssociatedSourceType ); + if ( sink ) + { + return sink; + } + + if ( streams[i]->BoundStream() ) + { + sink = MusEngMceUtils::GetMediaSink( streams[i]->BoundStreamL(), + aType, + aAssociatedSourceType ); + if ( sink ) + { + return sink; + } + } + } + + if ( !sink && aAssociatedSourceType != KMusEngNoAssociatedSourceType && !aStrictMatch ) + { + // No preferred match, try without source preference + sink = GetMediaSinkL( aSession, aType ); + } + + __ASSERT_ALWAYS( sink, User::Leave( KErrNotFound ) ); + + return sink; + } + + +// ----------------------------------------------------------------------------- +// Gets handle to a speaker sink contained by specified stream or bound stream. +// ----------------------------------------------------------------------------- +// +CMceSpeakerSink* MusEngMceUtils::GetSpeaker( CMceMediaStream& aStream ) + { + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::GetSpeaker()" ) + + CMceSpeakerSink* speaker = NULL; + + if ( aStream.Type() == KMceAudio ) + { + speaker = static_cast( + MusEngMceUtils::GetMediaSink( aStream, KMceSpeakerSink ) ); + + if ( !speaker && aStream.BoundStream() ) + { + CMceMediaStream* boundStream = NULL; + TRAPD( error, boundStream = &aStream.BoundStreamL() ) + + if ( error == KErrNone ) + { + speaker = static_cast( + MusEngMceUtils::GetMediaSink( *boundStream, + KMceSpeakerSink ) ); + } + } + } + + MUS_LOG( "mus: [ENGINE] <- MusEngMceUtils::GetSpeaker()" ) + + return speaker; + } + + +// ----------------------------------------------------------------------------- +// Gets handle to a camera source. +// ----------------------------------------------------------------------------- +// +CMceCameraSource* MusEngMceUtils::GetCameraL( CMceSession& aSession ) + { + // Camera can be only in out stream + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::GetCameraL()" ) + + CMceVideoStream* videoOut = MusEngMceUtils::GetVideoOutStreamL( aSession ); + + if ( !( videoOut->Source() && + videoOut->Source()->Type() == KMceCameraSource ) ) + { + User::Leave( KErrNotFound ); + } + + MUS_LOG( "mus: [ENGINE] <- MusEngMceUtils::GetCameraL()" ) + return static_cast( videoOut->Source() ); + } + + +// ----------------------------------------------------------------------------- +// Gets handle to a file source. +// ----------------------------------------------------------------------------- +// +CMceFileSource* MusEngMceUtils::GetFileSourceL( CMceSession& aSession ) + { + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::GetFileSourceL()" ) + + CMceVideoStream* videoOut = MusEngMceUtils::GetVideoOutStreamL( aSession ); + + if ( !( videoOut->Source() && + videoOut->Source()->Type() == KMceFileSource ) ) + { + User::Leave( KErrNotFound ); + } + + MUS_LOG( "mus: [ENGINE] <- MusEngMceUtils::GetFileSourceL()" ) + return static_cast( videoOut->Source() ); + } + + +// ----------------------------------------------------------------------------- +// Gets handle to a display sink. +// ----------------------------------------------------------------------------- +// +CMceDisplaySink* MusEngMceUtils::GetDisplay( + CMceSession& aSession, TBool aPreferViewFinder ) + { + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::GetDisplay()" ) + MUS_LOG( "mus: [ENGINE] <- MusEngMceUtils::GetDisplay()" ) + TMceSourceType preferredSource = + aPreferViewFinder ? KMceCameraSource : KMusEngNoAssociatedSourceType; + return static_cast( + MusEngMceUtils::GetMediaSink( aSession, KMceDisplaySink, preferredSource ) ); + + } + + +// ----------------------------------------------------------------------------- +// Gets handle to a display sink. +// ----------------------------------------------------------------------------- +// +CMceDisplaySink* MusEngMceUtils::GetDisplayL( + CMceSession& aSession, TBool aPreferViewFinder ) + { + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::GetDisplayL()" ) + + CMceDisplaySink* display = MusEngMceUtils::GetDisplay( aSession, aPreferViewFinder ); + + __ASSERT_ALWAYS( display, User::Leave( KErrNotFound ) ); + + MUS_LOG( "mus: [ENGINE] <- MusEngMceUtils::GetDisplayL()" ) + return display; + } + +// ----------------------------------------------------------------------------- +// Gets handle to a display sink displaying received video. +// ----------------------------------------------------------------------------- +// +CMceDisplaySink* MusEngMceUtils::GetReceivingDisplay( CMceSession& aSession ) + { + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::GetReceivingDisplay()" ) + MUS_LOG( "mus: [ENGINE] <- MusEngMceUtils::GetReceivingDisplay()" ) + + // Search display which is connected with rtp source + TMceSourceType preferredSource = KMceRTPSource; + return static_cast( MusEngMceUtils::GetMediaSink( + aSession, KMceDisplaySink, preferredSource, ETrue ) ); + } + +// ----------------------------------------------------------------------------- +// Gets handle to a display sink displaying received video. +// ----------------------------------------------------------------------------- +// +CMceDisplaySink* MusEngMceUtils::GetReceivingDisplayL( CMceSession& aSession ) + { + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::GetReceivingDisplayL()" ) + + CMceDisplaySink* display = GetReceivingDisplay( aSession ); + __ASSERT_ALWAYS( display != NULL, User::Leave( KErrNotFound ) ); + + MUS_LOG( "mus: [ENGINE] <- MusEngMceUtils::GetReceivingDisplay()" ) + + return display; + } + +// ----------------------------------------------------------------------------- +// Gets handle to a display sink displaying viewfinder content. +// ----------------------------------------------------------------------------- +// +CMceDisplaySink* MusEngMceUtils::GetVfDisplay( CMceSession& aSession ) + { + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::GetVfDisplay()" ) + MUS_LOG( "mus: [ENGINE] <- MusEngMceUtils::GetVfDisplay()" ) + + // Search display which is connected with camera + TMceSourceType preferredSource = KMceCameraSource; + return static_cast( MusEngMceUtils::GetMediaSink( + aSession, KMceDisplaySink, preferredSource, ETrue ) ); + } + +// ----------------------------------------------------------------------------- +// Adds display sink to specified stream if one does not exist already. +// Display rect is set in both cases. +// ----------------------------------------------------------------------------- +// +void MusEngMceUtils::AddDisplayL( CMceMediaStream& aStream, + CMceManager& aManager, + const TRect& aDisplayRect ) + { + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::AddDisplayL()" ) + + __ASSERT_ALWAYS( aStream.Type() == KMceVideo, User::Leave( KErrArgument ) ); + + CMceDisplaySink* display = static_cast( + MusEngMceUtils::GetMediaSink( + aStream, + KMceDisplaySink ) ); + + if ( !display ) + { + display = CMceDisplaySink::NewLC( aManager ); + aStream.AddSinkL( display ); + CleanupStack::Pop( display ); + } + + display->SetDisplayRectL( aDisplayRect ); + + MUS_LOG( "mus: [ENGINE] <- MusEngMceUtils::AddDisplayL()" ) + } + + +// ----------------------------------------------------------------------------- +// Adds display sink to specified stream if one does not exist already. +// ----------------------------------------------------------------------------- +// +void MusEngMceUtils::AddSpeakerL( CMceMediaStream& aStream ) + { + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::AddSpeakerL()" ) + + __ASSERT_ALWAYS( aStream.Type() == KMceAudio, User::Leave( KErrArgument ) ); + + CMceSpeakerSink* speaker = static_cast( + MusEngMceUtils::GetMediaSink( + aStream, + KMceSpeakerSink ) ); + + if ( !speaker ) + { + speaker = CMceSpeakerSink::NewLC(); + aStream.AddSinkL( speaker ); + CleanupStack::Pop( speaker ); + } + + MUS_LOG( "mus: [ENGINE] <- MusEngMceUtils::AddSpeakerL()" ) + } + + +// ----------------------------------------------------------------------------- +// Disables parameter stream, its' source and all the sinks. +// ----------------------------------------------------------------------------- +// +void MusEngMceUtils::DisableStreamL( CMceMediaStream& aStream ) + { + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::DisableStreamL()" ) + + aStream.DisableL(); + + if ( aStream.Source() ) + { + aStream.Source()->DisableL(); + } + + for ( TInt sinkIndex = 0; sinkIndex < aStream.Sinks().Count(); ++sinkIndex ) + { + aStream.Sinks()[ sinkIndex ]->DisableL(); + } + + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::DisableStreamL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void MusEngMceUtils::DoEnableDisplayL( CMceDisplaySink& aDisplay, TBool aEnable ) + { + MUS_LOG1( "mus: [ENGINE] -> MusEngMceUtils::DoEnableDisplayL() %d", + aEnable ) + + if ( aEnable ) + { + if ( !aDisplay.IsEnabled() ) + { + aDisplay.EnableL(); + MUS_LOG( " Display enabled" ) + } + else + { + MUS_LOG( " Display already enabled, ignore" ) + } + } + else + { + if ( aDisplay.IsEnabled() ) + { + aDisplay.DisableL(); + MUS_LOG( " Display disabled" ) + } + else + { + MUS_LOG( " Display already disabled, ignore" ) + } + } + + MUS_LOG( "mus: [ENGINE] <- MusEngMceUtils::DoEnableDisplayL()") + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt MusEngMceUtils::EnableInactivityTimer( + CMceSession& aSession, + TUint32 aInactivityTimeout ) + { + TInt err( KErrNotFound ); + CMceVideoStream* stream = NULL; + TRAP_IGNORE( stream = MusEngMceUtils::GetVideoInStreamL( aSession ) ) + if ( stream ) + { + // Instream has always RTP source + err = KErrNone; + CMceRtpSource* rtpSource = static_cast( stream->Source() ); + TRAP( err, rtpSource->EnableInactivityTimerL( aInactivityTimeout ) ) + } + + return err; + } + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/src/musengremotevideoplayer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/src/musengremotevideoplayer.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,75 @@ +/* +* 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: +* +*/ + + +// USER +#include "musengremotevideoplayer.h" +#include "musengdisplayhandler.h" + +// SYSTEM +#include + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngRemoteVideoPlayer* CMusEngRemoteVideoPlayer::NewL( + MMusEngDisplayHandler& aDisplayHandler, + MLcAudioControl& aLcAudioControl ) + { + return new( ELeave )CMusEngRemoteVideoPlayer( + aDisplayHandler, aLcAudioControl ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngRemoteVideoPlayer::CMusEngRemoteVideoPlayer( + MMusEngDisplayHandler& aDisplayHandler, + MLcAudioControl& aLcAudioControl ) : + CMusEngVideoPlayerBase( aDisplayHandler, aLcAudioControl ) + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngRemoteVideoPlayer::~CMusEngRemoteVideoPlayer() + { + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcVideoPlayer::TLcVideoPlayerState +CMusEngRemoteVideoPlayer::LcVideoPlayerState() const + { + return MLcVideoPlayer::EPlaying; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +TBool CMusEngRemoteVideoPlayer::LcIsPlayingL() + { + + return ETrue; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/src/musengsessionmanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/src/musengsessionmanager.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,94 @@ +/* +* 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 "musengsessionmanager.h" +#include "musengmcesession.h" +#include "musengtwowaysession.h" +#include "musenglivesession.h" +#include "lcsession.h" +#include "mccdatasender.h" +#include "mccdatareceiver.h" +#include "musenglogger.h" +#include "mccdatastructures.h" + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngSessionManager* CMusEngSessionManager::NewL() + { + CMusEngSessionManager* self = new( ELeave )CMusEngSessionManager(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngSessionManager::~CMusEngSessionManager() + { + delete iSession; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngSessionManager::CMusEngSessionManager() + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngSessionManager::ConstructL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngSessionManager::ConstructL()" ) + //iMsgReceiver = CMccDataReceiver::NewL(*this); + //iMsgSender = CMccDataSender::NewL(); + //iSession = CMusEngTwoWaySession::NewL(); + iSession = CMusEngLiveSession::NewL(); + _LIT(KDisplayName,"+358504871872"); + iSession->SetRemoteL( KDisplayName() ); + MUS_LOG( "mus: [ENGINE] <- CMusEngSessionManager::ConstructL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +MLcSession& CMusEngSessionManager::Session() + { + return *iSession; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngSessionManager::DataReceived( const TDataMessage& aData ) + { + } + + + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/src/musengtwowayrecvsession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/src/musengtwowayrecvsession.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,521 @@ +/* +* Copyright (c) 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: +* +*/ + + +// USER +#include "musengtwowayrecvsession.h" +#include "lcsessionobserver.h" +#include "musunittesting.h" +#include "musengmceutils.h" +#include "musenglogger.h" +#include "mussipprofilehandler.h" +#include "musenglivevideoplayer.h" +#include "musengremotevideoplayer.h" + +// SYSTEM +#include +#include +#include +#include +#include +#include +#include +#include +#include + +const TInt KMusEngJitterBufferLength = 51; //Must be bigger than treshold +// Using following value increases treshold buffer to 1 second from +// default 100 ms +const TInt KMusEngJitterBufferTreshold = 50; + +const TUint32 KMusEngTwoWayReceivingActivityTimeout = 5000; // 5 seconds +// 6 seconds keepalive timer, needs to be more than receiving timeout +const TUint8 KMusEngTwoWayRtpKeepAliveTimer = 6; + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngTwoWayRecvSession* CMusEngTwoWayRecvSession::NewL() + { + CMusEngTwoWayRecvSession* self = new( ELeave )CMusEngTwoWayRecvSession(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngTwoWayRecvSession::~CMusEngTwoWayRecvSession() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWayRecvSession::~CMusEngTwoWayRecvSession()" ) + + delete iLiveVideoPlayer; + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWayRecvSession::~CMusEngTwoWayRecvSession()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWayRecvSession::EnableDisplayL( TBool aEnable ) + { + MUS_LOG1( "mus: [ENGINE] -> CMusEngTwoWayRecvSession::EnableDisplayL() %d", + aEnable ) + + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + CMceDisplaySink* display = MusEngMceUtils::GetReceivingDisplayL( *iSession ); + MusEngMceUtils::DoEnableDisplayL( *display, aEnable ); + + CMceDisplaySink* vfDisplay = MusEngMceUtils::GetVfDisplay( *iSession ); + if ( vfDisplay ) + { + MusEngMceUtils::DoEnableDisplayL( *vfDisplay, aEnable ); + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWayRecvSession::EnableDisplayL()") + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngMceSession::TDisplayOrientation CMusEngTwoWayRecvSession::OrientationL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWayRecvSession::RotationL()" ) + + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + CMceDisplaySink* display = MusEngMceUtils::GetReceivingDisplayL( *iSession ); + + TDisplayOrientation displayOrientation; + CMceDisplaySink::TRotation rotation( display->RotationL() ); + + MUS_LOG1( "mus: [ENGINE] MCE rotation is %d", rotation ) + + if ( rotation == CMceDisplaySink::ENone ) + { + displayOrientation = CMusEngMceSession::EPortrait; + } + else + { + displayOrientation = CMusEngMceSession::ELandscape; + } + + MUS_LOG1( "mus: [ENGINE] <- CMusEngTwoWayRecvSession::RotationL() %d", + displayOrientation ) + + return displayOrientation; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWayRecvSession::SetOrientationL( TDisplayOrientation aOrientation ) + { + MUS_LOG1( "mus: [ENGINE] -> CMusEngTwoWayRecvSession::SetOrientationL() %d", + aOrientation ) + + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + CMceDisplaySink* display = MusEngMceUtils::GetReceivingDisplayL( *iSession ); + + CMceDisplaySink* vfDisplay = MusEngMceUtils::GetVfDisplay( *iSession ); + + CMceDisplaySink::TRotation rotation = ( aOrientation == EPortrait ) ? + CMceDisplaySink::ENone : CMceDisplaySink::EClockwise90Degree; + + display->SetRotationL( rotation ); + if ( vfDisplay ) + { + vfDisplay->SetRotationL( rotation ); + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWayRecvSession::SetOrientationL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWayRecvSession::SetRectsL( + const TRect& aRemoteRect, + const TRect& aLocalRect ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWayRecvSession::SetRectsL()" ) + + iLocalRect = aLocalRect; + iRect = aRemoteRect; + RectChangedL(); + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWayRecvSession::SetRectsL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWayRecvSession::SetSecondaryRectL( const TRect& aSecondaryRect ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWayRecvSession::SetSecondaryRectL()" ) + + iLocalRect = aSecondaryRect; + RectChangedL(); + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWayRecvSession::SetSecondaryRectL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TRect CMusEngTwoWayRecvSession::SecondaryRect() const + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWayRecvSession::SecondaryRect()" ) + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWayRecvSession::SecondaryRect()" ) + return iLocalRect; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TMusEngCameraHandler& CMusEngTwoWayRecvSession::Camera() + { + return iCameraHandler; + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +MLcVideoPlayer* CMusEngTwoWayRecvSession::LocalVideoPlayer() + { + return iLiveVideoPlayer; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// + +void CMusEngTwoWayRecvSession::RectChangedL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWayRecvSession::RectChangedL()" ) + + + // If session is not yet created, do nothing + if ( iSession && iSession->State() != CMceSession::ETerminated ) + { + TRect remoteRect( Rect() ); + MUS_LOG2( "mus: [ENGINE] remote tl.ix=%d tl.iy=%d", + remoteRect.iTl.iX, remoteRect.iTl.iY ) + MUS_LOG2( "mus: [ENGINE] remote brc%d br.iy=%d", + remoteRect.iBr.iX, remoteRect.iBr.iY ) + MUS_LOG2( "mus: [ENGINE] local tl.ix=%d tl.iy=%d", + iLocalRect.iTl.iX, iLocalRect.iTl.iY ) + MUS_LOG2( "mus: [ENGINE] local br.ix=%d br.iy=%d", + iLocalRect.iBr.iX, iLocalRect.iBr.iY ) + + if ( remoteRect != iSetRemoteRect ) + { + CMceDisplaySink* display = MusEngMceUtils::GetReceivingDisplayL( *iSession ); + display->SetDisplayRectL( remoteRect ); + iSetRemoteRect = remoteRect; + } + + if ( iLocalRect != iSetLocalRect ) + { + CMceDisplaySink* vfDisplay = MusEngMceUtils::GetVfDisplay( *iSession ); + if ( vfDisplay ) + { + vfDisplay->SetDisplayRectL( iLocalRect ); + } + iSetLocalRect = iLocalRect; + } + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWayRecvSession::RectChangedL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWayRecvSession::CompleteSessionStructureL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWayRecvSession::CompleteSessionStructureL()" ) + + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + iCameraHandler.SetSession( iSession ); + + // Force bandwidth line usage in sdp as it is mandatory + // at MT side based on GSMA VS specification IR.74. Bandwidth is set to + // session or to media level based on sender's way of usage. If other end + // is not using bandwidth attribute at all, media level is preferred. + SetSessionSdpLinesL( *iSession, ETrue ); + + CMceStreamBundle* localBundle = + CMceStreamBundle::NewLC( CMceStreamBundle::ELS ); + + const RPointerArray& streams = iSession->Streams(); + + CMceMediaStream* videoInStream = NULL; + CMceMediaStream* videoOutStream = NULL; + + // Search interesting video streams, sendrecv is preferred + TBool sendRecvVideoFound( EFalse ); + for( TInt i = 0; i < streams.Count(); ++i ) + { + if ( MusEngMceUtils::IsVideoInStream( *streams[i] ) && + !sendRecvVideoFound ) + { + videoInStream = streams[i]; + + if ( streams[i]->BoundStream() ) + { + videoOutStream = &streams[i]->BoundStreamL(); + } + } + else if ( streams[i]->BoundStream() && + MusEngMceUtils::IsVideoInStream( streams[i]->BoundStreamL() ) && + !sendRecvVideoFound ) + { + videoInStream = &streams[i]->BoundStreamL(); + + videoOutStream = streams[i]; + } + else + { + // NOP + } + + sendRecvVideoFound = ( videoInStream && videoOutStream ); + } + + CompleteSessionStructureAudioPartL( streams, *localBundle, videoInStream, videoOutStream ); + + if ( videoInStream ) + { + CompleteSessionStructureInStreamL( *videoInStream, *localBundle ); + } + else + { + // At least receiving video stream is required + User::Leave( KErrCorrupt ); + } + + if ( videoOutStream ) + { + CompleteSessionStructureOutStreamL( *videoOutStream ); + } + + // Destroy bundle if it is not needed or transfer ownership + if ( localBundle->Streams().Count() > 1 ) + { + iSession->AddBundleL( localBundle ); + CleanupStack::Pop( localBundle ); + } + else + { + CleanupStack::PopAndDestroy( localBundle ); + } + + AdjustStreamsAndCodecsL(); + + iSession->UpdateL(); + + // Now session state is right to adjust volume + SetSpeakerVolumeL( LcVolumeL() ); + + iSipProfileHandler->CreateProfileL( iSession->Profile() ); + + iRemoteVideoPlayer->SetMceSession( iSession ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWayRecvSession::CompleteSessionStructureL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngTwoWayRecvSession::CMusEngTwoWayRecvSession() + : CMusEngReceiveSession() + { + iMceManagerUid.iUid = CMusManager::ESipInviteDesired2WayVideo; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWayRecvSession::ConstructL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWayRecvSession::ConstructL()" ) + + iCameraHandler.ReadCameraUsageKeyL(); + CMusEngReceiveSession::ConstructL(); + + iLiveVideoPlayer = + CMusEngLiveVideoPlayer::NewL( *this, iCameraHandler, *this ); + + // Override receiving timeout and keepalive values of + // normal one-way receiving session + // + iReceivingInactivityTimeout = KMusEngTwoWayReceivingActivityTimeout; + iKeepaliveTimer = KMusEngTwoWayRtpKeepAliveTimer; + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWayRecvSession::ConstructL()" ) + } + +// ----------------------------------------------------------------------------- +// When checking audio streams also not interesting streams are removed from +// session. Stream if removed if one of following apply: +// 1. Is not and does not contain incoming video or audio +// 2. We already have one incoming video stream +// 3. Stream is audio and we run operator variant where audio is +// not allowed. +// 4. Two-way video exists and this one is audio +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWayRecvSession::CompleteSessionStructureAudioPartL( + const RPointerArray& aStreams, + CMceStreamBundle& aLocalBundle, + CMceMediaStream* aVideoInStream, + CMceMediaStream* aVideoOutStream ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWayRecvSession::CompleteSessionStructureAudioPartL()" ) + + // Audio streams not allowed in two-way session or in operator variant + TBool audioAllowed( !( aVideoInStream && aVideoOutStream ) && !iOperatorVariant ); + + for( TInt i = 0; i < aStreams.Count(); ++i ) + { + // Audio supported currently only in recvonly case + if ( audioAllowed && + MusEngMceUtils::IsAudioInStream( *aStreams[i] ) ) + { + MusEngMceUtils::AddSpeakerL( *aStreams[i] ); + + aLocalBundle.AddStreamL( *aStreams[i] ); + + // Disable possible opposite stream to indicate that sendrecv audio is + // not allowed. + if ( aStreams[i]->BoundStream() ) + { + MusEngMceUtils::DisableStreamL( aStreams[i]->BoundStreamL() ); + } + } + else if ( audioAllowed && + aStreams[i]->BoundStream() && + MusEngMceUtils::IsAudioInStream( aStreams[i]->BoundStreamL() ) ) + { + MusEngMceUtils::AddSpeakerL( aStreams[i]->BoundStreamL() ); + + aLocalBundle.AddStreamL( aStreams[i]->BoundStreamL() ); + + // Disable opposite stream to indicate that sendrecv audio is not allowed. + MusEngMceUtils::DisableStreamL( *aStreams[i] ); + } + else if ( aStreams[ i ] != aVideoInStream && aStreams[ i ] != aVideoOutStream ) + { + iSession->RemoveStreamL( *aStreams[i] ); + + // Since succesfull removal of a stream has decreased the amount + // of streams in array by one, we have to modify the index + --i; + } + else + { + // NOP + } + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWayRecvSession::CompleteSessionStructureAudioPartL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWayRecvSession::CompleteSessionStructureInStreamL( + CMceMediaStream& aVideoInStream, CMceStreamBundle& aLocalBundle ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWayRecvSession::CompleteSessionStructureInStreamL()" ) + + SetMediaSdpLinesL( aVideoInStream, ETrue ); + + MusEngMceUtils::AddDisplayL( aVideoInStream, *iManager, Rect() ); + + static_cast(aVideoInStream.Source())->UpdateL( + KMusEngJitterBufferLength, + KMusEngJitterBufferTreshold, + KMusEngTwoWayReceivingActivityTimeout ); + + aLocalBundle.AddStreamL( aVideoInStream ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWayRecvSession::CompleteSessionStructureInStreamL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWayRecvSession::CompleteSessionStructureOutStreamL( + CMceMediaStream& aVideoOutStream ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWayRecvSession::CompleteSessionStructureOutStreamL()" ) + + SetMediaSdpLinesL( aVideoOutStream, ETrue ); + + CMceCameraSource* camera = NULL; + TRAP_IGNORE( camera = MusEngMceUtils::GetCameraL( *iSession ) ) + if ( !camera ) + { + camera = CMceCameraSource::NewLC( *iManager ); + aVideoOutStream.SetSourceL( camera ); + CleanupStack::Pop( camera ); + } + + camera->DisableL(); // Start session in pause mode. + + iCameraHandler.InitializeL( *camera ); + + CMceVideoStream* vfStream = CMceVideoStream::NewLC(); + + vfStream->SetSourceL( aVideoOutStream.Source() ); + + // Complete stream + MusEngMceUtils::AddDisplayL( *vfStream, *iManager, SecondaryRect() ); + + iSession->AddStreamL( vfStream ); + CleanupStack::Pop( vfStream ); + + iLiveVideoPlayer->SetMceSession( iSession ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWayRecvSession::CompleteSessionStructureOutStreamL()" ) + } + + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/src/musengtwowaysession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/src/musengtwowaysession.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,159 @@ +/* +* Copyright (c) 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: +* +*/ + + +// USER +#include "musengtwowaysession.h" +#include "lcsessionobserver.h" +#include "musenglogger.h" +#include "musengremotevideoplayer.h" +#include "musenglivevideoplayer.h" +#include "svptimer.h" + + +const TInt KMusEngJitterBufferLength = 51; //Must be bigger than treshold +// Using following value increases treshold buffer to 1 second from +// default 100 ms +const TInt KMusEngJitterBufferTreshold = 50; + +const TUint32 KMusEngTwoWayReceivingActivityTimeout = 5000; // 5 seconds +// 6 seconds keepalive timer, needs to be more than receiving timeout +const TUint8 KMusEngTwoWayRtpKeepAliveTimer = 6; + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngTwoWaySession* CMusEngTwoWaySession::NewL() + { + CMusEngTwoWaySession* self = new( ELeave )CMusEngTwoWaySession(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngTwoWaySession::~CMusEngTwoWaySession() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWaySession::~CMusEngTwoWaySession()" ) + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWaySession::~CMusEngTwoWaySession()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWaySession::EnableDisplayL( TBool aEnable ) + { + MUS_LOG1( "mus: [ENGINE] -> CMusEngTwoWaySession::EnableDisplayL() %d", + aEnable ) + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWaySession::EnableDisplayL()") + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWaySession::SetOrientationL( TDisplayOrientation aOrientation ) + { + MUS_LOG1( "mus: [ENGINE] -> CMusEngTwoWaySession::SetOrientationL() %d", + aOrientation ) + + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWaySession::SetOrientationL()" ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWaySession::SetRectsL( + const TRect& aRemoteRect, + const TRect& aLocalRect ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWaySession::SetRectsL()" ) + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWaySession::SetRectsL()" ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngTwoWaySession::CMusEngTwoWaySession() + : CMusEngMceSession() + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWaySession::ConstructL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWaySession::ConstructL()" ) + + CMusEngMceSession::ConstructL(); + + iRemoteVideoPlayer = CMusEngRemoteVideoPlayer::NewL( *this, *this ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWaySession::ConstructL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWaySession::EstablishLcSessionL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWaySession::EstablishLcSessionL" ) + + iTimer = CSVPTimer::NewL( *this, 1 ); + iTimer->SetTime(2000); + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWaySession::EstablishLcSessionL" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWaySession::TerminateLcSessionL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWaySession::TerminateLcSessionL" ) + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWaySession::TerminateLcSessionL" ) + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +MLcVideoPlayer* CMusEngTwoWaySession::RemoteVideoPlayer() + { + return iRemoteVideoPlayer; + } + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/src/musengvideoplayerbase.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/src/musengvideoplayerbase.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,199 @@ +/* +* 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: +* +*/ + +// USER +#include "musenglocalvideoplayer.h" +#include "musengcamerahandler.h" +#include "musengdisplayhandler.h" + +// SYSTEM +#include + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngVideoPlayerBase::CMusEngVideoPlayerBase( + MMusEngDisplayHandler& aDisplayHandler, + MLcAudioControl& aLcAudioControl ) : + iDisplayHandler( aDisplayHandler ), + iLcAudioControl( aLcAudioControl ) + { + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngVideoPlayerBase::~CMusEngVideoPlayerBase() + { + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +void CMusEngVideoPlayerBase::LcPlayL(MLcVideoPlayer::TLcVideoPlayerSource /*aSource*/) + { + // NOP + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +void CMusEngVideoPlayerBase::LcPauseL() + { + // NOP + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcWindow* CMusEngVideoPlayerBase::LcWindow() + { + return this; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcCameraControl* CMusEngVideoPlayerBase::LcCameraControl() + { + return NULL; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcSourceFileControl* CMusEngVideoPlayerBase::LcSourceFileControl() + { + return NULL; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcDestinationFileControl* CMusEngVideoPlayerBase::LcDestinationFileControl() + { + return NULL; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcAudioControl* CMusEngVideoPlayerBase::LcAudioControl() + { + return &iLcAudioControl; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcZoomControl* CMusEngVideoPlayerBase::LcZoomControl() + { + return NULL; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcBrightnessControl* CMusEngVideoPlayerBase::LcBrightnessControl() + { + return NULL; + } + +// ----------------------------------------------------------------------------- +// From MLcWindow +// ----------------------------------------------------------------------------- +// +void CMusEngVideoPlayerBase::EnableLcWindowL( TBool aEnable ) + { + iDisplayHandler.EnableDisplayL( aEnable ); + } + +// ----------------------------------------------------------------------------- +// From MLcWindow +// ----------------------------------------------------------------------------- +// +TBool CMusEngVideoPlayerBase::IsLcWindowEnabled() + { + return iDisplayHandler.IsDisplayEnabled(); + } + +// ----------------------------------------------------------------------------- +// From MLcWindow +// ----------------------------------------------------------------------------- +// +void CMusEngVideoPlayerBase::SetLcWindowRectL( TRect aRect ) + { + iDisplayHandler.SetRectL( aRect ); + } + + +// ----------------------------------------------------------------------------- +// From MLcWindow +// ----------------------------------------------------------------------------- +// +TRect CMusEngVideoPlayerBase::LcWindowRect() + { + return iDisplayHandler.Rect(); + } + +// ----------------------------------------------------------------------------- +// From MLcWindow +// ----------------------------------------------------------------------------- +// +void CMusEngVideoPlayerBase::SetLcWindowOrientationL( + TLcWindowOrientation aOrientation ) + { + if ( aOrientation == MLcWindow::ELandscape ) + { + iDisplayHandler.SetOrientationL( MMusEngDisplayHandler::ELandscape ); + } + else + { + iDisplayHandler.SetOrientationL( MMusEngDisplayHandler::EPortrait ); + } + } + +// ----------------------------------------------------------------------------- +// From MLcWindow +// ----------------------------------------------------------------------------- +// +MLcWindow::TLcWindowOrientation CMusEngVideoPlayerBase::LcWindowOrientationL() + { + MLcWindow::TLcWindowOrientation orientation; + if ( iDisplayHandler.OrientationL() == MMusEngDisplayHandler::ELandscape ) + { + orientation = MLcWindow::ELandscape; + } + else + { + orientation = MLcWindow::EPortrait; + } + return orientation; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/src/svptimer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/dummymusengineplugin/src/svptimer.cpp Thu Jul 22 16:32:26 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: Timer service for SVP +* +*/ + + +#include "svptimer.h" +#include "svptimerobserver.h" + + +const TInt KMicroSecondsCoefficient = 1000; + + +// --------------------------------------------------------------------------- +// CSVPTimer::CSVPTimer +// --------------------------------------------------------------------------- +// +CSVPTimer::CSVPTimer( MSVPTimerObserver& aObserver, TInt aTimerId ): + CTimer( EPriorityHigh ), + iObserver( aObserver ), + iId( aTimerId ) + { + CActiveScheduler::Add( this ); + } + +// --------------------------------------------------------------------------- +// CSVPTimer::CSVPTimer +// --------------------------------------------------------------------------- +// +void CSVPTimer::ConstructL() + { + CTimer::ConstructL(); + } + +// --------------------------------------------------------------------------- +// CSVPTimer::CSVPTimer +// --------------------------------------------------------------------------- +// +CSVPTimer* CSVPTimer::NewL( MSVPTimerObserver& aObserver, + TInt aTimerId ) + { + CSVPTimer* self = new (ELeave) CSVPTimer( aObserver, aTimerId ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + +// --------------------------------------------------------------------------- +// CSVPTimer::~CSVPTimer +// --------------------------------------------------------------------------- +// +CSVPTimer::~CSVPTimer() + { + Cancel(); + } + +// --------------------------------------------------------------------------- +// CSVPTimer::RunL +// --------------------------------------------------------------------------- +// +void CSVPTimer::RunL() + { + iObserver.TimedOut( iId ); + } + +// --------------------------------------------------------------------------- +// CSVPTimer::SetTime +// --------------------------------------------------------------------------- +// +void CSVPTimer::SetTime( TInt aMilliSeconds ) + { + // Milliseconds to microseconds conversion + const TTimeIntervalMicroSeconds32 time( + KMicroSecondsCoefficient * aMilliSeconds ); + + CTimer::After( time ); // NB, CTimer::After calls SetActive + } + +// --------------------------------------------------------------------------- +// CSVPTimer::Stop +// --------------------------------------------------------------------------- +// +void CSVPTimer::Stop() + { + Cancel(); + } + +// --------------------------------------------------------------------------- +// CSVPTimer::Id +// --------------------------------------------------------------------------- +// +TInt CSVPTimer::Id() const + { + return iId; + } + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ipvtengine/data/20029876.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ipvtengine/data/20029876.rss Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,40 @@ +/* +* 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 "registryinfov2.rh" + +RESOURCE REGISTRY_INFO theInfo + { + resource_format_version = RESOURCE_FORMAT_VERSION_2; + dll_uid = 0x20029876; + interfaces = + { + INTERFACE_INFO + { + interface_uid = 0x20021340; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x20029876; + version_no = 1; + default_data = "Videotelephony"; + } + }; + } + }; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ipvtengine/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ipvtengine/group/bld.inf Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,23 @@ +/* +* 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 + +PRJ_MMPFILES +ipvtengineplugin.mmp + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ipvtengine/group/ipvtengineplugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ipvtengine/group/ipvtengineplugin.mmp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,73 @@ +/* +* 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 + +TARGET ipvtengineplugin.dll +TARGETTYPE PLUGIN +UID 0x10009D8D 0x20029876 +VENDORID VID_DEFAULT +CAPABILITY CAP_ECOM_PLUGIN + +SOURCEPATH ../data +START RESOURCE 20029876.rss +TARGET ipvtengineplugin.rsc +END + +SOURCEPATH ../src +SOURCE musenginepluginentry.cpp +SOURCE musengsessionmanager.cpp + + +SOURCE musengmcesession.cpp +SOURCE musengtwowaysession.cpp +SOURCE musengcamerahandler.cpp +SOURCE musengvideoplayerbase.cpp +SOURCE musenglocalvideoplayer.cpp +SOURCE musenglivevideoplayer.cpp +SOURCE musengremotevideoplayer.cpp +SOURCE svptimer.cpp +SOURCE mccdatasender.cpp +SOURCE mccdatareceiver.cpp +SOURCE mccscreen.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../../../../../inc + + +APP_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/ecom + +LIBRARY euser.lib +LIBRARY bafl.lib +LIBRARY inetprotutil.lib +LIBRARY phoneclient.lib +LIBRARY centralrepository.lib +LIBRARY sipprofilecli.lib +LIBRARY sipclient.lib +LIBRARY sipcodec.lib +LIBRARY mceclient.lib +LIBRARY drmcommon.lib +LIBRARY charconv.lib +LIBRARY telephonyaudiorouting.lib +LIBRARY cntmodel.lib ecom.lib +LIBRARY ecam.lib +LIBRARY ws32.lib +LIBRARY bitgdi.lib +LIBRARY fbscli.lib +LIBRARY cone.lib +DEBUGLIBRARY flogger.lib diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ipvtengine/inc/mccdatareceiver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ipvtengine/inc/mccdatareceiver.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,63 @@ +/* +* 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: +* +*/ + + + + +#ifndef MCCDATARECEIVER_H +#define MCCDATARECEIVER_H +#include +#include + +#include "mccdatareceiverobserver.h" +#include "mccdatastructures.h" + + +// CLASS DECLARATION + +/** +* CMccDataReceiver class declaration +*/ +class CMccDataReceiver : public CActive + { + public: + + static CMccDataReceiver* NewL( MMccDataReceiverObserver& aObserver ); + + ~CMccDataReceiver(); + + TDataMessage iInitData; + + public: // From CActive + + void DoCancel(); + void RunL(); + TInt RunError(TInt aError); + + private: + CMccDataReceiver( MMccDataReceiverObserver& aObserver ); + void ConstructL(); // second construction phase + + private: + + RMsgQueue iMsgQueue; + MMccDataReceiverObserver* iObserver; + + }; + + +#endif \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ipvtengine/inc/mccdatareceiverobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ipvtengine/inc/mccdatareceiverobserver.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,41 @@ +/* +* 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: +* +*/ + + + + +#ifndef MCCDATARECEIVEROBSERVER_H +#define MCCDATARECEIVEROBSERVER_H + +#include +#include "mccdatastructures.h" + +// CLASS DECLARATION + +/** +* CMccDataReceiver class declaration +*/ +class MMccDataReceiverObserver + { + public: + + virtual void DataReceived( const TDataMessage& aData ) = 0; + + }; + + +#endif \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ipvtengine/inc/mccdatasender.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ipvtengine/inc/mccdatasender.h Thu Jul 22 16:32:26 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: +* +*/ + + + + +#ifndef MCCDATASENDER_H +#define MCCDATASENDER_H +#include +#include + +#include "mccdatastructures.h" + + +// CLASS DECLARATION + +/** +* CMccPeriodicRunner class declaration +*/ +class CMccDataSender : public CActive + { + public: + + static CMccDataSender* NewL(); + + ~CMccDataSender(); + + public: + + void Send( const TDataMessage& aData ); + + public: // From CActive + + void DoCancel(); + void RunL(); + TInt RunError(TInt aError); + + private: + CMccDataSender(); + void ConstructL(); // second construction phase + + private: + + RMsgQueue iMsgQueue; + TDataMessage iBuffer; + + }; + + +#endif \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ipvtengine/inc/mccdatastructures.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ipvtengine/inc/mccdatastructures.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,48 @@ +/* +* 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: +* +*/ + + + + +#ifndef MCCDATASTRUCTURES_H +#define MCCDATASTRUCTURES_H + +#include + +enum TDataId +{ + EUninitialized, + EInitComplete, + EEstablish, + EProceeding, + EEstablished, + ETerminate, + ETerminated +}; + +class TDataMessage +{ +public: + TDataId iDataId; + TInt iDataIntValue; + TBuf<50> iDataBufValue; + +}; + + + +#endif \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ipvtengine/inc/mccscreen.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ipvtengine/inc/mccscreen.h Thu Jul 22 16:32:26 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: +* +*/ + + + +#ifndef MCCSCREEN_H +#define MCCSCREEN_H + +#include +#include "svptimerobserver.h" + +class CCamera; +class MCameraDirectViewFinder; +class CSVPTimer; + +/** +* Screen for viewfinder, may use bitmap viewfinder or direct viewfinder +* depending on supported camera vf modes. +* +*/ +class CMccScreen : public CBase + { + + public: + + enum TMccScreenType + { + EBitmapScreen, + EDirectScreen + }; + + public: + + static CMccScreen* NewL( CCamera* aCamera, + TPoint aPos, + TSize aArea, + TInt aIndex, + TInt aWindowOrdinalPosition, + TInt aWindowOrdinalPriority, + TBool aSecondary, + RDrawableWindow* aParentWindow = 0); + + ~CMccScreen(); + + + + public: + + virtual void StartL(); + + virtual void Stop(); + + virtual void Draw( CFbsBitmap& aFrame ); + + virtual TInt SetCamera( CCamera* aCamera ); + + void SetPrimaryRectL(TRect aRect); + void SetSecondaryRectL(TRect aRect); + + void Update(TBool aIsForeground); + + protected: + + void StopCamera(); + + TBool VfStartPossible(); + + void ConstructL(); + + CMccScreen( TMccScreenType aScreenType, + CCamera* aCamera, + TPoint aPos, + TSize aArea, + TInt aIndex, + TInt aWindowOrdinalPosition, + TInt aWindowOrdinalPriority, + TBool aSecondary = EFalse, + RDrawableWindow* aParentWindow = 0); + + protected: + + CCamera* iCamera; + TInt iDeviceIndex; + TPoint iPosition; + TSize iArea; + TInt iWindowOrdinalPosition; + TInt iWindowOrdinalPriority; + + RWsSession iRwSession; + RWindowGroup* iRwGroup; + RWindow* iRw; + CWsScreenDevice* iDev; + + CWindowGc* iGraphicsContext; + + TMccScreenType iScreenType; + + TBool iSecondary; + TRect iPrimaryRect; + TRect iSecondaryRect; + + RDrawableWindow* iParentWindow; + + + +#ifdef TEST_EUNIT + friend class UT_CMccCameraHandler; + friend class UT_CMccScreen; +#endif + +}; + +/** +* Bitamp viewfinder screen. Uses DSA to draw vf bitmaps. +* +*/ +class CMccScreenBitmap : public CMccScreen, + public MDirectScreenAccess, + public MSVPTimerObserver + { + + public: + + static CMccScreenBitmap* NewL( CCamera* aCamera, + TPoint aPos, + TSize aArea, + TInt aIndex, + TInt aWindowOrdinalPosition, + TInt aWindowOrdinalPriority, + TBool aSecondary, + RDrawableWindow* aParentWindow = 0); + + ~CMccScreenBitmap(); + + public: // From CMccScreen + + virtual void StartL(); + + virtual void Stop(); + + virtual void Draw( CFbsBitmap& aFrame ); + + void TimedOut( TInt aTimerId ); + + private: + + void ConstructL(); + + CMccScreenBitmap( CCamera* aCamera, + TPoint aPos, + TSize aArea, + TInt aIndex, + TInt aWindowOrdinalPosition, + TInt aWindowOrdinalPriority, + TBool aSecondary, + RDrawableWindow* aParentWindow = 0); + + void Restart( RDirectScreenAccess::TTerminationReasons aReason ); + + void AbortNow( RDirectScreenAccess::TTerminationReasons aReason ); + + void StartCameraL(); + + void StartDsaL(); + + TPoint UpdateViewFinderArea( TSize aViewFinderImageSize ); + + void DoDraw( CFbsBitmap& aFrame ); + + void DoScreenDeviceUpdate(); + + void AttachFrameL( CFbsBitmap* aFrame ); + + void DetachFrame(); + + void StoreFrameDataL( CFbsBitmap& aFrame ); + + CFbsBitmap* RestoreFrameLC(); + + void DrawBlackBorders(); + + private: + + CDirectScreenAccess* iDirectScreenAccess; + CFbsBitGc* iGc; + RRegion* iRegion; + CFbsScreenDevice* iFbsDev; + + TRect iViewFinderImageRect; + + TBool iFirstImageDrawn; + + CFbsBitmap* iAttachedFrame; + + TBool iAborted; + + TSize iPausedFrameSize; + TDisplayMode iPausedFrameDisplayMode; + HBufC8* iPausedFrameData; + + TBool iStopped; + + CSVPTimer* iTimer; + + +#ifdef TEST_EUNIT + friend class UT_CMccCameraHandler; + friend class UT_CMccScreen; +#endif + + }; + +/** +* Direct viewfinder screen. +* +*/ +class CMccScreenDirect : public CMccScreen + { + + public: + + static CMccScreenDirect* NewL( CCamera* aCamera, + TPoint aPos, + TSize aArea, + TInt aIndex, + TInt aWindowOrdinalPosition, + TInt aWindowOrdinalPriority ); + + ~CMccScreenDirect(); + + + + public: // From CMccScreen + + virtual void StartL(); + + virtual void Stop(); + + virtual TInt SetCamera( CCamera* aCamera ); + + private: + + void ConstructL(); + + CMccScreenDirect( + CCamera* aCamera, + TPoint aPos, + TSize aArea, + TInt aIndex, + TInt aWindowOrdinalPosition, + TInt aWindowOrdinalPriority ); + + void StartDirectViewFinderL(); + + TInt HandleDirectViewFinder(); + + private: + + MCameraDirectViewFinder* iDirectViewFinder; + +#ifdef TEST_EUNIT + friend class UT_CMccCameraHandler; + friend class UT_CMccScreen; +#endif + + }; + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ipvtengine/inc/musengcamerahandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ipvtengine/inc/musengcamerahandler.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,122 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef MUSHENGCAMERAHANDLER_H +#define MUSHENGCAMERAHANDLER_H + +// USER +#include "lccameracontrol.h" +#include "lcbrightnesscontrol.h" +#include "lczoomcontrol.h" + +// SYSTEM +#include +#include + +class CMusEngMceSession; + +// CLASS + +class TMusEngCameraHandler : + 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: + + TMusEngCameraHandler(); + + TInt ZoomStepSize( TInt64& aTime ); + + void SetSession( CMusEngMceSession* aSession ); + + TBool IsPlayingL(); + void PlayL(); + void PauseL(); + + + private: + + enum TCurrentCamera + { + ECameraNotAvailable = KErrNotFound, + EBackCamera = 0, + EFrontCamera = 1 + }; + + + private: // Data + + + TCameraInfo iCameraInfo; + + TInt iDefaultBrightness; + + TInt64 iZoomInTime; + + TInt64 iZoomOutTime; + + TInt iSmallZoomStep; + + TInt iBigZoomStep; + + TCurrentCamera iCurrentCamera; + + CMusEngMceSession* iMusSession; + TBool iPlaying; + }; + +#endif + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ipvtengine/inc/musengdisplayhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ipvtengine/inc/musengdisplayhandler.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,109 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef MUSHENGDISPLAYHANDLER_H +#define MUSHENGDISPLAYHANDLER_H + + +#include + +// CLASS DECLARATION + +/** +* An Interface for display services +* +* @lib museng.lib +* @since S60 v3.2 +*/ +class MMusEngDisplayHandler + { + + public: + + /* + * Defines possible rotations + */ + enum TDisplayOrientation + { + EPortrait, // Normal + ELandscape // 90 degree's clockwise rotation + }; + + /** + * Returns currently assigned drawing area + * + * @return TRect This session drawing area rectangle + */ + virtual TRect Rect() const = 0; + + /** + * Sets new drawing area + * + * @param TRect This session new drawing area rectangle + */ + virtual void SetRectL( const TRect& aRect ) = 0; + + /** + * Sets secondary rect (e.g. viewfinder in twoway session) + * @param TRect This session new secondary drawing area rectangle + */ + virtual void SetSecondaryRectL( const TRect& aSecondaryRect ) = 0; + + /** + * Gets secondary rect. + * @return TRect This session secondary drawing area rectangle + */ + virtual TRect SecondaryRect() const = 0; + + /** + * Enables or disables display. Call to this function is considered + * as a permission or denial to draw to the display. + */ + virtual void EnableDisplayL( TBool aEnable ) = 0; + + /** + * Check whether display is enabled + */ + virtual TBool IsDisplayEnabled() = 0; + + /** + * Returns current display orientation. + * + * @pre Session is ongoing + * @return Current display orientation + * @leave KErrNotReady if precondition is not fullfilled + */ + virtual TDisplayOrientation OrientationL() = 0; + + /** + * Sets display orientation. + * + * @pre Session is ongoing + * @return Sets display orientation + * @leave KErrNotReady if precondition is not fullfilled + */ + virtual void SetOrientationL( TDisplayOrientation aOrientation ) = 0; + + /** + * Check if display is actively displaying content + * @return ETrue if is displaying content, otherwise EFalse + */ + virtual TBool IsDisplayActive() = 0; + }; + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ipvtengine/inc/musenglivevideoplayer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ipvtengine/inc/musenglivevideoplayer.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,83 @@ +/* +* 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 MUSHENGLIVEVIDEOPLAYER_H +#define MUSHENGLIVEVIDEOPLAYER_H + +// INCLUDES +#include "musenglocalvideoplayer.h" +#include "lcdestinationfilecontrol.h" + +// FORWARD DECLARATIONS +class CMceSession; +class TMusEngCameraHandler; + +// CLASS DECLARATION +class CMusEngLiveVideoPlayer : + public CMusEngLocalVideoPlayer, + public MLcDestinationFileControl + { + public: // Constructors and destructor + + static CMusEngLiveVideoPlayer* NewL( + MMusEngDisplayHandler& aDisplayHandler, + TMusEngCameraHandler& aCameraHandler, + MLcAudioControl& aLcAudioControl ); + + ~CMusEngLiveVideoPlayer(); + + public: // From MLcVideoPlayer + + TBool LcIsPlayingL(); + + void LcPlayL(); + + void LcPauseL(); + + MLcCameraControl* LcCameraControl(); + + MLcDestinationFileControl* LcDestinationFileControl(); + + MLcZoomControl* LcZoomControl(); + + MLcBrightnessControl* LcBrightnessControl(); + + public: // From MLcDestinationFileControl + + void SetLcFileNameL( const TFileName& aFileName ); + + TFileName& LcFileName(); + + void LcRecordL( TBool aRecord ); + + TBool LcIsRecording(); + + private: // Constructors + + CMusEngLiveVideoPlayer( + MMusEngDisplayHandler& aDisplayHandler, + TMusEngCameraHandler& aCameraHandler, + MLcAudioControl& aLcAudioControl ); + + private: // Data + + TFileName iFileName; + TMusEngCameraHandler& iCameraHandler; + }; + +#endif // MUSHENGLIVEVIDEOPLAYER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ipvtengine/inc/musenglocalvideoplayer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ipvtengine/inc/musenglocalvideoplayer.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,49 @@ +/* +* 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 MUSHENGLOCALVIDEOPLAYER_H +#define MUSHENGLOCALVIDEOPLAYER_H + +// INCLUDES +#include "musengvideoplayerbase.h" + +// CLASS DECLARATION +class CMusEngLocalVideoPlayer : public CMusEngVideoPlayerBase + { + public: // Constructors and destructor + + ~CMusEngLocalVideoPlayer(); + + public: // from CMusEngVideoPlayerBase + + TLcVideoPlayerState LcVideoPlayerState() const; + + void SetLcWindowRectL( TRect aRect ); + + TRect LcWindowRect(); + + TLcVideoPlayerState iState; + + protected: // Constructors + + CMusEngLocalVideoPlayer( + MMusEngDisplayHandler& aDisplayHandler, + MLcAudioControl& aLcAudioControl ); + }; + +#endif // MUSHENGLOCALVIDEOPLAYER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ipvtengine/inc/musenglogger.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ipvtengine/inc/musenglogger.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,301 @@ +/* +* 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: ?Description +* +*/ + + +#ifndef MUSENGLOGGER_H +#define MUSENGLOGGER_H + + +#include "muslogger.h" + +#if ( !_DEBUG || UNIT_TESTING ) // release or unit test build; no logs + +#define MUS_ENG_LOG_SESSION_STATE( aSession ) +#define MUS_ENG_LOG_SESSION_STATE_AND_STATUS( aSession, aStatusCode, aReasonPhrase ) +#define MUS_ENG_LOG_STREAM_STATE( aStream ) +#define MUS_ENG_LOG_SINK_STATES( aStream ) +#define MUS_ENG_LOG_SOURCE_STATE( aSource ) +#define MUS_ENG_LOG_SINK_STATE( aSink ) +#define MUS_ENG_LOG_STATUS( aStatusCode, aReasonPhrase ) + +#else // debug build; logs + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define MUS_ENG_LOG_SESSION_STATE( aSession )\ + {\ + TBuf<15> state;\ + switch ( (aSession).State() )\ + {\ + case CMceSession::EIdle:\ + {\ + state = _L("EIdle");\ + break;\ + }\ + case CMceSession::EOffering :\ + {\ + state = _L("EOffering");\ + break;\ + }\ + case CMceSession::EIncoming:\ + {\ + state = _L("EIncoming");\ + break;\ + }\ + case CMceSession::EReserving :\ + {\ + state = _L("EReserving");\ + break;\ + }\ + case CMceSession::EAnswering :\ + {\ + state = _L("EAnswering");\ + break;\ + }\ + case CMceSession::EProceeding :\ + {\ + state = _L("EProceeding");\ + break;\ + }\ + case CMceSession::EEstablished:\ + {\ + state = _L("EEstablished");\ + break;\ + }\ + case CMceSession::ECancelling:\ + {\ + state = _L("ECancelling");\ + break;\ + }\ + case CMceSession::ETerminating:\ + {\ + state = _L("ETerminating");\ + break;\ + }\ + case CMceSession::ETerminated:\ + {\ + state = _L("ETerminated");\ + break;\ + }\ + default:\ + {\ + state = _L("Unknown");\ + break;\ + }\ + }\ + MUS_LOG_TDESC( "mus: [ENGINE] Session state is ", state )\ + } + + +#define MUS_ENG_LOG_SESSION_STATE_AND_STATUS( aSession, aStatusCode, aReasonPhrase )\ + {\ + MUS_ENG_LOG_SESSION_STATE( aSession )\ + MUS_ENG_LOG_STATUS( aStatusCode, aReasonPhrase )\ + } + + +#define MUS_ENG_LOG_STREAM_STATE( aStream )\ + {\ + TBuf<20> streamState;\ + switch ( (aStream).State() )\ + {\ + case CMceMediaStream::EUninitialized:\ + {\ + streamState = _L("EIdle");\ + break;\ + }\ + case CMceMediaStream::EInitialized:\ + {\ + streamState = _L("EInitialized");\ + break;\ + }\ + case CMceMediaStream::EBuffering:\ + {\ + streamState = _L("EBuffering");\ + break;\ + }\ + case CMceMediaStream::EIdle:\ + {\ + streamState = _L("EIdle");\ + break;\ + }\ + case CMceMediaStream::EStreaming:\ + {\ + streamState = _L("EStreaming");\ + break;\ + }\ + case CMceMediaStream::EDisabled:\ + {\ + streamState = _L("EDisabled");\ + break;\ + }\ + case CMceMediaStream::ENoResources:\ + {\ + streamState = _L("ENoResources");\ + break;\ + }\ + case CMceMediaStream::ETranscodingRequired:\ + {\ + streamState = _L("ETranscodingRequired");\ + break;\ + }\ + case CMceMediaStream::ETranscoding:\ + {\ + streamState = _L("ETranscoding");\ + break;\ + }\ + default:\ + {\ + streamState = _L("Unknown");\ + break;\ + }\ + }\ + if ( (aStream).Type() == KMceAudio )\ + {\ + MUS_LOG_TDESC( "mus: [ENGINE] AudioStream state is ", streamState )\ + }\ + else\ + {\ + MUS_LOG_TDESC( "mus: [ENGINE] VideoStream state is ", streamState )\ + }\ + MUS_ENG_LOG_SOURCE_STATE( (aStream).Source() )\ + MUS_ENG_LOG_SINK_STATES( (aStream) )\ + } + + +#define MUS_ENG_LOG_SINK_STATES( aStream )\ + {\ + for ( TInt sinkIndex = 0; sinkIndex < aStream.Sinks().Count(); ++sinkIndex )\ + {\ + MUS_ENG_LOG_SINK_STATE( aStream.Sinks()[ sinkIndex ] )\ + }\ + } + + +#define MUS_ENG_LOG_SOURCE_STATE( aSource )\ + {\ + if ( aSource )\ + {\ + TBuf<10> sourceState;\ + if ( aSource->IsEnabled() )\ + {\ + sourceState = _L("enabled");\ + }\ + else\ + {\ + sourceState = _L("disabled");\ + }\ + switch ( aSource->Type() )\ + {\ + case KMceCameraSource:\ + {\ + MUS_LOG_TDESC( " CameraSource is ", sourceState )\ + break;\ + }\ + case KMceFileSource:\ + {\ + MUS_LOG_TDESC( " FileSource is ", sourceState )\ + break;\ + }\ + case KMceRTPSource:\ + {\ + MUS_LOG_TDESC( " RtpSource is ", sourceState )\ + break;\ + }\ + default:\ + {\ + MUS_LOG_TDESC( " UnknownSource is ", sourceState )\ + break;\ + }\ + }\ + }\ + else\ + {\ + MUS_LOG( " No source in stream" )\ + }\ + } + +#define MUS_ENG_LOG_SINK_STATE( aSink )\ + {\ + if ( aSink )\ + {\ + TBuf<10> sinkState;\ + if ( aSink->IsEnabled() )\ + {\ + sinkState = _L("enabled");\ + }\ + else\ + {\ + sinkState = _L("disabled");\ + }\ + switch ( aSink->Type() )\ + {\ + case KMceDisplaySink:\ + {\ + MUS_LOG_TDESC( " DisplaySink is ", sinkState )\ + break;\ + }\ + case KMceSpeakerSink:\ + {\ + MUS_LOG_TDESC( " SpeakerSink is ", sinkState )\ + break;\ + }\ + case KMceRTPSink:\ + {\ + MUS_LOG_TDESC( " RtpSink is ", sinkState )\ + break;\ + }\ + case KMceFileSink:\ + {\ + MUS_LOG_TDESC( " FileSink is ", sinkState )\ + break;\ + }\ + default:\ + {\ + MUS_LOG_TDESC( " UnknownSink is ", sinkState )\ + break;\ + }\ + }\ + }\ + } + + +#define MUS_ENG_LOG_STATUS( aStatusCode, aReasonPhrase )\ + {\ + MUS_LOG1( " StatusCode is %d", aStatusCode )\ + HBufC16* reasonPhrase = HBufC16::NewLC( aReasonPhrase.Length() );\ + reasonPhrase->Des().Copy( aReasonPhrase );\ + MUS_LOG_TDESC( " ReasonPhrase is ",(*reasonPhrase) )\ + CleanupStack::PopAndDestroy( reasonPhrase );\ + } + + + +#endif // _DEBUG + + +#endif // MUSENGLOGGER_H + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ipvtengine/inc/musengmcesession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ipvtengine/inc/musengmcesession.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,290 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef MUSENGMCESESSION_H +#define MUSENGMCESESSION_H + +// USER +#include "musengcamerahandler.h" +#include "musengdisplayhandler.h" +#include "lcsession.h" +#include "lcaudiocontrol.h" +#include "svptimerobserver.h" + +#include + + +// FORWARD DECLARATIONS +class CContactTextField; +class CPbkContactItem; +class CPbkContactEngine; +class MLcSessionObserver; +class CMusEngLiveVideoPlayer; +class CMusEngRemoteVideoPlayer; +class CSVPTimer; +class CMccScreen; + + +// CONSTANTS + +_LIT8( KMusEngAcceptContactHeader, + "Accept-Contact: *;+g.3gpp.cs-voice; explicit" ); +_LIT8( KMusAcceptHeader, + "Accept: application/sdp" ); +_LIT8( KMusEngSessionSdpLineXApplication, "a=X-application:com.nokia.rtvs\r\n" ); +_LIT8( KMusEngSessionSdpLineApplication , "a=application:com.gsma.rts\r\n" ); +_LIT8( KMusEngSessionSdpLineType, "a=type:videolive\r\n" ); +_LIT8( KMusEngSessionSdpLineBandwidthLine , "b=AS:" ); +_LIT8( KMusEngSessionSdpLineBandwidthField , "b=AS:85\r\n" ); +_LIT8( KMusEngSessionSdpLineTiasLine , "b=TIAS:" ); +_LIT8( KMusPPreferredIdentity, "P-Preferred-Identity" ); +_LIT8( KMusEngNewLine , "\r\n" ); + +const TInt KMusTiasMultiplier = 1000; +const TUint8 KMusEngRtpKeepAliveTimer = 5; +const TUint8 KMusEngKeepAlivePayloadTypeVideoH263 = 96; +const TUint8 KMusEngKeepAlivePayloadTypeAudio = 97; +const TUint8 KMusEngKeepAlivePayloadTypeVideoAvc = 98; + +// CLASS DECLARATION + +/** +* Base class for Multimedia Sharing Engine MCE sessions, inherited by +* CMusEngLiveSession CMusEngClipSession and CMusEngReceiveSession. +* +* CMusEngMceSession encapsulates CMCESession and simplifies use of +* MCE Sessions to user interface. Also splits observers messy events +* to simplified function calls. +* +* @lib musengine.lib +*/ +class CMusEngMceSession : public CBase, + public MLcSession, + public MLcAudioControl, + public MMusEngDisplayHandler, + public MSVPTimerObserver + { + public: + + /** + * Destructor + */ + ~CMusEngMceSession(); + + void SetRemoteL( const TDesC& aRemote ); + void ToggleCameraL(); + void PlayCameraL(); + void PauseCameraL(); + void InformUiProviderAboutReceivingStart(); + + public: // from MSVPTimerObserver + + virtual void TimedOut( TInt aTimerId ); + + + public: // from MMusEngDisplayHandler + + /** + * Returns currently assigned drawing area + * + * @return TRect This session drawing area rectangle + */ + TRect Rect() const; + + /** + * Sets new drawing area + * + * @param TRect This session new drawing area rectangle + */ + void SetRectL( const TRect& aRect ); + + /** + * Sets secondary rect (e.g. viewfinder in twoway session) + * @param TRect This session new secondary drawing area rectangle + */ + void SetSecondaryRectL( const TRect& aSecondaryRect ); + + /** + * Gets secondary rect. + * @return TRect This session secondary drawing area rectangle + */ + virtual TRect SecondaryRect() const; + + /** + * Returns current display orientation. + * + * @pre Session is ongoing + * @return Current display orientation + * @leave KErrNotReady if precondition is not fullfilled + */ + TDisplayOrientation OrientationL(); + + /** + * Sets display orientation. + * + * @pre Session is ongoing + * @return Sets display orientation + * @leave KErrNotReady if precondition is not fullfilled + */ + void SetOrientationL( TDisplayOrientation aOrientation ); + + /** + * Permission to draw on screen device. + * + * @pre Session is ongoing + */ + void EnableDisplayL( TBool aEnable ); + + /** + * Implements virtual from MMusEngDisplayHandler + * + * @pre Session is ongoing + */ + TBool IsDisplayEnabled(); + + /** + * Implements virtual from MMusEngDisplayHandler + * + * @pre Session is ongoing + */ + TBool IsDisplayActive(); + + + public: // From MMusEngAudioRoutingObserver + + void AudioRoutingChanged(); + + + public: // From MLcSession + + virtual TLcSessionState LcSessionState() const; + + void SetLcSessionObserver( MLcSessionObserver* aObserver ); + + void SetLcUiProvider( MLcUiProvider* aUiProvider ); + + virtual MLcVideoPlayer* RemoteVideoPlayer(); + + virtual MLcVideoPlayer* LocalVideoPlayer(); + + virtual const TDesC& LocalDisplayName(); + + virtual const TDesC& RemoteDisplayName(); + + TInt SetParameter( TInt aId, TInt aValue ); + + TInt ParameterValue( TInt aId ); + + TBool IsBackgroundStartup(); + + TInt SetForegroundStatus( TBool aIsForeground ); + + const TDesC& RemoteDetails(); + + 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(); + + + protected: // CONSTRUCTORS + + /** + * Constructor + * + */ + CMusEngMceSession(); + + /** + * Second-phase constructor + */ + void ConstructL(); + + protected: // Data + + /** + * Drawing area rect. + */ + TRect iRect; + + /** + * ETrue if operator specific behavior is expected + */ + TBool iOperatorVariant; + + /** + * Session state for MLcSession + */ + MLcSession::TLcSessionState iLcSessionState; + + TMusEngCameraHandler iCameraHandler; + + CMusEngLiveVideoPlayer* iLiveVideoPlayer; + CMusEngRemoteVideoPlayer* iRemoteVideoPlayer; + TRect iSetRemoteRect; + TRect iSetLocalRect; + CSVPTimer* iTimer; + TLcSessionState lLcSessionState; + HBufC* iRemoteAddress; + CMccScreen* iScreen; + + private: // Data + + /** + * The session observer, if present. + */ + MLcSessionObserver* iLcSessionObserver; + + /** + * The UI provider, if present. + */ + MLcUiProvider* iLcUiProvider; + + /** + * Value indicates whether session was started in background mode. + * (see IsBackgroundStartup()). Once sending of video started, + * iBackground is set to EFalse + */ + TBool iBackground; + + + }; + +#endif // MUSENGMCESESSION_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ipvtengine/inc/musengremotevideoplayer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ipvtengine/inc/musengremotevideoplayer.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,60 @@ +/* +* 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 MUSHENGREMOTEVIDEOPLAYER_H +#define MUSHENGREMOTEVIDEOPLAYER_H + +// INCLUDES +#include +#include "musengvideoplayerbase.h" + +// FORWARD DECLARATIONS +class CMceSession; +class MLcWindow; +class MLcAudioControl; + +// CLASS DECLARATION +class CMusEngRemoteVideoPlayer : public CMusEngVideoPlayerBase + { + public: // Constructors and destructor + + static CMusEngRemoteVideoPlayer* NewL( MMusEngDisplayHandler& aDisplayHandler, + MLcAudioControl& aLcAudioControl ); + + ~CMusEngRemoteVideoPlayer(); + + + public: // from CMusEngVideoPlayerBase + + TLcVideoPlayerState LcVideoPlayerState() const; + + TBool LcIsPlayingL(); + + TLcVideoPlayerState iState; + + private: // Constructors + + CMusEngRemoteVideoPlayer( MMusEngDisplayHandler& aDisplayHandler, + MLcAudioControl& aLcAudioControl ); + void ConstructL(); + + private: // Data + + }; + +#endif // MUSHENGREMOTEVIDEOPLAYER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ipvtengine/inc/musengsessionmanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ipvtengine/inc/musengsessionmanager.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,63 @@ +/* +* 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 CMUSENGSESSIONMANAGER_H +#define CMUSENGSESSIONMANAGER_H + +// INCLUDES +#include "lcengine.h" +#include "mccdatareceiverobserver.h" + +// FORWARD DECLARATIONS +class MLcSession; +class CMusEngMceSession; +class MLcUiProvider; +class CMccDataReceiver; +class CMccDataSender; + +class CMusEngSessionManager : public CLcEngine, public MMccDataReceiverObserver + { + public: + + static CMusEngSessionManager* NewL(); + ~CMusEngSessionManager(); + + void DataReceived( const TDataMessage& aData ); + + public: // From CLcEngine + + MLcSession& Session(); + + TBool IsFeatureSupported( TLcFeature aLcFeature ); + + private: // Constructors + + CMusEngSessionManager(); + void ConstructL(); + + private: // Data + + CMusEngMceSession* iSession; + + CMccDataReceiver* iMsgReceiver; + CMccDataSender* iMsgSender; + + }; + +#endif // CMUSENGSESSIONMANAGER_H + +// end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ipvtengine/inc/musengtwowayrecvsession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ipvtengine/inc/musengtwowayrecvsession.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,141 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef MUSHENGTWOWAYRECVSESSION_H +#define MUSHENGTWOWAYRECVSESSION_H + +// USER +#include "musengreceivesession.h" +#include "musunittesting.h" +#include "mussettings.h" +#include "musengcamerahandler.h" + +// SYSTEM +#include + +// FORWARD DECLARATIONS +class CMceDisplaySink; +class CMceStreamBundle; +class CMusEngLiveVideoPlayer; + + +class CMusEngTwoWayRecvSession : public CMusEngReceiveSession + { + MUS_UNITTEST( UT_CMusEngTwoWayRecvSession ) + + + public: + /** + * Creates new MultimediaSharing two-way receive session. + * @return CMusEngTwoWayRecvSession* New instanse of specified class + */ + static CMusEngTwoWayRecvSession* NewL(); + + public: + + /** + * Destructor + */ + ~CMusEngTwoWayRecvSession(); + + public: + + void EnableDisplayL( TBool aEnable ); + + CMusEngMceSession::TDisplayOrientation OrientationL(); + + void SetOrientationL( TDisplayOrientation aOrientation ); + + public: + + /** + * Sets both remote (receiving video) and local (viewfinder) rects. + * + */ + void SetRectsL( const TRect& aRemoteRect, + const TRect& aLocalRect ); + + /** + * Gets camera handler (can be used for zooming etc.) + */ + TMusEngCameraHandler& Camera(); + + public: // from MLcSession + + MLcVideoPlayer* LocalVideoPlayer(); + + protected: // From CMusEngReceiveSession + + /** + * Sets local rect (viewfinder). + * + */ + void SetSecondaryRectL( const TRect& aSecondaryRect ); + + /** + * Gets local rect (viewfinder). + * + */ + TRect SecondaryRect() const; + + void CompleteSessionStructureL(); + + void RectChangedL(); + + private: + + /** + * Constructor + */ + CMusEngTwoWayRecvSession(); + + /** + * Second-phase constructor + */ + void ConstructL(); + + private: + + void CompleteSessionStructureAudioPartL( + const RPointerArray& aStreams, + CMceStreamBundle& aLocalBundle, + CMceMediaStream* aVideoInStream, + CMceMediaStream* aVideoOutStream ); + + void CompleteSessionStructureInStreamL( CMceMediaStream& aVideoInStream, + CMceStreamBundle& aLocalBundle ); + + void CompleteSessionStructureOutStreamL( CMceMediaStream& aVideoOutStream ); + + + private: + + TRect iLocalRect; + + TMusEngCameraHandler iCameraHandler; + + /// The live video player implementing MLcVideoPlayer + CMusEngLiveVideoPlayer* iLiveVideoPlayer; + + TRect iSetRemoteRect; + TRect iSetLocalRect; + + }; + +#endif + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ipvtengine/inc/musengtwowaysession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ipvtengine/inc/musengtwowaysession.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,88 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef MUSHENGTWOWAYSESSION_H +#define MUSHENGTWOWAYSESSION_H + +// USER +#include "musengmcesession.h" + +// SYSTEM +#include + +// FORWARD DECLARATIONS +class MMusEngLiveSessionObserver; +class CMceDisplaySink; +class MMusEngTwoWaySessionObserver; +class CMusEngRemoteVideoPlayer; + + +class CMusEngTwoWaySession : public CMusEngMceSession + { + public: + /** + * Creates new MultimediaSharing Live session. + * @return CMusEngTwoWaySession* New instanse of specified class + */ + static CMusEngTwoWaySession* NewL(); + + + public: + + /** + * Destructor + */ + ~CMusEngTwoWaySession(); + + public: + + void EnableDisplayL( TBool aEnable ); + + void SetOrientationL( MMusEngDisplayHandler::TDisplayOrientation aOrientation ); + + void EstablishLcSessionL(); + + void TerminateLcSessionL(); + + void UpdateLcSessionL(); + + public: + + /** + * Sets both remote (receiving video) and local (viewfinder) rects. + * + */ + void SetRectsL( const TRect& aRemoteRect, + const TRect& aLocalRect ); + + private: + + /** + * Constructor + */ + CMusEngTwoWaySession(); + + /** + * Second-phase constructor + */ + void ConstructL(); + + }; + +#endif + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ipvtengine/inc/musengvideoplayerbase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ipvtengine/inc/musengvideoplayerbase.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,90 @@ +/* +* 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 MUSHENGVIDEOPLAYERBASE_H +#define MUSHENGVIDEOPLAYERBASE_H + +// INCLUDES +#include +#include "lcvideoplayer.h" +#include "lcwindow.h" + +// FORWARD DECLARATIONS +class TMusEngCameraHandler; +class MMusEngDisplayHandler; + +// CLASS DECLARATION +class CMusEngVideoPlayerBase : + public CBase, public MLcVideoPlayer, public MLcWindow + { + public: // Constructors and destructor + + ~CMusEngVideoPlayerBase(); + + public: // From MLcVideoPlayer + + virtual void LcPlayL(MLcVideoPlayer::TLcVideoPlayerSource aSource); + + virtual void LcPauseL(); + + MLcWindow* LcWindow(); + + virtual MLcCameraControl* LcCameraControl(); + + virtual MLcSourceFileControl* LcSourceFileControl(); + + virtual MLcDestinationFileControl* LcDestinationFileControl(); + + MLcAudioControl* LcAudioControl(); + + virtual MLcZoomControl* LcZoomControl(); + + virtual MLcBrightnessControl* LcBrightnessControl(); + + virtual MLcVideoPlayer::TLcVideoPlayerSource LcVideoPlayerSourceL(); + + + public: // from MLcWindow + + void EnableLcWindowL( TBool aEnable ); + + TBool IsLcWindowEnabled(); + + void SetLcWindowRectL( TRect aRect ); + + TRect LcWindowRect(); + + void SetLcWindowOrientationL( + TLcWindowOrientation aOrientation ); + + TLcWindowOrientation LcWindowOrientationL(); + + protected: // Constructors + + CMusEngVideoPlayerBase( + MMusEngDisplayHandler& aDisplayHandler, + MLcAudioControl& aLcAudioControl ); + + protected: // Data + + MMusEngDisplayHandler& iDisplayHandler; + MLcAudioControl& iLcAudioControl; + MLcVideoPlayer::TLcVideoPlayerSource iVideoPlayerSource; + }; + +#endif // MUSHENGVIDEOPLAYERBASE_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ipvtengine/inc/svptimer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ipvtengine/inc/svptimer.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,112 @@ +/* +* 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: Timer services for SVP +* +*/ + + + +#ifndef SVPTIMER_H +#define SVPTIMER_H + +#include + +class MSVPTimerObserver; + +/** + * SVP timer + * + * Provides timer service for SVP + * + * @lib + * @since S60 3.2 + */ +class CSVPTimer : public CTimer + { + +public: + + /** + * Two-phased constructor. + */ + static CSVPTimer* NewL( MSVPTimerObserver& aObserver, + TInt aTimerId ); + + /** + * Destructor. + */ + virtual ~CSVPTimer(); + +public: // new methods + + /** + * Sets the timer to be fired after given number of milliseconds. + * @since Series 60 3.2 + * @param aMilliSeconds Time in milliseconds + * @return + */ + void SetTime( TInt aMilliSeconds, TInt aTimerId ); + + /** + * Stops the timer. + * @since Series 60 3.2 + * @return + */ + void Stop(); + + /** + * Returns the Timer ID + * @since Series 60 3.2 + * @return TInt The timer ID. + */ + TInt Id() const; + +public: // methods from base classes + + /** + * From CActive Called when an aychronic request is completed. + * @since Series 60 3.0 + * @param None + * @return None + */ + void RunL(); + +private: + + /** + * C++ default constructor. + */ + CSVPTimer( MSVPTimerObserver& aObserver, TInt aTimerId ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + +private: // data + + /** + * Reference to the observer. + */ + MSVPTimerObserver& iObserver; + + /** + * The timer ID, given to observer when the timer fires. + * Timers can be identifies with this ID. + */ + TInt iId; + + }; + +#endif // SVPTIMER_H \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ipvtengine/inc/svptimerobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ipvtengine/inc/svptimerobserver.h Thu Jul 22 16:32:26 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: Observer for SVP timer +* +*/ + + +#ifndef SVPTIMEROBSERVER_H +#define SVPTIMEROBSERVER_H + +#include + +/** + * SVP timer observer + * + * Observer for SVP timer + * + * @lib + * @since S60 3.2 + */ +class MSVPTimerObserver + { + +public: // New functions + + /** + * Notifies, that the previously set timer has now expired. + * Implemented by the class using the timer. + * @since Series 60 3.2 + * @param TInt aTimerId The ID of the timer. Observer can identify + * timers from each other with this ID. + * @return + */ + virtual void TimedOut( TInt aTimerId ) = 0; + + + }; + +#endif // SVPTIMEROBSERVER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ipvtengine/src/mccdatareceiver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ipvtengine/src/mccdatareceiver.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,107 @@ +/* +* 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: +* +*/ + + +// INCLUDE FILES +#include "mccdatareceiver.h" + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CMccDataReceiver::CMccDataReceiver +// ----------------------------------------------------------------------------- +// +CMccDataReceiver::CMccDataReceiver( MMccDataReceiverObserver& aObserver ) + : CActive( EPriorityStandard ), iObserver( &aObserver ) + { + CActiveScheduler::Add(this); + } + +// ----------------------------------------------------------------------------- +// CMccDataReceiver::ConstructL +// ----------------------------------------------------------------------------- +// +void CMccDataReceiver::ConstructL() + { + + TInt err = iMsgQueue.CreateGlobal(_L("IP-VT-Queue2"), 5, EOwnerProcess ); + if ( err ) + { + User::LeaveIfError( iMsgQueue.OpenGlobal(_L("IP-VT-Queue2"))); + } + + iMsgQueue.ReceiveBlocking( iInitData ); + + iMsgQueue.NotifyDataAvailable( iStatus ); + SetActive(); + } + +// ----------------------------------------------------------------------------- +// CMccDataReceiver::NewL +// ----------------------------------------------------------------------------- +// +CMccDataReceiver* CMccDataReceiver::NewL( MMccDataReceiverObserver& aObserver ) + { + CMccDataReceiver* self = + new ( ELeave ) CMccDataReceiver( aObserver ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CMccDataReceiver::~CMccDataReceiver +// ----------------------------------------------------------------------------- +// +CMccDataReceiver::~CMccDataReceiver() + { + Cancel(); + iMsgQueue.Close(); + } + +// ----------------------------------------------------------------------------- +// CMccDataReceiver::DoCancel +// ----------------------------------------------------------------------------- +// +void CMccDataReceiver::DoCancel() + { + iMsgQueue.CancelDataAvailable(); + } + +// ----------------------------------------------------------------------------- +// CMccDataReceiver::RunL +// ----------------------------------------------------------------------------- +// +void CMccDataReceiver::RunL() + { + TDataMessage buffer; + iMsgQueue.Receive( buffer ); + iObserver->DataReceived( buffer ); + iMsgQueue.NotifyDataAvailable( iStatus ); + SetActive(); + } + +// ----------------------------------------------------------------------------- +// CMccDataReceiver::RunError +// ----------------------------------------------------------------------------- +// +TInt CMccDataReceiver::RunError(TInt /*aError*/) + { + return KErrNone; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ipvtengine/src/mccdatasender.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ipvtengine/src/mccdatasender.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,122 @@ +/* +* 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: +* +*/ + + +// INCLUDE FILES +#include "mccdatasender.h" + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CMccDataSender::CMccDataSender +// ----------------------------------------------------------------------------- +// +CMccDataSender::CMccDataSender( ) + : CActive( EPriorityStandard ) + { + CActiveScheduler::Add(this); + } + +// ----------------------------------------------------------------------------- +// CMccDataSender::ConstructL +// ----------------------------------------------------------------------------- +// +void CMccDataSender::ConstructL() + { + TInt err = iMsgQueue.CreateGlobal(_L("IP-VT-Queue1"), 5, EOwnerProcess ); + if ( err ) + { + User::LeaveIfError( iMsgQueue.OpenGlobal(_L("IP-VT-Queue1"))); + } + } + +// ----------------------------------------------------------------------------- +// CMccDataSender::NewL +// ----------------------------------------------------------------------------- +// +CMccDataSender* CMccDataSender::NewL( ) + { + CMccDataSender* self = + new ( ELeave ) CMccDataSender(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CMccDataSender::Send +// ----------------------------------------------------------------------------- +// +void CMccDataSender::Send( const TDataMessage& aData ) +{ + TInt err = iMsgQueue.Send( aData ); + + if ( err == KErrOverflow ) + { + if ( !IsActive() ) + { + iBuffer = aData; + iMsgQueue.NotifySpaceAvailable( iStatus ); + SetActive(); + } + else + { + // TODO + // BUFFER OR DROP + } + } + } + +// ----------------------------------------------------------------------------- +// CMccDataSender::~CMccDataSender +// ----------------------------------------------------------------------------- +// +CMccDataSender::~CMccDataSender() + { + Cancel(); + iMsgQueue.Close(); + } + +// ----------------------------------------------------------------------------- +// CMccDataSender::DoCancel +// ----------------------------------------------------------------------------- +// +void CMccDataSender::DoCancel() + { + iMsgQueue.CancelSpaceAvailable(); + } + +// ----------------------------------------------------------------------------- +// CMccDataSender::RunL +// ----------------------------------------------------------------------------- +// +void CMccDataSender::RunL() + { + iMsgQueue.Send( iBuffer ); + iBuffer.iDataId = EUninitialized; + } + +// ----------------------------------------------------------------------------- +// CMccDataSender::RunError +// ----------------------------------------------------------------------------- +// +TInt CMccDataSender::RunError(TInt /*aError*/) + { + return KErrNone; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ipvtengine/src/mccscreen.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ipvtengine/src/mccscreen.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,921 @@ +/* +* 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: +* +*/ + +#include +#include +#include +#include +#include +#include +#include "MccScreen.h" +#include "svptimer.h" +#include "musenglogger.h" + +// EXTERNAL DATA STRUCTURES + +// EXTERNAL FUNCTION PROTOTYPES + +// CONSTANTS + +_LIT(KMccWindowGroupName,"MccVideoWindow"); + +// MACROS + +// LOCAL CONSTANTS AND MACROS + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// ============================= LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CMccScreen::NewL +// ----------------------------------------------------------------------------- +// +CMccScreen* CMccScreen::NewL( CCamera* aCamera, + TPoint aPos, + TSize aArea, + TInt aIndex, + TInt aWindowOrdinalPosition, + TInt aWindowOrdinalPriority, + TBool aSecondary, + RDrawableWindow* aParentWindow ) + { + // Resolve screen type based on ecam capabilities, asssume direct vf + // to be available if camera not present yet. + CMccScreen* screen = NULL; + TBool useDirectVf = EFalse; + + if ( aCamera ) + { + TCameraInfo info; + aCamera->CameraInfo( info ); + useDirectVf = ( info.iOptionsSupported & TCameraInfo::EViewFinderDirectSupported ); + } + + if ( useDirectVf ) + { + TRAPD( err, screen = CMccScreenDirect::NewL( + aCamera, aPos, aArea, aIndex, + aWindowOrdinalPosition, aWindowOrdinalPriority ) ); + // If creation failes for some reason, bitmap vf is tried to be + // created as a fallback + if ( err == KErrNoMemory ) + { + User::Leave( err ); + } + if ( err ) + { + } + } + + if ( !screen ) + { + screen = CMccScreenBitmap::NewL( + aCamera, aPos, aArea, aIndex, + aWindowOrdinalPosition, aWindowOrdinalPriority, aSecondary, aParentWindow ); + } + return screen; + } + +// ----------------------------------------------------------------------------- +// CMccScreen::~CMccScreen +// ----------------------------------------------------------------------------- +// +CMccScreen::~CMccScreen() + { + + StopCamera(); + + delete iGraphicsContext; + delete iDev; + delete iRw; + delete iRwGroup; + iRwSession.Close(); + + } + +// ----------------------------------------------------------------------------- +// CMccScreen::StartL +// ----------------------------------------------------------------------------- +// +void CMccScreen::StartL() + { + + } + +// ----------------------------------------------------------------------------- +// CMccScreen::Stop +// ----------------------------------------------------------------------------- +// +void CMccScreen::Stop() + { + + } + +// ----------------------------------------------------------------------------- +// CMccScreen::Draw +// ----------------------------------------------------------------------------- +// +void CMccScreen::Draw( CFbsBitmap& /*aFrame*/ ) + { + + } + +// ----------------------------------------------------------------------------- +// CMccScreen::SetCamera +// ----------------------------------------------------------------------------- +// +TInt CMccScreen::SetCamera( CCamera* aCamera ) + { + if ( !aCamera ) + { + StopCamera(); + } + + iCamera = aCamera; + + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// CMccScreen::StopCamera +// ----------------------------------------------------------------------------- +// +void CMccScreen::StopCamera() + { + + if ( iCamera ) + { + iCamera->StopViewFinder(); + } + + } + +// ----------------------------------------------------------------------------- +// CMccScreen::VfStartPossible +// ----------------------------------------------------------------------------- +// +TBool CMccScreen::VfStartPossible() + { + return ( iCamera && !iCamera->ViewFinderActive() && + iArea.iWidth > 0 && + iArea.iHeight > 0 ); + } + +void CMccScreen::SetPrimaryRectL(TRect aRect) + { + MUS_LOG2( "mus: [ENGINE] -> CMccScreen::SetPrimaryRectL() (%dx%d)", + aRect.Width(), aRect.Height() ); + MUS_LOG2( "mus: [ENGINE] -> CMccScreen::SetPrimaryRectL() (%d,%d)", + aRect.iTl.iX, aRect.iTl.iY ); + iPrimaryRect = aRect; + } +void CMccScreen::SetSecondaryRectL(TRect aRect) + { + MUS_LOG2( "mus: [ENGINE] -> CMccScreen::SetSecondaryRectL() (%dx%d)", + aRect.Width(), aRect.Height() ); + MUS_LOG2( "mus: [ENGINE] -> CMccScreen::SetSecondaryRectL() (%d,%d)", + aRect.iTl.iX, aRect.iTl.iY ); + iSecondaryRect = aRect; + } + +void CMccScreen::Update(TBool aIsForeground) + { + if ( aIsForeground ){ + + iRwGroup->SetOrdinalPosition( iWindowOrdinalPosition, iWindowOrdinalPriority ); + iRw->SetOrdinalPosition( iWindowOrdinalPosition, iWindowOrdinalPriority ); + iRw->HandleTransparencyUpdate(); + iRwSession.Flush(); + } else { + + } + + } + + +// ----------------------------------------------------------------------------- +// CMccScreen::ConstructL +// ----------------------------------------------------------------------------- +// +void CMccScreen::ConstructL() + { + User::LeaveIfError( iRwSession.Connect() ); + + // Create window group + + iRwGroup = new (ELeave) RWindowGroup( iRwSession ) ; + + RWindowGroup& rootWin = CCoeEnv::Static()->RootWin(); + rootWin.AllowProcessToCreateChildWindowGroups(TUid::Uid( 0x101F8681 )); + TUint32 groupId = rootWin.WindowGroupId(); //iRwSession.GetFocusWindowGroup(); + TUint32 focusGroupId = iRwSession.GetFocusWindowGroup(); + //User::LeaveIfError( iRwGroup->ConstructChildApp( groupId, (TUint32)iRwGroup, EFalse ) ); + User::LeaveIfError( iRwGroup->Construct( (TUint32)iRwGroup, EFalse ) ); + + TBuf<100> name; + name.Append(KMccWindowGroupName); + iRwGroup->SetName( name ); + + iRwGroup->SetOrdinalPosition( iWindowOrdinalPosition, iWindowOrdinalPriority ); + //iRwGroup->SetOrdinalPriorityAdjust(1); + iRwGroup->AutoForeground(EFalse); + + // Create screen device + iDev = new (ELeave) CWsScreenDevice( iRwSession ); + iDev->Construct( iDeviceIndex ); + + TInt currMode = iDev->CurrentScreenMode(); + MUS_LOG1( "mus: [ENGINE] -> CMccScreen::ConstructL() mode: %d", currMode ); + TPixelsTwipsAndRotation sizeAndRotation; + iDev->GetScreenModeSizeAndRotation( currMode, sizeAndRotation ); + + MUS_LOG3( "mus: [ENGINE] -> CMccScreen::ConstructL() (%dx%d) %d", + sizeAndRotation.iPixelSize.iWidth, sizeAndRotation.iPixelSize.iHeight, sizeAndRotation.iRotation ); + + // Create window + iRw = new (ELeave) RWindow( iRwSession ); + + User::LeaveIfError( iRw->Construct( *iRwGroup, (TUint32)iRw ) ); + + + iRw->SetPosition( iPosition ); + + iRw->SetSize( iArea ); + iRw->SetOrdinalPosition( iWindowOrdinalPosition, iWindowOrdinalPriority ); + iRw->EnableVisibilityChangeEvents(); + + User::LeaveIfError( iDev->CreateContext( iGraphicsContext ) ); + + iRw->Activate(); + iRwSession.Flush(); + } + +// ----------------------------------------------------------------------------- +// CMccScreen::CMccScreen +// ----------------------------------------------------------------------------- +// +CMccScreen::CMccScreen( + TMccScreenType aScreenType, + CCamera* aCamera, + TPoint aPos, + TSize aArea, + TInt aIndex, + TInt aWindowOrdinalPosition, + TInt aWindowOrdinalPriority, + TBool aSecondary, + RDrawableWindow* aParentWindow ) : + iCamera( aCamera ), + iDeviceIndex( aIndex ), + iPosition( aPos ), + iArea( aArea ), + iWindowOrdinalPosition( aWindowOrdinalPosition ), + iWindowOrdinalPriority( aWindowOrdinalPriority ), + iScreenType( aScreenType ), + iSecondary(aSecondary), + iParentWindow(aParentWindow)/*, + iRwSession(CCoeEnv::Static()->WsSession()), + iRwGroup(&CCoeEnv::Static()->RootWin()), + iDev(CCoeEnv::Static()->ScreenDevice())*/ + { + + } + + +// ----------------------------------------------------------------------------- +// CMccScreenBitmap::CMccScreenBitmap +// ----------------------------------------------------------------------------- +// +CMccScreenBitmap* CMccScreenBitmap::NewL( + CCamera* aCamera, + TPoint aPos, + TSize aArea, + TInt aIndex, + TInt aWindowOrdinalPosition, + TInt aWindowOrdinalPriority, + TBool aSecondary, + RDrawableWindow* aParentWindow) + { + CMccScreenBitmap* self = new ( ELeave ) CMccScreenBitmap( aCamera, + aPos, + aArea, + aIndex, + aWindowOrdinalPosition, + aWindowOrdinalPriority, + aSecondary, + aParentWindow); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CMccScreenBitmap::CMccScreenBitmap +// ----------------------------------------------------------------------------- +// +CMccScreenBitmap::CMccScreenBitmap( + CCamera* aCamera, + TPoint aPos, + TSize aArea, + TInt aIndex, + TInt aWindowOrdinalPosition, + TInt aWindowOrdinalPriority, + TBool aSecondary, + RDrawableWindow* aParentWindow) : + CMccScreen( EBitmapScreen, aCamera, aPos, aArea, aIndex, + aWindowOrdinalPosition, aWindowOrdinalPriority, aSecondary, aParentWindow ), + iAborted( ETrue ) + { + } + +// ----------------------------------------------------------------------------- +// CMccScreenBitmap::CMccScreenBitmap +// ----------------------------------------------------------------------------- +// +CMccScreenBitmap::~CMccScreenBitmap() + { + + DetachFrame(); // Must do bitmap detach before releasing window resources + delete iDirectScreenAccess; + + delete iPausedFrameData; + delete iTimer; + } + +// ----------------------------------------------------------------------------- +// CMccScreenBitmap::ConstructL +// ----------------------------------------------------------------------------- +// +void CMccScreenBitmap::ConstructL() + { + iTimer = CSVPTimer::NewL( *this, 1 ); + + CMccScreen::ConstructL(); + + // Create direct screen access + //iDirectScreenAccess = CDirectScreenAccess::NewL( iRwSession, *iDev, *iRw, *this ); + + UpdateViewFinderArea( iArea ); + + StartL(); // Simu HACK + iTimer->SetTime(500, 1); + } + +// ----------------------------------------------------------------------------- +// CMccScreenBitmap::StartL +// ----------------------------------------------------------------------------- +// +void CMccScreenBitmap::StartL() + { + iStopped = EFalse; + + if ( iCamera ) + { + StartCameraL(); + } + else if ( iPausedFrameData ) + { + + CFbsBitmap* frame = RestoreFrameLC(); + AttachFrameL( frame ); + CleanupStack::Pop( frame ); + } + else + { + // NOP + } + + StartDsaL(); + } + +// ----------------------------------------------------------------------------- +// CMccScreenBitmap::StartCameraL +// ----------------------------------------------------------------------------- +// +void CMccScreenBitmap::StartCameraL() + { + + __ASSERT_ALWAYS( iCamera, User::Leave( KErrNotReady ) ); + + // Camera may modify the size + TSize vfBitmapSize = iArea; + + if ( VfStartPossible() ) + { + iCamera->StartViewFinderBitmapsL( vfBitmapSize ); + } + + + UpdateViewFinderArea( vfBitmapSize ); + + } + +// ----------------------------------------------------------------------------- +// CMccScreenBitmap::StartDsaL +// ----------------------------------------------------------------------------- +// +void CMccScreenBitmap::StartDsaL() + { + /* + iAborted = EFalse; + iDirectScreenAccess->Cancel(); + iDirectScreenAccess->StartL(); + iGc = iDirectScreenAccess->Gc(); + iFbsDev = iDirectScreenAccess->ScreenDevice(); + iRegion = iDirectScreenAccess->DrawingRegion(); + + iGc->SetClippingRegion( iRegion ); + */ + // Fill with black areas which are not covered by viewfinder image. + // If viewfinder image has not been yet received and drawn, fill whole area. + // + + /* if ( !iFirstImageDrawn ) + { + // Whole area + iGc->SetBrushColor( KRgbBlue ); + iGc->SetBrushStyle( CGraphicsContext::ESolidBrush ); + TPoint pointTl( 0, 0 ); + TRect rect( pointTl, iArea ); + iGc->DrawRect( rect ); + } + else + { + DrawBlackBorders(); + } + + if ( iAttachedFrame ) + { + + TSize viewFinderImageSize = iAttachedFrame->SizeInPixels(); + + TPoint corner = UpdateViewFinderArea( viewFinderImageSize ); + + iGc->BitBlt( corner, iAttachedFrame ); + } + + DoScreenDeviceUpdate(); + */ + //iGc->SetBrushStyle( CGraphicsContext::ENullBrush ); + } + +// ----------------------------------------------------------------------------- +// CMccScreenBitmap::Stop +// ----------------------------------------------------------------------------- +// +void CMccScreenBitmap::Stop() + { + // Don't do anything yet, wait for next frame and then stop camera + iStopped = ETrue; + } + +// ----------------------------------------------------------------------------- +// CMccScreenBitmap::Restart +// ----------------------------------------------------------------------------- +// +void CMccScreenBitmap::Restart( RDirectScreenAccess::TTerminationReasons /*aReason*/ ) + { + + TRAP_IGNORE( StartDsaL() ); + } + +// ----------------------------------------------------------------------------- +// CMccScreenBitmap::AbortNow +// ----------------------------------------------------------------------------- +// +void CMccScreenBitmap::AbortNow( RDirectScreenAccess::TTerminationReasons /*aReason*/ ) + { + iDirectScreenAccess->Cancel(); + + iAborted = ETrue; + } + +// ----------------------------------------------------------------------------- +// CMccScreenBitmap::Draw +// ----------------------------------------------------------------------------- +// +void CMccScreenBitmap::Draw( CFbsBitmap& aFrame ) + { + if ( iStopped ) + { + + // Screen was waiting for freeze frame from camera, inform observer + // that camera is not needed anymore + StoreFrameDataL( aFrame ); + CFbsBitmap* frame = RestoreFrameLC(); + AttachFrameL( frame ); + CleanupStack::Pop( frame ); + + StopCamera(); + } + else + { + // When normal frame draw is requested, attached frame is not anymore drawn + DetachFrame(); + + DoDraw( aFrame ); + } + } + +void CMccScreenBitmap::TimedOut( TInt aTimerId ) + { + iGraphicsContext->Activate(*iRw); + iRw->Invalidate(); + iRw->BeginRedraw(); + TRgb color1(0,0,255,255); + iGraphicsContext->Clear(); + iGraphicsContext->SetBrushColor( color1 ); + iGraphicsContext->SetBrushStyle( CGraphicsContext::ESolidBrush ); + iGraphicsContext->DrawRect( iPrimaryRect ); + TRgb color2(0,255,0,255); + iGraphicsContext->SetBrushColor( color2 ); + iGraphicsContext->DrawRect( iSecondaryRect ); + iRw->EndRedraw(); + iGraphicsContext->Deactivate(); + iRwSession.Flush(); + + /* + if ( !iAborted && iGc ){ + iGc->SetBrushColor( KRgbBlue ); + iGc->SetBrushStyle( CGraphicsContext::ESolidBrush ); + iGc->DrawRect( iPrimaryRect ); + iGc->SetBrushColor( KRgbGreen ); + iGc->DrawRect( iSecondaryRect ); + DoScreenDeviceUpdate(); + } + */ + iTimer->SetTime(500, 1); + } + +// ----------------------------------------------------------------------------- +// CMccScreenBitmap::AttachFrameL +// ----------------------------------------------------------------------------- +// +void CMccScreenBitmap::AttachFrameL( CFbsBitmap* aFrame ) + { + + __ASSERT_ALWAYS( aFrame, User::Leave( KErrArgument ) ); + + DetachFrame(); + + iAttachedFrame = aFrame; + + DoDraw( *iAttachedFrame ); + + } + +// ----------------------------------------------------------------------------- +// CMccScreenBitmap::DetachFrame +// ----------------------------------------------------------------------------- +// +void CMccScreenBitmap::DetachFrame() + { + if ( iAttachedFrame ) + { + iAttachedFrame->Reset(); + delete iAttachedFrame; + } + + iAttachedFrame = NULL; + } + +// ----------------------------------------------------------------------------- +// CMccScreenBitmap::UpdateViewFinderArea +// ----------------------------------------------------------------------------- +// +TPoint CMccScreenBitmap::UpdateViewFinderArea( TSize aViewFinderImageSize ) + { + TPoint corner( 0, 0 ); + if ( aViewFinderImageSize.iWidth < iArea.iWidth ) + { + // Divide the subtraction by two (i.e. do centering) + corner.iX = ( iArea.iWidth - aViewFinderImageSize.iWidth ) >> 1; + } + + if ( aViewFinderImageSize.iHeight < iArea.iHeight ) + { + // Divide the subtraction by two (i.e. do centering) + corner.iY = ( iArea.iHeight - aViewFinderImageSize.iHeight ) >> 1; + } + + iViewFinderImageRect = TRect( corner, aViewFinderImageSize ); + + return corner; + } + +// ----------------------------------------------------------------------------- +// CMccScreenBitmap::DoDraw +// ----------------------------------------------------------------------------- +// +void CMccScreenBitmap::DoDraw( CFbsBitmap& aFrame ) + { + if ( !iAborted && iGc ) + { + iFirstImageDrawn = ETrue; + + TSize viewFinderImageSize = aFrame.SizeInPixels(); + + TBool imageSizeChanged = ( viewFinderImageSize != iViewFinderImageRect.Size() ); + + TPoint corner = UpdateViewFinderArea( viewFinderImageSize ); + + if ( imageSizeChanged ) + { + // Size of bitmap changed suddenly, borders need to be redrawn + DrawBlackBorders(); + } + + iGc->BitBlt( corner, &aFrame ); + + DoScreenDeviceUpdate(); + } + } + +// ----------------------------------------------------------------------------- +// CMccScreenBitmap::DoScreenDeviceUpdate +// ----------------------------------------------------------------------------- +// +void CMccScreenBitmap::DoScreenDeviceUpdate() + { + if ( iFbsDev ) + { + iFbsDev->Update(); + } + } + +// ----------------------------------------------------------------------------- +// CMccScreenBitmap::StoreFrameDataL +// ----------------------------------------------------------------------------- +// +void CMccScreenBitmap::StoreFrameDataL( CFbsBitmap& aFrame ) + { + + iPausedFrameSize = aFrame.SizeInPixels(); + iPausedFrameDisplayMode = aFrame.DisplayMode(); + TInt bitmapSizeInBytes = + CFbsBitmap::ScanLineLength( iPausedFrameSize.iWidth, iPausedFrameDisplayMode ) * + iPausedFrameSize.iHeight; + HBufC8* pausedFrameData = HBufC8::NewLC( bitmapSizeInBytes ); + aFrame.LockHeap(); + pausedFrameData->Des().Copy( (TUint8*)aFrame.DataAddress(), bitmapSizeInBytes ); + aFrame.UnlockHeap(); + delete iPausedFrameData; + iPausedFrameData = pausedFrameData; + CleanupStack::Pop( pausedFrameData ); + } + +// ----------------------------------------------------------------------------- +// CMccScreenBitmap::RestoreFrameLC +// ----------------------------------------------------------------------------- +// +CFbsBitmap* CMccScreenBitmap::RestoreFrameLC() + { + + __ASSERT_ALWAYS( iPausedFrameData, User::Leave( KErrNotReady ) ); + + CFbsBitmap* tempFrame = new ( ELeave ) CFbsBitmap; + CleanupStack::PushL( tempFrame ); + + User::LeaveIfError( tempFrame->Create( iPausedFrameSize, iPausedFrameDisplayMode ) ); + TInt bitmapSizeInBytes = + CFbsBitmap::ScanLineLength( iPausedFrameSize.iWidth, iPausedFrameDisplayMode ) * + iPausedFrameSize.iHeight; + + tempFrame->LockHeap(); + Mem::Copy( tempFrame->DataAddress(), + iPausedFrameData->Des().Ptr(), + bitmapSizeInBytes ); + tempFrame->UnlockHeap(); + + + return tempFrame; + } + +// ----------------------------------------------------------------------------- +// CMccScreenBitmap::DrawBlackBorders +// ----------------------------------------------------------------------------- +// +void CMccScreenBitmap::DrawBlackBorders() + { + iGc->SetBrushColor( KRgbBlue ); + iGc->SetBrushStyle( CGraphicsContext::ESolidBrush ); + + // Upper area + TPoint pointTl( 0, 0 ); + TPoint pointBr( iArea.iWidth, iViewFinderImageRect.iTl.iY ); + TRect rect( pointTl, pointBr ); + iGc->DrawRect( rect ); + + // Lower area + pointTl.SetXY( 0, iViewFinderImageRect.iBr.iY ); + pointBr.SetXY( iArea.iWidth, iArea.iHeight ); + rect.SetRect( pointTl, pointBr ); + iGc->DrawRect( rect ); + + // Left area + pointTl.SetXY( 0, iViewFinderImageRect.iTl.iY ); + pointBr.SetXY( iViewFinderImageRect.iTl.iX, iViewFinderImageRect.iBr.iY ); + rect.SetRect( pointTl, pointBr ); + iGc->DrawRect( rect ); + + // Right area + pointTl.SetXY( iViewFinderImageRect.iBr.iX, iViewFinderImageRect.iTl.iY ); + pointBr.SetXY( iArea.iWidth, iViewFinderImageRect.iBr.iY ); + rect.SetRect( pointTl, pointBr ); + iGc->DrawRect( rect ); + } + +// ----------------------------------------------------------------------------- +// CMccScreenDirect::NewL +// ----------------------------------------------------------------------------- +// +CMccScreenDirect* CMccScreenDirect::NewL( CCamera* aCamera, + TPoint aPos, + TSize aArea, + TInt aIndex, + TInt aWindowOrdinalPosition, + TInt aWindowOrdinalPriority ) + { + + CMccScreenDirect* self = new ( ELeave ) CMccScreenDirect( aCamera, + aPos, + aArea, + aIndex, + aWindowOrdinalPosition, + aWindowOrdinalPriority ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + +// ----------------------------------------------------------------------------- +// CMccScreenDirect::~CMccScreenDirect +// ----------------------------------------------------------------------------- +// +CMccScreenDirect::~CMccScreenDirect() + { + + if ( iDirectViewFinder ) + { + iDirectViewFinder->Release(); + iDirectViewFinder = NULL; + } + + } + +// ----------------------------------------------------------------------------- +// CMccScreenDirect::StartL +// ----------------------------------------------------------------------------- +// +void CMccScreenDirect::StartL() + { + + + if ( iDirectViewFinder && iDirectViewFinder->ViewFinderState() == + CCamera::CCameraDirectViewFinder::EViewFinderPause ) + { + + iDirectViewFinder->ResumeViewFinderDirectL(); + } + else if ( VfStartPossible() ) + { + + StartDirectViewFinderL(); + } + else + { + // NOP + } + } + +// ----------------------------------------------------------------------------- +// CMccScreenDirect::Stop +// ----------------------------------------------------------------------------- +// +void CMccScreenDirect::Stop() + { + + if ( iDirectViewFinder ) + { + // TBD: pausing disabled temporarily due problems in it + //TRAP_IGNORE( iDirectViewFinder->PauseViewFinderDirectL() ) + } + + } + +// ----------------------------------------------------------------------------- +// CMccScreenDirect::SetCamera +// ----------------------------------------------------------------------------- +// +TInt CMccScreenDirect::SetCamera( CCamera* aCamera ) + { + CMccScreen::SetCamera( aCamera ); + + return HandleDirectViewFinder(); + } + +// ----------------------------------------------------------------------------- +// CMccScreenDirect::ConstructL +// ----------------------------------------------------------------------------- +// +void CMccScreenDirect::ConstructL() + { + + CMccScreen::ConstructL(); + + User::LeaveIfError( HandleDirectViewFinder() ); + + } + +// ----------------------------------------------------------------------------- +// CMccScreenDirect::CMccScreenDirect +// ----------------------------------------------------------------------------- +// +CMccScreenDirect::CMccScreenDirect( + CCamera* aCamera, + TPoint aPos, + TSize aArea, + TInt aIndex, + TInt aWindowOrdinalPosition, + TInt aWindowOrdinalPriority ) : + CMccScreen( EDirectScreen, aCamera, aPos, aArea, aIndex, + aWindowOrdinalPosition, aWindowOrdinalPriority ) + { + + } + +// ----------------------------------------------------------------------------- +// CMccScreenDirect::StartDirectViewFinderL +// ----------------------------------------------------------------------------- +// +void CMccScreenDirect::StartDirectViewFinderL() + { + if ( VfStartPossible() ) + { + // Camera may modify the size + TSize vfBitmapSize = iArea; + + TPoint point( 0, 0 ); + TRect vfRect( point, vfBitmapSize ); + iCamera->StartViewFinderDirectL( iRwSession, *iDev, *iRw, vfRect ); + } + } + +// ----------------------------------------------------------------------------- +// CMccScreenDirect::HandleDirectViewFinder +// ----------------------------------------------------------------------------- +// +TInt CMccScreenDirect::HandleDirectViewFinder() + { + TInt err( KErrNone ); + if ( iCamera ) + { + if ( !iDirectViewFinder ) + { + + iDirectViewFinder = static_cast( + iCamera->CustomInterface( TUid::Uid( KECamMCameraDirectViewFinderUidValue ) ) ); + + if ( !iDirectViewFinder ) + { + err = KErrNotSupported; + } + } + } + else if ( iDirectViewFinder ) + { + iDirectViewFinder->Release(); + iDirectViewFinder = NULL; + } + else + { + // NOP + } + return err; + } + + +// End of file + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ipvtengine/src/musengcamerahandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ipvtengine/src/musengcamerahandler.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,278 @@ +/* +* Copyright (c) 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: +* +*/ + + +// USER +#include "musengcamerahandler.h" +#include "musenglogger.h" +#include "musengmcesession.h" + + +// SYSTEM +#include + +const TInt KMaxBrightness = 100; +const TInt KMinBrightness = -100; +const TInt KBrightnessStepSize = 10; + + +//Number of big and small zoom steps on Zoom scale +const TInt KZoomBigStepCount = 15; +const TInt KZoomSmallStepCount = KZoomBigStepCount*2; +const TInt KZoomStepMinSize = 1; + +const TInt64 KZoomFasterTime = 333333; // 1/3 second + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TMusEngCameraHandler::TMusEngCameraHandler() : + iDefaultBrightness( 0 ), + iZoomInTime(0), + iZoomOutTime(0), + iSmallZoomStep( KZoomStepMinSize ), + iBigZoomStep( KZoomStepMinSize ), + iCurrentCamera( TMusEngCameraHandler::ECameraNotAvailable ) + { + iPlaying = ETrue; //Keep it true -> first play not reported up! + } + +// ----------------------------------------------------------------------------- +// From MLcCameraControl +// ----------------------------------------------------------------------------- +// +TInt TMusEngCameraHandler::LcCameraCountL() + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::LcCameraCountL()" ) + + return 2; + } + +// ----------------------------------------------------------------------------- +// From MLcCameraControl +// ----------------------------------------------------------------------------- +// +TInt TMusEngCameraHandler::CurrentLcCameraIndex() + { + return iCurrentCamera; + } + +// ----------------------------------------------------------------------------- +// From MLcCameraControl +// ----------------------------------------------------------------------------- +// +void TMusEngCameraHandler::ToggleLcCameraL() + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::ToggleLcCamera()" ) + iMusSession->ToggleCameraL(); + MUS_LOG( "mus: [ENGINE] <- TMusEngCameraHandler::ToggleLcCamera()" ) + } + +// ----------------------------------------------------------------------------- +// From MLcBrightnessControl +// ----------------------------------------------------------------------------- +// +TInt TMusEngCameraHandler::MinLcBrightnessL() + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::MinLcBrightnessL()" ) + + // minimum brightness is not in camera info, but a constant + + MUS_LOG1( "mus: [ENGINE] <- TMusEngCameraHandler::MinLcBrightnessL(): %d", + KMinBrightness ) + + return KMinBrightness; + } + +// ----------------------------------------------------------------------------- +// From MLcBrightnessControl +// ----------------------------------------------------------------------------- +// +TInt TMusEngCameraHandler::MaxLcBrightnessL() + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::MaxLcBrightnessL()" ) + + // maximum brightness is not in camera info, but a constant + + MUS_LOG1( "mus: [ENGINE] <- TMusEngCameraHandler::MaxLcBrightnessL(): %d", + KMaxBrightness ) + + return KMaxBrightness; + } + +// ----------------------------------------------------------------------------- +// From MLcBrightnessControl +// ----------------------------------------------------------------------------- +// +TInt TMusEngCameraHandler::LcBrightnessL() + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::LcBrightnessL()" ) + + return 5; + } + +// ----------------------------------------------------------------------------- +// From MLcBrightnessControl +// ----------------------------------------------------------------------------- +// +void TMusEngCameraHandler::SetLcBrightnessL( TInt aValue ) + { + MUS_LOG1( "mus: [ENGINE] -> TMusEngCameraHandler::SetLcBrightnessL( %d )", + aValue ) + + + MUS_LOG( "mus: [ENGINE] <- TMusEngCameraHandler::SetLcBrightnessL()" ) + } + +// ----------------------------------------------------------------------------- +// From MLcBrightnessControl +// ----------------------------------------------------------------------------- +// +void TMusEngCameraHandler::IncreaseLcBrightnessL() + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::IncreaseLcBrightnessL()" ) + + MUS_LOG( "mus: [ENGINE] <- TMusEngCameraHandler::IncreaseLcBrightnessL()" ) + } + +// ----------------------------------------------------------------------------- +// From MLcBrightnessControl +// ----------------------------------------------------------------------------- +// +void TMusEngCameraHandler::DecreaseLcBrightnessL() + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::DecreaseLcBrightnessL()" ) + + MUS_LOG( "mus: [ENGINE] <- TMusEngCameraHandler::DecreaseLcBrightnessL()" ) + } + +// ----------------------------------------------------------------------------- +// From MLcZoomControl +// ----------------------------------------------------------------------------- +// +TInt TMusEngCameraHandler::MinLcZoomL() + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::MinLcZoomL()" ) + + return 1; + } + +// ----------------------------------------------------------------------------- +// From MLcZoomControl +// ----------------------------------------------------------------------------- +// +TInt TMusEngCameraHandler::MaxLcZoomL() + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::MaxLcZoomL()" ) + + return 10; + } + +// ----------------------------------------------------------------------------- +// From MLcZoomControl +// ----------------------------------------------------------------------------- +// +TInt TMusEngCameraHandler::LcZoomValueL() + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::LcZoomValueL" ) + + + return 5; + } + +// ----------------------------------------------------------------------------- +// From MLcZoomControl +// ----------------------------------------------------------------------------- +// +void TMusEngCameraHandler::SetLcZoomValueL( TInt aValue ) + { + MUS_LOG1( "mus: [ENGINE] -> TMusEngCameraHandler::SetLcZoomValueL( %d )", + aValue ) + + MUS_LOG( "mus: [ENGINE] <- MusEngCameraHandler::SetLcZoomValueL()" ) + } + +// ----------------------------------------------------------------------------- +// From MLcZoomControl +// ----------------------------------------------------------------------------- +// +void TMusEngCameraHandler::LcZoomInL() + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::LcZoomInL()" ) + + MUS_LOG( "mus: [ENGINE] <- TMusEngCameraHandler::LcZoomInL()" ) + } + +// ----------------------------------------------------------------------------- +// From MLcZoomControl +// ----------------------------------------------------------------------------- +// +void TMusEngCameraHandler::LcZoomOutL() + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::LcZoomOutL()" ) + + MUS_LOG( "mus: [ENGINE] <- TMusEngCameraHandler::LcZoomOutL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void TMusEngCameraHandler::SetSession(CMusEngMceSession* aSession ) + { + iMusSession = aSession; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool TMusEngCameraHandler::IsPlayingL() + { + return iPlaying; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void TMusEngCameraHandler::PlayL() + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::PlayL()" ) + if (!iPlaying) + { + iPlaying = ETrue; + iMusSession->PlayCameraL(); + } + MUS_LOG( "mus: [ENGINE] <- TMusEngCameraHandler::PlayL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void TMusEngCameraHandler::PauseL() + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::PauseL()" ) + iPlaying = EFalse; + iMusSession->PauseCameraL(); + MUS_LOG( "mus: [ENGINE] <- TMusEngCameraHandler::PauseL()" ) + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ipvtengine/src/musengclipvideoplayer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ipvtengine/src/musengclipvideoplayer.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,535 @@ +/* +* 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: +* +*/ + +// USER +#include "musengclipvideoplayer.h" +#include "musengcamerahandler.h" +#include "musengmceutils.h" +#include "musengdisplayhandler.h" +#include "muslogger.h" + +// SYSTEM +#include +#include +#include +#include + +// CONSTANTS +const TInt64 KMicroSecondsInOneSecond = 1000000; +const TInt KFastWindingFactor = 4; + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngClipVideoPlayer* CMusEngClipVideoPlayer::NewL( + MMusEngDisplayHandler& aDisplayHandler, + MLcAudioControl& aLcAudioControl ) + { + return new( ELeave )CMusEngClipVideoPlayer( + aDisplayHandler, aLcAudioControl ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngClipVideoPlayer::CMusEngClipVideoPlayer( + MMusEngDisplayHandler& aDisplayHandler, + MLcAudioControl& aLcAudioControl ) : + CMusEngLocalVideoPlayer( aDisplayHandler, aLcAudioControl ) + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngClipVideoPlayer::~CMusEngClipVideoPlayer() + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMusEngClipVideoPlayer::HasClipEnded() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngClipVideoPlayer::HasClipEnded" ) + + TBool hasClipEnded( EFalse ); + + if ( iMceSession ) + { + CMceVideoStream* videoOut = NULL; + + TRAPD( err, + videoOut = MusEngMceUtils::GetVideoOutStreamL( *iMceSession ) ); + if ( err != KErrNone ) + { + MUS_LOG1( "mus: [ENGINE] Error in GetVideoOutStreamL %d", err ) + return EFalse; + } + + CMceFileSource* filesource = NULL; + TRAP( err, filesource = MusEngMceUtils::GetFileSourceL( *iMceSession ) ) + + if ( err == KErrNone ) + { + TTimeIntervalMicroSeconds position; + TTimeIntervalMicroSeconds duration; + TRAP( err, position = filesource->PositionL() ); + TRAPD( err2, duration = filesource->DurationL() ); + if ( err != KErrNone || err2 != KErrNone ) + { + return EFalse; + } + + MUS_LOG2( "mus: [ENGINE] position = %Ld, duration = %Ld", + position.Int64(), duration.Int64() ) + + hasClipEnded = + ( position.Int64() == 0 && + !filesource->IsEnabled() && + videoOut->State() == CMceMediaStream::EDisabled ); + } + } + + if ( hasClipEnded ) + { + iDelayFileEndingPos = 0; + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngClipVideoPlayer::HasClipEnded" ) + + return hasClipEnded; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngClipVideoPlayer::SetBufferingPeriod( + const TTimeIntervalMicroSeconds& aPeriod ) + { + iBufferingPeriod = aPeriod; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +TBool CMusEngClipVideoPlayer::LcIsPlayingL() + { + __ASSERT_ALWAYS( iMceSession, User::Leave( KErrNotReady ) ); + return ( MusEngMceUtils::GetFileSourceL( *iMceSession )->IsEnabled() ); + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +void CMusEngClipVideoPlayer::LcPlayL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngClipVideoPlayer::LcPlayL" ) + + __ASSERT_ALWAYS( iMceSession, User::Leave( KErrNotReady ) ); + CMceFileSource* file = MusEngMceUtils::GetFileSourceL( *iMceSession ); + + if ( !file->IsEnabled() ) + { + file->EnableL(); + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngClipVideoPlayer::LcPlayL" ) + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +void CMusEngClipVideoPlayer::LcPauseL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngClipVideoPlayer::LcPauseL" ) + + __ASSERT_ALWAYS( iMceSession, User::Leave( KErrNotReady ) ); + CMceFileSource* file = MusEngMceUtils::GetFileSourceL( *iMceSession ); + + if ( file->IsEnabled() ) + { + file->DisableL(); + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngClipVideoPlayer::LcPauseL" ) + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcSourceFileControl* CMusEngClipVideoPlayer::LcSourceFileControl() + { + return this; + } + +// ----------------------------------------------------------------------------- +// From MLcSourceFileControl +// ----------------------------------------------------------------------------- +// +void CMusEngClipVideoPlayer::SetLcFileNameL( const TFileName& aFileName ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngClipVideoPlayer::SetLcFileNameL" ) + + __ASSERT_ALWAYS( !IsProtectedFileL( aFileName ), + User::Leave( KErrPermissionDenied ) ); + + if ( iMceSession ) + { + CMceFileSource* file = MusEngMceUtils::GetFileSourceL( *iMceSession ); + file->UpdateL( aFileName ); + } + + iFileName = aFileName; + MUS_LOG( "mus: [ENGINE] <- CMusEngClipVideoPlayer::SetLcFileNameL" ) + } + +// ----------------------------------------------------------------------------- +// From MLcSourceFileControl +// ----------------------------------------------------------------------------- +// +TFileName& CMusEngClipVideoPlayer::LcFileName() + { + return iFileName; + } + +// ----------------------------------------------------------------------------- +// From MLcSourceFileControl +// Since MCE does not at the moment support SetFastForwardL function, this +// functionality is implemented by taking a timestamp when forwarding is +// started and calculating a new position when it is ended. +// ----------------------------------------------------------------------------- +// +void CMusEngClipVideoPlayer::LcFastForwardL( TBool aUseFFWD ) + { + MUS_LOG1( "mus: [ENGINE] -> CMusEngClipVideoPlayer::FastForward( %d )", + aUseFFWD ) + + __ASSERT_ALWAYS( iMceSession, User::Leave( KErrNotReady ) ); + + CMceFileSource* file = MusEngMceUtils::GetFileSourceL( *iMceSession ); + + if ( aUseFFWD ) + { + // Ignore if we are already fastforwarding + if ( iFFWDStartTime.Int64() > 0 ) + { + return; + } + + // Stop rewinding if ongoing, else just pause file source + if ( iFRWDStartTime.Int64() > 0 ) + { + LcFastRewindL( EFalse ); + } + else + { + file->DisableL(); + } + + // Get timestamp for starttime + iFFWDStartTime.HomeTime(); + } + else + { + // Leave if we are not fastforwarding + if ( iFFWDStartTime.Int64() == 0 ) + { + User::Leave( KErrAlreadyExists ); + } + + // Set new position + file->SetPositionL( PositionMicroSecondsL( ETrue ) ); + + // Reset timer + iFFWDStartTime = TTime( 0 ); + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngClipVideoPlayer::FastForward" ) + } + +// ----------------------------------------------------------------------------- +// From MLcSourceFileControl +// Since MCE does not at the moment support SetFastRewindL function, this +// functionality is implemented by taking a timestamp when rewinding is +// started and calculating a new position when it is ended. +// ----------------------------------------------------------------------------- +// +void CMusEngClipVideoPlayer::LcFastRewindL( TBool aUseFRWD ) + { + MUS_LOG1( "mus: [ENGINE] -> CMusEngClipVideoPlayer::FastRewind( %d )", + aUseFRWD ) + + __ASSERT_ALWAYS( iMceSession, User::Leave( KErrNotReady ) ); + + CMceFileSource* file = MusEngMceUtils::GetFileSourceL( *iMceSession ); + + if ( aUseFRWD ) + { + // Ignore if we are already fastrewinding + if ( iFRWDStartTime.Int64() > 0 ) + { + return; + } + + // Stop fastforwarding if ongoing, else just pause file source + if ( iFFWDStartTime.Int64() > 0 ) + { + LcFastForwardL( EFalse ); + } + else + { + file->DisableL(); + } + + // Get timestamp for starttime + iFRWDStartTime.HomeTime(); + } + else + { + // Leave if we are not fastrewinding + if ( iFRWDStartTime.Int64() == 0 ) + { + User::Leave( KErrAlreadyExists ); + } + + // Set new position + file->SetPositionL( PositionMicroSecondsL( ETrue ) ); + + // Reset timer + iFRWDStartTime = TTime( 0 ); + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngClipVideoPlayer::FastRewind" ) + } + +// ----------------------------------------------------------------------------- +// From MLcSourceFileControl +// ----------------------------------------------------------------------------- +// +TTimeIntervalSeconds CMusEngClipVideoPlayer::LcFileDurationL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngClipVideoPlayer::DurationL" ) + + __ASSERT_ALWAYS( iMceSession, User::Leave( KErrNotReady ) ); + + CMceFileSource* file = MusEngMceUtils::GetFileSourceL( *iMceSession ); + + TTimeIntervalMicroSeconds duration = file->DurationL(); + + MUS_LOG( "mus: [ENGINE] <- CMusEngClipVideoPlayer::DurationL" ) + + return TTimeIntervalSeconds( static_cast< TInt >( + duration.Int64() / KMicroSecondsInOneSecond ) ); + } + +// ----------------------------------------------------------------------------- +// From MLcSourceFileControl +// ----------------------------------------------------------------------------- +// +TTimeIntervalSeconds CMusEngClipVideoPlayer::LcFilePositionL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngClipVideoPlayer::LcFilePositionL" ) + + TTimeIntervalMicroSeconds currentPosition = PositionMicroSecondsL(); + + MUS_LOG1( "mus: [ENGINE] <- CMusEngClipVideoPlayer::LcFilePositionL, %d", + currentPosition.Int64() ) + + return TTimeIntervalSeconds( static_cast< TInt >( + currentPosition.Int64() / KMicroSecondsInOneSecond ) ); + } + +// ----------------------------------------------------------------------------- +// From MLcSourceFileControl +// ----------------------------------------------------------------------------- +// +void CMusEngClipVideoPlayer::SetLcFilePositionL( + const TTimeIntervalSeconds& aPosition ) + { + MUS_LOG1( "mus: [ENGINE] -> CMusEngClipVideoPlayer::SetPositionL ( %d )", + aPosition.Int() ) + + __ASSERT_ALWAYS( iMceSession, User::Leave( KErrNotReady ) ); + + CMceFileSource* file = MusEngMceUtils::GetFileSourceL( *iMceSession ); + + TTimeIntervalMicroSeconds position( + KMicroSecondsInOneSecond * static_cast< TInt64 >( aPosition.Int() ) ); + + if ( position == 0 ) + { + iRewindedToBeginning = ETrue; + } + + file->SetPositionL( position ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngClipVideoPlayer::SetPositionL ()" ) + } + +// ----------------------------------------------------------------------------- +// Check is file DRM protected. +// ----------------------------------------------------------------------------- +// +TBool CMusEngClipVideoPlayer::IsProtectedFileL( const TDesC& aClipFile ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngClipVideoPlayer::IsProtectedFileL(...)" ) + + TBool isDRMProtected = EFalse; + DRMCommon* drmapi = DRMCommon::NewL(); + CleanupStack::PushL( drmapi ); + + User::LeaveIfError( drmapi->Connect() ); + //Check DRM file protection + User::LeaveIfError( drmapi->IsProtectedFile( aClipFile, isDRMProtected ) ); + drmapi->Disconnect(); + + CleanupStack::PopAndDestroy( drmapi ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngClipVideoPlayer::IsProtectedFileL(...)" ) + return isDRMProtected; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TTimeIntervalMicroSeconds CMusEngClipVideoPlayer::PositionMicroSecondsL( + TBool aActualPosition ) + { + __ASSERT_ALWAYS( iMceSession, User::Leave( KErrNotReady ) ); + + CMceFileSource* file = MusEngMceUtils::GetFileSourceL( *iMceSession ); + + TTimeIntervalMicroSeconds position = file->PositionL(); + TTimeIntervalMicroSeconds duration = file->DurationL(); + + TTimeIntervalMicroSeconds calculatedPosition; + + // Adjust position if we are fastforwarding or -rewinding + if ( iFFWDStartTime.Int64() != 0 ) + { + TTime now; + now.HomeTime(); + calculatedPosition = KFastWindingFactor * + now.MicroSecondsFrom( iFFWDStartTime ).Int64() + + position.Int64(); + if ( calculatedPosition > duration ) + { + calculatedPosition = duration; + } + } + else if ( iFRWDStartTime.Int64() != 0 ) + { + TTime now; + now.HomeTime(); + calculatedPosition = position.Int64() - + KFastWindingFactor * + now.MicroSecondsFrom( iFRWDStartTime ).Int64(); + if ( calculatedPosition < 0 ) + { + calculatedPosition = 0; + } + + if ( calculatedPosition == 0 ) + { + iRewindedToBeginning = ETrue; + } + } + else + { + calculatedPosition = position; + } + + if ( !aActualPosition ) + { + calculatedPosition = + GetVideoSinkRelativeFilePos( calculatedPosition, duration ); + } + + return calculatedPosition; + } + +// ----------------------------------------------------------------------------- +// Modifies file position if position has reached end before clip has ended. +// File position is not going in sync with local video playback as playback +// buffers media before starting playing. +// ----------------------------------------------------------------------------- +// +TTimeIntervalMicroSeconds CMusEngClipVideoPlayer::GetVideoSinkRelativeFilePos( + const TTimeIntervalMicroSeconds& aActualPosition, + const TTimeIntervalMicroSeconds& aDuration ) + { + MUS_LOG1( "mus: [ENGINE] PositionMicroSecondsL, pos before mod:%d", + aActualPosition.Int64() ) + + TTimeIntervalMicroSeconds tempCalculatedPosition( aActualPosition ); + + if ( iDelayFileEndingPos != 0 ) + { + iDelayFileEndingPos = aDuration; + tempCalculatedPosition = iDelayFileEndingPos; + } + else + { + // FRWD can go to zero even if clip has not ended, do not modify + // time in such situation. + if ( aActualPosition == 0 && + !HasClipEnded() && + iFRWDStartTime.Int64() == 0 && + !iRewindedToBeginning ) + { + const TInt KMusDelayEndingModifier = 2; + iDelayFileEndingPos = aDuration.Int64() - + iBufferingPeriod.Int64() / KMusDelayEndingModifier; + tempCalculatedPosition = iDelayFileEndingPos; + if ( iPreviousPos > tempCalculatedPosition ) + { + tempCalculatedPosition = iPreviousPos; + } + } + else + { + iDelayFileEndingPos = 0; + } + + if ( iRewindedToBeginning && aActualPosition > 0 ) + { + iRewindedToBeginning = EFalse; + } + + if ( tempCalculatedPosition < 0 ) + { + tempCalculatedPosition = 0; + } + } + + iPreviousPos = tempCalculatedPosition; + + return tempCalculatedPosition; + } + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ipvtengine/src/musenginepluginentry.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ipvtengine/src/musenginepluginentry.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,42 @@ +/* +* 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 "musengsessionmanager.h" +#include +#include + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +const TImplementationProxy KMusEnginePluginImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( 0x20029876, CMusEngSessionManager::NewL ) + }; + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount ) + { + aTableCount = sizeof( KMusEnginePluginImplementationTable ) / + sizeof( TImplementationProxy ); + + return KMusEnginePluginImplementationTable; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ipvtengine/src/musenglivevideoplayer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ipvtengine/src/musenglivevideoplayer.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,169 @@ +/* +* 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: +* +*/ + +// USER +#include "musenglivevideoplayer.h" +#include "musengcamerahandler.h" +#include "musengdisplayhandler.h" +#include "musenglogger.h" + +// SYSTEM +#include + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngLiveVideoPlayer* CMusEngLiveVideoPlayer::NewL( + MMusEngDisplayHandler& aDisplayHandler, + TMusEngCameraHandler& aCameraHandler, + MLcAudioControl& aLcAudioControl ) + { + return new( ELeave )CMusEngLiveVideoPlayer( + aDisplayHandler, aCameraHandler, aLcAudioControl ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngLiveVideoPlayer::CMusEngLiveVideoPlayer( + MMusEngDisplayHandler& aDisplayHandler, + TMusEngCameraHandler& aCameraHandler, + MLcAudioControl& aLcAudioControl ) : + CMusEngLocalVideoPlayer( aDisplayHandler, aLcAudioControl ), + iCameraHandler( aCameraHandler ) + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngLiveVideoPlayer::~CMusEngLiveVideoPlayer() + { + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +TBool CMusEngLiveVideoPlayer::LcIsPlayingL() + { + return iCameraHandler.IsPlayingL(); + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +void CMusEngLiveVideoPlayer::LcPlayL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngLiveVideoPlayer::LcPlayL" ) + iCameraHandler.PlayL(); + MUS_LOG( "mus: [ENGINE] <- CMusEngLiveVideoPlayer::LcPlayL" ) + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +void CMusEngLiveVideoPlayer::LcPauseL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngLiveVideoPlayer::LcPauseL" ) + iCameraHandler.PauseL(); + MUS_LOG( "mus: [ENGINE] <> CMusEngLiveVideoPlayer::LcPauseL" ) + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcCameraControl* CMusEngLiveVideoPlayer::LcCameraControl() + { + return &iCameraHandler; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcDestinationFileControl* CMusEngLiveVideoPlayer::LcDestinationFileControl() + { + return this; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcZoomControl* CMusEngLiveVideoPlayer::LcZoomControl() + { + return &iCameraHandler; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcBrightnessControl* CMusEngLiveVideoPlayer::LcBrightnessControl() + { + return &iCameraHandler; + } + +// ----------------------------------------------------------------------------- +// From MLcFileControl +// ----------------------------------------------------------------------------- +// +void CMusEngLiveVideoPlayer::SetLcFileNameL( const TFileName& aFileName ) + { + iFileName = aFileName; + } + +// ----------------------------------------------------------------------------- +// From MLcFileControl +// ----------------------------------------------------------------------------- +// +TFileName& CMusEngLiveVideoPlayer::LcFileName() + { + return iFileName; + } + +// ----------------------------------------------------------------------------- +// From MLcDestinationFileControl +// ----------------------------------------------------------------------------- +// +void CMusEngLiveVideoPlayer::LcRecordL( TBool aRecord ) + { + MUS_LOG1( "mus: [ENGINE] -> CMusEngLiveVideoPlayer::LcRecordL(( %d )", + aRecord ) + + MUS_LOG( "mus: [ENGINE] <- CMusEngLiveVideoPlayer::LcRecordL" ) + } + +// ----------------------------------------------------------------------------- +// From MLcDestinationFileControl +// ----------------------------------------------------------------------------- +// +TBool CMusEngLiveVideoPlayer::LcIsRecording() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngLiveVideoPlayer::LcIsRecording()" ) + + TBool isEnabled( EFalse ); + + return isEnabled; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ipvtengine/src/musenglocalvideoplayer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ipvtengine/src/musenglocalvideoplayer.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,70 @@ +/* +* 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: +* +*/ + +// USER +#include "musenglocalvideoplayer.h" +#include "musengdisplayhandler.h" + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngLocalVideoPlayer::CMusEngLocalVideoPlayer( + MMusEngDisplayHandler& aDisplayHandler, + MLcAudioControl& aLcAudioControl ) : + CMusEngVideoPlayerBase( aDisplayHandler, aLcAudioControl ) + { + iState = EInit; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngLocalVideoPlayer::~CMusEngLocalVideoPlayer() + { + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcVideoPlayer::TLcVideoPlayerState +CMusEngLocalVideoPlayer::LcVideoPlayerState() const + { + return iState; + } + + +// ----------------------------------------------------------------------------- +// From MLcWindow +// ----------------------------------------------------------------------------- +// +void CMusEngLocalVideoPlayer::SetLcWindowRectL( TRect aRect ) + { + iDisplayHandler.SetSecondaryRectL( aRect ); + } + +// ----------------------------------------------------------------------------- +// From MLcWindow +// ----------------------------------------------------------------------------- +// +TRect CMusEngLocalVideoPlayer::LcWindowRect() + { + return iDisplayHandler.SecondaryRect(); + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ipvtengine/src/musengmcesession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ipvtengine/src/musengmcesession.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,778 @@ +/* +* Copyright (c) 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: +* +*/ + + +// USER +#include "musengmcesession.h" +#include "lcsessionobserver.h" +#include "musenglogger.h" +#include "lcuiprovider.h" +#include "lcvideoplayer.h" +#include "musengremotevideoplayer.h" +#include "musenglivevideoplayer.h" +#include "mccscreen.h" + +// SYSTEM +#include +#include + +#include +#include +#include +#include + +#include "svptimer.h" + +RDrawableWindow* testWindow = 0; + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngMceSession::CMusEngMceSession() + { + iBackground = IsBackgroundStartup(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::ConstructL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::ConstructL()" ) + + iRemoteVideoPlayer = CMusEngRemoteVideoPlayer::NewL( *this, *this ); + iLiveVideoPlayer = CMusEngLiveVideoPlayer::NewL( *this, iCameraHandler, *this ); + iLcSessionState = MLcSession::EUninitialized; + + iTimer = CSVPTimer::NewL( *this, 1 ); + iCameraHandler.SetSession( this ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::ConstructL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngMceSession::~CMusEngMceSession() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::~CMusEngMceSession()" ) + + delete iRemoteAddress; + delete iRemoteVideoPlayer; + delete iLiveVideoPlayer; + delete iScreen; + MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::~CMusEngMceSession()" ) + } + +// ----------------------------------------------------------------------------- +// From MMusEngDisplayHandler +// ----------------------------------------------------------------------------- +// +TRect CMusEngMceSession::Rect() const + { + MUS_LOG( "mus: [ENGINE] CMusEngMceSession::Rect()" ) + return iRect; + } + +// ----------------------------------------------------------------------------- +// From MMusEngDisplayHandler +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::SetRectL( const TRect& aRect ) + { + MUS_LOG( "mus: [ENGINE] CMusEngSession::SetRectL()" ) + if ( !iScreen ){ + iScreen = CMccScreen::NewL(0,TPoint(0,0), TSize(640,640), 0, 1, 0, EFalse, testWindow); + } + iRect = aRect; + if ( iScreen ) + { + iScreen->SetPrimaryRectL(iRect); + } + } + +// ----------------------------------------------------------------------------- +// From MMusEngDisplayHandler +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::SetSecondaryRectL( const TRect& aSecondaryRect ) + { + MUS_LOG( "mus: [ENGINE] CMusEngMceSession::SetSecondaryRectL()" ) + if ( !iScreen ){ + iScreen = CMccScreen::NewL(0,TPoint(0,0), TSize(640,640), 0, 1, 0, EFalse, testWindow); + } + // Same rect is set by primary and secondary setters + iSetLocalRect = aSecondaryRect; + if ( iScreen ) + { + iScreen->SetSecondaryRectL(iSetLocalRect); + } + } + +// ----------------------------------------------------------------------------- +// From MMusEngDisplayHandler +// ----------------------------------------------------------------------------- +// +TRect CMusEngMceSession::SecondaryRect() const + { + MUS_LOG( "mus: [ENGINE] CMusEngMceSession::SecondaryRect()" ) + return iSetLocalRect; + } + +#if 0 + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWaySession::SetSecondaryRectL( const TRect& aSecondaryRect ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWaySession::SetSecondaryRectL()" ) + + iLocalRect = aSecondaryRect; + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWaySession::SetSecondaryRectL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TRect CMusEngTwoWaySession::SecondaryRect() const + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWaySession::SecondaryRect()" ) + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWaySession::SecondaryRect()" ) + return iLocalRect; + } + +#endif + +// ----------------------------------------------------------------------------- +// From MMusEngDisplayHandler +// ----------------------------------------------------------------------------- +// +MMusEngDisplayHandler::TDisplayOrientation CMusEngMceSession::OrientationL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::RotationL()" ) + return MMusEngDisplayHandler::EPortrait; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::SetOrientationL( TDisplayOrientation aOrientation ) + { + MUS_LOG1( "mus: [ENGINE] -> CMusEngMceSession::SetOrientationL() %d", + aOrientation ) + + MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::SetOrientationL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::EnableDisplayL( TBool aEnable ) + { + MUS_LOG1( "mus: [ENGINE] -> CMusEngMceSession::EnableDisplay() %d", + aEnable ) + + MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::EnableDisplay()") + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMusEngMceSession::IsDisplayEnabled() + { + TBool enabled( EFalse ); + return enabled; + } + +// ----------------------------------------------------------------------------- +// From MMusEngDisplayHandler +// ----------------------------------------------------------------------------- +// +TBool CMusEngMceSession::IsDisplayActive() + { + return ( IsDisplayEnabled() ); + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +MLcSession::TLcSessionState CMusEngMceSession::LcSessionState() const + { + MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::LcSessionState()" ) + + TLcSessionState lcSessionState = MLcSession::EUninitialized; + +/* + if ( iSession ) + { + switch( iSession->State() ) + { + case CMceSession::EIdle: + { + lcSessionState = MLcSession::EInitialized; + break; + } + case CMceSession::EIncoming: + case CMceSession::EProceeding: + case CMceSession::EReserving: + { + lcSessionState = MLcSession::EReceived; + break; + } + + case CMceSession::EOffering: + case CMceSession::EAnswering: + { + lcSessionState = MLcSession::EOpening; + break; + } + case CMceSession::EEstablished: + { + lcSessionState = MLcSession::EOpen; + break; + } + case CMceSession::ECancelling: + case CMceSession::ETerminating: + { + lcSessionState = MLcSession::EClosing; + break; + } + case CMceSession::ETerminated: + { + lcSessionState = MLcSession::EClosed; + break; + } + default: + { + lcSessionState = MLcSession::EUninitialized; + break; + } + } + } +*/ + + return iLcSessionState; + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::SetLcSessionObserver( MLcSessionObserver* aObserver ) + { + iLcSessionObserver = aObserver; + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::SetLcUiProvider( MLcUiProvider* aUiProvider ) + { + iLcUiProvider = aUiProvider; + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +MLcVideoPlayer* CMusEngMceSession::RemoteVideoPlayer() + { + return iRemoteVideoPlayer; + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +MLcVideoPlayer* CMusEngMceSession::LocalVideoPlayer() + { + return iLiveVideoPlayer; + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +const TDesC& CMusEngMceSession::LocalDisplayName() + { + return KNullDesC; + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +const TDesC& CMusEngMceSession::RemoteDisplayName() + { + return *iRemoteAddress; + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +TInt CMusEngMceSession::SetParameter( TInt aId, TInt aValue ) + { + if ( aId == 0 ){ + testWindow = reinterpret_cast(aValue); + } + return KErrNotSupported; + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +TInt CMusEngMceSession::ParameterValue( TInt /*aId*/ ) + { + return KErrNotSupported; + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +TBool CMusEngMceSession::IsBackgroundStartup() + { + return ETrue; + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +TBool CMusEngMceSession::SendDialTone( TChar aKey ) + { + MUS_LOG1( "mus: [ENGINE] -> CMusEngMceSession::SendDialTone() key = %c",aKey ) + return ETrue; + } + + // ----------------------------------------------------------------------------- +// From MLcAudioControl +// ----------------------------------------------------------------------------- +// +TBool CMusEngMceSession::IsLcAudioMutedL() + { + return EFalse; + } + +// ----------------------------------------------------------------------------- +// From MLcAudioControl +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::MuteLcAudioL( TBool aMute ) + { + } + +// ----------------------------------------------------------------------------- +// From MLcAudioControl +// ----------------------------------------------------------------------------- +// +TBool CMusEngMceSession::IsLcMicMutedL() + { + return EFalse; + } + +// ----------------------------------------------------------------------------- +// From MLcAudioControl +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::MuteLcMicL( TBool aMute ) + { + } + +// ----------------------------------------------------------------------------- +// From MLcAudioControl +// ----------------------------------------------------------------------------- +// +TBool CMusEngMceSession::IsEnablingLcLoudspeakerAllowed() + { + return ETrue; + } + +// ----------------------------------------------------------------------------- +// From MLcAudioControl +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::EnableLcLoudspeakerL( TBool aEnabled ) + { + } + +// ----------------------------------------------------------------------------- +// From MLcAudioControl +// ----------------------------------------------------------------------------- +// +TBool CMusEngMceSession::IsLcLoudspeakerEnabled() + { + return ETrue; + } + +// ----------------------------------------------------------------------------- +// From MLcAudioControl +// ----------------------------------------------------------------------------- +// +TInt CMusEngMceSession::LcVolumeL() + { + return 5; + } + +// ----------------------------------------------------------------------------- +// From MLcAudioControl +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::SetLcVolumeL( TInt aValue ) + { + } + +// ----------------------------------------------------------------------------- +// From MLcAudioControl +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::IncreaseLcVolumeL() + { + } + +// ----------------------------------------------------------------------------- +// From MLcAudioControl +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::DecreaseLcVolumeL() + { + } + + +// ----------------------------------------------------------------------------- +// From MLcAudioControl +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::TimedOut( TInt aTimerId ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::TimedOut()" ) + +/* + iLcSessionState = MLcSession::EOpen; + + if ( iLcSessionObserver ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::TimedOut(), StateChanged" ) + iLcSessionObserver->StateChanged( *this ); + } +*/ + switch( aTimerId ) + { + case 1: + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::TimedOut(), StateChanged -> Established" ) + + InformUiProviderAboutReceivingStart(); + + iLcSessionState = MLcSession::EOpen; + iLcSessionObserver->StateChanged( *this ); + + // starting remote playing timer + iTimer->SetTime(10000, 3); + + break; + } + case 2: + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::TimedOut(), StateChanged -> RemotePlaying" ) + iRemoteVideoPlayer->iState = MLcVideoPlayer::EPlaying; + iLcSessionObserver->StateChanged( *iRemoteVideoPlayer ); + break; + } + case 3: + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::TimedOut(), StateChanged -> LocalPlaying" ) + iLiveVideoPlayer->iState = MLcVideoPlayer::EPlaying; + iLcSessionObserver->StateChanged( *iLiveVideoPlayer ); + iTimer->SetTime(5000, 2); + break; + } + case 10: + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::TimedOut(), Camera Toggle, StateChanged -> LocalPaused" ) + iLiveVideoPlayer->iState = MLcVideoPlayer::EPaused; + iLcSessionObserver->StateChanged( *iLiveVideoPlayer ); + iTimer->SetTime(10000, 11); + break; + } + case 11: + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::TimedOut(), Camera Toggle, StateChanged -> LocalPlaying" ) + iLiveVideoPlayer->iState = MLcVideoPlayer::EPlaying; + iLcSessionObserver->StateChanged( *iLiveVideoPlayer ); + break; + } + case 12: + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::TimedOut(), Camera Play, StateChanged -> LocalPlaying" ) + iLiveVideoPlayer->iState = MLcVideoPlayer::EPlaying; + iLcSessionObserver->StateChanged( *iLiveVideoPlayer ); + break; + } + case 13: + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::TimedOut(), Camera Pause, StateChanged -> LocalIdle" ) + iLiveVideoPlayer->iState = MLcVideoPlayer::EPaused; + iLcSessionObserver->StateChanged( *iLiveVideoPlayer ); + break; + } + + + case 14: + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::TimedOut(), StateChanged -> EReceived" ) + InformUiProviderAboutReceivingStart(); + iLcSessionState = MLcSession::EReceived; + iLcSessionObserver->StateChanged( *this ); + break; + } + + default: + { + iLcSessionState = MLcSession::EUninitialized; + break; + } + } +/* + switch( aTimerId ) + { + case CMceSession::EIdle: + { + lcSessionState = MLcSession::EInitialized; + break; + } + case CMceSession::EIncoming: + case CMceSession::EProceeding: + case CMceSession::EReserving: + { + lcSessionState = MLcSession::EReceived; + break; + } + + case CMceSession::EOffering: + case CMceSession::EAnswering: + { + lcSessionState = MLcSession::EOpening; + break; + } + case CMceSession::EEstablished: + { + lcSessionState = MLcSession::EOpen; + break; + } + case CMceSession::ECancelling: + case CMceSession::ETerminating: + { + lcSessionState = MLcSession::EClosing; + break; + } + case CMceSession::ETerminated: + { + lcSessionState = MLcSession::EClosed; + break; + } + default: + { + lcSessionState = MLcSession::EUninitialized; + break; + } + } +*/ + MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::TimedOut()" ) + } + + + +TInt CMusEngMceSession::SetForegroundStatus( TBool aIsForeground ) + { + MUS_LOG1( "mus: [ENGINE] -> CMusEngMceSession::SetForegroundStatus() %d", + aIsForeground ) + if ( iScreen ){ + iScreen->Update(aIsForeground); + } + return KErrNone; + } + +_LIT( KIpVtEngStubRemoteDetails, "5556567844" ); + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +const TDesC& CMusEngMceSession::RemoteDetails() + { + return KIpVtEngStubRemoteDetails(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::SetRemoteL( const TDesC& aRemote ) +{ + iRemoteAddress = aRemote.AllocL(); +} + +#if 0 + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::InformObserverAboutSessionStateChange() + { + if ( iLcSessionObserver ) + { + iLcSessionObserver->StateChanged( *this ); + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::InformObserverAboutSessionUpdate() + { + if ( iLcSessionObserver ) + { + iLcSessionObserver->Updated( *this ); + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::InformObserverAboutSessionFailure( TInt aReason ) + { + if ( iLcSessionObserver ) + { + iLcSessionObserver->Failed( *this, aReason ); + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::InformObserverAboutPlayerStateChange( + MLcVideoPlayer* aPlayer ) + { + if ( iLcSessionObserver && aPlayer ) + { + iLcSessionObserver->StateChanged( *aPlayer ); + } + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::InformObserverAboutPlayerUpdate( + MLcVideoPlayer* aPlayer ) + { + if ( iLcSessionObserver && aPlayer ) + { + iLcSessionObserver->Updated( *aPlayer ); + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::InformObserverAboutPlayerFailure( + MLcVideoPlayer* aPlayer, + TInt aReason ) + { + if ( iLcSessionObserver && aPlayer ) + { + iLcSessionObserver->Failed( *aPlayer, aReason ); + } + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +MLcUiProvider& CMusEngMceSession::LcUiProviderL() + { + __ASSERT_ALWAYS( iLcUiProvider, User::Leave( KErrNotReady ) ); + return *iLcUiProvider; + } +#endif + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::InformUiProviderAboutReceivingStart() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::InformUiProviderAboutReceivingStart()" ) + if ( iBackground && iLcUiProvider ) + { + MUS_LOG( "mus: [ENGINE] receiving started in BG mode, switching to FG" ) + iBackground = EFalse; + iLcUiProvider->HandleForegroundStatus( ETrue ); + } + MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::InformUiProviderAboutReceivingStart()" ) + } + +void CMusEngMceSession::ToggleCameraL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::ToggleCameraL()" ) + if( iLiveVideoPlayer->iState == MLcVideoPlayer::EPlaying ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::ToggleCameraL(), start timer" ) + iTimer->SetTime(5000, 10); + } + MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::ToggleCameraL()" ) + } + +void CMusEngMceSession::PlayCameraL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::PlayCameraL()" ) + iTimer->SetTime(5000, 12); + MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::PlayCameraL()" ) + } + +void CMusEngMceSession::PauseCameraL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::PauseCameraL()" ) + iTimer->SetTime(5000, 13); + MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::PauseCameraL()" ) + } + + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ipvtengine/src/musengmceutils.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ipvtengine/src/musengmceutils.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,594 @@ +/* +* 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: Utilities to get and set profile used with SWIS. +* +*/ + + + +// USER + +#include "musengmceutils.h" +#include "muslogger.h" + +// SYSTEM + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + + + +// ----------------------------------------------------------------------------- +// Tells if parameter stream is a video stream with RTP source +// ----------------------------------------------------------------------------- +// +TBool MusEngMceUtils::IsVideoInStream( CMceMediaStream& aStream ) + { + return ( aStream.Type() == KMceVideo && + aStream.Source() && + aStream.Source()->Type() == KMceRTPSource ); + } + +// ----------------------------------------------------------------------------- +// Tells if parameter stream is a video stream with RTP sink +// ----------------------------------------------------------------------------- +// +TBool MusEngMceUtils::IsVideoOutStream( CMceMediaStream& aStream ) + { + TBool isOutStream( EFalse ); + if ( aStream.Type() == KMceVideo ) + { + CMceMediaSink* rtpSink = MusEngMceUtils::GetMediaSink( + aStream, + KMceRTPSink ); + + isOutStream = ( rtpSink != NULL ); + } + return isOutStream; + } + +// ----------------------------------------------------------------------------- +// Tells if parameter stream is an audio stream with RTP source +// ----------------------------------------------------------------------------- +// +TBool MusEngMceUtils::IsAudioInStream( CMceMediaStream& aStream ) + { + return ( aStream.Type() == KMceAudio && + aStream.Source() && + aStream.Source()->Type() == KMceRTPSource ); + } + + +// ----------------------------------------------------------------------------- +// Gets handle to video stream with RTP sink. +// ----------------------------------------------------------------------------- +// +CMceVideoStream* MusEngMceUtils::GetVideoOutStreamL( CMceSession& aSession ) + { + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::GetVideoOutStreamL()" ) + + const RPointerArray& streams = aSession.Streams(); + + CMceVideoStream* videoOut = NULL; + + for ( TInt i = 0; i < streams.Count(); ++i ) + { + if ( MusEngMceUtils::IsVideoOutStream( *streams[i] ) ) + { + __ASSERT_ALWAYS( !videoOut, User::Leave( KErrOverflow ) ); + + videoOut = static_cast( streams[i] ); + } + + // Check if bound stream is a video stream with RTP sink. + if ( streams[i]->BoundStream() && + MusEngMceUtils::IsVideoOutStream( streams[i]->BoundStreamL() ) ) + { + __ASSERT_ALWAYS( !videoOut, User::Leave( KErrOverflow ) ); + + videoOut = static_cast( + &streams[i]->BoundStreamL() ); + } + } + + __ASSERT_ALWAYS( videoOut, User::Leave( KErrNotFound ) ); + + MUS_LOG( "mus: [ENGINE] <- MusEngMceUtils::GetVideoOutStreamL()" ) + + return videoOut; + } + + +// ----------------------------------------------------------------------------- +// Gets handle to video stream with RTP source. +// ----------------------------------------------------------------------------- +// +CMceVideoStream* MusEngMceUtils::GetVideoInStreamL( CMceSession& aSession ) + { + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::GetVideoInStreamL()" ) + + const RPointerArray& streams = aSession.Streams(); + + CMceVideoStream* videoIn = NULL; + + for ( TInt i = 0; i < streams.Count(); ++i ) + { + if ( MusEngMceUtils::IsVideoInStream( *streams[i] ) ) + + { + __ASSERT_ALWAYS( !videoIn, User::Leave( KErrOverflow ) ); + + videoIn = static_cast( streams[i] ); + } + + // Check if bound stream is a video stream with RTP souce. + if ( streams[i]->BoundStream() && + MusEngMceUtils::IsVideoInStream( streams[i]->BoundStreamL() ) ) + { + __ASSERT_ALWAYS( !videoIn, User::Leave( KErrOverflow ) ); + + videoIn = static_cast( + &streams[i]->BoundStreamL() ); + } + } + + __ASSERT_ALWAYS( videoIn, User::Leave( KErrNotFound ) ); + + MUS_LOG( "mus: [ENGINE] <- MusEngMceUtils::GetVideoInStreamL()" ) + + return videoIn; + } + + +// ----------------------------------------------------------------------------- +// Gets handle to video stream with file sink +// ----------------------------------------------------------------------------- +// +CMceVideoStream* MusEngMceUtils::GetRecordingStream( CMceSession& aSession ) + { + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::GetRecordingStreamL()" ) + + const RPointerArray& streams = aSession.Streams(); + + CMceVideoStream* recordingStream = NULL; + + for ( TInt i = 0; i < streams.Count(); ++i ) + { + if ( streams[i]->Type() == KMceVideo ) + { + if ( MusEngMceUtils::GetMediaSink( *streams[i], KMceFileSink ) ) + { + recordingStream = static_cast( streams[i] ); + } + } + } + + MUS_LOG( "mus: [ENGINE] <- MusEngMceUtils::GetRecordingStreamL()" ) + + return recordingStream; + } + + +// ----------------------------------------------------------------------------- +// Gets handle to a media sink of spesified type contained by a mediastream. +// ----------------------------------------------------------------------------- +// +CMceMediaSink* MusEngMceUtils::GetMediaSink( CMceMediaStream& aStream, + TMceSinkType aType, + TMceSourceType aAssociatedSourceType ) + { + const RPointerArray& sinks = aStream.Sinks(); + for ( TInt i = 0; i < sinks.Count(); ++i ) + { + if ( sinks[i]->Type() == aType && + ( aAssociatedSourceType == KMusEngNoAssociatedSourceType || + aStream.Source()->Type() == aAssociatedSourceType ) ) + { + return sinks[i]; + } + } + + return NULL; + } + + +// ----------------------------------------------------------------------------- +// Gets handle to a media sink of spesified type contained by a mediastream. +// ----------------------------------------------------------------------------- +// +CMceMediaSink* MusEngMceUtils::GetMediaSinkL( CMceMediaStream& aStream, + TMceSinkType aType, + TMceSourceType aAssociatedSourceType ) + { + + CMceMediaSink* sink = MusEngMceUtils::GetMediaSink( aStream, aType, aAssociatedSourceType ); + + __ASSERT_ALWAYS( sink, User::Leave( KErrNotFound ) ); + + return sink; + } + + +// ----------------------------------------------------------------------------- +// Gets handle to a media sink of spesified type contained by a session. +// ----------------------------------------------------------------------------- +// +CMceMediaSink* MusEngMceUtils::GetMediaSink( CMceSession& aSession, + TMceSinkType aType, + TMceSourceType aAssociatedSourceType, + TBool aStrictMatch ) + { + CMceMediaSink* sink = NULL; + + TRAP_IGNORE( sink = MusEngMceUtils::GetMediaSinkL( + aSession, aType, aAssociatedSourceType, aStrictMatch ) ) + + return sink; + } + + +// ----------------------------------------------------------------------------- +// Gets handle to a media sink of spesified type contained by a session. +// ----------------------------------------------------------------------------- +// +CMceMediaSink* MusEngMceUtils::GetMediaSinkL( CMceSession& aSession, + TMceSinkType aType, + TMceSourceType aAssociatedSourceType, + TBool aStrictMatch ) + { + CMceMediaSink* sink = NULL; + + const RPointerArray& streams = aSession.Streams(); + + for ( TInt i = 0; i < streams.Count(); ++i ) + { + sink = MusEngMceUtils::GetMediaSink( *streams[i], aType, aAssociatedSourceType ); + if ( sink ) + { + return sink; + } + + if ( streams[i]->BoundStream() ) + { + sink = MusEngMceUtils::GetMediaSink( streams[i]->BoundStreamL(), + aType, + aAssociatedSourceType ); + if ( sink ) + { + return sink; + } + } + } + + if ( !sink && aAssociatedSourceType != KMusEngNoAssociatedSourceType && !aStrictMatch ) + { + // No preferred match, try without source preference + sink = GetMediaSinkL( aSession, aType ); + } + + __ASSERT_ALWAYS( sink, User::Leave( KErrNotFound ) ); + + return sink; + } + + +// ----------------------------------------------------------------------------- +// Gets handle to a speaker sink contained by specified stream or bound stream. +// ----------------------------------------------------------------------------- +// +CMceSpeakerSink* MusEngMceUtils::GetSpeaker( CMceMediaStream& aStream ) + { + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::GetSpeaker()" ) + + CMceSpeakerSink* speaker = NULL; + + if ( aStream.Type() == KMceAudio ) + { + speaker = static_cast( + MusEngMceUtils::GetMediaSink( aStream, KMceSpeakerSink ) ); + + if ( !speaker && aStream.BoundStream() ) + { + CMceMediaStream* boundStream = NULL; + TRAPD( error, boundStream = &aStream.BoundStreamL() ) + + if ( error == KErrNone ) + { + speaker = static_cast( + MusEngMceUtils::GetMediaSink( *boundStream, + KMceSpeakerSink ) ); + } + } + } + + MUS_LOG( "mus: [ENGINE] <- MusEngMceUtils::GetSpeaker()" ) + + return speaker; + } + + +// ----------------------------------------------------------------------------- +// Gets handle to a camera source. +// ----------------------------------------------------------------------------- +// +CMceCameraSource* MusEngMceUtils::GetCameraL( CMceSession& aSession ) + { + // Camera can be only in out stream + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::GetCameraL()" ) + + CMceVideoStream* videoOut = MusEngMceUtils::GetVideoOutStreamL( aSession ); + + if ( !( videoOut->Source() && + videoOut->Source()->Type() == KMceCameraSource ) ) + { + User::Leave( KErrNotFound ); + } + + MUS_LOG( "mus: [ENGINE] <- MusEngMceUtils::GetCameraL()" ) + return static_cast( videoOut->Source() ); + } + + +// ----------------------------------------------------------------------------- +// Gets handle to a file source. +// ----------------------------------------------------------------------------- +// +CMceFileSource* MusEngMceUtils::GetFileSourceL( CMceSession& aSession ) + { + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::GetFileSourceL()" ) + + CMceVideoStream* videoOut = MusEngMceUtils::GetVideoOutStreamL( aSession ); + + if ( !( videoOut->Source() && + videoOut->Source()->Type() == KMceFileSource ) ) + { + User::Leave( KErrNotFound ); + } + + MUS_LOG( "mus: [ENGINE] <- MusEngMceUtils::GetFileSourceL()" ) + return static_cast( videoOut->Source() ); + } + + +// ----------------------------------------------------------------------------- +// Gets handle to a display sink. +// ----------------------------------------------------------------------------- +// +CMceDisplaySink* MusEngMceUtils::GetDisplay( + CMceSession& aSession, TBool aPreferViewFinder ) + { + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::GetDisplay()" ) + MUS_LOG( "mus: [ENGINE] <- MusEngMceUtils::GetDisplay()" ) + TMceSourceType preferredSource = + aPreferViewFinder ? KMceCameraSource : KMusEngNoAssociatedSourceType; + return static_cast( + MusEngMceUtils::GetMediaSink( aSession, KMceDisplaySink, preferredSource ) ); + + } + + +// ----------------------------------------------------------------------------- +// Gets handle to a display sink. +// ----------------------------------------------------------------------------- +// +CMceDisplaySink* MusEngMceUtils::GetDisplayL( + CMceSession& aSession, TBool aPreferViewFinder ) + { + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::GetDisplayL()" ) + + CMceDisplaySink* display = MusEngMceUtils::GetDisplay( aSession, aPreferViewFinder ); + + __ASSERT_ALWAYS( display, User::Leave( KErrNotFound ) ); + + MUS_LOG( "mus: [ENGINE] <- MusEngMceUtils::GetDisplayL()" ) + return display; + } + +// ----------------------------------------------------------------------------- +// Gets handle to a display sink displaying received video. +// ----------------------------------------------------------------------------- +// +CMceDisplaySink* MusEngMceUtils::GetReceivingDisplay( CMceSession& aSession ) + { + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::GetReceivingDisplay()" ) + MUS_LOG( "mus: [ENGINE] <- MusEngMceUtils::GetReceivingDisplay()" ) + + // Search display which is connected with rtp source + TMceSourceType preferredSource = KMceRTPSource; + return static_cast( MusEngMceUtils::GetMediaSink( + aSession, KMceDisplaySink, preferredSource, ETrue ) ); + } + +// ----------------------------------------------------------------------------- +// Gets handle to a display sink displaying received video. +// ----------------------------------------------------------------------------- +// +CMceDisplaySink* MusEngMceUtils::GetReceivingDisplayL( CMceSession& aSession ) + { + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::GetReceivingDisplayL()" ) + + CMceDisplaySink* display = GetReceivingDisplay( aSession ); + __ASSERT_ALWAYS( display != NULL, User::Leave( KErrNotFound ) ); + + MUS_LOG( "mus: [ENGINE] <- MusEngMceUtils::GetReceivingDisplay()" ) + + return display; + } + +// ----------------------------------------------------------------------------- +// Gets handle to a display sink displaying viewfinder content. +// ----------------------------------------------------------------------------- +// +CMceDisplaySink* MusEngMceUtils::GetVfDisplay( CMceSession& aSession ) + { + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::GetVfDisplay()" ) + MUS_LOG( "mus: [ENGINE] <- MusEngMceUtils::GetVfDisplay()" ) + + // Search display which is connected with camera + TMceSourceType preferredSource = KMceCameraSource; + return static_cast( MusEngMceUtils::GetMediaSink( + aSession, KMceDisplaySink, preferredSource, ETrue ) ); + } + +// ----------------------------------------------------------------------------- +// Adds display sink to specified stream if one does not exist already. +// Display rect is set in both cases. +// ----------------------------------------------------------------------------- +// +void MusEngMceUtils::AddDisplayL( CMceMediaStream& aStream, + CMceManager& aManager, + const TRect& aDisplayRect ) + { + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::AddDisplayL()" ) + + __ASSERT_ALWAYS( aStream.Type() == KMceVideo, User::Leave( KErrArgument ) ); + + CMceDisplaySink* display = static_cast( + MusEngMceUtils::GetMediaSink( + aStream, + KMceDisplaySink ) ); + + if ( !display ) + { + display = CMceDisplaySink::NewLC( aManager ); + aStream.AddSinkL( display ); + CleanupStack::Pop( display ); + } + + display->SetDisplayRectL( aDisplayRect ); + + MUS_LOG( "mus: [ENGINE] <- MusEngMceUtils::AddDisplayL()" ) + } + + +// ----------------------------------------------------------------------------- +// Adds display sink to specified stream if one does not exist already. +// ----------------------------------------------------------------------------- +// +void MusEngMceUtils::AddSpeakerL( CMceMediaStream& aStream ) + { + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::AddSpeakerL()" ) + + __ASSERT_ALWAYS( aStream.Type() == KMceAudio, User::Leave( KErrArgument ) ); + + CMceSpeakerSink* speaker = static_cast( + MusEngMceUtils::GetMediaSink( + aStream, + KMceSpeakerSink ) ); + + if ( !speaker ) + { + speaker = CMceSpeakerSink::NewLC(); + aStream.AddSinkL( speaker ); + CleanupStack::Pop( speaker ); + } + + MUS_LOG( "mus: [ENGINE] <- MusEngMceUtils::AddSpeakerL()" ) + } + + +// ----------------------------------------------------------------------------- +// Disables parameter stream, its' source and all the sinks. +// ----------------------------------------------------------------------------- +// +void MusEngMceUtils::DisableStreamL( CMceMediaStream& aStream ) + { + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::DisableStreamL()" ) + + aStream.DisableL(); + + if ( aStream.Source() ) + { + aStream.Source()->DisableL(); + } + + for ( TInt sinkIndex = 0; sinkIndex < aStream.Sinks().Count(); ++sinkIndex ) + { + aStream.Sinks()[ sinkIndex ]->DisableL(); + } + + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::DisableStreamL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void MusEngMceUtils::DoEnableDisplayL( CMceDisplaySink& aDisplay, TBool aEnable ) + { + MUS_LOG1( "mus: [ENGINE] -> MusEngMceUtils::DoEnableDisplayL() %d", + aEnable ) + + if ( aEnable ) + { + if ( !aDisplay.IsEnabled() ) + { + aDisplay.EnableL(); + MUS_LOG( " Display enabled" ) + } + else + { + MUS_LOG( " Display already enabled, ignore" ) + } + } + else + { + if ( aDisplay.IsEnabled() ) + { + aDisplay.DisableL(); + MUS_LOG( " Display disabled" ) + } + else + { + MUS_LOG( " Display already disabled, ignore" ) + } + } + + MUS_LOG( "mus: [ENGINE] <- MusEngMceUtils::DoEnableDisplayL()") + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt MusEngMceUtils::EnableInactivityTimer( + CMceSession& aSession, + TUint32 aInactivityTimeout ) + { + TInt err( KErrNotFound ); + CMceVideoStream* stream = NULL; + TRAP_IGNORE( stream = MusEngMceUtils::GetVideoInStreamL( aSession ) ) + if ( stream ) + { + // Instream has always RTP source + err = KErrNone; + CMceRtpSource* rtpSource = static_cast( stream->Source() ); + TRAP( err, rtpSource->EnableInactivityTimerL( aInactivityTimeout ) ) + } + + return err; + } + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ipvtengine/src/musengremotevideoplayer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ipvtengine/src/musengremotevideoplayer.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,75 @@ +/* +* 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: +* +*/ + + +// USER +#include "musengremotevideoplayer.h" +#include "musengdisplayhandler.h" + +// SYSTEM +#include + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngRemoteVideoPlayer* CMusEngRemoteVideoPlayer::NewL( + MMusEngDisplayHandler& aDisplayHandler, + MLcAudioControl& aLcAudioControl ) + { + return new( ELeave )CMusEngRemoteVideoPlayer( + aDisplayHandler, aLcAudioControl ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngRemoteVideoPlayer::CMusEngRemoteVideoPlayer( + MMusEngDisplayHandler& aDisplayHandler, + MLcAudioControl& aLcAudioControl ) : + CMusEngVideoPlayerBase( aDisplayHandler, aLcAudioControl ) + { + iState = EInit; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngRemoteVideoPlayer::~CMusEngRemoteVideoPlayer() + { + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcVideoPlayer::TLcVideoPlayerState +CMusEngRemoteVideoPlayer::LcVideoPlayerState() const + { + return iState; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +TBool CMusEngRemoteVideoPlayer::LcIsPlayingL() + { + return ETrue; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ipvtengine/src/musengsessionmanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ipvtengine/src/musengsessionmanager.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,103 @@ +/* +* 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 "musengsessionmanager.h" +#include "musengmcesession.h" +#include "musengtwowaysession.h" +#include "lcsession.h" +#include "mccdatasender.h" +#include "mccdatareceiver.h" +#include "musenglogger.h" +#include "mccdatastructures.h" + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngSessionManager* CMusEngSessionManager::NewL() + { + CMusEngSessionManager* self = new( ELeave )CMusEngSessionManager(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngSessionManager::~CMusEngSessionManager() + { + delete iSession; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngSessionManager::CMusEngSessionManager() + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngSessionManager::ConstructL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngSessionManager::ConstructL()" ) + //iMsgReceiver = CMccDataReceiver::NewL(*this); + MUS_LOG( "mus: [ENGINE] MsgQueue1 setup complete" ) + //iMsgSender = CMccDataSender::NewL(); + MUS_LOG( "mus: [ENGINE] MsgQueue2 setup complete" ) + iSession = CMusEngTwoWaySession::NewL(); + iSession->SetRemoteL( _L("Homer Simpson") ); + MUS_LOG( "mus: [ENGINE] <- CMusEngSessionManager::ConstructL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +MLcSession& CMusEngSessionManager::Session() + { + return *iSession; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngSessionManager::DataReceived( const TDataMessage& aData ) + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMusEngSessionManager::IsFeatureSupported( TLcFeature aLcFeature ) + { + return ( aLcFeature == ELcSendVideoQuery ); + } + + + + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ipvtengine/src/musengtwowayrecvsession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ipvtengine/src/musengtwowayrecvsession.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,521 @@ +/* +* Copyright (c) 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: +* +*/ + + +// USER +#include "musengtwowayrecvsession.h" +#include "lcsessionobserver.h" +#include "musunittesting.h" +#include "musengmceutils.h" +#include "musenglogger.h" +#include "mussipprofilehandler.h" +#include "musenglivevideoplayer.h" +#include "musengremotevideoplayer.h" + +// SYSTEM +#include +#include +#include +#include +#include +#include +#include +#include +#include + +const TInt KMusEngJitterBufferLength = 51; //Must be bigger than treshold +// Using following value increases treshold buffer to 1 second from +// default 100 ms +const TInt KMusEngJitterBufferTreshold = 50; + +const TUint32 KMusEngTwoWayReceivingActivityTimeout = 5000; // 5 seconds +// 6 seconds keepalive timer, needs to be more than receiving timeout +const TUint8 KMusEngTwoWayRtpKeepAliveTimer = 6; + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngTwoWayRecvSession* CMusEngTwoWayRecvSession::NewL() + { + CMusEngTwoWayRecvSession* self = new( ELeave )CMusEngTwoWayRecvSession(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngTwoWayRecvSession::~CMusEngTwoWayRecvSession() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWayRecvSession::~CMusEngTwoWayRecvSession()" ) + + delete iLiveVideoPlayer; + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWayRecvSession::~CMusEngTwoWayRecvSession()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWayRecvSession::EnableDisplayL( TBool aEnable ) + { + MUS_LOG1( "mus: [ENGINE] -> CMusEngTwoWayRecvSession::EnableDisplayL() %d", + aEnable ) + + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + CMceDisplaySink* display = MusEngMceUtils::GetReceivingDisplayL( *iSession ); + MusEngMceUtils::DoEnableDisplayL( *display, aEnable ); + + CMceDisplaySink* vfDisplay = MusEngMceUtils::GetVfDisplay( *iSession ); + if ( vfDisplay ) + { + MusEngMceUtils::DoEnableDisplayL( *vfDisplay, aEnable ); + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWayRecvSession::EnableDisplayL()") + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngMceSession::TDisplayOrientation CMusEngTwoWayRecvSession::OrientationL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWayRecvSession::RotationL()" ) + + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + CMceDisplaySink* display = MusEngMceUtils::GetReceivingDisplayL( *iSession ); + + TDisplayOrientation displayOrientation; + CMceDisplaySink::TRotation rotation( display->RotationL() ); + + MUS_LOG1( "mus: [ENGINE] MCE rotation is %d", rotation ) + + if ( rotation == CMceDisplaySink::ENone ) + { + displayOrientation = CMusEngMceSession::EPortrait; + } + else + { + displayOrientation = CMusEngMceSession::ELandscape; + } + + MUS_LOG1( "mus: [ENGINE] <- CMusEngTwoWayRecvSession::RotationL() %d", + displayOrientation ) + + return displayOrientation; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWayRecvSession::SetOrientationL( TDisplayOrientation aOrientation ) + { + MUS_LOG1( "mus: [ENGINE] -> CMusEngTwoWayRecvSession::SetOrientationL() %d", + aOrientation ) + + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + CMceDisplaySink* display = MusEngMceUtils::GetReceivingDisplayL( *iSession ); + + CMceDisplaySink* vfDisplay = MusEngMceUtils::GetVfDisplay( *iSession ); + + CMceDisplaySink::TRotation rotation = ( aOrientation == EPortrait ) ? + CMceDisplaySink::ENone : CMceDisplaySink::EClockwise90Degree; + + display->SetRotationL( rotation ); + if ( vfDisplay ) + { + vfDisplay->SetRotationL( rotation ); + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWayRecvSession::SetOrientationL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWayRecvSession::SetRectsL( + const TRect& aRemoteRect, + const TRect& aLocalRect ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWayRecvSession::SetRectsL()" ) + + iLocalRect = aLocalRect; + iRect = aRemoteRect; + RectChangedL(); + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWayRecvSession::SetRectsL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWayRecvSession::SetSecondaryRectL( const TRect& aSecondaryRect ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWayRecvSession::SetSecondaryRectL()" ) + + iLocalRect = aSecondaryRect; + RectChangedL(); + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWayRecvSession::SetSecondaryRectL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TRect CMusEngTwoWayRecvSession::SecondaryRect() const + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWayRecvSession::SecondaryRect()" ) + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWayRecvSession::SecondaryRect()" ) + return iLocalRect; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TMusEngCameraHandler& CMusEngTwoWayRecvSession::Camera() + { + return iCameraHandler; + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +MLcVideoPlayer* CMusEngTwoWayRecvSession::LocalVideoPlayer() + { + return iLiveVideoPlayer; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// + +void CMusEngTwoWayRecvSession::RectChangedL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWayRecvSession::RectChangedL()" ) + + + // If session is not yet created, do nothing + if ( iSession && iSession->State() != CMceSession::ETerminated ) + { + TRect remoteRect( Rect() ); + MUS_LOG2( "mus: [ENGINE] remote tl.ix=%d tl.iy=%d", + remoteRect.iTl.iX, remoteRect.iTl.iY ) + MUS_LOG2( "mus: [ENGINE] remote brc%d br.iy=%d", + remoteRect.iBr.iX, remoteRect.iBr.iY ) + MUS_LOG2( "mus: [ENGINE] local tl.ix=%d tl.iy=%d", + iLocalRect.iTl.iX, iLocalRect.iTl.iY ) + MUS_LOG2( "mus: [ENGINE] local br.ix=%d br.iy=%d", + iLocalRect.iBr.iX, iLocalRect.iBr.iY ) + + if ( remoteRect != iSetRemoteRect ) + { + CMceDisplaySink* display = MusEngMceUtils::GetReceivingDisplayL( *iSession ); + display->SetDisplayRectL( remoteRect ); + iSetRemoteRect = remoteRect; + } + + if ( iLocalRect != iSetLocalRect ) + { + CMceDisplaySink* vfDisplay = MusEngMceUtils::GetVfDisplay( *iSession ); + if ( vfDisplay ) + { + vfDisplay->SetDisplayRectL( iLocalRect ); + } + iSetLocalRect = iLocalRect; + } + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWayRecvSession::RectChangedL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWayRecvSession::CompleteSessionStructureL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWayRecvSession::CompleteSessionStructureL()" ) + + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + iCameraHandler.SetSession( iSession ); + + // Force bandwidth line usage in sdp as it is mandatory + // at MT side based on GSMA VS specification IR.74. Bandwidth is set to + // session or to media level based on sender's way of usage. If other end + // is not using bandwidth attribute at all, media level is preferred. + SetSessionSdpLinesL( *iSession, ETrue ); + + CMceStreamBundle* localBundle = + CMceStreamBundle::NewLC( CMceStreamBundle::ELS ); + + const RPointerArray& streams = iSession->Streams(); + + CMceMediaStream* videoInStream = NULL; + CMceMediaStream* videoOutStream = NULL; + + // Search interesting video streams, sendrecv is preferred + TBool sendRecvVideoFound( EFalse ); + for( TInt i = 0; i < streams.Count(); ++i ) + { + if ( MusEngMceUtils::IsVideoInStream( *streams[i] ) && + !sendRecvVideoFound ) + { + videoInStream = streams[i]; + + if ( streams[i]->BoundStream() ) + { + videoOutStream = &streams[i]->BoundStreamL(); + } + } + else if ( streams[i]->BoundStream() && + MusEngMceUtils::IsVideoInStream( streams[i]->BoundStreamL() ) && + !sendRecvVideoFound ) + { + videoInStream = &streams[i]->BoundStreamL(); + + videoOutStream = streams[i]; + } + else + { + // NOP + } + + sendRecvVideoFound = ( videoInStream && videoOutStream ); + } + + CompleteSessionStructureAudioPartL( streams, *localBundle, videoInStream, videoOutStream ); + + if ( videoInStream ) + { + CompleteSessionStructureInStreamL( *videoInStream, *localBundle ); + } + else + { + // At least receiving video stream is required + User::Leave( KErrCorrupt ); + } + + if ( videoOutStream ) + { + CompleteSessionStructureOutStreamL( *videoOutStream ); + } + + // Destroy bundle if it is not needed or transfer ownership + if ( localBundle->Streams().Count() > 1 ) + { + iSession->AddBundleL( localBundle ); + CleanupStack::Pop( localBundle ); + } + else + { + CleanupStack::PopAndDestroy( localBundle ); + } + + AdjustStreamsAndCodecsL(); + + iSession->UpdateL(); + + // Now session state is right to adjust volume + SetSpeakerVolumeL( LcVolumeL() ); + + iSipProfileHandler->CreateProfileL( iSession->Profile() ); + + iRemoteVideoPlayer->SetMceSession( iSession ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWayRecvSession::CompleteSessionStructureL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngTwoWayRecvSession::CMusEngTwoWayRecvSession() + : CMusEngReceiveSession() + { + iMceManagerUid.iUid = CMusManager::ESipInviteDesired2WayVideo; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWayRecvSession::ConstructL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWayRecvSession::ConstructL()" ) + + iCameraHandler.ReadCameraUsageKeyL(); + CMusEngReceiveSession::ConstructL(); + + iLiveVideoPlayer = + CMusEngLiveVideoPlayer::NewL( *this, iCameraHandler, *this ); + + // Override receiving timeout and keepalive values of + // normal one-way receiving session + // + iReceivingInactivityTimeout = KMusEngTwoWayReceivingActivityTimeout; + iKeepaliveTimer = KMusEngTwoWayRtpKeepAliveTimer; + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWayRecvSession::ConstructL()" ) + } + +// ----------------------------------------------------------------------------- +// When checking audio streams also not interesting streams are removed from +// session. Stream if removed if one of following apply: +// 1. Is not and does not contain incoming video or audio +// 2. We already have one incoming video stream +// 3. Stream is audio and we run operator variant where audio is +// not allowed. +// 4. Two-way video exists and this one is audio +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWayRecvSession::CompleteSessionStructureAudioPartL( + const RPointerArray& aStreams, + CMceStreamBundle& aLocalBundle, + CMceMediaStream* aVideoInStream, + CMceMediaStream* aVideoOutStream ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWayRecvSession::CompleteSessionStructureAudioPartL()" ) + + // Audio streams not allowed in two-way session or in operator variant + TBool audioAllowed( !( aVideoInStream && aVideoOutStream ) && !iOperatorVariant ); + + for( TInt i = 0; i < aStreams.Count(); ++i ) + { + // Audio supported currently only in recvonly case + if ( audioAllowed && + MusEngMceUtils::IsAudioInStream( *aStreams[i] ) ) + { + MusEngMceUtils::AddSpeakerL( *aStreams[i] ); + + aLocalBundle.AddStreamL( *aStreams[i] ); + + // Disable possible opposite stream to indicate that sendrecv audio is + // not allowed. + if ( aStreams[i]->BoundStream() ) + { + MusEngMceUtils::DisableStreamL( aStreams[i]->BoundStreamL() ); + } + } + else if ( audioAllowed && + aStreams[i]->BoundStream() && + MusEngMceUtils::IsAudioInStream( aStreams[i]->BoundStreamL() ) ) + { + MusEngMceUtils::AddSpeakerL( aStreams[i]->BoundStreamL() ); + + aLocalBundle.AddStreamL( aStreams[i]->BoundStreamL() ); + + // Disable opposite stream to indicate that sendrecv audio is not allowed. + MusEngMceUtils::DisableStreamL( *aStreams[i] ); + } + else if ( aStreams[ i ] != aVideoInStream && aStreams[ i ] != aVideoOutStream ) + { + iSession->RemoveStreamL( *aStreams[i] ); + + // Since succesfull removal of a stream has decreased the amount + // of streams in array by one, we have to modify the index + --i; + } + else + { + // NOP + } + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWayRecvSession::CompleteSessionStructureAudioPartL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWayRecvSession::CompleteSessionStructureInStreamL( + CMceMediaStream& aVideoInStream, CMceStreamBundle& aLocalBundle ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWayRecvSession::CompleteSessionStructureInStreamL()" ) + + SetMediaSdpLinesL( aVideoInStream, ETrue ); + + MusEngMceUtils::AddDisplayL( aVideoInStream, *iManager, Rect() ); + + static_cast(aVideoInStream.Source())->UpdateL( + KMusEngJitterBufferLength, + KMusEngJitterBufferTreshold, + KMusEngTwoWayReceivingActivityTimeout ); + + aLocalBundle.AddStreamL( aVideoInStream ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWayRecvSession::CompleteSessionStructureInStreamL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWayRecvSession::CompleteSessionStructureOutStreamL( + CMceMediaStream& aVideoOutStream ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWayRecvSession::CompleteSessionStructureOutStreamL()" ) + + SetMediaSdpLinesL( aVideoOutStream, ETrue ); + + CMceCameraSource* camera = NULL; + TRAP_IGNORE( camera = MusEngMceUtils::GetCameraL( *iSession ) ) + if ( !camera ) + { + camera = CMceCameraSource::NewLC( *iManager ); + aVideoOutStream.SetSourceL( camera ); + CleanupStack::Pop( camera ); + } + + camera->DisableL(); // Start session in pause mode. + + iCameraHandler.InitializeL( *camera ); + + CMceVideoStream* vfStream = CMceVideoStream::NewLC(); + + vfStream->SetSourceL( aVideoOutStream.Source() ); + + // Complete stream + MusEngMceUtils::AddDisplayL( *vfStream, *iManager, SecondaryRect() ); + + iSession->AddStreamL( vfStream ); + CleanupStack::Pop( vfStream ); + + iLiveVideoPlayer->SetMceSession( iSession ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWayRecvSession::CompleteSessionStructureOutStreamL()" ) + } + + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ipvtengine/src/musengtwowaysession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ipvtengine/src/musengtwowaysession.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,169 @@ +/* +* Copyright (c) 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: +* +*/ + + +// USER +#include "musengtwowaysession.h" +#include "lcsessionobserver.h" +#include "musenglogger.h" +#include "musengremotevideoplayer.h" +#include "musenglivevideoplayer.h" +#include "svptimer.h" + + +const TInt KMusEngJitterBufferLength = 51; //Must be bigger than treshold +// Using following value increases treshold buffer to 1 second from +// default 100 ms +const TInt KMusEngJitterBufferTreshold = 50; + +const TUint32 KMusEngTwoWayReceivingActivityTimeout = 5000; // 5 seconds +// 6 seconds keepalive timer, needs to be more than receiving timeout +const TUint8 KMusEngTwoWayRtpKeepAliveTimer = 6; + +//Uncomment this for MT Simulation. +//#define MT_Simulation + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngTwoWaySession* CMusEngTwoWaySession::NewL() + { + CMusEngTwoWaySession* self = new( ELeave )CMusEngTwoWaySession(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngTwoWaySession::~CMusEngTwoWaySession() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWaySession::~CMusEngTwoWaySession()" ) + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWaySession::~CMusEngTwoWaySession()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWaySession::EnableDisplayL( TBool aEnable ) + { + MUS_LOG1( "mus: [ENGINE] -> CMusEngTwoWaySession::EnableDisplayL() %d", + aEnable ) + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWaySession::EnableDisplayL()") + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWaySession::SetOrientationL( TDisplayOrientation aOrientation ) + { + MUS_LOG1( "mus: [ENGINE] -> CMusEngTwoWaySession::SetOrientationL() %d", + aOrientation ) + + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWaySession::SetOrientationL()" ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWaySession::SetRectsL( + const TRect& aRemoteRect, + const TRect& aLocalRect ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWaySession::SetRectsL()" ) + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWaySession::SetRectsL()" ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngTwoWaySession::CMusEngTwoWaySession() + : CMusEngMceSession() + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWaySession::ConstructL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWaySession::ConstructL()" ) + + CMusEngMceSession::ConstructL(); + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWaySession::ConstructL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWaySession::EstablishLcSessionL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWaySession::EstablishLcSessionL" ) + + #ifdef MT_Simulation + if ( LcSessionState() != MLcSession::EReceived ) { + iTimer->SetTime(2000, 14); + } else { + iTimer->SetTime(2000, 1); + } + #else + + iTimer->SetTime(2000, 1); + #endif + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWaySession::EstablishLcSessionL" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWaySession::TerminateLcSessionL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWaySession::TerminateLcSessionL" ) + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWaySession::TerminateLcSessionL" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWaySession::UpdateLcSessionL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWaySession::UpdateLcSessionL" ) + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWaySession::UpdateLcSessionL" ) + } + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ipvtengine/src/musengvideoplayerbase.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ipvtengine/src/musengvideoplayerbase.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,208 @@ +/* +* 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: +* +*/ + +// USER +#include "musenglocalvideoplayer.h" +#include "musengcamerahandler.h" +#include "musengdisplayhandler.h" + +// SYSTEM +#include + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngVideoPlayerBase::CMusEngVideoPlayerBase( + MMusEngDisplayHandler& aDisplayHandler, MLcAudioControl& aLcAudioControl ) + :iDisplayHandler( aDisplayHandler ), + iLcAudioControl( aLcAudioControl ) + { + iVideoPlayerSource = MLcVideoPlayer::ECameraSource ; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngVideoPlayerBase::~CMusEngVideoPlayerBase() + { + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcVideoPlayer::TLcVideoPlayerSource CMusEngVideoPlayerBase::LcVideoPlayerSourceL() + { + return iVideoPlayerSource; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +void CMusEngVideoPlayerBase::LcPlayL(MLcVideoPlayer::TLcVideoPlayerSource aSource) + { + iVideoPlayerSource = aSource; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +void CMusEngVideoPlayerBase::LcPauseL() + { + // NOP + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcWindow* CMusEngVideoPlayerBase::LcWindow() + { + return this; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcCameraControl* CMusEngVideoPlayerBase::LcCameraControl() + { + return NULL; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcSourceFileControl* CMusEngVideoPlayerBase::LcSourceFileControl() + { + return NULL; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcDestinationFileControl* CMusEngVideoPlayerBase::LcDestinationFileControl() + { + return NULL; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcAudioControl* CMusEngVideoPlayerBase::LcAudioControl() + { + return &iLcAudioControl; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcZoomControl* CMusEngVideoPlayerBase::LcZoomControl() + { + return NULL; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcBrightnessControl* CMusEngVideoPlayerBase::LcBrightnessControl() + { + return NULL; + } + +// ----------------------------------------------------------------------------- +// From MLcWindow +// ----------------------------------------------------------------------------- +// +void CMusEngVideoPlayerBase::EnableLcWindowL( TBool aEnable ) + { + iDisplayHandler.EnableDisplayL( aEnable ); + } + +// ----------------------------------------------------------------------------- +// From MLcWindow +// ----------------------------------------------------------------------------- +// +TBool CMusEngVideoPlayerBase::IsLcWindowEnabled() + { + return iDisplayHandler.IsDisplayEnabled(); + } + +// ----------------------------------------------------------------------------- +// From MLcWindow +// ----------------------------------------------------------------------------- +// +void CMusEngVideoPlayerBase::SetLcWindowRectL( TRect aRect ) + { + iDisplayHandler.SetRectL( aRect ); + } + + +// ----------------------------------------------------------------------------- +// From MLcWindow +// ----------------------------------------------------------------------------- +// +TRect CMusEngVideoPlayerBase::LcWindowRect() + { + return iDisplayHandler.Rect(); + } + +// ----------------------------------------------------------------------------- +// From MLcWindow +// ----------------------------------------------------------------------------- +// +void CMusEngVideoPlayerBase::SetLcWindowOrientationL( + TLcWindowOrientation aOrientation ) + { + if ( aOrientation == MLcWindow::ELandscape ) + { + iDisplayHandler.SetOrientationL( MMusEngDisplayHandler::ELandscape ); + } + else + { + iDisplayHandler.SetOrientationL( MMusEngDisplayHandler::EPortrait ); + } + } + +// ----------------------------------------------------------------------------- +// From MLcWindow +// ----------------------------------------------------------------------------- +// +MLcWindow::TLcWindowOrientation CMusEngVideoPlayerBase::LcWindowOrientationL() + { + MLcWindow::TLcWindowOrientation orientation; + if ( iDisplayHandler.OrientationL() == MMusEngDisplayHandler::ELandscape ) + { + orientation = MLcWindow::ELandscape; + } + else + { + orientation = MLcWindow::EPortrait; + } + return orientation; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ipvtengine/src/svptimer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ipvtengine/src/svptimer.cpp Thu Jul 22 16:32:26 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: Timer service for SVP +* +*/ + + +#include "svptimer.h" +#include "svptimerobserver.h" + + +const TInt KMicroSecondsCoefficient = 1000; + + +// --------------------------------------------------------------------------- +// CSVPTimer::CSVPTimer +// --------------------------------------------------------------------------- +// +CSVPTimer::CSVPTimer( MSVPTimerObserver& aObserver, TInt aTimerId ): + CTimer( EPriorityHigh ), + iObserver( aObserver ), + iId( aTimerId ) + { + CActiveScheduler::Add( this ); + } + +// --------------------------------------------------------------------------- +// CSVPTimer::CSVPTimer +// --------------------------------------------------------------------------- +// +void CSVPTimer::ConstructL() + { + CTimer::ConstructL(); + } + +// --------------------------------------------------------------------------- +// CSVPTimer::CSVPTimer +// --------------------------------------------------------------------------- +// +CSVPTimer* CSVPTimer::NewL( MSVPTimerObserver& aObserver, + TInt aTimerId ) + { + CSVPTimer* self = new (ELeave) CSVPTimer( aObserver, aTimerId ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + +// --------------------------------------------------------------------------- +// CSVPTimer::~CSVPTimer +// --------------------------------------------------------------------------- +// +CSVPTimer::~CSVPTimer() + { + Cancel(); + } + +// --------------------------------------------------------------------------- +// CSVPTimer::RunL +// --------------------------------------------------------------------------- +// +void CSVPTimer::RunL() + { + iObserver.TimedOut( iId ); + } + +// --------------------------------------------------------------------------- +// CSVPTimer::SetTime +// --------------------------------------------------------------------------- +// +void CSVPTimer::SetTime( TInt aMilliSeconds, TInt aTimerId ) + { + if ( IsActive() ) + { + //iObserver.TimedOut( iId ); // Discard previous request + Cancel(); + } + + iId = aTimerId; + + // Milliseconds to microseconds conversion + const TTimeIntervalMicroSeconds32 time( + KMicroSecondsCoefficient * aMilliSeconds ); + + CTimer::After( time ); // NB, CTimer::After calls SetActive + } + +// --------------------------------------------------------------------------- +// CSVPTimer::Stop +// --------------------------------------------------------------------------- +// +void CSVPTimer::Stop() + { + Cancel(); + } + +// --------------------------------------------------------------------------- +// CSVPTimer::Id +// --------------------------------------------------------------------------- +// +TInt CSVPTimer::Id() const + { + return iId; + } + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/bwins/mceclientstubu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/bwins/mceclientstubu.def Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,310 @@ +EXPORTS + ??0TMceTransactionDataContainer@@QAE@XZ @ 1 NONAME ; TMceTransactionDataContainer::TMceTransactionDataContainer(void) + ??1CMceAmrCodec@@UAE@XZ @ 2 NONAME ; CMceAmrCodec::~CMceAmrCodec(void) + ??1CMceAudioStream@@UAE@XZ @ 3 NONAME ; CMceAudioStream::~CMceAudioStream(void) + ??1CMceAvcCodec@@UAE@XZ @ 4 NONAME ; CMceAvcCodec::~CMceAvcCodec(void) + ??1CMceCameraSource@@UAE@XZ @ 5 NONAME ; CMceCameraSource::~CMceCameraSource(void) + ??1CMceDisplaySink@@UAE@XZ @ 6 NONAME ; CMceDisplaySink::~CMceDisplaySink(void) + ??1CMceFileSink@@UAE@XZ @ 7 NONAME ; CMceFileSink::~CMceFileSink(void) + ??1CMceFileSource@@UAE@XZ @ 8 NONAME ; CMceFileSource::~CMceFileSource(void) + ??1CMceH263Codec@@UAE@XZ @ 9 NONAME ; CMceH263Codec::~CMceH263Codec(void) + ??1CMceInSession@@UAE@XZ @ 10 NONAME ; CMceInSession::~CMceInSession(void) + ??1CMceManager@@UAE@XZ @ 11 NONAME ; CMceManager::~CMceManager(void) + ??1CMceMediaSink@@UAE@XZ @ 12 NONAME ; CMceMediaSink::~CMceMediaSink(void) + ??1CMceMediaSource@@UAE@XZ @ 13 NONAME ; CMceMediaSource::~CMceMediaSource(void) + ??1CMceMediaStream@@UAE@XZ @ 14 NONAME ; CMceMediaStream::~CMceMediaStream(void) + ??1CMceOutSession@@UAE@XZ @ 15 NONAME ; CMceOutSession::~CMceOutSession(void) + ??1CMceRtpSink@@UAE@XZ @ 16 NONAME ; CMceRtpSink::~CMceRtpSink(void) + ??1CMceRtpSource@@UAE@XZ @ 17 NONAME ; CMceRtpSource::~CMceRtpSource(void) + ??1CMceSession@@UAE@XZ @ 18 NONAME ; CMceSession::~CMceSession(void) + ??1CMceSpeakerSink@@UAE@XZ @ 19 NONAME ; CMceSpeakerSink::~CMceSpeakerSink(void) + ??1CMceStreamBundle@@UAE@XZ @ 20 NONAME ; CMceStreamBundle::~CMceStreamBundle(void) + ??1CMceVideoStream@@UAE@XZ @ 21 NONAME ; CMceVideoStream::~CMceVideoStream(void) + ??1CMusTestSessionSimulator@@QAE@XZ @ 22 NONAME ; CMusTestSessionSimulator::~CMusTestSessionSimulator(void) + ??1CSIP@@UAE@XZ @ 23 NONAME ; CSIP::~CSIP(void) + ??1CSIPManagedProfile@@UAE@XZ @ 24 NONAME ; CSIPManagedProfile::~CSIPManagedProfile(void) + ??1CSIPManagedProfileRegistry@@UAE@XZ @ 25 NONAME ; CSIPManagedProfileRegistry::~CSIPManagedProfileRegistry(void) + ??1CSIPProfile@@UAE@XZ @ 26 NONAME ; CSIPProfile::~CSIPProfile(void) + ??1CSIPProfileRegistry@@UAE@XZ @ 27 NONAME ; CSIPProfileRegistry::~CSIPProfileRegistry(void) + ??1CSIPProfileRegistryBase@@UAE@XZ @ 28 NONAME ; CSIPProfileRegistryBase::~CSIPProfileRegistryBase(void) + ?AcceptL@CMceInSession@@QAEXABVTDesC8@@KPAVCDesC8Array@@PAVHBufC8@@2@Z @ 29 NONAME ; void CMceInSession::AcceptL(class TDesC8 const &, unsigned long, class CDesC8Array *, class HBufC8 *, class HBufC8 *) + ?AcceptL@CMceInSession@@QAEXXZ @ 30 NONAME ; void CMceInSession::AcceptL(void) + ?AddBundleL@CMceSession@@QAEXPAVCMceStreamBundle@@@Z @ 31 NONAME ; void CMceSession::AddBundleL(class CMceStreamBundle *) + ?AddCodecL@CMceAudioStream@@QAEXPAVCMceAudioCodec@@@Z @ 32 NONAME ; void CMceAudioStream::AddCodecL(class CMceAudioCodec *) + ?AddCodecL@CMceVideoStream@@QAEXPAVCMceVideoCodec@@@Z @ 33 NONAME ; void CMceVideoStream::AddCodecL(class CMceVideoCodec *) + ?AddSinkL@CMceMediaStream@@QAEXPAVCMceMediaSink@@@Z @ 34 NONAME ; void CMceMediaStream::AddSinkL(class CMceMediaSink *) + ?AddStreamL@CMceOutSession@@UAEXPAVCMceMediaStream@@@Z @ 35 NONAME ; void CMceOutSession::AddStreamL(class CMceMediaStream *) + ?AddStreamL@CMceSession@@UAEXPAVCMceMediaStream@@@Z @ 36 NONAME ; void CMceSession::AddStreamL(class CMceMediaStream *) + ?AddStreamL@CMceStreamBundle@@QAEXAAVCMceMediaStream@@@Z @ 37 NONAME ; void CMceStreamBundle::AddStreamL(class CMceMediaStream &) + ?AllowedBitrates@CMceCodec@@QBEIXZ @ 38 NONAME ; unsigned int CMceCodec::AllowedBitrates(void) const + ?AllowedFrameRates@CMceVideoCodec@@QBEIXZ @ 39 NONAME ; unsigned int CMceVideoCodec::AllowedFrameRates(void) const + ?AllowedResolutions@CMceVideoCodec@@QBEIXZ @ 40 NONAME ; unsigned int CMceVideoCodec::AllowedResolutions(void) const + ?BindL@CMceMediaStream@@QAEXPAV1@@Z @ 41 NONAME ; void CMceMediaStream::BindL(class CMceMediaStream *) + ?Bitrate@CMceCodec@@QBEIXZ @ 42 NONAME ; unsigned int CMceCodec::Bitrate(void) const + ?BoundStream@CMceMediaStream@@QBEHXZ @ 43 NONAME ; int CMceMediaStream::BoundStream(void) const + ?BoundStreamL@CMceMediaStream@@QBEAAV1@XZ @ 44 NONAME ; class CMceMediaStream & CMceMediaStream::BoundStreamL(void) const + ?BrightnessL@CMceCameraSource@@QAEHXZ @ 45 NONAME ; int CMceCameraSource::BrightnessL(void) + ?Bundles@CMceSession@@QBEABV?$RPointerArray@VCMceStreamBundle@@@@XZ @ 46 NONAME ; class RPointerArray const & CMceSession::Bundles(void) const + ?CamerasAvailable@CMceCameraSource@@QBEHXZ @ 47 NONAME ; int CMceCameraSource::CamerasAvailable(void) const + ?CancelL@CMceOutSession@@QAEXXZ @ 48 NONAME ; void CMceOutSession::CancelL(void) + ?CancelTranscodeL@CMceFileSource@@QAEXXZ @ 49 NONAME ; void CMceFileSource::CancelTranscodeL(void) + ?Clear@TMceTransactionDataContainer@@QAEXXZ @ 50 NONAME ; void TMceTransactionDataContainer::Clear(void) + ?CloneL@CMceAmrCodec@@UBEPAVCMceAudioCodec@@XZ @ 51 NONAME ; class CMceAudioCodec * CMceAmrCodec::CloneL(void) const + ?CloneL@CMceAvcCodec@@UBEPAVCMceVideoCodec@@XZ @ 52 NONAME ; class CMceVideoCodec * CMceAvcCodec::CloneL(void) const + ?CloneL@CMceH263Codec@@UBEPAVCMceVideoCodec@@XZ @ 53 NONAME ; class CMceVideoCodec * CMceH263Codec::CloneL(void) const + ?CodecMode@CMceCodec@@QBEIXZ @ 54 NONAME ; unsigned int CMceCodec::CodecMode(void) const + ?Codecs@CMceAudioStream@@QAEABV?$RPointerArray@VCMceAudioCodec@@@@XZ @ 55 NONAME ; class RPointerArray const & CMceAudioStream::Codecs(void) + ?Codecs@CMceVideoStream@@QAEABV?$RPointerArray@VCMceVideoCodec@@@@XZ @ 56 NONAME ; class RPointerArray const & CMceVideoStream::Codecs(void) + ?ConfigKeyL@CMceVideoCodec@@QBEPAVHBufC8@@XZ @ 57 NONAME ; class HBufC8 * CMceVideoCodec::ConfigKeyL(void) const + ?Connection@CSIP@@QBEPAVCSIPConnection@@K@Z @ 58 NONAME ; class CSIPConnection * CSIP::Connection(unsigned long) const + ?ConnectionActive@CMceSession@@QBEHXZ @ 59 NONAME ; int CMceSession::ConnectionActive(void) const + ?ContrastL@CMceCameraSource@@QAEHXZ @ 60 NONAME ; int CMceCameraSource::ContrastL(void) + ?CurrentMediaElement@CMceFileSource@@QAEHI@Z @ 61 NONAME ; int CMceFileSource::CurrentMediaElement(unsigned int) + ?DefaultHeadersL@CMceManager@@QBEPAVCDesC8Array@@ABVTDesC8@@@Z @ 62 NONAME ; class CDesC8Array * CMceManager::DefaultHeadersL(class TDesC8 const &) const + ?DefaultProfileL@CSIPProfileRegistryBase@@QAEPAVCSIPProfile@@XZ @ 63 NONAME ; class CSIPProfile * CSIPProfileRegistryBase::DefaultProfileL(void) + ?DigitalZoomFactorL@CMceCameraSource@@QAEHXZ @ 64 NONAME ; int CMceCameraSource::DigitalZoomFactorL(void) + ?Disable@CSIPProfileRegistry@@QAEHAAVCSIPProfile@@@Z @ 65 NONAME ; int CSIPProfileRegistry::Disable(class CSIPProfile &) + ?DisableInactivityTimerL@CMceRtpSource@@QAEXXZ @ 66 NONAME ; void CMceRtpSource::DisableInactivityTimerL(void) + ?DisableL@CMceCameraSource@@UAEXXZ @ 67 NONAME ; void CMceCameraSource::DisableL(void) + ?DisableL@CMceDisplaySink@@UAEXXZ @ 68 NONAME ; void CMceDisplaySink::DisableL(void) + ?DisableL@CMceFileSink@@UAEXXZ @ 69 NONAME ; void CMceFileSink::DisableL(void) + ?DisableL@CMceFileSource@@UAEXXZ @ 70 NONAME ; void CMceFileSource::DisableL(void) + ?DisableL@CMceMediaStream@@UAEXXZ @ 71 NONAME ; void CMceMediaStream::DisableL(void) + ?DisableL@CMceRtpSink@@UAEXXZ @ 72 NONAME ; void CMceRtpSink::DisableL(void) + ?DisableL@CMceRtpSource@@UAEXXZ @ 73 NONAME ; void CMceRtpSource::DisableL(void) + ?DisableL@CMceSpeakerSink@@UAEXXZ @ 74 NONAME ; void CMceSpeakerSink::DisableL(void) + ?DisableSsrcL@CMceRtpSource@@QAEXI@Z @ 75 NONAME ; void CMceRtpSource::DisableSsrcL(unsigned int) + ?DisplayRectL@CMceDisplaySink@@QAE?BVTRect@@XZ @ 76 NONAME ; class TRect const CMceDisplaySink::DisplayRectL(void) + ?DisplaysAvailable@CMceDisplaySink@@QBEHXZ @ 77 NONAME ; int CMceDisplaySink::DisplaysAvailable(void) const + ?DurationL@CMceFileSource@@QBE?AVTTimeIntervalMicroSeconds@@XZ @ 78 NONAME ; class TTimeIntervalMicroSeconds CMceFileSource::DurationL(void) const + ?EnableInactivityTimerL@CMceRtpSource@@QAEXK@Z @ 79 NONAME ; void CMceRtpSource::EnableInactivityTimerL(unsigned long) + ?EnableL@CMceCameraSource@@UAEXXZ @ 80 NONAME ; void CMceCameraSource::EnableL(void) + ?EnableL@CMceDisplaySink@@UAEXXZ @ 81 NONAME ; void CMceDisplaySink::EnableL(void) + ?EnableL@CMceFileSink@@UAEXXZ @ 82 NONAME ; void CMceFileSink::EnableL(void) + ?EnableL@CMceFileSource@@UAEXXZ @ 83 NONAME ; void CMceFileSource::EnableL(void) + ?EnableL@CMceMediaStream@@UAEXXZ @ 84 NONAME ; void CMceMediaStream::EnableL(void) + ?EnableL@CMceRtpSink@@UAEXXZ @ 85 NONAME ; void CMceRtpSink::EnableL(void) + ?EnableL@CMceRtpSource@@UAEXXZ @ 86 NONAME ; void CMceRtpSource::EnableL(void) + ?EnableL@CMceSpeakerSink@@UAEXXZ @ 87 NONAME ; void CMceSpeakerSink::EnableL(void) + ?EnableL@CSIPProfileRegistry@@QAEXAAVCSIPProfile@@AAVMSIPConnectionObserver@@@Z @ 88 NONAME ; void CSIPProfileRegistry::EnableL(class CSIPProfile &, class MSIPConnectionObserver &) + ?EnableSsrcL@CMceRtpSource@@QAEXI@Z @ 89 NONAME ; void CMceRtpSource::EnableSsrcL(unsigned int) + ?EnableVAD@CMceAmrCodec@@UAEHH@Z @ 90 NONAME ; int CMceAmrCodec::EnableVAD(int) + ?EstablishL@CMceOutSession@@QAEXKPAVCDesC8Array@@PAVHBufC8@@10@Z @ 91 NONAME ; void CMceOutSession::EstablishL(unsigned long, class CDesC8Array *, class HBufC8 *, class HBufC8 *, class CDesC8Array *) + ?ExposureL@CMceCameraSource@@QAE?AW4TExposure@CCamera@@XZ @ 92 NONAME ; enum CCamera::TExposure CMceCameraSource::ExposureL(void) + ?FourCC@CMceCodec@@QBEKXZ @ 93 NONAME ; unsigned long CMceCodec::FourCC(void) const + ?FrameRate@CMceVideoCodec@@QBENXZ @ 94 NONAME ; double CMceVideoCodec::FrameRate(void) const + ?FrameSize@CMceCodec@@QBEIXZ @ 95 NONAME ; unsigned int CMceCodec::FrameSize(void) const + ?GetCameraInfo@CMceCameraSource@@QBEXAAVTCameraInfo@@@Z @ 96 NONAME ; void CMceCameraSource::GetCameraInfo(class TCameraInfo &) const + ?GetContent@TMceTransactionDataContainer@@QAEPAVHBufC8@@XZ @ 97 NONAME ; class HBufC8 * TMceTransactionDataContainer::GetContent(void) + ?GetContentHeaders@TMceTransactionDataContainer@@QAEPAVCDesC8Array@@XZ @ 98 NONAME ; class CDesC8Array * TMceTransactionDataContainer::GetContentHeaders(void) + ?GetContentType@TMceTransactionDataContainer@@QAEPAVHBufC8@@XZ @ 99 NONAME ; class HBufC8 * TMceTransactionDataContainer::GetContentType(void) + ?GetHeaders@TMceTransactionDataContainer@@QAEPAVCDesC8Array@@XZ @ 100 NONAME ; class CDesC8Array * TMceTransactionDataContainer::GetHeaders(void) + ?GetModifierL@CMceSession@@QBEXKAAI@Z @ 101 NONAME ; void CMceSession::GetModifierL(unsigned long, unsigned int &) const + ?GetParameter@CSIPProfile@@QBEHKAAH@Z @ 102 NONAME ; int CSIPProfile::GetParameter(unsigned long, int &) const + ?GetParameter@CSIPProfile@@QBEHKAAK@Z @ 103 NONAME ; int CSIPProfile::GetParameter(unsigned long, unsigned long &) const + ?GetParameter@CSIPProfile@@QBEHKAAPBVMDesC8Array@@@Z @ 104 NONAME ; int CSIPProfile::GetParameter(unsigned long, class MDesC8Array const * &) const + ?GetParameter@CSIPProfile@@QBEHKAAPBVTDesC8@@@Z @ 105 NONAME ; int CSIPProfile::GetParameter(unsigned long, class TDesC8 const * &) const + ?GetReasonPhrase@TMceTransactionDataContainer@@QAEPAVHBufC8@@XZ @ 106 NONAME ; class HBufC8 * TMceTransactionDataContainer::GetReasonPhrase(void) + ?GetStatusCode@TMceTransactionDataContainer@@QAEHXZ @ 107 NONAME ; int TMceTransactionDataContainer::GetStatusCode(void) + ?IsEnabled@CMceMediaSink@@QBEHXZ @ 108 NONAME ; int CMceMediaSink::IsEnabled(void) const + ?IsEnabled@CMceMediaSource@@QBEHXZ @ 109 NONAME ; int CMceMediaSource::IsEnabled(void) const + ?IsEnabled@CMceMediaStream@@QBEHXZ @ 110 NONAME ; int CMceMediaStream::IsEnabled(void) const + ?IsEnabled@CSIPProfileRegistry@@QBEHABVCSIPProfile@@@Z @ 111 NONAME ; int CSIPProfileRegistry::IsEnabled(class CSIPProfile const &) const + ?IsSigCompSupportedL@CSIP@@QBEHXZ @ 112 NONAME ; int CSIP::IsSigCompSupportedL(void) const + ?IsSsrcEnabledL@CMceRtpSource@@QAEHI@Z @ 113 NONAME ; int CMceRtpSource::IsSsrcEnabledL(unsigned int) + ?KeepAliveData@CMceCodec@@QBEABVTDesC8@@XZ @ 114 NONAME ; class TDesC8 const & CMceCodec::KeepAliveData(void) const + ?KeepAlivePayloadType@CMceCodec@@QBEEXZ @ 115 NONAME ; unsigned char CMceCodec::KeepAlivePayloadType(void) const + ?KeepAliveTimer@CMceCodec@@QBEEXZ @ 116 NONAME ; unsigned char CMceCodec::KeepAliveTimer(void) const + ?LastPacket@CMceRtpSink@@QBEKXZ @ 117 NONAME ; unsigned long CMceRtpSink::LastPacket(void) const + ?LastRegistrationError@CSIPProfileRegistryBase@@QBEHABVCSIPProfile@@@Z @ 118 NONAME ; int CSIPProfileRegistryBase::LastRegistrationError(class CSIPProfile const &) const + ?LocalMediaPort@CMceMediaStream@@QBEIXZ @ 119 NONAME ; unsigned int CMceMediaStream::LocalMediaPort(void) const + ?MMFPriority@CMceCodec@@QBEHXZ @ 120 NONAME ; int CMceCodec::MMFPriority(void) const + ?MMFPriorityPreference@CMceCodec@@QBEHXZ @ 121 NONAME ; int CMceCodec::MMFPriorityPreference(void) const + ?MaxBitRate@CMceVideoCodec@@QBEIXZ @ 122 NONAME ; unsigned int CMceVideoCodec::MaxBitRate(void) const + ?MaxVolumeL@CMceSpeakerSink@@QBEHXZ @ 123 NONAME ; int CMceSpeakerSink::MaxVolumeL(void) const + ?MediaAttributeLinesL@CMceMediaStream@@QAEPAVMDesC8Array@@XZ @ 124 NONAME ; class MDesC8Array * CMceMediaStream::MediaAttributeLinesL(void) + ?MediaElementCountL@CMceFileSource@@QBEHI@Z @ 125 NONAME ; int CMceFileSource::MediaElementCountL(unsigned int) const + ?NegotiatedSecurityMechanismL@CSIP@@QAEPAVHBufC8@@ABVTDesC8@@@Z @ 126 NONAME ; class HBufC8 * CSIP::NegotiatedSecurityMechanismL(class TDesC8 const &) + ?NewL@CMceAudioStream@@SAPAV1@XZ @ 127 NONAME ; class CMceAudioStream * CMceAudioStream::NewL(void) + ?NewL@CMceAvcCodec@@SAPAV1@V?$TBuf8@$0BE@@@@Z @ 128 NONAME ; class CMceAvcCodec * CMceAvcCodec::NewL(class TBuf8<20>) + ?NewL@CMceCameraSource@@SAPAV1@AAVCMceManager@@@Z @ 129 NONAME ; class CMceCameraSource * CMceCameraSource::NewL(class CMceManager &) + ?NewL@CMceCameraSource@@SAPAV1@XZ @ 130 NONAME ; class CMceCameraSource * CMceCameraSource::NewL(void) + ?NewL@CMceDisplaySink@@SAPAV1@AAVCMceManager@@@Z @ 131 NONAME ; class CMceDisplaySink * CMceDisplaySink::NewL(class CMceManager &) + ?NewL@CMceDisplaySink@@SAPAV1@XZ @ 132 NONAME ; class CMceDisplaySink * CMceDisplaySink::NewL(void) + ?NewL@CMceFileSink@@SAPAV1@ABV?$TBuf@$0BAA@@@@Z @ 133 NONAME ; class CMceFileSink * CMceFileSink::NewL(class TBuf<256> const &) + ?NewL@CMceFileSource@@SAPAV1@AAVCMceManager@@ABV?$TBuf@$0BAA@@@@Z @ 134 NONAME ; class CMceFileSource * CMceFileSource::NewL(class CMceManager &, class TBuf<256> const &) + ?NewL@CMceH263Codec@@SAPAV1@V?$TBuf8@$0BE@@@@Z @ 135 NONAME ; class CMceH263Codec * CMceH263Codec::NewL(class TBuf8<20>) + ?NewL@CMceInSession@@SAPAV1@AAVCMceManager@@ABVTDesC8@@@Z @ 136 NONAME ; class CMceInSession * CMceInSession::NewL(class CMceManager &, class TDesC8 const &) + ?NewL@CMceInSession@@SAPAV1@XZ @ 137 NONAME ; class CMceInSession * CMceInSession::NewL(void) + ?NewL@CMceManager@@SAPAV1@ABVTUid@@PAVTMceTransactionDataContainer@@@Z @ 138 NONAME ; class CMceManager * CMceManager::NewL(class TUid const &, class TMceTransactionDataContainer *) + ?NewL@CMceOutSession@@SAPAV1@AAVCMceEvent@@@Z @ 139 NONAME ; class CMceOutSession * CMceOutSession::NewL(class CMceEvent &) + ?NewL@CMceOutSession@@SAPAV1@AAVCMceManager@@AAVCSIPProfile@@ABVTDesC8@@PAVHBufC8@@@Z @ 140 NONAME ; class CMceOutSession * CMceOutSession::NewL(class CMceManager &, class CSIPProfile &, class TDesC8 const &, class HBufC8 *) + ?NewL@CMceOutSession@@SAPAV1@AAVCMceRefer@@@Z @ 141 NONAME ; class CMceOutSession * CMceOutSession::NewL(class CMceRefer &) + ?NewL@CMceOutSession@@SAPAV1@XZ @ 142 NONAME ; class CMceOutSession * CMceOutSession::NewL(void) + ?NewL@CMceRtpSink@@SAPAV1@HPAVHBufC8@@@Z @ 143 NONAME ; class CMceRtpSink * CMceRtpSink::NewL(int, class HBufC8 *) + ?NewL@CMceRtpSink@@SAPAV1@XZ @ 144 NONAME ; class CMceRtpSink * CMceRtpSink::NewL(void) + ?NewL@CMceRtpSource@@SAPAV1@IIKPAVHBufC8@@@Z @ 145 NONAME ; class CMceRtpSource * CMceRtpSource::NewL(unsigned int, unsigned int, unsigned long, class HBufC8 *) + ?NewL@CMceSpeakerSink@@SAPAV1@XZ @ 146 NONAME ; class CMceSpeakerSink * CMceSpeakerSink::NewL(void) + ?NewL@CMceStreamBundle@@SAPAV1@W4TMceStreamBundleType@1@@Z @ 147 NONAME ; class CMceStreamBundle * CMceStreamBundle::NewL(enum CMceStreamBundle::TMceStreamBundleType) + ?NewL@CMceVideoStream@@SAPAV1@XZ @ 148 NONAME ; class CMceVideoStream * CMceVideoStream::NewL(void) + ?NewL@CSIP@@SAPAV1@ABVTUid@@AAVMSIPObserver@@@Z @ 149 NONAME ; class CSIP * CSIP::NewL(class TUid const &, class MSIPObserver &) + ?NewL@CSIPManagedProfileRegistry@@SAPAV1@AAVMSIPProfileRegistryObserver@@@Z @ 150 NONAME ; class CSIPManagedProfileRegistry * CSIPManagedProfileRegistry::NewL(class MSIPProfileRegistryObserver &) + ?NewL@CSIPProfileRegistry@@SAPAV1@AAVCSIP@@AAVMSIPProfileRegistryObserver@@@Z @ 151 NONAME ; class CSIPProfileRegistry * CSIPProfileRegistry::NewL(class CSIP &, class MSIPProfileRegistryObserver &) + ?NewLC@CMceAudioStream@@SAPAV1@XZ @ 152 NONAME ; class CMceAudioStream * CMceAudioStream::NewLC(void) + ?NewLC@CMceAvcCodec@@SAPAV1@V?$TBuf8@$0BE@@@@Z @ 153 NONAME ; class CMceAvcCodec * CMceAvcCodec::NewLC(class TBuf8<20>) + ?NewLC@CMceCameraSource@@SAPAV1@AAVCMceManager@@@Z @ 154 NONAME ; class CMceCameraSource * CMceCameraSource::NewLC(class CMceManager &) + ?NewLC@CMceCameraSource@@SAPAV1@XZ @ 155 NONAME ; class CMceCameraSource * CMceCameraSource::NewLC(void) + ?NewLC@CMceDisplaySink@@SAPAV1@AAVCMceManager@@@Z @ 156 NONAME ; class CMceDisplaySink * CMceDisplaySink::NewLC(class CMceManager &) + ?NewLC@CMceDisplaySink@@SAPAV1@XZ @ 157 NONAME ; class CMceDisplaySink * CMceDisplaySink::NewLC(void) + ?NewLC@CMceFileSink@@SAPAV1@ABV?$TBuf@$0BAA@@@@Z @ 158 NONAME ; class CMceFileSink * CMceFileSink::NewLC(class TBuf<256> const &) + ?NewLC@CMceFileSource@@SAPAV1@AAVCMceManager@@ABV?$TBuf@$0BAA@@@@Z @ 159 NONAME ; class CMceFileSource * CMceFileSource::NewLC(class CMceManager &, class TBuf<256> const &) + ?NewLC@CMceH263Codec@@SAPAV1@V?$TBuf8@$0BE@@@@Z @ 160 NONAME ; class CMceH263Codec * CMceH263Codec::NewLC(class TBuf8<20>) + ?NewLC@CMceRtpSink@@SAPAV1@XZ @ 161 NONAME ; class CMceRtpSink * CMceRtpSink::NewLC(void) + ?NewLC@CMceRtpSource@@SAPAV1@IIKPAVHBufC8@@@Z @ 162 NONAME ; class CMceRtpSource * CMceRtpSource::NewLC(unsigned int, unsigned int, unsigned long, class HBufC8 *) + ?NewLC@CMceSpeakerSink@@SAPAV1@XZ @ 163 NONAME ; class CMceSpeakerSink * CMceSpeakerSink::NewLC(void) + ?NewLC@CMceStreamBundle@@SAPAV1@W4TMceStreamBundleType@1@@Z @ 164 NONAME ; class CMceStreamBundle * CMceStreamBundle::NewLC(enum CMceStreamBundle::TMceStreamBundleType) + ?NewLC@CMceVideoStream@@SAPAV1@XZ @ 165 NONAME ; class CMceVideoStream * CMceVideoStream::NewLC(void) + ?NewLC@CSIP@@SAPAV1@ABVTUid@@AAVMSIPObserver@@@Z @ 166 NONAME ; class CSIP * CSIP::NewLC(class TUid const &, class MSIPObserver &) + ?NewLC@CSIPManagedProfileRegistry@@SAPAV1@AAVMSIPProfileRegistryObserver@@@Z @ 167 NONAME ; class CSIPManagedProfileRegistry * CSIPManagedProfileRegistry::NewLC(class MSIPProfileRegistryObserver &) + ?NewLC@CSIPProfileRegistry@@SAPAV1@AAVCSIP@@AAVMSIPProfileRegistryObserver@@@Z @ 168 NONAME ; class CSIPProfileRegistry * CSIPProfileRegistry::NewLC(class CSIP &, class MSIPProfileRegistryObserver &) + ?Originator@CMceSession@@QBEABVTDesC8@@XZ @ 169 NONAME ; class TDesC8 const & CMceSession::Originator(void) const + ?PayloadType@CMceCodec@@QBEEXZ @ 170 NONAME ; unsigned char CMceCodec::PayloadType(void) const + ?PositionL@CMceFileSource@@QBE?AVTTimeIntervalMicroSeconds@@XZ @ 171 NONAME ; class TTimeIntervalMicroSeconds CMceFileSource::PositionL(void) const + ?Preference@CMceCodec@@QBEHXZ @ 172 NONAME ; int CMceCodec::Preference(void) const + ?PriorityL@CMceDisplaySink@@QAEIXZ @ 173 NONAME ; unsigned int CMceDisplaySink::PriorityL(void) + ?Profile@CMceSession@@QBEKXZ @ 174 NONAME ; unsigned long CMceSession::Profile(void) const + ?ProfileL@CSIPProfileRegistryBase@@QAEPAVCSIPProfile@@K@Z @ 175 NONAME ; class CSIPProfile * CSIPProfileRegistryBase::ProfileL(unsigned long) + ?ProfilesL@CSIPProfileRegistryBase@@QAEXAAV?$RPointerArray@VCSIPProfile@@@@@Z @ 176 NONAME ; void CSIPProfileRegistryBase::ProfilesL(class RPointerArray &) + ?ProfilesL@CSIPProfileRegistryBase@@QAEXABVTDesC8@@AAV?$RPointerArray@VCSIPProfile@@@@@Z @ 177 NONAME ; void CSIPProfileRegistryBase::ProfilesL(class TDesC8 const &, class RPointerArray &) + ?ProfilesL@CSIPProfileRegistryBase@@QAEXABVTSIPProfileTypeInfo@@AAV?$RPointerArray@VCSIPProfile@@@@@Z @ 178 NONAME ; void CSIPProfileRegistryBase::ProfilesL(class TSIPProfileTypeInfo const &, class RPointerArray &) + ?Recipient@CMceSession@@QBEABVTDesC8@@XZ @ 179 NONAME ; class TDesC8 const & CMceSession::Recipient(void) const + ?RejectL@CMceInSession@@QAEXABVTDesC8@@KPAVCDesC8Array@@PAVHBufC8@@2@Z @ 180 NONAME ; void CMceInSession::RejectL(class TDesC8 const &, unsigned long, class CDesC8Array *, class HBufC8 *, class HBufC8 *) + ?RejectL@CMceInSession@@QAEXXZ @ 181 NONAME ; void CMceInSession::RejectL(void) + ?RemoveBundleL@CMceSession@@QAEXAAVCMceStreamBundle@@@Z @ 182 NONAME ; void CMceSession::RemoveBundleL(class CMceStreamBundle &) + ?RemoveCodecL@CMceAudioStream@@QAEXAAVCMceAudioCodec@@@Z @ 183 NONAME ; void CMceAudioStream::RemoveCodecL(class CMceAudioCodec &) + ?RemoveCodecL@CMceVideoStream@@QAEXAAVCMceVideoCodec@@@Z @ 184 NONAME ; void CMceVideoStream::RemoveCodecL(class CMceVideoCodec &) + ?RemoveSinkL@CMceMediaStream@@QAEXAAVCMceMediaSink@@@Z @ 185 NONAME ; void CMceMediaStream::RemoveSinkL(class CMceMediaSink &) + ?RemoveStreamL@CMceSession@@QAEXAAVCMceMediaStream@@@Z @ 186 NONAME ; void CMceSession::RemoveStreamL(class CMceMediaStream &) + ?RemoveStreamL@CMceStreamBundle@@QAEXAAVCMceMediaStream@@@Z @ 187 NONAME ; void CMceStreamBundle::RemoveStreamL(class CMceMediaStream &) + ?ReplaceCodecsL@CMceVideoStream@@QAEXPAV?$RPointerArray@VCMceVideoCodec@@@@@Z @ 188 NONAME ; void CMceVideoStream::ReplaceCodecsL(class RPointerArray *) + ?Resolution@CMceVideoCodec@@QBE?AVTSize@@XZ @ 189 NONAME ; class TSize CMceVideoCodec::Resolution(void) const + ?RingL@CMceInSession@@QAEXPAVCDesC8Array@@PAVHBufC8@@1@Z @ 190 NONAME ; void CMceInSession::RingL(class CDesC8Array *, class HBufC8 *, class HBufC8 *) + ?RotationL@CMceDisplaySink@@QAE?AW4TRotation@1@XZ @ 191 NONAME ; enum CMceDisplaySink::TRotation CMceDisplaySink::RotationL(void) + ?RoutingL@CMceSpeakerSink@@QBEHXZ @ 192 NONAME ; int CMceSpeakerSink::RoutingL(void) const + ?SIP@CSIPProfileRegistry@@QBEAAVCSIP@@XZ @ 193 NONAME ; class CSIP & CSIPProfileRegistry::SIP(void) const + ?SaveL@CSIPManagedProfileRegistry@@QAEXAAVCSIPProfile@@@Z @ 194 NONAME ; void CSIPManagedProfileRegistry::SaveL(class CSIPProfile &) + ?SdpName@CMceCodec@@QBEABVTDesC8@@XZ @ 195 NONAME ; class TDesC8 const & CMceCodec::SdpName(void) const + ?SendRRL@CMceRtpSource@@QAEXXZ @ 196 NONAME ; void CMceRtpSource::SendRRL(void) + ?SendSRL@CMceRtpSink@@QAEXXZ @ 197 NONAME ; void CMceRtpSink::SendSRL(void) + ?Session@CMceMediaStream@@QBEPAVCMceSession@@XZ @ 198 NONAME ; class CMceSession * CMceMediaStream::Session(void) const + ?SessionSDPLinesL@CMceSession@@QAEPAVMDesC8Array@@XZ @ 199 NONAME ; class MDesC8Array * CMceSession::SessionSDPLinesL(void) + ?SessionTimer@CMceSession@@QBEKXZ @ 200 NONAME ; unsigned long CMceSession::SessionTimer(void) const + ?Sessions@CMceManager@@QBEABV?$RPointerArray@VCMceSession@@@@XZ @ 201 NONAME ; class RPointerArray const & CMceManager::Sessions(void) const + ?SetAllowedBitrates@CMceAmrCodec@@UAEHI@Z @ 202 NONAME ; int CMceAmrCodec::SetAllowedBitrates(unsigned int) + ?SetAllowedBitrates@CMceAvcCodec@@UAEHI@Z @ 203 NONAME ; int CMceAvcCodec::SetAllowedBitrates(unsigned int) + ?SetAllowedBitrates@CMceH263Codec@@UAEHI@Z @ 204 NONAME ; int CMceH263Codec::SetAllowedBitrates(unsigned int) + ?SetAllowedFrameRatesL@CMceAvcCodec@@UAEXI@Z @ 205 NONAME ; void CMceAvcCodec::SetAllowedFrameRatesL(unsigned int) + ?SetAllowedFrameRatesL@CMceH263Codec@@UAEXI@Z @ 206 NONAME ; void CMceH263Codec::SetAllowedFrameRatesL(unsigned int) + ?SetAllowedResolutionsL@CMceAvcCodec@@UAEXI@Z @ 207 NONAME ; void CMceAvcCodec::SetAllowedResolutionsL(unsigned int) + ?SetAllowedResolutionsL@CMceH263Codec@@UAEXI@Z @ 208 NONAME ; void CMceH263Codec::SetAllowedResolutionsL(unsigned int) + ?SetBitrate@CMceAmrCodec@@UAEHI@Z @ 209 NONAME ; int CMceAmrCodec::SetBitrate(unsigned int) + ?SetBitrate@CMceAvcCodec@@UAEHI@Z @ 210 NONAME ; int CMceAvcCodec::SetBitrate(unsigned int) + ?SetBitrate@CMceH263Codec@@UAEHI@Z @ 211 NONAME ; int CMceH263Codec::SetBitrate(unsigned int) + ?SetBrightnessL@CMceCameraSource@@QAEXH@Z @ 212 NONAME ; void CMceCameraSource::SetBrightnessL(int) + ?SetCameraIndexL@CMceCameraSource@@QAEXH@Z @ 213 NONAME ; void CMceCameraSource::SetCameraIndexL(int) + ?SetCodecMode@CMceAmrCodec@@UAEHI@Z @ 214 NONAME ; int CMceAmrCodec::SetCodecMode(unsigned int) + ?SetCodecMode@CMceAvcCodec@@UAEHI@Z @ 215 NONAME ; int CMceAvcCodec::SetCodecMode(unsigned int) + ?SetCodecMode@CMceH263Codec@@UAEHI@Z @ 216 NONAME ; int CMceH263Codec::SetCodecMode(unsigned int) + ?SetConfigKeyL@CMceAvcCodec@@UAEXABVTDesC8@@@Z @ 217 NONAME ; void CMceAvcCodec::SetConfigKeyL(class TDesC8 const &) + ?SetConfigKeyL@CMceH263Codec@@UAEXABVTDesC8@@@Z @ 218 NONAME ; void CMceH263Codec::SetConfigKeyL(class TDesC8 const &) + ?SetContent@TMceTransactionDataContainer@@QAEXPAVHBufC8@@@Z @ 219 NONAME ; void TMceTransactionDataContainer::SetContent(class HBufC8 *) + ?SetContentHeaders@TMceTransactionDataContainer@@QAEXPAVCDesC8Array@@@Z @ 220 NONAME ; void TMceTransactionDataContainer::SetContentHeaders(class CDesC8Array *) + ?SetContentType@TMceTransactionDataContainer@@QAEXPAVHBufC8@@@Z @ 221 NONAME ; void TMceTransactionDataContainer::SetContentType(class HBufC8 *) + ?SetContrastL@CMceCameraSource@@QAEXH@Z @ 222 NONAME ; void CMceCameraSource::SetContrastL(int) + ?SetCurrentMediaElementL@CMceFileSource@@QAEXIH@Z @ 223 NONAME ; void CMceFileSource::SetCurrentMediaElementL(unsigned int, int) + ?SetDefaultHeadersL@CMceManager@@QAEXPAVCDesC8Array@@0@Z @ 224 NONAME ; void CMceManager::SetDefaultHeadersL(class CDesC8Array *, class CDesC8Array *) + ?SetDigitalZoomFactorL@CMceCameraSource@@QAEXH@Z @ 225 NONAME ; void CMceCameraSource::SetDigitalZoomFactorL(int) + ?SetDisplay@CMceDisplaySink@@QAEXAAVRWindow@@AAVCWindowGc@@@Z @ 226 NONAME ; void CMceDisplaySink::SetDisplay(class RWindow &, class CWindowGc &) + ?SetDisplayIndexL@CMceDisplaySink@@QAEXH@Z @ 227 NONAME ; void CMceDisplaySink::SetDisplayIndexL(int) + ?SetDisplayRectL@CMceDisplaySink@@QAEXABVTRect@@@Z @ 228 NONAME ; void CMceDisplaySink::SetDisplayRectL(class TRect const &) + ?SetEventObserver@CMceManager@@QAEXPAVMMceEventObserver@@@Z @ 229 NONAME ; void CMceManager::SetEventObserver(class MMceEventObserver *) + ?SetExposureL@CMceCameraSource@@QAEXW4TExposure@CCamera@@@Z @ 230 NONAME ; void CMceCameraSource::SetExposureL(enum CCamera::TExposure) + ?SetFastForwardL@CMceFileSource@@QAEXH@Z @ 231 NONAME ; void CMceFileSource::SetFastForwardL(int) + ?SetFastRewindL@CMceFileSource@@QAEXH@Z @ 232 NONAME ; void CMceFileSource::SetFastRewindL(int) + ?SetFrameRateL@CMceAvcCodec@@UAEXN@Z @ 233 NONAME ; void CMceAvcCodec::SetFrameRateL(double) + ?SetFrameRateL@CMceH263Codec@@UAEXN@Z @ 234 NONAME ; void CMceH263Codec::SetFrameRateL(double) + ?SetHeaders@TMceTransactionDataContainer@@QAEXPAVCDesC8Array@@@Z @ 235 NONAME ; void TMceTransactionDataContainer::SetHeaders(class CDesC8Array *) + ?SetInEventObserver@CMceManager@@QAEXPAVMMceInEventObserver@@@Z @ 236 NONAME ; void CMceManager::SetInEventObserver(class MMceInEventObserver *) + ?SetInReferObserver@CMceManager@@QAEXPAVMMceInReferObserver@@@Z @ 237 NONAME ; void CMceManager::SetInReferObserver(class MMceInReferObserver *) + ?SetInSessionObserver@CMceManager@@QAEXPAVMMceInSessionObserver@@@Z @ 238 NONAME ; void CMceManager::SetInSessionObserver(class MMceInSessionObserver *) + ?SetKeepAliveDataL@CMceCodec@@QAEXABVTDesC8@@@Z @ 239 NONAME ; void CMceCodec::SetKeepAliveDataL(class TDesC8 const &) + ?SetKeepAlivePayloadTypeL@CMceCodec@@QAEXE@Z @ 240 NONAME ; void CMceCodec::SetKeepAlivePayloadTypeL(unsigned char) + ?SetKeepAliveTimerL@CMceCodec@@QAEXE@Z @ 241 NONAME ; void CMceCodec::SetKeepAliveTimerL(unsigned char) + ?SetLocalMediaPortL@CMceMediaStream@@QAEXI@Z @ 242 NONAME ; void CMceMediaStream::SetLocalMediaPortL(unsigned int) + ?SetMMFPriorityL@CMceCodec@@QAEXH@Z @ 243 NONAME ; void CMceCodec::SetMMFPriorityL(int) + ?SetMMFPriorityPreferenceL@CMceCodec@@QAEXH@Z @ 244 NONAME ; void CMceCodec::SetMMFPriorityPreferenceL(int) + ?SetMaxBitrateL@CMceAvcCodec@@UAEXI@Z @ 245 NONAME ; void CMceAvcCodec::SetMaxBitrateL(unsigned int) + ?SetMaxBitrateL@CMceH263Codec@@UAEXI@Z @ 246 NONAME ; void CMceH263Codec::SetMaxBitrateL(unsigned int) + ?SetMaxPTime@CMceAmrCodec@@UAEHI@Z @ 247 NONAME ; int CMceAmrCodec::SetMaxPTime(unsigned int) + ?SetMediaAttributeLinesL@CMceMediaStream@@QAEXPAVCDesC8Array@@@Z @ 248 NONAME ; void CMceMediaStream::SetMediaAttributeLinesL(class CDesC8Array *) + ?SetMediaObserver@CMceManager@@QAEXPAVMMceStreamObserver@@@Z @ 249 NONAME ; void CMceManager::SetMediaObserver(class MMceStreamObserver *) + ?SetModifierL@CMceSession@@QAEXKI@Z @ 250 NONAME ; void CMceSession::SetModifierL(unsigned long, unsigned int) + ?SetPTime@CMceAmrCodec@@UAEHI@Z @ 251 NONAME ; int CMceAmrCodec::SetPTime(unsigned int) + ?SetParameter@CSIPManagedProfile@@QAEHKABVMDesC8Array@@@Z @ 252 NONAME ; int CSIPManagedProfile::SetParameter(unsigned long, class MDesC8Array const &) + ?SetPayloadType@CMceAmrCodec@@UAEHE@Z @ 253 NONAME ; int CMceAmrCodec::SetPayloadType(unsigned char) + ?SetPayloadType@CMceAvcCodec@@UAEHE@Z @ 254 NONAME ; int CMceAvcCodec::SetPayloadType(unsigned char) + ?SetPayloadType@CMceH263Codec@@UAEHE@Z @ 255 NONAME ; int CMceH263Codec::SetPayloadType(unsigned char) + ?SetPositionL@CMceFileSource@@QAEXABVTTimeIntervalMicroSeconds@@@Z @ 256 NONAME ; void CMceFileSource::SetPositionL(class TTimeIntervalMicroSeconds const &) + ?SetPreferenceL@CMceCodec@@QAEXH@Z @ 257 NONAME ; void CMceCodec::SetPreferenceL(int) + ?SetPreferredEncodingDecodingDeviceL@CMceAvcCodec@@UAEXVTUid@@@Z @ 258 NONAME ; void CMceAvcCodec::SetPreferredEncodingDecodingDeviceL(class TUid) + ?SetPreferredEncodingDecodingDeviceL@CMceH263Codec@@UAEXVTUid@@@Z @ 259 NONAME ; void CMceH263Codec::SetPreferredEncodingDecodingDeviceL(class TUid) + ?SetPriorityL@CMceDisplaySink@@QAEXI@Z @ 260 NONAME ; void CMceDisplaySink::SetPriorityL(unsigned int) + ?SetReasonPhrase@TMceTransactionDataContainer@@QAEXPAVHBufC8@@@Z @ 261 NONAME ; void TMceTransactionDataContainer::SetReasonPhrase(class HBufC8 *) + ?SetReferObserver@CMceManager@@QAEXPAVMMceReferObserver@@@Z @ 262 NONAME ; void CMceManager::SetReferObserver(class MMceReferObserver *) + ?SetResolutionL@CMceAvcCodec@@UAEXVTSize@@@Z @ 263 NONAME ; void CMceAvcCodec::SetResolutionL(class TSize) + ?SetResolutionL@CMceH263Codec@@UAEXVTSize@@@Z @ 264 NONAME ; void CMceH263Codec::SetResolutionL(class TSize) + ?SetRotationL@CMceDisplaySink@@QAEXW4TRotation@1@@Z @ 265 NONAME ; void CMceDisplaySink::SetRotationL(enum CMceDisplaySink::TRotation) + ?SetRoutingL@CMceSpeakerSink@@QAEXH@Z @ 266 NONAME ; void CMceSpeakerSink::SetRoutingL(int) + ?SetRtpObserver@CMceManager@@QAEXPAVMMceRtpObserver@@@Z @ 267 NONAME ; void CMceManager::SetRtpObserver(class MMceRtpObserver *) + ?SetSamplingFreq@CMceAmrCodec@@UAEHI@Z @ 268 NONAME ; int CMceAmrCodec::SetSamplingFreq(unsigned int) + ?SetSessionObserver@CMceManager@@QAEXPAVMMceSessionObserver@@@Z @ 269 NONAME ; void CMceManager::SetSessionObserver(class MMceSessionObserver *) + ?SetSessionSDPLinesL@CMceSession@@QAEXPAVCDesC8Array@@@Z @ 270 NONAME ; void CMceSession::SetSessionSDPLinesL(class CDesC8Array *) + ?SetSourceL@CMceMediaStream@@QAEXPAVCMceMediaSource@@@Z @ 271 NONAME ; void CMceMediaStream::SetSourceL(class CMceMediaSource *) + ?SetStandByTimerL@CMceCodec@@QAEXK@Z @ 272 NONAME ; void CMceCodec::SetStandByTimerL(unsigned long) + ?SetStateL@CMceCodec@@QAEXW4TState@1@@Z @ 273 NONAME ; void CMceCodec::SetStateL(enum CMceCodec::TState) + ?SetStatusCode@TMceTransactionDataContainer@@QAEXH@Z @ 274 NONAME ; void TMceTransactionDataContainer::SetStatusCode(int) + ?SetVolumeL@CMceSpeakerSink@@QAEXH@Z @ 275 NONAME ; void CMceSpeakerSink::SetVolumeL(int) + ?SetWhiteBalanceL@CMceCameraSource@@QAEXW4TWhiteBalance@CCamera@@@Z @ 276 NONAME ; void CMceCameraSource::SetWhiteBalanceL(enum CCamera::TWhiteBalance) + ?SetZoomFactorL@CMceCameraSource@@QAEXH@Z @ 277 NONAME ; void CMceCameraSource::SetZoomFactorL(int) + ?Sinks@CMceMediaStream@@QBEABV?$RPointerArray@VCMceMediaSink@@@@XZ @ 278 NONAME ; class RPointerArray const & CMceMediaStream::Sinks(void) const + ?Source@CMceMediaStream@@QBEPAVCMceMediaSource@@XZ @ 279 NONAME ; class CMceMediaSource * CMceMediaStream::Source(void) const + ?Ssrc@CMceRtpSink@@QBEKXZ @ 280 NONAME ; unsigned long CMceRtpSink::Ssrc(void) const + ?Ssrc@CMceRtpSource@@QBEKXZ @ 281 NONAME ; unsigned long CMceRtpSource::Ssrc(void) const + ?Ssrcs@CMceRtpSource@@QBEABV?$RArray@I@@XZ @ 282 NONAME ; class RArray const & CMceRtpSource::Ssrcs(void) const + ?State@CMceCodec@@QBE?AW4TState@1@XZ @ 283 NONAME ; enum CMceCodec::TState CMceCodec::State(void) const + ?State@CMceMediaStream@@QBE?AW4TState@1@XZ @ 284 NONAME ; enum CMceMediaStream::TState CMceMediaStream::State(void) const + ?State@CMceSession@@QBE?AW4TState@1@XZ @ 285 NONAME ; enum CMceSession::TState CMceSession::State(void) const + ?Streams@CMceSession@@QBEABV?$RPointerArray@VCMceMediaStream@@@@XZ @ 286 NONAME ; class RPointerArray const & CMceSession::Streams(void) const + ?Streams@CMceStreamBundle@@QAEABV?$RPointerArray@VCMceMediaStream@@@@XZ @ 287 NONAME ; class RPointerArray const & CMceStreamBundle::Streams(void) + ?SupportedAudioCodecs@CMceManager@@QBEABV?$RPointerArray@$$CBVCMceAudioCodec@@@@XZ @ 288 NONAME ; class RPointerArray const & CMceManager::SupportedAudioCodecs(void) const + ?SupportedProfileTypesL@CSIPProfileRegistryBase@@QAEXAAV?$RArray@VTSIPProfileTypeInfo@@@@@Z @ 289 NONAME ; void CSIPProfileRegistryBase::SupportedProfileTypesL(class RArray &) + ?SupportedSecurityMechanismsL@CSIP@@QBEPAVCDesC8Array@@XZ @ 290 NONAME ; class CDesC8Array * CSIP::SupportedSecurityMechanismsL(void) const + ?SupportedVideoCodecs@CMceManager@@QBEABV?$RPointerArray@$$CBVCMceVideoCodec@@@@XZ @ 291 NONAME ; class RPointerArray const & CMceManager::SupportedVideoCodecs(void) const + ?SupportedVideoCodecs@CMceVideoStream@@QBEABV?$RPointerArray@$$CBVCMceVideoCodec@@@@XZ @ 292 NONAME ; class RPointerArray const & CMceVideoStream::SupportedVideoCodecs(void) const + ?TerminateL@CMceSession@@QAEXPAVCDesC8Array@@PAVHBufC8@@1@Z @ 293 NONAME ; void CMceSession::TerminateL(class CDesC8Array *, class HBufC8 *, class HBufC8 *) + ?TranscodeL@CMceFileSource@@QAEXABV?$TBuf@$0BAA@@@@Z @ 294 NONAME ; void CMceFileSource::TranscodeL(class TBuf<256> const &) + ?TranscodingProgressL@CMceFileSource@@QBEHXZ @ 295 NONAME ; int CMceFileSource::TranscodingProgressL(void) const + ?Type@CMceCodec@@QBEIXZ @ 296 NONAME ; unsigned int CMceCodec::Type(void) const + ?Type@CMceMediaSink@@QBEIXZ @ 297 NONAME ; unsigned int CMceMediaSink::Type(void) const + ?Type@CMceMediaSource@@QBEIXZ @ 298 NONAME ; unsigned int CMceMediaSource::Type(void) const + ?Type@CMceMediaStream@@QBEIXZ @ 299 NONAME ; unsigned int CMceMediaStream::Type(void) const + ?Type@CMceStreamBundle@@QBE?AW4TMceStreamBundleType@1@XZ @ 300 NONAME ; enum CMceStreamBundle::TMceStreamBundleType CMceStreamBundle::Type(void) const + ?Type@CSIPProfile@@QBEABVTSIPProfileTypeInfo@@XZ @ 301 NONAME ; class TSIPProfileTypeInfo const & CSIPProfile::Type(void) const + ?UpdateL@CMceFileSource@@QAEXABV?$TBuf@$0BAA@@@@Z @ 302 NONAME ; void CMceFileSource::UpdateL(class TBuf<256> const &) + ?UpdateL@CMceRtpSink@@QAEXHPAVHBufC8@@@Z @ 303 NONAME ; void CMceRtpSink::UpdateL(int, class HBufC8 *) + ?UpdateL@CMceRtpSource@@QAEXIIKPAVHBufC8@@@Z @ 304 NONAME ; void CMceRtpSource::UpdateL(unsigned int, unsigned int, unsigned long, class HBufC8 *) + ?UpdateL@CMceSession@@QAEXKPAVCDesC8Array@@PAVHBufC8@@10@Z @ 305 NONAME ; void CMceSession::UpdateL(unsigned long, class CDesC8Array *, class HBufC8 *, class HBufC8 *, class CDesC8Array *) + ?VolumeL@CMceSpeakerSink@@QBEHXZ @ 306 NONAME ; int CMceSpeakerSink::VolumeL(void) const + ?WhiteBalanceL@CMceCameraSource@@QAE?AW4TWhiteBalance@CCamera@@XZ @ 307 NONAME ; enum CCamera::TWhiteBalance CMceCameraSource::WhiteBalanceL(void) + ?ZoomFactorL@CMceCameraSource@@QAEHXZ @ 308 NONAME ; int CMceCameraSource::ZoomFactorL(void) + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/group/mceclient.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/group/mceclient.mmp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,91 @@ +/* +* Copyright (c) 2006-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: Definition of project MceClientStub +* +*/ + + +// To get the APP_LAYER_SYSTEMINCLUDE-definition +#include + +#include + +TARGET mceclient.dll +TARGETTYPE dll +UID 0x1000008d 0x00000111 // Experimental UID + +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE mcemanager.cpp +SOURCE mcesession.cpp +SOURCE mceoutsession.cpp +SOURCE mceinsession.cpp +SOURCE mcestreambundle.cpp +SOURCE mcemediastream.cpp +SOURCE mcevideostream.cpp +SOURCE mceaudiostream.cpp +SOURCE mcemediasource.cpp +SOURCE mcecamerasource.cpp +SOURCE mcefilesource.cpp +SOURCE mcefilesink.cpp +SOURCE mcertpsource.cpp +SOURCE mcemediasink.cpp +SOURCE mcedisplaysink.cpp +SOURCE mcertpsink.cpp +SOURCE mcespeakersink.cpp +SOURCE mcecodec.cpp +SOURCE mceaudiocodec.cpp +SOURCE mceamrcodec.cpp +SOURCE mcevideocodec.cpp +SOURCE mceh263codec.cpp +SOURCE mceavccodec.cpp +SOURCE mcetransactiondatacontainer.cpp +SOURCE staticdllentry.cpp + +SOURCEPATH ../../sipprofilestub/src +SOURCE sipprofileregistrybasestub.cpp +SOURCE sipprofileregistrystub.cpp +SOURCE sipprofilestub.cpp sipmanagedprofileregistrystub.cpp sipmanagedprofilestub.cpp sipstub.cpp + + +USERINCLUDE ../inc +USERINCLUDE ../../sipprofilestub/inc +USERINCLUDE ../../../../../../inc /Mush/inc + + +// to replace SIP profiles with a stub +SYSTEMINCLUDE ../../sipprofilestub/inc +SYSTEMINCLUDE /epoc32/include + +// Default system include paths for application layer modules. +APP_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY bafl.lib +LIBRARY ws32.lib +LIBRARY bitgdi.lib +LIBRARY fbscli.lib + + + +EXPORTUNFROZEN + +SOURCEPATH ../src +SOURCE mussessionsimulator.cpp +SOURCEPATH ../../sipprofilestub/src +SOURCE sipprofilealrcontroller.cpp +SOURCEPATH ../src +SOURCE mccscreen.cpp diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mccscreen.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mccscreen.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,105 @@ +/* +* 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: +* +*/ + + + +#ifndef MCCSCREEN_H +#define MCCSCREEN_H + +#include + +class CMccScreen : public CBase, + public MDirectScreenAccess + { + + public: + + // Construction & destruction + static CMccScreen* NewL( TPoint aPos, + TSize aArea, + TInt aIndex, + TInt aWindowOrdinalPosition, + TInt aWindowOrdinalPriority, + TSize aViewFinderImageSize ); + + ~CMccScreen(); + + void ConstructL( TSize aViewFinderImageSize ); + + public: + + void StartL(); + + void Stop(); + + void Draw( CFbsBitmap& aFrame ); + + void AttachFrameL( CFbsBitmap* aFrame ); + + void DetachFrame(); + + private: + + CMccScreen( TPoint aPos, + TSize aArea, + TInt aIndex, + TInt aWindowOrdinalPosition, + TInt aWindowOrdinalPriority ); + + void Restart( RDirectScreenAccess::TTerminationReasons aReason ); + + void AbortNow( RDirectScreenAccess::TTerminationReasons aReason ); + + TPoint UpdateViewFinderArea( TSize aViewFinderImageSize ); + + void DoDraw( CFbsBitmap& aFrame ); + + void DoScreenDeviceUpdate(); + + private: + + RWsSession iRwSession; + RWindowGroup* iRwGroup; + RWindow* iRw; + CWsScreenDevice* iDev; + TInt iDeviceIndex; + CDirectScreenAccess* iDirectScreenAccess; + CFbsBitGc* iGc; + RRegion* iRegion; + CFbsScreenDevice* iFbsDev; + + TPoint iPosition; + TSize iArea; + + TInt iWindowOrdinalPosition; + TInt iWindowOrdinalPriority; + + TRect iViewFinderImageRect; + + TBool iFirstImageDrawn; + + CFbsBitmap* iAttachedFrame; + + TBool iAborted; + + #ifdef TEST_EUNIT + friend class UT_CMccCameraHandler; + #endif + + }; + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mceamrcodec.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mceamrcodec.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,182 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef CMCEAMRCODEC_H +#define CMCEAMRCODEC_H + +// INCLUDES +#include +#include + +// CONSTANTS +const TInt KMceAmrNbBitrate475 = 4750; +const TInt KMceAmrNbBitrate515 = 5150; +const TInt KMceAmrNbBitrate590 = 5900; +const TInt KMceAmrNbBitrate670 = 6700; +const TInt KMceAmrNbBitrate740 = 7400; +const TInt KMceAmrNbBitrate795 = 7950; +const TInt KMceAmrNbBitrate102 = 10200; +const TInt KMceAmrNbBitrate122 = 12200; + +const TUint KMceAllowedAmrNbBitrate475 = 0x0001; +const TUint KMceAllowedAmrNbBitrate515 = 0x0002; +const TUint KMceAllowedAmrNbBitrate590 = 0x0004; +const TUint KMceAllowedAmrNbBitrate670 = 0x0008; +const TUint KMceAllowedAmrNbBitrate740 = 0x0010; +const TUint KMceAllowedAmrNbBitrate795 = 0x0020; +const TUint KMceAllowedAmrNbBitrate102 = 0x0040; +const TUint KMceAllowedAmrNbBitrate122 = 0x0080; +const TUint KMceAllowedAmrNbBitrateAll = 0x00FF; + +const TUint KMceAmrNbSamplingFreq = 8000; +const TUint KMceAmrWbSamplingFreq = 16000; + +const TUint KMceDefaultMaxPtime = 400; +const TUint KMceDefaultPtime = 20; + +// DATA TYPES +enum TAmrCodecMode + { + EMceBandwidthEfficient = 4, + EMceOctetAligned + }; + +// CLASS DECLARATION + +/** +* Class for the AMR codec information. +* +* It checks the validity of inserted values for AMR. +* +* @lib mceclient.lib +*/ +class CMceAmrCodec : public CMceAudioCodec + { + public: // Constructors and destructor + + /** + * Destructor. + */ + IMPORT_C ~CMceAmrCodec(); + + public: // From base class + + /** + * Enable / Disable Voice Activity Detection. + * @param aEnableVAD, Boolean indicating whether to enable Voice Activity Detection + * @return KErrNotSupported if codec doesn't support VAD; otherwise KErrNone. + */ + IMPORT_C TInt EnableVAD(TBool aEnableVAD); + + /** + * Sets bitrate used with codec for encoding. + * @param aBitrate, bitrate value for encoding + * @return KErrNotSupported if codec doesn't support bitrate value issued; otherwise KErrNone. + */ + IMPORT_C TInt SetBitrate(TUint aBitrate); + + /** + * Sets bitrates allowed with codec. + * @param aBitrates, allowed bitrate values (like KMceAmrNbBitrate590|KMceAmrNbBitrate670) + * @return KErrNotSupported if codec doesn't support bitrate value issued; otherwise KErrNone. + */ + IMPORT_C TInt SetAllowedBitrates(TUint aBitrates); + + /** + * Sets the sampling frequency. + * @param aSamplingFreq, Sampling frequency to be used + * @return KErrNotSupported if codec doesn't support sampling frequency issued; otherwise KErrNone. + */ + IMPORT_C TInt SetSamplingFreq(TUint aSamplingFreq); + + /** + * Sets the packetization rate. + * @param aPTime, Packetization rate, must be multiple of audio frame size. + * @return KErrNotSupported if codec doesn't support packetrate value issued; otherwise KErrNone. + */ + IMPORT_C TInt SetPTime(TUint aPTime); + + /** + * Sets the maximum packetization rate. + * @param aMaxPTime, maximum allowed packetization rate, must be multiple of audio frame size. + * @return KErrNotSupported if codec doesn't support packetrate value issued; otherwise KErrNone. + */ + IMPORT_C TInt SetMaxPTime(TUint aMaxPTime); + + /** + * Sets the payload type identifier. + * @param aPayloadType payload type identifier. + * @return One of the standard system-wide error codes. + */ + IMPORT_C TInt SetPayloadType(TUint8 aPayloadType); + + /** + * Sets the codec mode. + * @param aCodecMode Codec mode ( Bandwidth efficient / octet aligned ) + * @return KErrNotSupported if codec doesnt' support codec mode value issued; otherwise KErrNone. + */ + IMPORT_C TInt SetCodecMode(TUint aCodecMode); + + /** + * Clones codec, ownership is transferred. + * @return cloned codec + */ + IMPORT_C CMceAudioCodec* CloneL() const; + + public: + + /** + * Two-phased constructor. + * @param aSdpName sdp name + */ + static CMceAmrCodec* NewL( TBuf8 aSdpName); + + /** + * Two-phased constructor. + * @param aSdpName sdp name + */ + static CMceAmrCodec* NewLC(TBuf8 aSdpName); + + + private: + + /** + * C++ default constructor. + */ + CMceAmrCodec(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL( TBuf8 aSdpName); + + /** + * Sets the sdp name. + * @param aSdpName the sdp name + */ + void SetSdpNameL( const TDesC8& aSdpName ); + + //for testing + + MCE_UNIT_TEST_DEFS + }; + + +#endif + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mceaudiocodec.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mceaudiocodec.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,161 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef CMCEAUDIOCODEC_H +#define CMCEAUDIOCODEC_H + +// INCLUDES +#include +#include +#include + +// FORWARD DECLARATIONS +class RReadStream; +class RWriteStream; +class CMceComAudioCodec; +class CMceMediaStream; +class TMceIds; +class TMceEvent; +class TMceMediaId; +class TMceFactory; +class TMceAudioCodecFactory; + +// CLASS DECLARATION + +/** +* Container class for audio codecs. +* +* It defines attributes that can be set and get from audio codec. +* These attributes are used in single audio stream and they +* are negotiated with remote terminal. +* +* @lib mceclient.lib +*/ +class CMceAudioCodec : public CMceCodec + { + public: // Constructors and destructor + + /** + * Destructor. + */ + virtual ~CMceAudioCodec(); + + public: // New functions + + /** + * Enable / Disable Voice Activity Detection. + * @param aEnableVAD, Boolean indicating whether to enable Voice Activity Detection + * @return KErrNotSupported if codec doesn't support VAD; otherwise KErrNone. + */ + virtual TInt EnableVAD(TBool aEnableVAD) = 0; + + /** + * Sets the sampling frequency. + * @param aSamplingFreq, Sampling frequency to be used + * @return KErrNotSupported if codec doesn't support sampling frequency issued; otherwise KErrNone. + */ + virtual TInt SetSamplingFreq(TUint aSamplingFreq) = 0; + + /** + * Sets the packetization rate. + * @param aPTime, Packetization rate, must be multiple of audio frame size. + * @return KErrNotSupported if codec doesn't support packetrate value issued; otherwise KErrNone. + */ + virtual TInt SetPTime(TUint aPTime) = 0; + + /** + * Sets the maximum packetization rate. + * @param aMaxPTime, maximum allowed packetization rate, must be multiple of audio frame size. + * @return KErrNotSupported if codec doesn't support packetrate value issued; otherwise KErrNone. + */ + virtual TInt SetMaxPTime(TUint aMaxPTime) = 0; + + /** + * Clones codec, ownership is transferred. + * @return cloned codec + */ + virtual CMceAudioCodec* CloneL() const = 0; + + /** + * Gets sampling frequency used currently. + * @return Sampling frequency + */ + virtual TUint SamplingFreq() const; + + /** + * Get VAD status. + * @return Boolean indicating is VAD activated + */ + virtual TBool VAD() const; + + /** + * Gets the packetization rate. + * @return packetization rate. + */ + virtual TUint PTime() const; + + /** + * Gets max packetization rate. + * @return Max packetization rate. + */ + virtual TUint MaxPTime() const; + + public: + + /** + * Initializes + * @param aParent the parent + */ + virtual void InitializeL( CMceMediaStream& aParent ); + + + protected: // New functions + + /** + * C++ default constructor. + */ + CMceAudioCodec(); + + + public: // stub data + + /** + * Enables or disables VAD + */ + TBool iEnableVAD; + + /** + * Sampling frequency used with codec + */ + TUint iSamplingFreq; + + /** + * Stream's packet time + */ + TUint iPTime; + + /** + * Stream's max packet time + */ + TUint iMaxPTime; + }; + + +#endif + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mceaudiostream.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mceaudiostream.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,122 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef CMCEAUDIOSTREAM_H +#define CMCEAUDIOSTREAM_H + +// INCLUDES +#include +#include + +// CONSTANTS +const TMceMediaType KMceAudio = 1; + +// FORWARD DECLARATIONS +class CMceAudioCodec; + +// CLASS DECLARATION + +/** +* Class for representing unidirectional audio stream. +* +* It defines the used audio codecs for the stream. +* In order to be complete structure, at least one codec is required. +* +* @lib mceclient.lib +*/ +class CMceAudioStream: public CMceMediaStream + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CMceAudioStream* NewL(); + + /** + * Two-phased constructor. + */ + IMPORT_C static CMceAudioStream* NewLC(); + + /** + * Destructor. + */ + IMPORT_C ~CMceAudioStream(); + + public: // Functions + + /** + * Returns the available codecs to the session. + * For CMEOutSession, array contains all codecs supported by + * terminal in default. For CMEInSession, array contains codecs + * that were offered by remote terminal, and supported by local terminal. + * @return codecs available for the session. + */ + IMPORT_C const RPointerArray& Codecs(); + + /** + * Adds codec to the stream, ownership is transferred. + * @param aCodec codec added to the stream + */ + IMPORT_C void AddCodecL( CMceAudioCodec* aCodec ); + + /** + * Removes codec from the stream + * @param aCodec codec removed from stream + */ + IMPORT_C void RemoveCodecL( CMceAudioCodec& aCodec ); + + + public: //from CMceMediaStream + + /** + * Initializes + * @param aParent the parent + */ + void InitializeL( CMceSession& aParent ); + + /** + * Initializes + * @param aManager the manager. Ownership is NOT transferred + */ + void InitializeL( CMceManager* aManager ); + + + private: //methods + + /** + * C++ default constructor. + */ + CMceAudioStream(); + + /** + * Second-phase constructor. + */ + void ConstructL(); + + + private: // Owned data + + /** + * codecs + */ + RPointerArray iCodecs; + + }; + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mceavccodec.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mceavccodec.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,243 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef MCEAVCCODEC_H +#define MCEAVCCODEC_H + +// INCLUDES +#include +#include + +// CONSTANTS + +const TUint KMceAvcClockRate = 90000; + +// Allowedbitrates bitfield combines avc profile-level-id information in +// similar manner as defined in RFC 3984. Most significant byte stores +// profile-id value, seconds significant byte contains profile-iop value and +// last two bytes contain profile-level information. +// +const TUint KMceAvcBitrateLevel1 = 0x0001; +const TUint KMceAvcBitrateLevel1b = 0x0002; +const TUint KMceAvcBitrateLevel1_1 = 0x0004; +const TUint KMceAvcBitrateLevel1_2 = 0x0008; +const TUint KMceAvcBitrateLevel1_3 = 0x0010; +const TUint KMceAvcBitrateLevel2 = 0x0020; + +const TUint KMceAvcCodecProfileIopConstraintSet = 0x0100; +const TUint KMceAvcCodecProfileIopConstraintSet1 = 0x0200; +const TUint KMceAvcCodecProfileIopConstraintSet2 = 0x0400; + +const TUint KMceAvcCodecProfileIdBaseline = 0x1000; +const TUint KMceAvcCodecProfileIdMain = 0x2000; +const TUint KMceAvcCodecProfileIdExtended = 0x4000; +const TUint KMceAvcCodecProfileIdHigh = 0x8000; + +const TUint KMceAllowedAvcBitrateAll = 0x00FF; + +// Different framerates may be supported depending on profile level. +// +const TUint KMceAvcFrameRate7_5 = 0x0001; +const TUint KMceAvcFrameRate12_5 = 0x0002; +const TUint KMceAvcFrameRate15 = 0x0004; +const TUint KMceAvcFrameRate30 = 0x0008; +const TUint KMceAvcFrameRate36 = 0x0010; + +const TUint KMceAllowedAvcFrameRateAll = 0x00FF; + +// Different resolutions may be supported depending on profile level. +// +const TUint KMceAvcResolution176x144 = 0x0001; +const TUint KMceAvcResolution320x240 = 0x0002; +const TUint KMceAvcResolution352x288 = 0x0004; + +const TUint KMceAllowedAvcResolutionAll = 0x000F; + + +// DATA TYPES +enum TAvcCodecMode + { + KMceAvcModeSingleNal, + KMceAvcModeNonInterleaved, + KMceAvcModeInterleaved + }; + + +// CLASS DECLARATION + +/** +* Class for the H264 codec information. +* +* It checks the validity of inserted values for H264 +* +* @lib mceclient.lib +*/ +class CMceAvcCodec : public CMceVideoCodec + { + + public: // Constructors and destructor + + /** + * Destructor. + */ + IMPORT_C ~CMceAvcCodec(); + + public: + + /** + * Two-phased constructor. + * @param aSdpName sdp name + */ + IMPORT_C static CMceAvcCodec* NewL( TBuf8 aSdpName); + + /** + * Two-phased constructor. + * @param aSdpName sdp name + */ + IMPORT_C static CMceAvcCodec* NewLC( TBuf8 aSdpName ); + + public: // From base classes + + /** + * Sets bitrate used with codec for encoding. + * @param aBitrate bitrate value for encoding + * @return KErrNotSupported if codec doesn't support bitrate + * value issued + */ + virtual TInt SetBitrate( TUint aBitrate ); + + /** + * Sets bitrates allowed with codec. + * @param aBitrates allowed bitrate values + * @return KErrNotSupported if codec doesn't support bitrate + * values issued + */ + virtual TInt SetAllowedBitrates( TUint aBitrates ); + + /** + * Sets the codec specific mode. + * @param aCodecMode mode of the codec + * @return KErrNotSupported if codec doesnt' support codec mode + * value issued + */ + virtual TInt SetCodecMode( TUint aCodecMode ); + + /** + * Sets the payload type. + * @param aPayloadType type identifier of the payload + * @return KErrNotSupported if codec doesn't support payload type issued + */ + virtual TInt SetPayloadType( TUint8 aPayloadType ); + + /** + * Clones the codec. + * @return cloned codec; ownership is transferred + */ + virtual CMceVideoCodec* CloneL() const; + + /** + * Sets maximum bitrate of the codec. + * @param aMaxBitrate value of maximum bitrate used for encoding + * @leave KErrNotSupported if codec doesn't support frame sizes issued + */ + virtual void SetMaxBitrateL( TUint aMaxBitrate ); + + /** + * Sets resolutions allowed with the codec. + * @param aResolutions bitfield of allowed resolutions + * @leave KErrNotSupported if codec doesn't support resolutions issued + */ + virtual void SetAllowedResolutionsL( TUint aResolutions ); + + /** + * Sets resolution of the video. + * @param aResolution resolution of the video in pixels + * @leave KErrNotSupported if codec doesn't support resolution issued + */ + virtual void SetResolutionL( TSize aResolution ); + + /** + * Sets frame rates allowed with the codec. + * @param aFrameRates allowed frame rate values as a bitfield + * @leave KErrNotSupported if codec doesn't support frame rates issued + */ + virtual void SetAllowedFrameRatesL( TUint aFrameRates ); + + /** + * Sets frame rate used with the codec for encoding. + * @param aFrameRate frame rate for encoding + * @leave KErrNotSupported if codec doesn't support frame rate value + * issued + */ + virtual void SetFrameRateL( TReal aFrameRate ); + + /** + * Sets preferred encoding device for uplink stream and preferred decoding + * device for downlink stream. + * @param aEncodingDecodingDevice + * @leave KErrNotSupported if setting preferred device is not possible + */ + virtual void SetPreferredEncodingDecodingDeviceL( + TUid aEncodingDecodingDevice ); + + /** + * Set config key (sprop-parameter-sets) + * @param aConfigKey, config key as Base64 encoded + * @leave KErrNotSupported if setting config key is not possible + */ + virtual void SetConfigKeyL( const TDesC8& aConfigKey ); + + + private: // Helper functions + + /** + * Sets the sdp name. + * @param aSdpName the sdp name + */ + void SetSdpNameL( const TDesC8& aSdpName ); + + private: // Constructors + + /** + * C++ default constructor. + */ + CMceAvcCodec(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL( TBuf8 aSdpName); + + + public: // Stub data + + TUint8 iPacketizationMode; + + TUint8 iAllowedPacketizationModes; + + + //for testing + + MCE_UNIT_TEST_DEFS + + }; + + +#endif + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mcecamerasource.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mcecamerasource.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,248 @@ +/* +* 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: +* +*/ + + +#ifndef MCECAMERASOURCE_H +#define MCECAMERASOURCE_H + +// INCLUDES +#include +#include +#include "mcemediasource.h" + +// CONSTANTS +const TMceSourceType KMceCameraSource = 3; + +//FORWARD DECLARATIONS +class CMceManager; +class CMceItcSender; + +// CLASS DECLARATION + +/** +* Class representing camera in MCE. +* +* CMceCameraSource can be used to record video from camera. +* +* Enable (continue) and Disable (pause) operations to it are considered +* to be local, so they are not signalled to remote terminal. +* +* In common situation camera source is combined with display sink which acts +* as a viewfinder for the camera. +* +* @lib mceclient.lib +*/ +class CMceCameraSource : public CMceMediaSource + { + friend class UT_CMusEngLiveSession; + friend class UT_CMusEngTwoWaySession; + friend class UT_TMusEngCameraHandler; + + public: // Constructors and destructor + + /** + * Two-phased constructor. + * @param aManager reference to the manager + */ + IMPORT_C static CMceCameraSource* NewL( CMceManager& aManager ); + + /** + * Two-phased constructor. + * @param aManager reference to the manager + */ + IMPORT_C static CMceCameraSource* NewLC( CMceManager& aManager ); + + /// Not in the real implementation + IMPORT_C static CMceCameraSource* NewL(); + + /// Not in the real implementation + IMPORT_C static CMceCameraSource* NewLC(); + + /** + * Destructor. + */ + IMPORT_C ~CMceCameraSource(); + + public: // From CMceMediaSource + + /** + * Enables the source explicitly. + */ + IMPORT_C void EnableL(); + + /** + * Disables the source explicitly. + */ + IMPORT_C void DisableL(); + + public: // New functions + + /** + * Gets the number of cameras on the device. + * @return number of available cameras + */ + IMPORT_C TInt CamerasAvailable() const; + + /** + * Sets index of physical camera to be used. + * @param aCameraIndex, index of the camera to be used; First camera has + * index 0 and number of available cameras can be retrieved by + * calling CMceCameraSource::CamerasAvailable + */ + IMPORT_C void SetCameraIndexL( TInt aCameraIndex ); + + /** + * Gets information about the camera device. + * @param aInfo on return information about the camera device + */ + IMPORT_C void GetCameraInfo( TCameraInfo& aInfo ) const; + + /** + * Sets the zoom factor. + * This must be in the range of TCameraInfo::iMinZoom to + * TCameraInfo::iMaxZoom inclusive. + * @param aZoomFactor required zoom factor + * @leave KErrArgument if the specified zoom factor is out of range + */ + IMPORT_C void SetZoomFactorL( TInt aZoomFactor ); + + /** + * Gets the currently set zoom factor. + * @return current zoom factor + */ + IMPORT_C TInt ZoomFactorL(); + + /** + * Sets the digital zoom factor. + * This must be in the range of 0 to TCameraInfo::iMaxDigitalZoom + * inclusive. + * @param aDigitalZoomFactor The required digital zoom factor + * @leave KErrArgument if the zoom factor is out of range + */ + IMPORT_C void SetDigitalZoomFactorL( TInt aDigitalZoomFactor ); + + /** + * Gets the currently set digital zoom factor. + * @return current digital zoom factor + */ + IMPORT_C TInt DigitalZoomFactorL(); + + /** + * Sets the contrast adjustment of the device. + * @param aContrast required contrast value; This must be in the + * range of -100 to +100 or CCamera::EContrastAuto. + * @leave KErrNotSupported if contrast adjustment is not supported, + * see TCameraInfo::TOptions + * @leave KErrArgument if the specified contrast value is out of + * range + */ + IMPORT_C void SetContrastL( TInt aContrast ); + + /** + * Gets the current contrast value. + * @return current contrast value + */ + IMPORT_C TInt ContrastL(); + + /** + * Sets the brightness adjustment of the device. + * No effect if this is not supported, see TCameraInfo::TOptions. + * + * @param aBrightness required brightness adjustment; This must be + * in the range of -100 to +100 or CCamera::EBrightnessAuto + * @leave KErrNotSupported if brightness adjustment is not supported, + * see TCameraInfo::TOptions + * @leave KErrArgument if the brightness adjustment is out of range + */ + IMPORT_C void SetBrightnessL( TInt aBrightness ); + + /** + * Gets the currently set brightness adjustment value. + * @return current brightness adjustment value + */ + IMPORT_C TInt BrightnessL(); + + /** + * Sets the exposure adjustment of the device. + * @param aExposure required exposure adjustment + * @leave KErrNotSupported if the specified exposure adjustment is + * not supported, see CameraInfo::iExposureModesSupported + */ + IMPORT_C void SetExposureL( CCamera::TExposure aExposure ); + + /** + * Gets the currently set exposure setting value. + * @return current exposure setting value + */ + IMPORT_C CCamera::TExposure ExposureL(); + + /** + * Sets the white balance adjustment of the device. + * @param aWhiteBalance required white balance adjustment + * @leave KErrNotSupported if the specified white balance adjustment is + * not supported, see TCameraInfo::iWhiteBalanceModesSupported + */ + IMPORT_C void SetWhiteBalanceL( CCamera::TWhiteBalance aWhiteBalance ); + + /** + * Gets the currently set white balance adjustment value. + * @return current white balance adjustment value + */ + IMPORT_C CCamera::TWhiteBalance WhiteBalanceL(); + + public: // internal + + /** + * Initializes + * @param aManager the manager. Ownership is NOT transferred + */ + void InitializeL( CMceManager* aManager ); + + private: + + /** + * C++ constructor. + */ + CMceCameraSource(); + + private: // Owned data + + TCameraInfo iCameraInfo; + + private: // Not owned data + + //CMceManager* iManager; + + private: // Reserved for future use + + TAny* iReserved; + + + public: // stub data + + TInt iCameraIndex; + TInt iCameraCount; + TInt iZoomFactor; + TInt iDigitalZoomFactor; + TInt iContrast; + TInt iBrightness; + TInt iExposure; + TInt iWhiteBalance; + + }; + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mcecodec.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mcecodec.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,412 @@ +/* +* 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: +* +*/ + + +#ifndef MCECODEC_H +#define MCECODEC_H + +// INCLUDES +#include +#include "mcedefs.h" + +// FORWARD DECLARATIONS +class RReadStream; +class RWriteStream; +class CMceComCodec; + +class CMceMediaStream; +class TMceEvent; +class TMceMediaId; +class TMceFactory; + +// DATA TYPES +typedef TUint TMceCodecType; + + +// CLASS DECLARATION + +/** +* Base class for codecs. +* +* It defines setters and getters for generic codec attributes. +* +* In some systems certain device resources cannot be shared. For example +* speaker of the device might not be able to play simultaneously several +* differently encoded audio streams. Or only one client at the time +* could use the camera of the device. Codec states can be used to overcome +* situations where single codec would occupy some resource for excessive +* period of time or permanently. +* +* Codec can be in one of the three states: +* +* When codec is in state EEnabled, resources, associated with the codec, +* are reserved for the codec and in some cases cannot be used by other +* software components. Precondition for reserving resources for the codec +* is that associated device resource (e.g. speaker sink of downlink or +* camera source of uplink) is also enabled. +* +* When codec is in state EStandby, resources are not reserved for the codec +* and therefore can be used by other software components. If the stream +* (uplink or downlink), into which this codec is attached, encounters data +* encoded with the codec, codec in state EStandby is tried to be enabled. +* If enabling succeeds, codec state changes to EEnabled and associated +* resources are reserved. +* +* When codec is in state EDisabled, resources are not reserved for the codec +* and are not even tried to be reserved. +* +* @lib mceclient.lib +*/ +class CMceCodec : public CBase + { + + public: // Codec states + + enum TState + { + EDisabled, + EStandby, + EEnabled + }; + + public: // Constructors and destructor + + /** + * Destructor. + */ + virtual ~CMceCodec(); + + public: // New functions + + /** + * Sets bitrate used with codec for encoding. + * @param aBitrate bitrate value for encoding + * @return KErrNotSupported if codec doesn't support bitrate + * value issued + */ + virtual TInt SetBitrate( TUint aBitrate ) = 0; + + /** + * Sets bitrates allowed with codec. + * @param aBitrates allowed bitrate values + * @return KErrNotSupported if codec doesn't support bitrate + * values issued + */ + virtual TInt SetAllowedBitrates( TUint aBitrates ) = 0; + + /** + * Sets the codec specific mode. + * @param aCodecMode mode of the codec + * @return KErrNotSupported if codec doesnt' support codec mode + * value issued + */ + virtual TInt SetCodecMode( TUint aCodecMode ) = 0; + + /** + * Sets the payload type. + * @param aPayloadType type identifier of the payload + * @return KErrNotSupported if codec doesn't support payload type issued + */ + virtual TInt SetPayloadType( TUint8 aPayloadType ) = 0; + + + public: // New functions + + /** + * Sets the state of the codec. + * @param aState desired codec state + */ + IMPORT_C void SetStateL( CMceCodec::TState aState ); + + /** + * Sets the timer period in seconds from starting of inactivity + * to automatically changing to state CMceCodec::EStandby . + * @param aTimerValue timer period in seconds + */ + IMPORT_C void SetStandByTimerL( TUint32 aTimerValue ); + + /** + * Sets MMF priority value for the codec. + * @param aPriority priority of the codec + */ + IMPORT_C void SetMMFPriorityL( TInt aPriority ); + + /** + * Sets MMF priority preference value for the codec. + * @param aPriorityPreference priority preference of the codec + */ + IMPORT_C void SetMMFPriorityPreferenceL( TInt aPriorityPreference ); + + /** + * Set keep alive packets send timer value. + * @param aTimerValue timer value in ms for keep alive packets + * @return One of the standard system-wide error codes. + */ + IMPORT_C void SetKeepAliveTimerL( TUint8 aTimerValue ); + + /** + * Set keep alive packets payload type. + * @param aKeepAlivePT payload type for keep alive packets + * @return One of the standard system-wide error codes. + */ + IMPORT_C void SetKeepAlivePayloadTypeL( TUint8 aKeepAlivePT ); + + /** + * Set keep alive packets payload data. + * @param aData payload data for keep alive packets + * @return One of the standard system-wide error codes. + */ + IMPORT_C void SetKeepAliveDataL( const TDesC8& aData ); + + + public: // Getters + + /** + * Gets the state of the codec + * @return state of the codec + */ + IMPORT_C CMceCodec::TState State() const; + + /** + * Media id of the codec. + * @return media id + */ + //IMPORT_C TMceMediaId Id() const; + + /** + * Type of the codec + * @return codec type + */ + IMPORT_C TMceCodecType Type() const; + + /** + * Gets codec fourCC. + * @return fourCC value + */ + IMPORT_C TUint32 FourCC() const; + + /** + * Gets current bitrate. + * @return bitrate value + */ + IMPORT_C TUint Bitrate() const; + + /** + * Gets allowed bitrate values. + * @return bitrate values + */ + IMPORT_C TUint AllowedBitrates() const; + + /** + * Gets current frame size of the codec. + * @return size of single frame used by the codec + */ + IMPORT_C TUint FrameSize() const; + + /** + * Gets the codec mode. + * @return codec mode + */ + IMPORT_C TUint CodecMode() const; + + /** + * Gets the payload type identifier. + * @return payload type used + */ + IMPORT_C TUint8 PayloadType() const; + + /** + * Gets the sdp name. + * @return sdp name of the codec + */ + IMPORT_C const TDesC8& SdpName() const; + + /** + * Gets MMF priority + * @return MMF priority + */ + IMPORT_C TInt MMFPriority() const; + + /** + * Gets MMF priority preference + * @return current MMFPriorityPreference + */ + IMPORT_C TInt MMFPriorityPreference() const; + + /** + * Gets keep alive packets send timer value. + * @return keep alive packets send timer value (ms). + */ + IMPORT_C TUint8 KeepAliveTimer() const; + + /** + * Gets keep alive packets payload type. + * @return keep alive packets payload type. + */ + IMPORT_C TUint8 KeepAlivePayloadType() const; + + /** + * Gets keep alive packets payload data. + * @return keep alive packets payload data. + */ + IMPORT_C const TDesC8& KeepAliveData() const; + + + public: // Preference manipulation + + /** + * Gets the preference value. + * @return preference value of the codec + */ + IMPORT_C TInt Preference() const; + + /** + * Sets the preference value used in media negotiation. + * Codec with preference value 0 is considered as the most preferenced + * codec. Preference of codecs with the same preference value is + * determined by order they were added to the stream. + * @param aPreference preference value of the codec + */ + IMPORT_C void SetPreferenceL( TInt aPeference ); + + + public: // Internal + + /** + * Initializes the codec. + * @param aParent the parent + */ + virtual void InitializeL( CMceMediaStream& aParent ); + + + + protected: // New functions + + /** + * Sets the sdp name. + * @param aSdpName sdp name for the codec + */ + virtual void SetSdpNameL( const TDesC8& aSdpName ) = 0; + + /** + * C++ default constructor. + */ + CMceCodec(); + + protected: // Data + + /** + * Codec type. + */ + TMceCodecType iType; + + protected: // NOT owned data + + /** + * Parent stream, not owned. + */ + CMceMediaStream* iStream; + + private: // Reserved for future use + + TAny* iReserved; + + public: // stub data + + /** + * type of session + */ + //TMceMediaId iID; + + /** + * Fmtp attribute + */ + HBufC8* iFmtpAttr; + + /** + * Sdp name used in SDP messages + */ + TBuf8 iSdpName; + + /** + * Payload type + */ + TUint8 iPayloadType; + + /** + * Is enabled + */ + TBool iIsEnabled; + + /** + * Stream's bit rate + */ + TUint iBitrate; + + /** + * Stream's allowed bit rates + */ + TUint32 iAllowedBitrates; + + /** + * Codec mode ( e.g. PCMU, PCMA, Bandwidth efficient, octet aligned ) + */ + TUint32 iCodecMode; + + /** + * Codec FourCC + */ + TUint32 iFourCC; + + /** + * Codecs frame size + */ + TUint iFrameSize; + + /** + * + */ + TInt iMMFPriority; + + /** + * + */ + TInt iMMFPriorityPreference; + + /** + * + */ + TUint8 iKeepAliveTimer; + + /** + * Codecs frame size + */ + TUint8 iKeepAlivePayloadType; + + /** + * + */ + TBuf8<10> iKeepAliveData; + + TInt iPreference; + + }; + + +#endif + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mcedefs.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mcedefs.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,97 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef MCEDEFS_H +#define MCEDEFS_H + +#include + +const TInt KMceMaxSdpNameLength = 20; +const TUint8 KMceMaxPacketrate = 10; +const TInt KMcePTimeFactor = 1000; + +const TInt KMceMaxSizeInReadStream = 1000; +const TInt KMceExternalizeBufferExpandSize = 100; +const TInt KMceArrayGranularity = 5; + + +_LIT8( KMceSDPNamePCMU, "PCMU" ); +_LIT8( KMceSDPNamePCMA, "PCMA" ); +_LIT8( KMceSDPNameAMR, "AMR" ); + +_LIT8( KMceSDPNameH263, "H263" ); +_LIT8( KMceSDPNameH2632000, "H263-2000" ); +_LIT8( KMceSDPNameH2631998, "H263-1998" ); +_LIT8( KMceSDPNameH264, "H264" ); + +typedef TInt TMceReturnStatus; +const TMceReturnStatus KMceAsync = 1; +const TMceReturnStatus KMceReady = 0; + +// SESSION MODIFIERS + +/** +* Data type for session modifiers. +*/ +typedef TUint32 TMceSessionModifier; + + +/** +* Usage of QOS preconditions within session; +* This modifier can be set only when session is in state MceSession::EIdle. +* By default, session is in preconditions supported mode. +* +* KMcePreconditionsNotUsed indicates that preconditions are not used. +* KMcePreconditionsSupported indicates that preconditions are supported +*/ +// KEY +const TMceSessionModifier KMcePreconditions = 0; +// VALUES +const TUint KMcePreconditionsNotUsed = 0; +const TUint KMcePreconditionsSupported = 1; + +/** +* Usage of reliable provisional responses (aka 100rel) within session. +* This modifier can be set only when session is in state MceSession::EIdle +* or MceSession::EIncoming. +* By default, session is in 100rel supported mode. +* +* KMce100RelNotUsed indicates that 100rel is not used. +* KMce100RelSupported indicates that 100rel is supported. +* KMce100RelRequired indicates that 100rel is required. +*/ +// KEY +const TMceSessionModifier KMce100Rel = 1; +// VALUES +const TUint KMce100RelNotUsed = 0; +const TUint KMce100RelSupported = 1; +const TUint KMce100RelRequired = 2; + + + +#ifdef __MWERKS__ +#pragma warn_emptydecl off +#endif + +#ifdef MCE_UNIT_TEST +#include "mcetestdefs.h" +#else +#define MCE_UNIT_TEST_DEFS +#endif + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mcedisplaysink.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mcedisplaysink.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,197 @@ +/* +* 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: +* +*/ + + +#ifndef MCEDISPLAYSINK_H +#define MCEDISPLAYSINK_H + +// INCLUDES +#include "mcemediasink.h" + +// FORWARD DECLARATIONS +class CMceManager; +class RWindow; +class CWindowGc; +class CMccScreen; + +// DATA TYPES +const TMceSinkType KMceDisplaySink = 3; + + +// CLASS DECLARATION + +/** +* Class representing display in MCE. +* +* CMceDisplaySink can be used to show video on screen or as a viewfinder +* of the camera. +* +* Enable and Disable operations to it are considered to be local, +* so they are not signalled to remote terminal. +* +* @lib mceclient.lib +*/ +class CMceDisplaySink : public CMceMediaSink + { + + public: + + enum TRotation + { + ENone, + EClockwise90Degree, + EClockwise180Degree, + EClockwise270Degree + }; + + public: // Constructors and destructor + + /** + * Two-phased constructor. + * @param aManager reference to the manager + */ + IMPORT_C static CMceDisplaySink* NewL( CMceManager& aManager ); + + /** + * Two-phased constructor. + * @param aManager reference to the manager + */ + IMPORT_C static CMceDisplaySink* NewLC( CMceManager& aManager ); + + /// Not in the real implementation + IMPORT_C static CMceDisplaySink* NewL(); + + /// Not in the real implementation + IMPORT_C static CMceDisplaySink* NewLC(); + + /** + * Destructor. + */ + IMPORT_C ~CMceDisplaySink(); + + + public: // From CMceMediaSink + + /** + * Enables the sink explicitly. + */ + IMPORT_C void EnableL(); + + /** + * Disables the sink explicitly. + */ + IMPORT_C void DisableL(); + + + public: // New functions + + /** + * Gets the number of available displays on the device. + * @return number of available displays + */ + IMPORT_C TInt DisplaysAvailable() const; + + /** + * Sets index of physical display to be used. + * @param aDisplayIndex, index of the display to be used; number of + * available displays can be retrieved by calling + * CMceDisplaySink::DisplaysAvailable + * @leave KErrNotSupported if requested display cannot be used + */ + IMPORT_C void SetDisplayIndexL( TInt aDisplayIndex ); + + /** + * Sets display resources. + * @param aWindow handle to the display window of the user + * @param aGc graphics context of the user + */ + IMPORT_C void SetDisplay( RWindow& aWindow, CWindowGc& aGc ); + + /** + * Sets display rectangle. Display data is drawn to the given area. + * @param aRect display area + */ + IMPORT_C void SetDisplayRectL( const TRect& aRect ); + + /** + * Gets current display rectagle. + * @return current display rectangle + */ + IMPORT_C const TRect DisplayRectL(); + + /* + * Sets display sink priority. Priority value 0 is the highest priority. + * Display sink with higher priority draws over less priority display + * if display rectangles overlap. + * @param aPriority priority value + */ + IMPORT_C void SetPriorityL( TUint aPriority ); + + /* + * Display sink's current priority. + * @return priority value + */ + IMPORT_C TUint PriorityL(); + + /* + * Sets display sink rotation. + * @param aRotation rotation value + */ + IMPORT_C void SetRotationL( TRotation aRotation ); + + /* + * Display sink's current rotation. + * @return rotation value + */ + IMPORT_C TRotation RotationL(); + + + public: // internal + + /** + * Initializes + * @param aManager the manager. Ownership is NOT transferred + */ + void InitializeL( CMceManager* aManager ); + + + private: + + /** + * C++ constructor. + */ + CMceDisplaySink(); + + private: // Reserved for future use + + TAny* iReserved; + + public: // stub data + + TInt iDisplayIndex; + + TRect iDisplayRect; + + TUint iDisplayPriority; + + TRotation iRotation; + + CMccScreen* iScreen; + + }; + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mcefilesink.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mcefilesink.h Thu Jul 22 16:32:26 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: +* +*/ + + +#ifndef MCEFILESINK_H +#define MCEFILESINK_H + +// INCLUDES +#include +#include + +// FORWARD DECLARATIONS + +// DATA TYPES +const TMceSinkType KMceFileSink = 4; + + +// CLASS DECLARATION + +/** +* Class representing file sink in Mce. +* +* CMceFileSink can be used to record a stream to the file. The file may consist of +* both audio and video data. If both media elements are available and should be +* recorded to the same file, the same file sink should be attached to audio stream +* and video stream. Recording only one of the media elements is possible as well. +* +* Enable (continue) and Disable (pause) operations to it are considered +* to be local, so they are not signalled to remote terminal. +* +* @lib mceclient.lib +*/ +class CMceFileSink : public CMceMediaSink + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + * @param aFileName name of the file including full path info + */ + IMPORT_C static CMceFileSink* NewL( const TFileName& aFileName ); + + /** + * Two-phased constructor. + * @param aFileName name of the file including full path info + */ + IMPORT_C static CMceFileSink* NewLC( const TFileName& aFileName ); + + /** + * Destructor. + */ + IMPORT_C ~CMceFileSink(); + + + public: // From CMceMediaSink + + /** + * Enables the sink explicitly. + */ + IMPORT_C void EnableL(); + + /** + * Disables the sink explicitly. + */ + IMPORT_C void DisableL(); + + private: + + /** + * C++ default constructor. + */ + CMceFileSink(); + + /** + * Second-phase constructor. + */ + void ConstructL( const TFileName& aFileName ); + + public: // Stub data + + TFileName iFileName; + + }; + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mcefilesource.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mcefilesource.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,262 @@ +/* +* 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: +* +*/ + + +#ifndef MCEFILESOURCE_H +#define MCEFILESOURCE_H + +// INCLUDES +#include "mcemediasource.h" +#include "mcemediastream.h" + +// CONSTANTS +const TMceSourceType KMceFileSource = 4; + +//FORWARD DECLARATIONS +class CMceManager; + +// CLASS DECLARATION + +/** +* Class representing file source in MCE. +* +* CMceFileSource can be used for streaming file contents. The file may contain +* both audio and video data. If the user wants to stream both media types, +* the same file source should be attached to audio stream and video stream. +* +* The file may contain also several elements of the same media type (e.g. +* 3 audio channels) and the user might want to use only some of those. +* This can be handled by defining index of the file's current media element: +* +* - Get number of audio media elements within the file (e.g. returns 3) +* - Set current audio element index to be 0 +* - Attach the file source to the audioStreamOne (audio element 0 is attached) +* - Set current audio element index to be 2 +* - Attach the file source to the audioStreamTwo (audio element 2 is attached) +* - Consequently, file's audio channel 0 would be streamed over the audioStreamOne +* and channel 2 over the audioStreamTwo. Channel 1 would be ignored. +* +* Enable (continue) and Disable (pause) operations to it are considered +* to be local, so they are not signalled to remote terminal. +* +* @lib mceclient.lib +*/ +class CMceFileSource : public CMceMediaSource + { + + public: // Constructors and destructor + + /** + * Two-phased constructor. + * @param aManager associated MCE manager + * @param aFileName name of the file including full path info + */ + IMPORT_C static CMceFileSource* NewL( CMceManager& aManager, + const TFileName& aFileName ); + + /** + * Two-phased constructor. + * @param aManager associated MCE manager + * @param aFileName name of the file including full path info + */ + IMPORT_C static CMceFileSource* NewLC( CMceManager& aManager, + const TFileName& aFileName ); + + /** + * Destructor. + */ + IMPORT_C ~CMceFileSource(); + + + public: // From CMceMediaSource + + /** + * Enables the source explicitly. + */ + IMPORT_C void EnableL(); + + /** + * Disables the source explicitly. + */ + IMPORT_C void DisableL(); + + + public: // Functions + + /** + * Updates file for the source. + * @param aFileName name of the file including full path info + */ + IMPORT_C void UpdateL ( const TFileName& aFileName ); + + /** + * Determines how many media elements of the spesified type the file + * source contains. E.g. audio file may contain N number of audio + * channels which has to be streamed over N number of audio streams. + * @param aType the type of media + * @return the number of media elements (of spesified type) + * the file contains + */ + IMPORT_C TInt MediaElementCountL( TMceMediaType aType ) const; + + /** + * Sets currently managed media element of the spesified media type. + * The setting is effective when the file source is attached to + * media stream of the spesified type. Current media element can be + * defined for each media type the file contains. By default, media + * element 0 of each media type is used. + * @param aType the type of media + * @param aIndex new index of the current media element + * @leave KErrArgument if media element spesified by input parameters + * does not exist + */ + IMPORT_C void SetCurrentMediaElementL( TMceMediaType aType, TInt aIndex ); + + /** + * Gets currently managed media element of the spesified media type. + * @param aType the type of media + * @return index of the current media element or KErrNotFound if no media + * elements of the spesified type exists + */ + IMPORT_C TInt CurrentMediaElement( TMceMediaType aType ); + + /** + * Sets the position within the file from where to start playback. + * @pre IsEnabled() == EFalse and contains audio/video + * @param aPosition from start of the file in microseconds + */ + IMPORT_C void SetPositionL( const TTimeIntervalMicroSeconds& aPosition ); + + /** + * Gets the current playback position in microseconds from the start of the file. + * @pre contains audio/video + * @return current position from start of the file in microseconds + */ + IMPORT_C TTimeIntervalMicroSeconds PositionL() const; + + /** + * Returns the duration of the file in microseconds. + * @pre contains audio/video + * @return duration of the file in microseconds. + */ + IMPORT_C TTimeIntervalMicroSeconds DurationL() const; + + /** + * Sets fast forward on/off. + * @pre contains video + * @param aUseFFWD ETrue if fast forward is enabled; otherwise EFalse + */ + IMPORT_C void SetFastForwardL( TBool aUseFFWD ); + + /** + * Sets fast rewind on/off. + * @pre contains video + * @param aUseFRWD ETrue if fast rewind is enabled; otherwise EFalse + */ + IMPORT_C void SetFastRewindL( TBool aUseFRWD ); + + /** + * Starts transcoding of file. After the transcoding is complete, + * file of this source is changed into the transcoded file. + * @pre CMceMediaStream::State() == ETranscodingRequired + * @post CMceMediaStream::State() == ETranscoding + * @param aFileName Name of the transcoding output file. + */ + IMPORT_C void TranscodeL( const TFileName& aFileName ); + + /** + * Cancels transcoding of file. + * @pre CMceMediaStream::State() == ETranscoding + * @post CMceMediaStream::State() == ETranscodingRequired + */ + IMPORT_C void CancelTranscodeL(); + + /** + * Gets the current transcoding progress in percentage. + * Value is updated with MMceStreamObserver::StreamStateChanged() event. + * @pre CMceMediaStream::State() == ETranscoding + * @return Transcoding progress in persentage (0-100). + */ + IMPORT_C TInt TranscodingProgressL() const; + + + public: // internal + + /** + * Initializes + * @param aManager the manager. Ownership is NOT transferred + */ + void InitializeL( CMceManager* aManager ); + + public: + + /** + * Two-phased constructor. + */ + static CMceFileSource* NewL(); + + /** + * Two-phased constructor. + */ + static CMceFileSource* NewLC(); + + private: + + /** + * C++ default constructor. + */ + CMceFileSource(); + + /** + * Second-phase constructor. + */ + void ConstructL( CMceManager* aManager, + const TFileName& aFileName ); + + + public: // Stub data + + TBool iFastForward; + TBool iFastRewind; + TTimeIntervalMicroSeconds iPosition; + + //TMceFileInfo iFileInfo; + //TBuf8<256> iFileName; + + TBool iInitialInfoRetrieved; + + TInt iCurrentAudioElement; + TInt iCurrentVideoElement; + + + TFileName iFileName; + TTimeIntervalMicroSeconds iDuration; + TInt iAudioElementCount; + TInt iVideoElementCount; + + TInt iTranscodingPercentage; + + // If this code is != KErrNone, next operation that can fail will fail + // (leave or return a value) with this code. Variable is reseted before + // failing. + // Obs! Check that wanted failing is really implemented in this stub + mutable TInt iFailWithCode; + + }; + + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mceh263codec.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mceh263codec.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,199 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef CMCEH263CODEC_H +#define CMCEH263CODEC_H + +// INCLUDES +#include "mcevideocodec.h" +#include "mcedefs.h" + +// CONSTANTS + +const TUint KMceH263FrameHeight = 176; +const TUint KMceH263FrameWidth = 144; +const TUint KMceH263ClockRate = 90000; +const TReal KMceH263FrameRate = 15; + +const TInt KMceH263Level10Bitrate = 64000; +const TInt KMceH263Level45Bitrate = 128000; + +const TUint KMceAllowedH263Bitrate10 = 0x0001; +const TUint KMceAllowedH263Bitrate45 = 0x0002; +const TUint KMceAllowedH263BitrateAll = 0x00FF; + +// CLASS DECLARATION + +/** +* Class for the H263 codec information. +* +* It checks the validity of inserted values for H263 +* +* @lib mceclient.lib +*/ +class CMceH263Codec : public CMceVideoCodec + { + + public: // Constructors and destructor + + /** + * Destructor. + */ + IMPORT_C ~CMceH263Codec(); + + public: + + /** + * Two-phased constructor. + * @param aSdpName sdp name + */ + IMPORT_C static CMceH263Codec* NewL( TBuf8 aSdpName); + + /** + * Two-phased constructor. + * @param aSdpName sdp name + */ + IMPORT_C static CMceH263Codec* NewLC( TBuf8 aSdpName ); + + public: // From base classes + + /** + * Sets bitrate used with codec for encoding. + * @param aBitrate bitrate value for encoding + * @return KErrNotSupported if codec doesn't support bitrate + * value issued + */ + virtual TInt SetBitrate( TUint aBitrate ); + + /** + * Sets bitrates allowed with codec. + * @param aBitrates allowed bitrate values + * @return KErrNotSupported if codec doesn't support bitrate + * values issued + */ + virtual TInt SetAllowedBitrates( TUint aBitrates ); + + /** + * Sets the codec specific mode. + * @param aCodecMode mode of the codec + * @return KErrNotSupported if codec doesnt' support codec mode + * value issued + */ + virtual TInt SetCodecMode( TUint aCodecMode ); + + /** + * Sets the payload type. + * @param aPayloadType type identifier of the payload + * @return KErrNotSupported if codec doesn't support payload type issued + */ + virtual TInt SetPayloadType( TUint8 aPayloadType ); + + /** + * Clones the codec. + * @return cloned codec; ownership is transferred + */ + virtual CMceVideoCodec* CloneL() const; + + /** + * Sets maximum bitrate of the codec. + * @param aMaxBitrate value of maximum bitrate used for encoding + * @leave KErrNotSupported if codec doesn't support frame sizes issued + */ + virtual void SetMaxBitrateL( TUint aMaxBitrate ); + + /** + * Sets resolutions allowed with the codec. + * @param aResolutions bitfield of allowed resolutions + * @leave KErrNotSupported if codec doesn't support resolutions issued + */ + virtual void SetAllowedResolutionsL( TUint aResolutions ); + + /** + * Sets resolution of the video. + * @param aResolution resolution of the video in pixels + * @leave KErrNotSupported if codec doesn't support resolution issued + */ + virtual void SetResolutionL( TSize aResolution ); + + /** + * Sets frame rates allowed with the codec. + * @param aFrameRates allowed frame rate values as a bitfield + * @leave KErrNotSupported if codec doesn't support frame rates issued + */ + virtual void SetAllowedFrameRatesL( TUint aFrameRates ); + + /** + * Sets frame rate used with the codec for encoding. + * @param aFrameRate frame rate for encoding + * @leave KErrNotSupported if codec doesn't support frame rate value + * issued + */ + virtual void SetFrameRateL( TReal aFrameRate ); + + /** + * Sets preferred encoding device for uplink stream and preferred decoding + * device for downlink stream. + * @param aEncodingDecodingDevice + * @leave KErrNotSupported if setting preferred device is not possible + */ + virtual void SetPreferredEncodingDecodingDeviceL( + TUid aEncodingDecodingDevice ); + + /** + * Set config key (sprop-parameter-sets) + * @param aConfigKey, config key as Base64 encoded + * @leave KErrNotSupported if setting config key is not possible + */ + virtual void SetConfigKeyL( const TDesC8& aConfigKey ); + + + private: // Helper functions + + /** + * Sets the sdp name. + * @param aSdpName the sdp name + */ + void SetSdpNameL( const TDesC8& aSdpName ); + + private: // Constructors + + /** + * C++ default constructor. + */ + CMceH263Codec(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL( TBuf8 aSdpName); + + + + private: // Data + + private: // Reserved for future use + + TAny* iReserved; + + + }; + + +#endif + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mceinsession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mceinsession.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,199 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef CMCEINSESSION_H +#define CMCEINSESSION_H + +// INCLUDES +#include +#include + +// CLASS DECLARATION + +/** +* Class for mobile terminated MCE sessions. +* +* CMceInSession represents incoming invitation to join in a session. +* +* The characteristics of the session are defined by remote terminal. Theses charactereistics +* are defined using SDP and are turned by MCE server into structure of media streams attached +* into the session. The user of this class is then responsible to either reject accept +* the invitation. +* +* Accepting the invitation is executed in two steps. First after receiving the invitation +* the user must complete the media structure. Streams attached to the session are not complete, +* but they must be completed by the user. Those componens defined in SDP are put automatically +* into media structure (like streams and RTP sinks and sources), but other relations must +* be completed by user. When media structure is complete, UpdateL method is called and session +* establishement continues with second step. +* +* After all media resources are succesfully negotiated and reserved, session state is changed +* to Proceeding, and end used can be alarmed about incoming invitation. Typically, at this state +* 180 Ringing response is sent to network. If end user accepts the invitation, 200 OK is +* sent to network and session is established. +* +* After the session has been succesfylly established, it can be later updated and +* must be finally terminated. +* +* This class is never instantiated by user, but the ownership is in any case transferred +* to it. See class MMceInSessionObserver. +* +* If for any reason instance of this class is deleted while in established state, +* session is automatically terminated by MCE server. +* +* @lib mceclient.lib +*/ +class CMceInSession : public CMceSession + { + + public: // Constructors and destructor + + /** + * Destructor + */ + IMPORT_C ~CMceInSession(); + + public: // Functions + + /** + * Indicates to the server side, that 180(Ringing) response for the + * incoming INVITE request can be sent. Does not establish session. + * @pre State() == CMceSession::EProceeding + * @param aHeaders, SIP headers to be added. Ownership is + * transferred. + * @param aContentType, a type of content. Ownership + * is transferred. + * @param aContent, content to be added in body. Ownership is + * transferred. + + */ + IMPORT_C void RingL( CDesC8Array* aHeaders = 0, + HBufC8* aContentType = 0, + HBufC8* aContent = 0 ); + + /** + * Answers to an incoming session. Indicates to server side that the + * 200(OK) response for the incoming INVITE has to be sent. + * @pre State() == CMceSession::EProceeding + * @post State() == CMceSession::EAnswering + */ + IMPORT_C void AcceptL(); + + /** + * Answers to an incoming session. Indicates to server side that the + * given response for the incoming INVITE has to be sent. + * @pre State() == CMceSession::EProceeding && ( 200 <= aCode <= 300 ) + * @post State() == CMceSession::EAnswering + * @param aReason, reason phrase + * @param aCode, reason code + * @param aHeaders, SIP headers to be added. Ownership is + * transferred. + * @param aContentType, a type of content. Ownership + * is transferred. + * @param aContent, content to be added in body. Ownership is + * transferred. + */ + IMPORT_C void AcceptL( const TDesC8& aReason, + TUint32 aCode, + CDesC8Array* aHeaders = 0, + HBufC8* aContentType = 0, + HBufC8* aContent = 0 ); + + /** + * Rejects the incoming session. Indicates to server side that + * 603(Decline) response has to be sent. + * @pre State() == CMceSession::EIncoming || + * State() == CMceSession::EProceeding + * @post State() == CMceSession::ETerminated + */ + IMPORT_C void RejectL(); + + /** + * Rejects the incoming session. Indicates to server side that + * 603(Decline) response has to be sent. + * @pre ( State() == CMceSession::EIncoming || + * State() == CMceSession::EProceeding ) && + * ( 300 <= aCode < 700 ) + * @post State() == CMceSession::ETerminated + * @param aReason, reason phrase + * @param aCode, reason code + * @param aHeaders, SIP headers to be added. Ownership is + * transferred. + * @param aContentType, a type of content. Ownership + * is transferred. + * @param aContent, content to be added in body. Ownership is + * transferred. + */ + IMPORT_C void RejectL( const TDesC8& aReason, + TUint32 aCode, + CDesC8Array* aHeaders = 0, + HBufC8* aContentType = 0, + HBufC8* aContent = 0 ); + + public: // serialization + + /** + * Two-phased constructor. + * @param aReadStream, read stream + * @param aManager, reference to session manager. + * @param aProfileId, id of the sip profile used for the session. + */ + static CMceInSession* NewL( RReadStream& aReadStream, + CMceManager& aManager, + TUint32 aProfileId ); + /** + * Two-phased constructor. + * For temporay use only. + */ + IMPORT_C static CMceInSession* NewL(); + + /** + * C++ default constructor. + * @param aManager, reference to session manager. + * @param aProfileId, id of the sip profile used for the session. + */ + CMceInSession( CMceManager* aManager, TUint32 aProfileId ); + + + private://methods + + /** + * second-phase constructor + * @param aOriginator, the originator + * @param aRecipient, the recipient + */ + void ConstructL( const TDesC8& aOriginator, const TDesC8& aRecipient ); + + public: // Stub constructor + + /** + * Two-phased constructor. + * @param aManager, reference to session manager. + */ + IMPORT_C static CMceInSession* NewL( CMceManager& aManager, + const TDesC8& aOriginator ); + + + public: // Stub data + + TBool iRingingCalled; + + }; + + + #endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mceinsessionobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mceinsessionobserver.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,74 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef MMCEINSESSIONOBSERVER_H +#define MMCEINSESSIONOBSERVER_H + +// INCLUDES +#include + +// FORWARD DECLARATIONS +class CMceSession; +class CMceInSession; +class TMceTransactionDataContainer; + +// CLASS DECLARATION + +/** +* An interface to be implemented by users of MCE if they wish to receive +* invitations to session from network. +* +* This observer is set using CMceManager::SetInSessionObserver function. +* +* @lib mceclient.lib +*/ +class MMceInSessionObserver + { + + public: // Functions + + /** + * Incoming session invitation. The CMceInSession is given to the + * application as a callback. + * @param aSession, pointer to the incoming session. Ownership is + * transferred. + * @param aContainer, if present, holds details of + * transaction causing state change. + */ + virtual void IncomingSession( + CMceInSession* aSession, + TMceTransactionDataContainer* aContainer ) = 0; + + /** + * Incoming session update. The new updated CMceInSession is given to the + * application as a callback. + * @param aOrigSession, the original session to be updated. This instance + * cannot be used anymore, all actions done using aUpdatedSession instance. + * @param aUpdatedSession, pointer to the new updated session. Ownership is + * transferred. + * @param aContainer, if present, holds details of + * update transaction. + */ + virtual void IncomingUpdate( + CMceSession& aOrigSession, + CMceInSession* aUpdatedSession, + TMceTransactionDataContainer* aContainer ) = 0; + + }; + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mcemanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mcemanager.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,271 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef CMCEMANAGER_H +#define CMCEMANAGER_H + +// INCLUDES +#include +#include +//#include + +// FORWARD DECLARATIONS +class MMceInSessionObserver; +class MMceInEventObserver; +class MMceInReferObserver; +class MMceSessionObserver; +class MMceEventObserver; +class MMceReferObserver; +class MMceStreamObserver; +class MMceRtpObserver; +class CMceSession; +class CMceEvent; +class CMceRefer; +class TMceMediaId; +class CMceAudioCodec; +class CMceVideoCodec; +class TMceTransactionDataContainer; +class CMusTestSessionSimulator; + +// CLASS DECLARATION + +/** +* Class for connecting to MCE server. +* +* This class provides the connection to the MCE server and +* provides functions for setting observers for asynchronous +* events. +* +* The user should create only one instance of this class. +* +* @lib mceclient.lib +*/ +class CMceManager : public CBase + { + + public: // Constructors and destructor + + /** + * Two-phased constructor. + * @param aAppUid, uid of the application. + * @param aContainer, if set, detailed data provided in observers. + */ + IMPORT_C static CMceManager* NewL( + const TUid& aAppUid, + TMceTransactionDataContainer* aContainer = 0); + + /** + * Destructor. + */ + IMPORT_C ~CMceManager(); + + public: // Functions + + /** + * Set observer for incoming sessions. + * @param aInSessionObserver, observer of the sessions. + */ + IMPORT_C void SetInSessionObserver( + MMceInSessionObserver* aInSessionObserver ); + + /** + * Set observer for incoming events. + * @param aInEventObserver, observer of the events. + */ + IMPORT_C void SetInEventObserver( + MMceInEventObserver* aInEventObserver ); + + /** + * Set observer for incoming refers. + * @param aInReferObserver, observer of the refers. + */ + IMPORT_C void SetInReferObserver( + MMceInReferObserver* aInReferObserver ); + + /** + * Set observer for sessions. + * @param aSessionObserver, observer of the sessions. + */ + IMPORT_C void SetSessionObserver( + MMceSessionObserver* aSessionObserver ); + + /** + * Set observer for medias + * @param aMediaObserver, observer of medias. + */ + IMPORT_C void SetMediaObserver( + MMceStreamObserver* aMediaObserver ); + + /** + * Set observer for rtp + * @param aRtpObserver, observer of rtp + */ + IMPORT_C void SetRtpObserver( + MMceRtpObserver* aRtpObserver ); + + /** + * Sets observer for incoming events. + * @param aEventObserver, observer of the event. Ownership is + * not transferred. + */ + IMPORT_C void SetEventObserver( + MMceEventObserver* aEventObserver); + + /** + * Sets observer for incoming REFER events. + * @param aReferObserver, observer of the event. Ownership is + * not transferred. + */ + IMPORT_C void SetReferObserver( + MMceReferObserver* aReferObserver); + + /** + * Gets currently ongoing sessions + * @return RPointerArray array of sessions. + */ + IMPORT_C const RPointerArray< CMceSession >& Sessions() const; + + /** + * Gets currently ongoing events + * @return RPointerArray array of events. + */ + IMPORT_C const RPointerArray< CMceEvent >& Events() const; + + /** + * Sets observer for incoming SUBSCRIBE events. + * @param aObserver, observer of the event. Ownership is + * not transferred. + */ + IMPORT_C const RPointerArray< CMceRefer >& Refers() const; + + /** + * Returns supported audio codecs of the system. + * @return supported audio codecs of the system. + */ + IMPORT_C const RPointerArray& SupportedAudioCodecs() const; + + /** + * Returns supported video codecs of the system. + * @return supported video codecs of the system. + */ + IMPORT_C const RPointerArray& SupportedVideoCodecs() const; + + /* + * Set default headers for the method. The headers will always be added + * to the given SIP methods unless overwritten with + * headers given as parameter for the API method triggering the + * sending of request/response. + * @param aMethods, the SIP methods the headers are added to. + * @param aHeaders, the default headers, ownership is transferred. + */ + IMPORT_C void SetDefaultHeadersL( CDesC8Array* aMethods, CDesC8Array* aHeaders ); + + /* + * Get the default headers assigned for the given method. + * If none is assigned, and empty array is returned. + * @param aMethod, the method for which the headers are queried. + * @return the default headers, ownership is transfered. + */ + IMPORT_C CDesC8Array* DefaultHeadersL( const TDesC8& aMethod ) const; + + + public: // Functions + + /** + * Gets observer for incoming sessions + * @return incoming session observer + */ + MMceInSessionObserver* InSessionObserver() const; + + /** + * Gets session observer + * @return session observer + */ + MMceSessionObserver* SessionObserver() const; + + /** + * Gets media observer + * @return media observer + */ + MMceStreamObserver* MediaObserver() const; + + /** + * Gets rtp observer + * @return rtp observer + */ + MMceRtpObserver* RtpObserver() const; + + + /** + * Returs transaction container for detailed data. + * Returns NULL, if none exists. + */ + TMceTransactionDataContainer* TransactionContainer() const; + + private: + + /** + * C++ default constructor. + * @param aAppUid, uid of the application. + * @param aContainer, if set, detailed data provided in observers. + */ + CMceManager( const TUid& aAppUid, + TMceTransactionDataContainer* aContainer = 0); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + + public: // Stub data + + /** + * detailed callbacks wanted + */ + TBool iDetailedCallbacks; + + /** + * sessions + */ + RPointerArray iSessions; + + /** + * supported audio codecs + */ + RPointerArray iSupportedAudioCodecs; + + /** + * supported audio codecs + */ + RPointerArray iSupportedVideoCodecs; + + MMceSessionObserver* iSessionObserver; + MMceStreamObserver* iMediaObserver; + MMceRtpObserver* iRtpObserver; + MMceInSessionObserver* iInSessionObserver; + + TMceTransactionDataContainer* iContainer; + + private: // Data + CMusTestSessionSimulator* iSessionSimulator; + + friend class CMceSession; + }; + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mcemediasink.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mcemediasink.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,143 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef CMCEMEDIASINK_H +#define CMCEMEDIASINK_H + +// INCLUDES +#include +#include + +// DATA TYPES +typedef TUint TMceSinkType; + +// FORWARD DECLARATIONS +class TMceSinkFactory; +class CMceMediaStream; +class TMceIds; +class TMceEvent; +class TMceMediaId; +class CMceManager; + + +// CLASS DECLARATION + +/** +* Base class for the MCE media sinks. +* +* Media sinks represent the destination of data. +* CMceMediaSink gets it data from CMceMediaSource through +* CMceMediaStream. +* +* CMceMediaSink has a type that defines how it can connected to other +* sources and streams. +* +* Enable and Disable operations to sinks are considered to be local, +* so they are not signalled to remote terminal. +* +* @lib mceclient.lib +*/ +class CMceMediaSink: public CBase + { + + public: // Destructor + + IMPORT_C ~CMceMediaSink(); + + public: // Functions + + /** + * Returns the type of the sink. + * @return The type of the sink. + */ + IMPORT_C TMceSinkType Type() const; + + /** + * Enables streaming explicitly. + */ + virtual void EnableL() = 0; + + /** + * Disables streaming explicitly. + */ + virtual void DisableL() = 0; + + /** + * Returns the state of the sink. + * @return ETrue if enabled, EFalse if disabled. + */ + IMPORT_C TBool IsEnabled() const; + + public: //internal + + /** + * Initializes + * @param aParent the parent + */ + virtual void InitializeL( CMceMediaStream& aParent ); + + /** + * Initializes + * @param aManager the manager. Ownership is NOT transferred + */ + virtual void InitializeL( CMceManager* aManager ); + + /** + * Sets and gets reference count describing to how many + * streams sink is associated + * @return reference count reference + */ + TInt& ReferenceCount(); + + protected: + + /** + * C++ default constructor. + */ + CMceMediaSink(); + + /** + * Enables streaming explicitly. + */ + void DoEnableL(); + + /** + * Disables streaming explicitly. + */ + void DoDisableL(); + + + protected: // NOT owned data + + /** + * stream + */ + CMceMediaStream* iStream; + + public: // stub data + + TMceSinkType iType; + + TBool iIsEnabled; + + TInt iReferenceCount; + + }; + + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mcemediasource.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mcemediasource.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,146 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef CMCEMEDIASOURCE_H +#define CMCEMEDIASOURCE_H + +// INCLUDES +#include + +// DATA TYPES +typedef TUint TMceSourceType; + +// FORWARD DECLARATIONS +class RReadStream; +class RWriteStream; +class CMceComMediaSource; +class TMceSourceFactory; +class CMceMediaStream; +class TMceEvent; +class TMceMediaId; +class CMceManager; + +// CLASS DECLARATION + +/** +* Base class for the MCE media sources. +* +* Media sources represent the origin of data. +* CMceMediaSource puts it data through CMceMediaStream into +* CMceMediaSink. +* +* CMceMediaSource has a type that defines how it can connected to other +* sinks and streams. +* +* Enable and Disable operations to sinks are considered to be local, +* so they are not signalled to remote terminal. +* +* @lib mceclient.lib +*/ +class CMceMediaSource: public CBase + { + public: // Destructor + + IMPORT_C ~CMceMediaSource(); + + public: // Functions + + /** + * Returns the type of the source. + * @return The type of the source. + */ + IMPORT_C TMceSourceType Type() const; + + /** + * Enables streaming explicitly. + */ + virtual void EnableL() = 0; + + /** + * Disables streaming explicitly. + */ + virtual void DisableL() = 0; + + /** + * Returns the state of the source. + * @return ETrue if enabled, EFalse if disabled. + */ + IMPORT_C TBool IsEnabled() const; + + + + public: //internal + + /** + * Initializes + * @param aParent the parent + */ + virtual void InitializeL( CMceMediaStream& aParent ); + + /** + * Initializes + * @param aManager the manager. Ownership is NOT transferred + */ + virtual void InitializeL( CMceManager* aManager ); + + /** + * Sets and gets reference count describing to how many + * streams source is associated + * @return reference count reference + */ + TInt& ReferenceCount(); + + + protected: + + /** + * C++ default constructor. + */ + CMceMediaSource(); + + /** + * Enables streaming explicitly. + */ + void DoEnableL(); + + /** + * Disables streaming explicitly. + */ + void DoDisableL(); + + + protected: // NOT owned data + + /** + * stream + */ + RPointerArray iStreams; + + + public: // stub data + + TBool iIsEnabled; + + TMceSourceType iType; + + TInt iReferenceCount; + + }; + + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mcemediastream.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mcemediastream.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,316 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef CMCEMEDIASTREAM_H +#define CMCEMEDIASTREAM_H + +// INCLUDES +#include + +// DATA TYPES +typedef TUint TMceMediaType; + +// FORWARD DECLARATIONS +class CMceComMediaStream; +class TMceFactory; +class TMceMediaStreamFactory; +class RWriteStream; +class RReadStream; +class CDesC8Array; +class CMceSession; +class TMceIds; +class TMceEvent; +class TMceMediaId; +class CMceManager; +class CMceSession; +class CMceMediaSource; +class CMceMediaSink; +class MMceComSerializationContext; +class MDesC8Array; + +// CLASS DECLARATION + +/** +* Base class for MCE media streams. +* +* MCE Media stream represents stream of data negotiated between two terminals. +* Streams may transfer any data. +* +* Enabling or disabling of a stream is not a local operation, but it requires +* always signalling. Thus, these operation require always to be completed by +* calling CMceSession::UpdateL() function. +* +* @lib mceclient.lib +*/ +class CMceMediaStream : public CBase + { + public: // Stream states + + enum TState + { + EUninitialized, // Stream is created + EInitialized, // Stream is initialized + EBuffering, // Stream is buffering + EIdle, // Stream is not receiving RTP + EStreaming, // Stream is streaming + EDisabled, // Stream is explicitly disabled + ENoResources, // Stream has no needed resources to stream + ETranscodingRequired, // Stream requires non-realtime transcoding + ETranscoding // Stream is transcoding in non-realtime + }; + + public: // Destructor + + /** + * Destructor. + */ + IMPORT_C ~CMceMediaStream(); + + public: // Functions + + /** + * Gets the state of the stream. + * @return the current state of the stream + */ + IMPORT_C CMceMediaStream::TState State() const; + + /** + * Returns the type of the stream. + * @return The type of the stream. + */ + IMPORT_C TMceMediaType Type() const; + + /** + * Configures media stream by updating SDP media lines. + * In order to get complete update, whole session must be + * updated causing sending of re-invite. + * @param aMediaSDPLines, application specific SDP media lines for + * the stream. Ownership is transferred. + */ + IMPORT_C void SetMediaAttributeLinesL( CDesC8Array* aMediaSDPLines ); + + /** + * Gets attribute lines of the media. + * @return array of media attribute lines, owneship is transferred. + */ + IMPORT_C MDesC8Array* MediaAttributeLinesL(); + + /** + * Sets local media port + * @param aLocalMediaPort, local port for the media + */ + IMPORT_C void SetLocalMediaPortL(TUint aLocalMediaPort); + + /** + * Gets the local media port. + * @return Local port used for media. + */ + IMPORT_C TUint LocalMediaPort() const; + + /** + * Gets the session this stream belongs to, if exists. The + * ownership is not transfered. + * @return Session object + */ + IMPORT_C CMceSession* Session() const; + + + public: // Local stream control + + /** + * Enables streaming explicitly. + */ + virtual void EnableL(); + + /** + * Disables streaming explicitly. + */ + virtual void DisableL(); + + /** + * Returns the state of the stream. + * @return ETrue if enabled, EFalse if disabled. + */ + IMPORT_C TBool IsEnabled() const; + + + public: // Source and sink functions + + /** + * Adds source to the stream. CMceMediaStream can only + * have one source at a time. Ownership of passed source is transferred. + * However, the same source can be also passed to other streams resulting + * that streams share ownership of the source. Passing NULL source will + * remove source from stream. + * In some cases the source might contain a codec. The codec is derived + * to the stream when such source is added to the stream. + * Derived codec will get automatically highest preference. + * @param aSource source to be added to the stream; ownership is + * transferred + */ + IMPORT_C void SetSourceL( CMceMediaSource* aSource ); + + /** + * Adds sink to the stream. CMceMediaStream can have + * many sinks at a time. Ownership of passed sink is transferred. + * However, the same sink can be also passed to other streams resulting + * that streams share ownership of the sink. + * @param aSink sink to be added to the stream; ownership is transferred + */ + IMPORT_C void AddSinkL( CMceMediaSink* aSink ); + + /** + * Gets source of the stream. Returns NULL if source is not set. + * @return source of the stream; ownership is not transferred + */ + IMPORT_C CMceMediaSource* Source() const; + + /** + * Gets array of sinks of the stream. + * @return array of sinks + */ + IMPORT_C const RPointerArray& Sinks() const; + + /** + * Removes sink from the stream. + * @post aSink cannot be used anymore and contents of + * previously returned sink array (CMceMediaStream::Sinks()) + * are not anymore valid + * @param aSink sink to be removed from the stream + */ + IMPORT_C void RemoveSinkL( CMceMediaSink& aSink ); + + public: // Binding opposite way stream + + /** + * Binds opposite direction stream to this stream. + * @param aStream another stream to be bind to the stream; + * ownership is transferred + */ + IMPORT_C void BindL( CMceMediaStream* aStream ); + + /** + * Gets opposite direction stream of this stream. + * @return opposite direction stream + */ + IMPORT_C CMceMediaStream& BoundStreamL() const; + + /** + * Checks if opposite direction stream is set. + * @return ETrue if opposite direction stream is set; + * otherwise EFalse + */ + IMPORT_C TBool BoundStream() const; + + + public: //internal + + /** + * Checks if this is binder (biding owner) + * @return ETrue if this is binder (biding owner) + */ + TBool Binder() const; + + /** + * Initializes + * @param aParent the parent + */ + virtual void InitializeL( CMceSession& aParent ); + + /** + * Initializes + * @param aManager the manager. Ownership is NOT transferred + */ + virtual void InitializeL( CMceManager* aManager ); + + protected: + + /** + * C++ default constructor. + */ + CMceMediaStream(); + + private: + + /** + * Handles event + * @param aEvent the event + * @return status, if event was consumed or not or object needs update + */ + TInt HandleEvent( TMceEvent& aEvent ); + + /** + * one-way bind + * @param aStream another stream to be bind to the stream. + */ + void DoBindL( CMceMediaStream* aStream ); + + /** + * Deletes sink + * @param aIndex index of sink in the array + */ + void DeleteSink( TInt aIndex ); + + /** + * Deletes source + */ + void DeleteSource(); + + + protected: // NOT owned data + + /** + * session + */ + CMceSession* iSession; + + protected: // owned data + + + /** + * linked stream. Owned if iLinkOwner is ETrue + */ + CMceMediaStream* iLinkedStream; + + public: // stub data + + /** + * source + */ + CMceMediaSource* iSource; + + /** + * sinks + */ + RPointerArray iSinks; + + TState iState; + + TMceMediaType iType; + + TBool iLinkOwner; + + TBool iIsEnabled; + + TUint iLocalMediaPort; + + CDesC8Array* iMediaSDPLines; + }; + + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mceoutsession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mceoutsession.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,161 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef CMCEOUTSESSION_H +#define CMCEOUTSESSION_H + +// INCLUDES +#include +#include + +// FORWARD DECLARATIONS +class CSIPProfile; +class CMceMediaStream; +class CMceManager; +class CMceEvent; +class CMceRefer; + +// CLASS DECLARATION + +/** +* Class for mobile originated MCE sessions. +* +* CMceOutSession represents outgoing invitation to remote terminal to join in a session. +* +* The characteristics of the session are defined by user of this class by attaching +* media streams into the session. Theses charactereistics are turned by MCE server into SDP +* and attached into sent invitation request. +* +* After the session has been succesfylly established, it can be later updated and +* must be finally terminated. +* +* If for any reason instance of this class is deleted while in established state, +* session is automatically terminated by MCE server. +* +* @lib mceclient.lib +*/ +class CMceOutSession : public CMceSession + { + + public: // Constructors and destructor + + /** + * Two-phased constructor. Should be used when session + * is established into new logical connection to remote terminal. + * @param aManager, reference to session manager. + * @param aProfile, sip profile used for the session. + * @param aRecipient, recipient of the session invitation. + * @param aOriginator, originator of the session invitation. + */ + IMPORT_C static CMceOutSession* NewL( + CMceManager& aManager, + CSIPProfile& aProfile, + const TDesC8& aRecipient, + HBufC8* aOriginator = 0); + + /** + * Two-phased constructor. Should be used when session is associated + * to existing event. This guarantees that session is established with + * same remote terminal with the event. + * @param aEvent, reference to existing event that is associated + * with this session. + */ + IMPORT_C static CMceOutSession* NewL(CMceEvent& aEvent); + + /** + * Two-phased constructor. Should be used when session is associated + * to existing refer. This guarantees that session is established with + * same remote terminal with the refer. + * @param aRefer, reference to existing refer that is associated + * with this session. + */ + IMPORT_C static CMceOutSession* NewL(CMceRefer& aRefer); + + /// Note: This function exists only in the stub + IMPORT_C static CMceOutSession* NewL(); + + /** + * Destructor. + */ + IMPORT_C ~CMceOutSession(); + + public: // from CMceSession + + /** + * Adds media stream into session. + * @pre State() == CMceSession::EIdle || + * State() == CMceSession::EIncoming || + * State() == CMceSession::EEstablished + * @pre aMediaStream != 0 + * @param aMediaStream, media stream to be added. + * ownership is transferred. + */ + IMPORT_C void AddStreamL( CMceMediaStream* aMediaStream ); + + public: // Functions + + /** + * Establishes a SIP session with the recipient. + * The streams in the stream array are offered in the + * SDP codec negotiation. + * @pre State() == CMceSession::EIdle + * @post State() == CMceSession::EOffering + * @param aTimeout, the session timer value in seconds + * @param aHeaders, SIP headers to be added. Ownership is + * transferred. + * @param aContentType, content type of the body. + * Ownership is transferred. + * @param aContent, content to be added in body. Ownership is + * transferred. + * @param aContentHeaders, content headers to be added. Ownership is + * transferred. + */ + IMPORT_C void EstablishL( + TUint32 aTimeout = 0, + CDesC8Array* aHeaders = 0, + HBufC8* aContentType = 0, + HBufC8* aContent = 0, + CDesC8Array* aContentHeaders = 0 ); + + /** + * Cancels a previously initialized MO session. + * @pre State() == CMceSession::EOffering + */ + IMPORT_C void CancelL(); + + private://methods + + /** + * C++ default constructor. + * @param aManager, reference to session manager. + * @param aProfileId, id of the sip profile used for the session. + */ + CMceOutSession( CMceManager* aManager, TUint32 aProfileId ); + + /** + * second-phase constructor + * @param aRecipient, the recipient + * @param aOriginator, the originator + */ + void ConstructL( const TDesC8& aRecipient, HBufC8* aOriginator ); + + + + }; + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mcertpobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mcertpobserver.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,98 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef MMCERTPOBSERVER_H +#define MMCERTPOBSERVER_H + +// INCLUDES +#include + +// FORWARD DECLARATIONS +class CMceMediaStream; +class CMceRtpSource; + +// CLASS DECLARATION + +/** +* An interface to be implemented by users of MCE if they wish to receive +* events from CMceRtpSource. +* +* This observer is set using CMceManager::SetRtpObserver function. +* +* @lib mceclient.lib +*/ +class MMceRtpObserver + { + public: + /** + * Callback function to indicate that an RTCP sender report + * has been received. + * @param aSession the session that has changed + * @param aStream the stream that has changed + */ + virtual void SRReceived( + CMceSession& aSession, + CMceMediaStream& aStream) = 0; + + /** + * Callback function to indicate that an RTCP receiver report + * has been received. + * @param aSession the session that has changed + * @param aStream the stream that has changed + */ + virtual void RRReceived( + CMceSession& aSession, + CMceMediaStream& aStream) = 0; + + /** + * Callback function to indicate inactivity timer timeout + * has occurred. Timer is disabled after the timeout. + * @param aStream, the session that has changed. + * @param aSource, the source that the timeout occurred. + */ + virtual void InactivityTimeout( + CMceMediaStream& aStream, + CMceRtpSource& aSource) = 0; + + /** + * Callback function to indicate that spesified CMceRtpSource has + * received RTP from a new synchronization source (SSRC). + * @param aStream the stream that new SSRC was added to + * @param aSource the source that new SSRC was added to + * @param aSsrc added SSRC identifier + */ + virtual void SsrcAdded( + CMceMediaStream& aStream, + CMceRtpSource& aSource, + TUint aSsrc ) = 0; + + /** + * Callback function to indicate that spesified CMceRtpSource has + * received RTP BYE message from a spesified synchronization + * source (SSRC). + * @param aStream the stream that SSRC was removed from + * @param aSource the source that SSRC was removed from + * @param aSsrc removed SSRC identifier + */ + virtual void SsrcRemoved( + CMceMediaStream& aStream, + CMceRtpSource& aSource, + TUint aSsrc ) = 0; + }; + +#endif \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mcertpsink.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mcertpsink.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,154 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef CMCERTPSINK_H +#define CMCERTPSINK_H + +// INCLUDES +#include "mcemediasink.h" + +// CONSTANTS +const TMceSinkType KMceRTPSink = 1; + +// CLASS DECLARATION + +/** +* Class representing outgoing RTP stream in MCE. +* +* CMceRtpSink can be used to send media data to network. +* It can be configured not to use RTCP during play in order +* to save bandwith. +* +* CMceRtpSink allows also explicitly sending of RTP RR and SR +* messages. +* +* Enable and Disable operations to it are considered +* to be local, so they are not signalled to remote terminal. +* +* @lib mceclient.lib +*/ +class CMceRtpSink: public CMceMediaSink + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CMceRtpSink* NewL(); + + /** + * Two-phased constructor. + */ + IMPORT_C static CMceRtpSink* NewLC(); + + /** + * Two-phased constructor. + * @param aSuppressRTCP, ETrue if RTCP not sent during play, + * EFalse otherwise + * @param aIdentity, identity of user placed in RTCP, + * ownership not transferred. + */ + IMPORT_C static CMceRtpSink* NewL( TBool aSuppressRTCP, + HBufC8* aIdentity = 0 ); + + /** + * Destructor. + */ + IMPORT_C ~CMceRtpSink(); + + public: // From base class + + /** + * Locally resumes sending of RTP packets. + */ + IMPORT_C void EnableL(); + + /** + * Locally pauses sending of RTP packets. + */ + IMPORT_C void DisableL(); + + public: // Functions + + /** + * Sends RTCP sender report to recipient. + */ + IMPORT_C void SendSRL(); + + /** + * Returns the sequence id of the last packet + * sent to network. The value is updated only + * when sink is disabled. + * @pre IsEnabled() == EFalse + * @return sequence number of last sent packet. + */ + IMPORT_C TUint32 LastPacket() const; + + /** + * Returns the RTP stream source identifier + * used in network (SSRC). + * @pre CMceSession::State() == CMceSession::EEstablished + * @return source identifier used in network (SSRC). + */ + IMPORT_C TUint32 Ssrc() const; + + /** + * Updates settings of rtp sink. + * @pre CMceSession::State() == CMceSession::EIncoming + * @param aSuppressRTCP, ETrue if RTCP not sent during play, + * EFalse otherwise + * @param aIdentity, identity of user placed in RTCP, + * ownership not transferred. + */ + IMPORT_C void UpdateL( TBool aSuppressRTCP, HBufC8* aIdentity = 0 ); + + private: + + /** + * C++ default constructor. + */ + CMceRtpSink(); + + /** + * second-phase constructor + * @param aSuppressRTCP, ETrue if RTCP not sent during play, + * EFalse otherwise + */ + void ConstructL( TBool aSuppressRTCP ); + + public: // stub data + + /** + * suppress RTCP + */ + TBool iSuppressRTCP; + + /** + * SSRC + */ + TUint32 iSSRC; + + /** + * last packet + */ + TUint32 iLastPacket; + + + }; + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mcertpsource.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mcertpsource.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,217 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef CMCERTPSOURCE_H +#define CMCERTPSOURCE_H + +// INCLUDES +#include +#include + +// CONSTANTS +const TMceSourceType KMceRTPSource = 1; +const TInt KMceJitterBufferLength = 10; +const TInt KMceJitterBufferTreshold = 5; + +//FORWARD DECLARATIONS +class TMceIds; + +// CLASS DECLARATION + +/** +* Class representing incoming RTP stream in MCE. +* +* CMceRtpSource can be used to receive media data from network. +* It can be configured with stream specific values to avoid +* jitter generated by network. It may also be configured to +* recognize separate media bursts instead of just receiving +* continuous flow of data. +* +* Events from this class can be received through class MMceRtpObserver. +* +* Enable and Disable operations to it are considered to be local, +* so they are not signalled to remote terminal. +* +* One CMceRTPSource may contain several RTP streams which are identified with +* synchronization source (SSRC) values. Disabling or enabling CMceRtpSource +* will affect to all SSRCs but streaming from specific SSRC can be also +* controlled with EnableSSRCL and Disable SSRCL methods. These are also +* local operations, thus not signalled to remote terminal. +* +* @lib mceclient.lib +*/ +class CMceRtpSource: public CMceMediaSource + { + + public: // Constructors and destructor + + /** + * Two-phased constructor. + * @param aBufferLength, length in packets of jitter buffer + * @param aBufferTreshold, treshold in packets of jitter buffer + * @param aInactivityTimer, timer (ms) to detect network inactivity. + * If 0, no activity detection, otherwise source is set to support + * talk bursts and report inactivity. + * @param aIdentity, identity of user placed in RTCP, ownership not transferred. + */ + IMPORT_C static CMceRtpSource* NewL( + TUint aBufferLength = KMceJitterBufferLength, + TUint aBufferTreshold = KMceJitterBufferTreshold, + TUint32 aInactivityTimer = 0, + HBufC8* aIdentity = 0 ); + + /** + * Two-phased constructor. + * @param aBufferLength, length in packets of jitter buffer + * @param aBufferTreshold, treshold in packets of jitter buffer + * @param aInactivityTimer, timer (ms) to detect network inactivity. + * If 0, no activity detection, otherwise source is set to support + * talk bursts and report inactivity. + * @param aIdentity, identity of user placed in RTCP, ownership not transferred. + */ + IMPORT_C static CMceRtpSource* NewLC( + TUint aBufferLength = KMceJitterBufferLength, + TUint aBufferTreshold = KMceJitterBufferTreshold, + TUint32 aInactivityTimer = 0, + HBufC8* aIdentity = 0 ); + + /** + * Destructor. + */ + IMPORT_C ~CMceRtpSource(); + + public: // From base class + + /** + * Enables streaming explicitly. + */ + IMPORT_C void EnableL(); + + /** + * Disables streaming explicitly. + */ + IMPORT_C void DisableL(); + + public: // Functions + + /** + * Enables RTP inactivity timer. + * @param aInactivityTimer, timer value (ms) that after inactivity + * of media from network is reported to client. + */ + IMPORT_C void EnableInactivityTimerL( TUint32 aInactivityTimer ); + + /** + * Disables RTP inactivity timer. + */ + IMPORT_C void DisableInactivityTimerL(); + + /** + * Updates settings for incoming session. + * @pre CMceSession::State() == CMceSession::EIncoming + * @param aBufferLength, length in packets of jitter buffer + * @param aBufferTreshold, treshold in packets of jitter buffer + * @param aInactivityTimer, timer (ms) to detect network inactivity. + * If 0, no activity detection, otherwise source is set to support + * talk bursts and report inactivity. + * @param aIdentity, identity of user placed in RTCP, ownership not transferred. + */ + IMPORT_C void UpdateL ( TUint aBufferLength = KMceJitterBufferLength, + TUint aBufferTreshold = KMceJitterBufferTreshold, + TUint32 aInactivityTimer = 0, + HBufC8* aIdentity = 0 ); + + /** + * Sends RTCP receiver report to recipient. + */ + IMPORT_C void SendRRL(); + + /** + * Returns the last RTP stream source identifier + * used in network (SSRC). + * @pre CMceSession::State() == CMceSession::EEstablished + * @return last source identifier used in network (SSRC). + */ + IMPORT_C TUint32 Ssrc() const; + + /** + * Gets an array of RTP synchronization source (SSRC) identifiers. + * Array includes all SSRC values this RtpSource has received RTP from. + * Changes in array are notified using MMceRtpObserver interface. + * @return array of synchronization source identifiers + */ + IMPORT_C const RArray& Ssrcs() const; + + /** + * Enables streaming from specified synchronization source (SSRC). + * @param aSsrc synchronization source to be enabled + */ + IMPORT_C void EnableSsrcL( TUint aSsrc ); + + /** + * Disables streaming from specified synchronization source (SSRC). + * @param aSsrc synchronization source to be disabled + */ + IMPORT_C void DisableSsrcL( TUint aSsrc ); + + /** + * Determines whether specific SSRC is enabled or not. + * @param aSsrc the SSRC identifier + * @return ETrue if specified SSRC is enabled; otherwise EFalse + */ + IMPORT_C TBool IsSsrcEnabledL( TUint aSsrc ); + + private: + + /** + * C++ default constructor. + */ + CMceRtpSource(); + + /** + * second-phase constructor + * @param aBufferLength, length in packets of jitter buffer + * @param aBufferTreshold, treshold in packets of jitter buffer + * @param aInactivityTimer, timer (ms) to detect network inactivity. + * If 0, no activity detection, otherwise source is set to support + * talk burts and report inactivity. + * @param aMediaBurstIndicator, indicator sound to be played before + * every new burst of media, if source in media burst mode. + */ + void ConstructL( TUint aBufferLength, + TUint aBufferTreshold, + TUint32 aInactivityTimer, + HBufC8* iMediaBurstIndicator ); + + + public: // Stub data + + RArray iSsrcs; + + TUint iBufferLength; + TUint iBufferTreshold; + TUint32 iInactivityTimer; + TUint32 iSilenceTimer; + TUint iToneFrequency; + TUint iToneLength; + HBufC8* iMediaBurstIndicator; + + }; + + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mcesession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mcesession.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,370 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef CMCESESSION_H +#define CMCESESSION_H + +// INCLUDES +#include +#include + +// FORWARD DECLARATIONS +class CDesC8Array; +class TMceIds; +class CMceMediaStream; +class CMceManager; +class TMceFactory; +class RReadStream; +class RWriteStream; +class CMceItcSender; +class CMceSessionReceiver; +class MMceFcMsgObserver; +class CMceComSession; +class CMceMsgBase; +class TMceEvent; +class CMceInSession; +class MDesC8Array; +class CMceStreamBundle; + + +// CLASS DECLARATION + +/** +* Base class for MCE sessions, inherited by both CMceInSession and CMceOutSession. +* +* CMceSession represents peer-to-peer connection made with remote terminal. +* This connection is also known as dialog and it is set up using SIP INVITE +* method. +* +* The characteristics of the session are defined by user of this class by attaching +* media streams into the session. +* +* After the session has been succesfylly established, it can be later updated and +* must be finally terminated. +* +* If for any reason instance of this class is deleted while in established state, +* session is automatically terminated by MCE server. +* +* @lib mceclient.lib +*/ +class CMceSession : public CBase + { + public: // Session states + + enum TState + { + EIdle, // Idle + EOffering, // Outgoing session, or session update establishment in progress, + EIncoming, // Session received incoming call + EReserving, // UpdateL called to incoming session during session establishment + EAnswering, // Answering an incoming call + EProceeding, // Session media negotiations proceeding + EEstablished, // Session established + ECancelling, // Cancelling outgoing session establishment + ETerminating, // Terminating session + ETerminated, // Session terminated + }; + + public: // Session termination reasons + + enum TReason + { + EDeclined, + EBusy, + ECancelled, + EDisconnected + }; + + public: + + /** + * Destructor. + */ + virtual ~CMceSession(); + + public: // Functions + + /** + * Returns the state of the session. + * @return The current state of the session + */ + IMPORT_C TState State() const; + + /** + * Returns the state of network connection of the session. + * @return ETrue if connection active, EFalse if connection inactive. + */ + IMPORT_C TBool ConnectionActive() const; + + + /** + * Removes media stream from session. + * @pre State() == CMceSession::EIdle || + * State() == CMceSession::EIncoming || + * State() == CMceSession::EEstablished + * @post aMediaStream cannot be used anymore and contents of + * previously returned stream array (CMceSession::Streams()) + * are not anymore valid + * @param aMediaStream media stream to be removed + */ + IMPORT_C void RemoveStreamL( CMceMediaStream& aMediaStream ); + + /** + * Adds media stream into session. + * @pre State() == CMceSession::EIdle || + * State() == CMceSession::EIncoming || + * State() == CMceSession::EEstablished + * @pre aMediaStream != 0 + * @param aMediaStream, media stream to be added. + * ownership is transferred. + */ + virtual void AddStreamL( CMceMediaStream* aMediaStream ); + + /** + * Updates offered session parameters during session + * establishement phase for first answer. + * Updates established session using re-invite. + * In state EIncoming the timeout value must be smaller or equal to + * offered value obtained by SessionTimer(). + * @pre State() == CMceSession::EIncoming || + * State() == CMceSession::EEstablished + * @post State() == CMceSession::EReserving for incoming session || + * State() == CMceSession::EOffering for established session + * @param aTimeout, the session timer value in seconds + * @param aHeaders, SIP headers to be added. Ownership is + * transferred. + * @param aContentType, content type of the body. + * Ownership is transferred. + * @param aContent, content to be added in body. Ownership is + * transferred. + * @param aContentHeaders, content headers to be added. Ownership is + * transferred. + */ + IMPORT_C void UpdateL( + TUint32 aTimeout = 0, + CDesC8Array* aHeaders = 0, + HBufC8* aContentType = 0, + HBufC8* aContent = 0, + CDesC8Array* aContentHeaders = 0 ); + + /** + * Terminates established session. + * @pre State() == CMceSession::EEstablished + * @post State() == CMceSession::ETerminating + * @param aHeaders, SIP headers to be added. Ownership is + * transferred. + * @param aContentType, content type of the body. + * Ownership is transferred. + * @param aContent, content to be added in body. Ownership is + * transferred. + */ + IMPORT_C void TerminateL( CDesC8Array* aHeaders = 0, + HBufC8* aContentType = 0, + HBufC8* aContent = 0 ); + + /** + * Returns the streams belonging to the session. + * @return streams of the session. + */ + IMPORT_C const RPointerArray& Streams() const; + + /** + * Returns the recipient of the session. + * @pre State() == CMceSession::EIncoming || + * State() == CMceSession::EEstablished + * @return The recipients address. + */ + IMPORT_C const TDesC8& Recipient() const; + + /** + * Returns the originator of the session. + * @pre State() == CMceSession::EIdle || + * State() == CMceSession::EIncoming || + * State() == CMceSession::EEstablished + * @return the originators address. + */ + IMPORT_C const TDesC8& Originator() const; + + /** + * Configures session by updating SDP session lines. + * In order to get complete update, whole session must be + * updated causing sending of re-invite. + * @pre State() == CMceSession::EIdle || + * State() == CMceSession::EIncoming || + * State() == CMceSession::EEstablished + * @pre aSessionSDPLines != 0 + * @param aSessionSDPLines, application specific SDP lines for session. + * Ownership is transferred. + */ + IMPORT_C void SetSessionSDPLinesL( CDesC8Array* aSessionSDPLines ); + + /** + * Gets SDP lines of the session. + * @return array of session SDP lines, owneship is transferred. + */ + IMPORT_C MDesC8Array* SessionSDPLinesL(); + + /** + * Returns the session timer value of the session. + * @return the session timer value. + */ + IMPORT_C TUint32 SessionTimer() const; + + /** + * Adds grouped media streams to the session. Changes SDP + * of the session. In order to get complete update, whole + * session must be updated causing sending of re-invite. + * @pre State() == CMceSession::EIdle || + * State() == CMceSession::EIncoming || + * State() == CMceSession::EEstablished + * @pre aBundle != 0 + * @param aBundle group of media streams; + * ownership of the bundle is transferred + */ + IMPORT_C void AddBundleL( CMceStreamBundle* aBundle ); + + /** + * Removes grouped media stream from session. Changes SDP + * of the session. In order to get complete update, whole + * session must be updated causing sending of re-invite. + * @pre State() == CMceSession::EIdle || + * State() == CMceSession::EIncoming || + * State() == CMceSession::EEstablished + * @post aBundle cannot be used anymore and contents of + * previously returned bundle array (CMceSession::Bundles()) + * are not anymore valid + * @param aBundle bundle to be removed + */ + IMPORT_C void RemoveBundleL( CMceStreamBundle& aBundle ); + + /** + * Gets the grouped media streams of the session. + * @return bundles of the session + */ + IMPORT_C const RPointerArray< CMceStreamBundle >& Bundles() const; + + /** + * Gets session modifier of type TUint. + * @param aModifier is a modifier to be retrieved + * @param aValue on return will contain modifier value + * @leave KErrNotFound if modifier is not found + */ + IMPORT_C void GetModifierL( TMceSessionModifier aModifier, + TUint& aValue ) const; + + /** + * Sets session modifier of type TUint. + * @param aModifier is a modifier to be set + * @param aValue is a new value of a modifier + * @leave KErrNotFound if modifier is not found + */ + IMPORT_C void SetModifierL( TMceSessionModifier aModifier, + TUint aValue ); + + /** + * Returns the identifier of profile used by the sesison. + * @return TUint32 Identifier of the used profile. 0, + * if session is setup without profile. + */ + IMPORT_C TUint32 Profile() const; + + + public: + + CMceManager& Manager() const; + + // Restarts the simulator + void RestartSimulator(); + + protected: + + /** + * C++ default constructor. + * @param aManager, reference to session manager. + * @param aProfileId, id of the sip profile used for the session. + */ + CMceSession( CMceManager* aManager, TUint32 aProfileId ); + + /** + * second-phase constructor + */ + void ConstructL(); + + /** + * Initializes + */ + void InitializeL(); + + + protected: // Not owned data + + /** + * profile id + */ + TUint32 iProfileId; + + private: // Owned data + + /** + * media streams + */ + RPointerArray iMediaStreams; + + /** + * bundles + */ + RPointerArray iBundles; + + //for testing + + //friend class CMceManager; + + public: // stub data + + CMceManager* iManager; + + CMceSession::TState iState; + + TBool iIsConnectionActive; + + HBufC8* iOriginator; + + HBufC8* iRecipient; + + TUint32 iTimeout; + + CDesC8Array* iSessionSDPLines; + + CDesC8Array* iHeaders; + + TBool iForceInternetSignaling; + + TUint i100RelUsage; + + // If this code is != KErrNone, next operation that can fail will fail + // (leave or return a value) with this code. Variable is reseted before + // failing. + // Obs! Check that wanted failing is really implemented in this stub + TInt iFailWithCode; + + TBuf8<200> iReasonPhrase; + + TInt iReasonCode; + }; + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mcesessionobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mcesessionobserver.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,82 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef MMCESESSIONOBSERVER_H +#define MMCESESSIONOBSERVER_H + +// INCLUDES +#include + +// FORWARD DECLARATIONS +class CMceSession; +class TMceTransactionDataContainer; + +// CLASS DECLARATION + +/** +* An interface to be implemented by users of MCE if they wish to use +* sessions. +* +* This observer is set using CMceManager::SetSessionObserver function. +* +* @lib mceclient.lib +*/ +class MMceSessionObserver + { + public: // Session control callbacks + + /** + * The state of the session has changed. + * @param aSession, the session that has changed. + * @param aContainer, if present, holds details of + * transaction causing state change. + */ + virtual void SessionStateChanged( + CMceSession& aSession, + TMceTransactionDataContainer* aContainer ) = 0; + + /** + * The state of the connection used by the session has changed. + * @param aSession, the session that has changed. + * @param aActive, ETrue if connection active, EFalse if connection inactive. + */ + virtual void SessionConnectionStateChanged( + CMceSession& aSession, + TBool aActive ) = 0; + + /** + * An error has occurred concerning a specific session. + * Note, that each error causes the session state to be ETerminated. + * @param aSession, The session raising the error. + * @param aError, Error code + */ + virtual void Failed( CMceSession& aSession, TInt aError ) = 0; + + /** + * An session update has been failed concerning a specific session. + * Note, that each error causes the session state to be ETerminated. + * @param aSession, The session raising the error. + * @param aContainer, if present, holds details of + * transaction causing update. + */ + virtual void UpdateFailed( + CMceSession& aSession, + TMceTransactionDataContainer* aContainer ) = 0; + }; + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mcespeakersink.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mcespeakersink.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,130 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef CMCESPEAKERSINK_H +#define CMCESPEAKERSINK_H + +// INCLUDES +#include +#include + +// DATA TYPES +const TMceSinkType KMceSpeakerSink = 2; + +// CLASS DECLARATION + +const TInt KMceAudioRoutePrivate = 3; +const TInt KMceAudioRoutePublic = 4; + +/** +* Class representing speaker in MCE. +* +* CMceSpeakerSink can be used to play out audio. +* +* Enable (un-mute) and Disable (mute) operations to it are considered +* to be local, so they are not signalled to remote terminal. +* +* @lib mceclient.lib +*/ +class CMceSpeakerSink: public CMceMediaSink + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CMceSpeakerSink* NewL(); + + /** + * Two-phased constructor. + */ + IMPORT_C static CMceSpeakerSink* NewLC(); + + /** + * Destructor. + */ + IMPORT_C ~CMceSpeakerSink(); + + public: // Functions + + /** + * Enables streaming explicitly. + */ + IMPORT_C void EnableL(); + + /** + * Disables streaming explicitly. + */ + IMPORT_C void DisableL(); + + /** + * Sets volume + * @param aVolume, + */ + IMPORT_C void SetVolumeL( TInt aVolume ); + + /** + * Gets current volume + * @return value of current volume, + */ + IMPORT_C TInt VolumeL() const; + + /** + * Gets maximum volume + * @return value of mamimum volume, + */ + IMPORT_C TInt MaxVolumeL() const; + + /** + * Sets audio routing + * @param aRoute Required audio route, like KMceAudioRoutePublic. + */ + IMPORT_C void SetRoutingL( TInt aRoute ); + + /** + * Gets current audio routing. + * @return TInt Current audio routing. + */ + IMPORT_C TInt RoutingL() const; + + private: + + /** + * C++ default constructor. + */ + CMceSpeakerSink(); + + /** + * second-phase constructor + */ + void ConstructL(); + + + + + public: // stub data + + TInt iVolume; + + TInt iMaxVolume; + + TInt iAudioRouting; + + }; + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mcestreambundle.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mcestreambundle.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,150 @@ +/* +* 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: +* +*/ + + +#ifndef MCESTREAMBUNDLE_H +#define MCESTREAMBUNDLE_H + +// INCLUDES +#include +#include + +// CONSTANTS + +// FORWARD DECLARATIONS +class CMceMediaStream; +class CMceSession; +class CMceMediaSink; +class MMceEndPointProxy; + + +/** +* Class for handling grouping of Mce streams (i.e. grouping of media lines). +* +* Can be used for example to synchronize audio and video streams. +* +* If streams are added to the bundle or removed from it after the bundle +* has been added to the session, the session has to be updated with +* CMceSEssion::UpdateL() function in order to complete the changes. +* +* @lib mceclient.lib +*/ +class CMceStreamBundle: public CBase + { + public: // Bundle types + + enum TMceStreamBundleType + { + ELS, + EFID + }; + + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CMceStreamBundle* NewL( TMceStreamBundleType aType ); + + /** + * Two-phased constructor. + */ + IMPORT_C static CMceStreamBundle* NewLC( TMceStreamBundleType aType ); + + /** + * Destructor. + */ + IMPORT_C ~CMceStreamBundle(); + + public: + + /** + * Type of the bundle + * @param aParent the parent + */ + IMPORT_C TMceStreamBundleType Type() const; + + /** + * Adds stream to the bundle. + * @param aStream, stream to be added + */ + IMPORT_C void AddStreamL( CMceMediaStream& aStream ); + + /** + * Removes stream from the bundle. + * @param aStream, stream to be removed + */ + IMPORT_C void RemoveStreamL( CMceMediaStream& aStream ); + + /** + * Returns the streams belonging to the bundle. + * @return streams of the bundle. + */ + IMPORT_C const RPointerArray< CMceMediaStream >& Streams(); + + public: + + /** + * Initializes + * @param aParent the parent + */ + void InitializeL( CMceSession& aParent ); + + + private: //methods + + /** + * C++ default constructor. + */ + CMceStreamBundle(); + + /** + * second-phase constructor + */ + void ConstructL( TMceStreamBundleType aType ); + + void AddedSinkL( CMceMediaStream& aStream, + CMceMediaSink*& aCurrentSink, + MMceEndPointProxy*& aProxy ); + + + protected: // NOT owned data + + /** + * session + */ + CMceSession* iSession; + + public: // Stub data + + /** + * Bundled streams, streams are not owned + */ + RPointerArray< CMceMediaStream > iStreams; + + RPointerArray< CMceMediaStream > iTempStreams; + + /** + * type + */ + CMceStreamBundle::TMceStreamBundleType iBundleType; + + + + }; + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mcestreamobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mcestreamobserver.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,71 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef MMCESTREAMOBSERVER_H +#define MMCESTREAMOBSERVER_H + +// INCLUDES +#include + +// FORWARD DECLARATIONS +class CMceMediaStream; +class CMceMediaSink; +class CMceMediaSource; + +// CLASS DECLARATION + +/** +* An interface to be implemented by users of MCE if they wish to receive +* media state events. +* +* This observer is set using CMceManager::SetMediaObserver function. +* +* @lib mceclient.lib +*/ +class MMceStreamObserver + { + public: + + /** + * The state of the stream has changed. + * @param aStream, the stream that has changed. + */ + virtual void StreamStateChanged( + CMceMediaStream& aStream) = 0; + + /** + * The state of the sink has changed. + * @param aStream, the stream that uses the sink. + * @param aSink, the sink that has changed. + */ + virtual void StreamStateChanged( + CMceMediaStream& aStream, + CMceMediaSink& aSink) = 0; + + /** + * The state of the source has changed. + * @param aStream, the stream that uses the source. + * @param aSource, the source that has changed. + */ + virtual void StreamStateChanged( + CMceMediaStream& aStream, + CMceMediaSource& aSource) = 0; + + }; + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mcetransactiondatacontainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mcetransactiondatacontainer.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,120 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef TMceTRANSACTIONDATACONTAINER_H +#define TMceTRANSACTIONDATACONTAINER_H + +// INCLUDES +#include +#include +//#include + +// CLASS DECLARATION + +/** +* Container class to hold detailed data of a transaction. +* +* It is assumed, that user has only one instance of this class. +* The same instance is passed between MCE and user, but the data +* inside of this container is just updated for each event. +* +* The data inside the container is valid only during the execution +* of the callback function. After this the remaining data in container +* is deleted. +* +* @lib mceclient.lib +*/ +class TMceTransactionDataContainer + { + public: + + /** + * Default constructor + */ + IMPORT_C TMceTransactionDataContainer(); + + /** + * Returns status code + * @returns status code of transaction, if any. + */ + IMPORT_C TInt GetStatusCode(); + + /** + * Returns reason phrase, ownership is transferred. + * @returns reason phrase of transaction, if any. + */ + IMPORT_C HBufC8* GetReasonPhrase(); + + /** + * Returns headers, ownership is transferred. + * @returns headers of transaction, if any. + */ + IMPORT_C CDesC8Array* GetHeaders(); + + /** + * Returns content type, ownership is transferred. + * @returns content type of transaction, if any. + */ + IMPORT_C HBufC8* GetContentType(); + + /** + * Returns content headers, ownership is transferred. + * @returns headers of content, if any. + */ + IMPORT_C CDesC8Array* GetContentHeaders(); + + /** + * Returns content, ownership is transferred. + * @returns content of transaction, if any. + */ + IMPORT_C HBufC8* GetContent(); + + public: // IMPORTED FOR STUBBING PURPOSES, NORMALLY NOT IMPORTED + + IMPORT_C void SetStatusCode( TInt aStatusCode ); + + IMPORT_C void SetReasonPhrase( HBufC8* aReasonPhrase ); + + IMPORT_C void SetHeaders( CDesC8Array* aHeaders ); + + IMPORT_C void SetContentType( HBufC8* aContentType ); + + IMPORT_C void SetContent( HBufC8* aContent ); + + IMPORT_C void SetContentHeaders( CDesC8Array* aHeaders ); + + IMPORT_C void Clear(); + + private: + + TUint32 iStatusCode; + + HBufC8* iReasonPhrase; + + CDesC8Array* iHeaders; + + HBufC8* iContentType; + + CDesC8Array* iContentHeaders; + + HBufC8* iContent; + + + }; + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mcevideocodec.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mcevideocodec.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,190 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef MCEVIDEOCODEC_H +#define MCEVIDEOCODEC_H + +// INCLUDES +#include +#include "mcecodec.h" +#include "mcedefs.h" + +// FORWARD DECLARATIONS +class CMceComVideoCodec; +class TMceVideoCodecFactory; +class TCCMRVideoCodingOptions; + +// CONSTANTS +const TMceCodecType KMceVideoCodec = 2; + + +// CLASS DECLARATION + +/** +* Base class for video codecs. +* +* It defines setters and getters for generic video codec attributes. +* These attributes are used in single video stream and they +* are negotiated with remote terminal. +* +* @lib mceclient.lib +*/ +class CMceVideoCodec : public CMceCodec + { + public: // Constructors and destructor + + /** + * Destructor. + */ + virtual ~CMceVideoCodec(); + + + public: // New functions + + /** + * Clones the codec. + * @return cloned codec; ownership is transferred + */ + virtual CMceVideoCodec* CloneL() const = 0; + + /** + * Sets maximum bitrate of the codec. + * @param aMaxBitrate value of maximum bitrate used for encoding + * @leave KErrNotSupported if codec doesn't support frame sizes issued + */ + virtual void SetMaxBitrateL( TUint aMaxBitrate ) = 0; + + /** + * Sets resolutions allowed with the codec. + * @param aResolutions bitfield of allowed resolutions + * @leave KErrNotSupported if codec doesn't support resolutions issued + */ + virtual void SetAllowedResolutionsL( TUint aResolutions ) = 0; + + /** + * Sets resolution of the video. + * @param aResolution resolution of the video in pixels + * @leave KErrNotSupported if codec doesn't support resolution issued + */ + virtual void SetResolutionL( TSize aResolution ) = 0; + + /** + * Sets frame rates allowed with the codec. + * @param aFrameRates allowed frame rate values as a bitfield + * @leave KErrNotSupported if codec doesn't support frame rates issued + */ + virtual void SetAllowedFrameRatesL( TUint aFrameRates ) = 0; + + /** + * Sets frame rate used with the codec for encoding. + * @param aFrameRate frame rate for encoding + * @leave KErrNotSupported if codec doesn't support frame rate value + * issued + */ + virtual void SetFrameRateL( TReal aFrameRate ) = 0; + + /** + * Sets preferred encoding device for uplink stream and preferred decoding + * device for downlink stream. + * @param aEncodingDecodingDevice + * @leave KErrNotSupported if setting preferred device is not possible + */ + virtual void SetPreferredEncodingDecodingDeviceL( + TUid aEncodingDecodingDevice ) = 0; + + /** + * Set config key (sprop-parameter-sets) + * @param aConfigKey, config key as Base64 encoded + * @leave KErrNotSupported if setting config key is not possible + */ + virtual void SetConfigKeyL( const TDesC8& aConfigKey ) = 0; + + + public: // Getters + + /** + * Gets maximum bit rate currently allowed + * @return maximum bit rate + */ + IMPORT_C TUint MaxBitRate() const; + + /** + * Gets currently allowed resolutions as a bitfield + * @return currently allowed resolutions as a bitfield + */ + IMPORT_C TUint AllowedResolutions() const; + + /** + * Gets current resolution + * @return current resolution + */ + IMPORT_C TSize Resolution() const; + + /** + * Gets frame rates currently allowed for encoding and decoding. + * @return allowed frame rate values as a bitfield + */ + IMPORT_C TUint AllowedFrameRates() const; + + /** + * Gets frame rate currently used for encoding and decoding. + * @return current frame rate value + */ + IMPORT_C TReal FrameRate() const; + + /** + * Get config key (sprop-parameter-sets) + * @return config key as Base64 encoded or NULL, ownership + * is transferred. + */ + IMPORT_C HBufC8* ConfigKeyL() const; + + + protected: // New functions + + /** + * C++ default constructor. + */ + CMceVideoCodec(); + + + + + private: // Reserved for future use + + TAny* iReserved; + + public: // stub data + + TReal iFrameRate; + TUint iMaxBitRate; + TUint iAllowedResolutions; + TInt iResolutionWidth; + TInt iResolutionHeight; + TUint iAllowedFrameRates; + TUint iClockRate; + + HBufC8* iConfigKey; + TUid iEncodingDecodingDevice; + + }; + + +#endif + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mcevideostream.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mcevideostream.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,176 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef MCEVIDEOSTREAM_H +#define MCEVIDEOSTREAM_H + +// INCLUDES +#include +#include "mcemediastream.h" + +// CONSTANTS +const TMceMediaType KMceVideo = 2; + +// FORWARD DECLARATIONS +class CMceVideoCodec; + +// CLASS DECLARATION + +/** +* Class for representing unidirectional video stream. +* +* It defines the used video codecs for the stream. +* In order to be complete structure, at least one codec is required. +* +* @lib mceclient.lib +*/ +class CMceVideoStream : public CMceMediaStream + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CMceVideoStream* NewL(); + + /** + * Two-phased constructor. + */ + IMPORT_C static CMceVideoStream* NewLC(); + + /** + * Destructor. + */ + IMPORT_C ~CMceVideoStream(); + + public: // Functions + + /** + * Returns the codecs available to the session. + * For CMceOutSession, array contains all codecs supported by + * terminal in default. For CMceInSession, array contains codecs + * that were offered by remote terminal, and supported by local terminal. + * Codecs are in preference order in the array. + * Codec in the first element of the array has highest preference. + * Adding, removing or replacing a codec or changing the preference + * of a codec causes the returned array to be in invalid state. + * @return codecs available for the session + */ + IMPORT_C const RPointerArray& Codecs(); + + /** + * Adds codec to the stream. The codec contains preference value + * which will define its preference when added to the stream. + * Preference of codecs with the same preference value is determined + * by order they were added to the stream. In case of bound streams, + * codec is also automatically added to the opposite direction stream. + * After adding a codec an array of codecs received with a call + * to Codecs() is not valid. + * @param aCodec codec added to the stream; ownership is transferred + */ + IMPORT_C void AddCodecL( CMceVideoCodec* aCodec ); + + /** + * Removes codec from the stream. In case of bound streams, codec is + * also automatically removed from the opposite direction stream. + * After removing a codec an array of codecs previously received with + * a call to Codecs() is not valid. + * @param aCodec codec removed from stream + */ + IMPORT_C void RemoveCodecL( CMceVideoCodec& aCodec ); + + /** + * Replaces codecs of the stream. Preference values of codecs will define + * the preference order. In case of bound streams, codecs are + * also automatically added to the opposite direction stream. + * After replacing codecs an array of codecs received with a call + * to Codecs() is not valid. + * @param aCodecs array of codecs which will replace existing codecs; + * ownership is transferred + */ + IMPORT_C void ReplaceCodecsL( RPointerArray* aCodecs ); + + /** + * Gets supported video codecs of the current stream configuration. + * Supported codecs for this video stream is affected by attached + * sinks and sources. + * @return supported video codecs of the current stream configuration + */ + IMPORT_C const RPointerArray& + SupportedVideoCodecs() const; + + + public: // From CMceMediaStream + + /** + * Initializes the stream. + * @param aParent the parent + */ + void InitializeL( CMceSession& aParent ); + + /** + * Initializes the stream. + * @param aManager the manager; ownership is not transferred + */ + void InitializeL( CMceManager* aManager ); + + + protected: // From CMceMediaStream + + /** + * Determine whether current combination of source and sinks + * is allowed for spesific stream type. + * @return ETrue is combination is allowed; otherwise EFalse + */ + virtual TBool IsAllowedCombination(); + + private: + + /** + * C++ default constructor. + */ + CMceVideoStream(); + + /** + * Second-phase constructor. + */ + void ConstructL(); + + + private: // Owned data + + /** + * Codecs. + */ + RPointerArray iCodecs; + + /** + * Supported video codecs. + */ + RPointerArray iSupportedVideoCodecs; + + private: // Reserved for future use + + TAny* iReserved; + + + public: // Stub data + + }; + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mussessionsimulator.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mussessionsimulator.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,77 @@ +/* +* 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: This interface is used by +* clients to get and availability setting for Video Charging +* +*/ + + +#ifndef MUSSESSIONSIMULATOR_H_ +#define MUSSESSIONSIMULATOR_H_ + +#include +#include + +class MMceSessionObserver; + +class MTimerNotify + { + public: + virtual void TimerExpired(TAny* aTimer,TInt aError) = 0; + }; + + class CMusTestTimer: public CActive + { + public: + static CMusTestTimer* NewL(const TInt aPriority,MTimerNotify& aNotify); + ~CMusTestTimer(); + public: + void At(const TTime& aTime); + void After(TTimeIntervalMicroSeconds32 aInterval); + void Inactivity(TTimeIntervalSeconds aSeconds); + protected: + void RunL(); + void DoCancel(); + private: + CMusTestTimer(const TInt aPriority,MTimerNotify& aNotify); + void ConstructL(void); + private: + RTimer iTimer; + MTimerNotify& iNotify; + }; + +class CMusTestSessionSimulator : public MTimerNotify + { + +public: + static CMusTestSessionSimulator* NewL( CMceManager& aObserver ); + CMusTestSessionSimulator( CMceManager& aObserver ); + ~CMusTestSessionSimulator(); + void StartL(); + void Stop(); + TBool IsRunning(); +private: + void ConstructL(); + void StateChangeL(); + void TimerExpired(TAny* aTimer,TInt aError); + void SimulateReceiveSession(); +private: + CMceManager& iManager; + +private : + CMusTestTimer* iTimer; + TBool ibIncoming; + }; + +#endif /* MUSSESSIONSIMULATOR_H_ */ diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mustestdrawer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/inc/mustestdrawer.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,39 @@ +/* +* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 observer class for monitoring SIP profiles. +* +*/ + + +#ifndef MMUSTESTDRAWER_H +#define MMUSTESTDRAWER_H + +#include +#include + +class CMusTestDrawer : public CBase,MDirectScreenAccess + { +public: + CMusTestDrawer* NewL(); + CMusTestDrawer* NewLC(); + ~CMusTestDrawer(); + void DrawL( const TRect& aRect); + virtual void Restart(RDirectScreenAccess::TTerminationReasons aReason); +private: + CMusTestDrawer(); + void ConstructL(); + + }; + +#endif // MMUSTESTDRAWER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/src/mccscreen.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/src/mccscreen.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,402 @@ +/* +* 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: +* +*/ + + + + +#include +#include +#include + +#include "MccScreen.h" +#include "muslogger.h" + +// EXTERNAL DATA STRUCTURES + +// EXTERNAL FUNCTION PROTOTYPES + +// CONSTANTS + +_LIT(KMccWindowGroupName,"32MccVideoWindow"); + +// MACROS + +// LOCAL CONSTANTS AND MACROS + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// ============================= LOCAL FUNCTIONS =============================== + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CMccScreen::CMccScreen +// ----------------------------------------------------------------------------- +// +CMccScreen* CMccScreen::NewL( + TPoint aPos, + TSize aArea, + TInt aIndex, + TInt aWindowOrdinalPosition, + TInt aWindowOrdinalPriority, + TSize aViewFinderImageSize ) + { + CMccScreen* self = new ( ELeave ) CMccScreen( aPos, + aArea, + aIndex, + aWindowOrdinalPosition, + aWindowOrdinalPriority ); + CleanupStack::PushL( self ); + self->ConstructL( aViewFinderImageSize ); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CMccScreen::CMccScreen +// ----------------------------------------------------------------------------- +// +CMccScreen::CMccScreen( + TPoint aPos, + TSize aArea, + TInt aIndex, + TInt aWindowOrdinalPosition, + TInt aWindowOrdinalPriority ) : + iDeviceIndex( aIndex ), + iPosition( aPos ), + iArea( aArea ), + iWindowOrdinalPosition( aWindowOrdinalPosition ), + iWindowOrdinalPriority( aWindowOrdinalPriority ), + iAborted( ETrue ) + { + } + +// ----------------------------------------------------------------------------- +// CMccScreen::CMccScreen +// ----------------------------------------------------------------------------- +// +CMccScreen::~CMccScreen() + { + MUS_LOG( "CMccScreen::~CMccScreen" ) + + DetachFrame(); // Must do bitmap detach before releasing window resources + delete iDirectScreenAccess; + delete iDev; + delete iRw; + delete iRwGroup; + iRwSession.Close(); + + MUS_LOG( "CMccScreen::~CMccScreen, exit" ) + } + +// ----------------------------------------------------------------------------- +// CMccScreen::CMccScreen +// ----------------------------------------------------------------------------- +// +void CMccScreen::ConstructL( TSize aViewFinderImageSize ) + { + MUS_LOG( "CMccScreen::ConstructL" ) + User::LeaveIfError( iRwSession.Connect() ); + + // Create window group + TInt groupId = iRwSession.GetFocusWindowGroup(); + iRwGroup = new (ELeave) RWindowGroup( iRwSession ) ; + //TInt handle = iRwSession.GetWindowGroupHandle( groupId ); + + MUS_LOG1( "CMccScreen::ConstructL, window ordinal pos", iWindowOrdinalPosition ) + MUS_LOG1( "CMccScreen::ConstructL, window ordinal priority", iWindowOrdinalPriority ) + + iRwGroup->Construct( groupId, EFalse ); + iRwGroup->SetName( KMccWindowGroupName ); + + iRwGroup->SetOrdinalPosition( iWindowOrdinalPosition, iWindowOrdinalPriority ); + + // Create screen device + iDev = new (ELeave) CWsScreenDevice( iRwSession ); + iDev->Construct( iDeviceIndex ); + + TInt currMode = iDev->CurrentScreenMode(); + MUS_LOG1( "CMccScreen::ConstructL, screen device mode = %d", currMode ) + + TPixelsTwipsAndRotation sizeAndRotation; + iDev->GetScreenModeSizeAndRotation( currMode, sizeAndRotation ); + MUS_LOG2( "CMccScreen::ConstructL, screen device size %d %d", + sizeAndRotation.iPixelSize.iWidth, + sizeAndRotation.iPixelSize.iHeight ) + + MUS_LOG1( "CMccScreen::ConstructL, screen device orientation %d", + sizeAndRotation.iRotation ) + + // Create window + iRw = new (ELeave) RWindow( iRwSession ); + + iRw->Construct( *iRwGroup, (TUint32) this + 2 ); + + MUS_LOG2( "CMccScreen::ConstructL, window pos %d %d", iPosition.iX, iPosition.iY ) + MUS_LOG2( "CMccScreen::ConstructL, window size %d %d", iArea.iWidth, iArea.iHeight ) + + iRw->SetPosition( iPosition ); + iRw->SetBackgroundColor( KRgbBlack ); + iRw->SetSize( iArea ); + iRw->SetOrdinalPosition( iWindowOrdinalPosition ); + iRw->Activate(); + iRwSession.Flush(); + + // Create direct screen access + iDirectScreenAccess = CDirectScreenAccess::NewL( iRwSession, *iDev, *iRw, *this ); + + UpdateViewFinderArea( aViewFinderImageSize ); + + MUS_LOG2( "CMccScreen::ConstructL, viewfinder pos %d %d", + iViewFinderImageRect.iTl.iX, iViewFinderImageRect.iTl.iY ) + MUS_LOG2( "CMccScreen::ConstructL, viewfinder size %d %d", + iViewFinderImageRect.Width(), iViewFinderImageRect.Height() ) + + MUS_LOG( "CMccScreen::ConstructL, exit" ) + } + +// ----------------------------------------------------------------------------- +// CMccScreen::CMccScreen +// ----------------------------------------------------------------------------- +// +void CMccScreen::StartL() + { + MUS_LOG( "CMccScreen::StartL" ) + + iAborted = EFalse; + + iDirectScreenAccess->StartL(); + iGc = iDirectScreenAccess->Gc(); + iFbsDev = iDirectScreenAccess->ScreenDevice(); + iRegion = iDirectScreenAccess->DrawingRegion(); + +#ifdef __MCC_CONTROLLER + if ( iRegion && !iRegion->IsEmpty() ) + { + for ( TInt i = 0; i < iRegion->Count(); i++ ) + { + const TRect& regionRect = (*iRegion)[ i ]; + MUS_LOG_INT2( "CMccScreen::StartL, rect tl", regionRect.iTl.iX, regionRect.iTl.iY ) + MUS_LOG_INT2( "CMccScreen::StartL, rect br", regionRect.iBr.iX, regionRect.iBr.iY ) + } + } +#endif + + iGc->SetClippingRegion( iRegion ); + + // Fill with black areas which are not covered by viewfinder image. + // If viewfinder image has not been yet received and drawn, fill whole area. + // + iGc->SetBrushColor( KRgbBlack ); + iGc->SetBrushStyle( CGraphicsContext::ESolidBrush ); + + if ( !iFirstImageDrawn ) + { + // Whole area + TPoint pointTl( 0, 0 ); + TRect rect( pointTl, iArea ); + iGc->DrawRect( rect ); + } + else + { + // Upper area + TPoint pointTl( 0, 0 ); + TPoint pointBr( iArea.iWidth, iViewFinderImageRect.iTl.iY ); + TRect rect( pointTl, pointBr ); + iGc->DrawRect( rect ); + + // Lower area + pointTl.SetXY( 0, iViewFinderImageRect.iBr.iY ); + pointBr.SetXY( iArea.iWidth, iArea.iHeight ); + rect.SetRect( pointTl, pointBr ); + iGc->DrawRect( rect ); + + // Left area + pointTl.SetXY( 0, iViewFinderImageRect.iTl.iY ); + pointBr.SetXY( iViewFinderImageRect.iTl.iX, iViewFinderImageRect.iBr.iY ); + rect.SetRect( pointTl, pointBr ); + iGc->DrawRect( rect ); + + // Right area + pointTl.SetXY( iViewFinderImageRect.iBr.iX, iViewFinderImageRect.iTl.iY ); + pointBr.SetXY( iArea.iWidth, iViewFinderImageRect.iBr.iY ); + rect.SetRect( pointTl, pointBr ); + iGc->DrawRect( rect ); + } + + if ( iAttachedFrame ) + { + MUS_LOG( "CMccScreen::StartL, draw attached frame" ) + + TSize viewFinderImageSize = iAttachedFrame->SizeInPixels(); + + TPoint corner = UpdateViewFinderArea( viewFinderImageSize ); + + iGc->BitBlt( corner, iAttachedFrame ); + } + + DoScreenDeviceUpdate(); + + iGc->SetBrushStyle( CGraphicsContext::ENullBrush ); + + MUS_LOG( "CMccScreen::StartL, exit" ) + } + +// ----------------------------------------------------------------------------- +// CMccScreen::CMccScreen +// ----------------------------------------------------------------------------- +// +void CMccScreen::Stop() + { + MUS_LOG( "CMccScreen::Stop" ) + iDirectScreenAccess->Cancel(); + MUS_LOG( "CMccScreen::Stop, exit" ) + } + +// ----------------------------------------------------------------------------- +// CMccScreen::CMccScreen +// ----------------------------------------------------------------------------- +// +void CMccScreen::Restart( RDirectScreenAccess::TTerminationReasons /*aReason*/ ) + { + MUS_LOG( "CMccScreen::Restart" ) + + TRAP_IGNORE( StartL() ); + } + +// ----------------------------------------------------------------------------- +// CMccScreen::CMccScreen +// ----------------------------------------------------------------------------- +// +void CMccScreen::AbortNow( RDirectScreenAccess::TTerminationReasons /*aReason*/ ) + { + MUS_LOG( "CMccScreen::AbortNow" ) + iDirectScreenAccess->Cancel(); + + iAborted = ETrue; + } + +// ----------------------------------------------------------------------------- +// CMccScreen::CMccScreen +// ----------------------------------------------------------------------------- +// +void CMccScreen::Draw( CFbsBitmap& aFrame ) + { + // When frame draw is requested, attached frame is not anymore drawn + DetachFrame(); + + DoDraw( aFrame ); + } + +// ----------------------------------------------------------------------------- +// CMccScreen::AttachFrameL +// ----------------------------------------------------------------------------- +// +void CMccScreen::AttachFrameL( CFbsBitmap* aFrame ) + { + MUS_LOG( "CMccScreen::AttachFrameL" ) + + __ASSERT_ALWAYS( aFrame, User::Leave( KErrArgument ) ); + + DetachFrame(); + + iAttachedFrame = aFrame; + + DoDraw( *iAttachedFrame ); + + MUS_LOG( "CMccScreen::AttachFrameL, exit" ) + } + +// ----------------------------------------------------------------------------- +// CMccScreen::DetachFrame +// ----------------------------------------------------------------------------- +// +void CMccScreen::DetachFrame() + { + if ( iAttachedFrame ) + { + MUS_LOG( "CMccScreen::DetachFrame, detaching" ) + iAttachedFrame->Reset(); + delete iAttachedFrame; + } + + iAttachedFrame = NULL; + } + +// ----------------------------------------------------------------------------- +// CMccScreen::UpdateViewFinderArea +// ----------------------------------------------------------------------------- +// +TPoint CMccScreen::UpdateViewFinderArea( TSize aViewFinderImageSize ) + { + TPoint corner( 0, 0 ); + if ( aViewFinderImageSize.iWidth < iArea.iWidth ) + { + // Divide the subtraction by two (i.e. do centering) + corner.iX = ( iArea.iWidth - aViewFinderImageSize.iWidth ) >> 1; + } + + if ( aViewFinderImageSize.iHeight < iArea.iHeight ) + { + // Divide the subtraction by two (i.e. do centering) + corner.iY = ( iArea.iHeight - aViewFinderImageSize.iHeight ) >> 1; + } + + iViewFinderImageRect = TRect( corner, aViewFinderImageSize ); + + return corner; + } + +// ----------------------------------------------------------------------------- +// CMccScreen::DoDraw +// ----------------------------------------------------------------------------- +// +void CMccScreen::DoDraw( CFbsBitmap& aFrame ) + { + if ( !iAborted && iGc ) + { + iFirstImageDrawn = ETrue; + + TSize viewFinderImageSize = aFrame.SizeInPixels(); + + TPoint corner = UpdateViewFinderArea( viewFinderImageSize ); + + iGc->BitBlt( corner, &aFrame ); + + DoScreenDeviceUpdate(); + } + } + +// ----------------------------------------------------------------------------- +// CMccScreen::DoScreenDeviceUpdate +// ----------------------------------------------------------------------------- +// +void CMccScreen::DoScreenDeviceUpdate() + { + if ( iFbsDev ) + { + iFbsDev->Update(); + } + } + +// End of file + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/src/mceamrcodec.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/src/mceamrcodec.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,194 @@ +/* +* Copyright (c) 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: +* +*/ + + +#include "mceamrcodec.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CMceAmrCodec::~CMceAmrCodec +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceAmrCodec::~CMceAmrCodec() + { + } + +// ----------------------------------------------------------------------------- +// CMceAmrCodec::CloneL +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceAudioCodec* CMceAmrCodec::CloneL() const + { + CMceAmrCodec* clone = CMceAmrCodec::NewLC( iSdpName ); + + if ( iFmtpAttr ) + { + clone->iFmtpAttr = iFmtpAttr->AllocL(); + } + clone->iEnableVAD = iEnableVAD; + clone->iSamplingFreq = iSamplingFreq; + clone->iPTime = iPTime; + clone->iMaxPTime = iMaxPTime; + clone->iBitrate = iBitrate; + clone->iAllowedBitrates = iAllowedBitrates; + clone->iPayloadType = iPayloadType; + clone->iCodecMode = iCodecMode; + clone->iFourCC = iFourCC; + clone->iFrameSize = iFrameSize; + + CleanupStack::Pop( clone ); + + return clone; + } + +// ----------------------------------------------------------------------------- +// CMceAmrCodec::EnableVAD +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceAmrCodec::EnableVAD( TBool aEnableVAD ) + { + iEnableVAD = aEnableVAD; + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CMceAmrCodec::SetBitrate +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceAmrCodec::SetBitrate(TUint aBitrate) + { + iBitrate = aBitrate; + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CMceAmrCodec::SetAllowedBitrates +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceAmrCodec::SetAllowedBitrates(TUint aBitrates) + { + iAllowedBitrates = aBitrates; + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CMceAmrCodec::SetSamplingFreq +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceAmrCodec::SetSamplingFreq(TUint aSamplingFreq) + { + iSamplingFreq = aSamplingFreq; + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CMceAmrCodec::SetPTime +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceAmrCodec::SetPTime(TUint aPTime) + { + iPTime = aPTime; + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CMceAmrCodec::SetMaxPTime +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceAmrCodec::SetMaxPTime(TUint aMaxPTime) + { + iMaxPTime = aMaxPTime; + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CMceAmrCodec::SetPayloadType +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceAmrCodec::SetPayloadType(TUint8 aPayloadType) + { + iPayloadType = aPayloadType; + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CMceAmrCodec::SetCodecMode +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceAmrCodec::SetCodecMode(TUint aCodecMode) + { + iCodecMode = aCodecMode; + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CMceAmrCodec::NewL +// ----------------------------------------------------------------------------- +// +CMceAmrCodec* CMceAmrCodec::NewL( TBuf8 aSdpName ) + { + CMceAmrCodec* self = NewLC( aSdpName ); + CleanupStack::Pop( self ); + return self; + + } + +// ----------------------------------------------------------------------------- +// CMceAmrCodec::NewL +// ----------------------------------------------------------------------------- +// +CMceAmrCodec* CMceAmrCodec::NewLC( TBuf8 aSdpName ) + { + CMceAmrCodec* self = new (ELeave) CMceAmrCodec(); + CleanupStack::PushL( self ); + self->ConstructL( aSdpName ); + return self; + + } + +// ----------------------------------------------------------------------------- +// CMceAmrCodec::CMceAmrCodec +// ----------------------------------------------------------------------------- +// +CMceAmrCodec::CMceAmrCodec() + : CMceAudioCodec() + { + } + + +// ----------------------------------------------------------------------------- +// CMceAmrCodec::ConstructL +// ----------------------------------------------------------------------------- +// +void CMceAmrCodec::ConstructL( TBuf8 aSdpName ) + { + iSdpName = aSdpName; + } + + +// ----------------------------------------------------------------------------- +// CMceAmrCodec::SetSdpNameL +// ----------------------------------------------------------------------------- +// +void CMceAmrCodec::SetSdpNameL( const TDesC8& aSdpName ) + { + __ASSERT_ALWAYS( aSdpName.Length() <= KMceMaxSdpNameLength, + User::Leave( KErrArgument ) ); + iSdpName.Copy( aSdpName ); + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/src/mceaudiocodec.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/src/mceaudiocodec.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,92 @@ +/* +* Copyright (c) 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: +* +*/ + + +#include "mceaudiocodec.h" +#include "mcesession.h" +#include "mcemanager.h" +#include "mcemediastream.h" + + +#define _FLAT_DATA static_cast( iFlatData ) +#define FLAT_DATA( data ) _FLAT_DATA->data + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// CMceAudioCodec::InitializeL +// ----------------------------------------------------------------------------- +// +void CMceAudioCodec::InitializeL( CMceMediaStream& aParent ) + { + CMceCodec::InitializeL( aParent ); + } + +// ----------------------------------------------------------------------------- +// CMceAudioCodec::~CMceAudioCodec +// ----------------------------------------------------------------------------- +// +CMceAudioCodec::~CMceAudioCodec() + { + } + +// ----------------------------------------------------------------------------- +// CMceAudioCodec::SamplingFreq +// ----------------------------------------------------------------------------- +// +TUint CMceAudioCodec::SamplingFreq() const + { + return iSamplingFreq; + + } + +// ----------------------------------------------------------------------------- +// CMceAudioCodec::VAD +// ----------------------------------------------------------------------------- +// +TBool CMceAudioCodec::VAD() const + { + return iEnableVAD; + } + +// ----------------------------------------------------------------------------- +// CMceAudioCodec::PTime +// ----------------------------------------------------------------------------- +// +TUint CMceAudioCodec::PTime() const + { + return iPTime; + } + +// ----------------------------------------------------------------------------- +// CMceAudioCodec::MaxPTime +// ----------------------------------------------------------------------------- +// +TUint CMceAudioCodec::MaxPTime() const + { + return iMaxPTime; + } + +// ----------------------------------------------------------------------------- +// CMceAudioCodec::CMceAudioCodec +// ----------------------------------------------------------------------------- +// +CMceAudioCodec::CMceAudioCodec() : + CMceCodec() + { + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/src/mceaudiostream.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/src/mceaudiostream.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,155 @@ +/* +* Copyright (c) 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: +* +*/ + + +#include "mceaudiostream.h" +#include "mcemanager.h" +#include "mceaudiocodec.h" +#include "mcesession.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CMceAudioStream::NewL +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceAudioStream* CMceAudioStream::NewL() + { + CMceAudioStream* self = NewLC(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CMceAudioStream::NewLC +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceAudioStream* CMceAudioStream::NewLC() + { + CMceAudioStream* self = new (ELeave) CMceAudioStream(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// ----------------------------------------------------------------------------- +// CMceAudioStream::~CMceAudioStream +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceAudioStream::~CMceAudioStream() + { + iCodecs.ResetAndDestroy(); + } + +// ----------------------------------------------------------------------------- +// CMceAudioStream::Codecs +// ----------------------------------------------------------------------------- +// +EXPORT_C const RPointerArray& CMceAudioStream::Codecs() + { + return iCodecs; + } + +// ----------------------------------------------------------------------------- +// CMceAudioStream::AddCodecL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceAudioStream::AddCodecL(CMceAudioCodec* aCodec) + { + __ASSERT_ALWAYS(aCodec, User::Leave(KErrArgument)); + iCodecs.AppendL(aCodec); + } + +// ----------------------------------------------------------------------------- +// CMceAudioStream::RemoveCodecL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceAudioStream::RemoveCodecL(CMceAudioCodec& aCodec) + { + for(int i = 0; i < iCodecs.Count(); i++ ) + { + if( iCodecs[i] == &aCodec ) + { + delete iCodecs[i]; + iCodecs.Remove( i ); + } + } + } + +// ----------------------------------------------------------------------------- +// CMceAudioStream::CMceAudioStream +// ----------------------------------------------------------------------------- +// +CMceAudioStream::CMceAudioStream() + :CMceMediaStream() + { + iType = KMceAudio; + } + + +// ----------------------------------------------------------------------------- +// CMceAudioStream::ConstructL +// ----------------------------------------------------------------------------- +// +void CMceAudioStream::ConstructL() + { + } + +// ----------------------------------------------------------------------------- +// CMceAudioStream::InitializeL +// ----------------------------------------------------------------------------- +// +void CMceAudioStream::InitializeL( CMceSession& aParent ) + { + + CMceMediaStream::InitializeL( aParent ); + + InitializeL( &aParent.Manager() ); + + for( TInt i = 0; i < iCodecs.Count(); i++ ) + { + iCodecs[i]->InitializeL( *this ); + } + } + + +// ----------------------------------------------------------------------------- +// CMceAudioStream::InitializeL +// ----------------------------------------------------------------------------- +// +void CMceAudioStream::InitializeL( CMceManager* aManager ) + { + CMceMediaStream::InitializeL( aManager ); + if ( aManager && iCodecs.Count() == 0 ) + { + const RPointerArray supportedCodes = + aManager->SupportedAudioCodecs(); + for( TInt i = 0; i < supportedCodes.Count(); i++ ) + { + CMceAudioCodec* codec = supportedCodes[i]->CloneL(); + CleanupStack::PushL( codec ); + iCodecs.AppendL( codec ); + CleanupStack::Pop( codec ); + } + + } + + } + + + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/src/mceavccodec.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/src/mceavccodec.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,286 @@ +/* +* 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: +* +*/ + + +#include "mceavccodec.h" + +// Stub constants +const TReal KMceAvcDefaultFrameRate = 15; +const TInt KMceAvcDefaultFrameSize = 10000; +const TInt KMceAvcDefaultAllowedBitrate = KMceAvcCodecProfileIdBaseline | + KMceAvcCodecProfileIopConstraintSet | + KMceAvcBitrateLevel1; +const TInt KMceAvcLevel1BitrateBps = 64000; + +const TUint KMceAvcDefaultFrameHeight = 176; +const TUint KMceAvcDefaultFrameWidth = 144; + + + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CMceAvcCodec::~CMceAvcCodec +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceAvcCodec::~CMceAvcCodec() + { + } + + +// ----------------------------------------------------------------------------- +// CMceAvcCodec::NewL +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceAvcCodec* CMceAvcCodec::NewL( TBuf8 aSdpName ) + { + CMceAvcCodec* self = NewLC( aSdpName ); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// CMceAvcCodec::NewL +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceAvcCodec* CMceAvcCodec::NewLC( TBuf8 aSdpName ) + { + CMceAvcCodec* self = new (ELeave) CMceAvcCodec(); + CleanupStack::PushL( self ); + self->ConstructL( aSdpName ); + return self; + } + + +// ----------------------------------------------------------------------------- +// CMceAvcCodec::SetBitrate +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceAvcCodec::SetBitrate( TUint aBitrate ) + { + iBitrate = aBitrate; + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// CMceAvcCodec::SetAllowedBitrates +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceAvcCodec::SetAllowedBitrates(TUint aBitrates) + { + iAllowedBitrates = aBitrates; + + delete iConfigKey; + iConfigKey = NULL; + + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// CMceAvcCodec::SetCodecMode +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceAvcCodec::SetCodecMode( TUint aCodecMode ) + { + if ( aCodecMode == KMceAvcModeSingleNal ) + { + iCodecMode = KMceAvcModeSingleNal; + return KErrNone; + } + return KErrNotSupported; + } + + +// ----------------------------------------------------------------------------- +// CMceAvcCodec::SetPayloadType +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceAvcCodec::SetPayloadType(TUint8 aPayloadType) + { + iPayloadType = aPayloadType; + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// CMceAvcCodec::CloneL +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceVideoCodec* CMceAvcCodec::CloneL() const + { + CMceAvcCodec* clone = CMceAvcCodec::NewLC( iSdpName ); + + if ( iFmtpAttr ) + { + clone->iFmtpAttr = iFmtpAttr->AllocL(); + } + clone->iPayloadType = iPayloadType; + + clone->iBitrate = iBitrate; + clone->iAllowedBitrates = iAllowedBitrates; + clone->iCodecMode = iCodecMode; + clone->iFourCC = iFourCC; + clone->iFrameSize = iFrameSize; + + clone->iFrameRate = iFrameRate; + clone->iMaxBitRate = iMaxBitRate; + clone->iAllowedResolutions = iAllowedResolutions; + clone->iResolutionWidth = iResolutionWidth; + clone->iResolutionHeight = iResolutionHeight; + clone->iAllowedFrameRates = iAllowedFrameRates; + clone->iClockRate = iClockRate; + + clone->iPacketizationMode = iPacketizationMode; + clone->iAllowedPacketizationModes = iAllowedPacketizationModes; + + CleanupStack::Pop( clone ); + return clone; + } + + +// ----------------------------------------------------------------------------- +// CMceAvcCodec:: +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceAvcCodec::SetMaxBitrateL( TUint aMaxBitrate ) + { + delete HBufC::NewL( 1 ); // To cause leave in simulation + iMaxBitRate = aMaxBitrate; + } + + +// ----------------------------------------------------------------------------- +// CMceAvcCodec:: +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceAvcCodec::SetAllowedResolutionsL( TUint aResolutions ) + { + delete HBufC::NewL( 1 ); // To cause leave in simulation + iAllowedResolutions = aResolutions; + } + + +// ----------------------------------------------------------------------------- +// CMceAvcCodec:: +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceAvcCodec::SetResolutionL( TSize aResolution ) + { + delete HBufC::NewL( 1 ); // To cause leave in simulation + iResolutionWidth = aResolution.iWidth; + iResolutionHeight = aResolution.iHeight; + } + + +// ----------------------------------------------------------------------------- +// CMceAvcCodec:: +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceAvcCodec::SetAllowedFrameRatesL( TUint aFrameRates ) + { + delete HBufC::NewL( 1 ); // To cause leave in simulation + iAllowedFrameRates = aFrameRates; + } + + +// ----------------------------------------------------------------------------- +// CMceAvcCodec:: +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceAvcCodec::SetFrameRateL( TReal aFrameRate ) + { + delete HBufC::NewL( 1 ); // To cause leave in simulation + iFrameRate = aFrameRate; + } + + +// ----------------------------------------------------------------------------- +// CMceAvcCodec::SetPreferredEncodingDecodingDeviceL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceAvcCodec::SetPreferredEncodingDecodingDeviceL( + TUid aEncodingDecodingDevice ) + { + delete HBufC::NewL( 1 ); // To cause leave in simulation + iEncodingDecodingDevice = aEncodingDecodingDevice; + } + + +// ----------------------------------------------------------------------------- +// CMceAvcCodec::SetEncodingKeyL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceAvcCodec::SetConfigKeyL( const TDesC8& aConfigKey ) + { + HBufC8* configKey = aConfigKey.AllocL(); + delete iConfigKey; + iConfigKey = configKey; + } + + +// ----------------------------------------------------------------------------- +// CMceAvcCodec::SetSdpNameL +// ----------------------------------------------------------------------------- +// +void CMceAvcCodec::SetSdpNameL( const TDesC8& aSdpName ) + { + __ASSERT_ALWAYS( aSdpName.Length() <= KMceMaxSdpNameLength, + User::Leave( KErrArgument ) ); + delete HBufC::NewL( 1 ); // To cause leave in simulation + iSdpName.Copy( aSdpName ); + } + + +// ----------------------------------------------------------------------------- +// CMceAvcCodec::CMceAvcCodec +// ----------------------------------------------------------------------------- +// +CMceAvcCodec::CMceAvcCodec() + :CMceVideoCodec() + { + } + + +// ----------------------------------------------------------------------------- +// CMceAvcCodec::ConstructL +// ----------------------------------------------------------------------------- +// +void CMceAvcCodec::ConstructL( TBuf8 aSdpName ) + { + iSdpName = aSdpName; + iCodecMode = KMceAvcModeSingleNal; + iClockRate = KMceAvcDefaultFrameRate; + iFrameRate = KMceAvcDefaultFrameRate; + iResolutionWidth = KMceAvcDefaultFrameWidth; + iResolutionHeight = KMceAvcDefaultFrameHeight; + iBitrate = KMceAvcLevel1BitrateBps; + iMaxBitRate = KMceAvcLevel1BitrateBps; + iAllowedBitrates = KMceAvcDefaultAllowedBitrate; + iFrameSize = KMceAvcDefaultFrameSize; + // Defaults should be defined in MCE API + const TUint8 KMceDefaultAvcPayloadType = 98; + iPayloadType = KMceDefaultAvcPayloadType; + + } + + + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/src/mcecamerasource.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/src/mcecamerasource.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,356 @@ +/* +* 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: +* +*/ + + +#include "mcecamerasource.h" +#include "mcesession.h" +#include "mcemediastream.h" +#include "mcemanager.h" + + +const TInt KMinDigitalZoom = 0; +const TInt KMinContrast = -100; +const TInt KMaxContrast = 100; +const TInt KMinBrightness = -100; +const TInt KMaxBrightness = 100; + + +const TInt KInitialCameraIndex = 0; +const TInt KInitialZoomFactor = 1; +const TInt KInitialDigitalZoomFactor = 1; +const TInt KInitialContrast = 0; +const TInt KInitialBrightness = 0; +const TInt KInitialExposure = CCamera::EExposureAuto; +const TInt KInitialWhiteBalance = CCamera::EWBAuto; + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceCameraSource* CMceCameraSource::NewL( CMceManager& aManager ) + { + CMceCameraSource* self = CMceCameraSource::NewLC( aManager ); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceCameraSource* CMceCameraSource::NewLC( CMceManager& /*aManager*/ ) + { + CMceCameraSource* self = new( ELeave )CMceCameraSource(); + CleanupStack::PushL( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceCameraSource* CMceCameraSource::NewL() + { + CMceCameraSource* self = CMceCameraSource::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceCameraSource* CMceCameraSource::NewLC() + { + CMceCameraSource* self = new( ELeave )CMceCameraSource(); + CleanupStack::PushL( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceCameraSource::~CMceCameraSource() + { + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceCameraSource::EnableL() + { + CMceMediaSource::DoEnableL(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceCameraSource::DisableL() + { + CMceMediaSource::DoDisableL(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceCameraSource::CamerasAvailable() const + { + return iCameraCount; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceCameraSource::SetCameraIndexL( TInt aCameraIndex ) + { + __ASSERT_ALWAYS( aCameraIndex >= 0 && + aCameraIndex < this->CamerasAvailable(), + User::Leave( KErrArgument ) ); + + + iCameraIndex = aCameraIndex; + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceCameraSource::GetCameraInfo( TCameraInfo& aInfo ) const + { + aInfo = iCameraInfo; + + aInfo.iMaxZoom += iCameraIndex*5; + aInfo.iMaxDigitalZoom += iCameraIndex*5; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceCameraSource::SetZoomFactorL( TInt aZoomFactor ) + { + __ASSERT_ALWAYS( aZoomFactor >= iCameraInfo.iMinZoom && + aZoomFactor <= iCameraInfo.iMaxZoom, + User::Leave( KErrArgument ) ); + + iZoomFactor = aZoomFactor; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceCameraSource::ZoomFactorL() + { + return iZoomFactor; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceCameraSource::SetDigitalZoomFactorL( TInt aDigitalZoomFactor ) + { + __ASSERT_ALWAYS( aDigitalZoomFactor >= KMinDigitalZoom && + aDigitalZoomFactor <= iCameraInfo.iMaxDigitalZoom, + User::Leave( KErrArgument ) ); + + iDigitalZoomFactor = aDigitalZoomFactor; + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceCameraSource::DigitalZoomFactorL() + { + return iDigitalZoomFactor; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceCameraSource::SetContrastL( TInt aContrast ) + { + + __ASSERT_ALWAYS( ( iCameraInfo.iOptionsSupported & + TCameraInfo::EContrastSupported ) == + TCameraInfo::EContrastSupported, + User::Leave( KErrNotSupported ) ); + + __ASSERT_ALWAYS( (( aContrast >= KMinContrast && + aContrast <= KMaxContrast ) || + aContrast == CCamera::EContrastAuto ), + User::Leave( KErrArgument ) ); + + + iContrast = aContrast; + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceCameraSource::ContrastL() + { + return iContrast; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceCameraSource::SetBrightnessL( TInt aBrightness ) + { + + __ASSERT_ALWAYS( ( iCameraInfo.iOptionsSupported & + TCameraInfo::EBrightnessSupported ) == + TCameraInfo::EBrightnessSupported, + User::Leave( KErrNotSupported ) ); + + __ASSERT_ALWAYS( (( aBrightness >= KMinBrightness && + aBrightness <= KMaxBrightness ) || + aBrightness == CCamera::EBrightnessAuto ), + User::Leave( KErrArgument ) ); + + iBrightness = aBrightness; + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceCameraSource::BrightnessL() + { + return iBrightness; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceCameraSource::SetExposureL( CCamera::TExposure aExposure ) + { + + __ASSERT_ALWAYS( ( iCameraInfo.iExposureModesSupported & aExposure ) == + aExposure, + User::Leave( KErrNotSupported ) ); + + iExposure = aExposure; + + } + + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CCamera::TExposure CMceCameraSource::ExposureL() + { + + + return static_cast( iExposure ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceCameraSource::SetWhiteBalanceL( + CCamera::TWhiteBalance aWhiteBalance ) + { + __ASSERT_ALWAYS( + ( iCameraInfo.iWhiteBalanceModesSupported & aWhiteBalance ) == + aWhiteBalance, + User::Leave( KErrNotSupported ) ); + + iWhiteBalance = aWhiteBalance; + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CCamera::TWhiteBalance CMceCameraSource::WhiteBalanceL() + { + + return static_cast( iWhiteBalance ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMceCameraSource::InitializeL( CMceManager* /*aManager*/ ) + { + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMceCameraSource::CMceCameraSource() + :CMceMediaSource(), + iCameraIndex( 0 ), + iZoomFactor( 1 ), + iDigitalZoomFactor( 0 ), + iContrast( 0 ), + iBrightness( 0 ), + iExposure( CCamera::EExposureAuto ), + iWhiteBalance( CCamera::EWBAuto ), + iCameraCount ( 2 ) + { + iType = KMceCameraSource; + iCameraInfo.iMinZoom = 1; + iCameraInfo.iMaxZoom = 3; + iCameraInfo.iMaxDigitalZoom = 10; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/src/mcecodec.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/src/mcecodec.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,304 @@ +/* +* Copyright (c) 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: +* +*/ + + +#include "mcecodec.h" +#include "mcesession.h" +#include "mcemanager.h" +#include "mcemediastream.h" +#include "mcestreamobserver.h" +#include "mcedefs.h" + + + +#define _FLAT_DATA static_cast( iFlatData ) +#define FLAT_DATA( data ) _FLAT_DATA->data + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CMceCodec::~CMceCodec +// ----------------------------------------------------------------------------- +// +CMceCodec::~CMceCodec() + { + } + +// ----------------------------------------------------------------------------- +// CMceCodec::InitializeL +// ----------------------------------------------------------------------------- +// +void CMceCodec::InitializeL( CMceMediaStream& aParent ) + { + iStream = &aParent; + } + +// ----------------------------------------------------------------------------- +// CMceCodec::SetStateL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceCodec::SetStateL( CMceCodec::TState /*aState*/ ) + { + // NOT SUPPORTED YET + User::Leave( KErrNotSupported ); + } + + +// ----------------------------------------------------------------------------- +// CMceCodec::SetStandByTimerL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceCodec::SetStandByTimerL( TUint32 /*aTimerValue*/ ) + { + // NOT SUPPORTED YET + User::Leave( KErrNotSupported ); + } + + +// ----------------------------------------------------------------------------- +// CMceCodec::SetMMFPriorityL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceCodec::SetMMFPriorityL( TInt aPriority ) + { + iMMFPriority = aPriority; + } + + +// ----------------------------------------------------------------------------- +// CMceCodec::SetMMFPriorityPreferenceL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceCodec::SetMMFPriorityPreferenceL( TInt aPriorityPreference ) + { + iMMFPriorityPreference = aPriorityPreference; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceCodec::SetKeepAliveTimerL( TUint8 aTimerValue ) + { + iKeepAliveTimer = aTimerValue; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceCodec::SetKeepAlivePayloadTypeL( TUint8 aKeepAlivePT ) + { + iKeepAlivePayloadType = aKeepAlivePT; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceCodec::SetKeepAliveDataL( const TDesC8& aData ) + { + iKeepAliveData = aData; + } + + +// ----------------------------------------------------------------------------- +// CMceCodec::State +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceCodec::TState CMceCodec::State() const + { + return CMceCodec::EDisabled; + } + + +// ----------------------------------------------------------------------------- +// CMceCodec::Id +// ----------------------------------------------------------------------------- +// +/* +EXPORT_C TMceMediaId CMceCodec::Id() const + { + return; + } +*/ + +// ----------------------------------------------------------------------------- +// CMceCodec::Type +// ----------------------------------------------------------------------------- +// +EXPORT_C TMceCodecType CMceCodec::Type() const + { + return iType; + } + +// ----------------------------------------------------------------------------- +// CMceCodec::FourCC +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint32 CMceCodec::FourCC() const + { + return iFourCC; + } + +// ----------------------------------------------------------------------------- +// CMceCodec::Bitrate +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint CMceCodec::Bitrate() const + { + return iBitrate; + } + +// ----------------------------------------------------------------------------- +// CMceAudioCodec::AllowedBitrates +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint CMceCodec::AllowedBitrates() const + { + return iAllowedBitrates; + } + +// ----------------------------------------------------------------------------- +// CMceCodec::FrameSize +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint CMceCodec::FrameSize() const + { + return iFrameSize; + } + +// ----------------------------------------------------------------------------- +// CMceCodec::CodecMode +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint CMceCodec::CodecMode() const + { + return iCodecMode; + } + +// ----------------------------------------------------------------------------- +// CMceCodec::PayloadType +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint8 CMceCodec::PayloadType() const + { + return iPayloadType; + } + + +// ----------------------------------------------------------------------------- +// CMceCodec::SdpName +// ----------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CMceCodec::SdpName() const + { + return iSdpName; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceCodec::MMFPriority() const + { + return iMMFPriority; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceCodec::MMFPriorityPreference() const + { + return iMMFPriorityPreference; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint8 CMceCodec::KeepAliveTimer() const + { + return iKeepAliveTimer; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint8 CMceCodec::KeepAlivePayloadType() const + { + return iKeepAlivePayloadType; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CMceCodec::KeepAliveData() const + { + return iKeepAliveData; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceCodec::Preference() const + { + return iPreference; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceCodec::SetPreferenceL( TInt aPreference ) + { + iPreference = aPreference; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMceCodec::SetSdpNameL( const TDesC8& aSdpName ) + { + iSdpName = aSdpName; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMceCodec::CMceCodec() + { + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/src/mcedisplaysink.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/src/mcedisplaysink.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,246 @@ +/* +* 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: +* +*/ + + +#include "mcedisplaysink.h" +#include "mcesession.h" +#include "mcemediastream.h" +#include "mcemanager.h" +#include "mccscreen.h" +#include "muslogger.h" + +#include +#include + + +#define _FLAT_DATA static_cast( iFlatData ) +#define FLAT_DATA( data ) _FLAT_DATA->data + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceDisplaySink* CMceDisplaySink::NewL( CMceManager& aManager ) + { + CMceDisplaySink* self = CMceDisplaySink::NewLC( aManager ); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceDisplaySink* CMceDisplaySink::NewLC( CMceManager& /*aManager*/ ) + { + CMceDisplaySink* self = new (ELeave) CMceDisplaySink(); + CleanupStack::PushL( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceDisplaySink* CMceDisplaySink::NewL() + { + CMceDisplaySink* self = CMceDisplaySink::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceDisplaySink* CMceDisplaySink::NewLC() + { + CMceDisplaySink* self = new( ELeave )CMceDisplaySink(); + CleanupStack::PushL( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceDisplaySink::~CMceDisplaySink() + { + delete iScreen; + iScreen = 0; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceDisplaySink::EnableL() + { + MUS_LOG("CMceDisplaySink::EnableL ->") + CMceMediaSink::DoEnableL(); + if ( !iScreen ) + { + TPoint pos (0,0); + TSize area = iDisplayRect.Size(); + TInt index = iDisplayIndex; + TInt windowOrdinalPosition = 2; + TInt windowOrdinalPriority = 1; + TSize viewFinderImageSize = iDisplayRect.Size(); + MUS_LOG2("CMceDisplaySink::EnableL display rect height=%d width=%d )",area.iHeight,area.iWidth) + iScreen = CMccScreen::NewL( pos,area,index,windowOrdinalPosition,windowOrdinalPriority,viewFinderImageSize); + } + + iScreen->StartL(); + MUS_LOG("CMceDisplaySink::EnableL <-") + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceDisplaySink::DisableL() + { + MUS_LOG("CMceDisplaySink::DisableL ->") + CMceMediaSink::DoDisableL(); + if( iScreen ) iScreen->Stop(); + MUS_LOG("CMceDisplaySink::DisableL <-") + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceDisplaySink::DisplaysAvailable() const + { + return 1; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceDisplaySink::SetDisplayIndexL( TInt aDisplayIndex ) + { + __ASSERT_ALWAYS( aDisplayIndex >= 0 && + aDisplayIndex < this->DisplaysAvailable(), + User::Leave( KErrArgument ) ); + + iDisplayIndex = aDisplayIndex; + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceDisplaySink::SetDisplay( RWindow& /*aWindow*/, + CWindowGc& /*aGc*/ ) + { + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceDisplaySink::SetDisplayRectL( const TRect& aRect ) + { + iDisplayRect = aRect; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C const TRect CMceDisplaySink::DisplayRectL() + { + return iDisplayRect; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceDisplaySink::SetPriorityL( TUint aPriority ) + { + iDisplayPriority = aPriority; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint CMceDisplaySink::PriorityL() + { + return iDisplayPriority; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceDisplaySink::SetRotationL( TRotation aRotation ) + { + iRotation = aRotation; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceDisplaySink::TRotation CMceDisplaySink::RotationL() + { + return iRotation; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMceDisplaySink::InitializeL( CMceManager* /*aManager*/ ) + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMceDisplaySink::CMceDisplaySink() + :CMceMediaSink(), + iDisplayIndex( 0 ), + iDisplayRect( TRect( 0, 0, 0, 0 ) ), + iDisplayPriority( 0 ), + iRotation( ENone ) + { + iType = KMceDisplaySink; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/src/mcefilesink.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/src/mcefilesink.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,98 @@ +/* +* 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: +* +*/ + + + +#include "mcefilesink.h" + + + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceFileSink* CMceFileSink::NewL( + const TFileName& aFileName ) + { + CMceFileSink* self = CMceFileSink::NewLC( aFileName ); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceFileSink* CMceFileSink::NewLC( + const TFileName& aFileName ) + { + CMceFileSink* self = new (ELeave) CMceFileSink(); + CleanupStack::PushL( self ); + self->ConstructL( aFileName ); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceFileSink::~CMceFileSink() + { + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceFileSink::EnableL() + { + CMceMediaSink::DoEnableL(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceFileSink::DisableL() + { + CMceMediaSink::DoDisableL(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMceFileSink::CMceFileSink() + { + iType = KMceFileSink; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMceFileSink::ConstructL( const TFileName& aFileName ) + { + iFileName = aFileName; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/src/mcefilesource.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/src/mcefilesource.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,387 @@ +/* +* 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: +* +*/ + + + +#include "mcefilesource.h" +#include "mcevideostream.h" +#include "mceaudiostream.h" +#include "mcemanager.h" +#include "mcesession.h" +#include "utf.h" + + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceFileSource* CMceFileSource::NewL( + CMceManager& aManager, + const TFileName& aFileName ) + { + CMceFileSource* self = CMceFileSource::NewLC( aManager, aFileName ); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceFileSource* CMceFileSource::NewLC( + CMceManager& aManager, + const TFileName& aFileName ) + { + CMceFileSource* self = new (ELeave) CMceFileSource(); + CleanupStack::PushL( self ); + self->ConstructL( &aManager, aFileName ); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceFileSource::~CMceFileSource() + { + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceFileSource::EnableL() + { + CMceMediaSource::DoEnableL(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceFileSource::DisableL() + { + CMceMediaSource::DoDisableL(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceFileSource::UpdateL ( const TFileName& aFileName ) + { + iFileName = aFileName; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceFileSource::MediaElementCountL( TMceMediaType aType ) const + { + if ( aType == KMceAudio ) + { + return iAudioElementCount; + } + else if ( aType == KMceVideo ) + { + return iVideoElementCount; + } + return 0; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceFileSource::SetCurrentMediaElementL( + TMceMediaType aType, + TInt aIndex ) + { + __ASSERT_ALWAYS( aIndex >= 0 && + aIndex < MediaElementCountL( aType ), + User::Leave( KErrArgument ) ); + + if ( aType == KMceAudio ) + { + iCurrentAudioElement = aIndex; + } + else if ( aType == KMceVideo ) + { + iCurrentVideoElement = aIndex; + } + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceFileSource::CurrentMediaElement( TMceMediaType aType ) + { + if ( aType == KMceAudio ) + { + return iCurrentAudioElement; + } + else if ( aType == KMceVideo ) + { + return iCurrentVideoElement; + } + + return 0; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceFileSource::SetPositionL( + const TTimeIntervalMicroSeconds& aPosition ) + { + __ASSERT_ALWAYS( aPosition <= DurationL() && + aPosition >= TTimeIntervalMicroSeconds( 0 ), + User::Leave( KErrArgument ) ); + + iPosition = aPosition; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TTimeIntervalMicroSeconds CMceFileSource::PositionL() const + { + return iPosition; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TTimeIntervalMicroSeconds CMceFileSource::DurationL() const + { + return iDuration; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceFileSource::SetFastForwardL( TBool aUseFFWD ) + { + __ASSERT_ALWAYS( this->MediaElementCountL( KMceVideo ) > 0, + User::Leave( KErrNotSupported ) ); + + + iFastForward = aUseFFWD; + + + if ( iFastForward ) + { + iFastRewind = EFalse; + } + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceFileSource::SetFastRewindL( TBool aUseFRWD ) + { + __ASSERT_ALWAYS( this->MediaElementCountL( KMceVideo ) > 0, + User::Leave( KErrNotSupported ) ); + + iFastRewind = aUseFRWD; + + if ( iFastRewind ) + { + iFastForward = EFalse; + } + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceFileSource::TranscodeL( const TFileName& aFileName ) + { + __ASSERT_ALWAYS( aFileName != KNullDesC, User::Leave( KErrArgument ) ); + + TBool transcodingNeeded = EFalse; + for ( TInt i = 0; i < iStreams.Count(); ++i ) + { + if ( iStreams[i]->State() == CMceMediaStream::ETranscodingRequired ) + { + transcodingNeeded = ETrue; + if ( iStreams[i]->Type() == KMceAudio ) + { + CMceAudioStream* audio = + static_cast(iStreams[i]); + __ASSERT_ALWAYS( audio->Codecs().Count() > 0, + User::Leave( KErrNotReady ) ); + } + else + { + CMceVideoStream* video = + static_cast(iStreams[i]); + __ASSERT_ALWAYS( video->Codecs().Count() > 0, + User::Leave( KErrNotReady ) ); + } + + iStreams[i]->iState = CMceMediaStream::ETranscoding; + } + } + + __ASSERT_ALWAYS( transcodingNeeded, User::Leave( KErrNotReady ) ); + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceFileSource::CancelTranscodeL() + { + TBool transcodingOngoing = EFalse; + + for ( TInt i = 0; i < iStreams.Count(); ++i ) + { + if ( iStreams[i]->State() == CMceMediaStream::ETranscoding ) + { + transcodingOngoing = ETrue; + iStreams[i]->iState = CMceMediaStream::ETranscodingRequired; + } + } + + __ASSERT_ALWAYS( transcodingOngoing, User::Leave( KErrNotReady ) ); + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceFileSource::TranscodingProgressL() const + { + TBool transcodingOngoing = EFalse; + + if ( iFailWithCode != KErrNone ) + { + TInt failCode = iFailWithCode; + iFailWithCode = KErrNone; + User::Leave( failCode ); + } + + for ( TInt i = 0; i < iStreams.Count(); ++i ) + { + if ( iStreams[i]->State() == CMceMediaStream::ETranscoding ) + { + transcodingOngoing = ETrue; + } + } + + __ASSERT_ALWAYS( transcodingOngoing, User::Leave( KErrNotReady ) ); + + return iTranscodingPercentage; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMceFileSource::InitializeL( CMceManager* aManager ) + { + iDuration = TTimeIntervalMicroSeconds( 100000000 ); + + iAudioElementCount = 1; + iVideoElementCount = 1; + + } + +// ----------------------------------------------------------------------------- +// Factory method for inner usage +// ----------------------------------------------------------------------------- +// +CMceFileSource* CMceFileSource::NewL() + { + CMceFileSource* self = CMceFileSource::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// Factory method for inner usage +// ----------------------------------------------------------------------------- +// +CMceFileSource* CMceFileSource::NewLC() + { + CMceFileSource* self = new (ELeave) CMceFileSource(); + CleanupStack::PushL( self ); + self->ConstructL( NULL, KNullDesC() ); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMceFileSource::CMceFileSource() + { + iType = KMceFileSource; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMceFileSource::ConstructL( CMceManager* aManager, + const TFileName& aFileName ) + { + + iFileName = aFileName; + + if ( aManager ) + { + InitializeL( aManager ); + } + + } + + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/src/mceh263codec.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/src/mceh263codec.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,244 @@ +/* +* 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: +* +*/ + + +#include "mceh263codec.h" + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CMceH263Codec::~CMceH263Codec +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceH263Codec::~CMceH263Codec() + { + } + + +// ----------------------------------------------------------------------------- +// CMceH263Codec::NewL +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceH263Codec* CMceH263Codec::NewL( TBuf8 aSdpName ) + { + CMceH263Codec* self = NewLC( aSdpName ); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// CMceH263Codec::NewL +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceH263Codec* CMceH263Codec::NewLC( TBuf8 aSdpName ) + { + CMceH263Codec* self = new (ELeave) CMceH263Codec(); + CleanupStack::PushL( self ); + self->ConstructL( aSdpName ); + return self; + } + + +// ----------------------------------------------------------------------------- +// CMceH263Codec::SetBitrate +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceH263Codec::SetBitrate(TUint aBitrate) + { + iBitrate = aBitrate; + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// CMceH263Codec::SetAllowedBitrates +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceH263Codec::SetAllowedBitrates(TUint aBitrates) + { + iAllowedBitrates = aBitrates; + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// CMceH263Codec::SetCodecMode +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceH263Codec::SetCodecMode(TUint aCodecMode) + { + iCodecMode = aCodecMode; + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// CMceH263Codec::SetPayloadType +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceH263Codec::SetPayloadType(TUint8 aPayloadType) + { + iPayloadType = aPayloadType; + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// CMceH263Codec::CloneL +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceVideoCodec* CMceH263Codec::CloneL() const + { + CMceH263Codec* clone = CMceH263Codec::NewLC( iSdpName ); + + if ( iFmtpAttr ) + { + clone->iFmtpAttr = iFmtpAttr->AllocL(); + } + clone->iPayloadType = iPayloadType; + + clone->iBitrate = iBitrate; + clone->iAllowedBitrates = iAllowedBitrates; + clone->iCodecMode = iCodecMode; + clone->iFourCC = iFourCC; + clone->iFrameSize = iFrameSize; + + clone->iFrameRate = iFrameRate; + clone->iMaxBitRate = iMaxBitRate; + clone->iAllowedResolutions = iAllowedResolutions; + clone->iResolutionWidth = iResolutionWidth; + clone->iResolutionHeight = iResolutionHeight; + clone->iAllowedFrameRates = iAllowedFrameRates; + clone->iClockRate = iClockRate; + + CleanupStack::Pop( clone ); + return clone; + } + + +// ----------------------------------------------------------------------------- +// CMceH263Codec:: +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceH263Codec::SetMaxBitrateL( TUint aMaxBitrate ) + { + iMaxBitRate = aMaxBitrate; + } + + +// ----------------------------------------------------------------------------- +// CMceH263Codec:: +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceH263Codec::SetAllowedResolutionsL( TUint aResolutions ) + { + iAllowedResolutions = aResolutions; + } + + +// ----------------------------------------------------------------------------- +// CMceH263Codec:: +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceH263Codec::SetResolutionL( TSize aResolution ) + { + iResolutionWidth = aResolution.iWidth; + iResolutionHeight = aResolution.iHeight; + } + + +// ----------------------------------------------------------------------------- +// CMceH263Codec:: +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceH263Codec::SetAllowedFrameRatesL( TUint aFrameRates ) + { + iAllowedFrameRates = aFrameRates; + } + + +// ----------------------------------------------------------------------------- +// CMceH263Codec:: +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceH263Codec::SetFrameRateL( TReal aFrameRate ) + { + iFrameRate = aFrameRate; + } + + +// ----------------------------------------------------------------------------- +// CMceH263Codec::SetPreferredEncodingDecodingDeviceL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceH263Codec::SetPreferredEncodingDecodingDeviceL( + TUid /*aEncodingDecodingDevice*/ ) + { + User::Leave( KErrNotSupported ); + } + + +// ----------------------------------------------------------------------------- +// CMceH263Codec::SetConfigKeyL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceH263Codec::SetConfigKeyL( const TDesC8& /*aConfigKey*/ ) + { + User::Leave( KErrNotSupported ); + } + + +// ----------------------------------------------------------------------------- +// CMceH263Codec::SetSdpNameL +// ----------------------------------------------------------------------------- +// +void CMceH263Codec::SetSdpNameL( const TDesC8& aSdpName ) + { + __ASSERT_ALWAYS( aSdpName.Length() <= KMceMaxSdpNameLength, + User::Leave( KErrArgument ) ); + iSdpName.Copy( aSdpName ); + } + + +// ----------------------------------------------------------------------------- +// CMceH263Codec::CMceH263Codec +// ----------------------------------------------------------------------------- +// +CMceH263Codec::CMceH263Codec() + :CMceVideoCodec() + { + } + + +// ----------------------------------------------------------------------------- +// CMceH263Codec::ConstructL +// ----------------------------------------------------------------------------- +// +void CMceH263Codec::ConstructL( TBuf8 aSdpName ) + { + iSdpName = aSdpName; + iClockRate = KMceH263ClockRate; + iFrameRate = KMceH263FrameRate; + iResolutionWidth = KMceH263FrameWidth; + iResolutionHeight = KMceH263FrameHeight; + } + + + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/src/mceinsession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/src/mceinsession.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,202 @@ +/* +* Copyright (c) 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: +* +*/ + + +#include "mceinsession.h" +#include "mcemanager.h" + + + +// CONSTANTS +const TUint32 KMceMinAcceptable = 200; +const TUint32 KMceMaxAcceptable = 299; +const TUint32 KMceMinError = 300; +const TUint32 KMceMaxError = 699; +const TUint32 KMceRinging = 180; +_LIT8( KMcePhraseRinging, "Ringing" ); + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CMceInSession::NewL +// ----------------------------------------------------------------------------- +// +CMceInSession* CMceInSession::NewL( RReadStream& /*aReadStream*/, + CMceManager& aManager, + TUint32 aProfileId ) + { + CMceInSession* self = new (ELeave) CMceInSession( &aManager, aProfileId ); + CleanupStack::PushL( self ); + self->ConstructL( KNullDesC8, KNullDesC8 ); + CleanupStack::Pop(self); + return self; + + } + +// ----------------------------------------------------------------------------- +// CMceInSession::NewL +// ----------------------------------------------------------------------------- +// + +EXPORT_C CMceInSession* CMceInSession::NewL() + { + CMceInSession* self = new (ELeave) CMceInSession( NULL, 0 ); + CleanupStack::PushL( self ); + self->ConstructL( KNullDesC8, KNullDesC8 ); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CMceInSession::~CMceInSession +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceInSession::~CMceInSession() + { + } + +// ----------------------------------------------------------------------------- +// CMceInSession::RingL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceInSession::RingL( CDesC8Array* aHeaders, + HBufC8* aContentType, + HBufC8* aContent ) + { + User::LeaveIfError( + ( aContentType && aContent ) || !( aContentType || aContent ) ? + KErrNone : KErrArgument ); + + delete aHeaders; + delete aContentType; + delete aContent; + + iRingingCalled = ETrue; + } + +// ----------------------------------------------------------------------------- +// CMceInSession::AcceptL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceInSession::AcceptL() + { + iState = CMceSession::EAnswering; + } + +// ----------------------------------------------------------------------------- +// CMceInSession::AcceptL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceInSession::AcceptL( const TDesC8& /*aReason*/, + TUint32 /*aCode*/, + CDesC8Array* aHeaders, + HBufC8* aContentType, + HBufC8* aContent ) + { + iState = CMceSession::EAnswering; + + delete aHeaders; + delete aContentType; + delete aContent; + } + +// ----------------------------------------------------------------------------- +// CMceInSession::RejectL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceInSession::RejectL() + { + if ( iFailWithCode != KErrNone ) + { + TInt failureCode = iFailWithCode; + iFailWithCode = KErrNone; + User::Leave( failureCode ); + } + + iState = CMceSession::ETerminated; + } + +// ----------------------------------------------------------------------------- +// CMceInSession::RejectL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceInSession::RejectL( const TDesC8& aReason, + TUint32 aCode, + CDesC8Array* aHeaders, + HBufC8* aContentType, + HBufC8* aContent ) + { + + User::LeaveIfError( + ( aContentType && aContent ) || !( aContentType || aContent ) ? + KErrNone : KErrArgument ); + User::LeaveIfError( aCode >= KMceMinError && aCode <= KMceMaxError ? + KErrNone : KErrArgument ); + + RejectL(); + + iReasonPhrase = aReason; + iReasonCode = aCode; + + delete aHeaders; + delete aContentType; + delete aContent; + } + +// ----------------------------------------------------------------------------- +// CMceInSession::CMceInSession +// ----------------------------------------------------------------------------- +// +CMceInSession::CMceInSession( CMceManager* aManager, TUint32 aProfileId ) + : CMceSession( aManager, aProfileId ) + { + } + + +// ----------------------------------------------------------------------------- +// CMceInSession::ConstructL +// ----------------------------------------------------------------------------- +// +void CMceInSession::ConstructL( const TDesC8& aOriginator, const TDesC8& aRecipient ) + { + + delete iOriginator; + iOriginator = 0; + iOriginator = aOriginator.AllocL(); + + delete iRecipient; + iRecipient = 0; + iRecipient = aRecipient.AllocL(); + + CMceSession::ConstructL(); + + iState = EIncoming; + } + +// ----------------------------------------------------------------------------- +// Stub constructor +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceInSession* CMceInSession::NewL( CMceManager& aManager, + const TDesC8& aOriginator ) + { + CMceInSession* self = new (ELeave) CMceInSession( &aManager, 0 ); + CleanupStack::PushL( self ); + self->ConstructL( aOriginator, KNullDesC8 ); + CleanupStack::Pop( self ); + return self; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/src/mcemanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/src/mcemanager.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,309 @@ +/* +* Copyright (c) 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: +* +*/ + + +#include "mcemanager.h" +#include "mceinsessionobserver.h" +#include "mcesessionobserver.h" +#include "mcesession.h" +#include "mcetransactiondatacontainer.h" +#include "mceamrcodec.h" +#include "mceh263codec.h" +#include "mceavccodec.h" +// Test simulator +#include "mussessionsimulator.h" + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// CMceManager::NewL +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceManager* CMceManager::NewL( + const TUid& aAppUid, + TMceTransactionDataContainer* aContainer ) + { + + CMceManager* self = + new (ELeave) CMceManager( aAppUid, aContainer ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + + } + + +// ----------------------------------------------------------------------------- +// CMceManager::~CMceManager +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceManager::~CMceManager() + { + if (iContainer) + { + iContainer->Clear(); + iContainer = 0; + } + + iSessions.Reset(); + iSessions.Close(); + + iSupportedAudioCodecs.ResetAndDestroy(); + iSupportedVideoCodecs.ResetAndDestroy(); + + delete iSessionSimulator; + + } + +// ----------------------------------------------------------------------------- +// CMceManager::SetInSessionObserver +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceManager::SetInSessionObserver( + MMceInSessionObserver* aInSessionObserver ) + { + iInSessionObserver = aInSessionObserver; + } + +// ----------------------------------------------------------------------------- +// CMceManager::SetInEventObserver +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceManager::SetInEventObserver( + MMceInEventObserver* /*aInEventObserver*/ ) + { + // NOP + } + +// ----------------------------------------------------------------------------- +// CMceManager::SetInReferObserver +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceManager::SetInReferObserver( + MMceInReferObserver* /*aInReferObserver*/ ) + { + // NOP + } + +// ----------------------------------------------------------------------------- +// CMceManager::SetSessionObserver +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceManager::SetSessionObserver( + MMceSessionObserver* aSessionObserver ) + { + iSessionObserver = aSessionObserver; + } + +// ----------------------------------------------------------------------------- +// CMceManager::SetEventObserver +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceManager::SetEventObserver( + MMceEventObserver* /*aEventObserver*/ ) + { + // NOP + } + +// ----------------------------------------------------------------------------- +// CMceManager::SetReferObserver +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceManager::SetReferObserver( + MMceReferObserver* /*aReferObserver*/ ) + { + // NOP + } + +// ----------------------------------------------------------------------------- +// CMceManager::SetMediaObserver +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceManager::SetMediaObserver( + MMceStreamObserver* aMediaObserver ) + { + iMediaObserver = aMediaObserver; + } + + +// ----------------------------------------------------------------------------- +// CMceManager::SetRtpObserver +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceManager::SetRtpObserver( + MMceRtpObserver* aRtpObserver ) + { + iRtpObserver = aRtpObserver; + } + + +// ----------------------------------------------------------------------------- +// CMceManager::SupportedAudioCodecs +// ----------------------------------------------------------------------------- +// +EXPORT_C const RPointerArray& + CMceManager::SupportedAudioCodecs() const + { + return iSupportedAudioCodecs; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C const RPointerArray& + CMceManager::SupportedVideoCodecs() const + { + return iSupportedVideoCodecs; + } + + +// ----------------------------------------------------------------------------- +// CMceManager::Sessions +// ----------------------------------------------------------------------------- +// +EXPORT_C const RPointerArray& CMceManager::Sessions() const + { + return iSessions; + } + + +// ----------------------------------------------------------------------------- +// CMceManager::SetDefaultHeadersL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceManager::SetDefaultHeadersL( CDesC8Array* aMethods, + CDesC8Array* aHeaders ) + { + delete aMethods; + delete aHeaders; + } + + +// ----------------------------------------------------------------------------- +// CMceManager::DefaultHeadersL +// ----------------------------------------------------------------------------- +// +EXPORT_C CDesC8Array* CMceManager::DefaultHeadersL( const TDesC8& /*aMethod*/ ) const + { + return NULL; + } + + +// ----------------------------------------------------------------------------- +// CMceManager::InSessionObserver +// ----------------------------------------------------------------------------- +// +MMceInSessionObserver* CMceManager::InSessionObserver() const + { + return iInSessionObserver; + } + + +// ----------------------------------------------------------------------------- +// CMceManager::SessionObserver +// ----------------------------------------------------------------------------- +// +MMceSessionObserver* CMceManager::SessionObserver() const + { + return iSessionObserver; + } + +// ----------------------------------------------------------------------------- +// CMceManager::MediaObserver +// ----------------------------------------------------------------------------- +// +MMceStreamObserver* CMceManager::MediaObserver() const + { + return iMediaObserver; + } + +// ----------------------------------------------------------------------------- +// CMceManager::RtpObserver +// ----------------------------------------------------------------------------- +// +MMceRtpObserver* CMceManager::RtpObserver() const + { + return iRtpObserver; + } + + +// ----------------------------------------------------------------------------- +// CMceManager::TransactionContainer +// ----------------------------------------------------------------------------- +// +TMceTransactionDataContainer* CMceManager::TransactionContainer() const + { + return iContainer; + } + + +// ----------------------------------------------------------------------------- +// CMceManager::CMceManager +// ----------------------------------------------------------------------------- +// +CMceManager::CMceManager( const TUid& /*aAppUid*/, + TMceTransactionDataContainer* aContainer ) + :iContainer( aContainer ) + { + + } + + +// ----------------------------------------------------------------------------- +// CMceManager::ConstructL +// ----------------------------------------------------------------------------- +// +void CMceManager::ConstructL() + { + // Fake having PCMU codec + iSupportedAudioCodecs.AppendL( CMceAmrCodec::NewLC( KMceSDPNamePCMU() ) ); + CleanupStack::Pop(); + + iSupportedAudioCodecs.AppendL( CMceAmrCodec::NewLC( KMceSDPNameAMR() ) ); + CleanupStack::Pop(); + + // Avc codec, level default 1 + iSupportedVideoCodecs.AppendL( CMceAvcCodec::NewLC( KMceSDPNameH264() ) ); + CleanupStack::Pop(); + + // Avc codec, level default 1, no profile id or constraint set defined + CMceVideoCodec* avc_2nd_Level_1 = CMceAvcCodec::NewLC( KMceSDPNameH264() ); + avc_2nd_Level_1->SetAllowedBitrates( KMceAvcBitrateLevel1 ); + iSupportedVideoCodecs.AppendL( avc_2nd_Level_1 ); + CleanupStack::Pop( avc_2nd_Level_1 ); + + // Avc codec, level 1_3 + CMceVideoCodec* avcLevel_1_3 = CMceAvcCodec::NewLC( KMceSDPNameH264() ); + avcLevel_1_3->SetAllowedBitrates( KMceAvcCodecProfileIdBaseline | + KMceAvcCodecProfileIopConstraintSet | + KMceAvcBitrateLevel1_3 ); + iSupportedVideoCodecs.AppendL( avcLevel_1_3 ); + CleanupStack::Pop( avcLevel_1_3 ); + + // H263 codec + iSupportedVideoCodecs.AppendL( CMceH263Codec::NewLC( KMceSDPNameH2632000() ) ); + CleanupStack::Pop(); + + // Test simulator + iSessionSimulator = CMusTestSessionSimulator::NewL( *this ); + } + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/src/mcemediasink.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/src/mcemediasink.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,117 @@ +/* +* Copyright (c) 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: +* +*/ + + +#include "mcemediasink.h" +#include "mcestreamobserver.h" +#include "mcesession.h" +#include "mcemanager.h" + + + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// CMceMediaSink::~CMceMediaSink +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceMediaSink::~CMceMediaSink() + { + } + +// ----------------------------------------------------------------------------- +// CMceMediaSink::Type +// ----------------------------------------------------------------------------- +// +EXPORT_C TMceSinkType CMceMediaSink::Type() const + { + return iType; + } + + + +// ----------------------------------------------------------------------------- +// CMceMediaSink::IsEnabled +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool CMceMediaSink::IsEnabled() const + { + return iIsEnabled; + } + + +// ----------------------------------------------------------------------------- +// CMceMediaSink::CMceMediaSink +// ----------------------------------------------------------------------------- +// +CMceMediaSink::CMceMediaSink() + :iIsEnabled( ETrue ), + iReferenceCount( 0 ) + { + } + + +// ----------------------------------------------------------------------------- +// CMceMediaSink::DoEnableL +// ----------------------------------------------------------------------------- +// +void CMceMediaSink::DoEnableL() + { + iIsEnabled = ETrue; + } + + +// --------------------------------------- -------------------------------------- +// CMceMediaSink::DoDisableL +// ----------------------------------------------------------------------------- +// +void CMceMediaSink::DoDisableL() + { + iIsEnabled = EFalse; + } + + +// ----------------------------------------------------------------------------- +// CMceMediaSink::InitializeL +// ----------------------------------------------------------------------------- +// +void CMceMediaSink::InitializeL( CMceMediaStream& aParent ) + { + iStream = &aParent; + } + + +// ----------------------------------------------------------------------------- +// CMceMediaSink::InitializeL +// ----------------------------------------------------------------------------- +// +void CMceMediaSink::InitializeL( CMceManager* /*aManager*/ ) + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// CMceMediaSink::ReferenceCount +// ----------------------------------------------------------------------------- +// +TInt& CMceMediaSink::ReferenceCount() + { + return iReferenceCount; + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/src/mcemediasource.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/src/mcemediasource.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,118 @@ +/* +* Copyright (c) 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: +* +*/ + + +#include "mcemediasource.h" +#include "mcesession.h" +#include "mcemanager.h" +#include "mcestreamobserver.h" + + + +#define _FLAT_DATA static_cast( iFlatData ) +#define FLAT_DATA( data ) _FLAT_DATA->data + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// CMceMediaSource::~CMceMediaSource +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceMediaSource::~CMceMediaSource() + { + iStreams.Reset(); + } + +// ----------------------------------------------------------------------------- +// CMceMediaSource::Type +// ----------------------------------------------------------------------------- +// +EXPORT_C TMceSourceType CMceMediaSource::Type() const + { + return iType; + } + + +// ----------------------------------------------------------------------------- +// CMceMediaSource::IsEnabled +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool CMceMediaSource::IsEnabled() const + { + return iIsEnabled; + } + +// ----------------------------------------------------------------------------- +// CMceMediaSource::ReferenceCount +// ----------------------------------------------------------------------------- +// +TInt& CMceMediaSource::ReferenceCount() + { + return iReferenceCount; + } + +// ----------------------------------------------------------------------------- +// CMceMediaSource::CMceMediaSource +// ----------------------------------------------------------------------------- +// +CMceMediaSource::CMceMediaSource() + :iIsEnabled( ETrue ) + { + } + + +// ----------------------------------------------------------------------------- +// CMceMediaSource::InitializeL +// ----------------------------------------------------------------------------- +// +void CMceMediaSource::InitializeL( CMceMediaStream& aParent ) + { + iStreams.AppendL( &aParent ); + + } + + +// ----------------------------------------------------------------------------- +// CMceMediaSource::InitializeL +// ----------------------------------------------------------------------------- +// +void CMceMediaSource::InitializeL( CMceManager* /*aManager*/ ) + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// CMceMediaSource::DoEnableL +// ----------------------------------------------------------------------------- +// +void CMceMediaSource::DoEnableL() + { + iIsEnabled = ETrue; + } + +// ----------------------------------------------------------------------------- +// CMceMediaSource::DoDisableL +// ----------------------------------------------------------------------------- +// +void CMceMediaSource::DoDisableL() + { + + iIsEnabled = EFalse; + + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/src/mcemediastream.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/src/mcemediastream.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,401 @@ +/* +* Copyright (c) 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: +* +*/ + + +#include "mcemediastream.h" +#include "mcesession.h" +#include "mcemanager.h" +#include "mcestreamobserver.h" +#include "mcemediasource.h" +#include "mcemediasink.h" + + + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// CMceMediaStream::~CMceMediaStream +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceMediaStream::~CMceMediaStream() + { + delete iMediaSDPLines; + + if ( iSource ) + { + DeleteSource(); + } + + if ( iLinkOwner ) + { + delete iLinkedStream; + } + + while( iSinks.Count() > 0 ) + { + DeleteSink( 0 ); + } + + iSinks.Reset(); + iSinks.Close(); + + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceMediaStream::TState CMceMediaStream::State() const + { + return iState; + } + +// ----------------------------------------------------------------------------- +// CMceMediaStream::Type +// ----------------------------------------------------------------------------- +// +EXPORT_C TMceMediaType CMceMediaStream::Type() const + { + return iType; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceMediaStream::SetMediaAttributeLinesL( + CDesC8Array* aMediaSDPLines ) + { + delete iMediaSDPLines; + iMediaSDPLines = aMediaSDPLines; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C MDesC8Array* CMceMediaStream::MediaAttributeLinesL() + { + if ( iMediaSDPLines ) + { + CDesC8Array* array = new ( ELeave ) CDesC8ArrayFlat( 1 ); + CleanupStack::PushL( array ); + for ( TInt i = 0; i < iMediaSDPLines->Count(); ++i ) + { + array->AppendL( iMediaSDPLines->MdcaPoint(i) ); + } + CleanupStack::Pop( array ); + return array; + } + + return NULL; + } + +// ----------------------------------------------------------------------------- +// CMceMediaStream::SetStartMediaPort +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceMediaStream::SetLocalMediaPortL( TUint aLocalMediaPort ) + { + iLocalMediaPort = aLocalMediaPort; + } + +// ----------------------------------------------------------------------------- +// CMceMediaStream::StartMediaPort +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint CMceMediaStream::LocalMediaPort() const + { + return iLocalMediaPort; + } + +// ----------------------------------------------------------------------------- +// CMceMediaStream::Session +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceSession* CMceMediaStream::Session() const + { + return iSession; + } + +// ----------------------------------------------------------------------------- +// CMceMediaStream::EnableL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceMediaStream::EnableL() + { + iIsEnabled = ETrue; + } + +// ----------------------------------------------------------------------------- +// CMceMediaStream::DisableL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceMediaStream::DisableL() + { + iIsEnabled = EFalse; + } + +// ----------------------------------------------------------------------------- +// CMceMediaStream::IsEnabled +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool CMceMediaStream::IsEnabled() const + { + return iIsEnabled; + } + +// ----------------------------------------------------------------------------- +// CMceMediaStream::SetSourceL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceMediaStream::SetSourceL( CMceMediaSource* aSource ) + { + if ( aSource ) + { + aSource->ReferenceCount()++; + } + + if ( iSource ) + { + DeleteSource(); + } + iSource = aSource; + + } + + +// ----------------------------------------------------------------------------- +// CMceMediaStream::AddSinkL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceMediaStream::AddSinkL( CMceMediaSink* aSink ) + { + __ASSERT_ALWAYS( aSink, User::Leave( KErrArgument ) ); + iSinks.AppendL( aSink ); + aSink->ReferenceCount()++; + } + + +// ----------------------------------------------------------------------------- +// CMceMediaStream::Source +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceMediaSource* CMceMediaStream::Source() const + { + return iSource; + } + + +// ----------------------------------------------------------------------------- +// CMceMediaStream::Sinks +// ----------------------------------------------------------------------------- +// +EXPORT_C const RPointerArray& CMceMediaStream::Sinks() const + { + return iSinks; + } + + +// ----------------------------------------------------------------------------- +// CMceMediaStream::RemoveSinkL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceMediaStream::RemoveSinkL( CMceMediaSink& aSink ) + { + for ( TInt i = 0; i < iSinks.Count(); i++ ) + { + if ( iSinks[i] == &aSink ) + { + DeleteSink( i ); + iSinks.Compress(); + return; + } + } + User::Leave( KErrNotFound ); + } + + + +// ----------------------------------------------------------------------------- +// CMceMediaStream::BindL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceMediaStream::BindL( CMceMediaStream* aStream ) + { + + __ASSERT_ALWAYS( !(! iLinkOwner && + iLinkedStream ), + User::Leave( KErrArgument ) ); + + if ( aStream ) + { + iLinkOwner = ETrue; + aStream->DoBindL( this ); + DoBindL( aStream ); + } + else + { + iLinkOwner = EFalse; + delete iLinkedStream; + iLinkedStream = NULL; + } + + } + + +// ----------------------------------------------------------------------------- +// CMceMediaStream::BoundStreamL +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceMediaStream& CMceMediaStream::BoundStreamL() const + { + __ASSERT_ALWAYS( iLinkedStream , User::Leave( KErrNotFound ) ); + + return *iLinkedStream; + + } + + +// ----------------------------------------------------------------------------- +// CMceMediaStream::BoundStream +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool CMceMediaStream::BoundStream() const + { + return iLinkedStream != NULL; + } + +// ----------------------------------------------------------------------------- +// CMceMediaStream::Binder +// ----------------------------------------------------------------------------- +// +TBool CMceMediaStream::Binder() const + { + return iLinkOwner; + } + + +// ----------------------------------------------------------------------------- +// CMceMediaStream::InitializeL +// ----------------------------------------------------------------------------- +// +void CMceMediaStream::InitializeL( CMceSession& aParent ) + { + iSession = &aParent; + + if ( Binder() && BoundStream() ) + { + iLinkedStream->InitializeL( aParent ); + } + + if ( iSource ) + { + iSource->InitializeL( *this ); + } + + for( TInt i = 0; i < iSinks.Count();i++) + { + iSinks[i]->InitializeL( *this ); + } + + } + + +// ----------------------------------------------------------------------------- +// CMceMediaStream::InitializeL +// ----------------------------------------------------------------------------- +// +void CMceMediaStream::InitializeL( CMceManager* aManager ) + { + if ( Binder() && BoundStream() ) + { + iLinkedStream->InitializeL( aManager ); + } + + if ( iSource ) + { + iSource->InitializeL( aManager ); + } + + for( TInt i = 0; i < iSinks.Count();i++) + { + iSinks[i]->InitializeL( aManager ); + } + } + + +// ----------------------------------------------------------------------------- +// CMceMediaStream::CMceMediaStream +// ----------------------------------------------------------------------------- +// +CMceMediaStream::CMceMediaStream() + :iLinkedStream( NULL ), + iSource( NULL ), + iLinkOwner( EFalse ), + iIsEnabled( ETrue ), + iState( CMceMediaStream::EUninitialized ) + { + } + + +// ----------------------------------------------------------------------------- +// CMceMediaStream::DeleteSink +// ----------------------------------------------------------------------------- +// +void CMceMediaStream::DeleteSink( TInt aIndex ) + { + + iSinks[ aIndex ]->ReferenceCount()--; + if ( iSinks[ aIndex ]->ReferenceCount() == 0 ) + { + delete iSinks[ aIndex ]; + } + iSinks.Remove( aIndex ); + + } + +// ----------------------------------------------------------------------------- +// CMceMediaStream::DeleteSource +// ----------------------------------------------------------------------------- +// +void CMceMediaStream::DeleteSource() + { + iSource->ReferenceCount()--; + if ( iSource->ReferenceCount() == 0 ) + { + delete iSource; + } + iSource = NULL; + } + + + +// ----------------------------------------------------------------------------- +// CMceMediaStream::DoBindL +// ----------------------------------------------------------------------------- +// +void CMceMediaStream::DoBindL( CMceMediaStream* aStream ) + { + if ( Session() ) + { + aStream->InitializeL( *Session() ); + } + delete iLinkedStream; + iLinkedStream = aStream; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/src/mceoutsession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/src/mceoutsession.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,191 @@ +/* +* Copyright (c) 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: +* +*/ + + +#include +#include +#include "mceoutsession.h" +#include "mcemediastream.h" +#include "mcemanager.h" + + + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// CMceOutSession::NewL +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceOutSession* CMceOutSession::NewL( + CMceManager& aManager, + CSIPProfile& aProfile, + const TDesC8& aRecipient, + HBufC8* aOriginator ) + { + // Check that profile has been registered + TBool profileRegistered = EFalse; + + aProfile.GetParameter( KSIPProfileRegistered, profileRegistered ); + __ASSERT_ALWAYS( profileRegistered, User::Leave( KErrCouldNotConnect ) ); + + CMceOutSession* self = new (ELeave) CMceOutSession( &aManager, 0 ); + CleanupStack::PushL( self ); + self->ConstructL( aRecipient, aOriginator ); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CMceOutSession::NewL +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceOutSession* CMceOutSession::NewL( CMceEvent& /*aEvent*/ ) + { + return NULL; + } + +// ----------------------------------------------------------------------------- +// CMceOutSession::NewL +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceOutSession* CMceOutSession::NewL( CMceRefer& /*aRefer*/ ) + { + return NULL; + } + +// ----------------------------------------------------------------------------- +// CMceOutSession::NewL +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceOutSession* CMceOutSession::NewL() + { + return new( ELeave )CMceOutSession( NULL, 0 ); + } + +// ----------------------------------------------------------------------------- +// CMceOutSession::~CMceOutSession +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceOutSession::~CMceOutSession() + { + } + + +// ----------------------------------------------------------------------------- +// CMceOutSession::EstablishL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceOutSession::EstablishL( + TUint32 aTimeout, + CDesC8Array* aHeaders, + HBufC8* aContentType, + HBufC8* aContent, + CDesC8Array* aContentHeaders ) + { + User::LeaveIfError( State() == EIdle ? KErrNone : KErrNotReady ); + User::LeaveIfError( + ( aContentType && aContent ) || + !( aContentType || aContent || aContentHeaders ) ? + KErrNone : KErrArgument ); + + if ( iFailWithCode != KErrNone ) + { + TInt failCode = iFailWithCode; + iFailWithCode = KErrNone; + User::Leave( failCode ); + } + + iTimeout = aTimeout; + + //start establishing the session + + delete iHeaders; + iHeaders = aHeaders; + delete aContentType; + delete aContent; + delete aContentHeaders; + + iState = CMceSession::EOffering; + } + + +// ----------------------------------------------------------------------------- +// CMceOutSession::AddStreamL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceOutSession::AddStreamL( CMceMediaStream* aMediaStream ) + { + if ( iManager ) + { + //initialize stream (to get supported codecs) + aMediaStream->InitializeL( iManager ); + } + else + { + //internalizing => no initialize yet + } + + CMceSession::AddStreamL( aMediaStream ); + } + + +// ----------------------------------------------------------------------------- +// CMceOutSession::CancelL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceOutSession::CancelL() + { + User::LeaveIfError( State() != EIdle ? KErrNone : KErrNotReady ); + + iState = CMceSession::ECancelling; + + } + + +// ----------------------------------------------------------------------------- +// CMceOutSession::CMceOutSession +// ----------------------------------------------------------------------------- +// +CMceOutSession::CMceOutSession( CMceManager* aManager, TUint32 aProfileId ) + : CMceSession( aManager, aProfileId ) + { + //NOP + } + +// ----------------------------------------------------------------------------- +// CMceOutSession::ConstructL +// ----------------------------------------------------------------------------- +// +void CMceOutSession::ConstructL( const TDesC8& aRecipient, HBufC8* aOriginator ) + { + delete iRecipient; + iRecipient = NULL; + iRecipient = aRecipient.AllocL(); + + delete iOriginator; + iOriginator = NULL; + if ( aOriginator ) + { + iOriginator = aOriginator->AllocL(); + delete aOriginator; + } + + CMceSession::ConstructL(); + iManager->iSessions.AppendL( this ); + + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/src/mcertpsink.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/src/mcertpsink.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,152 @@ +/* +* Copyright (c) 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: +* +*/ + + +#include "mcertpsink.h" +#include "mcemediastream.h" +#include "mcesession.h" + + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// CMceRtpSink::NewL +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceRtpSink* CMceRtpSink::NewL() + { + CMceRtpSink* self = NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// CMceRtpSink::NewLC +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceRtpSink* CMceRtpSink::NewLC() + { + CMceRtpSink* self = new (ELeave) CMceRtpSink(); + CleanupStack::PushL( self ); + self->ConstructL( EFalse ); + return self; + } + +// ----------------------------------------------------------------------------- +// CMceRtpSink::NewL +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceRtpSink* CMceRtpSink::NewL( TBool aSuppressRTCP, + HBufC8* /*aIdentity*/ ) + { + + CMceRtpSink* self = new (ELeave) CMceRtpSink(); + CleanupStack::PushL( self ); + self->ConstructL( aSuppressRTCP ); + CleanupStack::Pop( self ); + return self; + + } + +// ----------------------------------------------------------------------------- +// CMceRtpSink::~CMceRtpSink +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceRtpSink::~CMceRtpSink() + { + } + +// ----------------------------------------------------------------------------- +// CMceRtpSink::EnableL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceRtpSink::EnableL() + { + CMceMediaSink::DoEnableL(); + } + +// ----------------------------------------------------------------------------- +// CMceRtpSink::DisableL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceRtpSink::DisableL() + { + CMceMediaSink::DoDisableL(); + } + +// ----------------------------------------------------------------------------- +// CMceRtpSink::SendSRL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceRtpSink::SendSRL() + { + __ASSERT_ALWAYS( iStream && + iStream->Session() && + iStream->Session()->State() != CMceSession::EIdle && + iStream->Session()->State() != CMceSession::EIncoming, + User::Leave( KErrNotReady ) ); + // NOP + } + +// ----------------------------------------------------------------------------- +// CMceRtpSink::LastPacket +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint32 CMceRtpSink::LastPacket() const + { + return iLastPacket; + } + +// ----------------------------------------------------------------------------- +// CMceRtpSink::Ssrc +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint32 CMceRtpSink::Ssrc() const + { + return iSSRC; + } + +// ----------------------------------------------------------------------------- +// CMceRtpSink::UpdateL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceRtpSink::UpdateL( TBool aSuppressRTCP, + HBufC8* /*aIdentity*/ ) + { + iSuppressRTCP = aSuppressRTCP; + } + +// ----------------------------------------------------------------------------- +// CMceRtpSink::CMceRtpSink +// ----------------------------------------------------------------------------- +// +CMceRtpSink::CMceRtpSink() + : CMceMediaSink() + { + iType = KMceRTPSink; + } + +// ----------------------------------------------------------------------------- +// CMceRtpSink::ConstructL +// ----------------------------------------------------------------------------- +// +void CMceRtpSink::ConstructL( TBool aSuppressRTCP ) + { + iSuppressRTCP = aSuppressRTCP; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/src/mcertpsource.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/src/mcertpsource.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,223 @@ +/* +* Copyright (c) 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: +* +*/ + + +#include "mcertpsource.h" +#include "mcesession.h" +#include "mcemanager.h" +#include "mcemediastream.h" +#include "mcertpobserver.h" + +#define KMceTIMERDISABLED 0 + + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// CMceRtpSource::NewL +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceRtpSource* CMceRtpSource::NewL( + TUint aBufferLength, + TUint aBufferTreshold, + TUint32 aInactivityTimer, + HBufC8* aIdentity ) + { + CMceRtpSource* self = NewLC( aBufferLength, aBufferTreshold, + aInactivityTimer, aIdentity ); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CMceRtpSource::NewLC +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceRtpSource* CMceRtpSource::NewLC( + TUint aBufferLength, + TUint aBufferTreshold, + TUint32 aInactivityTimer, + HBufC8* /*aIdentity*/ ) + { + CMceRtpSource* self = new (ELeave) CMceRtpSource(); + CleanupStack::PushL( self ); + self->ConstructL( aBufferLength, aBufferTreshold, + aInactivityTimer, NULL ); + return self; + } + + +// ----------------------------------------------------------------------------- +// CMceRtpSource::~CMceRtpSource +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceRtpSource::~CMceRtpSource() + { + delete iMediaBurstIndicator; + } + +// ----------------------------------------------------------------------------- +// CMceRtpSource::EnableL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceRtpSource::EnableL() + { + CMceMediaSource::DoEnableL(); + } + +// ----------------------------------------------------------------------------- +// CMceRtpSource::DisableL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceRtpSource::DisableL() + { + CMceMediaSource::DoDisableL(); + } + + +// ----------------------------------------------------------------------------- +// CMceRtpSource::EnableInactivityTimerL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceRtpSource::EnableInactivityTimerL( TUint32 aInactivityTimer ) + { + // Simulate MCE's check + if ( iStreams[0] && + iStreams[0]->Session() && + iStreams[0]->Session()->State() != CMceSession::EIdle && + iStreams[0]->Session()->State() != CMceSession::EIncoming ) + { + iInactivityTimer = aInactivityTimer; + } + } + +// ----------------------------------------------------------------------------- +// CMceRtpSource::DisableInactivityTimer +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceRtpSource::DisableInactivityTimerL() + { + iInactivityTimer = KMceTIMERDISABLED; + } + +// ----------------------------------------------------------------------------- +// CMceRtpSource::UpdateL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceRtpSource::UpdateL ( + TUint aBufferLength, + TUint aBufferTreshold, + TUint32 aInactivityTimer, + HBufC8* /*aIdentity*/ ) + { + iInactivityTimer = aInactivityTimer; + iBufferLength = aBufferLength; + iBufferTreshold = aBufferTreshold; + } + +// ----------------------------------------------------------------------------- +// CMceRtpSource::SendRRL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceRtpSource::SendRRL() + { + __ASSERT_ALWAYS( iStreams[0] && + iStreams[0]->Session() && + iStreams[0]->Session()->State() != CMceSession::EIdle && + iStreams[0]->Session()->State() != CMceSession::EIncoming, + User::Leave( KErrNotReady ) ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint32 CMceRtpSource::Ssrc() const + { + return 0; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C const RArray& CMceRtpSource::Ssrcs() const + { + return iSsrcs; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceRtpSource::EnableSsrcL( TUint /*aSsrc*/ ) + { + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceRtpSource::DisableSsrcL( TUint /*aSsrc*/ ) + { + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool CMceRtpSource::IsSsrcEnabledL( TUint /*aSsrc*/ ) + { + return ETrue; + } + + +// ----------------------------------------------------------------------------- +// CMceRtpSource::CMceRtpSource +// ----------------------------------------------------------------------------- +// +CMceRtpSource::CMceRtpSource() + : CMceMediaSource() + { + iType = KMceRTPSource; + } + + +// ----------------------------------------------------------------------------- +// CMceRtpSource::ConstructL +// ----------------------------------------------------------------------------- +// +void CMceRtpSource::ConstructL( + TUint aBufferLength, + TUint aBufferTreshold, + TUint32 aInactivityTimer, + HBufC8* aMediaBurstIndicator ) + { + + iInactivityTimer = aInactivityTimer; + iBufferLength = aBufferLength; + iBufferTreshold = aBufferTreshold; + iMediaBurstIndicator = aMediaBurstIndicator; + + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/src/mcesession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/src/mcesession.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,413 @@ +/* +* Copyright (c) 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: +* +*/ + + +#include "mcesession.h" +//#include "mceinsession.h" +#include "mcemanager.h" +#include "mcestreambundle.h" +#include "mcemediastream.h" +#include "mceinsessionobserver.h" +#include "mcesessionobserver.h" +#include "mcestreamobserver.h" +#include "mcertpobserver.h" +#include "mcetransactiondatacontainer.h" +#include "mussessionsimulator.h" + + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// CMceSession::~CMceSession +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceSession::~CMceSession() + { + delete iHeaders; + delete iSessionSDPLines; + + delete iOriginator; + delete iRecipient; + iMediaStreams.ResetAndDestroy(); + iBundles.ResetAndDestroy(); + + } + + +// ----------------------------------------------------------------------------- +// CMceSession::State +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceSession::TState CMceSession::State() const + { + return iState; + } + + +// ----------------------------------------------------------------------------- +// CMceSession::ConnectionActive +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool CMceSession::ConnectionActive() const + { + return iIsConnectionActive; + } + + +// ----------------------------------------------------------------------------- +// CMceSession::RemoveStreamL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceSession::RemoveStreamL( CMceMediaStream& aMediaStream ) + { + for ( TInt i = 0; i < iMediaStreams.Count(); ++i ) + { + if ( &aMediaStream == iMediaStreams[i] ) + { + delete iMediaStreams[i]; + iMediaStreams.Remove( i ); + return; + } + } + + User::Leave( KErrNotFound ); + } + + +// ----------------------------------------------------------------------------- +// CMceSession::AddStreamL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceSession::AddStreamL( CMceMediaStream* aMediaStream ) + { + User::LeaveIfError( iMediaStreams.Find( aMediaStream ) != KErrNotFound ? + KErrArgument : KErrNone ); + + aMediaStream->InitializeL( *this ); // Initialize before taking ownership + + iMediaStreams.AppendL( aMediaStream ); + + } + + +// ----------------------------------------------------------------------------- +// CMceSession::UpdateL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceSession::UpdateL( + TUint32 aTimeout, + CDesC8Array* aHeaders, + HBufC8* aContentType, + HBufC8* aContent, + CDesC8Array* aContentHeaders ) + { + User::LeaveIfError( iState != EIdle ? KErrNone : KErrNotReady ); + User::LeaveIfError( + ( aContentType && aContent ) || + !( aContentType || aContent || aContentHeaders ) ? + KErrNone : KErrArgument ); + + // Leave if in incoming state givem too small timeout value + User::LeaveIfError( !( aTimeout > 0 && State() == CMceSession::EIncoming ) || + aTimeout <= SessionTimer() ? KErrNone : KErrArgument ); + + InitializeL(); + + iTimeout = aTimeout; + + delete iHeaders; + iHeaders = aHeaders; + delete aContentType; + delete aContentHeaders; + + if ( iState == EIncoming ) + { + iState = EReserving; + RestartSimulator(); + } + else + { + iState = EOffering; + } + } + +// ----------------------------------------------------------------------------- +// CMceSession::InitializeL +// ----------------------------------------------------------------------------- +// +/* +void CMceSession::InitializeL() + { + for(int i=0; iInitializeL( *this ); + } + } + */ + + +// ----------------------------------------------------------------------------- +// CMceSession::TerminateL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceSession::TerminateL( CDesC8Array* aHeaders, + HBufC8* aContentType, + HBufC8* aContent ) + { + __ASSERT_ALWAYS( iState != CMceSession::EIdle, User::Leave( KErrNotReady ) ); + + delete iHeaders; + iHeaders = aHeaders; + delete aContentType; + delete aContent; + + iState = CMceSession::ETerminating; + RestartSimulator(); + + + } + + +// ----------------------------------------------------------------------------- +// CMceSession::Streams +// ----------------------------------------------------------------------------- +// +EXPORT_C const RPointerArray& CMceSession::Streams() const + { + return iMediaStreams; + } + + +// ----------------------------------------------------------------------------- +// CMceSession::Recipient +// ----------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CMceSession::Recipient() const + { + return *iRecipient; + } + +// ----------------------------------------------------------------------------- +// CMceSession::Originator +// ----------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CMceSession::Originator() const + { + return *iOriginator; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceSession::SetSessionSDPLinesL( CDesC8Array* aSessionSDPLines ) + { + delete iSessionSDPLines; + iSessionSDPLines = aSessionSDPLines; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C MDesC8Array* CMceSession::SessionSDPLinesL() + { + if ( iSessionSDPLines ) + { + CDesC8Array* array = new ( ELeave ) CDesC8ArrayFlat( 1 ); + CleanupStack::PushL( array ); + for ( TInt i = 0; i < iSessionSDPLines->Count(); ++i ) + { + array->AppendL( iSessionSDPLines->MdcaPoint(i) ); + } + CleanupStack::Pop( array ); + return array; + } + + return NULL; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint32 CMceSession::SessionTimer() const + { + return iTimeout; + } + +// ----------------------------------------------------------------------------- +// CMceSession::AddBundleL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceSession::AddBundleL( CMceStreamBundle* aBundle ) + { + iBundles.AppendL( aBundle ); + } + +// ----------------------------------------------------------------------------- +// CMceSession::RemoveBundleL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceSession::RemoveBundleL( CMceStreamBundle& aBundle ) + { + TInt index = iBundles.Find( &aBundle ); + User::LeaveIfError( index ); + iBundles.Remove( index ); + } + +// ----------------------------------------------------------------------------- +// CMceSession::Bundles +// ----------------------------------------------------------------------------- +// +EXPORT_C const RPointerArray< CMceStreamBundle >& CMceSession::Bundles() const + { + return iBundles; + } + +// ----------------------------------------------------------------------------- +// CMceSession::GetModifierL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceSession::GetModifierL( TMceSessionModifier aModifier, + TUint& aValue ) const + { + if ( aModifier == KMcePreconditions ) + { + if ( iForceInternetSignaling ) + { + aValue = KMcePreconditionsNotUsed; + } + else + { + aValue = KMcePreconditionsSupported; + } + return; + } + User::Leave( KErrNotFound ); + } + +// ----------------------------------------------------------------------------- +// CMceSession::SetModifierL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceSession::SetModifierL( TMceSessionModifier aModifier, + TUint aValue ) + { + if ( aModifier == KMcePreconditions ) + { + if ( aValue == KMcePreconditionsNotUsed ) + { + iForceInternetSignaling = ETrue; + } + else + { + iForceInternetSignaling = EFalse; + } + return; + } + else if ( aModifier == KMce100Rel ) + { + if ( aValue >= 0 && aValue <= 2 ) + { + i100RelUsage = aValue; + return; + } + } + User::LeaveIfError( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CMceSession::Profile +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint32 CMceSession::Profile() const + { + return iProfileId; + } + +// ----------------------------------------------------------------------------- +// CMceSession::CMceSession +// ----------------------------------------------------------------------------- +// +CMceSession::CMceSession( CMceManager* aManager, TUint32 aProfileId ) + : iProfileId( aProfileId ), + iManager( aManager ), + iState( CMceSession::EIdle), + iIsConnectionActive( ETrue ), + iForceInternetSignaling( EFalse ), + i100RelUsage( 1 ), // MCE default + iFailWithCode( KErrNone ), + iReasonPhrase( KNullDesC8() ), + iReasonCode( 0 ) + { + } + + +// ----------------------------------------------------------------------------- +// CMceSession::Manager +// ----------------------------------------------------------------------------- +// +CMceManager& CMceSession::Manager() const + { + return *iManager; + } + + +// ----------------------------------------------------------------------------- +// CMceSession::ConstructL +// ----------------------------------------------------------------------------- +// +void CMceSession::ConstructL() + { + + } + +// ----------------------------------------------------------------------------- +// CMceSession::InitializeL +// ----------------------------------------------------------------------------- +// +void CMceSession::InitializeL() + { + for (int i=0; iInitializeL( *this ); + } + + /* + for(int i=0; iInitializeL( *this ); + } + */ + } + + +// ----------------------------------------------------------------------------- +// CMceSession::RestartSimulator +// ----------------------------------------------------------------------------- +// +void CMceSession::RestartSimulator() + { + if( iManager->iSessionSimulator->IsRunning()) + { + iManager->iSessionSimulator->Stop(); + } + iManager->iSessionSimulator->StartL(); + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/src/mcespeakersink.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/src/mcespeakersink.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,175 @@ +/* +* Copyright (c) 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: +* +*/ + + +#include "mcespeakersink.h" +#include "mcesession.h" +#include "mcemediastream.h" + + +// ============================ MEMBER FUNCTIONS =============================== + +const TInt KMceMaxVolume = 10; + +// ----------------------------------------------------------------------------- +// CMceSpeakerSink::NewL +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceSpeakerSink* CMceSpeakerSink::NewL() + { + CMceSpeakerSink* self = NewLC(); + CleanupStack::Pop( self ); + return self; + + } + +// ----------------------------------------------------------------------------- +// CMceSpeakerSink::NewLC +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceSpeakerSink* CMceSpeakerSink::NewLC() + { + CMceSpeakerSink* self = new (ELeave) CMceSpeakerSink(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + + } + +// ----------------------------------------------------------------------------- +// CMceSpeakerSink::~CMceSpeakerSink +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceSpeakerSink::~CMceSpeakerSink() + { + } + +// ----------------------------------------------------------------------------- +// CMceSpeakerSink::EnableL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceSpeakerSink::EnableL() + { + CMceMediaSink::DoEnableL(); + } + +// ----------------------------------------------------------------------------- +// CMceSpeakerSink::Disable +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceSpeakerSink::DisableL() + { + CMceMediaSink::DoDisableL(); + } + +// ----------------------------------------------------------------------------- +// CMceSpeakerSink::SetVolumeL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceSpeakerSink::SetVolumeL(TInt aVolume) + { + __ASSERT_ALWAYS( iStream && + iStream->Session() && + iStream->Session()->State() != CMceSession::EIdle && + iStream->Session()->State() != CMceSession::EIncoming, + User::Leave( KErrNotReady ) ); + + __ASSERT_ALWAYS( aVolume <= MaxVolumeL() && + aVolume > 0, + User::Leave( KErrArgument ) ); + iVolume = aVolume; + } + +// ----------------------------------------------------------------------------- +// CMceSpeakerSink::VolumeL +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceSpeakerSink::VolumeL() const + { + __ASSERT_ALWAYS( iStream && + iStream->Session() && + iStream->Session()->State() != CMceSession::EIdle && + iStream->Session()->State() != CMceSession::EIncoming, + User::Leave( KErrNotReady ) ); + + return iVolume; + } + +// ----------------------------------------------------------------------------- +// CMceSpeakerSink::MaxVolumeL +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceSpeakerSink::MaxVolumeL() const + { + __ASSERT_ALWAYS( iStream && + iStream->Session() && + iStream->Session()->State() != CMceSession::EIdle && + iStream->Session()->State() != CMceSession::EIncoming, + User::Leave( KErrNotReady ) ); + + return iMaxVolume; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceSpeakerSink::SetRoutingL( TInt aRoute ) + { + __ASSERT_ALWAYS( iStream && + iStream->Session() && + iStream->Session()->State() != CMceSession::EIdle && + iStream->Session()->State() != CMceSession::EIncoming, + User::Leave( KErrNotReady ) ); + + iAudioRouting = aRoute; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceSpeakerSink::RoutingL() const + { + __ASSERT_ALWAYS( iStream && + iStream->Session() && + iStream->Session()->State() != CMceSession::EIdle && + iStream->Session()->State() != CMceSession::EIncoming, + User::Leave( KErrNotReady ) ); + + return iAudioRouting; + } + +// ----------------------------------------------------------------------------- +// CMceSpeakerSink::CMceSpeakerSink +// ----------------------------------------------------------------------------- +// +CMceSpeakerSink::CMceSpeakerSink() + { + iType = KMceSpeakerSink; + iMaxVolume = KMceMaxVolume; + } + +// ----------------------------------------------------------------------------- +// CMceSpeakerSink::ConstructL +// ----------------------------------------------------------------------------- +// +void CMceSpeakerSink::ConstructL() + { + } + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/src/mcestreambundle.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/src/mcestreambundle.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,124 @@ +/* +* Copyright (c) 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: +* +*/ + + +#include "mcestreambundle.h" +#include "mcesession.h" + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CMceStreamBundle::NewL +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceStreamBundle* CMceStreamBundle::NewL( TMceStreamBundleType aType ) + { + CMceStreamBundle* self = NewLC( aType ); + CleanupStack::Pop( self ); + return self; + + } + +// ----------------------------------------------------------------------------- +// CMceStreamBundle::NewLC +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceStreamBundle* CMceStreamBundle::NewLC( TMceStreamBundleType aType ) + { + CMceStreamBundle* self = new (ELeave) CMceStreamBundle(); + CleanupStack::PushL( self ); + self->ConstructL( aType ); + return self; + } + +// ----------------------------------------------------------------------------- +// CMceStreamBundle::~CMceStreamBundle +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceStreamBundle::~CMceStreamBundle() + { + iStreams.Close(); + iTempStreams.Close(); + } + +// ----------------------------------------------------------------------------- +// CMceStreamBundle::Type +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceStreamBundle::TMceStreamBundleType CMceStreamBundle::Type() const + { + return iBundleType; + } + +// ----------------------------------------------------------------------------- +// CMceStreamBundle::AddStreamL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceStreamBundle::AddStreamL( CMceMediaStream& aStream ) + { + iStreams.AppendL( &aStream ); + } + +// ----------------------------------------------------------------------------- +// CMceStreamBundle::RemoveStreamL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceStreamBundle::RemoveStreamL( CMceMediaStream& aStream ) + { + TInt index = iStreams.Find( &aStream ); + User::LeaveIfError( index ); + iStreams.Remove( index ); + } + +// ----------------------------------------------------------------------------- +// CMceStreamBundle::Streams +// ----------------------------------------------------------------------------- +// +EXPORT_C const RPointerArray< CMceMediaStream >& CMceStreamBundle::Streams() + { + return iStreams; + } + + +// ----------------------------------------------------------------------------- +// CMceStreamBundle::InitializeL +// ----------------------------------------------------------------------------- +// +void CMceStreamBundle::InitializeL( CMceSession& aParent ) + { + iSession = &aParent; + } + +// ----------------------------------------------------------------------------- +// CMceStreamBundle::CMceStreamBundle +// ----------------------------------------------------------------------------- +// +CMceStreamBundle::CMceStreamBundle() + { + } + +// ----------------------------------------------------------------------------- +// CMceStreamBundle::ConstructL +// ----------------------------------------------------------------------------- +// +void CMceStreamBundle::ConstructL( CMceStreamBundle::TMceStreamBundleType aType ) + { + iBundleType = aType; + + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/src/mcetransactiondatacontainer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/src/mcetransactiondatacontainer.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,181 @@ +/* +* Copyright (c) 2002-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: +* +*/ + + +#include "mcetransactiondatacontainer.h" + + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// TMceTransactionDataContainer::GetStatusCode +// ----------------------------------------------------------------------------- +// +EXPORT_C TMceTransactionDataContainer::TMceTransactionDataContainer() : + iStatusCode(0), + iReasonPhrase(0), + iHeaders(0), + iContentType(0), + iContentHeaders(0), + iContent(0) + { + } + +// ----------------------------------------------------------------------------- +// TMceTransactionDataContainer::GetStatusCode +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt TMceTransactionDataContainer::GetStatusCode() + { + TInt tmpStatusCode = iStatusCode; + iStatusCode = 0; + return tmpStatusCode; + } + +// ----------------------------------------------------------------------------- +// TMceTransactionDataContainer::GetReasonPhrase +// ----------------------------------------------------------------------------- +// +EXPORT_C HBufC8* TMceTransactionDataContainer::GetReasonPhrase() + { + HBufC8* tmpReasonPhrase = iReasonPhrase; + iReasonPhrase = 0; + return tmpReasonPhrase; + } + +// ----------------------------------------------------------------------------- +// TMceTransactionDataContainer::GetHeaders +// ----------------------------------------------------------------------------- +// +EXPORT_C CDesC8Array* TMceTransactionDataContainer::GetHeaders() + { + CDesC8Array* tmpHeaders = iHeaders; + iHeaders = 0; + return tmpHeaders; + } + +// ----------------------------------------------------------------------------- +// TMceTransactionDataContainer::GetContentType +// ----------------------------------------------------------------------------- +// +EXPORT_C HBufC8* TMceTransactionDataContainer::GetContentType() + { + HBufC8* tmpContentType = iContentType; + iContentType = 0; + return tmpContentType; + } + +// ----------------------------------------------------------------------------- +// TMceTransactionDataContainer::GetHeaders +// ----------------------------------------------------------------------------- +// +EXPORT_C CDesC8Array* TMceTransactionDataContainer::GetContentHeaders() + { + CDesC8Array* tmpHeaders = iContentHeaders; + iContentHeaders = 0; + return tmpHeaders; + } + +// ----------------------------------------------------------------------------- +// TMceTransactionDataContainer::GetContent +// ----------------------------------------------------------------------------- +// +EXPORT_C HBufC8* TMceTransactionDataContainer::GetContent() + { + HBufC8* tmpContent = iContent; + iContent = 0; + return tmpContent; + } + +// ----------------------------------------------------------------------------- +// TMceTransactionDataContainer::SetStatusCode +// ----------------------------------------------------------------------------- +// +EXPORT_C void TMceTransactionDataContainer::SetStatusCode( TInt aStatusCode) + { + iStatusCode = aStatusCode; + } + +// ----------------------------------------------------------------------------- +// TMceTransactionDataContainer::SetReasonPhrase +// ----------------------------------------------------------------------------- +// +EXPORT_C void TMceTransactionDataContainer::SetReasonPhrase( HBufC8* aReasonPhrase ) + { + delete iReasonPhrase; + iReasonPhrase = aReasonPhrase; + } + +// ----------------------------------------------------------------------------- +// TMceTransactionDataContainer::SetHeaders +// ----------------------------------------------------------------------------- +// +EXPORT_C void TMceTransactionDataContainer::SetHeaders( CDesC8Array* aHeaders ) + { + delete iHeaders; + iHeaders = aHeaders; + } + +// ----------------------------------------------------------------------------- +// TMceTransactionDataContainer::SetContentType +// ----------------------------------------------------------------------------- +// +EXPORT_C void TMceTransactionDataContainer::SetContentType( HBufC8* aContentType ) + { + delete iContentType; + iContentType = aContentType; + } + +// ----------------------------------------------------------------------------- +// TMceTransactionDataContainer::SetContent +// ----------------------------------------------------------------------------- +// +EXPORT_C void TMceTransactionDataContainer::SetContent( HBufC8* aContent ) + { + delete iContent; + iContent = aContent; + } + +// ----------------------------------------------------------------------------- +// TMceTransactionDataContainer::SetContentHeaders +// ----------------------------------------------------------------------------- +// +EXPORT_C void TMceTransactionDataContainer::SetContentHeaders( CDesC8Array* aHeaders ) + { + delete iContentHeaders; + iContentHeaders = aHeaders; + } + +// ----------------------------------------------------------------------------- +// TMceTransactionDataContainer::Clear +// ----------------------------------------------------------------------------- +// +EXPORT_C void TMceTransactionDataContainer::Clear() + { + iStatusCode = 0; + delete iReasonPhrase; + iReasonPhrase = 0; + delete iHeaders; + iHeaders = 0; + delete iContentType; + iContentType = 0; + delete iContentHeaders; + iContentHeaders = 0; + delete iContent; + iContent = 0; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/src/mcevideocodec.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/src/mcevideocodec.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,158 @@ +/* +* Copyright (c) 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: +* +*/ + + +#include "mcevideocodec.h" + +// Avc config keys for all the . +// Getter is not virtual so keys must be returned from base class and +// the level values defined in mceavccodec.h are redefined. +_LIT8( KMceStubAvcBitrateLevel1ConfigKey, "TestTextForAvcBrL1Level" ); +_LIT8( KMceStubAvcBitrateLevel1bConfigKey, "TestTextForAvcBrL1bLevel" ); +_LIT8( KMceStubAvcBitrateLevel1_1ConfigKey, "TestTextForAvcBrL1_1Level" ); +_LIT8( KMceStubAvcBitrateLevel1_2ConfigKey, "TestTextForAvcBrL1_2Level" ); +_LIT8( KMceStubAvcBitrateLevel1_3ConfigKey, "TestTextForAvcBrL1_3Level" ); +_LIT8( KMceStubAvcBitrateLevel2ConfigKey, "TestTextForAvcBrL2Level" ); +const TUint KMceStubAvcBitrateLevel1 = 0x0001; +const TUint KMceStubAvcBitrateLevel1b = 0x0002; +const TUint KMceStubAvcBitrateLevel1_1 = 0x0004; +const TUint KMceStubAvcBitrateLevel1_2 = 0x0008; +const TUint KMceStubAvcBitrateLevel1_3 = 0x0010; +const TUint KMceStubAvcBitrateLevel2 = 0x0020; + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// CMceVideoCodec::~CMceVideoCodec +// ----------------------------------------------------------------------------- +// +CMceVideoCodec::~CMceVideoCodec() + { + delete iConfigKey; + } + + +// ----------------------------------------------------------------------------- +// CMceVideoCodec::AllowedFrameRates +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint CMceVideoCodec::AllowedFrameRates() const + { + return iAllowedFrameRates; + } + + +// ----------------------------------------------------------------------------- +// CMceVideoCodec::FrameRate +// ----------------------------------------------------------------------------- +// +EXPORT_C TReal CMceVideoCodec::FrameRate() const + { + return iFrameRate; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C HBufC8* CMceVideoCodec::ConfigKeyL() const + { + HBufC8* configKey = NULL; + + if ( iConfigKey ) + { + configKey = iConfigKey->AllocL(); + } + + if ( !configKey && SdpName() == KMceSDPNameH264() ) + { + if ( AllowedBitrates() & KMceStubAvcBitrateLevel1 ) + { + configKey = KMceStubAvcBitrateLevel1ConfigKey().AllocL(); + } + else if ( AllowedBitrates() & KMceStubAvcBitrateLevel1b ) + { + configKey = KMceStubAvcBitrateLevel1bConfigKey().AllocL(); + } + else if ( AllowedBitrates() & KMceStubAvcBitrateLevel1_1 ) + { + configKey = KMceStubAvcBitrateLevel1_1ConfigKey().AllocL(); + } + else if ( AllowedBitrates() & KMceStubAvcBitrateLevel1_2 ) + { + configKey = KMceStubAvcBitrateLevel1_2ConfigKey().AllocL(); + } + else if ( AllowedBitrates() & KMceStubAvcBitrateLevel1_3 ) + { + configKey = KMceStubAvcBitrateLevel1_3ConfigKey().AllocL(); + } + else if ( AllowedBitrates() & KMceStubAvcBitrateLevel2 ) + { + configKey = KMceStubAvcBitrateLevel2ConfigKey().AllocL(); + } + else + { + User::Leave( KErrNotFound ); + } + } + + return configKey; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint CMceVideoCodec::MaxBitRate() const + { + return iMaxBitRate; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint CMceVideoCodec::AllowedResolutions() const + { + return iAllowedResolutions; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TSize CMceVideoCodec::Resolution() const + { + return TSize( iResolutionWidth, + iResolutionHeight ); + } + + +// ----------------------------------------------------------------------------- +// CMceVideoCodec::CMceVideoCodec +// ----------------------------------------------------------------------------- +// +CMceVideoCodec::CMceVideoCodec() + { + iType = KMceVideoCodec; + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/src/mcevideostream.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/src/mcevideostream.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,231 @@ +/* +* 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 "mcevideostream.h" +#include "mcevideocodec.h" +#include "mcesession.h" +#include "mcemanager.h" +#include "mcefilesource.h" +#include "mcemediasink.h" +#include "mcecamerasource.h" +//#include "mcertpsource.h" +#include "mcertpsink.h" +#include "mcedisplaysink.h" +#include "mceh263codec.h" + +#define _FLAT_DATA static_cast( iFlatData ) + + + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// Factory method +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceVideoStream* CMceVideoStream::NewL() + { + CMceVideoStream* self = CMceVideoStream::NewLC(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// Factory method +// Leaves instance on CleanupStack. +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceVideoStream* CMceVideoStream::NewLC() + { + CMceVideoStream* self = new (ELeave) CMceVideoStream(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// ----------------------------------------------------------------------------- +// Destructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceVideoStream::~CMceVideoStream() + { + iCodecs.ResetAndDestroy(); + iSupportedVideoCodecs.ResetAndDestroy(); + } + + +// ----------------------------------------------------------------------------- +// Returns codec. +// Returns the codecs available to the session. +// ----------------------------------------------------------------------------- +// +EXPORT_C const RPointerArray& CMceVideoStream::Codecs() + { + return iCodecs; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceVideoStream::AddCodecL( CMceVideoCodec* aCodec ) + { + __ASSERT_ALWAYS(aCodec, User::Leave(KErrArgument)); + iCodecs.AppendL(aCodec); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceVideoStream::RemoveCodecL( CMceVideoCodec& aCodec ) + { + for(int i = 0; i < iCodecs.Count(); i++ ) + { + if( iCodecs[i] == &aCodec ) + { + delete iCodecs[i]; + iCodecs.Remove( i ); + } + } + } + + +// ----------------------------------------------------------------------------- +// NOT IMPLEMENTED YET +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceVideoStream::ReplaceCodecsL( RPointerArray* /*aCodecs*/ ) + { + User::Leave( KErrNotSupported ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C const RPointerArray& + CMceVideoStream::SupportedVideoCodecs() const + { + return iSupportedVideoCodecs; + } + + +// ----------------------------------------------------------------------------- +// CMceVideoStream::InitializeL +// ----------------------------------------------------------------------------- +// +void CMceVideoStream::InitializeL( CMceSession& aParent ) + { + CMceMediaStream::InitializeL( aParent ); + + InitializeL( &aParent.Manager() ); + + for( TInt i = 0; i < iCodecs.Count(); i++ ) + { + iCodecs[i]->InitializeL( *this ); + } + } + + +// ----------------------------------------------------------------------------- +// CMceVideoStream::InitializeL +// ----------------------------------------------------------------------------- +// +void CMceVideoStream::InitializeL( CMceManager* aManager ) + { + CMceMediaStream::InitializeL( aManager ); + if ( aManager && iCodecs.Count() == 0 ) + { + const RPointerArray supportedCodecs = + aManager->SupportedVideoCodecs(); + + TBool fileCodecAdded( EFalse ); + for( TInt i = 0; i < supportedCodecs.Count() && !fileCodecAdded; i++ ) + { + if ( iSource && iSource->Type() == KMceFileSource ) + { + // Fake codec using file name + CMceFileSource* fileSource = + static_cast(iSource); + TBuf8<256*2> fileName; + fileName.Copy( fileSource->iFileName ); + const TDesC8& currentCodecName( supportedCodecs[i]->SdpName() ); + + if ( ( fileName.FindF( KMceSDPNameH264() ) >= 0 && + currentCodecName.FindF( KMceSDPNameH264() ) >= 0 || + ( fileName.FindF( KMceSDPNameH263() ) >= 0 && + currentCodecName.FindF( KMceSDPNameH263() ) >= 0 ) ) ) + { + CMceVideoCodec* codec = supportedCodecs[i]->CloneL(); + CleanupStack::PushL( codec ); + iCodecs.AppendL( codec ); + CleanupStack::Pop( codec ); + iState = EInitialized; + fileCodecAdded = ETrue; + } + else + { + iState = ETranscodingRequired; + } + + } + else + { + CMceVideoCodec* codec = supportedCodecs[i]->CloneL(); + CleanupStack::PushL( codec ); + iCodecs.AppendL( codec ); + CleanupStack::Pop( codec ); + } + } + } + } + + +// ----------------------------------------------------------------------------- +// CMceVideoStream::IsAllowedCombination +// ----------------------------------------------------------------------------- +// +TBool CMceVideoStream::IsAllowedCombination() + { + return ETrue; + } + + +// ----------------------------------------------------------------------------- +// Default C++ constructor. +// ----------------------------------------------------------------------------- +// +CMceVideoStream::CMceVideoStream() + :CMceMediaStream() + { + iType = KMceVideo; + } + + +// ----------------------------------------------------------------------------- +// Symbian 2nd phase constructor. +// ----------------------------------------------------------------------------- +// +void CMceVideoStream::ConstructL() + { + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/src/mussessionsimulator.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/src/mussessionsimulator.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,330 @@ +/* +* Copyright (c) 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: +* +*/ + +#include +#include +#include +#include +#include +#include +#include "mceinsessionobserver.h" +#include "mcesessionobserver.h" +#include "mussessionsimulator.h" +#include "muslogger.h" +#include +#include "mussessionproperties.h" + + + +TInt KDuration = 60*1; + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// CMceManager::NewL +// ----------------------------------------------------------------------------- +// +CMusTestSessionSimulator* CMusTestSessionSimulator::NewL( CMceManager& aManager) + { + + CMusTestSessionSimulator* self = + new (ELeave) CMusTestSessionSimulator( aManager ); + CleanupStack::PushL( self ); + self->ConstructL( ); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CMceManager::~CMceManager +// ----------------------------------------------------------------------------- +// + +CMusTestSessionSimulator::CMusTestSessionSimulator( CMceManager& aManager ) + :iManager(aManager) + { + + } + +// ----------------------------------------------------------------------------- +// CMceManager::~CMceManager +// ----------------------------------------------------------------------------- +// +void CMusTestSessionSimulator::ConstructL( ) + { + iTimer = CMusTestTimer::NewL(CActive::EPriorityStandard, *this); + SimulateReceiveSession(); + StartL(); + } + +// ----------------------------------------------------------------------------- +// Callback implementation when the timer activity happens in the CMusTestTimer class +// ----------------------------------------------------------------------------- +// +void CMusTestSessionSimulator::StartL() + { + TTimeIntervalMicroSeconds32 someInterVal(KDuration); //you can call After/At/Inactivity depending on what you want to do + iTimer->After(someInterVal); + } + +// ----------------------------------------------------------------------------- +// Callback implementation when the timer activity happens in the CMusTestTimer class +// ----------------------------------------------------------------------------- +// +TBool CMusTestSessionSimulator::IsRunning() + { + return iTimer->IsActive(); + } + +// ----------------------------------------------------------------------------- +// Callback implementation when the timer activity happens in the CMusTestTimer class +// ----------------------------------------------------------------------------- +// +void CMusTestSessionSimulator::Stop( ) + { + iTimer->Cancel(); + } + +// ----------------------------------------------------------------------------- +// Callback implementation when the timer activity happens in the CMusTestTimer class +// ----------------------------------------------------------------------------- +// +void CMusTestSessionSimulator::TimerExpired(TAny* aTimer,TInt aError) + { + if(aError == KErrNone) + { + // Timer successfully completed, handle it + CMusTestTimer* timer = (CMusTestTimer*)aTimer; + MUS_LOG("CMusTestSessionSimulator TimerExipired Change the state") + StateChangeL(); + if( (iManager.iSessions[0]->iState == CMceSession::EEstablished )|| + ( iManager.iSessions[0]->iState == CMceSession::EIncoming ) + ) + { + timer->Cancel(); + } + else + { + TTimeIntervalSeconds seconds(KDuration); + timer->Inactivity(seconds); //Notify inactivity after 10 seconds + } + } + } + +// ----------------------------------------------------------------------------- +// Simulates Receive Session +// ----------------------------------------------------------------------------- +// +void CMusTestSessionSimulator::SimulateReceiveSession() + { + MUS_LOG("CMusTestSessionSimulator::SimulateReceiveSession ->") + TInt usecase; + TInt err = RProperty::Get( NMusSessionApi::KCategoryUid, NMusSessionApi::KUseCase, usecase); + if( err == KErrNone ) + { + if( usecase == MultimediaSharing::EMusReceive || usecase == MultimediaSharing::EMusReceiveTwoWayVideo ) + { + MUS_LOG("CMusTestSessionSimulator::SimulateReceiveSession receive session ") + CMceInSession* inSession = CMceInSession::NewL(); + inSession->iState = CMceSession::EIncoming; + iManager.iSessions.AppendL( inSession ); + ibIncoming = ETrue; + } + else + { + ibIncoming = EFalse; + } + } + else + { + MUS_LOG1("CMusTestSessionSimulator::SimulateReceiveSession err = %d ",err) + } + MUS_LOG("CMusTestSessionSimulator::SimulateReceiveSession <-") + } +// ----------------------------------------------------------------------------- +// CMceManager::~CMceManager +// ----------------------------------------------------------------------------- +// +void CMusTestSessionSimulator::StateChangeL() + { + MUS_LOG("CMusTestSessionSimulator::StateChangeL ->") + TMceTransactionDataContainer* container = new TMceTransactionDataContainer(); + HBufC8* resonPharase = _L8("OK").AllocL(); ; + TInt statusCode = 200; + switch( iManager.iSessions[0]->iState ) + { + case CMceSession::EIdle : // offering + statusCode = 180; + delete resonPharase; + resonPharase = _L8("Ringing").AllocL(); + iManager.iSessions[0]->iState = CMceSession::EOffering; + MUS_LOG("CMusTestSessionSimulator Session state : Offering 180") + break; + case CMceSession::EOffering : // estabilished + case CMceSession::EAnswering : // estabilished + delete resonPharase; + resonPharase = _L8("OK").AllocL(); + iManager.iSessions[0]->iState = CMceSession::EEstablished; + MUS_LOG("CMusTestSessionSimulator Session state : Answering") + break; + case CMceSession::EEstablished : // estabilished + delete resonPharase; + resonPharase = _L8("OK").AllocL(); + MUS_LOG("CMusTestSessionSimulator Session state : Estabilished") + break; + case CMceSession::ETerminating : // estabilished + delete resonPharase; + resonPharase = _L8("OK").AllocL(); + iManager.iSessions[0]->iState = CMceSession::ETerminated; + MUS_LOG("CMusTestSessionSimulator Session state : Terminated") + break; + case CMceSession::EIncoming : // estabilished + // handled down + break; + case CMceSession::EProceeding : // estabilished + iManager.iSessions[0]->iState = CMceSession::EAnswering; + MUS_LOG("CMusTestSessionSimulator Session state : Proceeding"); + break; + case CMceSession::EReserving : // estabilished + iManager.iSessions[0]->iState = CMceSession::EProceeding; + MUS_LOG("CMusTestSessionSimulator Session state : Reserving") + default: + break; + } + if( iManager.iSessions[0]->iState == CMceSession::EIncoming ) + { + MUS_LOG("CMusTestSessionSimulator Session state : Incoming") + if( iManager.iSessionObserver && container ) + { + CMceInSession* session = ( CMceInSession* ) iManager.iSessions[0]; + if( session ) + { + MUS_LOG("CMusTestSessionSimulator Calling InComingSession") + iManager.iInSessionObserver->IncomingSession( session , container ); + iManager.iSessions[0]->iState = CMceSession::EReserving; + } + } + else + { + MUS_LOG("CMusTestSessionSimulator insessionobserver empty ") + } + } + else + { + MUS_LOG("CMusTestSessionSimulator Session state : Inform Session state") + container->SetStatusCode(statusCode); + container->SetReasonPhrase( resonPharase ); + if( iManager.iSessionObserver && container ) + { + MUS_LOG("CMusTestSessionSimulator Calling SessionStateChanged") + if( iManager.iSessions.Count() > 0 ) + { + CMceSession* session = iManager.iSessions[0]; + if( session ) + { + iManager.iSessionObserver->SessionStateChanged( *session ,container); + } + else + { + MUS_LOG("CMusTestSessionSimulator session empty ") + } + } + else + { + MUS_LOG("CMusTestSessionSimulator No Session found ") + } + } + else + { + MUS_LOG("CMusTestSessionSimulator Invalid pointer") + } + } + delete container; + MUS_LOG("CMusTestSessionSimulator::StateChangeL <-") + } + +// ----------------------------------------------------------------------------- +// CMceManager::~CMceManager +// ----------------------------------------------------------------------------- +// +EXPORT_C CMusTestSessionSimulator::~CMusTestSessionSimulator() + { + Stop(); + delete iTimer; + } + +//-------------------------------------------------------------------------------- +// Timer implementation +//-------------------------------------------------------------------------------- +// +CMusTestTimer::CMusTestTimer(const TInt aPriority,MTimerNotify& aNotify) +:CActive(aPriority),iNotify(aNotify) +{ +} + +CMusTestTimer::~CMusTestTimer() +{ + Cancel(); + iTimer.Close(); +} + +CMusTestTimer* CMusTestTimer::NewL(const TInt aPriority,MTimerNotify& aNotify) +{ + CMusTestTimer* me = new (ELeave) CMusTestTimer(aPriority,aNotify); + CleanupStack::PushL(me); + me->ConstructL(); + CleanupStack::Pop(); + return me; +} + +void CMusTestTimer::ConstructL(void) +{ + CActiveScheduler::Add(this); + iTimer.CreateLocal(); +} + +void CMusTestTimer::After(TTimeIntervalMicroSeconds32 aInterval) +{ + Cancel(); + iTimer.After(iStatus,aInterval); + SetActive(); +} + +void CMusTestTimer::At(const TTime& aTime) +{ + Cancel(); + iTimer.At(iStatus,aTime); + SetActive(); +} + +void CMusTestTimer::Inactivity(TTimeIntervalSeconds aSeconds) +{ + Cancel(); + iTimer.Inactivity(iStatus,aSeconds); + SetActive(); +} + +void CMusTestTimer::DoCancel() +{ + iTimer.Cancel(); +} + +void CMusTestTimer::RunL() +{ + iNotify.TimerExpired(this,iStatus.Int()); +} diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/src/staticdllentry.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/mceclientstub/src/staticdllentry.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,37 @@ +/* +* Copyright (c) 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: +* +*/ + + + +#include + + +// Bullseye reguires following entry point +#ifdef _BullseyeCoverage +GLDEF_C int __stdcall __E32Dll(void*, unsigned, void*) + { + return 0; + } +#else +#ifndef EKA2 +// Starting point of the DLL (Removed in EKA2) +GLDEF_C TInt E32Dll(TDllReason) + { + return(KErrNone); + } +#endif +#endif // _BullseyeCoverage diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/sipclientstub/group/sipclient.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/sipclientstub/group/sipclient.mmp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2006-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: Definition of project MceClientStub +* +*/ + + +// To get the APP_LAYER_SYSTEMINCLUDE-definition +#include + +#include + +TARGET sipclient.dll +TARGETTYPE dll +UID 0x1000008d 0x00000112 // Experimental UID + +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE Csipconnection.cpp + SOURCE CSIPMessageElements.cpp + SOURCE CSIPRequestElements.cpp + SOURCE CSIPResponseElements.cpp + SOURCE Csipservertransaction.cpp + SOURCE Csiptransactionbase.cpp + SOURCE CSipSseTestTls.cpp + + +USERINCLUDE ../inc + +// Default system include paths for application layer modules. +APP_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY bafl.lib +LIBRARY sipcodec.lib + +EXPORTUNFROZEN \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/sipclientstub/inc/CSipSseTestTls.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/sipclientstub/inc/CSipSseTestTls.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,180 @@ +/* +* Copyright (c) 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: +* +*/ + + + +#ifndef CSIPSSETESTTLS_H +#define CSIPSSETESTTLS_H + +#include +#include +#include +#include + +#include +#include + +class CSIPMessageElements; +class CSIPResponseElements; +class RStringF; +class CSdpDocument; +class CSsfInvitation; +class TRequestStatus; +class CConnMonEventBase; +class CSIPRequestElements; + +//class CTelephony; +//class MSIPProfileRegistryObserver; + +// STUB stuff + +typedef TInt TSIPProfileBehavior; +const TSIPProfileBehavior KRegistryLeaveAtConstruct = 1; +const TSIPProfileBehavior KSIPProfileIdFetchFails = 2; +const TSIPProfileBehavior KSIPIapIdFetchFails = 3; +const TSIPProfileBehavior KSIPConnectionLeaveAtConstruct = 4; + +class CSipSseTestTls : public CBase + { + +public: + + static void OpenL(); + + static void Close(); + + static CSipSseTestTls* Storage(); + + ~CSipSseTestTls(); + + void Reset(); + + TInt Set(TUint32 aKey, TInt aValue); + + TInt Get(TUint32 aKey, TInt& aValue); + + void SetError( TInt aError ); + + TInt Error() const; + + void Clear(); + + void SetRequestStatus( TRequestStatus& iStatus ); + + TBool RegisterStatus(); + + void SetRegisterStatus( TBool aStatus ); + + TBool RegisterSent(); + + void StoreRegistry( MSIPProfileRegistryObserver& aRegistry ); + + //RCommMon + TInt ConnectionCount(); + + void SetConnectionCount( TInt aCount ); + + void ConnectionInfo( const TUint& aIndex, + TUint& aConnectionId, + TUint& aSubConnectionCount ); + + void SetConnectionInfo( TUint aConnectionId, + TUint aSubConnectionCount ); + + void GetUintAttribute( const TUint aConnectionId, + const TUint aSubConnectionId, + const TUint aAttribute, + TUint& aValue, + TRequestStatus& aStatus ); + + void SetUintAttribute( const TUint aConnectionId, + const TUint aSubConnectionId, + const TUint aAttribute, + TUint aValue, + TRequestStatus& aStatus ); + + void GetIntAttribute( const TUint aConnectionId, + const TUint aSubConnectionId, + const TUint aAttribute, + TInt& aValue, + TRequestStatus& aStatus ); + + void SetIntAttribute( const TUint aConnectionId, + const TUint aSubConnectionId, + const TUint aAttribute, + TInt aValue, + TRequestStatus& aStatus ); + + void SetEvent(const CConnMonEventBase& aConnMonEvent ); + + + const CConnMonEventBase& Event(); + + + void SetRegistrationStatus( RMobilePhone::TMobilePhoneRegistrationStatus aRegStatus ); + void SetRegistrationStatus( RMobilePhone::TMobilePhoneRegistrationStatus* aRegStatus ); + + void RegistrationStatus( RMobilePhone::TMobilePhoneRegistrationStatus& aReqStatus ); + + void SetPhoneNetworkModeStatus( RMobilePhone::TMobilePhoneNetworkMode aStatus ); + + RMobilePhone::TMobilePhoneNetworkMode& PhoneNetworkModeStatus(); + + void ClientRequest( CSIPRequestElements* aRequest ); + void ClientResponse( RStringF aMethod, CSIPResponseElements* aResponse ); + +private: + + CSipSseTestTls(); + +public://data + + // Stubs leave/return this error + TInt iError; + static TBool iSipRegisterStatus; + MSIPProfileRegistryObserver* iRegistry; + //RCommMon + TInt iConnectionCount; + //ConnectionInfo + TUint iConnectionId; + TUint iSubConnectionCount; + //UintAttribute + TUint iUintAttributeValue; + //UintAttribute + TUint iIntAttributeValue; + TRequestStatus iRequestStatus; + CConnMonEventBase* iConnMonEventBase; + + RMobilePhone::TMobilePhoneRegistrationStatus iPhoneRegistrationStatus; + RMobilePhone::TMobilePhoneRegistrationStatus* iPhoneRegistrationStatusPointer; + RMobilePhone::TMobilePhoneNetworkMode iPhoneNetworkMode; + + CSIPRequestElements* iClientRequest; + RStringF iResponseToRequest; + CSIPResponseElements* iClientResponse; + RArray iKeys; + RArray iValues; + TSIPProfileBehavior iRegistryBehavior; + TSIPProfileBehavior iProfileBehavior; + TSIPProfileBehavior iConnectionBehavior; + }; + + + +#endif + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/sipclientstub/inc/sipconnection.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/sipclientstub/inc/sipconnection.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,573 @@ +/* +* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 CSIPCONNECTION_H +#define CSIPCONNECTION_H + +// INCLUDES +#include +#include + +// FORWARD DECLARATIONS +class CSIP; +class MSIPConnectionObserver; +class CSIPTransactionBase; +class CSIPClientTransaction; +class CSIPServerTransaction; +class MSIPRegistrationContext; +class CSIPRegistrationBinding; +class CRegistrationState; +class CSIPDialog; +class CDialogState; +class CSIPRefresh; +class CSIPMessageElements; +class CSIPRequestElements; +class CSIPResponseElements; +class CSIPClientConnectionObserver; +class CConnectionCallback; +class CSIPClientConnection; + + +//CONSTANTS +/** SIP minimum value for the expiration in seconds*/ +//const TUint KSIPMinExpirationValue=60; + + +// CLASS DECLARATION + +/** +* Class for monitoring connection's state and sending SIP requests outside +* the dialog associations.Class must not be used +* -for sending requests to which received non-failure response creates a dialog +* -for sending requests that must be sent within SIP dialog +* Note that the user can have only one instance of the class per same IAP-id +*/ +class CSIPConnection : + public CBase + { + public: + + /** Connection states */ + enum TState + { + /** Connection initializing */ + EInit=1, + /** Connection active */ + EActive, + /** Connection suspended */ + ESuspended, + /** Connection is inactive */ + EInactive, + /** Connection is permanently unavailable */ + EUnavailable + }; + + public: // Constructors and destructor + + /** + * Two-phased constructor. + * @param aSip a handle to the SIP server + * @param aIapId IAP-id + * @param aObserver a observer for receiving asynchonous events on this + * connection + * @return New object, ownership is transferred + */ + + IMPORT_C static CSIPConnection* + NewL(CSIP& aSIP, + TUint32 aIapId, + MSIPConnectionObserver& aObserver); + + + /** + * Two-phased constructor. + * Constructs an object and adds the pointer to the cleanup stack; + * @param aSip a handle to the SIP server + * @param aIapId IAP-id + * @param aObserver a observer for receiving asynchonous events on this + * connection + * @return New object, ownership is transferred + */ + + IMPORT_C static CSIPConnection* + NewLC(CSIP& aSIP, + TUint32 aIapId, + MSIPConnectionObserver& aObserver); + + + /** + * Destructor + */ + + IMPORT_C ~CSIPConnection(); + + public: // New functions + + /** + * Gets current state of the connection + * @return current state of the connection + */ + + IMPORT_C TState State() const; + + /** + * Creates SIP request and sends it to the given destination. + * The function must not be used with SIP requests that creates + * SIP dialog associations or must be sent within SIP dialog + * association. + * This provokes the Non-invite state machine. + * This function must be used if the user has created the + * registration binding. + * @pre State() == EActive. + * @pre aContext.IsContextActive()==ETrue + * @param aElements contains local and remote addresses, + * optional SIP message headers and body. + * The ownership is transferred. + * @param aContext defines outbound proxy to be used. If the user + * does not provide from-address it will be constucted using + * user's AOR used during the registration. + * @return SIP client transaction, ownership is transferred + */ + + IMPORT_C CSIPClientTransaction* + SendRequestL(CSIPRequestElements* aElements, + const MSIPRegistrationContext& aContext); + + + /** + * Creates SIP request and sends it to the given destination. + * The function must not be used with SIP request that creates + * SIP dialog associations or must be sent within SIP diallog + * association. + * This provokes the Non-invite state machine. + * This function must be used if the user has created the + * registration binding. + * @pre State() == EActive. + * @pre aContext.IsContextActive()==ETrue + * @param aElements contains local and remote addresses, + * optional SIP message headers and body. + * The ownership is transferred. + * @param aContext defines outbound proxy to be used. If the user + * does not provide from-address it will + * be constucted using user's AOR used during the registration. + * @param aRefresh defines the refresh interval for this transaction. + * @return SIP client transaction, ownership is transferred + */ + + IMPORT_C CSIPClientTransaction* + SendRequestL(CSIPRequestElements* aElements, + const MSIPRegistrationContext& aContext, + CSIPRefresh& aRefresh); + + + /** + * Creates SIP request and sends it to the given destination. + * The function must not be used with SIP request that creates SIP + * diallog associations or must be sent within SIP dialog association. + * This invokes the Non-invite state machine. + * @pre State() == EActive. + * @pre aElements.FromHeader() != 0 + * @param aElements contains local and remote addresses, + * optional SIP message headers and body. + * The ownership is transferred. + * @return SIP client transaction, ownership is transferred + */ + + IMPORT_C CSIPClientTransaction* + SendRequestL(CSIPRequestElements* aElements); + + + /** + * Creates SIP request and sends it to the given destination. + * The function must not be used with SIP request that creates SIP + * dialog associations or must be sent within SIP dialog association. + * This invokes the Non-invite state machine. + * @pre State() == EActive. + * @pre aElements.FromHeader() != 0 + * @param aElements contains local and remote addresses, + * optional SIP message headers and body. + * The ownership is transferred. + * @param aRefresh indicates that transaction will be refreshed + * @return SIP client transaction, ownership is transferred + */ + + IMPORT_C CSIPClientTransaction* + SendRequestL(CSIPRequestElements* aElements, + CSIPRefresh& aRefresh); + + + /** + * Creates SIP REGISTER request and sends it to the given destination. + * User must no define any Contact or Expires-headers + * in the provided elements. + * @pre State() == EActive + * @pre aElements != 0 + * @pre aElements->Method().DesC().Length()==0 + * @param aElements contains local and remote addresses, optional SIP + * message headers and body. User must not set any expires values + * to aElements. The ownership is transferred. + * @return SIP REGISTER client transaction, ownership is transferred + */ + + IMPORT_C CSIPClientTransaction* + FetchRegistrationsL(CSIPRequestElements* aElements); + + // Not in real SIP API: + IMPORT_C void SetState(TState aState); + + //TODO:SHOULD THIS NEW FUNCTION BE INCLUDED INTO STUB??? + /** + * Gets Iap-id used for this connection + * @return Iap-id + */ + + IMPORT_C TUint32 IapId() const; + + + /** + * Gets SIP server handle + * @return handle to SIP server, or 0-pointer if SIP server does not + * exist any more + */ + IMPORT_C CSIP* SIP(); + + /** + * Gets SIP server handle + * @return handle to SIP server, or 0-pointer if SIP server does not + * exist any more + */ + + IMPORT_C const CSIP* SIP() const; + //TODO:ENDS + + /** + * Incoming request outside dialog has been received. + * + * @param aTransaction Server transaction. Ownership is transferred. + */ + + void IncomingRequestL(CSIPServerTransaction* aTransaction) const; + + /** + * Gets the local IP address of this CSIPConnection + * that is used by the SIP implementation. + * The user should re-new the call whenever the connection state changes + * to the CSIPConnection::EActive in order to verify the correctness of + * the previously retrieved local IP address. The local IP address might + * be different as a result of the connection state change. + * @pre State() == CSIPConnection::EActive + * @param aAddr on return filled with local IP address + * @leave a system-wide error code + */ + IMPORT_C void GetLocalAddrL(TInetAddr& aAddr) const; + + + /** + * Incoming request within dialog has been received. + * + * @param aTransaction Server transaction. Ownership is transferred. + * @param aDialogId Identifies the dialog to which the transaction + * belongs to. + */ + + void IncomingDialogRequestL(CSIPServerTransaction* aTransaction, + TUint32 aDialogId); + + void IncomingResponseL(CSIPResponseElements* aElements, + TUint32 aRequestId) const; + + void IncomingRegistrationResponseL(CSIPResponseElements* aElements, + TUint32 aRequestId, + TUint32 aRegistrationId) const; + + void IncomingRefreshResponseL(CSIPResponseElements* aElements, + TUint32 aRequestId, + TUint32 aRefreshId); + + + void ErrorOccured(TInt aError, TUint32 aRequestId) const; + + void RefreshErrorOccured(TInt aError, TUint32 aRefreshId) const; + + void RegistrationErrorOccured(TInt aError, + TUint32 aRegistrationId, + TUint32 aRequestId) const; + + void DialogErrorOccured(TInt aError, + TUint32 aDialogId, + TUint32 aRequestId) const; + + void DialogErrorOccured(TInt aError, + TUint32 aDialogId, + TUint32 aRefreshId, + TUint32 aRequestId) const; + + void ConnectionStateChanged(CSIPConnection::TState aState); + + void InviteCompleted(TUint32 aRequestId) const; + + + /** + * Searches for a transaction with the matching aRequestId. + * @param aRequestId RequestId associated with the transaction + * @return Found transaction or NULL if not found. Ownership is not + * transferred. + */ + + CSIPTransactionBase* FindTransaction(TUint32 aRequestId) const; + + + TInt AddRegistration(CSIPRegistrationBinding* aRegistration); + void RemoveRegistration(const CSIPRegistrationBinding* aRegistration); + + + /** + * Searches for a registration binding, using aRegistrationId and + * aRequestId as keys. Registration might not yet have received + * RegistrationId from SIP client, so the aRequestId may be needed to + * locate the registration binding. + * @param aRegistrationId RegistrationId of the registration binding + * @param aRequestId RequestId of a transaction associated with the + * registration + * @return Found registration binding or NULL if not found. + * Ownership is not transferred. + */ + + CSIPRegistrationBinding* FindRegistration(TUint32 aRegistrationId, + TUint32 aRequestId) const; + + + TInt AddDialog(CSIPDialog* aDialog); + void RemoveDialog(const CSIPDialog* aDialog); + + + /** + * Searches for a dialog, using aRequestId as a key. + * @param aRequestId RequestId of a transaction associated with the + * dialog + * @return Found dialog or NULL if not found. Ownership is not + * transferred. + */ + + CSIPDialog* FindDialogByRequestId(TUint32 aRequestId) const; + + + /** + * Informs CSIPConnection that the associated CSIP instance has been + * deleted. After this the CSIPConnection object can't be used anymore. + */ + + void CSIPDeleted(); + + + /** + * Obtains the initial state for registration state machine. + * + * @return Initial registration state, ownership is not transferred + */ + + CRegistrationState* InitialRegisterStateL() const; + + + /** + * Obtains the initial state for dialog state machine. + * + * @return Initial dialog state, ownership is not transferred + */ + + CDialogState* InitialDialogStateL() const; + + + /** + * Response related to a dialog has been received. + * + * @param aElements SIP response elements. Ownership is transferred. + * @param aRequestId Identifies the transaction + * @param aDialogId DialogId + * @param aRefreshId NULL if the response is not related to a refresh, + * otherwise the RefreshId. Ownership is not transferred. + */ + + void IncomingResponseToDialogL(CSIPResponseElements* aElements, + TUint32 aRequestId, + TUint32 aDialogId, + TUint32* aRefreshId); + + private: + CSIPConnection(CSIP& aSIP, + TUint32 aIapId, + MSIPConnectionObserver& aObserver); + + void ConstructL(); + + + /** + * Send a SIP request. + * + * @param aElements SIP headers. Ownership is transferred. + * @param aRegistrationId If non-NULL, request will use the outbound + * proxy and some SIP headers from the registration identified by + * aRegistrationId. Ownership is not transferred. + * @param aRefresh If non-NULL, the request will be refreshed. Otherwise + * NULL. Ownership is not transferred. + * @return New transaction. Ownership is transferred. + */ + + CSIPClientTransaction* + SendRequestL(CSIPRequestElements* aElements, + TUint32* aRegistrationId, + CSIPRefresh* aRefresh); + + + /** + * Searches for a refresh and transaction, using aRequestId and + * aRefreshId as keys. + * @param aRequestId RequestId associated with the refreshed transaction + * @param aRefreshId RefreshId associated with the refresh instance + * @param aRefresh OUT: if refresh was found, this pointer is set to the + * refresh instance. Ownership is not transferred. + * @param aTransaction OUT: if transaction was found, this pointer is + * set to the refreshed client transaction. Ownership is not + * transferred. + * @return ETrue if found, EFalse otherwise + */ + + TBool FindRefresh(TUint32 aRequestId, + TUint32 aRefreshId, + CSIPRefresh** aRefresh, + CSIPClientTransaction** aTransaction) const; + + /** + * Searches for a registration binding, using aRequestId as a key. + * @param aRequestId RequestId of a transaction associated with the + * registration binding + * @return Found registration binding or NULL if not found. + * Ownership is not transferred. + */ + + CSIPRegistrationBinding* FindRegistration(TUint32 aRequestId) const; + + + /** + * Searches for a dialog, using aDialogId as a key. + * @param aDialogId DialogId of the dialog. + * @return Found dialog or NULL if not found. Ownership is not + * transferred. + */ + + CSIPDialog* FindDialog(TUint32 aDialogId) const; + + + /** + * A request has been received with a dialogId, but no matching dialog + * exists. + * If the request is NOTIFY, it is stored until a response with the same + * dialogId is received. Then the response is passed to dialog and after + * that all the stored NOTIFY are passed to the same dialog. + * This is needed since NOTIFY can be received before a sent SUBSCRIBE + * receives a response with dialogId. + * + * @param aTransaction Server transaction, ownership is transferred + * @param aDialogId DialogId + */ + + void IncomingRequestBeforeDialogExistsL( + CSIPServerTransaction* aTransaction, + TUint32 aDialogId); + + + /** + * Extracts the oldest stored transaction for the dialog identified by + * aDialogId. + * @param aDialogId DialogId + * @return Server transaction or NULL if no transaction is stored for + * the dialog. Ownership is transferred. + */ + + CSIPServerTransaction* GetStoredTransaction(TUint32 aDialogId); + + + /** + * Checks that CSIP is available for use (not NULL). If iSIP is NULL, + * it means user has deleted a resource needed by CSIPConnection, and + * this function leaves. + */ + + void CheckCSipL() const; + + + /** + * Connection is no longer available. All registrations, dialogs, + * transactions and refreshes using this connection are terminated, but + * not deleted. + */ + + void ConnectionLost(); + + + //The used CSIP instance. CSIPConnection doesn't own the CSIP. + //If this pointer is NULL; it means application has deleted the + //CSIP instance before deleting the CSIPConnection, and this + //CSIPConnection is now useless. + CSIP* iSIP; + + //IAP-id of this connection + TUint32 iIapId; + + //Callback to upper layer + MSIPConnectionObserver& iObserver; + + //Callback receiving events from client + CSIPClientConnectionObserver* iClientConnectionObserver; + + //Connection used by this CSIPConnection instance + CSIPClientConnection* iClientConnection; + + //CSIPConnection doesn't own CSIPRegistrationBindings + RPointerArray iRegistrations; + + //CSIPConnection doesn't delete the CSIPDialog objects. CSIPDialog + //deletes itself when its last dialog association is deleted. + //NOTE: When CSIPDialog has just been created and has no dialog + //associations yet, it must be stored in CleanupStack, otherwise it + //won't be freed if leave occurs! + RPointerArray iDialogs; + + //CSIPConnection has to know which transactions are attached to it, but + //it doesn't own the transactions. Transaction's ownership is passed + //to application. + RPointerArray iTransactions; + + //Standalone refreshes, application owns these + RPointerArray iRefreshes; + + //To avoid using callbacks to MSIPConnectionObserver from within + //CSIPRegistrationBinding and CSIPDialog, CConnectionCallback is passed to + //the methods which would need to use MSIPConnectionObserver calls. + //CSIPRegistrationBinding and CSIPDialog will fill CConnectionCallback with + //the selected callback method and its parameters, and by returning + //ETrue they tell to CSIPConnection that a callback has to be done. + CConnectionCallback* iCallbackInfo; + + + // Not in real SIP API + TState iState; + }; + +#endif + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/sipclientstub/inc/sipmessageelements.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/sipclientstub/inc/sipmessageelements.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,173 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef CSIPMESSAGEELEMENTS_H +#define CSIPMESSAGEELEMENTS_H + +// INCLUDES +#include +#include +#include +#include "_sipcodecdefs.h" + +#ifdef SWIS_UNIT_TEST +#undef IMPORT_C +#define IMPORT_C +#endif + +// FORWARD DECLARATIONS +class CSIPHeaderBase; +class CSIPContentTypeHeader; +class CSIPFromHeader; +class CSIPToHeader; +class CSIPCSeqHeader; +class CSIPExtensionHeader; + +// CLASS DECLARATION + +/** +* @publishedAll +* +* Class for creation and manipulation optional elements in a SIP message. +* +* Class provides functions for setting and getting optional elements in a +* SIP message. Optional elements include user SIP message headers, +* content and content type. +* Following headers are not considered to be user SIP message headers and +* cannot be set or retrieved using functions of this class: +* "Authentication-Info", "Call-Id", "CSeq", "From" +* "Max-Forwards", "Min-Expires", "Record-Route", +* "Security-Verify", "Service-Route", "To", "Via", "Security-Server", +* "Proxy-Authorization", "Proxy-Authenticate" and "WWW-Authenticate". +* +* @lib sipclient.lib +*/ +class CSIPMessageElements : public CBase + { + public: // Constructors and destructor + /** + * Two-phased constructor. + */ + IMPORT_C static CSIPMessageElements* NewL(); + + /** + * Two-phased constructor. + */ + IMPORT_C static CSIPMessageElements* NewLC(); + + /** + * Destructor. + */ + IMPORT_C ~CSIPMessageElements(); + + public: //new functions + /** + * Sets an array of user headers i.e. headers that user is allowed + * manipulate to a SIP message. An empty array resets the user headers. + * Note that the Content-Type header must be set using SetContentL. + * + * @param aHeaders an array of SIP headers. + * The ownership of objects in the array is transferred. + */ + IMPORT_C void SetUserHeadersL(RPointerArray& aHeaders); + + /** + * Gets all user SIP headers this class contains + * @return SIP headers. Ownership is not transferred. + */ + IMPORT_C const RPointerArray& UserHeaders() const; + + /** + * Sets the SIP message content and its type. + * A zero length content can be set by providing a pointer + * to a zero length HBufC8 instance (the ownership is transferred). + * @pre aContent != 0 && aContentType != 0 + * @param aContent the content of a SIP message, + * the ownership is transferred + * @param aContentType the SIP message content type, + * the ownership is transferred + * @leave KErrArgument if aContent == 0 or + * aContentType == 0 + */ + IMPORT_C void SetContentL(HBufC8* aContent, + CSIPContentTypeHeader* aContentType); + + /** + * Gets the SIP message content + * @return SIP message content. If content does not exist, an empty + * descriptor is returned. + */ + IMPORT_C const TDesC8& Content() const; + + /** + * Gets the content type + * @return Content-Type-header or a 0-pointer if not present; the ownership + * is not transferred. + */ + IMPORT_C const CSIPContentTypeHeader* ContentType() const; + + /* + * Removes the SIP message content and destroys + * Content-Type header as well. + * @return SIP message content; the ownership is transferred. + */ + IMPORT_C HBufC8* ExtractContent(); + + public: // New functions, for internal use + + static CSIPMessageElements* InternalizeL(RReadStream& aReadStream); + void ExternalizeL(RWriteStream& aWriteStream) const; + TInt UserHeaderCount(RStringF aName) const; + const RPointerArray UserHeadersL(RStringF aName) const; + TInt RemoveHeaders(RStringF aName); + void DetachUserHeader(CSIPHeaderBase* aHeader); + void AddHeaderL(CSIPHeaderBase* aHeader); + void SetToL(CSIPToHeader* aTo); + const CSIPToHeader* To() const; + void SetFromL (CSIPFromHeader* aFrom); + const CSIPFromHeader* From() const; + const CSIPCSeqHeader* CSeq() const; + void SetContent(HBufC8* aContent); + void DetachContent(); + + private: + + CSIPMessageElements(); + void ConstructL(); + void DoInternalizeL(RReadStream& aReadStream); + void CheckUserHeaderL(const CSIPHeaderBase* aHeader) const; + void ExternalizeUserHeadersL(RWriteStream& aWriteStream) const; + void ExternalizeL(const CSIPExtensionHeader* aHeader, + RWriteStream& aWriteStream) const; + + private: // Data + + RPointerArray iUserHeaders; + HBufC8* iContent; + CSIPFromHeader* iFromHeader; + CSIPToHeader* iToHeader; + CSIPCSeqHeader* iCSeqHeader; + CSIPContentTypeHeader* iContentTypeHeader; + TBool iHeaderLookupOpen; + + private: // For testing purposes + + UNIT_TEST(CSIPMessageElementsTest) + }; + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/sipclientstub/inc/siprequestelements.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/sipclientstub/inc/siprequestelements.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,173 @@ +/* +* 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: +* +*/ + + +#ifndef CSIPREQUESTELEMENTS_H +#define CSIPREQUESTELEMENTS_H + +// INCLUDES +#include +#include +#include +#include +#include "_sipcodecdefs.h" + +// FORWARD DECLARATIONS +class CSIPMessageElements; +class CSIPFromHeader; +class CSIPToHeader; +class CSIPCSeqHeader; + +// CLASS DECLARATION + +/** +* @publishedAll +* @released +* +* Class provides functions for creation and manipulation of originator's and +* recipient's addresses in a SIP request. It also provide functions for +* manipulation of SIP method for unknown SIP requests. +* @lib sipclient.lib +*/ +class CSIPRequestElements : public CBase + { + public: // Constructors and destructor + /** + * Two-phased constructor. + * If the URI is SIP URI, no SIP URI headers are allowed. + * @pre aRemoteURi != 0 + * @param aRemoteUri Remote target URI that identifies a resource that + * the request is addressed to. The ownership is transferred. + */ + IMPORT_C static CSIPRequestElements* NewL(CUri8* aRemoteUri); + + /** + * Two-phased constructor. + * If the URI is SIP URI, no SIP URI headers are allowed. + * @pre aRemoteURi != 0 + * @param aRemoteUri Remote target URI that identifies a resource that + * the request is addressed to. The ownership is transferred. + */ + IMPORT_C static CSIPRequestElements* NewLC(CUri8* aRemoteUri); + + /** + * Destructor. + */ + IMPORT_C ~CSIPRequestElements(); + + public: // New functions + /** + * Sets/resets the recipient's To-header + * To-header must not contain tag-parameter. + * @pre aTo != 0 + * @param aTo a To-header to be set, the ownership is transferred. + */ + IMPORT_C void SetToHeaderL(CSIPToHeader* aTo); + + /** + * Gets the recipient's To-header + * @return To-header or a 0-pointer if not present. Ownership is not + * transferred. + */ + IMPORT_C const CSIPToHeader* ToHeader() const; + + /** + * Sets/resets the originator's From-header. + * From-header must not contain tag-parameter. + * @pre aFrom != 0 + * @param aFrom a From-header to be set, the ownership is transferred. + * @leave KErrArgument if aFrom == 0 + */ + IMPORT_C void SetFromHeaderL(CSIPFromHeader* aFrom); + + /** + * Gets the originator's From-header + * @return From-header or a 0-pointer if not present. Ownership is not + * transferred. + */ + IMPORT_C const CSIPFromHeader* FromHeader() const; + + /** + * Gets CSeq-header. Available for only incoming requests. + * @return a CSeq-header or a 0-pointer if not present. + * Ownership is not transferred. + */ + IMPORT_C const CSIPCSeqHeader* CSeqHeader() const; + + /** + * Sets the remote URI. + * If the URI is a SIP URI, no SIP URI headers are allowed. + * @pre aRemoteUri != 0 + * @param aRemoteUri + * @leave KErrArgument if aRemoteUri==0 + */ + IMPORT_C void SetRemoteUriL(CUri8* aRemoteUri); + + /** + * Gets the remote target URI + * @return remote target URI + */ + IMPORT_C const CUri8& RemoteUri() const; + + /** + * Sets the SIP request method + * @param aMethod a SIP method name. + * @leave KErrArgument if method name given is syntactically + * incorrect + */ + IMPORT_C void SetMethodL(RStringF aMethod); + + /** + * Gets the SIP Method for a request + * @return a SIP method name or a an empty string if the method + * is not defined + */ + IMPORT_C RStringF Method() const; + + /** + * Gets message elements (contains all SIP user headers and content) + * @return message elements + */ + IMPORT_C const CSIPMessageElements& MessageElements() const; + + /** + * Gets message elements (contains all SIP user headers and content) + * The response elements can be populated with SIP user headers + * and content using returned reference to the message elements. + * @return message elements + */ + IMPORT_C CSIPMessageElements& MessageElements(); + + public: // New functions, for internal use + static CSIPRequestElements* InternalizeL (RReadStream& aReadStream); + void ExternalizeL (RWriteStream& aWriteStream) const; + + private: + CSIPRequestElements(); + void ConstructL(CUri8* aRemoteUri); + void DoInternalizeL(RReadStream& aReadStream); + + private: // Data + RStringF iMethod; + CUri8* iRemoteURI; + CSIPMessageElements* iMessageElements; + + private: // For testing purposes + UNIT_TEST(CSIPRequestElementsTest) + }; + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/sipclientstub/inc/sipresponseelements.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/sipclientstub/inc/sipresponseelements.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,153 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef CSIPRESPONSEELEMENTS_H +#define CSIPRESPONSEELEMENTS_H + +// INCLUDES + +#include +#include +#include +#include "_sipcodecdefs.h" + +// FORWARD DECLARATIONS +class CSIPMessageElements; +class CSIPFromHeader; +class CSIPToHeader; +class CSIPCSeqHeader; + +// CLASS DECLARATION + +/** +* @publishedAll +* +* Class provides services for creating and manipulating SIP responses +* This class is used for creating and manipulating SIP responses including +* status code, reason phrase and optional elements such user headers, +* content and its type. +* +* @lib sipclient.lib +*/ +class CSIPResponseElements : public CBase + { + public: // Constructors and destructor + /** + * Two-phased constructor. + * @pre aStatusCode > 100 && aStatusCode < 700 + * @param aStatusCode a known SIP response status code. Cannot be 100. + * @param aReasonPhrase a SIP response reason phrase. + */ + IMPORT_C static CSIPResponseElements* NewL(TUint aStatusCode, + RStringF aReasonPhrase); + + /** + * Two-phased constructor. + * @pre aStatusCode > 100 && aStatusCode < 700 + * @param aStatusCode a known SIP response status code. Cannot be 100. + * @param aReasonPhrase a SIP response reason phrase. + */ + IMPORT_C static CSIPResponseElements* NewLC(TUint aStatusCode, + RStringF aReasonPhrase); + + /** + * Destructor. + */ + IMPORT_C ~CSIPResponseElements(); + + public: // New functions + /** + * Sets a SIP Response extension status code. It is not possible to set + * value 100. + * @pre aStatusCode > 100 && aStatusCode < 700 + * @param aStatusCode extension status code + * @leave KErrArgument if aStatusCode < 100 or aStatusCode >= 700 + */ + IMPORT_C void SetStatusCodeL(TUint aStatusCode); + + /** + * Gets the SIP Response status code + * @return SIP Response status code + */ + IMPORT_C TUint StatusCode() const; + + /** + * Sets a SIP Response Reason Phrase. + * @param aReasonPhrase a SIP response reason phrase. + */ + IMPORT_C void SetReasonPhraseL(RStringF aReasonPhrase); + + /** + * Gets a SIP Response Reason Phrase. + * @return a SIP response reason phrase or an empty string if + * the reason phrase is not defined. + */ + IMPORT_C RStringF ReasonPhrase() const; + + /** + * Gets the originator's From-header + * @return a From-header or a 0-pointer if not present. Ownership is + * not transferred. + */ + IMPORT_C const CSIPFromHeader* FromHeader() const; + + /** + * Gets the recipient's To-header + * @return a To-header or a 0-pointer if not present. Ownership is + * not transferred. + */ + IMPORT_C const CSIPToHeader* ToHeader() const; + + /** + * Gets CSeq-header + * @return a CSeq-header or a 0-pointer if not present. Ownership is + * not transferred. + */ + IMPORT_C const CSIPCSeqHeader* CSeqHeader() const; + + /** + * Gets message elements (contains all SIP user headers and content) + * @return message elements + */ + IMPORT_C const CSIPMessageElements& MessageElements() const; + + /** + * Gets message elements (contains all SIP user headers and content) + * The response elements can be populated with SIP user headers + * and content using returned reference to the message elements. + * @return message elements + */ + IMPORT_C CSIPMessageElements& MessageElements(); + + public: // New functions, for internal use + static CSIPResponseElements* InternalizeL (RReadStream& aReadStream); + static CSIPResponseElements* InternalizeLC (RReadStream& aReadStream); + void ExternalizeL (RWriteStream& aWriteStream) const; + + private: + CSIPResponseElements(); + void ConstructL(TUint aStatusCode, RStringF aReasonPhrase); + void DoInternalizeL (RReadStream& aReadStream); + + private: // Data + TUint iStatusCode; + RStringF iReasonPhrase; + CSIPMessageElements* iMessageElements; + }; + +#endif // end of CSIPRESPONSEELEMENTS_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/sipclientstub/inc/sipservertransaction.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/sipclientstub/inc/sipservertransaction.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,182 @@ +/* +* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 CSIPSERVERTRANSACTION_H +#define CSIPSERVERTRANSACTION_H + +// INCLUDES +#include "siptransactionbase.h" + +// FORWARD DECLARATIONS +class CSIPRequestElements; +class CSIPRefresh; +class MSIPResponseSender; +class CSIPConnection; + +/** +* Class for managing SIP server transactions. +* It provides services for creating, ending +* and getting SIP transaction parameters. +* Client cannot instantiate this class. +* +* @lib sipclient +*/ +class CSIPServerTransaction: public CSIPTransactionBase + { + public: + + /** + * Destructor + */ + + IMPORT_C ~CSIPServerTransaction(); + + public: // Not in real SIP API + + IMPORT_C static CSIPServerTransaction* NewL( RStringF aType ); + + IMPORT_C void SetRequestElements(CSIPRequestElements* aElements); + + + public: + + /** + * Sends response and ends the transaction; + * The user must not send 100 Trying response. Leaves on failure. + * @pre aElements!=0 + * @pre State()==ETrying || State()==EProceeding + * @pre CSIPConnection::State()==EActive + * @pre ResponseAllowed()==ETrue + * @param aElements contains Status Code, optional Reason Phrase and + * optional SIP message headers and body. Ownership is transferred. + * @leave KErrArgument if aElements == NULL + * @leave KErrGeneral if ResponseAllowed() == EFalse + */ + + IMPORT_C void SendResponseL(CSIPResponseElements *aElements); + + + /** + * Gets the request elements + * @return Request elements. Ownership is not transferred. + */ + + IMPORT_C const CSIPRequestElements* RequestElements() const; + + + /** + * Checks if the response sending is allowed for this server + * transaction. For instance response is not allowed in ACK transaction. + * @return ETrue if response sending is allowed, EFalse otherwise + */ + + IMPORT_C TBool ResponseAllowed() const; + + /** + * Sets a new respose sender, replacing the current sender. + * + * @param aSender Response sender to be used from now on. Ownership is + * transferred. + */ + + void SetResponseSender(MSIPResponseSender* aSender); + + + /** + * Obtains the associated CSIPConnection instance. If connection can't + * be accessed anymore, this function leaves. + * + * @return CSIPConnection + */ + + CSIPConnection& SIPConnectionL(); + + + /** + * Update the MTransactionAssociation to point to aAssociation. + * + * @param aAssociation Associated object + */ + + void ReAssociateL(MTransactionAssociation& aAssociation); + + + /** + * Removes, but does not delete, request elements from + * aServerTransaction. + * + * @param aServerTransaction Server transaction from which response + * elements are removed. Ownership is not transferred. + */ + + static void DetachRequestElements(TAny* aServerTransaction); + + public: + + /** + * Creates a server transaction. + * + * @param aRequestId RequestId for the transaction to use + * @param aAssociation Object with which the transaction is associated + * @param aElements Request elements. Ownership is transferred. + * @return New object. Ownership is transferred. + */ + + static CSIPServerTransaction* + NewL(TUint32 aRequestId, + MTransactionAssociation& aAssociation, + CSIPRequestElements* aElements); + + + /** + * Creates a server transaction and pushes it to cleanup stack. + * + * @param aRequestId RequestId for the transaction to use + * @param aAssociation Object with which the transaction is associated + * @param aElements Request elements. Ownership is transferred. + * @return New object. Ownership is transferred. + */ + + static CSIPServerTransaction* + NewLC(TUint32 aRequestId, + MTransactionAssociation& aAssociation, + CSIPRequestElements* aElements); + + + + private: + CSIPServerTransaction( RStringF aType ); + + + /** + * Second phase constructor. + * + * @param aElements Request elements. Ownership is transferred. + */ + void ConstructL(CSIPRequestElements* aElements); + + + CSIPRequestElements* iRequestElements; + + //This interface is used for sending the response. + //CSIPServerTransaction owns iResponseSender. + MSIPResponseSender* iResponseSender; + + }; + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/sipclientstub/inc/siptransactionbase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/sipclientstub/inc/siptransactionbase.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,228 @@ +/* +* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 CSIPTRANSACTIONBASE_H +#define CSIPTRANSACTIONBASE_H + +// INCLUDES + +#include +#include + +// FORWARD DECLARATIONS +class CSIPResponseElements; +class MTransactionAssociation; + +/** +* Base class for managing SIP transactions. +* It provides services for quering transaction +* type and its state. +* +* This class is an abstract class and cannot be +* instantiated. +* @lib sipclient +*/ +class CSIPTransactionBase: public CBase + { + public: + /** SIP transaction state */ + enum TState + { + /** Trying state */ + ETrying, + /** Calling state */ + ECalling, + /** Proceeding state */ + EProceeding, + /** Completed state */ + ECompleted, + /** Confirmed state */ + EConfirmed, + /** Terminated state */ + ETerminated + }; + + public: + + /** + * Destructor + */ + + virtual ~CSIPTransactionBase(); + + + public: + /** + * Gets the SIP transaction type + * @return SIP transaction type + */ + + IMPORT_C RStringF Type() const; + + + /** + * Gets SIP transaction state + * @return SIP transaction state + */ + + IMPORT_C CSIPTransactionBase::TState StateL(); + + + /** + * Checks the if the actual object + * is of type CSIPClientTransaction. + * @return ETrue if object is of type CSIPClientTransaction and + * EFalse otherwise + */ + + IMPORT_C TBool IsSIPClientTransaction() const; + + + /** + * Compares this object to another object also having + * CSIPTransactionBase base class + * The function has to be implemented in each of the sub-classes. + * @param aTransaction a CSIPTransactionBase object to compare + * @return ETrue if the objects are equal otherwise EFalse + */ + + IMPORT_C TBool + operator==(const CSIPTransactionBase& aTransaction) const; + + /** + * Obtains the RequestId of the transaction. + * + * @return RequestId + */ + + TUint32 RequestId() const; + + + /** + * Clears the MTransactionAssociation. After this the object can't be + * used anymore and it is expected that user will delete it soon. + * + * @param aAssociation Object requesting the detach + */ + + virtual void Detach(const MTransactionAssociation& aAssociation); + + + /** + * Changes the transaction state. + * + * @param aNextState State into which transaction moves + */ + + void ChangeState(CSIPTransactionBase::TState aNextState); + + + /** + * Determines whether this transaction has an effect on the associated + * dialog's state. + * + * @return ETrue if transaction has an effect on the dialog's state, + * EFalse otherwise. + */ + + TBool AffectsDialogState() const; + + + /** + * Sets this transaction to affect the dialog state. + */ + + void SetAffectsDialogState(); + + + /** + * Determines whether the transaction type is a target refresh request. + * + * @param aType Type of transaction + * @return ETrue If the transaction is a target refresh request, EFalse + * otherwise. + */ + + static TBool IsTargetRefresh(RStringF aType); + + + /** + * Stores response elements. Depending on the status code, transaction + * may enter another state. + * + * @param aElements Response elements, ownership is transferred. + */ + + void SetResponseElements(CSIPResponseElements* aElements); + + + protected: + CSIPTransactionBase( RStringF aType, TBool aIsCliTrx ); + + void ConstructL(); + + + /** + * Checks that iAssociation is available (not NULL). If iAssociation is + * NULL, it means user has deleted a resource needed by + * CSIPTransactionBase, and this function leaves. + */ + + void CheckAssociationL() const; + + + /** + * Gets response elements. + * + * @return Response elements. Ownership isn't transferred. + */ + + const CSIPResponseElements* ResponseElements() const; + + + //RequestId received from SIP client + TUint32 iRequestId; + + //Every transaction is associated to exactly one other object: + //CSIP, CSIPConnection, CSIPRegistrationBinding or CSIPDialogAssocBase + MTransactionAssociation* iAssociation; + + public: + + RStringF iType; + + //ETrue is the transaction is a client transaction, EFalse otherwise + TBool iIsClientTransaction; + + + //ETrue if the transaction has an effect on the dialog state in case + //the transaction is associated with a dialog. + //EFalse otherwise. + TBool iAffectsDialogState; + + //SIP response elements + CSIPResponseElements* iResponseElements; + + public: + //Current transaction state + TState iState; + + + }; + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/sipclientstub/src/CSIPMessageElements.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/sipclientstub/src/CSIPMessageElements.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,418 @@ +/* +* 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: +* +*/ + + +#include "SipMessageElements.h" +#include "SipHeaderBase.h" +#include "SipFromHeader.h" +#include "SipContactHeader.h" +#include "SipToHeader.h" +#include "SipCSeqHeader.h" +#include "SipContentTypeHeader.h" +#include "SipExtensionHeader.h" +#include "sipstrings.h" +#include "SipStrConsts.h" + + + +// ----------------------------------------------------------------------------- +// CSIPMessageElements::NewL +// ----------------------------------------------------------------------------- +// +EXPORT_C CSIPMessageElements* CSIPMessageElements::NewL() + { + CSIPMessageElements* self = CSIPMessageElements::NewLC(); + CleanupStack::Pop (self); + return self; + } + +// ----------------------------------------------------------------------------- +// CSIPMessageElements::NewLC +// ----------------------------------------------------------------------------- +// +EXPORT_C CSIPMessageElements* CSIPMessageElements::NewLC () + { + CSIPMessageElements* self = new(ELeave)CSIPMessageElements; + CleanupStack::PushL (self); + self->ConstructL (); + return self; + } + +// ----------------------------------------------------------------------------- +// CSIPMessageElements::CSIPMessageElements +// ----------------------------------------------------------------------------- +// +CSIPMessageElements::CSIPMessageElements () + : iHeaderLookupOpen(EFalse) + { + } + +// ----------------------------------------------------------------------------- +// CSIPMessageElements::ConstructL +// ----------------------------------------------------------------------------- +// +void CSIPMessageElements::ConstructL() + { +// SIPHeaderLookup::OpenL(); + iHeaderLookupOpen = ETrue; + iCSeqHeader = CSIPCSeqHeader::DecodeL( _L8("1 INVITE") ); + + } + +// ----------------------------------------------------------------------------- +// CSIPMessageElements::~CSIPMessageElements +// ----------------------------------------------------------------------------- +// +EXPORT_C CSIPMessageElements::~CSIPMessageElements () + { + /*if (iHeaderLookupOpen) + { + SIPHeaderLookup::Close(); + }*/ + delete iContent; + iUserHeaders.ResetAndDestroy(); + delete iFromHeader; + delete iToHeader; + delete iCSeqHeader; + delete iContentTypeHeader; + } + +// ----------------------------------------------------------------------------- +// CSIPMessageElements::SetUserHeadersL +// ----------------------------------------------------------------------------- +// +EXPORT_C void +CSIPMessageElements::SetUserHeadersL (RPointerArray& aHeaders) + { + RPointerArray tmpHeaders; + CleanupClosePushL(tmpHeaders); + for (TInt i=0; i& +CSIPMessageElements::UserHeaders() const + { + return iUserHeaders; + } + +// ----------------------------------------------------------------------------- +// CSIPMessageElements::SetContentL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CSIPMessageElements::SetContentL (HBufC8* aContent, + CSIPContentTypeHeader* aType) + { + __ASSERT_ALWAYS (aContent != 0, User::Leave(KErrArgument)); + __ASSERT_ALWAYS (aContent->Length() > 0, User::Leave(KErrArgument)); + __ASSERT_ALWAYS (aType != 0, User::Leave(KErrArgument)); + + delete iContentTypeHeader; + iContentTypeHeader = aType; + delete iContent; + iContent = aContent; + } + +// ----------------------------------------------------------------------------- +// CSIPMessageElements::Content +// ----------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CSIPMessageElements::Content () const + { + if (iContent) + { + return *iContent; + } + return KNullDesC8; + } + +// ----------------------------------------------------------------------------- +// CSIPMessageElements::Content +// ----------------------------------------------------------------------------- +// +EXPORT_C const CSIPContentTypeHeader* CSIPMessageElements::ContentType() const + { + return iContentTypeHeader; + } + +// ----------------------------------------------------------------------------- +// CSIPMessageElements::ExtractContent +// ----------------------------------------------------------------------------- +// +EXPORT_C HBufC8* CSIPMessageElements::ExtractContent () + { + HBufC8* tmp = iContent; + iContent = 0; + delete iContentTypeHeader; + iContentTypeHeader = 0; + return tmp; + } + +// ----------------------------------------------------------------------------- +// CSIPMessageElements::InternalizeL +// ----------------------------------------------------------------------------- +// +CSIPMessageElements* +CSIPMessageElements::InternalizeL (RReadStream& aReadStream) + { + CSIPMessageElements* self = CSIPMessageElements::NewLC(); + self->DoInternalizeL(aReadStream); + CleanupStack::Pop(); // self + return self; + } + +// ----------------------------------------------------------------------------- +// CSIPMessageElements::DoInternalizeL +// ----------------------------------------------------------------------------- +// +void CSIPMessageElements::DoInternalizeL (RReadStream& /*aReadStream*/) + { + + } + +// ----------------------------------------------------------------------------- +// CSIPMessageElements::ExternalizeL +// ----------------------------------------------------------------------------- +// +void +CSIPMessageElements::ExternalizeL (RWriteStream& /*aWriteStream*/) const + { + + } + +// ----------------------------------------------------------------------------- +// CSIPMessageElements::UserHeaderCount +// ----------------------------------------------------------------------------- +// +TInt CSIPMessageElements::UserHeaderCount (RStringF aName) const + { + TInt headerCount = 0; + for (TInt i=0; i < iUserHeaders.Count(); i++) + { + if (iUserHeaders[i]->Name() == aName) + { + headerCount++; + } + } + return headerCount; + } + +// ----------------------------------------------------------------------------- +// CSIPMessageElements::UserHeadersL +// ----------------------------------------------------------------------------- +// +const RPointerArray +CSIPMessageElements::UserHeadersL (RStringF aName) const + { + RPointerArray headers; + CleanupClosePushL(headers); + for (TInt i=0; i < iUserHeaders.Count(); i++) + { + if (iUserHeaders[i]->Name() == aName) + { + User::LeaveIfError(headers.Append(iUserHeaders[i])); + } + } + CleanupStack::Pop(1); // headers + return headers; + } + +// ----------------------------------------------------------------------------- +// CSIPMessageElements::RemoveHeaders +// ----------------------------------------------------------------------------- +// +TInt CSIPMessageElements::RemoveHeaders (RStringF aName) + { + TInt err = KErrNotFound; + for (TInt i=iUserHeaders.Count()-1; i>=0; i--) + { + if (iUserHeaders[i]->Name() == aName) + { + CSIPHeaderBase* header = iUserHeaders[i]; + iUserHeaders.Remove(i); + delete header; + err = KErrNone; + } + } + return err; + } + +// ----------------------------------------------------------------------------- +// CSIPMessageElements::DetachUserHeader +// ----------------------------------------------------------------------------- +// +void CSIPMessageElements::DetachUserHeader (CSIPHeaderBase* aHeader) + { + for (TInt i=0; i < iUserHeaders.Count(); i++) + { + if (iUserHeaders[i] == aHeader) + { + iUserHeaders.Remove(i); + } + } + } + +// ----------------------------------------------------------------------------- +// CSIPMessageElements::AddHeaderL +// ----------------------------------------------------------------------------- +// +void CSIPMessageElements::AddHeaderL (CSIPHeaderBase* aHeader) + { + __ASSERT_ALWAYS (aHeader != 0, User::Leave(KErrArgument)); + + if (aHeader->Name() == SIPStrings::StringF(SipStrConsts::EFromHeader)) + { + delete iFromHeader; + iFromHeader = static_cast(aHeader); + } + else if (aHeader->Name() == SIPStrings::StringF(SipStrConsts::EToHeader)) + { + delete iToHeader; + iToHeader = static_cast(aHeader); + } + else if (aHeader->Name() == SIPStrings::StringF(SipStrConsts::ECSeqHeader)) + { + delete iCSeqHeader; + iCSeqHeader = static_cast(aHeader); + } + else if (aHeader->Name() == + SIPStrings::StringF(SipStrConsts::EContentTypeHeader)) + { + delete iContentTypeHeader; + iContentTypeHeader = static_cast(aHeader); + } + else + { + User::LeaveIfError(iUserHeaders.Append(aHeader)); + } + } + +// ----------------------------------------------------------------------------- +// CSIPMessageElements::SetToL +// ----------------------------------------------------------------------------- +// +void CSIPMessageElements::SetToL (CSIPToHeader* aTo) + { + __ASSERT_ALWAYS (aTo != 0, User::Leave(KErrArgument)); + __ASSERT_ALWAYS (!aTo->HasParam(SIPStrings::StringF(SipStrConsts::ETag)), + User::Leave(KErrArgument)); + + delete iToHeader; + iToHeader = aTo; + } + +// ----------------------------------------------------------------------------- +// CSIPMessageElements::To +// ----------------------------------------------------------------------------- +// +const CSIPToHeader* CSIPMessageElements::To() const + { + return iToHeader; + } + +// ----------------------------------------------------------------------------- +// CSIPMessageElements::SetFromL +// ----------------------------------------------------------------------------- +// +void CSIPMessageElements::SetFromL (CSIPFromHeader* aFrom) + { + __ASSERT_ALWAYS (aFrom != 0, User::Leave(KErrArgument)); + __ASSERT_ALWAYS (!aFrom->HasParam(SIPStrings::StringF(SipStrConsts::ETag)), + User::Leave(KErrArgument)); + + delete iFromHeader; + iFromHeader = aFrom; + } + +// ----------------------------------------------------------------------------- +// CSIPMessageElements::From +// ----------------------------------------------------------------------------- +// +const CSIPFromHeader* CSIPMessageElements::From() const + { + return iFromHeader; + } + +// ----------------------------------------------------------------------------- +// CSIPMessageElements::CSeq +// ----------------------------------------------------------------------------- +// +const CSIPCSeqHeader* CSIPMessageElements::CSeq() const + { + return iCSeqHeader; + } + +// ----------------------------------------------------------------------------- +// CSIPMessageElements::SetContent +// ----------------------------------------------------------------------------- +// +void CSIPMessageElements::SetContent (HBufC8* aContent) + { + delete iContent; + iContent = aContent; + } + +// ----------------------------------------------------------------------------- +// CSIPMessageElements::DetachContent +// ----------------------------------------------------------------------------- +// +void CSIPMessageElements::DetachContent () + { + iContent = 0; + } + +// ----------------------------------------------------------------------------- +// CSIPMessageElements::CheckUserHeaderL +// ----------------------------------------------------------------------------- +// +void CSIPMessageElements::CheckUserHeaderL (const CSIPHeaderBase* /*aHeader*/) const + { + + } + +// ----------------------------------------------------------------------------- +// CSIPMessageElements::ExternalizeUserHeadersL +// ----------------------------------------------------------------------------- +// +void +CSIPMessageElements::ExternalizeUserHeadersL (RWriteStream& /*aWriteStream*/) const + { + + } + +// ----------------------------------------------------------------------------- +// CSIPMessageElements::ExternalizeL +// ----------------------------------------------------------------------------- +// +void CSIPMessageElements::ExternalizeL (const CSIPExtensionHeader* /*aHeader*/, + RWriteStream& /*aWriteStream*/) const + { + + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/sipclientstub/src/CSIPRequestElements.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/sipclientstub/src/CSIPRequestElements.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,237 @@ +/* +* 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: +* +*/ + + +#include "siprequestelements.h" +#include "sipmessageelements.h" +#include "sipfromheader.h" +#include "siptoheader.h" +#include "sipstrings.h" +#include "sipstrconsts.h" +#include "_sipcodecdefs.h" + + +// ----------------------------------------------------------------------------- +// CSIPRequestElements::NewL +// ----------------------------------------------------------------------------- +// +EXPORT_C CSIPRequestElements* CSIPRequestElements::NewL(CUri8* aRemoteUri) + { + CSIPRequestElements* self = CSIPRequestElements::NewLC(aRemoteUri); + CleanupStack::Pop (self); + return self; + } + +// ----------------------------------------------------------------------------- +// CSIPRequestElements::NewLC +// ----------------------------------------------------------------------------- +// +EXPORT_C CSIPRequestElements* CSIPRequestElements::NewLC(CUri8* aRemoteUri) + { + CSIPRequestElements* self = new(ELeave)CSIPRequestElements; + CleanupStack::PushL (self); + self->ConstructL (aRemoteUri); + return self; + } + +// ----------------------------------------------------------------------------- +// CSIPRequestElements::CSIPRequestElements +// ----------------------------------------------------------------------------- +// +CSIPRequestElements::CSIPRequestElements() + { + } + +// ----------------------------------------------------------------------------- +// CSIPRequestElements::ConstructL +// ----------------------------------------------------------------------------- +// +void CSIPRequestElements::ConstructL(CUri8* aRemoteUri) + { + __ASSERT_ALWAYS (aRemoteUri != 0, User::Leave(KErrArgument)); + + iMessageElements = CSIPMessageElements::NewL(); + SetRemoteUriL(aRemoteUri); + } + +// ----------------------------------------------------------------------------- +// CSIPRequestElements::~CSIPRequestElements +// ----------------------------------------------------------------------------- +// +EXPORT_C CSIPRequestElements::~CSIPRequestElements() + { + delete iRemoteURI; + iMethod.Close(); + delete iMessageElements; + } + +// ----------------------------------------------------------------------------- +// CSIPRequestElements::SetToHeaderL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CSIPRequestElements::SetToHeaderL(CSIPToHeader* aTo) + { + iMessageElements->SetToL(aTo); + } + +// ----------------------------------------------------------------------------- +// CSIPRequestElements::ToHeader +// ----------------------------------------------------------------------------- +// +EXPORT_C const CSIPToHeader* CSIPRequestElements::ToHeader() const + { + return iMessageElements->To(); + } + +// ----------------------------------------------------------------------------- +// CSIPRequestElements::SetFromHeaderL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CSIPRequestElements::SetFromHeaderL(CSIPFromHeader* aFrom) + { + iMessageElements->SetFromL(aFrom); + } + +// ----------------------------------------------------------------------------- +// CSIPRequestElements::FromHeader +// ----------------------------------------------------------------------------- +// +EXPORT_C const CSIPFromHeader* CSIPRequestElements::FromHeader() const + { + return iMessageElements->From(); + } + +// ----------------------------------------------------------------------------- +// CSIPRequestElements::CSeqHeader +// ----------------------------------------------------------------------------- +// +EXPORT_C const CSIPCSeqHeader* CSIPRequestElements::CSeqHeader() const + { + return iMessageElements->CSeq(); + } + +// ----------------------------------------------------------------------------- +// CSIPRequestElements::SetRemoteURIL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CSIPRequestElements::SetRemoteUriL(CUri8* aRemoteUri) + { + __ASSERT_ALWAYS (aRemoteUri != 0, User::Leave(KErrArgument)); + + delete iRemoteURI; + iRemoteURI = aRemoteUri; + } + +// ----------------------------------------------------------------------------- +// CSIPRequestElements::RemoteURI +// ----------------------------------------------------------------------------- +// +EXPORT_C const CUri8& CSIPRequestElements::RemoteUri() const + { + return *(iRemoteURI); + } + +// ----------------------------------------------------------------------------- +// CSIPRequestElements::SetMethodL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CSIPRequestElements::SetMethodL(RStringF aMethod) + { + __ASSERT_ALWAYS (aMethod.DesC().Length() > 0, User::Leave(KErrArgument)); + + iMethod.Close(); + iMethod = aMethod.Copy(); + } + +// ----------------------------------------------------------------------------- +// CSIPRequestElements::Method +// ----------------------------------------------------------------------------- +// +EXPORT_C RStringF CSIPRequestElements::Method() const + { + return iMethod; + } + +// ----------------------------------------------------------------------------- +// CSIPRequestElements::MessageElements +// ----------------------------------------------------------------------------- +// +EXPORT_C const CSIPMessageElements& CSIPRequestElements::MessageElements() const + { + return *iMessageElements; + } + +// ----------------------------------------------------------------------------- +// CSIPRequestElements::MessageElements +// ----------------------------------------------------------------------------- +// +EXPORT_C CSIPMessageElements& CSIPRequestElements::MessageElements() + { + return *iMessageElements; + } + +// ----------------------------------------------------------------------------- +// CSIPRequestElements::InternalizeL +// ----------------------------------------------------------------------------- +// +CSIPRequestElements* CSIPRequestElements::InternalizeL(RReadStream& aReadStream) + { + CSIPRequestElements* self = new(ELeave)CSIPRequestElements; + CleanupStack::PushL(self); + self->DoInternalizeL(aReadStream); + CleanupStack::Pop(self); + return self; + } + +// ----------------------------------------------------------------------------- +// CSIPRequestElements::DoInternalizeL +// ----------------------------------------------------------------------------- +// +void CSIPRequestElements::DoInternalizeL(RReadStream& aReadStream) + { + // For incoming requests the method is always present +/* TUint32 methodLength = aReadStream.ReadUint32L(); + if (methodLength > 0) + { + HBufC8* methodBuf = HBufC8::NewLC(methodLength); + TPtr8 methodPtr(methodBuf->Des()); + aReadStream.ReadL(methodPtr,methodLength); + iMethod = SIPStrings::Pool().OpenFStringL(methodPtr); + CleanupStack::PopAndDestroy(methodBuf); + } + aReadStream.ReadUint8L(); // remote-URI always present + iRemoteURI = CURIContainer::InternalizeL(aReadStream); + iMessageElements = CSIPMessageElements::InternalizeL(aReadStream); +*/ } + +// ----------------------------------------------------------------------------- +// CSIPRequestElements::ExternalizeL +// ----------------------------------------------------------------------------- +// +void CSIPRequestElements::ExternalizeL(RWriteStream& aWriteStream) const + { +/* TPtrC8 method(iMethod.DesC()); + // For outgoing requests in some cases the method is filled in ServerCore + if (method.Length() > 0) + { + aWriteStream.WriteUint32L(method.Length()); + aWriteStream.WriteL(method); + } + aWriteStream.WriteUint8L(1); // remote-URI always present + iRemoteURI->ExternalizeL(aWriteStream); + iMessageElements->ExternalizeL(aWriteStream); +*/ } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/sipclientstub/src/CSIPResponseElements.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/sipclientstub/src/CSIPResponseElements.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,217 @@ +/* +* 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: +* +*/ + +#include "SipResponseElements.h" +#include "SipMessageElements.h" +#include "sipstrings.h" +#include "SipStrConsts.h" + + +// ----------------------------------------------------------------------------- +// CSIPResponseElements::NewL +// ----------------------------------------------------------------------------- +// +EXPORT_C CSIPResponseElements* +CSIPResponseElements::NewL (TUint aStatusCode, RStringF aReasonPhrase) + { + CSIPResponseElements* self = + CSIPResponseElements::NewLC(aStatusCode,aReasonPhrase); + CleanupStack::Pop (self); + return self; + } + +// ----------------------------------------------------------------------------- +// CSIPResponseElements::NewLC +// ----------------------------------------------------------------------------- +// +EXPORT_C CSIPResponseElements* +CSIPResponseElements::NewLC (TUint aStatusCode, RStringF aReasonPhrase) + { + CSIPResponseElements* self = new(ELeave)CSIPResponseElements; + CleanupStack::PushL (self); + self->ConstructL (aStatusCode,aReasonPhrase); + return self; + } + +// ----------------------------------------------------------------------------- +// CSIPResponseElements::CSIPResponseElements +// ----------------------------------------------------------------------------- +// +CSIPResponseElements::CSIPResponseElements () + { + } + +// ----------------------------------------------------------------------------- +// CSIPResponseElements::ConstructL +// ----------------------------------------------------------------------------- +// +void CSIPResponseElements::ConstructL (TUint aStatusCode, + RStringF aReasonPhrase) + { + SetStatusCodeL (aStatusCode); + iReasonPhrase = aReasonPhrase.Copy(); + iMessageElements = CSIPMessageElements::NewL(); + } + +// ----------------------------------------------------------------------------- +// CSIPResponseElements::~CSIPResponseElements +// ----------------------------------------------------------------------------- +// +EXPORT_C CSIPResponseElements::~CSIPResponseElements () + { + delete iMessageElements; + iReasonPhrase.Close(); + } + +// ----------------------------------------------------------------------------- +// CSIPResponseElements::SetStatusCodeL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CSIPResponseElements::SetStatusCodeL (TUint aStatusCode) + { + iStatusCode = aStatusCode; + } + +// ----------------------------------------------------------------------------- +// CSIPResponseElements::StatusCode +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint CSIPResponseElements::StatusCode() const + { + return iStatusCode; + } + +// ----------------------------------------------------------------------------- +// CSIPResponseElements::SetReasonPhraseL +// ----------------------------------------------------------------------------- +// +EXPORT_C void +CSIPResponseElements::SetReasonPhraseL (RStringF aReasonPhrase) + { + iReasonPhrase.Close(); + iReasonPhrase = aReasonPhrase.Copy(); + } + +// ----------------------------------------------------------------------------- +// CSIPResponseElements::ReasonPhrase +// ----------------------------------------------------------------------------- +// +EXPORT_C RStringF CSIPResponseElements::ReasonPhrase () const + { + return iReasonPhrase; + } + +// ----------------------------------------------------------------------------- +// CSIPResponseElements::FromHeader +// ----------------------------------------------------------------------------- +// +EXPORT_C const CSIPFromHeader* CSIPResponseElements::FromHeader () const + { + return iMessageElements->From(); + } + +// ----------------------------------------------------------------------------- +// CSIPResponseElements::ToHeader +// ----------------------------------------------------------------------------- +// +EXPORT_C const CSIPToHeader* CSIPResponseElements::ToHeader () const + { + return iMessageElements->To(); + } + +// ----------------------------------------------------------------------------- +// CSIPResponseElements::CSeqHeader +// ----------------------------------------------------------------------------- +// +EXPORT_C const CSIPCSeqHeader* CSIPResponseElements::CSeqHeader() const + { + return iMessageElements->CSeq(); + } + +// ----------------------------------------------------------------------------- +// CSIPResponseElements::MessageElements +// ----------------------------------------------------------------------------- +// +EXPORT_C const CSIPMessageElements& +CSIPResponseElements::MessageElements () const + { + return *iMessageElements; + } + +// ----------------------------------------------------------------------------- +// CSIPResponseElements::MessageElements +// ----------------------------------------------------------------------------- +// +EXPORT_C CSIPMessageElements& CSIPResponseElements::MessageElements () + { + return *iMessageElements; + } + +// ----------------------------------------------------------------------------- +// CSIPResponseElements::InternalizeL +// ----------------------------------------------------------------------------- +// +CSIPResponseElements* +CSIPResponseElements::InternalizeL (RReadStream& aReadStream) + { + CSIPResponseElements* self = + CSIPResponseElements::InternalizeLC(aReadStream); + CleanupStack::Pop(); // self + return self; + } + +// ----------------------------------------------------------------------------- +// CSIPResponseElements::InternalizeLC +// ----------------------------------------------------------------------------- +// +CSIPResponseElements* +CSIPResponseElements::InternalizeLC (RReadStream& aReadStream) + { + CSIPResponseElements* self = new(ELeave)CSIPResponseElements; + CleanupStack::PushL (self); + self->DoInternalizeL(aReadStream); + return self; + } + +// ----------------------------------------------------------------------------- +// CSIPResponseElements::DoInternalizeL +// ----------------------------------------------------------------------------- +// +void CSIPResponseElements::DoInternalizeL (RReadStream& aReadStream) + { + iStatusCode = aReadStream.ReadUint16L(); + TUint32 reasonPhraseLength = aReadStream.ReadUint32L(); + HBufC8* reasonPhraseBuf = HBufC8::NewLC(reasonPhraseLength); + TPtr8 reasonPhrasePtr(reasonPhraseBuf->Des()); + aReadStream.ReadL(reasonPhrasePtr,reasonPhraseLength); + iReasonPhrase = SIPStrings::Pool().OpenFStringL(reasonPhrasePtr); + CleanupStack::PopAndDestroy(reasonPhraseBuf); + iMessageElements = CSIPMessageElements::InternalizeL(aReadStream); + } + +// ----------------------------------------------------------------------------- +// CSIPResponseElements::ExternalizeL +// ----------------------------------------------------------------------------- +// +void CSIPResponseElements::ExternalizeL (RWriteStream& aWriteStream) const + { + aWriteStream.WriteUint16L(iStatusCode); + TPtrC8 reasonPhrase(iReasonPhrase.DesC()); + aWriteStream.WriteUint32L(reasonPhrase.Length()); + aWriteStream.WriteL(reasonPhrase); + iMessageElements->ExternalizeL(aWriteStream); + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/sipclientstub/src/CSipSseTestTls.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/sipclientstub/src/CSipSseTestTls.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,334 @@ +/* +* 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: +* +*/ + + +#include "CSipSseTestTls.h" +#include +#include +#include +#include +#include "SipResponseElements.h" +#include "siprequestelements.h" +#include "mussettingskeys.h" + + +TBool CSipSseTestTls::iSipRegisterStatus = EFalse; + + +void CSipSseTestTls::OpenL () + { + CSipSseTestTls* self = new (ELeave) CSipSseTestTls(); + self->ClientRequest( NULL ); + self->ClientResponse( SIPStrings::StringF( SipStrConsts::EEmpty ), NULL ); + Dll::SetTls( self ); + + User::LeaveIfError( self->Set ( MusSettingsKeys::KActivation, + MusSettingsKeys::EAlwaysActive ) ); + User::LeaveIfError( self->Set ( MusSettingsKeys::KAuditoryNotification, + MusSettingsKeys::EAuditoryNotificationOff ) ); + User::LeaveIfError( self->Set ( MusSettingsKeys::KPopupNotification, + MusSettingsKeys::EPopupNotificationOff ) ); + User::LeaveIfError( self->Set ( MusSettingsKeys::KPopupNotificationType, + MusSettingsKeys::ENotificationTypeQueryUser ) ); + User::LeaveIfError( self->Set ( MusSettingsKeys::KEdgeDtmSupport, + MusSettingsKeys::EDtmModeNotAllowed ) ); + User::LeaveIfError( self->Set ( MusSettingsKeys::KForceInternetSignaling, + MusSettingsKeys::EFollowProfileConfiguration ) ); + User::LeaveIfError( self->Set ( MusSettingsKeys::KAutoRecord, + MusSettingsKeys::EAutoRecordOn ) ); + User::LeaveIfError( self->Set ( MusSettingsKeys::KSipProfileId, + 0 ) ); //default profile + User::LeaveIfError( self->Set ( MusSettingsKeys::KUiOrientation, + MusSettingsKeys::EPortrait ) ); + User::LeaveIfError( self->Set ( MusSettingsKeys::KCapabilityQuery, + MusSettingsKeys::ENoOptions ) ); + User::LeaveIfError( self->Set ( MusSettingsKeys::KAllowOnlyIn3GNetwork, + MusSettingsKeys::EAllowedAllBearers ) ); + + } + +void CSipSseTestTls::Close () + { + CSipSseTestTls* self = Storage(); + delete self; + Dll::SetTls( NULL ); + } + + +CSipSseTestTls* CSipSseTestTls::Storage() + { + return static_cast(Dll::Tls()); + } + +CSipSseTestTls::CSipSseTestTls() + : iError( KErrNone ) + { + } + +CSipSseTestTls::~CSipSseTestTls() + { + delete iClientRequest; + delete iClientResponse; + iKeys.Reset(); + iValues.Reset(); + } + +void CSipSseTestTls::Reset() + { + Storage()->Set ( MusSettingsKeys::KActivation, + MusSettingsKeys::EAlwaysActive ); + Storage()->Set ( MusSettingsKeys::KAuditoryNotification, + MusSettingsKeys::EAuditoryNotificationOff ); + Storage()->Set ( MusSettingsKeys::KPopupNotification, + MusSettingsKeys::EPopupNotificationOff ); + Storage()->Set ( MusSettingsKeys::KPopupNotificationType, + MusSettingsKeys::ENotificationTypeQueryUser ); + Storage()->Set ( MusSettingsKeys::KEdgeDtmSupport, + MusSettingsKeys::EDtmModeNotAllowed ); + Storage()->Set ( MusSettingsKeys::KForceInternetSignaling, + MusSettingsKeys::EFollowProfileConfiguration ); + Storage()->Set ( MusSettingsKeys::KAutoRecord, + MusSettingsKeys::EAutoRecordOn ); + Storage()->Set ( MusSettingsKeys::KSipProfileId, + 0 ); //default profile + Storage()->Set ( MusSettingsKeys::KUiOrientation, + MusSettingsKeys::EPortrait ); + Storage()->Set ( MusSettingsKeys::KCapabilityQuery, + MusSettingsKeys::ENoOptions ); + + Storage()->Set ( MusSettingsKeys::KAllowOnlyIn3GNetwork, + MusSettingsKeys::EAllowedAllBearers ); + + iRegistryBehavior = 0; + iProfileBehavior = 0; + iConnectionBehavior = 0; + } + +TInt CSipSseTestTls::Set(TUint32 aKey, TInt aValue) + { + // Setting of any other value + for ( TInt i = 0; i < iKeys.Count(); ++i ) + { + if ( iKeys[i] == aKey ) + { + iValues[i] = aValue; + return KErrNone; + } + } + + // No wise error handling implemented + TInt error = iKeys.Append( aKey ); + if ( error == KErrNone ) + { + error = iValues.Append( aValue ); + } + + return error; + } + +TInt CSipSseTestTls::Get(TUint32 aKey, TInt& aValue) + { + for ( TInt i = 0; i < iKeys.Count(); ++i ) + { + if ( iKeys[i] == aKey ) + { + aValue = iValues[i]; + return KErrNone; + } + } + + return KErrNotFound; + } + +void CSipSseTestTls::SetError( TInt aError ) + { + iError = aError; + } + +TInt CSipSseTestTls::Error() const + { + return iError; + } + + +void CSipSseTestTls::Clear() + { + iError = KErrNone; + iConnectionCount = 0; + iSubConnectionCount = 0; + iUintAttributeValue = 0; + iConnectionId = 0; + iIntAttributeValue = 0; + iRequestStatus = KErrNone; + iPhoneRegistrationStatus = RMobilePhone::ERegistrationUnknown; + iPhoneRegistrationStatusPointer = NULL; + iPhoneNetworkMode = RMobilePhone::ENetworkModeUnknown; + ClientRequest( NULL ); + //iResponseToRequest = SIPStrings::StringF( SipStrConsts::EEmpty ); + } + +void CSipSseTestTls::SetRequestStatus( TRequestStatus& aStatus ) + { + iRequestStatus = aStatus; + } + + +TBool CSipSseTestTls::RegisterStatus() + { + + return iSipRegisterStatus; + } +void CSipSseTestTls::SetRegisterStatus( TBool aStatus ) + { + iSipRegisterStatus = aStatus; + } +TBool CSipSseTestTls::RegisterSent() + { + if ( !iSipRegisterStatus ) + { + iSipRegisterStatus = ETrue; + } + return iSipRegisterStatus; + } + +void CSipSseTestTls::StoreRegistry( MSIPProfileRegistryObserver& aRegistry ) + { + iRegistry = &aRegistry; + } +/* +void CSipSseTestTls::ProfileRegistryEventOccurred(TUint32 aProfileId, MSIPProfileRegistryObserver::TEvent aEvent ) + { + iRegistry->ProfileRegistryEventOccurred( aProfileId,aEvent ); + } + + +void CSipSseTestTls::SetState( MMusAvaObserver::TAvailabilityStatus aStatus ) + { + iStatus = aStatus; + } + */ +TInt CSipSseTestTls::ConnectionCount() + { + return iConnectionCount; + } +void CSipSseTestTls::SetConnectionCount( TInt aCount ) + { + iConnectionCount = aCount; + } + +void CSipSseTestTls::ConnectionInfo( const TUint& aIndex, + TUint& aConnectionId, + TUint& aSubConnectionCount ) + { + aConnectionId = iConnectionId; + aSubConnectionCount = iSubConnectionCount; + } + +void CSipSseTestTls::SetConnectionInfo( TUint aConnectionId, + TUint aSubConnectionCount ) + { + iConnectionId = aConnectionId; + iSubConnectionCount = aSubConnectionCount; + } + +void CSipSseTestTls::GetUintAttribute( const TUint aConnectionId, + const TUint aSubConnectionId, + const TUint aAttribute, + TUint& aValue, + TRequestStatus& aStatus ) + { + aValue = iUintAttributeValue; + aStatus = iRequestStatus; + } +void CSipSseTestTls::SetUintAttribute( TUint aConnectionId, + TUint aSubConnectionId, + TUint aAttribute, + TUint aValue, + TRequestStatus& aStatus ) + { + iUintAttributeValue = aValue; + iRequestStatus = aStatus; + } + +void CSipSseTestTls::GetIntAttribute( const TUint aConnectionId, + const TUint aSubConnectionId, + const TUint aAttribute, + TInt& aValue, + TRequestStatus& aStatus ) + { + aValue = iIntAttributeValue; + aStatus = iRequestStatus; + } +void CSipSseTestTls::SetIntAttribute( TUint aConnectionId, + TUint aSubConnectionId, + TUint aAttribute, + TInt aValue, + TRequestStatus& aStatus ) + { + iIntAttributeValue = aValue; + iRequestStatus = aStatus; + } + +void CSipSseTestTls::SetEvent(const CConnMonEventBase& aConnMonEvent) + { + iConnMonEventBase = const_cast( &aConnMonEvent ); + } + +const CConnMonEventBase& CSipSseTestTls::Event() + { + return *iConnMonEventBase; + } + +void CSipSseTestTls::SetRegistrationStatus( RMobilePhone::TMobilePhoneRegistrationStatus aRegStatus ) + { + iPhoneRegistrationStatus = aRegStatus; + } + +void CSipSseTestTls::SetRegistrationStatus( RMobilePhone::TMobilePhoneRegistrationStatus* aRegStatus ) + { + iPhoneRegistrationStatusPointer = aRegStatus; + } + +void CSipSseTestTls::RegistrationStatus( RMobilePhone::TMobilePhoneRegistrationStatus& aReqStatus ) + { + aReqStatus = iPhoneRegistrationStatus; + } + +void CSipSseTestTls::SetPhoneNetworkModeStatus( RMobilePhone::TMobilePhoneNetworkMode aStatus ) + { + iPhoneNetworkMode = aStatus; + } + +RMobilePhone::TMobilePhoneNetworkMode& CSipSseTestTls::PhoneNetworkModeStatus() + { + return iPhoneNetworkMode; + } + + void CSipSseTestTls::ClientRequest( CSIPRequestElements* aRequest ) + { + delete iClientRequest; + iClientRequest = aRequest; + } + +void CSipSseTestTls::ClientResponse( RStringF aMethod, CSIPResponseElements* aResponse ) + { + iResponseToRequest = aMethod; + delete iClientResponse; + iClientResponse = aResponse; + } + +//end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/sipclientstub/src/Csipconnection.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/sipclientstub/src/Csipconnection.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,85 @@ +/* +* 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 "sipconnection.h" +#include "sip.h" +#include "siperr.h" + +CSIPConnection::CSIPConnection(CSIP& aSIP, + TUint32 aIapId, + MSIPConnectionObserver& aObserver) + : iIapId(aIapId), iObserver(aObserver), iState(EActive) + { + iSIP = &aSIP; + } + +void CSIPConnection::ConstructL() + { + } + + +EXPORT_C CSIPConnection* CSIPConnection::NewL(CSIP& aSIP, + TUint32 aIapId, + MSIPConnectionObserver& aSIPConnectionObserver) + { + + CSIPConnection* self = new(ELeave) CSIPConnection(aSIP, aIapId, aSIPConnectionObserver); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(); + return self; + + } + + +EXPORT_C CSIPConnection::~CSIPConnection() + { + } + +EXPORT_C TUint32 CSIPConnection::IapId() const + { + return iIapId; + } + +EXPORT_C CSIPConnection::TState CSIPConnection::State() const + { + return iState; + } + +EXPORT_C void CSIPConnection::SetState(TState aState) + { + iState = aState; + } + +//TODO:Check if these new functions are needed in sip_stub + +// ----------------------------------------------------------------------------- +// CSIPConnection::SIP +// ----------------------------------------------------------------------------- +// +EXPORT_C CSIP* CSIPConnection::SIP() + { + return iSIP; + } + +// ----------------------------------------------------------------------------- +// CSIPConnection::SIP +// ----------------------------------------------------------------------------- +// +EXPORT_C const CSIP* CSIPConnection::SIP() const + { + return iSIP; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/sipclientstub/src/Csipservertransaction.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/sipclientstub/src/Csipservertransaction.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,87 @@ +/* +* 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 "sipservertransaction.h" +#include "siprequestelements.h" +#include "sipresponseelements.h" +#include +#include +#include "CSipSseTestTls.h" + + +EXPORT_C CSIPServerTransaction::~CSIPServerTransaction() + { + delete iRequestElements; + } + + +CSIPServerTransaction::CSIPServerTransaction( RStringF aType ) + : CSIPTransactionBase( aType, EFalse ) + { + } + + +EXPORT_C CSIPServerTransaction* CSIPServerTransaction::NewL( RStringF aType ) + { + return new(ELeave)CSIPServerTransaction( aType ); + } + + +EXPORT_C void CSIPServerTransaction::SetRequestElements( + CSIPRequestElements* aElements) + { + if( iRequestElements ) + { + delete iRequestElements; + } + + iRequestElements = aElements; + } + + +EXPORT_C void CSIPServerTransaction::SendResponseL( + CSIPResponseElements *aElements) + { + CSipSseTestTls* tls = CSipSseTestTls::Storage(); + if ( tls ) + { + User::LeaveIfError( tls->Error() ); + // tls->SIPSends( Type(), aElements ); + } + else + { + delete aElements; + } + } + + +EXPORT_C const CSIPRequestElements* CSIPServerTransaction::RequestElements() const + { + return iRequestElements; + } + +EXPORT_C TBool CSIPServerTransaction::ResponseAllowed() const + { + if ( Type() == SIPStrings::StringF( SipStrConsts::EAck ) ) + { + return EFalse; + } + else + { + return ETrue; + } + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/sipclientstub/src/Csiptransactionbase.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/sipclientstub/src/Csiptransactionbase.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,68 @@ +/* +* 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 "siptransactionbase.h" +#include "sipresponseelements.h" +#include "sipstrings.h" +#include "SipStrConsts.h" + +CSIPTransactionBase::~CSIPTransactionBase() + { + delete iResponseElements; + } + +CSIPTransactionBase::CSIPTransactionBase( RStringF aType, TBool aIsCliTrx ) + : iType(aType), + iIsClientTransaction(aIsCliTrx), + iState(ETrying) + { + + if ( iIsClientTransaction && iType == SIPStrings::StringF( SipStrConsts::EInvite ) ) + { + iState = ECalling; + } + } + +EXPORT_C TBool CSIPTransactionBase::operator==(const CSIPTransactionBase& aTransactionBase) const + { + return (this == &aTransactionBase); + } + +EXPORT_C CSIPTransactionBase::TState CSIPTransactionBase::StateL() + { + return iState; + } + +EXPORT_C RStringF CSIPTransactionBase::Type() const + { + return iType; + } + +EXPORT_C TBool CSIPTransactionBase::IsSIPClientTransaction() const + { + return iIsClientTransaction; + } + +void CSIPTransactionBase::ChangeState( CSIPTransactionBase::TState aNextState ) + { + iState = aNextState; + } + +void CSIPTransactionBase::Detach(const MTransactionAssociation& /*aAssociation*/) + { + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/sipprofilestub/group/sipprofile.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/sipprofilestub/group/sipprofile.mmp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,48 @@ +/* +* Copyright (c) 2006-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: Definition of project MceClientStub +* +*/ + + +// To get the APP_LAYER_SYSTEMINCLUDE-definition +#include + +#include + +TARGET sipprofilecli.dll +TARGETTYPE dll +UID 0x1000008d 0x00000113 // Experimental UID + +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE sipmanagedprofileregistrystub.cpp +SOURCE sipmanagedprofilestub.cpp +SOURCE sipprofileregistrybasestub.cpp +SOURCE sipprofileregistrystub.cpp +SOURCE sipprofilestub.cpp +SOURCE sipstub.cpp sipprofilealrcontroller.cpp + + +USERINCLUDE ../inc + +// Default system include paths for application layer modules. +APP_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY bafl.lib + +EXPORTUNFROZEN \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/sipprofilestub/inc/sipprofile.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/sipprofilestub/inc/sipprofile.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,343 @@ +/* +* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 class providing profile data of SIP service provider +* +*/ + + +#ifndef CSIPPROFILE_H +#define CSIPPROFILE_H + +// INCLUDES +#include +#include +#include +#include "sipregistrationcontext.h" +#include "sipprofiletypeinfo.h" + +// FORWARD DECLARATIONS +class CSIPConcreteProfile; +class CSIPProfileRegistry; +class CSIPProfileRegistryBase; + +/** +* SIP Profile ID which value is type of TUint32 +*/ +const TUint32 KSIPProfileId = 1; + +/** +* SIP Provider Name which value is type of TDesC8 +*/ +const TUint32 KSIPProviderName = 2; + +/** +* Access Point ID which value is type of TUint32 +*/ +const TUint32 KSIPAccessPointId = 3; + +/** +* Signaling compression (SigComp) which value is type of TBool. +* ETrue indicates that SigComp is enabled +*/ +const TUint32 KSIPSigComp = 4; + +/** +* Security Negotiation which value is type of TBool. ETrue indicates that +* Security Negotiation is enabled +*/ +const TUint32 KSIPSecurityNegotiation = 5; + +/** +* Auto Registration which value is type of TBool. ETrue indicates that +* profile is enabled for auto registration +*/ +const TUint32 KSIPAutoRegistration = 6; + +/** +* Defined user's address-of-record which value is type of TDesC8 +*/ +const TUint32 KSIPUserAor = 7; + +/** +* Registration which value is type of TBool. ETrue indicates that +* profile is registered +*/ +const TUint32 KSIPProfileRegistered = 8; + +/** +* Uers's registered address-of-records which value is of type MDesC8Array. +* Note that array will contain AORs only in case the profile is registered. +*/ +const TUint32 KSIPRegisteredAors = 9; + +/** +* Negotiated security mechanism during registration procedure which value +* is of type TDesC8. +* Note that descriptor will contain value only in case the profile is +* registered. +*/ +const TUint32 KSIPNegotiatedSecurityMechanism = 10; + +/** +* Default profile which value is type of TBool. +* ETrue indicates that profile is default +*/ +const TUint32 KSIPDefaultProfile = 11; + +/** +* "Contact" header parameters used during registration which value +*is of type MDesC8Array. Array element contains one "Contact" header +* parameter. +*/ +const TUint32 KSIPContactHeaderParams = 12; + +/** +* SIP Registrar +*/ +const TUint32 KSIPRegistrar = 130; + +/** +* SIP Outbound Proxy +*/ +const TUint32 KSIPOutboundProxy = 131; + +/** +* HTTP Digest user name which value is type of TDesC8 +*/ +const TUint32 KSIPDigestUserName = 150; + +/** +* HTTP Digest realm which value is type of TDesC8 +*/ +const TUint32 KSIPDigestRealm = 151; + +/** +* SIP server's address which value is of type TDesC8 +*/ +const TUint32 KSIPServerAddress = 152; + +// CLASS DECLARATION +/** +* @publishedAll +* @released +* +* Class contains profile information of particular SIP service +* provider. Class provides functions for quering profile parameter +* values. +* @lib sipprofilecli.lib +*/ +class CSIPProfile: public CBase, public MSIPRegistrationContext + { + public: // Constructors and destructor + /** + * Destructor. + * @capability NetworkServices + */ + IMPORT_C ~CSIPProfile(); + + public: // New functions + /** + * Gets profile type information + * @return profile type information + */ + IMPORT_C const TSIPProfileTypeInfo& Type() const; + + /** + * Gets profile parameter + * @param aParam a parameter to get + * @param aVal on return will contain parameter value + * @return KErrNotFound if parameter was not found, KErrNone otherwise + */ + IMPORT_C TInt GetParameter(TUint32 aParam, TDesC8 const *& aVal) const; + + /** + * Gets profile parameter + * @param aParam a parameter to get + * @param aVal on return will contain parameter value + * @return KErrNotFound if parameter was not found, KErrNone otherwise + */ + IMPORT_C TInt GetParameter(TUint32 aParam, TUint32& aVal) const; + + /** + * Gets profile parameter + * @param aParam a parameter to get + * @param aVal on return will contain parameter value + * @return KErrNotFound if parameter was not found, KErrNone otherwise + */ + IMPORT_C TInt GetParameter(TUint32 aParam, TBool& aVal) const; + + /** + * Gets profile parameter + * @param aParam a parameter to get + * @param aVal on return will contain parameter value + * @return KErrNotFound if parameter was not found, KErrNone otherwise + */ + IMPORT_C TInt GetParameter(TUint32 aParam, MDesC8Array const *& aVal) const; + + /** + * Gets profile parameter that is defined for a particular SIP server + * @param aServer a SIP server type + * @param aParam a parameter to get + * @param aVal on return will contain parameter value + * @return KErrNotFound if parameter was not found, KErrNone otherwise + */ + IMPORT_C TInt GetParameter(TUint32 aServerType, TUint32 aParam, TDesC8 const *& aVal) const; + + public: //Functions from base class + /** + * Tests if the registration context can be + * used for creating SIP messages/dialogs + * Profile can be used, when CSIPProfileRegistry::IsEnabled() == ETrue + * and Status() == ERegistered. + * @return ETrue if can be used, EFalse otherwise + */ + TBool IsContextActive() const; + + /** + * + * For internal use only + * @return context id + */ + TUint32 ContextId() const; + + + public: //New functions + + /** + * Two-phased constructor. + * @param aSIPRegistry a SIP profile client providing connection to SIP + * profile server. + */ + + static CSIPProfile* NewL(CSIPProfileRegistry* aSIPRegistry); + + /** + * Two-phased constructor. + * @param aSIPRegistry a SIP profile client providing connection to SIP + * profile server. + * Constructs an object and adds the pointer to the cleanup stack; + */ + + static CSIPProfile* NewLC(CSIPProfileRegistry* aSIPRegistry); + + /** + * Sets profiles enabled state + * @param aEnabled ETrue if enabled + */ + + void SetEnabled(TBool aEnabled); + + /** + * Sets concrete profile that holds actual data + * @param aProfile profile instance containing data + */ + + void SetConcreteProfile(CSIPConcreteProfile* aProfile); + + /** + * Clears concrete profile that holds actual data + */ + + void ClearConcreteProfile(); + + /** + * Gets concrete profile that holds actual data + * @return concrete profile holding data + */ + + CSIPConcreteProfile& ConcreteProfile(); + + /** + * Gets concrete profile that holds actual data + * @return concrete profile holding data + */ + + const CSIPConcreteProfile& ConcreteProfile() const; + + /** + * Checks if the profile is enabled + * @return ETrue if enabled, EFalse otherwise + */ + + TBool IsEnabled() const; + + /** + * Gets last occurred error during registration + * @return last occurred error code, KErrNone if no error + */ + TInt LastRegistrationError() const; + + /** + * Checks if two profiles are equal + * @return ETrue if equal + */ + TBool operator==(const CSIPProfile& + aProfile) const; + + /** + * sets pointer to registry for profile + */ + void SetRegistry(CSIPProfileRegistryBase* aRegistry); + + /** + * Clears pointer to registry from profile + */ + void ClearRegistry(); + + protected: + + /** + * Constructor. + */ + CSIPProfile(CSIPProfileRegistryBase* aRegistry); + + /** + * 2nd phase constructor. + */ + void ConstructL(); + + protected: + + CSIPConcreteProfile* iSIPProfile; + CSIPProfileRegistryBase* iSIPProfileRegistry; + + // Stub data + + public: + + TBool iEnabled; + TBool iIsDefaultProfile; + + TSIPProfileTypeInfo iTypeInfo; + + // Value iTUint32Value is set to aVal when calling + // GetParameter(TUint32 aParam, TUint32& aVal) + // if iTUint32ValueError == KErrNone. + // iTUint32ValueError is returned in any case + TUint32 iTUint32Value; + TInt iTUint32ValueError; + + // Value iTBoolValue is set to aVal when calling + // GetParameter(TUint32 aParam, TBool& aVal) + // if iTBoolValueError == KErrNone. + // iTBoolValueError is returned in any case + TBool iTBoolValue; + TInt iTBoolValueError; + + CDesC8Array* iArray; + + // + }; + +#endif // CSIPPROFILE_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/sipprofilestub/inc/sipprofileregistry.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/sipprofilestub/inc/sipprofileregistry.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,185 @@ +/* +* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 class for using SIP profiles +* +*/ + + +#ifndef CSIPPROFILEREGISTRY_H +#define CSIPPROFILEREGISTRY_H + +// INCLUDES +#include +#include +#include +#include "sipprofileregistrybase.h" + +// FORWARD DECLARATIONS +class CSIP; +class CSIPConnection; +class CSIPProfile; +class MSIPProfileRegistryObserver; +class MSIPConnectionObserver; + +// STUB stuff + +typedef TInt TSIPProfileBehavior; +const TSIPProfileBehavior KRegistryLeaveAtConstruct = 1; +const TSIPProfileBehavior KSIPProfileIdFetchFails = 2; +const TSIPProfileBehavior KSIPIapIdFetchFails = 3; +const TSIPProfileBehavior KSIPConnectionLeaveAtConstruct = 4; + +class CSIPProfileBehaviorTls : public CBase + { +public: + static void OpenL(); + static void Close(); + + static CSIPProfileBehaviorTls* Storage(); + + void Reset(); + +private: + + CSIPProfileBehaviorTls(); + ~CSIPProfileBehaviorTls(); + +public: + + TSIPProfileBehavior iRegistryBehavior; + TSIPProfileBehavior iProfileBehavior; + TSIPProfileBehavior iConnectionBehavior; + }; + + + +// CLASS DECLARATION +/** +* @publishedAll +* @released +* +* The class for retrieving SIP profiles from permanent storage. +* This class provides services for retreiving SIP profiles +* and enabling/disabling them for the usage. +* +* The user can create only one instance of this class (a singleton class). +* +* @lib sipprofilecli.lib +*/ +class CSIPProfileRegistry: public CSIPProfileRegistryBase + { + public: // Constructors and destructor + /** + * Two-phased constructor. + * This constructor should be used if the client intends + * to use SIP services with profiles. + * @param aSip a SIP client providing connection to SIP stack. + * @param aObserver a observer for SIP profile change events. + */ + IMPORT_C static CSIPProfileRegistry* NewL( + CSIP& aSip, + MSIPProfileRegistryObserver& aObserver); + + /** + * Two-phased constructor. + * This constructor should be used if the client intends + * to use SIP services with profiles. + * Constructs an object and adds the pointer to the cleanup stack; + * @param aSip a SIP client providing connection to SIP stack. + * @param aObserver a observer for SIP profile change events. + */ + IMPORT_C static CSIPProfileRegistry* NewLC( + CSIP& aSip, + MSIPProfileRegistryObserver& aObserver); + + /** + * Destructor + */ + IMPORT_C ~CSIPProfileRegistry(); + + public: // New functions + /** + * Gets handle to the SIP server + * @return handle to the SIP server + */ + IMPORT_C CSIP& SIP() const; + + /** + * Gets the SIP connection to be used with this SIP profile. + * @pre IsEnabled() == ETrue + * @param aProfile a sip profile + * @return a SIP connection to be used; the owneship is transfered + * @leave KErrNoMemory if out of memory + * @capability NetworkServices + */ + IMPORT_C CSIPConnection* ConnectionL( + CSIPProfile& aProfile); + + /** + * Enables the SIP profile for use. + * Enabling the SIP profile will cause the SIP profile to + * be registered if its status was unregistered. + * The user must check the profile status after calling this + * function. In case the profile is not registered the user must + * wait until the it is notified about profile registration + * on MSIPProfileRegistryObserver-callback interface. + * @param aProfile a sip profile to enable + * @param aObserver a observer for SIP connection events + * @leave KErrNotFound if non-existing profile is provided + * @capability NetworkServices + */ + IMPORT_C void EnableL( + CSIPProfile& aProfile, + MSIPConnectionObserver &aObserver); + + /** + * Disables the usage of SIP profile + * @param aProfile a sip profile to disable + * @return KErrNone if SIP profile was successfully disabled; + * system wide error otherwise + * @capability NetworkServices + */ + IMPORT_C TInt Disable(CSIPProfile& aProfile); + + /** + * Tests is the SIP profile enabled for the use + * @param aProfile a SIP profile to be checked + * @return ETrue if SIP profile is enabled; EFalse otherwise + */ + IMPORT_C TBool IsEnabled(const CSIPProfile& aProfile) const; + + public: + + CSIPProfile* NewInstanceL(); + + private: + + CSIPProfileRegistry(); + CSIPProfileRegistry(CSIP& aSip, MSIPProfileRegistryObserver& aObserver); + + void ConstructL(); + + public: + + TBool iProfileDisabled; + mutable TBool iProfileEnabled; + + private: + + CSIP& iSip; + MSIPConnectionObserver* iConnectionObserver; + + }; + +#endif // CSIPPROFILEREGISTRY_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/sipprofilestub/src/sipmanagedprofileregistrystub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/sipprofilestub/src/sipmanagedprofileregistrystub.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,164 @@ +/* +* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 FILES + +#include "sip.h" +#include "sipconnection.h" +#include "sipprofileregistry.h" +#include "sipmanagedprofileregistry.h" +#include "sipprofileregistryobserver.h" +#include "sipprofile.h" +#include "sipmanagedprofile.h" +//#include "sipconcreteprofile.h" + +// ============================ MEMBER FUNCTIONS =============================== +EXPORT_C void CSIPManagedProfileRegistry::SaveL(CSIPProfile& /*aSIPProfile*/) + { + + } + +// ----------------------------------------------------------------------------- +// CSIPManagedProfileRegistry::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CSIPManagedProfileRegistry* CSIPManagedProfileRegistry::NewL( + MSIPProfileRegistryObserver& aObserver) + { + CSIPManagedProfileRegistry* self = CSIPManagedProfileRegistry::NewLC(aObserver); + CleanupStack::Pop(self); + return self; + } + +// ----------------------------------------------------------------------------- +// CSIPManagedProfileRegistry::NewLC +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CSIPManagedProfileRegistry* CSIPManagedProfileRegistry::NewLC( + MSIPProfileRegistryObserver& aObserver) + { + CSIPManagedProfileRegistry* self = new (ELeave) CSIPManagedProfileRegistry(aObserver); + CleanupStack::PushL(self); + self->ConstructL(); + return self; + } + +// ----------------------------------------------------------------------------- +// CSIPManagedProfileRegistry::~CSIPManagedProfileRegistry +// ----------------------------------------------------------------------------- +// +EXPORT_C CSIPManagedProfileRegistry::~CSIPManagedProfileRegistry() + { + + } +/* +// ----------------------------------------------------------------------------- +// CSIPManagedProfileRegistry::EnableL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CSIPManagedProfileRegistry::EnableL(CSIPProfile& aSIPProfile, + MSIPConnectionObserver& aObserver) + { + //__ASSERT_ALWAYS (!aSIPProfile.IsEnabled(), User::Leave (KErrArgument)); + //aSIPProfile.ConcreteProfile().SetLastRegistrationError(KErrNone); + //iConnectionObserver = &aObserver; + + //EnableProfileL(aSIPProfile); + } + +// ----------------------------------------------------------------------------- +// CSIPManagedProfileRegistry::Disable +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CSIPManagedProfileRegistry::Disable(CSIPProfile& /*aProfile) + { + TInt err = KErrNone; + //aProfile.ConcreteProfile().SetLastRegistrationError(KErrNone); + //TRAPD(err, DisableProfileL(aProfile)); + return err; + } + +// ----------------------------------------------------------------------------- +// CSIPManagedProfileRegistry::SIP +// ----------------------------------------------------------------------------- +// +EXPORT_C CSIP& CSIPManagedProfileRegistry::SIP() const + { + return iSip; + } + +// ----------------------------------------------------------------------------- +// CSIPManagedProfileRegistry::ConnectionL +// ----------------------------------------------------------------------------- +// +//EXPORT_C CSIPConnection* CSIPManagedProfileRegistry::ConnectionL( +// /*CSIPProfile& aSIPProfile) +// { + //TUint32 apId(0); + //__ASSERT_ALWAYS (iConnectionObserver != 0, User::Leave (KErrArgument)); + //aSIPProfile.GetParameter(KSIPAccessPointId, apId); + //CSIPConnection* connection = iSip.Connection(apId); + //if (connection == 0) + // { + // connection = CSIPConnection::NewL(iSip, apId, + // *iConnectionObserver); + // } + //return connection; +// } + +// ----------------------------------------------------------------------------- +// CSIPManagedProfileRegistry::IsEnabled +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool CSIPManagedProfileRegistry::IsEnabled(const CSIPProfile& /*aSIPProfile) const + { + //return aSIPProfile.IsEnabled(); + return ETrue; + } +*/ +// ----------------------------------------------------------------------------- +// CSIPManagedProfileRegistry::CSIPManagedProfileRegistry +// ----------------------------------------------------------------------------- +// +CSIPManagedProfileRegistry::CSIPManagedProfileRegistry( + MSIPProfileRegistryObserver& aObserver) + : CSIPProfileRegistryBase( aObserver ) + { + } + +// ----------------------------------------------------------------------------- +// CSIPManagedProfileRegistry::ConstructL +// ----------------------------------------------------------------------------- +// +void CSIPManagedProfileRegistry::ConstructL() + { +// BaseConstructL(); + + } + +// ----------------------------------------------------------------------------- +// CSIPManagedProfileRegistry::NewInstanceL +// ----------------------------------------------------------------------------- +// +CSIPProfile* CSIPManagedProfileRegistry::NewInstanceL() + { + return CSIPManagedProfile::NewL(this); + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/sipprofilestub/src/sipmanagedprofilestub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/sipprofilestub/src/sipmanagedprofilestub.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,141 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 FILES + +#include "sipprofile.h" +#include "sipmanagedprofile.h" +#include "sipprofileregistry.h" +#include "sipmanagedprofileregistry.h" + +/* + +//#include "sipconcreteprofile.h" +//#include "SIPProfileTypeInfo.h" +//_LIT8(KSIPProfileExtenstionParameter, "%u"); +//const TUint KProfileBufferSize = 25; + +_LIT8(KSIPProfileDefAOR, "user@aa"); + /** + * Sets profile parameter + * @param aParam a parameter to set + * @param aVal values to set; an empty array resets the value + * @return KErrNotFound if parameter was not found, + * KErrNoMemory if out of memory + * KErrNone otherwise + */ +EXPORT_C TInt CSIPManagedProfile::SetParameter( TUint32 /*aParam*/, + const MDesC8Array& /*aVal*/ ) + { + return KErrNone; + } + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// CSIPManagedProfile::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CSIPManagedProfile* CSIPManagedProfile::NewL(CSIPManagedProfileRegistry* aSIPRegistry) + { + CSIPManagedProfile* self = CSIPManagedProfile::NewLC (aSIPRegistry); + CleanupStack::Pop(); + return self; + } + +// ----------------------------------------------------------------------------- +// CSIPManagedProfile::NewLC +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CSIPManagedProfile* CSIPManagedProfile::NewLC(CSIPManagedProfileRegistry* aSIPRegistry) + { + CSIPManagedProfile* self = new(ELeave)CSIPManagedProfile(aSIPRegistry); + CleanupStack::PushL (self); + return self; + } + +// ----------------------------------------------------------------------------- +// CSIPManagedProfile::~CSIPManagedProfile +// ----------------------------------------------------------------------------- +// +EXPORT_C CSIPManagedProfile::~CSIPManagedProfile() + { + } +/* +// ----------------------------------------------------------------------------- +// CSIPManagedProfile::GetParameter +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CSIPManagedProfile::GetParameter(TUint32 aParam, TDesC8 const *& aVal ) const + { + const TDesC8& val= KSIPProfileDefAOR; + aVal = &val; + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CSIPManagedProfile::GetParameter +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CSIPManagedProfile::GetParameter(TUint32 aParam, TUint32& aVal) const + { + aVal = 1; + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CSIPManagedProfile::GetParameter +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CSIPManagedProfile::GetParameter(TUint32 aParam, TBool& aVal) const + { + aVal = ETrue; + return KErrNone; + } +*/ +// ----------------------------------------------------------------------------- +// CSIPManagedProfile::CSIPManagedProfile +// ----------------------------------------------------------------------------- +// +CSIPManagedProfile::CSIPManagedProfile(CSIPManagedProfileRegistry* aRegistry) : + CSIPProfile( aRegistry ) + { + } + +/* +// ----------------------------------------------------------------------------- +// CSIPManagedProfile::IsContextActive +// ----------------------------------------------------------------------------- +// +TBool CSIPManagedProfile::IsContextActive() const + { + return ETrue; + } + +// ----------------------------------------------------------------------------- +// CSIPManagedProfile::ContextId +// ----------------------------------------------------------------------------- +// +TUint32 CSIPManagedProfile::ContextId() const + { + return 1; + } +*/ \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/sipprofilestub/src/sipprofilealrcontroller.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/sipprofilestub/src/sipprofilealrcontroller.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,64 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 FILES + +#include + + +// CSipProfileAlrController STUB +CSipProfileAlrController* CSipProfileAlrController::NewL( + CSIPProfileRegistryBase& aRegistry, + MSipProfileAlrObserver& /*aObserver*/ ) + { + return new( ELeave )CSipProfileAlrController( aRegistry ); + } + +CSipProfileAlrController::~CSipProfileAlrController() + { + } + +void CSipProfileAlrController::AllowMigrationL( + TUint32 /*aProfileId*/, + TUint32 aIapId ) + { + delete HBufC::NewL( 1 ); + //iAllowMigrationCalled = ETrue; + //iLastUsedIap = aIapId; + } + +void CSipProfileAlrController::DisallowMigrationL( + TUint32 /*aProfileId*/, + TUint32 aIapId ) + { + delete HBufC::NewL( 1 ); + //iDisallowMigrationCalled = ETrue; + //iLastUsedIap = aIapId; + } + +void CSipProfileAlrController::RefreshIapAvailabilityL( + TUint32 /*aProfileId*/ ) + { + delete HBufC::NewL( 1 ); + } + +CSipProfileAlrController::CSipProfileAlrController( + CSIPProfileRegistryBase& aRegistry ) + : iRegistry( aRegistry ) + { + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/sipprofilestub/src/sipprofileregistrybasestub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/sipprofilestub/src/sipprofileregistrybasestub.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,383 @@ +/* +* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 FILES + +#include "sipprofile.h" +#include "sip.h" +#include "sipprofileregistrybase.h" +#include "sipprofileregistryobserver.h" +#include "sipprofileregistry.h" +#include "sipprofileregistryobserver.h" +#include "sipmanagedprofile.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::~CSIPProfileRegistryBase +// ----------------------------------------------------------------------------- +// +EXPORT_C CSIPProfileRegistryBase::~CSIPProfileRegistryBase() + { + + + //iProfiles.ResetAndDestroy(); + //iProfiles.Close(); + + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::ProfilesL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CSIPProfileRegistryBase::ProfilesL( + RPointerArray& aProfiles) + { + // stubs + CSIPProfileRegistry* reg = (CSIPProfileRegistry*) this; + CSIPProfile* profile = CSIPProfile::NewLC(reg); + + aProfiles.AppendL ( profile ); + + CleanupStack::Pop( profile ); + + + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::ProfilesL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CSIPProfileRegistryBase::ProfilesL( + const TSIPProfileTypeInfo& /*aType*/, + RPointerArray& aProfiles) + { + // stubs + CSIPProfileRegistry* reg = (CSIPProfileRegistry*) this; + + CSIPProfile* profile = CSIPProfile::NewLC( reg ); + aProfiles.AppendL ( profile ); + + CleanupStack::Pop( profile ); + + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::ProfilesL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CSIPProfileRegistryBase::ProfilesL( + const TDesC8& /*aAOR*/, + RPointerArray& aProfiles) + { + // stubs + ProfilesL( aProfiles ); + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::ProfilesCommonL +// ----------------------------------------------------------------------------- +// +void CSIPProfileRegistryBase::ProfilesCommonL( + RPointerArray& /*aProfiles*/, + CSIPConcreteProfileHolder* /*aHolder */) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::ProfileL +// ----------------------------------------------------------------------------- +// +EXPORT_C CSIPProfile* CSIPProfileRegistryBase::ProfileL(TUint32 /*aId*/) + { + return NewInstanceL(); + } + + +// +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::DefaultProfileL +// ----------------------------------------------------------------------------- +// +EXPORT_C CSIPProfile* CSIPProfileRegistryBase::DefaultProfileL() + { + CSIPProfile* defaultProfile = NewInstanceL(); + defaultProfile->iIsDefaultProfile = ETrue; + return defaultProfile; + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::SupportedProfileTypesL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CSIPProfileRegistryBase::SupportedProfileTypesL( + RArray& /*aSupportedProfileTypes*/ ) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::LastRegistrationError +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CSIPProfileRegistryBase::LastRegistrationError( + const CSIPProfile& /*aProfile*/) const + { + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::CSIPProfileRegistryBase +// ----------------------------------------------------------------------------- +// +CSIPProfileRegistryBase::CSIPProfileRegistryBase( + MSIPProfileRegistryObserver& aObserver): + iObserver(aObserver) + { + + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::ProfileDeleted +// ----------------------------------------------------------------------------- +// +void CSIPProfileRegistryBase::ProfileDeleted(CSIPProfile& /*aProfile*/) + { + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::EnableProfileL +// ----------------------------------------------------------------------------- +// +void CSIPProfileRegistryBase::EnableProfileL( + CSIPProfile& /*aProfile*/) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::DisableProfileL +// ----------------------------------------------------------------------------- +// +void CSIPProfileRegistryBase::DisableProfileL(CSIPProfile& /*aProfile*/) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::UsageL +// ----------------------------------------------------------------------------- +// +TInt CSIPProfileRegistryBase::UsageL(const CSIPProfile& /*aProfile*/) const + { + User::Leave( KErrNotSupported ); + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::AddProfileL +// ----------------------------------------------------------------------------- +// +void CSIPProfileRegistryBase::AddProfileL(CSIPProfile& /*aProfile*/) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::UpdateProfileL +// ----------------------------------------------------------------------------- +// +void CSIPProfileRegistryBase::UpdateProfileL(CSIPProfile& /*aProfile*/) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::RemoveProfileL +// ----------------------------------------------------------------------------- +// +void CSIPProfileRegistryBase::RemoveProfileL(CSIPProfile& /*aProfile*/) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::IsDefaultProfileL +// ----------------------------------------------------------------------------- +// +TBool CSIPProfileRegistryBase::IsDefaultProfileL(const CSIPProfile& /*aProfile*/) + { + User::Leave( KErrNotSupported ); + return ETrue; + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::RegistrationStatusChangedL +// ----------------------------------------------------------------------------- +// +void CSIPProfileRegistryBase::NegotiatedSecurityMechanismL( + CSIPConcreteProfile& /*aProfile*/) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::RegisteredAORsL +// ----------------------------------------------------------------------------- +// +void CSIPProfileRegistryBase::RegisteredAORsL(CSIPConcreteProfile& /*aProfile*/) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::SIPProfileL +// ----------------------------------------------------------------------------- +// +CSIPProfile* CSIPProfileRegistryBase::SIPProfileL(TUint32 aId, TInt /*aSize*/) + { + __ASSERT_ALWAYS (aId > 1, User::Leave (KErrArgument)); + return NULL; + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::StoreProfileL +// ----------------------------------------------------------------------------- +// +void CSIPProfileRegistryBase::StoreProfileL(CSIPProfileCleanupItem* /*aCleanupItem*/) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::StoreProfileL +// ----------------------------------------------------------------------------- +// +void CSIPProfileRegistryBase::StoreArrayL( + RPointerArray& /*aProfiles*/, + RPointerArray& /*aRetProfiles*/) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::ProfileItemL +// ----------------------------------------------------------------------------- +// +/* +CSIPProfileItem* CSIPProfileRegistryBase::ProfileItemL(TUint aProfileId ) + { + User::Leave( KErrNotSupported ); + return NULL; + } +*/ + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::ProfileIndex +// ----------------------------------------------------------------------------- +// +TInt CSIPProfileRegistryBase::ProfileIndex (TUint /*profileId*/) + { + return 0; + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::ProfileItemByIndex +// ----------------------------------------------------------------------------- +// +CSIPProfileItem* CSIPProfileRegistryBase::ProfileItemByIndex(TUint /*aIndex*/) + { + return NULL; + } + + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::RegistrationStatusChangedL +// ----------------------------------------------------------------------------- +// +void CSIPProfileRegistryBase::RegistrationStatusChangedL(TUint32 /*aProfileId*/, + TInt /*aStatus*/, + TUint32 /*aStatusId*/) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::UpdatedL +// ----------------------------------------------------------------------------- +// +void CSIPProfileRegistryBase::UpdatedL(TUint32 /*aProfileId*/, TUint /*aSize*/) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::AddedL +// ----------------------------------------------------------------------------- +// +void CSIPProfileRegistryBase::AddedL(TUint32 /*aProfileId*/) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::RemovedL +// ----------------------------------------------------------------------------- +// +void CSIPProfileRegistryBase::RemovedL(TUint32 /*aProfileId*/) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::ErrorOccurredL +// ----------------------------------------------------------------------------- +// +void CSIPProfileRegistryBase::ErrorOccurredL(TUint32 /*aProfileId*/, + TInt /*aStatus*/, + TInt /*aError*/ ) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::BaseConstructL +// ----------------------------------------------------------------------------- +// +void CSIPProfileRegistryBase::BaseConstructL() + { + + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::CrashRevert +// ----------------------------------------------------------------------------- +// +void CSIPProfileRegistryBase::CrashRevert (TAny* /*aItem*/) + { + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::LocalCrashRevert +// ----------------------------------------------------------------------------- +// +void CSIPProfileRegistryBase::LocalCrashRevert (TAny* /*aItem*/) + { + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/sipprofilestub/src/sipprofileregistrystub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/sipprofilestub/src/sipprofileregistrystub.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,208 @@ +/* +* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 FILES + +#include "sip.h" +#include "sipconnection.h" +#include "sipprofileregistry.h" +#include "sipprofileregistryobserver.h" +#include "sipprofile.h" +//#include "sipconcreteprofile.h" + +// STUB stuff + +void CSIPProfileBehaviorTls::OpenL() + { + CSIPProfileBehaviorTls* self = new (ELeave) CSIPProfileBehaviorTls(); + Dll::SetTls( self ); + } + +void CSIPProfileBehaviorTls::Close () + { + CSIPProfileBehaviorTls* self = Storage(); + delete self; + Dll::SetTls( NULL ); + } + + +CSIPProfileBehaviorTls* CSIPProfileBehaviorTls::Storage() + { + return static_cast(Dll::Tls()); + } + +void CSIPProfileBehaviorTls::Reset() + { + iRegistryBehavior = 0; + iProfileBehavior = 0; + iConnectionBehavior = 0; + } + +CSIPProfileBehaviorTls::CSIPProfileBehaviorTls() + { + } + +CSIPProfileBehaviorTls::~CSIPProfileBehaviorTls() + { + } + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistry::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CSIPProfileRegistry* CSIPProfileRegistry::NewL( + CSIP& aSip, + MSIPProfileRegistryObserver& aObserver) + { + CSIPProfileRegistry* self = CSIPProfileRegistry::NewLC(aSip, aObserver); + CleanupStack::Pop(self); + return self; + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistry::NewLC +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CSIPProfileRegistry* CSIPProfileRegistry::NewLC( + CSIP& aSip, + MSIPProfileRegistryObserver& aObserver) + { + CSIPProfileRegistry* self = new (ELeave) CSIPProfileRegistry(aSip, aObserver); + CleanupStack::PushL(self); + self->ConstructL(); + return self; + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistry::~CSIPProfileRegistry +// ----------------------------------------------------------------------------- +// +EXPORT_C CSIPProfileRegistry::~CSIPProfileRegistry() + { + + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistry::EnableL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CSIPProfileRegistry::EnableL(CSIPProfile& /*aSIPProfile*/, + MSIPConnectionObserver& /*&aObserver*/) + { + //__ASSERT_ALWAYS (!aSIPProfile.IsEnabled(), User::Leave (KErrArgument)); + //aSIPProfile.ConcreteProfile().SetLastRegistrationError(KErrNone); + //iConnectionObserver = &aObserver; + + //EnableProfileL(aSIPProfile); + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistry::Disable +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CSIPProfileRegistry::Disable(CSIPProfile& /*aProfile*/) + { + TInt err = KErrNone; + iProfileDisabled = ETrue; + //aProfile.ConcreteProfile().SetLastRegistrationError(KErrNone); + //TRAPD(err, DisableProfileL(aProfile)); + return err; + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistry::SIP +// ----------------------------------------------------------------------------- +// +EXPORT_C CSIP& CSIPProfileRegistry::SIP() const + { + return iSip; + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistry::ConnectionL +// ----------------------------------------------------------------------------- +// +//EXPORT_C CSIPConnection* CSIPProfileRegistry::ConnectionL( +// /*CSIPProfile& aSIPProfile*/) +// { + //TUint32 apId(0); + //__ASSERT_ALWAYS (iConnectionObserver != 0, User::Leave (KErrArgument)); + //aSIPProfile.GetParameter(KSIPAccessPointId, apId); + //CSIPConnection* connection = iSip.Connection(apId); + //if (connection == 0) + // { + // connection = CSIPConnection::NewL(iSip, apId, + // *iConnectionObserver); + // } + //return connection; +// } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistry::IsEnabled +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool CSIPProfileRegistry::IsEnabled(const CSIPProfile& /*aSIPProfile*/) const + { + //iProfileEnabled = ETrue; + return ETrue; + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistry::CSIPProfileRegistry +// ----------------------------------------------------------------------------- +// +CSIPProfileRegistry::CSIPProfileRegistry( + CSIP& aSip, + MSIPProfileRegistryObserver& aObserver): + CSIPProfileRegistryBase(aObserver), iSip(aSip) + { + + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistry::ConstructL +// ----------------------------------------------------------------------------- +// +void CSIPProfileRegistry::ConstructL() + { + CSIPProfileBehaviorTls* tls = CSIPProfileBehaviorTls::Storage(); + if ( tls ) + { + if ( tls->iRegistryBehavior == KRegistryLeaveAtConstruct ) + { + User::Leave( KErrGeneral ); + } + } + BaseConstructL(); + + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistry::NewInstanceL +// ----------------------------------------------------------------------------- +// +CSIPProfile* CSIPProfileRegistry::NewInstanceL() + { + return CSIPProfile::NewL(this); + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/sipprofilestub/src/sipprofilestub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/sipprofilestub/src/sipprofilestub.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,198 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 FILES + +#include "sipprofile.h" +//#include "sipmanagedprofile.h" +#include "sipprofileregistry.h" +//#include "sipconcreteprofile.h" +//#include "SIPProfileTypeInfo.h" +//_LIT8(KSIPProfileExtenstionParameter, "%u"); +//const TUint KProfileBufferSize = 25; + +_LIT8(KSIPProfileDefAOR, "user@aa"); + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// CSIPProfile::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CSIPProfile* CSIPProfile::NewL(CSIPProfileRegistry* aSIPRegistry) + { + CSIPProfile* self = CSIPProfile::NewLC (aSIPRegistry); + CleanupStack::Pop(); + return self; + } + +// ----------------------------------------------------------------------------- +// CSIPProfile::NewLC +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CSIPProfile* CSIPProfile::NewLC(CSIPProfileRegistry* aSIPRegistry) + { + CSIPProfile* self = new(ELeave)CSIPProfile(aSIPRegistry); + CleanupStack::PushL (self); + self->ConstructL (); + return self; + } + +// ----------------------------------------------------------------------------- +// CSIPProfile::~CSIPProfile +// ----------------------------------------------------------------------------- +// +EXPORT_C CSIPProfile::~CSIPProfile() + { + delete iArray; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C const TSIPProfileTypeInfo& CSIPProfile::Type() const + { + return iTypeInfo; + } + +// ----------------------------------------------------------------------------- +// CSIPProfile::GetParameter +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CSIPProfile::GetParameter( TUint32 /*aParam*/, + TDesC8 const *& aVal ) const + { + const TDesC8& val= KSIPProfileDefAOR; + aVal = &val; + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CSIPProfile::GetParameter +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CSIPProfile::GetParameter(TUint32 aParam, TUint32& aVal) const + { + CSIPProfileBehaviorTls* tls = CSIPProfileBehaviorTls::Storage(); + if ( tls ) + { + if ( tls->iProfileBehavior == KSIPProfileIdFetchFails && + aParam == KSIPProfileId ) + { + return KErrNotFound; + } + else if ( tls->iProfileBehavior == KSIPIapIdFetchFails && + aParam == KSIPAccessPointId ) + { + return KErrNotFound; + } + } + + if ( iTUint32ValueError == KErrNone ) + { + aVal = iTUint32Value; + } + return iTUint32ValueError; + } + +// ----------------------------------------------------------------------------- +// CSIPProfile::GetParameter +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CSIPProfile::GetParameter(TUint32 aParam, TBool& aVal) const + { + if ( iTBoolValueError == KErrNone ) + { + if ( aParam == KSIPDefaultProfile ) + { + aVal = iIsDefaultProfile; + } + else + { + aVal = iTBoolValue; + } + } + + return iTBoolValueError; + } + + +// ----------------------------------------------------------------------------- +// CSIPProfile::GetParameter +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CSIPProfile::GetParameter( TUint32 /*aParam*/, + MDesC8Array const *& aVal) const + { + if ( iArray ) + { + aVal = iArray; + } + else + { + aVal = NULL; + } + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// CSIPProfile::CSIPProfile +// ----------------------------------------------------------------------------- +// +CSIPProfile::CSIPProfile(CSIPProfileRegistryBase* aRegistry): + iSIPProfileRegistry(aRegistry), + iEnabled(EFalse), + iTUint32Value( 1 ), + iTUint32ValueError( KErrNone ), + iTBoolValue( ETrue ), + iTBoolValueError( KErrNone ), + iIsDefaultProfile( EFalse ) + { + iTypeInfo.iSIPProfileClass = TSIPProfileTypeInfo::EInternet; + } + +// ----------------------------------------------------------------------------- +// CSIPProfile::ConstructL +// ----------------------------------------------------------------------------- +// +void CSIPProfile::ConstructL() + { + } + +// ----------------------------------------------------------------------------- +// CSIPProfile::IsContextActive +// ----------------------------------------------------------------------------- +// +TBool CSIPProfile::IsContextActive() const + { + return ETrue; + } + +// ----------------------------------------------------------------------------- +// CSIPProfile::ContextId +// ----------------------------------------------------------------------------- +// +TUint32 CSIPProfile::ContextId() const + { + return 1; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/sipprofilestub/src/sipstub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/sipprofilestub/src/sipstub.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,83 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 FILES + +#include + + + +EXPORT_C CSIP* CSIP::NewL(const TUid& /*aUid*/, + MSIPObserver& /*aObserver*/) + { + return new ( ELeave ) CSIP; + } + + +EXPORT_C CSIP* CSIP::NewLC(const TUid& /*aUid*/, + MSIPObserver& /*aObserver*/) + { + CSIP* sip = new ( ELeave ) CSIP; + CleanupStack::PushL( sip ); + return sip; + } + + +EXPORT_C CSIP::~CSIP() + { + } + + + +EXPORT_C CDesC8Array* CSIP::SupportedSecurityMechanismsL() const + { + return NULL; + } + + +EXPORT_C TBool CSIP::IsSigCompSupportedL() const + { + return EFalse; + } + + +EXPORT_C HBufC8* CSIP::NegotiatedSecurityMechanismL(const TDesC8& /*aHop*/) + { + return NULL; + } + + +EXPORT_C CSIPConnection* CSIP::Connection(TUint32 /*aIapId*/) const + { + return NULL; + } + + +CSIPImplementation& CSIP::Implementation() + { + return *iImplementation; + } + + +CSIP::CSIP() + { + } + +void CSIP::ConstructL(const TUid& /*aUid*/, MSIPObserver& /*aObserver*/) + { + } \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/app/lcapplication.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/app/lcapplication.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,106 @@ +/* +* 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: +* +*/ +//USER +#include "lcapplication.h" +#include "mustestdirector.h" +#include + +//SYSTEM +#include +#include + +LcHbApplication* LcHbApplication::self = 0; + + +// ----------------------------------------------------------------------------- +// LcHbApplication::LcHbApplication +// ----------------------------------------------------------------------------- +// +LcHbApplication::LcHbApplication(int &argc, char *argv[], QString useCase) : + HbApplication(argc, argv) +{ + qDebug() << "LcHbApplication::LcHbApplication() ->"; + self = this; + iTestDirector = CMusTestDirector::NewL(); + setUseCase( useCase ); + qDebug() << "LcHbApplication::LcHbApplication() -<"; +} + +// ----------------------------------------------------------------------------- +// LcHbApplication::~LcHbApplication +// ----------------------------------------------------------------------------- +// +LcHbApplication::~LcHbApplication() +{ + self = 0; +} + + +// ----------------------------------------------------------------------------- +// LcHbApplication::quit +// ----------------------------------------------------------------------------- +// +void LcHbApplication::quit() +{ + qDebug() << "LcHbApplication::quit()"; + if (self) { + emit self->handleQuit(); + } +} + +// ----------------------------------------------------------------------------- +// LcHbApplication::quit +// ----------------------------------------------------------------------------- +// +void LcHbApplication::setUseCase( QString useCase ) +{ + qDebug() << "LcHbApplication::setUseCase()"; + if( useCase == "0") // live + { + qDebug() << "LcHbApplication::LiveUseCase()"; + iTestDirector->ConfigureLiveSharing(); + } + else if( useCase == "1") // clip + { + if (self) emit self->handleQuit(); + } + else if( useCase == "2") // stil + { + if (self) emit self->handleQuit(); + } + else if( useCase == "3") // EMusReceive + { + qDebug() << "LcHbApplication::ReceiveUseCase()"; + iTestDirector->ConfigureReceiveSharing(); + } + else if( useCase == "4") // EMusContinue + { + if (self) emit self->handleQuit(); + } + else if( useCase == "5") // EMusTwoWayVideo + { + if (self) emit self->handleQuit(); + } + else if( useCase == "6") // EMusReceiveTwoWayVideo + { + if (self) emit self->handleQuit(); + } + else + { + if (self) emit self->handleQuit(); + } +} diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/app/lcapplication.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/app/lcapplication.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,54 @@ +/* +* 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 LCAPPLICATION_H +#define LCAPPLICATION_H + +#include +#include + +class CMusTestDirector; + +class LcHbApplication : public HbApplication +{ + Q_OBJECT + friend class UT_LcApplication; + +public: + + LcHbApplication(int &argc, char *argv[],QString useCase); + ~LcHbApplication(); + +signals: + + void handleQuit(); + +public slots: + + //from QCoreApplication + static void quit(); + +private: + void setUseCase( QString useCase ); + +private: //data + + static LcHbApplication* self; + CMusTestDirector* iTestDirector; +}; + + +#endif //LCAPPLICATION_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/app/main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/app/main.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,42 @@ +/* +* 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: +* +*/ +//USER +#include "lcapplication.h" + +//SYSTEM +#include +#include + +int main(int argc, char *argv[]) +{ + int err=-1; + QString useCase = "0"; // live case + QString engineName("MultimediaSharing"); + QString applicationName("Video Sharing"); + if (argc >= 2) + { + useCase = QString::fromUtf8( argv[2] ); + } + LcHbApplication app(argc,argv,useCase); + LcViewManager viewManager(engineName,applicationName); + QObject::connect( &app, SIGNAL( handleQuit() ), + &viewManager, SLOT( terminateSession() ), + Qt::QueuedConnection ); + + err = app.exec(); + return err; +} diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/app/moc_lcapplication.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/app/moc_lcapplication.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,83 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'lcapplication.h' +** +** Created: Mon 14. Sep 11:48:03 2009 +** by: The Qt Meta Object Compiler version 61 (Qt 4.5.0-garden) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include "lcapplication.h" +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'lcapplication.h' doesn't include ." +#elif Q_MOC_OUTPUT_REVISION != 61 +#error "This file was generated using the moc from 4.5.0-garden. It" +#error "cannot be used with the include files from this version of Qt." +#error "(The moc has changed too much.)" +#endif + +QT_BEGIN_MOC_NAMESPACE +static const uint qt_meta_data_LcHbApplication[] = { + + // content: + 2, // revision + 0, // classname + 0, 0, // classinfo + 2, 12, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + + // signals: signature, parameters, type, tag, flags + 17, 16, 16, 16, 0x05, + + // slots: signature, parameters, type, tag, flags + 30, 16, 16, 16, 0x0a, + + 0 // eod +}; + +static const char qt_meta_stringdata_LcHbApplication[] = { + "LcHbApplication\0\0handleQuit()\0quit()\0" +}; + +const QMetaObject LcHbApplication::staticMetaObject = { + { &HbApplication::staticMetaObject, qt_meta_stringdata_LcHbApplication, + qt_meta_data_LcHbApplication, 0 } +}; + +const QMetaObject *LcHbApplication::metaObject() const +{ + return &staticMetaObject; +} + +void *LcHbApplication::qt_metacast(const char *_clname) +{ + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_LcHbApplication)) + return static_cast(const_cast< LcHbApplication*>(this)); + return HbApplication::qt_metacast(_clname); +} + +int LcHbApplication::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = HbApplication::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + switch (_id) { + case 0: handleQuit(); break; + case 1: quit(); break; + default: ; + } + _id -= 2; + } + return _id; +} + +// SIGNAL 0 +void LcHbApplication::handleQuit() +{ + QMetaObject::activate(this, &staticMetaObject, 0, 0); +} +QT_END_MOC_NAMESPACE diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/app/must.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/app/must.loc Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,13 @@ +// ============================================================================ +// * Generated by qmake (2.01a) (Qt 4.5.0-garden) on: Mon 14. Sep 11:50:02 2009 +// * This file is generated by qmake and should not be modified by the +// * user. +// ============================================================================ + +#ifdef LANGUAGE_SC +#define STRING_r_short_caption "must" +#define STRING_r_caption "must" +#else +#define STRING_r_short_caption "must" +#define STRING_r_caption "must" +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/app/must.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/app/must.pro Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,36 @@ +# +# 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 = must +CONFIG += hb + +# Input +HEADERS += lcapplication.h +HEADERS += mustestdirector.h +INCLUDEPATH += ..\..\..\..\..\inc\ + +SOURCES += main.cpp +SOURCES += lcapplication.cpp +SOURCES += mustestdirector.cpp + +symbian: { + TARGET.UID2 = 0x1000008d + TARGET.UID3 = 0x1028238D + TARGET.CAPABILITY = CAP_APPLICATION NetworkControl SwEvent Location MultimediaDD + LIBS += -llivecommsui -lcentralrepository +} diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/app/must.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/app/must.rss Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,21 @@ +// ============================================================================ +// * Generated by qmake (2.01a) (Qt 4.5.0-garden) on: Mon 14. Sep 15:39:08 2009 +// * This file is generated by qmake and should not be modified by the +// * user. +// ============================================================================ + +#include +#include "must.loc" + +RESOURCE LOCALISABLE_APP_INFO r_localisable_app_info + { + short_caption = STRING_r_short_caption; + caption_and_icon = + CAPTION_AND_ICON_INFO + { + caption = STRING_r_caption; + number_of_icons = 0; + icon_file = ""; + }; + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/app/must_reg.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/app/must_reg.rss Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,18 @@ +// ============================================================================ +// * Generated by qmake (2.01a) (Qt 4.5.0-garden) on: Mon 14. Sep 15:39:08 2009 +// * This file is generated by qmake and should not be modified by the +// * user. +// ============================================================================ + +#include +#include + +UID2 KUidAppRegistrationResourceFile +UID3 0x1028238D + +RESOURCE APP_REGISTRATION_INFO + { + app_file="must"; + localisable_resource_file="\\resource\\apps\\must"; + + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/app/mustestdirector.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/app/mustestdirector.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,373 @@ +/* +* Copyright (c) 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: +* +*/ + + +// USER +#include "mustestdirector.h" +#include +#include "mussessionproperties.h" +#include "musresourceproperties.h" +#include "mussesseioninformationapi.h" +#include "mussettingskeys.h" +#include "mussettings.inl" + +#include +#include +#include +#include + +_LIT(KTestTelNumber,"+358504869612"); +_LIT( KTestCallProvider,"MultimediaSharing" ); +_LIT( KTestRemoteSipAddress,"sip:siva@musworld.com" ); +_LIT( KTestRemoteSipAddressProposal,"sip:wondering@nokia.com,sip:package@gone.com" ); +_LIT( KTestContactName,"Michel Jackson" ); + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusTestDirector::CMusTestDirector() + { + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// + +CMusTestDirector* CMusTestDirector::NewL() + { + CMusTestDirector* self = new( ELeave )CMusTestDirector(); + self->ConstructL(); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// + +void CMusTestDirector::ConstructL() + { + DefinePropertiesL(); + } +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// + +CMusTestDirector::~CMusTestDirector() + { + DeleteProperties(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// + +void CMusTestDirector::ConfigureLiveSharing( ) + { + SetUseCase( MultimediaSharing::EMusLiveVideo ); + + TInt error = RProperty::Set( NMusResourceApi::KCategoryUid, NMusSessionInformationApi::KMusTelNumber, KTestTelNumber); + MUS_LOG1("mus: [TEST] return value = %d",error ) + + error = RProperty::Set( NMusResourceApi::KCategoryUid, NMusSessionInformationApi::KMusCallDirection, NMusSessionInformationApi::ECallOrginated); + MUS_LOG1("mus: [TEST] return value = %d",error ) + + error = RProperty::Set( NMusResourceApi::KCategoryUid, NMusSessionInformationApi::KMUSCallProvider, KTestCallProvider); + MUS_LOG1("mus: [TEST] return value = %d",error ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// + +void CMusTestDirector::ConfigureReceiveSharing( ) + { + SetUseCase( MultimediaSharing::EMusReceive ); + + TInt error = RProperty::Set( NMusResourceApi::KCategoryUid, NMusSessionInformationApi::KMusTelNumber, KTestTelNumber); + MUS_LOG1("mus: [TEST] return value = %d",error ) + + error = RProperty::Set( NMusResourceApi::KCategoryUid, NMusSessionInformationApi::KMusCallDirection, NMusSessionInformationApi::ECallOrginated); + MUS_LOG1("mus: [TEST] return value = %d",error ) + + error = RProperty::Set( NMusResourceApi::KCategoryUid, NMusSessionInformationApi::KMUSCallProvider, KTestCallProvider); + MUS_LOG1("mus: [TEST] return value = %d",error ) + } +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// + +void CMusTestDirector::SetUseCase( MultimediaSharing::TMusUseCase aUseCase ) + { + TInt err = RProperty::Set( NMusSessionApi::KCategoryUid, NMusSessionApi::KUseCase, ( TInt )aUseCase); + } + +// ----------------------------------------------------------------------------- +// CMusAoPlugin::DefineResourcePropertiesL() +// Note : Ignore Define Errors . Because if define fails for sure Set +// will fail too . But there are some cases in Define Error should +// be ignored like KErrAlreadyExists , KErrPersmissionDenied.So It +// could be better if we dont care Define Error but care about Set Err. +// ----------------------------------------------------------------------------- +// +void CMusTestDirector::DefinePropertiesL() + { + MUS_LOG( "mus: [TEST] -> CMusAoPlugin::DefineResourceProperties") ; + // define resource properties + // they need to be defined here to make them exist always + // Read from cenrep key about the availability of camera and keypad + // if the availability is dynamic then define a key else no. + MusSettingsKeys::TAvailability camera = MusSettingsKeys::EAvailabilityStatic; + MusSettingsKeys::TAvailability keypad = MusSettingsKeys::EAvailabilityStatic ; + MultimediaSharingSettings::ResourceAvailability(camera,keypad); + if( camera == MusSettingsKeys::EAvailabilityDynamic ) + { + DefinePropertyL(NMusResourceApi::KCameraAvailability, + RProperty::EInt,( TInt ) NMusResourceApi::ENotAvailable); + } + if( keypad == MusSettingsKeys::EAvailabilityDynamic ) + { + DefinePropertyL(NMusResourceApi::KKeypadAvailability, + RProperty::EInt,( TInt ) NMusResourceApi::ENotAvailable); + } + DefinePropertyL(NMusResourceApi::KCameraInformation, + RProperty::EInt,( TInt ) NMusResourceApi::EUsePrimaryCamera); + DefinePropertyL(NMusSessionInformationApi::KMusCallEvent, + RProperty::EInt,( TInt ) NMusSessionInformationApi::ENoCall); + DefinePropertyL(NMusSessionInformationApi::KMusCallCount,RProperty::EInt,0); + + DefinePropertyL(NMusSessionInformationApi::KMusTelNumber, + RProperty::EText,KTestTelNumber); + DefinePropertyL(NMusSessionInformationApi::KMUSForbidden, + RProperty::EInt,( TInt ) NMusSessionInformationApi::EMUSAllowed); + DefinePropertyL(NMusSessionInformationApi::KMusCallDirection, + RProperty::EInt,( TInt ) NMusSessionInformationApi::ENoDirection); + + DefinePropertyL(NMusSessionInformationApi::KMUSCallProvider, + RProperty::EText,KTestCallProvider); + + DefineSessionPropertyL(NMusSessionApi::KUseCase, + RProperty::EInt,MultimediaSharing::EMusLiveVideo); + + DefineSessionPropertyL(NMusSessionApi::KStatus, + RProperty::EInt,MultimediaSharing::EMultimediaSharingAvailable); + + DefineSessionPropertyL(NMusSessionApi::KTelNumber, + RProperty::EText,KTestTelNumber); + + DefineSessionPropertyL(NMusSessionApi::KRemoteSipAddress, + RProperty::EText,KTestRemoteSipAddress); + + DefineSessionPropertyL(NMusSessionApi::KRemoteSipAddressProposal, + RProperty::EText,KTestRemoteSipAddressProposal); + + DefineSessionPropertyL(NMusSessionApi::KContactId, + RProperty::EInt,1); + + DefineSessionPropertyL(NMusSessionApi::KContactName, + RProperty::EText,KTestContactName); + + DefineSessionPropertyL(NMusSessionApi::KSipProfileId, + RProperty::EInt,1); + + CRepository* repository = CRepository::NewL(MusSettingsKeys::KRepositoryUid); + TInt uid = 0; + TBool exist = (repository->Get(MusSettingsKeys::KEncodingDevice,uid) == KErrNone); + if( !exist ) + { + TInt uid = 1234; + repository->Create(MusSettingsKeys::KEncodingDevice,uid); + TUint32 modifiedKeyCount(0); + User::LeaveIfError(repository->CommitTransaction(modifiedKeyCount)); + } + delete repository; + + MUS_LOG( "mus: [TEST] <- CMusAoPlugin::DefineResourceProperties" ) + } + +// ----------------------------------------------------------------------------- +// CMusAoPlugin::DefineProperty() +// ----------------------------------------------------------------------------- +// +void CMusTestDirector::DefineSessionPropertyL(TInt aKey,RProperty::TType aType,TInt aVal) + { + MUS_LOG( "mus: [TEST] -> CMusTestDirector::DefineSessionPropertyL( intValue )" ) + + TInt error = RProperty::Define( NMusSessionApi::KCategoryUid, + aKey, + aType ); + MUS_LOG2( "mus: [TEST] Key=%d defining tried, return=%d", aKey, error ) + + if ( error == KErrNone ) + { + error = RProperty::Set( NMusSessionApi::KCategoryUid, aKey, aVal ); + MUS_LOG2( "mus: [TEST] RProperty value %d set, return = %d", + aVal, error ) + User::LeaveIfError( error ); + } + else + { + MUS_LOG( "mus: [TEST] Defining failed, do not set value" ) + } + + MUS_LOG( "mus: [TEST] <- CMusTestDirector::DefineSessionPropertyL( intValue )" ) + } + +// ----------------------------------------------------------------------------- +// CTESTPlugin::DefineProperty() +// ----------------------------------------------------------------------------- +// +void CMusTestDirector::DefineSessionPropertyL( TInt aKey, + RProperty::TType aType, + const TDesC& aVal ) + { + MUS_LOG( "mus: [TEST] -> CTESTPlugin::DefineSessionPropertyL( DesCValue )" ) + + TInt error = RProperty::Define( NMusSessionApi::KCategoryUid, + aKey, + aType ); + MUS_LOG2( "mus: [TEST] Key=%d defining tried, return=%d", aKey, error ) + + if ( error == KErrNone ) + { + error = RProperty::Set( NMusSessionApi::KCategoryUid, aKey, aVal); + MUS_LOG_TDESC( "mus: [TEST] Tried to set RProperty value: ", aVal ) + MUS_LOG1("mus: [TEST] return value = %d",error ) + User::LeaveIfError( error ); + } + else + { + MUS_LOG( "mus: [TEST] Defining failed, do not set value" ) + } + + MUS_LOG( "mus: [TEST] <- CTESTPlugin::DefineSessionPropertyL( DesCValue )" ) + } + +// ----------------------------------------------------------------------------- +// CMusAoPlugin::DefineProperty() +// ----------------------------------------------------------------------------- +// +void CMusTestDirector::DefinePropertyL(TInt aKey,RProperty::TType aType,TInt aVal) + { + MUS_LOG( "mus: [TEST] -> CMusAoPlugin::DefinePropertyL( intValue )" ) + + TInt error = RProperty::Define( NMusResourceApi::KCategoryUid, + aKey, + aType ); + MUS_LOG2( "mus: [TEST] Key=%d defining tried, return=%d", aKey, error ) + + if ( error == KErrNone ) + { + error = RProperty::Set( NMusResourceApi::KCategoryUid, aKey, aVal ); + MUS_LOG2( "mus: [TEST] RProperty value %d set, return = %d", + aVal, error ) + User::LeaveIfError( error ); + } + else + { + MUS_LOG( "mus: [TEST] Defining failed, do not set value" ) + } + + MUS_LOG( "mus: [TEST] <- CTESTPlugin::DefinePropertyL( intValue )" ) + } + +// ----------------------------------------------------------------------------- +// CTESTPlugin::DefineProperty() +// ----------------------------------------------------------------------------- +// +void CMusTestDirector::DefinePropertyL( TInt aKey, + RProperty::TType aType, + const TDesC& aVal ) + { + MUS_LOG( "mus: [TEST] -> CTESTPlugin::DefinePropertyL( DesCValue )" ) + + TInt error = RProperty::Define( NMusResourceApi::KCategoryUid, + aKey, + aType ); + MUS_LOG2( "mus: [TEST] Key=%d defining tried, return=%d", aKey, error ) + + if ( error == KErrNone ) + { + error = RProperty::Set( NMusResourceApi::KCategoryUid, aKey, aVal); + MUS_LOG_TDESC( "mus: [TEST] Tried to set RProperty value: ", aVal ) + MUS_LOG1("mus: [TEST] return value = %d",error ) + User::LeaveIfError( error ); + } + else + { + MUS_LOG( "mus: [TEST] Defining failed, do not set value" ) + } + + MUS_LOG( "mus: [TEST] <- CTESTPlugin::DefinePropertyL( DesCValue )" ) + } + +// ----------------------------------------------------------------------------- +// CTESTPlugin::DeleteSessionProperties() +// ----------------------------------------------------------------------------- +// +void CMusTestDirector::DeleteSessionProperties() + { + TInt retVal = RProperty::Delete( NMusSessionApi::KCategoryUid,NMusSessionApi::KStatus); + retVal = RProperty::Delete( NMusSessionApi::KCategoryUid,NMusSessionApi::KRemoteSipAddress); + retVal = RProperty::Delete( NMusSessionApi::KCategoryUid,NMusSessionApi::KRemoteSipAddressProposal); + retVal = RProperty::Delete( NMusSessionApi::KCategoryUid,NMusSessionApi::KContactId); + retVal = RProperty::Delete( NMusSessionApi::KCategoryUid,NMusSessionApi::KContactName); + } +// ----------------------------------------------------------------------------- +// CTESTPlugin::DeleteResourceProperties() +// Note : There is no need of caring the return value in deleting +// This will be called when AO Plugin destroyed which is rare to happen +// Any unwanted deletion of AO Plugin should leave some PS Keys open. +// But this is OK if we ignore KErrAlreadyExists while defining next time. +// ----------------------------------------------------------------------------- +// +void CMusTestDirector::DeleteProperties() + { + MUS_LOG( "mus: [TEST] -> CTESTPlugin::DeleteResourcePropertiesL" ) + // Delete resource properties + // they need to be defined here to make them exist always + DeleteProperty(NMusResourceApi::KCameraAvailability); + DeleteProperty(NMusResourceApi::KKeypadAvailability); + DeleteProperty(NMusResourceApi::KCameraInformation); + DeleteProperty(NMusSessionInformationApi::KMusCallEvent); + DeleteProperty(NMusSessionInformationApi::KMusCallCount); + DeleteProperty(NMusSessionInformationApi::KMusTelNumber); + DeleteProperty(NMusSessionInformationApi::KMUSCallProvider); + DeleteProperty(NMusSessionInformationApi::KMUSForbidden); + DeleteProperty(NMusSessionInformationApi::KMusCallDirection); + MUS_LOG( "mus: [TEST] <- CTESTPlugin::DeleteResourcePropertiesL" ) + } + +// ----------------------------------------------------------------------------- +// CTESTPlugin::DeleteProperty() +// ----------------------------------------------------------------------------- +// +void CMusTestDirector::DeleteProperty(TInt aKey) + { + TInt retVal = RProperty::Delete( NMusResourceApi::KCategoryUid,aKey); + MUS_LOG2( "mus: [TEST] RProperty::Delete Type=%d return=%d",\ + aKey, retVal ) + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/app/mustestdirector.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/app/mustestdirector.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,53 @@ +/* +* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 CMUSTESTDIRECTOR_H +#define CMUSTESTDIRECTOR_H + +// INCLUDES +#include +#include +#include + + +class CMusTestDirector : public CBase + { + public: + CMusTestDirector(); + static CMusTestDirector* NewL(); + ~CMusTestDirector(); + public: + void SetUseCase( MultimediaSharing::TMusUseCase aUseCase ); + void ConfigureLiveSharing() ; + void ConfigureReceiveSharing(); + private: + void DeleteProperty(TInt aKey); + void DeleteProperties(); + void DefinePropertyL( TInt aKey, + RProperty::TType aType, + const TDesC& aVal ); + void DefinePropertyL(TInt aKey,RProperty::TType aType,TInt aVal); + void DefinePropertiesL(); + void DeleteSessionProperties(); + void DefineSessionPropertyL(TInt aKey,RProperty::TType aType,TInt aVal); + void DefineSessionPropertyL( TInt aKey,RProperty::TType aType,const TDesC& aVal ); + void ConstructL(); + }; + +#endif // CMUSTESTDIRECTOR_H + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/group/bld.inf Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,24 @@ +/* +* 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: +* +*/ + +PRJ_MMPFILES +../Stubs/mceclientstub/group/mceclient.mmp +../Stubs/sipclientstub/group/sipclient.mmp +../Stubs/sipprofilestub/group/sipprofile.mmp +../../../../mmshengine/group/musengineplugin.mmp +../app/must_0x1028238D.mmp +gnumakefile ../app/Makefile_0x1028238D.mk diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/group/install.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/group/install.bat Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,35 @@ +@rem +@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +@rem All rights reserved. +@rem This component and the accompanying materials are made available +@rem under the terms of "Eclipse Public License v1.0" +@rem which accompanies this distribution, and is available +@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +@rem +@rem Initial Contributors: +@rem Nokia Corporation - initial contribution. +@rem +@rem Contributors: +@rem +@rem Description: +@rem +@echo off +echo Installing mustester application ... +echo Backup the original dlls ... +move \epoc32\release\winscw\udeb\mceclient.dll \epoc32\release\winscw\udeb\mcelclient.dll.orig +move \epoc32\release\winscw\udeb\sipclient.dll \epoc32\release\winscw\udeb\sipclient.dll.orig +move \epoc32\release\winscw\udeb\sipprofilecli.dll \epoc32\release\winscw\udeb\sipprofilecli.dll.orig +echo Building mustester ... +call cd ..\..\..\ +call qmake mmshlcui.pro +call bldmake bldfiles +call abld reallyclean winscw udeb +call abld build winscw udeb +call cd tsrc\mustester\group +call bldmake bldfiles +call abld reallyclean winscw udeb +call abld build winscw udeb +echo Starting emulator... +echo Goto eshell and execute "must.exe -r usecase_no" +echo usecase_no = MultimediaSharing::TMusUsecase defined in musmanagercommon.h +call \epoc32\release\winscw\udeb\epoc.exe diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/group/install_armv5.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/group/install_armv5.bat Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,28 @@ +@rem +@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +@rem All rights reserved. +@rem This component and the accompanying materials are made available +@rem under the terms of "Eclipse Public License v1.0" +@rem which accompanies this distribution, and is available +@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +@rem +@rem Initial Contributors: +@rem Nokia Corporation - initial contribution. +@rem +@rem Contributors: +@rem +@rem Description: +@rem +@echo off +echo Installing mustester application ... +echo Backup the original dlls ... +move \epoc32\release\winscw\udeb\mceclient.dll \epoc32\release\winscw\udeb\mcelclient.dll.orig +move \epoc32\release\winscw\udeb\sipclient.dll \epoc32\release\winscw\udeb\sipclient.dll.orig +move \epoc32\release\winscw\udeb\sipprofilecli.dll \epoc32\release\winscw\udeb\sipprofilecli.dll.orig +echo Building mustester ... +call bldmake bldfiles +call abld reallyclean winscw udeb +call abld build winscw udeb +echo Starting emulator.Goto eshell and execute must.exe -r usecase_no +echo usecase_no = MultimediaSharing::TMusUsecase defined in musmanagercommon.h +call \epoc32\release\winscw\udeb\epoc.exe diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/group/uninstall.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/group/uninstall.bat Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,23 @@ +@rem +@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +@rem All rights reserved. +@rem This component and the accompanying materials are made available +@rem under the terms of "Eclipse Public License v1.0" +@rem which accompanies this distribution, and is available +@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +@rem +@rem Initial Contributors: +@rem Nokia Corporation - initial contribution. +@rem +@rem Contributors: +@rem +@rem Description: +@rem +@echo off +move \epoc32\release\winscw\udeb\mcelclient.dll.orig \epoc32\release\winscw\udeb\mceclient.dll +move \epoc32\release\winscw\udeb\sipclient.dll.orig \epoc32\release\winscw\udeb\sipclient.dll +move \epoc32\release\winscw\udeb\sipprofilecli.dll.orig \epoc32\release\winscw\udeb\sipprofilecli.dll + +call abld reallyclean winscw udeb +call abld clean winscw udeb +del \epoc32\release\winscw\udeb\must.exe \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/group/uninstall_armv5.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/group/uninstall_armv5.bat Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,23 @@ +@rem +@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +@rem All rights reserved. +@rem This component and the accompanying materials are made available +@rem under the terms of "Eclipse Public License v1.0" +@rem which accompanies this distribution, and is available +@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +@rem +@rem Initial Contributors: +@rem Nokia Corporation - initial contribution. +@rem +@rem Contributors: +@rem +@rem Description: +@rem +@echo off +move \epoc32\release\winscw\udeb\mcelclient.dll.orig \epoc32\release\winscw\udeb\mceclient.dll +move \epoc32\release\winscw\udeb\sipclient.dll.orig \epoc32\release\winscw\udeb\sipclient.dll +move \epoc32\release\winscw\udeb\sipprofilecli.dll.orig \epoc32\release\winscw\udeb\sipprofilecli.dll + +call abld reallyclean winscw udeb +call abld clean winscw udeb +del \epoc32\release\winscw\udeb\must.exe \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/install/must_armv5_udeb.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/install/must_armv5_udeb.pkg Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,32 @@ +; must_armv5_udeb.pkg generated by qmake at Mon 14. Sep 11:50:02 2009 +; This file is generated by qmake and should not be modified by the user +; + +; Language +&EN + +; SIS header: name, uid, version +#{"must"},(0x1028238D),1,0,0 + +; Localised Vendor name +%{"Nokia, Qt Software"} + +; Unique Vendor name +:"Nokia, Qt Software" + +; Dependencies +[0x101F7961],0,0,0,{"S60ProductID"} +[0x102032BE],0,0,0,{"S60ProductID"} +[0x102752AE],0,0,0,{"S60ProductID"} +[0x1028315F],0,0,0,{"S60ProductID"} +(0x2001E61C), 4, 5, 0, {"QtLibs pre-release"} + +; Executable and default resource files +"\epoc32\release\armv5\udeb\must.exe" - "!:\sys\bin\must.exe" +"\epoc32\data\z\resource\apps\must.rsc" - "!:\resource\apps\must.rsc" +"\epoc32\data\z\private\10003a3f\import\apps\must_reg.rsc" - "!:\private\10003a3f\import\apps\must_reg.rsc" +"\epoc32\release\armv5\udeb\sipclient.dll" - "!:\sys\bin\sipclient.dll" +"\epoc32\release\armv5\udeb\mceclient.dll" - "!:\sys\bin\mceclient.dll" +"\epoc32\release\armv5\udeb\sipprofilecli.dll" - "!:\sys\bin\sipprofilecli.dll" +"\epoc32\release\armv5\udeb\musengineplugin.dll" - "!:\sys\bin\musengineplugin.dll" + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/install/must_armv5_urel.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/install/must_armv5_urel.pkg Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,32 @@ +; must_armv5_urel.pkg generated by qmake at Mon 14. Sep 11:50:02 2009 +; This file is generated by qmake and should not be modified by the user +; + +; Language +&EN + +; SIS header: name, uid, version +#{"must"},(0x1028238D),1,0,0 + +; Localised Vendor name +%{"Nokia, Qt Software"} + +; Unique Vendor name +:"Nokia, Qt Software" + +; Dependencies +[0x101F7961],0,0,0,{"S60ProductID"} +[0x102032BE],0,0,0,{"S60ProductID"} +[0x102752AE],0,0,0,{"S60ProductID"} +[0x1028315F],0,0,0,{"S60ProductID"} +(0x2001E61C), 4, 5, 0, {"QtLibs pre-release"} + +; Executable and default resource files +"\epoc32\release\armv5\urel\must.exe" - "!:\sys\bin\must.exe" +"\epoc32\data\z\resource\apps\must.rsc" - "!:\resource\apps\must.rsc" +"\epoc32\data\z\private\10003a3f\import\apps\must_reg.rsc" - "!:\private\10003a3f\import\apps\must_reg.rsc" +"\epoc32\release\armv5\urel\sipclient.dll" - "!:\sys\bin\sipclient.dll" +"\epoc32\release\armv5\urel\mceclient.dll" - "!:\sys\bin\mceclient.dll" +"\epoc32\release\armv5\urel\sipprofilecli.dll" - "!:\sys\bin\sipprofilecli.dll" +"\epoc32\release\armv5\urel\musengineplugin.dll" - "!:\sys\bin\musengineplugin.dll" + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/mustester/install/sis_udeb.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/mustester/install/sis_udeb.bat Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,17 @@ +rem +rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +rem All rights reserved. +rem This component and the accompanying materials are made available +rem under the terms of "Eclipse Public License v1.0" +rem which accompanies this distribution, and is available +rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +rem +rem Initial Contributors: +rem Nokia Corporation - initial contribution. +rem +rem Contributors: +rem +rem Description: +rem + +makesis must_armv5_udeb.pkg must.sis diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/dialpad.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/dialpad.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,64 @@ +/*! +* 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: Dialpad popup +* +*/ + +#ifndef DIALPAD_H +#define DIALPAD_H + +#include + +#include +#include + +class HbLineEdit; + +const int DialpadButtonCount = 13; + +class Dialpad : public HbWidget +{ + Q_OBJECT + +public: + explicit Dialpad(); + explicit Dialpad(const HbMainWindow& mainWindow); + + virtual ~Dialpad(); + + HbLineEdit& editor() const; + + bool isOpen() const {return mIsOpen;} + +public slots: + + void setTapOutsideDismiss( bool enable ); + + void openDialpad() { mIsOpen = true; } + + void closeDialpad() { mIsOpen = false; } + + void setCallButtonEnabled(bool enabled); + +signals: + void aboutToClose(); + +public: + HbLineEdit* mLineEdit; + bool mIsCallButtonEnabled; + bool mIsOpen; + bool mIsTabOutsideDismissEnabled; +}; + +#endif // DIALPAD_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/dialpad_stub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/dialpad_stub.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,56 @@ +/* +* Copyright (c) 2008-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 "dialpad.h" + +Dialpad::Dialpad() +{ + mLineEdit = new HbLineEdit(); + setVisible(false); + mIsCallButtonEnabled = true; + mIsOpen = false; +} + +Dialpad::Dialpad(const HbMainWindow& mainWindow) +{ + Q_UNUSED(mainWindow); + mLineEdit = new HbLineEdit(); + setVisible(false); + mIsCallButtonEnabled = true; + mIsOpen = false; +} + +Dialpad::~Dialpad() +{ + delete mLineEdit; +} + +HbLineEdit& Dialpad::editor() const +{ + return *mLineEdit; +} + +void Dialpad::setCallButtonEnabled(bool enabled) +{ + mIsCallButtonEnabled = enabled; +} + +void Dialpad::setTapOutsideDismiss( bool enable ) +{ + mIsTabOutsideDismissEnabled = enable ; +} diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/dialpadvtkeyhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/dialpadvtkeyhandler.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,53 @@ +/*! +* 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: Dialpad key handler. +* +*/ + +#ifndef DIALPADVTKEYHANDLER_H +#define DIALPADVTKEYHANDLER_H + +#include + +class Dialpad; +class HbMainWindow; + +/*! + DialpadVtKeyHandler + Class provides key handling for dialpad component. + + @code + Dialpad *dialpad = new Dialpad(); + DialpadVtKeyHandler *keyhandler = new DialpadVtKeyHandler(dialpad, this); + @endcode + +*/ +class DialpadVtKeyHandler : public QObject +{ + Q_OBJECT + +public: + explicit DialpadVtKeyHandler(Dialpad *dialPad, HbMainWindow& mainWindow, QObject *parent = 0); + virtual ~DialpadVtKeyHandler(); + +private: + HbMainWindow& mMainWindow; + Dialpad* mDialPad; // not owned + +public: // helper + void contentChanged( QString chrs ); + +}; + +#endif // DIALPADVTKEYHANDLER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/dialpadvtkeyhandler_stub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/dialpadvtkeyhandler_stub.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,45 @@ +/*! +* 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: Dialpad key handler. +* +*/ + +#include +#include +#include + +#define EMERGENCY_NUMBER "112" + +DialpadVtKeyHandler::DialpadVtKeyHandler(Dialpad *dialPad, HbMainWindow& mainWindow, QObject * parent) + : mMainWindow( mainWindow ), + mDialPad( dialPad ) +{ + Q_UNUSED(parent); +} + +DialpadVtKeyHandler::~DialpadVtKeyHandler() +{ + +} + +void DialpadVtKeyHandler::contentChanged( QString chrs ) +{ + if( mDialPad ){ + if( chrs == EMERGENCY_NUMBER ){ + mDialPad->setCallButtonEnabled(true); + }else{ + mDialPad->setCallButtonEnabled(false); + } + } +} diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbabstractbutton.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbabstractbutton.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,37 @@ +/* +* Copyright (c) 2008-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: HbAbstractButton class definition +* +*/ + + +#ifndef HBABSTRACTBUTTON_H +#define HBABSTRACTBUTTON_H + +#include +#include +#include + +class HbAbstractButton : public HbWidget +{ +public: + explicit HbAbstractButton( QGraphicsItem *parent = 0 ); + virtual ~HbAbstractButton(); + + +signals: + void clicked( bool checked = false ); +}; + +#endif // HBABSTRACTBUTTON_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbaction.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbaction.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,43 @@ +/* +* 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: Orbit stubs for Live Comms UI unit tests +* +*/ +#ifndef HBACTION_H +#define HBACTION_H + +#include +#include +#include +#include + + +class HbAction : public QAction +{ +public: + explicit HbAction(QObject *parent = 0); + explicit HbAction(const QString &text, QObject *parent = 0); + explicit HbAction(Hb::NavigationAction action, QObject* parent = 0); + virtual ~HbAction(); + + using QAction::setIcon; + using QAction::icon; + void setIcon(const HbIcon &icon); + HbIcon icon() const; + +private: // Data added for the unit testing stub + HbIcon mIcon; +}; + +#endif // HBACTION_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbdialog.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbdialog.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,73 @@ +/* +* 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: Orbit stubs for Live Comms UI unit tests +* +*/ +#ifndef HBDIALOG_H +#define HBDIALOG_H + +#include +#include + + +class HbAction; + + +class HbDialog : public HbWidget +{ +public: + + enum DefaultTimeout + { + NoTimeout, + ConfirmationNoteTimeout, + StandardTimeout, + ContextMenuTimeout, + }; + + enum DismissPolicy + { + NoDismiss = 0, + TapInside = 1, + TapOutside = 2, + TapAnywhere = TapInside | TapOutside + }; + + explicit HbDialog(QGraphicsItem *parent = 0); + virtual ~HbDialog(); + + int timeout() const; + void setTimeout(int timeout); + void setTimeout(HbDialog::DefaultTimeout timeout); + void setHeadingWidget(QGraphicsWidget *headingWidget); + void setContentWidget(QGraphicsWidget *contentWidget); + Hb::SceneItems unfadedItems() const; + void setUnfadedItems(Hb::SceneItems unfadedItems); + HbDialog::DismissPolicy dismissPolicy() const; + void setDismissPolicy(HbDialog::DismissPolicy dismissPolicy); + enum { Type = Hb::ItemType_Popup }; + +protected: + + QVariant itemChange ( GraphicsItemChange change, const QVariant & value ); + +private: // Data added for the unit testing stub + + Hb::SceneItems mUnfadedItems; + DismissPolicy mDismissPolicy; + int mTimeout; +}; + + +#endif // HBDIALOG_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbdocumentloader.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbdocumentloader.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,61 @@ +/* +* 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: Orbit stubs for Live Comms UI unit tests +* +*/ +#ifndef HBDOCUMENTLOADER_H +#define HBDOCUMENTLOADER_H + +#include +#include +#include + +class QObject; +class QGraphicsWidget; +class HbLabel; +class HbAction; +class HbPushButton; + +class HbDocumentLoader +{ +public: + HbDocumentLoader(); + virtual ~HbDocumentLoader(); + + QObjectList load( const QString &fileName, const QString §ion , bool *ok = 0 ); + QObjectList load( const QString &fileName, bool *ok = 0 ); + QGraphicsWidget *findWidget(const QString &name); + QObject *findObject(const QString &name) const; + bool setObjectTree( QObjectList roots ); + void reset(); + +protected: + virtual QObject *createObject(const QString& type, const QString &name); + +public: // Data added for the unit testing stub + HbLabel* mLabel; + HbAction* mAction; + HbPushButton* mPushButton; + QList mWidgets; + bool mReturnSendVideo; + QString mLayoutSection; + + QList mActions; + + friend class UT_LcView; + friend class UT_LcUiComponentRepository; + +}; + +#endif // HBDOCUMENTLOADER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbeffect.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbeffect.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,60 @@ +/* +* Copyright (c) 2008-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 HBEFFECT_H +#define HBEFFECT_H + +#include +#include +#include + +QT_BEGIN_NAMESPACE +class QGraphicsItem; +class QVariant; +QT_END_NAMESPACE + +class HbEffect +{ + +public: + + struct EffectStatus { + QGraphicsItem *item; + QString effectEvent; + Hb::EffectEvent reason; + QVariant userData; + }; + + static bool start(QGraphicsItem *item, + const QString &itemType, + const QString &effectEvent, + QObject *receiver = 0, + const char *member = 0, + const QVariant &userData = QVariant()); + + static bool add(const QString &itemType, const QString &filePath, const QString &effectEvent = QString() ); + + static bool effectRunning(QGraphicsItem *item, const QString &effectEvent = QString()); + + static bool mRunning; + +private: + HbEffect(); +}; + +#endif // HBEFFECT_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbframedrawer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbframedrawer.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (developer.feedback@nokia.com) +** +** This file is part of the HbCore module of the UI Extensions for Mobile. +** +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at developer.feedback@nokia.com. +** +****************************************************************************/ + +#ifndef HBFRAMEDRAWER_H +#define HBFRAMEDRAWER_H + + +class HbFrameDrawer +{ +public: + + enum FrameType + { + Undefined = 0, + OnePiece, + ThreePiecesHorizontal, + ThreePiecesVertical, + NinePieces + }; + + HbFrameDrawer(const QString &frameGraphicsName, FrameType type, bool cacheFlag = true); + + ~HbFrameDrawer(); + +}; + +#endif // HBFRAMEDRAWER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbgesture.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbgesture.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,74 @@ +/* +* Copyright (c) 2008-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: Defines a gesture that can be added to a gesture filter. +* +*/ + + +#ifndef HB_GESTURE_H +#define HB_GESTURE_H + +#include +#include + +class HbGesture; +class HbGesturePrivate; + +class HbGesture : public QObject +{ + +public: + + /** + * Direction of the gesture. + */ + enum Direction + { + /* empty gesture */ + none=0, + /** Left */ + left= 0x0000001, + /** Right */ + right= 0x0000002, + /** Up */ + up= 0x0000004, + /** Down */ + down= 0x0000008, + /** Pan */ + pan= 0x0000010, + /** Longpress */ + longpress= 0x0000020 + }; + + /* + * Defines that the default minimum pixel distance should be used for the gesture. + * The actual amount of pixels might vary based on the screen resolution. + */ + static const int HbGestureDefaultMinDistance = -1; + +public: + + explicit HbGesture( Direction direction, + int minDistance = HbGestureDefaultMinDistance, + QObject *parent = 0 ); + + virtual ~HbGesture(); + +signals: + + void longPress( QPointF delta ); + +}; + +#endif // HB_GESTURE_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbgesturefilter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbgesturefilter.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,48 @@ +/* +* Copyright (c) 2008-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: Gesture filter for implementing touch gesture actions. +* +*/ + + +#ifndef HB_GESTURE_FILTER_H +#define HB_GESTURE_FILTER_H + +#include + +#include +#include +#include + +class HbGesture; +class HbGestureFilterPrivate; +class HbGestureSceneFilterPrivate; +class HbLongPressVisualizer; + + +class HbGestureSceneFilter : public HbWidget +{ +public: + explicit HbGestureSceneFilter(Qt::MouseButton button = Qt::LeftButton, QGraphicsItem *parent = 0 ); + ~HbGestureSceneFilter(); + void addGesture( HbGesture *gesture ); + + public: + + // Stub stuff + QList gestures; +}; + +#endif // HB_GESTURE_FILTER_H + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbicon.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbicon.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,35 @@ +/* +* 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: Orbit stubs for Live Comms UI unit tests +* +*/ +#ifndef HBICON_H +#define HBICON_H + +#include + + +class HbIcon +{ +public: + HbIcon(const QString &iconName); + ~HbIcon(); + + bool operator==(const HbIcon &other) const; + +private: // Data added for the unit testing stub + QString mName; +}; + +#endif // HBICON_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbinstance.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbinstance.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,50 @@ +/* +* 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: Orbit stubs for Live Comms UI unit tests +* +*/ +#ifndef HBINSTANCE_H +#define HBINSTANCE_H + +#include +#include +#include +#include + +class QGraphicsScene; + +#define hbInstance (HbInstance::instance()) + +class HbInstance +{ +public: + static HbInstance *instance(); + QList allMainWindows() const; + + Qt::Orientation orientation() const; + void setOrientation(Qt::Orientation orientation); + + QGraphicsScene* scene() const; + +private: + HbInstance(); + ~HbInstance(); + +private: // Data added for the unit testing stub + QList mAllMainWindows; + QGraphicsScene* mScene; + Qt::Orientation mOrientation; +}; + +#endif // HBINSTANCE_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hblabel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hblabel.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,44 @@ +/* +* 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: Orbit stubs for Live Comms UI unit tests +* +*/ +#ifndef HBLABEL_H +#define HBLABEL_H + +#include +#include +#include + +class QGraphicsItem; + + +class HbLabel : public HbWidget +{ +public: + explicit HbLabel (QGraphicsItem *parent = 0); + explicit HbLabel (const QString &displayText, QGraphicsItem *parent = 0); + ~HbLabel (); + + virtual void setGeometry(const QRectF &rect); + enum { Type = Hb::ItemType_Label }; + + void setIcon( const HbIcon &icon ); + void clear(); + +public slots: + void setPlainText(const QString &text); +}; + +#endif // HBLABEL_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hblineedit.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hblineedit.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,55 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (developer.feedback@nokia.com) +** +** This file is part of the HbWidgets module of the UI Extensions for Mobile. +** +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at developer.feedback@nokia.com. +** +****************************************************************************/ + +#ifndef HBLINEEDIT_H +#define HBLINEEDIT_H + +#include +#include +#include + +class HbLineEdit : public QObject +{ +public: + explicit HbLineEdit(QGraphicsItem *parent = 0); + explicit HbLineEdit(const QString &text, QGraphicsItem *parent = 0); + virtual ~HbLineEdit(); + void setText(const QString &text); + QString text() const; +private: + QString mText; + +signals: + void editingFinished(); + void textChanged(const QString &text); + void selectionChanged(); + + // signals from the base class + void contentsChanged(); +}; + +//Q_DECLARE_METATYPE(HbLineEdit::EchoMode) + +#endif // HBLINEEDIT_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbmainwindow.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbmainwindow.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,55 @@ +/* +* 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: Orbit stubs for Live Comms UI unit tests +* +*/ + +#ifndef HBMAINWINDOW_H +#define HBMAINWINDOW_H + +#include +#include +#include + +class QGraphicsWidget; +class HbAction; +class HbView; + + +class HbMainWindow : public QGraphicsView +{ +public: + explicit HbMainWindow(QWidget *parent = 0, Hb::WindowFlags windowFlags = Hb::WindowFlagNone); + ~HbMainWindow(); + + HbView *addView(QGraphicsWidget *widget = 0); + QGraphicsWidget *removeView(int index); + void removeView(QGraphicsWidget *widget); + HbView *currentView() const; + void setCurrentView(HbView *view, bool animate = false); + int viewCount() const; + void setOrientation(Qt::Orientation orientation, bool animate = true); + Qt::Orientation orientation() const; + void show(){}; + QList views() const; + QRectF sceneRect() const; + +private: // Data added for the unit testing stub + HbView* mCurrentView; // Not owned + int mViewCount; + Qt::Orientation mOrientation; + QList mTestViews; +}; + +#endif // HBMAINWINDOW_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbmenu.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbmenu.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,44 @@ +/* +* 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: Orbit stubs for Live Comms UI unit tests +* +*/ +#ifndef HBMENU_H +#define HBMENU_H + +#include + + +class HbMenu : public HbDialog +{ +public: + + explicit HbMenu(QGraphicsItem *parent = 0); + ~HbMenu(); + + using HbDialog::addAction; + HbAction *addAction(const QString &text); + + bool isEmpty() const; + + enum { Type = Hb::ItemType_Menu }; + +public slots: + void open(QObject* receiver = 0, const char* member = 0); + +private: // Data added for the unit testing stub + bool mIsEmpty; +}; + +#endif // HBMENU_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbmessagebox.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbmessagebox.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,104 @@ +/* +* 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: Orbit stubs for Live Comms UI unit tests +* +*/ + +#ifndef HBMESSAGEBOX_H +#define HBMESSAGEBOX_H + +#include +#include +#include + +class HbMessageBoxPrivate; +class HbStyleOptionMessageBox; + +class HB_WIDGETS_EXPORT HbMessageBox : public HbDialog +{ + +public: + enum MessageBoxType { + MessageTypeInformation, + MessageTypeQuestion, + MessageTypeWarning + }; + + enum StandardButton { + NoButton = 0x00000000, + Ok = 0x00000400, + Save = 0x00000800, + Open = 0x00001000, + Yes = 0x00002000, + Continue = 0x00004000, + Delete = 0x00008000, + No = 0x00010000, + Retry = 0x00020000, + Close = 0x00040000, + Cancel = 0x00080000, + Help = 0x00100000, + Apply = 0x00200000, + Reset = 0x00400000 + }; + + Q_DECLARE_FLAGS(StandardButtons, StandardButton) + + explicit HbMessageBox(MessageBoxType type=MessageTypeInformation,QGraphicsItem *parent = 0); + explicit HbMessageBox(const QString &text,MessageBoxType type =MessageTypeInformation, QGraphicsItem *parent = 0); + virtual ~HbMessageBox(); + + void setText(const QString &text); + QString text() const; + + void setIcon(const HbIcon &icon); + HbIcon icon() const; + + void setIconAlignment(Qt::Alignment align); + Qt::Alignment iconAlignment() const; + + enum { Type = Hb::ItemType_MessageBox }; + int type() const { return Type; } + + void setStandardButtons(int buttons); + int standardButtons() const; + +public: + static bool launchQuestionMessageBox(const QString &questionText, + const QString &primaryButtonText = tr("Yes"), + const QString &secondaryButtonText = tr("No"), + QGraphicsWidget *headWidget = 0, + QGraphicsScene *scene = 0, + QGraphicsItem *parent = 0 ); + + static void launchInformationMessageBox(const QString &informationText, + QGraphicsWidget *headWidget = 0, + QGraphicsScene *scene = 0, + QGraphicsItem *parent = 0 ); + + static void launchWarningMessageBox(const QString &warningText, + QGraphicsWidget *headWidget = 0, + QGraphicsScene *scene = 0, + QGraphicsItem *parent = 0 ); + +public slots: + void updatePrimitives(); + +protected: + HbMessageBox(HbMessageBoxPrivate &dd, QGraphicsItem *parent); + void initStyleOption(HbStyleOptionMessageBox *option) const; + void keyPressEvent(QKeyEvent *event); +}; + +#endif // HB_MESSAGEBOX_H + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbprogressdialog.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbprogressdialog.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,37 @@ +/* +* 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: Orbit stubs for Live Comms UI unit tests +* +*/ +#ifndef HBPROGRESSDIALOG_H +#define HBPROGRESSDIALOG_H + +#include + +class HbProgressDialog : public HbDialog +{ +public: + + enum ProgressDialogType { ProgressNote,WaitNote }; + explicit HbProgressDialog(QGraphicsItem *parent = 0); + + enum { Type = Hb::ItemType_ProgressDialog }; + + void setText(const QString &text); + +protected: + QVariant itemChange(GraphicsItemChange change, const QVariant& value); +}; + +#endif // HBPROGRESSDIALOG_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbpushbutton.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbpushbutton.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,37 @@ +/* +* Copyright (c) 2008-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: HbPushButton class definition +* +*/ + + +#ifndef HBPUSHBUTTON_H +#define HBPUSHBUTTON_H + +#include +#include + +class HbFrameDrawer; + +class HbPushButton : public HbAbstractButton +{ + +public: + explicit HbPushButton( QGraphicsItem *parent = 0 ); + explicit HbPushButton( const QString &text, QGraphicsItem *parent = 0 ); + virtual ~HbPushButton( ); + void setFrameBackground( HbFrameDrawer *backgroundFrameDrawer ); +}; + +#endif // HBPUSHBUTTON_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbstub_helper.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbstub_helper.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,35 @@ +/* +* 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 HBSTUB_HELPER_H +#define HBSTUB_HELPER_H + +/** +* Helper class to control logsdbconnector stub behavior +* +*/ +class HbStubHelper +{ + public: + static void reset(); + static void setGestureState(int state); + static void setGestureStyleHint(int style); + static bool isTitleBarVisible(); + static bool isStatusBarVisible(); +}; + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbstubs.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbstubs.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,1300 @@ +/* +* 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: +* +*/ + +// Orbit classes +#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 + +// Helper Class +#include "hbstub_helper.h" + +// LC UI +#include "lcuidefs.h" + + + +// Static data that simulates HbInstance and HbMainWindow +static HbInstance* hbInstanceSingleton = 0; + +// Static data for hbeffects +bool HbEffect::mRunning; + +// No Gesture default state. +Qt::GestureState testState = Qt::NoGesture; + +HbTapGesture::TapStyleHint testStyleHint = HbTapGesture::Tap; + +// Title Bar and Status Bar Flags +bool titlebarVisible = true; +bool statusBarVisible = true; + +// ----------------------------------------------------------------------------- +// QCoreApplication::quit +// ----------------------------------------------------------------------------- +// +void QCoreApplication::quit() +{ +} + +// ----------------------------------------------------------------------------- +// QCoreApplication::exit +// ----------------------------------------------------------------------------- +// +void QCoreApplication::exit(int /*retcode*/) +{ +} + + +// HbInstance + +// ----------------------------------------------------------------------------- +// HbInstance::instance +// ----------------------------------------------------------------------------- +// +HbInstance* HbInstance::instance() +{ + if (!hbInstanceSingleton) + hbInstanceSingleton = new HbInstance; + return hbInstanceSingleton; +} + +// ----------------------------------------------------------------------------- +// HbInstance::allMainWindows +// ----------------------------------------------------------------------------- +// +QList HbInstance::allMainWindows() const +{ + return mAllMainWindows; +} + + +// ----------------------------------------------------------------------------- +// HbInstance::HbInstance +// ----------------------------------------------------------------------------- +// +HbInstance::HbInstance() +{ + HbMainWindow *mainWindow = new HbMainWindow; + mAllMainWindows.append(mainWindow); + mScene = new QGraphicsScene; +} + +// ----------------------------------------------------------------------------- +// HbInstance::~HbInstance +// ----------------------------------------------------------------------------- +// +HbInstance::~HbInstance() +{ + mAllMainWindows.clear(); + delete mScene; +} + +// ----------------------------------------------------------------------------- +// HbInstance::HbInstance +// ----------------------------------------------------------------------------- +// +Qt::Orientation HbInstance::orientation() const +{ + return mOrientation; +} + +// ----------------------------------------------------------------------------- +// HbInstance::HbInstance +// ----------------------------------------------------------------------------- +// +void HbInstance::setOrientation(Qt::Orientation orientation) +{ + mOrientation = orientation; +} + +// ----------------------------------------------------------------------------- +// HbInstance::HbInstance +// ----------------------------------------------------------------------------- +// +QGraphicsScene* HbInstance::scene() const +{ + return mScene; +} + +// HbMainWindow + +// ----------------------------------------------------------------------------- +// HbMainWindow::HbMainWindow +// ----------------------------------------------------------------------------- +// +HbMainWindow::HbMainWindow(QWidget *parent,Hb::WindowFlags windowFlags) +: QGraphicsView(parent), mCurrentView(0), mViewCount(0) +{ + Q_UNUSED(windowFlags) +} + +// ----------------------------------------------------------------------------- +// HbMainWindow::~HbMainWindow +// ----------------------------------------------------------------------------- +// +HbMainWindow::~HbMainWindow() +{ +} + +// ----------------------------------------------------------------------------- +// HbMainWindow::addView +// ----------------------------------------------------------------------------- +// +HbView* HbMainWindow::addView(QGraphicsWidget *widget) +{ + Q_UNUSED(widget) + mTestViews.append(static_cast( widget ) ); + return 0; +} + +// ----------------------------------------------------------------------------- +// HbMainWindow::removeView +// ----------------------------------------------------------------------------- +// +QGraphicsWidget* HbMainWindow::removeView(int index) +{ + Q_UNUSED(index) + if ( index >= 0 && index < mTestViews.count() ){ + return mTestViews.takeAt(index); + } + return mCurrentView; +} + +// ----------------------------------------------------------------------------- +// HbMainWindow::removeView +// ----------------------------------------------------------------------------- +// +void HbMainWindow::removeView(QGraphicsWidget *widget) +{ + for(int i = 0; i < mTestViews.count(); i++ ){ + if ( mTestViews.at(i) == widget ){ + mTestViews.takeAt(i); + } + } +} + +// ----------------------------------------------------------------------------- +// HbMainWindow::currentView +// ----------------------------------------------------------------------------- +// +HbView* HbMainWindow::currentView() const +{ + return mCurrentView; +} + +// ----------------------------------------------------------------------------- +// HbMainWindow::setCurrentView +// ----------------------------------------------------------------------------- +// +void HbMainWindow::setCurrentView(HbView *view, bool animate) +{ + mCurrentView = view; + Q_UNUSED(animate) +} + +// ----------------------------------------------------------------------------- +// HbMainWindow::viewCount +// ----------------------------------------------------------------------------- +// +int HbMainWindow::viewCount() const +{ + return mTestViews.count(); +} + +// ----------------------------------------------------------------------------- +// HbMainWindow::viewCount +// ----------------------------------------------------------------------------- +// +void HbMainWindow::setOrientation(Qt::Orientation orientation, bool animate) +{ + Q_UNUSED(animate); + mOrientation = orientation; +} + +// ----------------------------------------------------------------------------- +// HbMainWindow::viewCount +// ----------------------------------------------------------------------------- +// +Qt::Orientation HbMainWindow::orientation() const +{ + return mOrientation; +} + +// ----------------------------------------------------------------------------- +// HbMainWindow::views +// ----------------------------------------------------------------------------- +// +QList HbMainWindow::views() const +{ + return mTestViews; +} + +// ----------------------------------------------------------------------------- +// HbMainWindow::sceneRect +// ----------------------------------------------------------------------------- +// +QRectF HbMainWindow::sceneRect() const +{ + return QRectF( 0, 0, 360, 640 ); +} + +// HbWidget + +// ----------------------------------------------------------------------------- +// HbWidget::HbWidget +// ----------------------------------------------------------------------------- +// +HbWidget::HbWidget(QGraphicsItem *parent, Qt::WindowFlags wFlags) +: QGraphicsWidget(parent,wFlags) +{ + +} + +// ----------------------------------------------------------------------------- +// HbWidget::~HbWidget +// ----------------------------------------------------------------------------- +// +HbWidget::~HbWidget() +{ + +} + +// ----------------------------------------------------------------------------- +// HbWidget::clearActions +// ----------------------------------------------------------------------------- +// +void HbWidget::clearActions() +{ +} + +// ----------------------------------------------------------------------------- +// HbWidget::itemChange +// ----------------------------------------------------------------------------- +// +QVariant HbWidget::itemChange(GraphicsItemChange change, const QVariant& value) +{ + Q_UNUSED(change) + return QVariant(value); +} + +// ----------------------------------------------------------------------------- +// HbWidget::mainWindow +// ----------------------------------------------------------------------------- +// +HbMainWindow* HbWidget::mainWindow() const +{ + +} + +// HbDialog + +// ----------------------------------------------------------------------------- +// HbDialog::HbDialog +// ----------------------------------------------------------------------------- +// +HbDialog::HbDialog(QGraphicsItem *parent) : HbWidget(parent) +{ + resize(10,10); // Just some values for height and width + mDismissPolicy = NoDismiss; + mUnfadedItems = Hb::NoItem; +} + +// ----------------------------------------------------------------------------- +// HbDialog::~HbDialog +// ----------------------------------------------------------------------------- +// +HbDialog::~HbDialog() +{ +} + +// ----------------------------------------------------------------------------- +// HbDialog::timeout +// ----------------------------------------------------------------------------- +// +int HbDialog::timeout() const +{ + return mTimeout; +} + +// ----------------------------------------------------------------------------- +// HbDialog::setTimeout +// ----------------------------------------------------------------------------- +// +void HbDialog::setTimeout(int timeout) +{ + mTimeout = timeout; +} + +// ----------------------------------------------------------------------------- +// HbDialog::setTimeout +// ----------------------------------------------------------------------------- +// +void HbDialog::setTimeout(HbDialog::DefaultTimeout timeout) +{ + // Timeout Values from the current implementation of orbit. + switch (timeout) + { + case HbDialog::NoTimeout: + mTimeout = 0; + break; + case HbDialog::ConfirmationNoteTimeout: + mTimeout = 1500; + break; + case HbDialog::StandardTimeout: + mTimeout = 3000; + break; + case HbDialog::ContextMenuTimeout: + mTimeout = 6000; + break; + } +} + +// ----------------------------------------------------------------------------- +// HbDialog::setHeadingWidget +// ----------------------------------------------------------------------------- +// +void HbDialog::setHeadingWidget(QGraphicsWidget *headingWidget) +{ + Q_UNUSED(headingWidget) +} + +// ----------------------------------------------------------------------------- +// HbDialog::setContentWidget +// ----------------------------------------------------------------------------- +// +void HbDialog::setContentWidget(QGraphicsWidget *contentWidget) +{ + Q_UNUSED(contentWidget) +} + +// ----------------------------------------------------------------------------- +// HbDialog::unfadedItems +// ----------------------------------------------------------------------------- +// +Hb::SceneItems HbDialog::unfadedItems() const +{ + return mUnfadedItems; +} + +// ----------------------------------------------------------------------------- +// HbDialog::setUnfadedItems +// ----------------------------------------------------------------------------- +// +void HbDialog::setUnfadedItems(Hb::SceneItems unfadedItems) +{ + mUnfadedItems = unfadedItems; +} + +// ----------------------------------------------------------------------------- +// HbDialog::dismissPolicy +// ----------------------------------------------------------------------------- +// +HbDialog::DismissPolicy HbDialog::dismissPolicy() const +{ + return mDismissPolicy; +} + +// ----------------------------------------------------------------------------- +// HbDialog::setDismissPolicy +// ----------------------------------------------------------------------------- +// +void HbDialog::setDismissPolicy(HbDialog::DismissPolicy dismissPolicy) +{ + mDismissPolicy = dismissPolicy; +} + +// ----------------------------------------------------------------------------- +// HbDialog::itemChange +// ----------------------------------------------------------------------------- +// +QVariant HbDialog::itemChange(GraphicsItemChange change, const QVariant& value) +{ + Q_UNUSED(change) + return QVariant(value); +} + + +// HbMenu + +// ----------------------------------------------------------------------------- +// HbMenu::HbMenu +// ----------------------------------------------------------------------------- +// +HbMenu::HbMenu(QGraphicsItem *parent) : HbDialog(parent) +{ + mIsEmpty = true; +} + +// ----------------------------------------------------------------------------- +// HbMenu::~HbMenu +// ----------------------------------------------------------------------------- +// +HbMenu::~HbMenu() +{ +} + +// ----------------------------------------------------------------------------- +// HbMenu::open +// ----------------------------------------------------------------------------- +// +void HbMenu::open(QObject* receiver, const char* member) +{ + Q_UNUSED(receiver); + Q_UNUSED(member); +} + +// ----------------------------------------------------------------------------- +// HbMenu::addAction +// ----------------------------------------------------------------------------- +// +HbAction* HbMenu::addAction(const QString &text) +{ + Q_UNUSED(text) + mIsEmpty = false; + return 0; +} + +// ----------------------------------------------------------------------------- +// HbMenu::isEmpty +// ----------------------------------------------------------------------------- +// +bool HbMenu::isEmpty() const +{ + return mIsEmpty; +} + + +// HbAction + +// ----------------------------------------------------------------------------- +// HbAction::HbAction +// ----------------------------------------------------------------------------- +// +HbAction::HbAction(QObject *parent) +: QAction(parent), mIcon(QString()) +{ +} + +// ----------------------------------------------------------------------------- +// HbAction::HbAction +// ----------------------------------------------------------------------------- +// +HbAction::HbAction(const QString &text, QObject *parent) +: QAction(text,parent), mIcon(QString()) +{ +} + +// ----------------------------------------------------------------------------- +// HbAction::~HbAction +// ----------------------------------------------------------------------------- +// +HbAction::~HbAction() +{ +} + +// ----------------------------------------------------------------------------- +// HbAction::setIcon +// ----------------------------------------------------------------------------- +// +void HbAction::setIcon(const HbIcon &icon) +{ + mIcon = icon; +} + +// ----------------------------------------------------------------------------- +// HbAction::icon +// ----------------------------------------------------------------------------- +// +HbIcon HbAction::icon() const +{ + return mIcon; +} + +// ----------------------------------------------------------------------------- +// HbAction::HbAction +// ----------------------------------------------------------------------------- +// +HbAction::HbAction(Hb::NavigationAction action, QObject* parent) + : QAction ( parent ),mIcon(QString()) +{ + Q_UNUSED(action); +} + +// HbLabel + +// ----------------------------------------------------------------------------- +// HbLabel::HbLabel +// ----------------------------------------------------------------------------- +// +HbLabel::HbLabel(QGraphicsItem *parent) : HbWidget(parent) +{ +} + +// ----------------------------------------------------------------------------- +// HbLabel::HbLabel +// ----------------------------------------------------------------------------- +// +HbLabel::HbLabel(const QString &displayText, QGraphicsItem *parent) +: HbWidget(parent) +{ + Q_UNUSED(displayText) +} + +// ----------------------------------------------------------------------------- +// HbLabel::~HbLabel +// ----------------------------------------------------------------------------- +// +HbLabel::~HbLabel() +{ +} + +// ----------------------------------------------------------------------------- +// HbLabel::setGeometry +// ----------------------------------------------------------------------------- +// +void HbLabel::setGeometry(const QRectF &rect) +{ + Q_UNUSED(rect) +} + +// ----------------------------------------------------------------------------- +// HbLabel::clear +// ----------------------------------------------------------------------------- +// +void HbLabel::clear() +{ +} + +// ----------------------------------------------------------------------------- +// HbLabel::setPlainText +// ----------------------------------------------------------------------------- +// +void HbLabel::setPlainText(const QString &text) +{ + Q_UNUSED(text) +} + +// ----------------------------------------------------------------------------- +// HbLabel::setText +// ----------------------------------------------------------------------------- +// +void HbLabel::setIcon(const HbIcon &icon) +{ + Q_UNUSED(icon) +} + + +// HbIcon + +// ----------------------------------------------------------------------------- +// HbIcon::HbIcon +// ----------------------------------------------------------------------------- +// +HbIcon::HbIcon(const QString &iconName) +{ + mName = iconName; +} + +// ----------------------------------------------------------------------------- +// HbIcon::~HbIcon +// ----------------------------------------------------------------------------- +// +HbIcon::~HbIcon() +{ +} + +// ----------------------------------------------------------------------------- +// HbIcon::operator== +// ----------------------------------------------------------------------------- +// +bool HbIcon::operator==(const HbIcon &other) const +{ + return (other.mName == mName); +} + + +// HbProgressDialog + +// ----------------------------------------------------------------------------- +// HbProgressDialog::HbProgressDialog +// ----------------------------------------------------------------------------- +// +HbProgressDialog::HbProgressDialog(QGraphicsItem *parent) : HbDialog(parent) +{ +} + +// ----------------------------------------------------------------------------- +// HbProgressDialog::itemChange +// ----------------------------------------------------------------------------- +// +QVariant HbProgressDialog::itemChange(GraphicsItemChange change, const QVariant& value) +{ + Q_UNUSED(change) + return QVariant(value); +} + +// ----------------------------------------------------------------------------- +// HbProgressDialog::setText +// ----------------------------------------------------------------------------- +// +void HbProgressDialog::setText(const QString &text) +{ + Q_UNUSED(text) +} + +// ----------------------------------------------------------------------------- +// HbToolBar::HbToolBar +// ----------------------------------------------------------------------------- +// +HbToolBar::HbToolBar(QGraphicsItem *parent) : HbWidget(parent) +{ +} + +// ----------------------------------------------------------------------------- +// HbToolBar::~HbToolBar +// ----------------------------------------------------------------------------- +// +HbToolBar::~HbToolBar() +{ +} + + +// HbView + +// ----------------------------------------------------------------------------- +// HbView::HbView +// ----------------------------------------------------------------------------- +// +HbView::HbView(QGraphicsItem *parent) : HbWidget(parent) +{ + mMenu = new HbMenu(this); + mToolBar = new HbToolBar(this); + mDockWidgetVisible = true; +} + +// ----------------------------------------------------------------------------- +// HbView::~HbView +// ----------------------------------------------------------------------------- +// +HbView::~HbView() +{ +} + +// ----------------------------------------------------------------------------- +// HbView::menu +// ----------------------------------------------------------------------------- +// +HbMenu* HbView::menu() const +{ + return mMenu; +} + +// ----------------------------------------------------------------------------- +// HbView::toolBar +// ----------------------------------------------------------------------------- +// +HbToolBar* HbView::toolBar() const +{ + return mToolBar; +} + +// ----------------------------------------------------------------------------- +// HbView::setTitle +// ----------------------------------------------------------------------------- +// +void HbView::setTitle(const QString &title) +{ + Q_UNUSED(title) +} + +// ----------------------------------------------------------------------------- +// HbView::showItems +// ----------------------------------------------------------------------------- +// +void HbView::showItems(Hb::SceneItems items) +{ + if ( items == Hb::DockWidgetItem ) { + mDockWidgetVisible = true; + } +} + +// ----------------------------------------------------------------------------- +// HbView::hideItems +// ----------------------------------------------------------------------------- +// +void HbView::hideItems(Hb::SceneItems items) +{ + if ( items == Hb::DockWidgetItem ) { + mDockWidgetVisible = false; + } +} + + +// ----------------------------------------------------------------------------- +// HbView::isItemVisible +// ----------------------------------------------------------------------------- +// +bool HbView::isItemVisible(Hb::SceneItem items) const +{ + if ( items == Hb::DockWidgetItem ) { + return mDockWidgetVisible; + } + return false; +} + +// ----------------------------------------------------------------------------- +// HbView::setTitleBarVisible +// ----------------------------------------------------------------------------- +// +void HbView::setTitleBarVisible(bool visible) +{ + titlebarVisible = visible; +} + + +// ----------------------------------------------------------------------------- +// HbView::setStatusBarVisible +// ----------------------------------------------------------------------------- +// +void HbView::setStatusBarVisible(bool visible) +{ + statusBarVisible = visible; +} + + +// ----------------------------------------------------------------------------- +// HbView::setContentFullScreen +// ----------------------------------------------------------------------------- +// +void HbView::setContentFullScreen(bool /*enable*/) +{ +} + +// ----------------------------------------------------------------------------- +// HbView::navigationAction +// ----------------------------------------------------------------------------- +// +HbAction *HbView::navigationAction() const +{ + return 0; +} + +// ----------------------------------------------------------------------------- +// HbView::setNavigationAction +// ----------------------------------------------------------------------------- +// +void HbView::setNavigationAction(HbAction *action) +{ + Q_UNUSED(action); +} + +// HbDocumentLoader + +// ----------------------------------------------------------------------------- +// HbDocumentLoader::HbDocumentLoader +// ----------------------------------------------------------------------------- +// +HbDocumentLoader::HbDocumentLoader() +{ + mLabel = new HbLabel; + mAction = new HbAction; + mReturnSendVideo = true; + mPushButton = new HbPushButton(); + +} + +// ----------------------------------------------------------------------------- +// HbDocumentLoader::~HbDocumentLoader +// ----------------------------------------------------------------------------- +// +HbDocumentLoader::~HbDocumentLoader() +{ + delete mAction; + delete mLabel; + delete mPushButton; +} + +// ----------------------------------------------------------------------------- +// HbDocumentLoader::load +// ----------------------------------------------------------------------------- +// +QObjectList HbDocumentLoader::load( const QString &fileName, + const QString §ion , bool *ok ) +{ + Q_UNUSED(fileName) + if ( section == lcLayoutLandscapeDefaultId || + section == lcLayoutLandscapeSwappedId || + section == lcLayoutFullscreenId || + section == lcLayoutLandscapeDialpadId ) { + mLayoutSection = section; + *ok = true; + } else { + *ok = false; + } + return QObjectList(); +} + +// ----------------------------------------------------------------------------- +// HbDocumentLoader::load +// ----------------------------------------------------------------------------- +// +QObjectList HbDocumentLoader::load(const QString &fileName, bool *ok) +{ + *ok = true; + Q_UNUSED(fileName) + return QObjectList(); +} + +// ----------------------------------------------------------------------------- +// HbDocumentLoader::findWidget +// ----------------------------------------------------------------------------- +// +QGraphicsWidget* HbDocumentLoader::findWidget(const QString &name) +{ + if ( !mReturnSendVideo && name == lcWidgetSendVideoId ) { + return 0; + } + foreach(QGraphicsWidget* widget, mWidgets) { + if (widget->objectName() == name) + return widget; + } + if (name == lcLabelRecipientId || + name == lcLabelDurationId || + name == lcIconContactId || + name == lcWidgetSendVideoId2 || + name == lcWidgetRecvVideoId2 ) { + return mLabel; + } + QString dummy = ""; + QGraphicsWidget* createdWidget = + static_cast(createObject(dummy,name)); + if (createdWidget) { + createdWidget->setPos(QPointF(10,20)); + mWidgets.append(createdWidget); + } + return createdWidget; +} + +// ----------------------------------------------------------------------------- +// HbDocumentLoader::findObject +// ----------------------------------------------------------------------------- +// +QObject* HbDocumentLoader::findObject(const QString &name) const +{ + if (name == lcActMuteId || + name == lcActSpeakerId ) { + return mAction; + } + if( name == lcButtonEndCall ){ + return mPushButton; + } + foreach(HbAction* action, mActions) { + if (action->objectName() == name) + return action; + } + + return 0; +} + +// ----------------------------------------------------------------------------- +// HbDocumentLoader::setObjectTree +// ----------------------------------------------------------------------------- +// +bool HbDocumentLoader::setObjectTree( QObjectList roots ) +{ + Q_UNUSED(roots) + return true; +} + +// ----------------------------------------------------------------------------- +// HbDocumentLoader::reset +// ----------------------------------------------------------------------------- +// +void HbDocumentLoader::reset() +{ +} + +// ----------------------------------------------------------------------------- +// HbDocumentLoader::createObject +// ----------------------------------------------------------------------------- +// +QObject* HbDocumentLoader::createObject( + const QString& type, + const QString& name) +{ + Q_UNUSED(type) + Q_UNUSED(name) + return 0; +} + + +// HbTransparentWindow + +// ----------------------------------------------------------------------------- +// HbTransparentWindow::HbTransparentWindow +// ----------------------------------------------------------------------------- +// +HbTransparentWindow::HbTransparentWindow(QGraphicsItem *parent) +{ + Q_UNUSED(parent) +} + +// ----------------------------------------------------------------------------- +// HbTransparentWindow::~HbTransparentWindow +// ----------------------------------------------------------------------------- +// +HbTransparentWindow::~HbTransparentWindow() +{ +} + +// ----------------------------------------------------------------------------- +// HbGesture::HbGesture +// ----------------------------------------------------------------------------- +// +HbGesture::HbGesture( Direction direction, int minDistance, QObject *parent ) + : QObject(parent) +{ + Q_UNUSED(direction) + Q_UNUSED(minDistance) +} + +// ----------------------------------------------------------------------------- +// HbGesture::~HbGesture +// ----------------------------------------------------------------------------- +// +HbGesture::~HbGesture() +{ +} + +// ----------------------------------------------------------------------------- +// HbGesturSeceneFilter::HbGestureSceneFilter +// ----------------------------------------------------------------------------- +// +HbGestureSceneFilter::HbGestureSceneFilter( Qt::MouseButton button, QGraphicsItem *parent ) + : HbWidget(parent) +{ + Q_UNUSED(button) +} + +// ----------------------------------------------------------------------------- +// HbGestureSceneFilter::~HbGestureSceneFilter +// ----------------------------------------------------------------------------- +// +HbGestureSceneFilter::~HbGestureSceneFilter() +{ + qDeleteAll(gestures); + gestures.clear(); +} + +// ----------------------------------------------------------------------------- +// HbGestureSceneFilter::addGesture +// ----------------------------------------------------------------------------- +// +void HbGestureSceneFilter::addGesture( HbGesture *gesture ) +{ + gestures.append(gesture); +} + + +// ----------------------------------------------------------------------------- +// HbEffect::HbEffect +// ----------------------------------------------------------------------------- +// +HbEffect::HbEffect( ) +{ + mRunning = false; +} + +// ----------------------------------------------------------------------------- +// HbEffect::start +// ----------------------------------------------------------------------------- +// +bool HbEffect::start( QGraphicsItem *item, + const QString &itemType, + const QString &effectEvent, + QObject *receiver, + const char *member, + const QVariant &userData ) +{ + Q_UNUSED(item) + Q_UNUSED(itemType) + Q_UNUSED(effectEvent) + Q_UNUSED(receiver) + Q_UNUSED(member) + Q_UNUSED(userData) + return true; +} + +// ----------------------------------------------------------------------------- +// HbEffect::add +// ----------------------------------------------------------------------------- +// +bool HbEffect::add( const QString &itemType, const QString &filePath, const QString &effectEvent ) +{ + Q_UNUSED(itemType) + Q_UNUSED(filePath) + Q_UNUSED(effectEvent) + return true; +} + +// ----------------------------------------------------------------------------- +// HbEffect::effectRunning +// ----------------------------------------------------------------------------- +// +bool HbEffect::effectRunning(QGraphicsItem *item, const QString &effectEvent ) +{ + Q_UNUSED(item) + Q_UNUSED(effectEvent) + return mRunning; +} + + +// ----------------------------------------------------------------------------- +// HbPushButton::HbPushButton +// ----------------------------------------------------------------------------- +// +HbPushButton::HbPushButton(QGraphicsItem *parent) : HbAbstractButton(parent) +{ +} + + +// ----------------------------------------------------------------------------- +// HbPushButton::HbPushButton +// ----------------------------------------------------------------------------- +// +HbPushButton::HbPushButton(const QString &text, QGraphicsItem *parent) + : HbAbstractButton(parent) +{ + Q_UNUSED(text) +} + + + +// ----------------------------------------------------------------------------- +// HbPushButton::~HbPushButton +// ----------------------------------------------------------------------------- +// +HbPushButton::~HbPushButton() +{ +} + +// ----------------------------------------------------------------------------- +// HbPushButton::setFrameBackground +// ----------------------------------------------------------------------------- +// +void HbPushButton::setFrameBackground( HbFrameDrawer *backgroundFrameDrawer ) +{ + delete backgroundFrameDrawer; +} + +// ----------------------------------------------------------------------------- +// HbAbstractButton::HbAbstractButton +// ----------------------------------------------------------------------------- +// +HbAbstractButton::HbAbstractButton(QGraphicsItem *parent) : HbWidget(parent) +{ +} + +// ----------------------------------------------------------------------------- +// HbAbstractButton::~HbAbstractButton +// ----------------------------------------------------------------------------- +// +HbAbstractButton::~HbAbstractButton() +{ +} + +// ----------------------------------------------------------------------------- +// HbFrameDrawer::HbFrameDrawer +// ----------------------------------------------------------------------------- +// +HbFrameDrawer::HbFrameDrawer(const QString &frameGraphicsName, FrameType type, bool cacheFlag) +{ + Q_UNUSED(frameGraphicsName); + Q_UNUSED(type); + Q_UNUSED(cacheFlag); +} + +// ----------------------------------------------------------------------------- +// HbFrameDrawer::~HbFrameDrawer +// ----------------------------------------------------------------------------- +// +HbFrameDrawer::~HbFrameDrawer() +{ + +} + +// ----------------------------------------------------------------------------- +// HbLineEdit::HbLineEdit +// ----------------------------------------------------------------------------- +// +HbLineEdit::HbLineEdit(QGraphicsItem *parent) +{ + Q_UNUSED(parent); +} + +// ----------------------------------------------------------------------------- +// HbLineEdit::HbLineEdit +// ----------------------------------------------------------------------------- +// +HbLineEdit::HbLineEdit(const QString &text, QGraphicsItem *parent) +{ + Q_UNUSED(parent); + mText = text; +} + +// ----------------------------------------------------------------------------- +// HbLineEdit::~HbLineEdit +// ----------------------------------------------------------------------------- +// +HbLineEdit::~HbLineEdit() +{ + +} + +// ----------------------------------------------------------------------------- +// HbLineEdit::setText +// ----------------------------------------------------------------------------- +// +void HbLineEdit::setText(const QString &text) +{ + mText = text; +} + +// ----------------------------------------------------------------------------- +// HbLineEdit::text +// ----------------------------------------------------------------------------- +// +QString HbLineEdit::text() const +{ + return mText; +} + +// ----------------------------------------------------------------------------- +// QGesture +// ----------------------------------------------------------------------------- +// + +Qt::GestureState QGesture::state() const +{ + return testState; +} + + +// ----------------------------------------------------------------------------- +// HbTapGesture::HbTapGesture +// ----------------------------------------------------------------------------- +// + +HbTapGesture::HbTapGesture(QObject *paren) +{ + Q_UNUSED(paren); +} + + +// ----------------------------------------------------------------------------- +// HbTapGesture::~HbTapGesture +// ----------------------------------------------------------------------------- +// + +HbTapGesture::~HbTapGesture() +{ +} + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +HbTapGesture::TapStyleHint HbTapGesture::tapStyleHint() const +{ + return testStyleHint; +} + +// ----------------------------------------------------------------------------- +// HbMessageBox::setStandardButtons +// ----------------------------------------------------------------------------- +// +void HbMessageBox::setStandardButtons(int buttons) +{ + Q_UNUSED(buttons); +} + +// ----------------------------------------------------------------------------- +// HbMessageBox::standardButtons +// ----------------------------------------------------------------------------- +// +int HbMessageBox::standardButtons() const +{ + return HbMessageBox::NoButton; +} + +// ----------------------------------------------------------------------------- +// Stub Helper +// ----------------------------------------------------------------------------- +// +void HbStubHelper::setGestureState(int state) +{ + testState = static_cast (state); +} + + +void HbStubHelper::setGestureStyleHint(int style) +{ + testStyleHint = static_cast (style); +} + +void HbStubHelper::reset() +{ + testState = Qt::NoGesture; +} + +bool HbStubHelper::isTitleBarVisible() +{ + return titlebarVisible; +} + +bool HbStubHelper::isStatusBarVisible() +{ + return statusBarVisible; +} + + +// end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbtapgesture.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbtapgesture.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,48 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (developer.feedback@nokia.com) +** +** This file is part of the HbCore module of the UI Extensions for Mobile. +** +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at developer.feedback@nokia.com. +** +****************************************************************************/ +#ifndef HBTAPGESTURE_H +#define HBTAPGESTURE_H + +#include +#include + + +class HbTapGesture : public QTapGesture +{ + Q_OBJECT + +public: + enum TapStyleHint { + Tap, + TapAndHold + }; + + explicit HbTapGesture(QObject *parent = 0); + virtual ~HbTapGesture(); + + TapStyleHint tapStyleHint() const; +}; + +#endif // HBTAPGESTURE_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbtoolbar.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbtoolbar.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,34 @@ +/* +* 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: Orbit stubs for Live Comms UI unit tests +* +*/ +#ifndef HBTOOLBAR_H +#define HBTOOLBAR_H + +#include +#include +#include + + +class HbToolBar : public HbWidget +{ +public: + explicit HbToolBar(QGraphicsItem *parent = 0); + virtual ~HbToolBar(); + + enum { Type = Hb::ItemType_ToolBar }; +}; + +#endif // HBTOOLBAR_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbtransparentwindow.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbtransparentwindow.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,34 @@ +/* +* 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: Orbit stubs for Live Comms UI unit tests +* +*/ +#ifndef HBTRANSPARENTWINDOW_H +#define HBTRANSPARENTWINDOW_H + +#include +#include + + +class HbTransparentWindow : public HbWidget +{ +public: + + explicit HbTransparentWindow(QGraphicsItem *parent = 0); + ~HbTransparentWindow(); + + enum { Type = Hb::ItemType_TransparentWindow }; +}; + +#endif // HBTRANSPARENTWINDOW_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbview.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,59 @@ +/* +* 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: Orbit stubs for Live Comms UI unit tests +* +*/ +#ifndef HBVIEW_H +#define HBVIEW_H + +#include +#include +#include + +class HbMenu; +class HbToolBar; +class HbAction; + +class HbView : public HbWidget +{ +public: + explicit HbView(QGraphicsItem *parent = 0); + virtual ~HbView(); + + HbMenu *menu() const; + HbToolBar *toolBar() const; + + void showItems(Hb::SceneItems items); + void hideItems(Hb::SceneItems items); + bool isItemVisible(Hb::SceneItem item) const; + void setTitleBarVisible(bool visible); + void setStatusBarVisible(bool visible); + + void setContentFullScreen(bool enable = true); + HbAction *navigationAction() const; + void setNavigationAction(HbAction *action); + +signals: + void contentFullScreenChanged(); + +public slots: + void setTitle(const QString &title); + +private: // Data added for the unit testing stub + HbMenu* mMenu; + HbToolBar* mToolBar; + bool mDockWidgetVisible; +}; + +#endif // HBVIEW_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbwidget.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/hbstubs/hbwidget.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,45 @@ +/* +* 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: Orbit stubs for Live Comms UI unit tests +* +*/ + +#ifndef HBWIDGET_H +#define HBWIDGET_H + +#include +#include +#include +#include + +class HbEvent; + + +class HbWidget : public QGraphicsWidget +{ +public: + explicit HbWidget( QGraphicsItem *parent=0, Qt::WindowFlags wFlags=0 ); + virtual ~HbWidget(); + void clearActions(); + HbMainWindow *mainWindow() const; + +protected: + QVariant itemChange ( GraphicsItemChange change, const QVariant & value ); + +protected: + /* unit test storage */ + HbMainWindow* mMainWindow; +}; + +#endif // HBWIDGET_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ut_lcui/inc/ut_lceffecthandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/inc/ut_lceffecthandler.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,84 @@ +/* +* 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_LCEFFECTHANDLER_H +#define UT_LCEFFECTHANDLER_H + +#include + +class LcEffectHandler; +class LcUiEngine; +class LcVideoWidget; +class HbMainWindow; + +class UT_LcEffectHandler : 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 testConstructor(); + void testSwap(); + void testShowSendWindow(); + void testHideSendWindow(); + void testShowReceiveWindow(); + void testHideReceiveWindow(); + void testEffectComplete(); + void testStartEffect(); + + void testSetVisibility(); + void testSetDissappearEffect(); + void testIsSharedVideoAtTop(); + void testVideosSideBySide(); + void testHandleSwapCompletion(); + void testIsSwapInProgress(); + +private: // Helpers + void clearWidgets(); + void setWidgets(); +private: + + HbMainWindow* mMainWindow; + LcUiEngine* mEngine; + LcEffectHandler* mEffectHandler; + LcVideoWidget* mSharedVideo; + LcVideoWidget* mSharedVideoOverlay; + LcVideoWidget* mReceivedVideo; + LcVideoWidget* mReceivedVideoOverlay; +}; + + +#endif //UT_LCEFFECTHANDLER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ut_lcui/inc/ut_lcuicomponentrepository.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/inc/ut_lcuicomponentrepository.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,77 @@ +/* +* 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_LCUICOMPONENTREPOSITORY_H +#define UT_LCUICOMPONENTREPOSITORY_H + +#include + +class LcUiEngine; +class LcUiComponentRepository; +class HbMainWindow; + + +class UT_LcUiComponentRepository : 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 testConstructor(); + void testIdleView(); + void testReceiveView(); + void testTwowayView(); + void testSendView(); + void testAllInOneView(); + void testReceiveOnlyView(); + void testAcceptQuery(); + void testInvitingNote(); + void testWaitingNote(); + void testRecipientQuery(); + void testShareOwnVideoQuery(); + void testSharedVideoContextMenu(); + void testLoadView_FileNotFound(); + void testConnect(); + void testLoadLayout(); + +private: + + LcUiEngine* mEngine; + LcUiComponentRepository* mRepository; +}; + + +#endif //UT_LCUICOMPONENTREPOSITORY_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ut_lcui/inc/ut_lcuidefs.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/inc/ut_lcuidefs.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,73 @@ +/* +* 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_LCUIDEFS_H_ +#define UT_LCUIDEFS_H_ + +#include + +class HbView; + +const char lcutNoCall[] = "NOCALL"; +const char lcutStub_LcUiEngine_start[] = "LcUiEngine::start"; +const char lcutStub_LcUiEngine_setOrientation[] = "LcUiEngine::setOrientation"; +const char lcutStub_LcUiEngine_setContentAreas[] = "LcUiEngine::setContentAreas"; +const char lcutStub_LcUiEngine_mute[] = "LcUiEngine::mute"; +const char lcutStub_LcUiEngine_zoom[] = "LcUiEngine::zoom"; +const char lcutStub_LcUiEngine_enableCamera[] = "LcUiEngine::enableCamera"; +const char lcutStub_LcUiEngine_disableCamera[] = "LcUiEngine::disableCamera"; +const char lcutStub_LcUiEngine_toggleCamera[] = "LcUiEngine::toggleCamera"; +const char lcutStub_LcUiEngine_speaker[] = "LcUiEngine::speaker"; +const char lcutStub_LcUiEngine_stop[] = "LcUiEngine::stop"; +const char lcutStub_LcUiEngine_updateSession[] = "LcUiEngine::updateSession"; + + +const char lcEngineName[] = "engineName"; +const char lcDisplayName[] = "displayName"; + +static QStringList* lcutStub_LcUiEngine_calledMethods = 0; +static int lcutStub_LcUiEngine_failure = 0; +static int lcutStub_LcUiEngine_layout = -1; + +static bool lcutStub_LcUiEngine_cameraMain = false; +static bool lcutStub_LcUiEngine_muted = false; +static bool lcutStub_LcUiEngine_speakerOn = false; +static bool lcutStub_LcUiEngine_localplaying = true; +static bool lcutStub_LcUiEngine_remoteplaying = true; +static bool lcutStub_LcUiEngine_windowState_minimized = false; +static bool lcutStub_LcUiEngine_isImageShared = false; + +extern QStringList& lcutStub_LcUiEngine_calledMethodsInstance(); +extern bool lcutStub_LcUiEngine_expectCall( const QString& call, int callNdx = 0); +extern void lcutStub_LcUiEngine_reset(); +extern void lcutStub_LcUiEngine_setFailure( int failure ); +extern void lcutStub_LcUiEngine_setLayout( int layout ); +extern void lcutStub_LcUiEngine_setCameraMain( bool val ); +extern void lcutStub_LcUiEngine_setMuted( bool val ); +extern void lcutStub_LcUiEngine_setSpeaker( bool val ); +extern void lcutStub_LcUiEngine_setLocalPlaying( bool val ); +extern void lcutStub_LcUiEngine_setRemotePlaying( bool val ); +extern HbView* lcutStub_LcUiEngine_getCurrentView(); +extern QChar lcutStub_LcUiEngine_getDialToneChar(); + +// End of file + + + + +#endif /* UT_LCUIDEFS_H_ */ diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ut_lcui/inc/ut_lcvideowidget.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/inc/ut_lcvideowidget.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,61 @@ +/* +* 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_LCVIDEOWIDGET_H +#define UT_LCVIDEOWIDGET_H + +#include + +class LcVideoWidget; + +class UT_LcVideoWidget : 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 testConstructor(); + void testSetShowVideo(); + void testPaint(); + +private: + + LcVideoWidget* mVideoWidget; + LcVideoWidget* mVideoWidget2; +}; + + +#endif //UT_LCVIDEOWIDGET_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ut_lcui/inc/ut_lcview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/inc/ut_lcview.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,115 @@ +/* +* 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_LCVIEW_H +#define UT_LCVIEW_H + +#include + +class LcView; +class LcUiEngine; +class HbLabel; +class LcUiComponentRepository; +class HbAction; +class HbPushButton; +class HbMainWindow; + +class UT_LcView : 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 testConstructor(); + void testActivated(); + void testInit(); + void testDeactivated(); + void testEndVideoSession(); + void testMute(); + void testChangeCamera(); + void testSwitchToVoiceCall(); + void testDisableCameraWhenOnFullScreenMode(); + void testDisableCameraWhenNotOnFullScreenMode(); + void testSpeaker(); + void testSwap(); + void testNotSupported(); + void testSetCameraActionToMain(); + void testSetCameraActionToSecondary(); + void testSetMuteActionToUnmute(); + void testSetMuteActionToMute(); + void testSetSpeakerActionToHandset(); + void testSetSpeakerActionToSpeaker(); + void testSetCameraActionToEnable(); + void testSetCameraActionToDisable(); + void testDisableControls(); + void testEnableControls(); + void testUpdateVideoRects(); + void testCurrentLayout(); + void testGestureEvent(); + void testContextMenu(); + void testGestureLongPress(); + void testGestureShortPress(); + void testShareImage(); + void testUpdateSwapLayout(); + void testMenuAboutToShow(); + void testTranslateRectForOrientation(); + void testTranslatePointForOrientation(); + void testOpenDialpad(); + void testDialpadOpened(); + void testDialpadClosed(); + void testDialpadEditorTextChanged(); + void testBack(); + void testAddOptionsMenuActions(); + void testToFullScreen(); + void testWatchInactivity(); + void testTimerEvent(); + void testIsVideoPositionedCorrectly(); + void testIsPositioned(); + +private: + + HbMainWindow* mMainWindow; + LcView* mView; + LcUiEngine* mEngine; + HbLabel* mRecipient; + LcUiComponentRepository* mRepository; + HbAction* mAction; + HbAction* mAction2; + HbPushButton* mEndCallButton; +}; + + +#endif //UT_LCVIEW_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ut_lcui/inc/ut_lcviewmanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/inc/ut_lcviewmanager.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,65 @@ +/* +* 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_LCVIEWMANAGER_H +#define UT_LCVIEWMANAGER_H + +#include +class LcViewManager; +class HbMainWindow; +class LcViewManagerPrivate; + +class UT_LcUiViewManager : 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 testConstructor(); + void testChangeView(); + void testTerminateSession(); + void testPrepareOrientationChange(); + void testMainWindowEvent(); + +private: + + LcViewManager* mViewManagerDecorator; + LcViewManagerPrivate* mViewManager; + +}; + + +#endif //UT_LCVIEWMANAGER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ut_lcui/lcuiengine_stub/symbian/stub_lcuiengine_p.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/lcuiengine_stub/symbian/stub_lcuiengine_p.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,400 @@ +/* +* 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 "lcuiengine_p.h" +#include "ut_lcuidefs.h" +#include "lcuidefs.h" +#include + +HbView* lcutStub_LcUiEngine_currentView = 0; +QChar lcStub_LcUiEngine_dialtone('0'); + +LcUiEnginePrivate::LcUiEnginePrivate( LcUiEngine& uiEngine, + const QString &engineName, + const QString &applicationDisplayName ) + : mUiEngine ( uiEngine ), + mEngineName( engineName.toUtf8() ), + mSessionTitle( applicationDisplayName ) + +{ + mViewLayout = Lc_NoViewLayout; + mLiveCommsEngine = 0; + mCloseTimer = 0; + mInvitingNote = 0; + mWaitingNote = 0; + mAcceptQuery = 0; + mRecipientQuery = 0; + mFullScreen = false; +} + +LcUiEnginePrivate::~LcUiEnginePrivate() +{ +} + +void LcUiEnginePrivate::start() +{ + lcutStub_LcUiEngine_calledMethodsInstance().insert(0,lcutStub_LcUiEngine_start ); +} + +void LcUiEnginePrivate::setContentAreas( const QRectF& /*sharedContent*/, + const QRectF& /*receivedContent*/ ) +{ + lcutStub_LcUiEngine_calledMethodsInstance().insert(0,lcutStub_LcUiEngine_setContentAreas ); + +} + +bool LcUiEnginePrivate::setOrientation( Qt::Orientation /*orientation*/ ) +{ + lcutStub_LcUiEngine_calledMethodsInstance().insert(0,lcutStub_LcUiEngine_setOrientation ); + return true; +} + +void LcUiEnginePrivate::zoom( int /*value*/ ) +{ + lcutStub_LcUiEngine_calledMethodsInstance().insert(0,lcutStub_LcUiEngine_zoom ); + +} + +void LcUiEnginePrivate::stop() +{ + lcutStub_LcUiEngine_calledMethodsInstance().insert(0,lcutStub_LcUiEngine_stop ); + +} + +void LcUiEnginePrivate::updateSession() +{ + lcutStub_LcUiEngine_calledMethodsInstance().insert(0,lcutStub_LcUiEngine_updateSession ); + +} + +bool LcUiEnginePrivate::isLocalPlayerPlaying() const +{ + return lcutStub_LcUiEngine_localplaying; +} + +bool LcUiEnginePrivate::isRemotePlayerPlaying() const +{ + return lcutStub_LcUiEngine_remoteplaying; +} + +const QString& LcUiEnginePrivate::sessionTitle() const +{ + return mSessionTitle; +} +const QString& LcUiEnginePrivate::recipient() const +{ + return mRecipient; +} + +const QString& LcUiEnginePrivate::phoneNumber() const +{ + return mPhoneNumber; +} + +LcViewLayoutHint LcUiEnginePrivate::viewLayout() const +{ + return (LcViewLayoutHint)lcutStub_LcUiEngine_layout; +} + +void LcUiEnginePrivate::setUiComponents(HbProgressDialog* invitingNote, + HbProgressDialog* waitingNote, + HbDialog* acceptQuery, + HbDialog* recipientQuery, + HbDialog* sharedVideoQuery) +{ + mInvitingNote = invitingNote; + mWaitingNote = waitingNote; + mAcceptQuery = acceptQuery; + mRecipientQuery = recipientQuery; + mShareOwnVideoQuery = sharedVideoQuery; + +} + +void LcUiEnginePrivate::startReceiving() +{ + +} + +void LcUiEnginePrivate::stopForcefully() +{ + +} + +void LcUiEnginePrivate::emitViewLayoutChanged() +{ + +} + +bool LcUiEnginePrivate::usingVideoTelephoneEngine() +{ + return mEngineName == "Videotelephony"; +} + +void LcUiEnginePrivate::setMainCamera(const bool aMainCamera) +{ + mMainCamera = aMainCamera; +} + +bool LcUiEnginePrivate::mainCamera() const +{ + return mMainCamera; +} + +bool LcUiEnginePrivate::isMuted() const +{ + return lcutStub_LcUiEngine_muted; +} + +bool LcUiEnginePrivate::isSpeakerOn() const +{ + return lcutStub_LcUiEngine_speakerOn; +} + +void LcUiEnginePrivate::toggleMute() +{ + lcutStub_LcUiEngine_muted = !lcutStub_LcUiEngine_muted; + lcutStub_LcUiEngine_calledMethodsInstance().insert(0,lcutStub_LcUiEngine_mute ); +} + +void LcUiEnginePrivate::toggleCamera() +{ + lcutStub_LcUiEngine_cameraMain = !lcutStub_LcUiEngine_cameraMain; + lcutStub_LcUiEngine_calledMethodsInstance().insert(0,lcutStub_LcUiEngine_toggleCamera ); +} + +void LcUiEnginePrivate::toggleDisableCamera() +{ + lcutStub_LcUiEngine_calledMethodsInstance().insert(0,lcutStub_LcUiEngine_disableCamera ); +} + +void LcUiEnginePrivate::toggleSpeaker() +{ + lcutStub_LcUiEngine_speakerOn = !lcutStub_LcUiEngine_speakerOn; + lcutStub_LcUiEngine_calledMethodsInstance().insert(0,lcutStub_LcUiEngine_speaker ); +} + +int LcUiEnginePrivate::zoomValues( LcControlValues& values ) const +{ + values.mMaxValue = 3; + values.mMinValue = 1; + values.mValue = 2; + return 0; +} + +void LcUiEnginePrivate::timerEvent(QTimerEvent */*event*/) +{ +} + +void LcUiEnginePrivate::StateChanged( MLcSession& /*aSession*/ ) +{ + +} + +void LcUiEnginePrivate::StateChanged( MLcVideoPlayer& /*aPlayer*/ ) +{ + +} + +void LcUiEnginePrivate::Updated( MLcSession& /*aSession*/ ) +{ + +} + +void LcUiEnginePrivate::Updated( MLcVideoPlayer& /*aPlayer*/ ) +{ + +} + + +void LcUiEnginePrivate::Failed( MLcSession& /*aSession*/, TInt /*aError*/ ) +{ + +} + +void LcUiEnginePrivate::Failed( MLcVideoPlayer& /*aPlayer*/, TInt /*aError*/ ) +{ + +} + +void LcUiEnginePrivate::SessionTimeChanged( MLcSession& /*aSession*/, + const TTimeIntervalSeconds& /*aSeconds*/ ) +{ + +} + +TBool LcUiEnginePrivate::SelectRecipient( MDesCArray& /*aRecipientAddresses*/, + TDes& /*aSelectedRecipientAddress*/ ) +{ + return true; +} + +TBool LcUiEnginePrivate::InputRecipient( TDes& /*aRecipientAddress*/ ) +{ + return true; + +} + +void LcUiEnginePrivate::HandleForegroundStatus( TBool /*aForeground*/ ) +{ + +} + +void LcUiEnginePrivate::BlockUi( TBool /*aBlocked*/ ) +{ + +} + + +bool LcUiEnginePrivate::fullScreenMode() +{ + return mFullScreen; +} + + +void LcUiEnginePrivate::setFullScreenMode(bool aMode) +{ + mFullScreen = aMode; +} + +bool LcUiEnginePrivate::isMinimized()const +{ + return lcutStub_LcUiEngine_windowState_minimized; +} + +void LcUiEnginePrivate::minimize() +{ + lcutStub_LcUiEngine_windowState_minimized = true; +} + +void LcUiEnginePrivate::maximize() +{ + lcutStub_LcUiEngine_windowState_minimized = false; +} + +void LcUiEnginePrivate::setCurrentView(HbView* view) +{ + lcutStub_LcUiEngine_currentView = view; +} + +void LcUiEnginePrivate::handleEngineForegroundStatus() +{ +} + +bool LcUiEnginePrivate::SendDialTone(const QChar aKey ) +{ + lcStub_LcUiEngine_dialtone = aKey; + return true; +} + +//stub control + +bool lcutStub_LcUiEngine_expectCall( const QString& call, int callNdx ) +{ + if ( callNdx >= lcutStub_LcUiEngine_calledMethodsInstance().count() ) { + return call == lcutNoCall; + } + return lcutStub_LcUiEngine_calledMethodsInstance().count() > 0 ? + lcutStub_LcUiEngine_calledMethodsInstance()[callNdx] == call : + call == lcutNoCall; +} + + +void lcutStub_LcUiEngine_reset() +{ + delete lcutStub_LcUiEngine_calledMethods; + lcutStub_LcUiEngine_calledMethods = 0; + lcutStub_LcUiEngine_failure = 0; + lcutStub_LcUiEngine_layout = -1; + lcutStub_LcUiEngine_cameraMain = false; + lcutStub_LcUiEngine_muted = false; + lcutStub_LcUiEngine_speakerOn = false; + lcutStub_LcUiEngine_localplaying = true; + lcutStub_LcUiEngine_remoteplaying = true; + lcutStub_LcUiEngine_currentView = 0; + lcStub_LcUiEngine_dialtone = '0'; +} + +void lcutStub_LcUiEngine_setFailure( int failure ) +{ + lcutStub_LcUiEngine_failure = failure; +} + +void lcutStub_LcUiEngine_setLayout( int layout ) +{ + lcutStub_LcUiEngine_layout = layout; +} + +QStringList& lcutStub_LcUiEngine_calledMethodsInstance() +{ + if ( !lcutStub_LcUiEngine_calledMethods ) { + lcutStub_LcUiEngine_calledMethods = new QStringList(); + } + return *lcutStub_LcUiEngine_calledMethods; +} + +void lcutStub_LcUiEngine_setCameraMain( bool val ) +{ + lcutStub_LcUiEngine_cameraMain = val; +} + +void lcutStub_LcUiEngine_setMuted( bool val ) +{ + lcutStub_LcUiEngine_layout = val; +} + +void lcutStub_LcUiEngine_setSpeaker( bool val ) +{ + lcutStub_LcUiEngine_speakerOn = val; +} + +void lcutStub_LcUiEngine_setLocalPlaying( bool val ) +{ + lcutStub_LcUiEngine_localplaying = val; +} + +void lcutStub_LcUiEngine_setRemotePlaying( bool val ) +{ + lcutStub_LcUiEngine_remoteplaying = val; +} + +HbView* lcutStub_LcUiEngine_getCurrentView() +{ + return lcutStub_LcUiEngine_currentView; +} + + +QChar lcutStub_LcUiEngine_getDialToneChar() +{ + return lcStub_LcUiEngine_dialtone; +} + + +void LcUiEnginePrivate::stopLocalVideo() +{ + lcutStub_LcUiEngine_localplaying = false; +} + +void LcUiEnginePrivate::startLocalVideo() +{ + lcutStub_LcUiEngine_localplaying = true; +} + +// End of file + + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ut_lcui/lcuiengine_stub/win32/stub_lcuiengine_p.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/lcuiengine_stub/win32/stub_lcuiengine_p.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,279 @@ +/* +* 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 "lcuiengine_p.h" +#include "ut_lcuidefs.h" +#include "lcuidefs.h" + +LcUiEnginePrivate::LcUiEnginePrivate( LcUiEngine& uiEngine, + const QString &engineName, + const QString &applicationDisplayName ) + : mUiEngine ( uiEngine ), + mEngineName( engineName.toUtf8() ), + mSessionTitle( applicationDisplayName ) + +{ + mViewLayout = Lc_NoViewLayout; + mCloseTimer = 0; + mInvitingNote = 0; + mWaitingNote = 0; + mAcceptQuery = 0; + mRecipientQuery = 0; + mFullScreen = false; +} + +LcUiEnginePrivate::~LcUiEnginePrivate() +{ +} + +void LcUiEnginePrivate::start() +{ + lcutStub_LcUiEngine_calledMethodsInstance().insert(0,lcutStub_LcUiEngine_start ); +} + +void LcUiEnginePrivate::setContentAreas( const QRectF& /*sharedContent*/, + const QRectF& /*receivedContent*/ ) +{ + lcutStub_LcUiEngine_calledMethodsInstance().insert(0,lcutStub_LcUiEngine_setContentAreas ); + +} + +bool LcUiEnginePrivate::setOrientation( Qt::Orientation /*orientation*/ ) +{ + lcutStub_LcUiEngine_calledMethodsInstance().insert(0,lcutStub_LcUiEngine_setOrientation ); + return true; +} + +void LcUiEnginePrivate::zoom( int /*value*/ ) +{ + lcutStub_LcUiEngine_calledMethodsInstance().insert(0,lcutStub_LcUiEngine_zoom ); + +} + +void LcUiEnginePrivate::stop() +{ + lcutStub_LcUiEngine_calledMethodsInstance().insert(0,lcutStub_LcUiEngine_stop ); + +} + +void LcUiEnginePrivate::updateSession() +{ + lcutStub_LcUiEngine_calledMethodsInstance().insert(0,lcutStub_LcUiEngine_updateSession ); + +} + +bool LcUiEnginePrivate::isLocalPlayerPlaying() const +{ + return lcutStub_LcUiEngine_localplaying; +} + +bool LcUiEnginePrivate::isRemotePlayerPlaying() const +{ + return lcutStub_LcUiEngine_remoteplaying; +} + +const QString& LcUiEnginePrivate::sessionTitle() const +{ + return mSessionTitle; +} +const QString& LcUiEnginePrivate::recipient() const +{ + return mRecipient; +} + +const QString& LcUiEnginePrivate::phoneNumber() const +{ + return mPhoneNumber; +} + +LcViewLayoutHint LcUiEnginePrivate::viewLayout() const +{ + return (LcViewLayoutHint)lcutStub_LcUiEngine_layout; +} + +void LcUiEnginePrivate::setUiComponents(HbDialog* invitingNote, + HbDialog* waitingNote, + HbDialog* acceptQuery, + HbDialog* recipientQuery) +{ + mInvitingNote = invitingNote; + mWaitingNote = waitingNote; + mAcceptQuery = acceptQuery; + mRecipientQuery = recipientQuery; + +} + +void LcUiEnginePrivate::setMainCamera(const bool aMainCamera) +{ + mMainCamera = aMainCamera; +} + +bool LcUiEnginePrivate::mainCamera() const +{ + return mMainCamera; +} + +bool LcUiEnginePrivate::isMuted() const +{ + return lcutStub_LcUiEngine_muted; +} + +bool LcUiEnginePrivate::isSpeakerOn() const +{ + return lcutStub_LcUiEngine_speakerOn; +} + +void LcUiEnginePrivate::toggleMute() +{ + lcutStub_LcUiEngine_muted = !lcutStub_LcUiEngine_muted; + lcutStub_LcUiEngine_calledMethodsInstance().insert(0,lcutStub_LcUiEngine_mute ); +} + +void LcUiEnginePrivate::toggleCamera() +{ + lcutStub_LcUiEngine_cameraMain = !lcutStub_LcUiEngine_cameraMain; + lcutStub_LcUiEngine_calledMethodsInstance().insert(0,lcutStub_LcUiEngine_toggleCamera ); +} + +void LcUiEnginePrivate::toggleDisableCamera() +{ + lcutStub_LcUiEngine_calledMethodsInstance().insert(0,lcutStub_LcUiEngine_disableCamera ); +} + +void LcUiEnginePrivate::toggleSpeaker() +{ + lcutStub_LcUiEngine_speakerOn = !lcutStub_LcUiEngine_speakerOn; + lcutStub_LcUiEngine_calledMethodsInstance().insert(0,lcutStub_LcUiEngine_speaker ); +} + +int LcUiEnginePrivate::zoomValues( LcControlValues& values ) const +{ + values.mMaxValue = 3; + values.mMinValue = 1; + values.mValue = 2; + return 0; +} + +bool LcUiEnginePrivate::fullScreenMode() +{ + return mFullScreen; +} + + +void LcUiEnginePrivate::setFullScreenMode(bool aMode) +{ + mFullScreen = aMode; +} + +bool LcUiEnginePrivate::isMinimized()const +{ + return lcutStub_LcUiEngine_windowState_minimized; +} + +void LcUiEnginePrivate::minimize() +{ + lcutStub_LcUiEngine_windowState_minimized = true; +} + +void LcUiEnginePrivate::maximize() +{ + lcutStub_LcUiEngine_windowState_minimized = false; +} + +void LcUiEnginePrivate::shareImage(const QString& /*fileName*/) +{ + lcutStub_LcUiEngine_isImageShared = true; +} + +void LcUiEnginePrivate::shareCamera() +{ + lcutStub_LcUiEngine_isImageShared = false; +} + + +//stub control + +bool lcutStub_LcUiEngine_expectCall( const QString& call, int callNdx ) +{ + if ( callNdx >= lcutStub_LcUiEngine_calledMethodsInstance().count() ) { + return call == lcutNoCall; + } + return lcutStub_LcUiEngine_calledMethodsInstance().count() > 0 ? + lcutStub_LcUiEngine_calledMethodsInstance()[callNdx] == call : + call == lcutNoCall; +} + + +void lcutStub_LcUiEngine_reset() +{ + delete lcutStub_LcUiEngine_calledMethods; + lcutStub_LcUiEngine_calledMethods = 0; + lcutStub_LcUiEngine_failure = 0; + lcutStub_LcUiEngine_layout = -1; + lcutStub_LcUiEngine_cameraMain = false; + lcutStub_LcUiEngine_muted = false; + lcutStub_LcUiEngine_speakerOn = false; + lcutStub_LcUiEngine_localplaying = true; + lcutStub_LcUiEngine_remoteplaying = true; +} + +void lcutStub_LcUiEngine_setFailure( int failure ) +{ + lcutStub_LcUiEngine_failure = failure; +} + +void lcutStub_LcUiEngine_setLayout( int layout ) +{ + lcutStub_LcUiEngine_layout = layout; +} + +QStringList& lcutStub_LcUiEngine_calledMethodsInstance() +{ + if ( !lcutStub_LcUiEngine_calledMethods ) { + lcutStub_LcUiEngine_calledMethods = new QStringList(); + } + return *lcutStub_LcUiEngine_calledMethods; +} + +void lcutStub_LcUiEngine_setCameraMain( bool val ) +{ + lcutStub_LcUiEngine_cameraMain = val; +} + +void lcutStub_LcUiEngine_setMuted( bool val ) +{ + lcutStub_LcUiEngine_layout = val; +} + +void lcutStub_LcUiEngine_setSpeaker( bool val ) +{ + lcutStub_LcUiEngine_speakerOn = val; +} + +void lcutStub_LcUiEngine_setLocalPlaying( bool val ) +{ + lcutStub_LcUiEngine_localplaying = val; +} + +void lcutStub_LcUiEngine_setRemotePlaying( bool val ) +{ + lcutStub_LcUiEngine_remoteplaying = val; +} + + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ut_lcui/runtest.cmd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/runtest.cmd Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,23 @@ +@rem +@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +@rem All rights reserved. +@rem This component and the accompanying materials are made available +@rem under the terms of "Eclipse Public License v1.0" +@rem which accompanies this distribution, and is available +@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +@rem +@rem Initial Contributors: +@rem Nokia Corporation - initial contribution. +@rem +@rem Contributors: +@rem +@rem Description: +@rem + +call qmake +call bldmake clean +call bldmake bldfiles +call abld reallyclean winscw udeb +call abld export +call abld build winscw udeb +call \epoc32\release\winscw\udeb\ut_lcui.exe diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ut_lcui/src/main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/src/main.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,84 @@ +/* +* 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 "ut_lcviewmanager.h" +#include "ut_lcuicomponentrepository.h" +#include "ut_lcview.h" +#include "ut_lceffecthandler.h" +#include "ut_lcvideowidget.h" +#include "testresultxmlparser.h" +#include +#include +#include + + +#define UT_ARGS( args, file )\ + QStringList args( "ut_lcui");\ + args << "-silent" << "-xml" << "-o" << file + +int main(int argc, char *argv[]) +{ + bool promptOnExit(true); + for (int i=0; i +#include +#include + +#define UT_SET_ORIENTATION(orient) \ +HbInstance::instance()->allMainWindows().at(0)->setOrientation(orient); + +void UT_LcEffectHandler::initTestCase() +{ + lcutStub_LcUiEngine_reset(); + //must have main window, even if it not used + mMainWindow = new HbMainWindow(); +} + +void UT_LcEffectHandler::cleanupTestCase() +{ + lcutStub_LcUiEngine_reset(); + delete mMainWindow; +} + + +void UT_LcEffectHandler::init() +{ + mEngine = new LcUiEngine( lcEngineName, lcDisplayName ); + + mSharedVideo = new LcVideoWidget(); + mSharedVideoOverlay = new LcVideoWidget(0,false); + mReceivedVideo = new LcVideoWidget(); + mReceivedVideoOverlay = new LcVideoWidget(0,false); + mEffectHandler = new LcEffectHandler( + *mEngine,mSharedVideo,mSharedVideoOverlay, + mReceivedVideo,mReceivedVideoOverlay); + +} + +void UT_LcEffectHandler::cleanup() +{ + lcutStub_LcUiEngine_reset(); + delete mEffectHandler; + delete mEngine; + delete mSharedVideo; + delete mSharedVideoOverlay; + delete mReceivedVideoOverlay; + delete mReceivedVideo; +} + +void UT_LcEffectHandler::testConstructor() +{ + QVERIFY( mEffectHandler ); +} + +void UT_LcEffectHandler::testSwap() +{ + clearWidgets(); + QSignalSpy spy( mEffectHandler, SIGNAL(loadSwapLayout()) ); + QVERIFY( !mEffectHandler->mSharedVideo ); + QVERIFY( !mEffectHandler->mReceivedVideo ); + QVERIFY( !mEffectHandler->mSwapInProgress ); + QCOMPARE( spy.count(), 0 ); + + mEffectHandler->swap(); + setWidgets(); + + QVERIFY( mEffectHandler->mSwapInProgress ); + QCOMPARE( spy.count(), 1 ); + + HbWidget* sharedVideoWidget = mEffectHandler->mSharedVideo; + HbWidget* receivedVideoWidget = mEffectHandler->mReceivedVideo; + HbWidget* sharedVideoWidget2 = mEffectHandler->mSharedVideoOverlay; + HbWidget* receivedVideoWidget2 = mEffectHandler->mReceivedVideoOverlay; + QRectF sharedOrig = mEffectHandler->mSharedVideo->geometry(); + QRectF recvOrig = mEffectHandler->mReceivedVideo->geometry(); + + // Swapping not started because other widget missing + mEffectHandler->mSwapSharedCompleted = true; + mEffectHandler->mSwapReceivedCompleted = true; + mEffectHandler->mSharedVideo = 0; + mEffectHandler->swap(); + QCOMPARE( sharedVideoWidget->geometry(), sharedOrig ); + QCOMPARE( receivedVideoWidget->geometry(), recvOrig ); + QCOMPARE( mEffectHandler->mSwapSharedCompleted, true ); + QCOMPARE( mEffectHandler->mSwapReceivedCompleted, true ); + + // Swapping not started because other widget missing + mEffectHandler->mSharedVideo = sharedVideoWidget; + mEffectHandler->mReceivedVideo = 0; + mEffectHandler->swap(); + QCOMPARE( sharedVideoWidget->geometry(), sharedOrig ); + QCOMPARE( receivedVideoWidget->geometry(), recvOrig ); + QCOMPARE( mEffectHandler->mSwapSharedCompleted, true ); + QCOMPARE( mEffectHandler->mSwapReceivedCompleted, true ); + + // Swapping started, however geometry is change only once swapping completes + mEffectHandler->mSharedVideo = sharedVideoWidget; + mEffectHandler->mReceivedVideo = receivedVideoWidget; + mEffectHandler->swap(); + + QCOMPARE( sharedVideoWidget->geometry(), sharedOrig ); + QCOMPARE( receivedVideoWidget->geometry(), recvOrig ); + QCOMPARE( mEffectHandler->mSwapSharedCompleted, false ); + QCOMPARE( mEffectHandler->mSwapReceivedCompleted, false ); + + // Swapping started, however geometry is change only once swapping completes + mEffectHandler->mSwapSharedCompleted = true; + mEffectHandler->mSwapReceivedCompleted = true; + mEffectHandler->swap(); + QCOMPARE( sharedVideoWidget->geometry(), sharedOrig ); + QCOMPARE( receivedVideoWidget->geometry(), recvOrig ); + QCOMPARE( mEffectHandler->mSwapSharedCompleted, false ); + QCOMPARE( mEffectHandler->mSwapReceivedCompleted, false ); +} + +void UT_LcEffectHandler::testShowSendWindow() +{ + // Shared video widget does not exist + setWidgets(); + HbWidget* sharedVideoWidget = mEffectHandler->mSharedVideo; + QVERIFY( sharedVideoWidget != 0 ); + sharedVideoWidget->hide(); + QVERIFY( !sharedVideoWidget->isVisible() ); + mEffectHandler->mSharedVideo = 0; + mEffectHandler->showSendWindow(); + QVERIFY( !sharedVideoWidget->isVisible() ); + + // Shared video widget exists, effects running, dont show + HbEffect::mRunning = true; + mEffectHandler->mSharedVideo = sharedVideoWidget; + mEffectHandler->showSendWindow(); + QVERIFY( !mEffectHandler->mSharedVideo->isVisible() ); + + // Shared video widget exists, show + HbEffect::mRunning = false; + mEffectHandler->mSharedVideo = sharedVideoWidget; + mEffectHandler->showSendWindow(); + QVERIFY( mEffectHandler->mSharedVideo->isVisible() ); +} + +void UT_LcEffectHandler::testHideSendWindow() +{ + // Shared video widget does not exist + setWidgets(); + HbWidget* sharedVideoWidget = mEffectHandler->mSharedVideo; + QVERIFY( sharedVideoWidget != 0 ); + mEffectHandler->mSharedVideo = 0; + mEffectHandler->hideSendWindow(); + + // Shared video widget exists, show + mEffectHandler->mSharedVideo = sharedVideoWidget; + mEffectHandler->showSendWindow(); + QVERIFY( mEffectHandler->mSharedVideo->isVisible() ); + + // Shared video widget exists, hide + mEffectHandler->hideSendWindow(); + QVERIFY( !mEffectHandler->mSharedVideo->isVisible() ); +} + +void UT_LcEffectHandler::testShowReceiveWindow() +{ + // Shared video widget does not exist + setWidgets(); + HbWidget* receivedVideoWidget = mEffectHandler->mReceivedVideo; + QVERIFY( receivedVideoWidget != 0 ); + receivedVideoWidget->hide(); + QVERIFY( !receivedVideoWidget->isVisible() ); + mEffectHandler->mReceivedVideo = 0; + mEffectHandler->showReceiveWindow(); + QVERIFY( !receivedVideoWidget->isVisible() ); + + // Received video widget exists, show + mEffectHandler->mReceivedVideo = receivedVideoWidget; + mEffectHandler->showReceiveWindow(); + QVERIFY( mEffectHandler->mReceivedVideo->isVisible() ); +} + +void UT_LcEffectHandler::testHideReceiveWindow() +{ + // Shared video widget does not exist + setWidgets(); + HbWidget* receivedVideoWidget = mEffectHandler->mReceivedVideo; + QVERIFY( receivedVideoWidget != 0 ); + mEffectHandler->mReceivedVideo = 0; + mEffectHandler->hideReceiveWindow(); + + + // Received video widget exists, show + mEffectHandler->mReceivedVideo = receivedVideoWidget; + mEffectHandler->showReceiveWindow(); + QVERIFY( mEffectHandler->mReceivedVideo->isVisible() ); + + // Receive video widget exists, hide + mEffectHandler->hideReceiveWindow(); + QVERIFY( !mEffectHandler->mReceivedVideo->isVisible() ); +} + + +// windowFlipComplete +// windowDisappearToFlipComplete +// windowDisappearComplete +// windowAppearComplete +// WindowSwapSharedComplete +// WindowSwapReceivedComplete + +void UT_LcEffectHandler::testEffectComplete() +{ + clearWidgets(); + + // Video widgets does not exist + HbEffect::EffectStatus status; + mEffectHandler->windowAppearComplete( status ); + mEffectHandler->windowDisappearComplete( status ); + mEffectHandler->windowDisappearToFlipComplete( status ); + mEffectHandler->windowFlipComplete( status ); + + setWidgets(); + + HbWidget* sharedVideoWidget = mEffectHandler->mSharedVideo; + HbWidget* receivedVideoWidget = mEffectHandler->mReceivedVideo; + sharedVideoWidget->hide(); + receivedVideoWidget->hide(); + + mEffectHandler->showSendWindow(); + mEffectHandler->windowAppearComplete( status ); + QVERIFY( sharedVideoWidget->isVisible() ); + + mEffectHandler->windowDisappearComplete( status ); + QVERIFY( sharedVideoWidget->isVisible() ); + + mEffectHandler->windowDisappearToFlipComplete( status ); + QVERIFY( !sharedVideoWidget->isVisible() ); + + lcutStub_LcUiEngine_setLocalPlaying( false ); + mEffectHandler->windowFlipComplete( status ); + QVERIFY( !sharedVideoWidget->isVisible() ); + + lcutStub_LcUiEngine_setLocalPlaying( true ); + mEffectHandler->windowFlipComplete( status ); + QVERIFY( sharedVideoWidget->isVisible() ); + + sharedVideoWidget->hide(); + receivedVideoWidget->hide(); + lcutStub_LcUiEngine_setLocalPlaying( true ); + mEffectHandler->windowFlipComplete( status ); + QVERIFY( sharedVideoWidget->isVisible() ); + + // Swapping, real video widgets are set visible only after + // both swap effects have completeded swapping completes and completion + // is also signal + + // Geomerty changes are handled by the view using DoCML's + // when swapping completes and completion is also signal + + QRectF pos1 = QRectF(5,100, 200, 200); + QRectF pos2 = QRectF(5,300, 400, 400); + mEffectHandler->mSharedVideo->setGeometry(pos1); + mEffectHandler->mReceivedVideo->setGeometry(pos2); + QSignalSpy spy( mEffectHandler, SIGNAL(swapCompleted()) ); + sharedVideoWidget->hide(); + receivedVideoWidget->hide(); + lcutStub_LcUiEngine_setLocalPlaying( true ); + mEffectHandler->windowSwapSharedComplete( status ); + QVERIFY( !sharedVideoWidget->isVisible() ); + QCOMPARE( spy.count(), 0 ); + + sharedVideoWidget->hide(); + receivedVideoWidget->hide(); + lcutStub_LcUiEngine_setRemotePlaying( true ); + mEffectHandler->windowSwapReceivedComplete( status ); + QVERIFY( receivedVideoWidget->isVisible() ); + QVERIFY( sharedVideoWidget->isVisible() ); + QCOMPARE( spy.count(), 1 ); + + // Players are disabled so even when swap completes, widgets are not set + // visible + sharedVideoWidget->hide(); + receivedVideoWidget->hide(); + lcutStub_LcUiEngine_setLocalPlaying( false ); + mEffectHandler->windowSwapSharedComplete( status ); + QVERIFY( !sharedVideoWidget->isVisible() ); + + sharedVideoWidget->hide(); + receivedVideoWidget->hide(); + lcutStub_LcUiEngine_setRemotePlaying( false ); + mEffectHandler->windowSwapReceivedComplete( status ); + QVERIFY( !receivedVideoWidget->isVisible() ); + QVERIFY( !sharedVideoWidget->isVisible() ); +} + +void UT_LcEffectHandler::testStartEffect() +{ + clearWidgets(); + + const char *effectId = "myeffect"; + const char *callBack = "mycallback"; + + QVERIFY( !mEffectHandler->mSharedVideo ); + QVERIFY( !mEffectHandler->mSharedVideoOverlay ); + mEffectHandler->startEffect( mEffectHandler->mSharedVideoOverlay,effectId, callBack); + + setWidgets(); + + QVERIFY( mEffectHandler->mSharedVideo ); + QVERIFY( mEffectHandler->mSharedVideoOverlay ); + + HbWidget* sharedVideoWidget = mEffectHandler->mSharedVideo; + HbWidget* sharedVideoWidget2 = mEffectHandler->mSharedVideoOverlay; + QRectF sharedOrig = mEffectHandler->mSharedVideo->geometry(); + + mEffectHandler->mSharedVideo = 0; + mEffectHandler->startEffect( mEffectHandler->mSharedVideoOverlay,effectId, callBack); + + mEffectHandler->mSharedVideo = sharedVideoWidget; + mEffectHandler->mSharedVideoOverlay = 0; + mEffectHandler->startEffect( mEffectHandler->mSharedVideoOverlay,effectId, callBack); + + mEffectHandler->mSharedVideo = sharedVideoWidget; + mEffectHandler->mSharedVideoOverlay = sharedVideoWidget2; + mEffectHandler->startEffect( mEffectHandler->mSharedVideoOverlay,effectId, callBack); + + QCOMPARE( sharedVideoWidget->geometry(), sharedVideoWidget2->geometry() ); +} + +void UT_LcEffectHandler::testSetVisibility() +{ + setWidgets(); + + QVERIFY( mEffectHandler->mSharedVideo ); + HbWidget* sharedVideoWidget = mEffectHandler->mSharedVideo; + sharedVideoWidget->setVisible(false); + + //If Effects are not running than we can set the visibility of widget + mEffectHandler->setVisibility(sharedVideoWidget,true); + // TODO: setvisibility temporarily NOP + /*QVERIFY( mEffectHandler->mSharedVideo->isVisible() ); + + //If Effects are running we can not set the visibility of widget. + HbEffect::mRunning = true; + mEffectHandler->setVisibility(sharedVideoWidget,false); + QVERIFY( mEffectHandler->mSharedVideo->isVisible() );*/ +} + +void UT_LcEffectHandler::testSetDissappearEffect() +{ + QCOMPARE( mEffectHandler->mEffectCallBack, + QString::fromAscii(lcEffectWinDefaultCallback )); + mEffectHandler->setDissappearEffect(LcEffectHandler::DissappearToFlip ); + QCOMPARE( mEffectHandler->mEffectCallBack, + QString::fromAscii("windowDisappearToFlipComplete" )); + mEffectHandler->setDissappearEffect(LcEffectHandler::NormalDissappear ); + QCOMPARE( mEffectHandler->mEffectCallBack, + QString::fromAscii("windowDisappearComplete" )); +} + +void UT_LcEffectHandler::testIsSharedVideoAtTop() +{ + setWidgets(); + + QRectF pos1 = QRectF(5,100, 200, 200); + QRectF pos2 = QRectF(5,300, 400, 400); + mEffectHandler->mSharedVideo->setGeometry(pos1); + mEffectHandler->mReceivedVideo->setGeometry(pos2); + + QVERIFY( mEffectHandler->isSharedVideoAtTop() ); + + mEffectHandler->mSharedVideo->setGeometry(pos2); + mEffectHandler->mReceivedVideo->setGeometry(pos1); + QVERIFY( !mEffectHandler->isSharedVideoAtTop() ); + +} + +void UT_LcEffectHandler::testVideosSideBySide() +{ + setWidgets(); + QRectF pos1 = QRectF(5,100, 200, 200); + QRectF pos2 = QRectF(5,300, 400, 400); + QRectF pos3 = QRectF(5,100, 400, 400); + + mEffectHandler->mSharedVideo->setGeometry(pos1); + mEffectHandler->mReceivedVideo->setGeometry(pos2); + + QVERIFY( !mEffectHandler->videosSideBySide() ); + mEffectHandler->mReceivedVideo->setGeometry(pos3); + QVERIFY( mEffectHandler->videosSideBySide() ); +} + +void UT_LcEffectHandler::testHandleSwapCompletion() +{ + QSignalSpy spy( mEffectHandler, SIGNAL(swapCompleted()) ); + mEffectHandler->mSwapInProgress = true; + mEffectHandler->mSwapSharedCompleted = false; + mEffectHandler->mSwapReceivedCompleted = false; + + // Test1: Swap is not completed. + mEffectHandler->handleSwapCompletion(); + QVERIFY( mEffectHandler->mSwapInProgress ); + QCOMPARE( spy.count(), 0 ); + + // Test2: Swap is partially completed. + mEffectHandler->mSwapSharedCompleted = true; + mEffectHandler->handleSwapCompletion(); + QVERIFY( mEffectHandler->mSwapInProgress ); + QCOMPARE( spy.count(), 0 ); + + // Test 3. Swap Completed completely. + mEffectHandler->mSwapSharedCompleted = true; + mEffectHandler->mSwapReceivedCompleted = true; + mEffectHandler->handleSwapCompletion(); + QVERIFY( !mEffectHandler->mSwapInProgress ); + QCOMPARE( spy.count(), 1 ); + + //Test 4. Local & Remote are player are availble. + lcutStub_LcUiEngine_setLocalPlaying( true ); + lcutStub_LcUiEngine_setRemotePlaying( true ); + + mEffectHandler->handleSwapCompletion(); + QVERIFY( mEffectHandler->mSharedVideo->isVisible() ); + QVERIFY( mEffectHandler->mReceivedVideo->isVisible() ); +} + +void UT_LcEffectHandler::testIsSwapInProgress() +{ + QVERIFY( !mEffectHandler->isSwapInProgress() ); + mEffectHandler->swap(); + QVERIFY( mEffectHandler->isSwapInProgress() ); +} + + +// Helper Utility Function for the Unit Test. +void UT_LcEffectHandler::clearWidgets() +{ + mEffectHandler->mReceivedVideo = 0; + mEffectHandler->mReceivedVideoOverlay = 0; + mEffectHandler->mSharedVideo = 0; + mEffectHandler->mSharedVideoOverlay = 0; +} + +void UT_LcEffectHandler::setWidgets() +{ + mEffectHandler->mReceivedVideo = mReceivedVideo; + mEffectHandler->mReceivedVideoOverlay = mReceivedVideoOverlay; + mEffectHandler->mSharedVideo = mSharedVideo; + mEffectHandler->mSharedVideoOverlay = mSharedVideoOverlay; +} + + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ut_lcui/src/ut_lcuicomponentrepository.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/src/ut_lcuicomponentrepository.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,322 @@ +/* +* 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 "ut_lcuicomponentrepository.h" +#include "ut_lcuidefs.h" +#include "lcuicomponentrepository.h" +#include "lcuidefs.h" +#include "lcview.h" +#include "lcuiengine.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define UT_SET_ORIENTATION(orient) \ +HbInstance::instance()->allMainWindows().at(0)->setOrientation(orient); + +void UT_LcUiComponentRepository::initTestCase() +{ +} + +void UT_LcUiComponentRepository::cleanupTestCase() +{ +} + + +void UT_LcUiComponentRepository::init() +{ + mEngine = new LcUiEngine( lcEngineName, lcDisplayName ); + mRepository = new LcUiComponentRepository( *mEngine ); +} + +void UT_LcUiComponentRepository::cleanup() +{ + delete mRepository; + delete mEngine; +} + +void UT_LcUiComponentRepository::testConstructor() +{ + QVERIFY( mRepository ); + QVERIFY( !mRepository->mIdleView ); + QVERIFY( !mRepository->mReceiveView ); + QVERIFY( !mRepository->mReceiveOnlyView ); + QVERIFY( !mRepository->mTwowayView ); + QVERIFY( !mRepository->mSendView ); + QVERIFY( !mRepository->mAllInOneView ); + QVERIFY( !mRepository->mAcceptQuery ); + QVERIFY( !mRepository->mInvitingNote ); + QVERIFY( !mRepository->mWaitingNote ); + QVERIFY( !mRepository->mRecipientQuery ); + +} + +void UT_LcUiComponentRepository::testIdleView() +{ + // View not yet loaded + UT_SET_ORIENTATION( Qt::Horizontal ); + QVERIFY( !mRepository->mIdleView ); + LcView* view = mRepository->idleView(); + QVERIFY( mRepository->mIdleView ); + QCOMPARE( view->objectName(), QString( lcViewIdleId ) ); + + // View loaded + LcView* view2 = mRepository->idleView(); + QVERIFY( view == view2 ); +} + +void UT_LcUiComponentRepository::testReceiveView() +{ + // View not yet loaded + // Landscape layout + UT_SET_ORIENTATION( Qt::Horizontal ); + QVERIFY( !mRepository->mReceiveView ); + LcView* view = mRepository->receiveView(); + QVERIFY( mRepository->mReceiveView ); + QCOMPARE( view->objectName(), QString( lcViewReceiveId ) ); + + // View loaded + LcView* view2 = mRepository->receiveView(); + QVERIFY( view == view2 ); +} + + +void UT_LcUiComponentRepository::testReceiveOnlyView() +{ + // View not yet loaded + QVERIFY( !mRepository->mReceiveOnlyView ); + LcView* view = mRepository->receiveOnlyView(); + QVERIFY( mRepository->mReceiveOnlyView ); + QCOMPARE( view->objectName(), QString( lcViewReceiveOnlyId ) ); + + // View loaded + LcView* view2 = mRepository->receiveOnlyView(); + QVERIFY( view == view2 ); +} + + +void UT_LcUiComponentRepository::testTwowayView() +{ + // View not yet loaded + QVERIFY( !mRepository->mTwowayView ); + LcView* view = mRepository->twowayView(); + QVERIFY( mRepository->mTwowayView ); + QCOMPARE( view->objectName(), QString( lcViewTwowayId ) ); + + // View loaded + LcView* view2 = mRepository->twowayView(); + QVERIFY( view == view2 ); +} + +void UT_LcUiComponentRepository::testSendView() +{ + // View not yet loaded + QVERIFY( !mRepository->mSendView ); + LcView* view = mRepository->sendView(); + QVERIFY( mRepository->mSendView ); + QCOMPARE( view->objectName(), QString( lcViewSendId ) ); + + // View loaded + LcView* view2 = mRepository->sendView(); + QVERIFY( view == view2 ); +} + +void UT_LcUiComponentRepository::testAllInOneView() +{ + // View not yet loaded + UT_SET_ORIENTATION( Qt::Horizontal ); + QVERIFY( !mRepository->mAllInOneView ); + LcView* view = mRepository->allInOneView(); + QVERIFY( mRepository->mAllInOneView ); + QCOMPARE( view->objectName(), QString( lcViewAllInOneId ) ); + QCOMPARE( mRepository->mLayoutSection, QString( lcLayoutLandscapeDefaultId ) ); + // View loaded + LcView* view2 = mRepository->allInOneView(); + QVERIFY( view == view2 ); +} + +void UT_LcUiComponentRepository::testAcceptQuery() +{ + // Query created and returned + QVERIFY( !mRepository->mAcceptQuery ); + HbDialog* query = mRepository->acceptQuery(); + QVERIFY( query ); + QCOMPARE( query, mRepository->mAcceptQuery ); + QVERIFY( !query->isVisible() ); + + // Existing query returned + HbDialog* query2 = mRepository->acceptQuery(); + QVERIFY( query2 ); + QVERIFY( query2 == query ); +} + +void UT_LcUiComponentRepository::testInvitingNote() +{ + // Note created and returned + QVERIFY( !mRepository->mInvitingNote ); + HbDialog* note = mRepository->invitingNote(); + QVERIFY( note ); + QVERIFY( note == mRepository->mInvitingNote ); + QVERIFY( !note->isVisible() ); + + // Existing note returned + HbDialog* note2 = mRepository->invitingNote(); + QVERIFY( note2 ); + QVERIFY( note2 == note ); +} + +void UT_LcUiComponentRepository::testWaitingNote() +{ + // Note created and returned + QVERIFY( !mRepository->mWaitingNote ); + HbDialog* note = mRepository->waitingNote(); + QVERIFY( note ); + QVERIFY( note == mRepository->mWaitingNote ); + QVERIFY( !note->isVisible() ); + + // Existing note returned + HbDialog* note2 = mRepository->waitingNote(); + QVERIFY( note2 ); + QVERIFY( note2 == note ); +} + +void UT_LcUiComponentRepository::testRecipientQuery() +{ + // Query created and returned + QVERIFY( !mRepository->mRecipientQuery ); + HbDialog* query = mRepository->recipientQuery(); + QVERIFY( mRepository->mRecipientQuery ); + QCOMPARE( query, mRepository->mRecipientQuery ); + QVERIFY( !query->isVisible() ); + + // Existing query returned + HbDialog* query2 = mRepository->recipientQuery(); + QVERIFY( query2 == query ); +} + +void UT_LcUiComponentRepository::testShareOwnVideoQuery() +{ + // Query created and returned + QVERIFY( !mRepository->mShareOwnVideoQuery ); + HbDialog* query = mRepository->shareOwnVideoQuery(); + QVERIFY( mRepository->mShareOwnVideoQuery ); + QCOMPARE( query, (HbDialog*)mRepository->mShareOwnVideoQuery ); + QVERIFY( !query->isVisible() ); + + // Existing query returned + HbDialog* query2 = mRepository->shareOwnVideoQuery(); + QVERIFY( query2 ); + QVERIFY( query2 == query ); +} + +void UT_LcUiComponentRepository::testSharedVideoContextMenu() +{ + HbMenu* menu = new HbMenu(); + QVERIFY( menu->isEmpty() ); + + QVERIFY( !mRepository->mAllInOneView ); + LcView* view = mRepository->allInOneView(); + QVERIFY( mRepository->mAllInOneView ); + QCOMPARE( view->objectName(), QString( lcViewAllInOneId ) ); + + HbAction changeCamera( lcActChangeCameraId ); + HbAction disableCam( lcActMenuDisableCameraId ); + HbAction enableCam( lcActEnableCameraId ); + HbAction changeCam( lcActMenuChangeCameraId ); + + mRepository->mActions.append( &changeCamera ); + mRepository->mActions.append( &disableCam ); + mRepository->mActions.append( &enableCam ); + mRepository->mActions.append( &changeCam ); + + mRepository->sharedVideoContextMenuActions( menu, *view ); + //TODO: stub implementation of void QGraphicsWidget::addAction(QAction *action); + //QVERIFY( !menu->isEmpty() ); +} + + +void UT_LcUiComponentRepository::testLoadView_FileNotFound() +{ + QObjectList viewR; + const QString vid( "view"); + const QString file( "file not found" ); + QVERIFY( !mRepository->loadView( viewR, vid, file ) ); +} + +void UT_LcUiComponentRepository::testConnect() +{ + LcView* view = mRepository->idleView(); + QVERIFY( view ); + HbAction action; + + // Existing action + action.setObjectName( QString( lcActMuteId ) ); + QVERIFY( mRepository->connect( action, *view ) ); + + // Action not found + action.setObjectName( QString( "Action not defined" ) ); + QVERIFY( !mRepository->connect( action, *view ) ); +} + + +void UT_LcUiComponentRepository::testLoadLayout() +{ + bool ok( false ); + + // View not yet loaded + QVERIFY( mRepository->mLastLoadedView.length() == 0 ); + ok = mRepository->loadLayout( lcLayoutLandscapeDefaultId ); + QVERIFY( !ok ); + + // View is loaded + mRepository->mLastLoadedView = lcIdleViewFile; + ok = mRepository->loadLayout( lcLayoutLandscapeDefaultId ); + QVERIFY( ok ); + + // Changing layout + ok = mRepository->loadLayout( lcLayoutLandscapeSwappedId ); + QVERIFY( ok ); + ok = mRepository->loadLayout( lcLayoutFullscreenId ); + QVERIFY( ok ); + + // Loading non-existing section + ok = mRepository->loadLayout( QString("dummy_layout") ); + QVERIFY( !ok ); + + // Check for current and previously loaded layout name + mRepository->mLastLoadedView = lcIdleViewFile; + ok = mRepository->loadLayout( lcLayoutLandscapeDefaultId ); + QVERIFY( ok ); + QVERIFY( mRepository->layout() == lcLayoutLandscapeDefaultId ); + ok = mRepository->loadLayout( lcLayoutLandscapeDialpadId ); + QVERIFY( ok ); + QVERIFY( mRepository->layout() == lcLayoutLandscapeDialpadId ); + QVERIFY( mRepository->previousLayout() == lcLayoutLandscapeDefaultId ); + ok = mRepository->loadLayout( mRepository->previousLayout() ); + QVERIFY( ok ); + QVERIFY( mRepository->layout() == lcLayoutLandscapeDefaultId ); + QVERIFY( mRepository->previousLayout() == lcLayoutLandscapeDialpadId ); + +} diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ut_lcui/src/ut_lcvideowidget.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/src/ut_lcvideowidget.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,73 @@ +/* +* 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 "ut_lcvideowidget.h" +#include "ut_lcuidefs.h" +#include "lcvideowidget.h" +#include +#include +#include +#include + +void UT_LcVideoWidget::initTestCase() +{ +} + +void UT_LcVideoWidget::cleanupTestCase() +{ +} + + +void UT_LcVideoWidget::init() +{ + mVideoWidget = new LcVideoWidget(); + mVideoWidget2 = new LcVideoWidget(0,false); +} + +void UT_LcVideoWidget::cleanup() +{ + delete mVideoWidget; + delete mVideoWidget2; +} + +void UT_LcVideoWidget::testConstructor() +{ + QVERIFY( mVideoWidget ); + QVERIFY( mVideoWidget->isShowingVideo() ); + QVERIFY( mVideoWidget2 ); + QVERIFY( !mVideoWidget2->isShowingVideo() ); +} + +void UT_LcVideoWidget::testSetShowVideo() +{ + QVERIFY( mVideoWidget->isShowingVideo() ); + mVideoWidget->setShowVideo(false); + QVERIFY( !mVideoWidget->isShowingVideo() ); + mVideoWidget->setShowVideo(true); + QVERIFY( mVideoWidget->isShowingVideo() ); +} + +void UT_LcVideoWidget::testPaint() +{ + QPainter painter; + QStyleOptionGraphicsItem style; + mVideoWidget->setPos(QPointF(10,100)); + mVideoWidget->paint(&painter,&style,0); + mVideoWidget2->paint(&painter,&style,0); +} + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ut_lcui/src/ut_lcview.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/src/ut_lcview.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,918 @@ +/* +* 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 "ut_lcview.h" +#include "ut_lcuidefs.h" +#include "lcview.h" +#include "lcuiengine.h" +#include "lcuicomponentrepository.h" +#include "lcuidefs.h" +#include "lcvideowidget.h" +#include "lceffecthandler.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Stub Helper +#include + +#define UT_SET_ORIENTATION(orient) \ +HbInstance::instance()->allMainWindows().at(0)->setOrientation(orient); + +void UT_LcView::initTestCase() +{ + lcutStub_LcUiEngine_reset(); + //must have main window, even if it not used + mMainWindow = new HbMainWindow(); +} + +void UT_LcView::cleanupTestCase() +{ + lcutStub_LcUiEngine_reset(); + delete mMainWindow; +} + + +void UT_LcView::init() +{ + lcutStub_LcUiEngine_reset(); + mRecipient = new HbLabel(); + mEndCallButton = new HbPushButton(); + mEngine = new LcUiEngine( lcEngineName, lcDisplayName ); + mRepository = new LcUiComponentRepository( *mEngine ); + mView = new LcView( *mEngine, *mRepository ); + mView->mRecipient = mRecipient; + mView->mEndCallButton = mEndCallButton; + mAction = new HbAction(); + mAction2 = new HbAction(); +} + +void UT_LcView::cleanup() +{ + lcutStub_LcUiEngine_reset(); + delete mRecipient; + delete mView; + delete mEngine; + delete mRepository; + delete mAction; + delete mAction2; + delete mEndCallButton; +} + +void UT_LcView::testConstructor() +{ + QVERIFY( mView ); +} + +void UT_LcView::testActivated() +{ + mView->init(); + lcutStub_LcUiEngine_reset(); + QVERIFY( lcutStub_LcUiEngine_getCurrentView() == 0 ); + mView->activated(); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_updateSession, 0 ) ); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_setOrientation, 1 ) ); + QVERIFY( lcutStub_LcUiEngine_getCurrentView() == mView ); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_setContentAreas, 2 ) ); + + lcutStub_LcUiEngine_reset(); + mView->mChangeCameraAction = mAction; + mView->mMuteAction = mAction; + mView->mSpeakerAction = mAction; + + mView->activated(); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_updateSession, 0 ) ); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_setOrientation, 1 ) ); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_setContentAreas, 2 ) ); + + lcutStub_LcUiEngine_reset(); + lcutStub_LcUiEngine_setCameraMain( true); + lcutStub_LcUiEngine_setMuted( true); + lcutStub_LcUiEngine_setSpeaker( true ); + + mView->activated(); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_updateSession, 0 ) ); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_setOrientation, 1 ) ); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_setContentAreas, 2 ) ); +} + +void UT_LcView::testInit() +{ + mRepository->mReturnSendVideo = false; + mView->init(); + QVERIFY( mView->mRecipient ); + QVERIFY( !mView->mSharedVideoWidget ); + QVERIFY( mView->mDialpad ); + QVERIFY( mView->mDialpadVtKeyHandler ); + + mRepository->mReturnSendVideo = true; + mView->init(); + QVERIFY( mView->mRecipient ); + QVERIFY( mView->mSharedVideoWidget ); + QVERIFY( mView->menu()); + QVERIFY( mView->mDialpad ); + QVERIFY( mView->mDialpadVtKeyHandler ); + + // emergency call + mView->mDialpadVtKeyHandler->contentChanged("112"); + QVERIFY( mView->mDialpad->mIsCallButtonEnabled ); + mView->mDialpadVtKeyHandler->contentChanged("100"); + QVERIFY( !mView->mDialpad->mIsCallButtonEnabled ); +} + +void UT_LcView::testDeactivated() +{ + mView->deactivated(); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_setContentAreas ) ); +} + +void UT_LcView::testSetCameraActionToMain() +{ + mView->mChangeCameraAction = mAction; + mView->mMuteAction = mAction; + mView->mSpeakerAction = mAction; + mView->mDisableCameraAction = mAction; + + mView->setCameraActionToMain(); + QVERIFY( mView->mChangeCameraAction->text().isEmpty() ); + QCOMPARE( mView->mChangeCameraAction->icon(), HbIcon(lcIconNameMainCamera) ); +} + +void UT_LcView::testSetCameraActionToSecondary() +{ + mView->mChangeCameraAction = mAction; + mView->mMuteAction = mAction; + mView->mSpeakerAction = mAction; + mView->mDisableCameraAction = mAction; + + mView->setCameraActionToSecondary(); + QVERIFY( mView->mChangeCameraAction->text().isEmpty() ); + QCOMPARE( mView->mChangeCameraAction->icon(), HbIcon(lcIconNameSecondaryCamera) ); +} + +void UT_LcView::testSetMuteActionToUnmute() +{ + mView->mChangeCameraAction = mAction; + mView->mMuteAction = mAction; + mView->mSpeakerAction = mAction; + mView->mDisableCameraAction = mAction; + + mView->setMuteActionToUnmute(); + QVERIFY( mView->mMuteAction->text().isEmpty() ); + QCOMPARE (mView->mMuteAction->icon(), HbIcon(lcIconNameUnmuteMic)); +} + +void UT_LcView::testSetMuteActionToMute() +{ + mView->mChangeCameraAction = mAction; + mView->mMuteAction = mAction; + mView->mSpeakerAction = mAction; + mView->mDisableCameraAction = mAction; + + mView->setMuteActionToMute(); + QVERIFY( mView->mMuteAction->text().isEmpty() ); + QCOMPARE (mView->mMuteAction->icon(), HbIcon(lcIconNameMuteMic)); +} + +void UT_LcView::testSetSpeakerActionToHandset() +{ + mView->mChangeCameraAction = mAction; + mView->mMuteAction = mAction; + mView->mSpeakerAction = mAction; + mView->mDisableCameraAction = mAction; + + mView->setSpeakerActionToHandset(); + QVERIFY( mView->mSpeakerAction->text().isEmpty() ); + QCOMPARE( mView->mSpeakerAction->icon(), HbIcon(lcIconNameHandset) ); +} + +void UT_LcView::testSetSpeakerActionToSpeaker() +{ + mView->mChangeCameraAction = mAction; + mView->mMuteAction = mAction; + mView->mSpeakerAction = mAction; + mView->mDisableCameraAction = mAction; + + mView->setSpeakerActionToSpeaker(); + QVERIFY( mView->mSpeakerAction->text().isEmpty() ); + QCOMPARE( mView->mSpeakerAction->icon(), HbIcon(lcIconNameLoudspeaker) ); +} + +void UT_LcView::testSetCameraActionToEnable() +{ + mView->setCameraActionToEnable(); + + mView->mDisableCameraAction = mAction; + mView->mDisableCameraMenuAction = mAction2; + + mView->setCameraActionToEnable(); + QVERIFY( mView->mDisableCameraAction->text().isEmpty() ); + QCOMPARE( mView->mDisableCameraAction->icon(), HbIcon(lcIconNameEnableCamera) ); + QCOMPARE( mView->mDisableCameraMenuAction->text(), hbTrId( "txt_vt_menu_enable_camera" ) ); +} + +void UT_LcView::testSetCameraActionToDisable() +{ + mView->setCameraActionToDisable(); + + mView->mDisableCameraAction = mAction; + mView->mDisableCameraMenuAction = mAction2; + + mView->setCameraActionToDisable(); + QVERIFY( mView->mDisableCameraAction->text().isEmpty() ); + QCOMPARE( mView->mDisableCameraAction->icon(), HbIcon(lcIconNameDisableCamera) ); + QCOMPARE( mView->mDisableCameraMenuAction->text(), hbTrId( "txt_vt_menu_disable_camera" ) ); +} + + +void UT_LcView::testDisableControls() +{ + mView->disableControls(); + QVERIFY( !mView->menu()->isEnabled() ); + QVERIFY( !mView->toolBar()->isEnabled() ); +} + +void UT_LcView::testEnableControls() +{ + mView->menu()->setEnabled( false ); + mView->toolBar()->setEnabled( false ); + + mView->enableControls(); + QVERIFY( mView->menu()->isEnabled() ); + QVERIFY( mView->toolBar()->isEnabled() ); +} + + +void UT_LcView::testEndVideoSession() +{ + mView->endVideoSession(); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_stop ) ); +} + +void UT_LcView::testMute() +{ + mView->mute(); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_mute ) ); + QVERIFY( !mView->timerId ); + QVERIFY( !mEngine->fullScreenMode()); +} + +void UT_LcView::testChangeCamera() +{ + mView->init(); + mView->changeCamera(); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_toggleCamera ) ); + QVERIFY( !mEngine->fullScreenMode() ); +} + +void UT_LcView::testSwitchToVoiceCall() +{ + mView->switchToVoiceCall(); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_stop ) ); +} + +void UT_LcView::testDisableCameraWhenOnFullScreenMode() +{ + mView->init(); + mEngine->setFullScreenMode(true); + mView->disableCamera(); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_disableCamera ) ); + QVERIFY( mEngine->fullScreenMode() ); +} + +void UT_LcView::testDisableCameraWhenNotOnFullScreenMode() +{ + mView->init(); + mEngine->setFullScreenMode(false); + mView->disableCamera(); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_disableCamera ) ); + QVERIFY( !mEngine->fullScreenMode() ); +} + +void UT_LcView::testSpeaker() +{ + mView->init(); + mView->speaker(); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_speaker ) ); + QVERIFY( !mEngine->fullScreenMode() ); +} + +void UT_LcView::testSwap() +{ + QVERIFY( !mView->mSharedVideoWidget ); + QVERIFY( !mView->mReceivedVideoWidget ); + mView->swap(); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutNoCall ) ); + + lcutStub_LcUiEngine_reset(); + mView->init(); + mView->swap(); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutNoCall ) ); +} + +void UT_LcView::testNotSupported() +{ + HbMainWindow mainWin; + QVERIFY( mView->mNotSupportedNote ); + QVERIFY( !mView->mNotSupportedNote->isVisible() ); + mView->notSupported(); + QVERIFY( mView->mNotSupportedNote->isVisible() ); +} + +void UT_LcView::testUpdateVideoRects() +{ + mView->init(); + LcVideoWidget* sharedVideoWidget = mView->mSharedVideoWidget; + LcVideoWidget* receivedVideoWidget = mView->mReceivedVideoWidget; + + mView->mSharedVideoWidget = 0; + mView->mReceivedVideoWidget = 0; + mView->updateVideoRects(); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_updateSession, 0 ) ); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_setOrientation, 1 ) ); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_setContentAreas, 2 ) ); + + mView->mSharedVideoWidget = sharedVideoWidget; + mView->mReceivedVideoWidget = 0; + mView->updateVideoRects(); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_updateSession, 0 ) ); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_setOrientation, 1 ) ); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_setContentAreas, 2 ) ); + + mView->mSharedVideoWidget = 0; + mView->mReceivedVideoWidget = receivedVideoWidget; + mView->updateVideoRects(); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_updateSession, 0 ) ); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_setOrientation, 1 ) ); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_setContentAreas, 2 ) ); + + mView->mSharedVideoWidget = sharedVideoWidget; + mView->mReceivedVideoWidget = receivedVideoWidget; + sharedVideoWidget->hide(); + receivedVideoWidget->hide(); + lcutStub_LcUiEngine_setLocalPlaying( false ); + lcutStub_LcUiEngine_setRemotePlaying( false ); + mView->updateVideoRects(); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_updateSession, 0 ) ); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_setOrientation, 1 ) ); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_setContentAreas, 2 ) ); + QVERIFY( !sharedVideoWidget->isVisible() ); + QVERIFY( !receivedVideoWidget->isVisible() ); + + sharedVideoWidget->hide(); + receivedVideoWidget->hide(); + lcutStub_LcUiEngine_setLocalPlaying( true ); + lcutStub_LcUiEngine_setRemotePlaying( true ); + mView->updateVideoRects(); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_updateSession, 0 ) ); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_setOrientation, 1 ) ); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_setContentAreas, 2 ) ); + + //Test: Shared video widgets and received video wigts are positioned at (0,0) + //It does not update. + lcutStub_LcUiEngine_reset(); + mView->isViewReady = false; + mView->mSharedVideoWidget = sharedVideoWidget; + mView->mSharedVideoWidget->setPos(QPointF(0,0)); + mView->mReceivedVideoWidget = receivedVideoWidget; + mView->mReceivedVideoWidget->setPos(QPointF(0,0)); + mView->updateVideoRects(); + QVERIFY( !lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_updateSession, 0 ) ); + QVERIFY( !lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_setOrientation, 1 ) ); + QVERIFY( !lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_setContentAreas, 2 ) ); + + + //Test2: Shared video widgets positioned at (0,0) and other widgets is null + //It does not update. + lcutStub_LcUiEngine_reset(); + mView->mSharedVideoWidget = sharedVideoWidget; + mView->mSharedVideoWidget->setPos(QPointF(0,0)); + mView->mReceivedVideoWidget = 0; + mView->isViewReady = false; + mView->updateVideoRects(); + QVERIFY( !lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_updateSession, 0 ) ); + QVERIFY( !lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_setOrientation, 1 ) ); + QVERIFY( !lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_setContentAreas, 2 ) ); + + //Test3: Shared video widgets positioned correctly and other widgets is null + //It update. + lcutStub_LcUiEngine_reset(); + mView->mSharedVideoWidget = sharedVideoWidget; + mView->mSharedVideoWidget->setPos(QPointF(10,10)); + mView->mReceivedVideoWidget = 0; + mView->isViewReady = false; + mView->updateVideoRects(); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_updateSession, 0 ) ); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_setOrientation, 1 ) ); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_setContentAreas, 2 ) ); +} + +void UT_LcView::testCurrentLayout() +{ + mView->init(); + QString layout; + + //1. Landscape layout + UT_SET_ORIENTATION( Qt::Horizontal ); + layout = mView->currentLayout(); + QVERIFY( layout == lcLayoutLandscapeDefaultId ); + + //2. Landscape swapped layout + // Shared window x coordinate is higher than Received windows x coordinate. + + QRectF pos1 = QRectF(100,300, 400, 400); + QRectF pos2 = QRectF(5,100, 200, 200); + + UT_SET_ORIENTATION( Qt::Horizontal ); + mView->mEffectHandler->mSwapInProgress = true; + mView->mSharedVideoWidget->setGeometry(pos1); + mView->mReceivedVideoWidget->setGeometry(pos2); + + layout = mView->currentLayout(); + QVERIFY( layout == lcLayoutLandscapeSwappedId ); + + //3. If it's already swapped, change to the normal landscape mode + mView->mSharedVideoWidget->setGeometry(pos2); + mView->mReceivedVideoWidget->setGeometry(pos1); + layout = mView->currentLayout(); + QVERIFY( layout == lcLayoutLandscapeDefaultId ); +} + + +void UT_LcView::testToFullScreen() +{ + QString layout; + UT_SET_ORIENTATION( Qt::Horizontal ); + + // Test1: to full screen + mView->init(); + mView->menu()->setVisible( false ); + mView->toFullScreen( true ); + QVERIFY( mEngine->fullScreenMode() ); + // Use the helper function do not invent new one + QVERIFY( !HbStubHelper::isTitleBarVisible() ); + QVERIFY( !HbStubHelper::isStatusBarVisible() ); + QVERIFY( !mView->toolBar()->isVisible() ); + QVERIFY( !mView->mEndCallButton->isVisible() ); + QVERIFY( !mView->mDuration->isVisible() ); + QVERIFY( !mView->mRecipient->isVisible() ); + + // Test2 : not in full screen + mView->init(); + mView->menu()->setVisible( false ); + mView->toFullScreen( false ); + QVERIFY( !mEngine->fullScreenMode() ); + QVERIFY( HbStubHelper::isTitleBarVisible() ); + QVERIFY( HbStubHelper::isStatusBarVisible() ); + QVERIFY( mView->toolBar()->isVisible() ); + QVERIFY( mView->mEndCallButton->isVisible() ); + QVERIFY( mView->mDuration->isVisible() ); + QVERIFY( mView->mRecipient->isVisible() ); + int tId = mView->timerId; + mView->watchInactivity(); + QVERIFY( mView->timerId != tId ); + + // Test3 : menu visible + mView->init(); + mView->menu()->setVisible( false ); + mView->toFullScreen( false ); + mView->menu()->setVisible( true ); + mView->toFullScreen( true ); + QVERIFY( !mEngine->fullScreenMode() ); + QVERIFY( HbStubHelper::isTitleBarVisible() ); + QVERIFY( HbStubHelper::isStatusBarVisible() ); + QVERIFY( mView->toolBar()->isVisible() ); + QVERIFY( mView->mEndCallButton->isVisible() ); + QVERIFY( mView->mDuration->isVisible() ); + QVERIFY( mView->mRecipient->isVisible() ); + tId = mView->timerId; + mView->watchInactivity(); + QVERIFY( mView->timerId != tId ); + + // Test3 : dialpad visible + mView->init(); + delete mView->mDialpad; + mView->mDialpad = new Dialpad(); + mView->toFullScreen( true ); + QVERIFY( !mEngine->fullScreenMode() ); + QVERIFY( HbStubHelper::isTitleBarVisible() ); + QVERIFY( HbStubHelper::isStatusBarVisible() ); + QVERIFY( mView->toolBar()->isVisible() ); + QVERIFY( mView->mEndCallButton->isVisible() ); + QVERIFY( mView->mDuration->isVisible() ); + QVERIFY( mView->mRecipient->isVisible() ); + tId = mView->timerId; + mView->watchInactivity(); + QVERIFY( mView->timerId == tId ); +} + +void UT_LcView::testGestureEvent() +{ + mView->init(); + mView->menu()->setVisible(false); + UT_SET_ORIENTATION( Qt::Horizontal ); + + mView->mSharedVideoWidget->setGeometry(QRectF(5,50, 100, 100)); + mView->mReceivedVideoWidget->setGeometry(QRectF(5,200, 200, 400)); + QList list; + + // Test1: Short tap Event toggle the full screen mode + mEngine->setFullScreenMode(true); + QPointF sharedVideoPos(10,60); + QTapGesture *tapGesture = new QTapGesture(); + tapGesture->setPosition(sharedVideoPos); + HbStubHelper::setGestureStyleHint(HbTapGesture::Tap); + HbStubHelper::setGestureState(Qt::GestureFinished); + list.append(tapGesture); + QGestureEvent event1(list); + mView->gestureEvent(&event1); + QVERIFY( !mEngine->fullScreenMode()); + list.clear(); + + // Test2: Long tap event does not affect full screen mode. + QTapGesture *tapGesture2 = new QTapGesture(); + QPointF receivedVideoPos(10,210); + tapGesture2->setPosition(receivedVideoPos); + HbStubHelper::setGestureState(Qt::GestureUpdated); + HbStubHelper::setGestureStyleHint(HbTapGesture::TapAndHold); + list.append(tapGesture2); + QGestureEvent event3(list); + mEngine->setFullScreenMode(true); + mView->gestureEvent(&event3); + // Ensure it does not affect full screen mode. + QVERIFY( mEngine->fullScreenMode()); + + //Test3: Not Handled States. + HbStubHelper::setGestureState(Qt::GestureStarted); + mEngine->setFullScreenMode(true); + mView->gestureEvent(&event3); + // Ensure its not handled everything remains same + QVERIFY( mEngine->fullScreenMode()); + list.clear(); + + //Test4: Not Handled Event + QSwipeGesture *swipeGesture = new QSwipeGesture(); + list.append(swipeGesture); + QGestureEvent event4(list); + mEngine->setFullScreenMode(true); + mView->gestureEvent(&event4); + // Ensure it does not affect full screen mode. + QVERIFY( mEngine->fullScreenMode()); +} + +void UT_LcView::testContextMenu() +{ + QVERIFY( !mView->mItemContextMenu ); + mView->createContextMenu(); + QVERIFY( mView->mItemContextMenu ); + QVERIFY( mView->mItemContextMenu->isEmpty() ); +} + +void UT_LcView::testGestureLongPress() +{ + QVERIFY( !mView->mItemContextMenu ); + QPointF coordsNoHit(10,10); + mView->gestureLongPress( coordsNoHit ); + QVERIFY( !mView->mItemContextMenu ); + + mView->init(); + HbTransparentWindow* sharedVideoWidget = mView->mSharedVideoWidget; + QVERIFY( sharedVideoWidget != NULL ); + mView->mSharedVideoWidget->setGeometry(QRectF(5,100, 200, 200)); + + QPointF coordsHitSharedVideo(20,150); + mView->gestureLongPress( coordsHitSharedVideo ); + QVERIFY( mView->mItemContextMenu ); + + delete mView->mItemContextMenu; + mView->mItemContextMenu = 0; + + QPointF coordsNoHit2(10,400); + mView->gestureLongPress( coordsNoHit2 ); + QVERIFY( !mView->mItemContextMenu ); + + HbTransparentWindow* receivedVideoWidget = mView->mReceivedVideoWidget; + QVERIFY( receivedVideoWidget != NULL ); + mView->mReceivedVideoWidget->setGeometry(QRectF(5,350, 200, 200)); + + QPointF coordsHitRecievedVideo(10,400); + mView->gestureLongPress( coordsHitRecievedVideo ); + QVERIFY( !mView->mItemContextMenu ); +} + + +void UT_LcView::testGestureShortPress() +{ + mView->init(); + mView->menu()->setVisible(false); + mView->mSharedVideoWidget->setGeometry(QRectF(5,50, 100, 100)); + mView->mReceivedVideoWidget->setGeometry(QRectF(5,200, 200, 400)); + + UT_SET_ORIENTATION( Qt::Horizontal ); + mEngine->setFullScreenMode(true); + mView->gestureShortPress(); + QVERIFY( !mEngine->fullScreenMode()); + + // toggled + mView->gestureShortPress(); + QVERIFY( mEngine->fullScreenMode()); +} + + +void UT_LcView::testTimerEvent() +{ + mView->init(); + // timer time out + QTimerEvent* event = new QTimerEvent( mView->timerId ); + mView->menu()->setVisible(false); + mView->timerEvent( event ); + QVERIFY( mEngine->fullScreenMode()); + QVERIFY( !HbStubHelper::isTitleBarVisible() ); + QVERIFY( !HbStubHelper::isStatusBarVisible() ); + QVERIFY( !mView->toolBar()->isVisible() ); + QVERIFY( !mView->mEndCallButton->isVisible()); + QVERIFY( !mView->mDuration->isVisible()); + QVERIFY( !mView->mRecipient->isVisible()); + delete event; + + // not a timer we want + mView->toFullScreen( false ); + event = new QTimerEvent( 22222 ); // some number + mView->timerEvent( event ); + QVERIFY( !mEngine->fullScreenMode() ); + QVERIFY( HbStubHelper::isTitleBarVisible() ); + QVERIFY( HbStubHelper::isStatusBarVisible() ); + QVERIFY( mView->toolBar()->isVisible() ); + QVERIFY( mView->mEndCallButton->isVisible()); + QVERIFY( mView->mDuration->isVisible()); + QVERIFY( mView->mRecipient->isVisible()); + delete event; +} + +void UT_LcView::testShareImage() +{ + QVERIFY( !lcutStub_LcUiEngine_isImageShared ); + mView->shareImage(); + //QVERIFY( lcutStub_LcUiEngine_isImageShared() ); +} + +void UT_LcView::testUpdateSwapLayout() +{ + mView->init(); + mView->menu()->setVisible(false); + mView->mEndCallButton = mEndCallButton; + UT_SET_ORIENTATION( Qt::Horizontal ); + mEngine->setFullScreenMode(true); + mView->updateSwapLayout(); + QVERIFY( mEngine->fullScreenMode()); + QVERIFY( !HbStubHelper::isTitleBarVisible() ); + QVERIFY( !HbStubHelper::isStatusBarVisible() ); + QVERIFY( !mView->isItemVisible(Hb::DockWidgetItem ) ); + QVERIFY( !mView->mEndCallButton->isVisible()); + QVERIFY( !mView->mDuration->isVisible()); + QVERIFY( !mView->mRecipient->isVisible()); +} + +void UT_LcView::testMenuAboutToShow() +{ + mView->init(); + mView->menu()->setVisible(false); + mView->toFullScreen( true ); + mView->menuAboutToShow(); + QVERIFY( !mEngine->fullScreenMode()); + QVERIFY( HbStubHelper::isTitleBarVisible() ); + QVERIFY( HbStubHelper::isStatusBarVisible() ); + QVERIFY( mView->toolBar()->isVisible() ); + QVERIFY( mView->mEndCallButton->isVisible()); + QVERIFY( mView->mDuration->isVisible()); + QVERIFY( mView->mRecipient->isVisible()); + int tId = mView->timerId; + mView->watchInactivity(); + QVERIFY( mView->timerId != tId ); + +} + +void UT_LcView::testTranslateRectForOrientation() +{ + UT_SET_ORIENTATION( Qt::Horizontal ); + QRectF origRect( 10, 10, 100, 200 ); + QRectF modRect = mView->translateRectForOrientation(origRect); + QVERIFY( modRect.height() == origRect.width() ); + QVERIFY( modRect.width() == origRect.height() ); +} + +void UT_LcView::testTranslatePointForOrientation() +{ + UT_SET_ORIENTATION( Qt::Horizontal ); + QPointF origPoint( 10, 20 ); + QPointF modPoint = mView->translatePointForOrientation(origPoint); + QVERIFY( origPoint != modPoint ); +} + +void UT_LcView::testOpenDialpad() +{ + delete mView; + mView = mRepository->twowayView(); + HbMainWindow& window = *(HbInstance::instance()->allMainWindows().at(0)); + QPointF pos = window.pos(); + window.setOrientation(Qt::Horizontal); + + // init + mView->mRepository.mLayoutSection = lcLayoutLandscapeDefaultId; + mView->menu()->setVisible(true); + + mView->openDialpad(); + + QVERIFY(mView->mDialpad->isOpen()); + QVERIFY(!mView->mDialpad->mIsCallButtonEnabled); + QVERIFY(mView->mRepository.mLayoutSection == lcLayoutLandscapeDialpadId); + QVERIFY( HbStubHelper::isTitleBarVisible() ); + QVERIFY( HbStubHelper::isStatusBarVisible() ); + QCOMPARE(mView->menu()->actions().size(), 0); + QVERIFY(!mView->mEngine.fullScreenMode()); +} + +void UT_LcView::testDialpadOpened() +{ + // no implementation +} + +void UT_LcView::testDialpadClosed() +{ + delete mView; + mView = mRepository->twowayView(); + + // test : no fullscreen,landscape , open and close dialpad scenario + HbMainWindow& window = *(HbInstance::instance()->allMainWindows().at(0)); + window.setOrientation( Qt::Horizontal ); + mView->openDialpad(); + + // Enter some dummy text + mView->mDialpad->editor().setText( QString("1") ); + mView->dialpadClosed(); + // Ensure text is cleared. + + QCOMPARE(mView->mDialpad->editor().text(), QString::fromAscii("")); + QVERIFY(!mView->mDialpad->editor().text().length()); + + // check that layout has changed + QVERIFY(mView->mRepository.layout()!= lcLayoutLandscapeDialpadId); + QVERIFY( HbStubHelper::isTitleBarVisible() ); + QVERIFY( HbStubHelper::isStatusBarVisible() ); + QVERIFY(mView->toolBar()->isVisible()); + QVERIFY(mView->mEndCallButton->isVisible()); + QVERIFY(mView->mRecipient->isVisible()); + QVERIFY(mView->mDuration->isVisible()); + QVERIFY(mView->menu()->isVisible()); + QVERIFY(!mView->mEngine.fullScreenMode()); + + // test : swapped,fullscreen,landscape,open and close dialpad scenario + mView->mRepository.loadLayout( lcLayoutLandscapeSwappedId ); + mView->openDialpad(); + mView->dialpadClosed(); + // check for swapped view appears + QVERIFY( mView->mRepository.layout()== lcLayoutLandscapeSwappedId ); + // check titlebar invisible + QVERIFY( HbStubHelper::isTitleBarVisible() ); + QVERIFY( HbStubHelper::isStatusBarVisible() ); + // check toolbar invisible + QVERIFY( mView->toolBar()->isVisible() ); + QVERIFY(!mView->mEngine.fullScreenMode()); + +} + + +void UT_LcView::testDialpadEditorTextChanged() +{ + delete mView; + mView = mRepository->twowayView(); + + mView->openDialpad(); + //text editor is one character long + QVERIFY( lcutStub_LcUiEngine_getDialToneChar() == '0'); + mView->mDialpad->editor().setText( QString("1") ); + mView->dialpadEditorTextChanged(); + QVERIFY( lcutStub_LcUiEngine_getDialToneChar() == '1' ); + + // We transmit dial tone character sepretly. + mView->mDialpad->editor().setText( QString("12345") ); + mView->dialpadEditorTextChanged(); + QVERIFY( lcutStub_LcUiEngine_getDialToneChar() == '5' ); +} + +void UT_LcView::testBack() +{ + delete mView; + mView = mRepository->twowayView(); + mView->openDialpad(); + mView->back(); + QVERIFY( !mView->mDialpad->isOpen() ); +} + +void UT_LcView::testAddOptionsMenuActions() +{ + delete mView; + mView = mRepository->twowayView(); + + mView->addOptionsMenuActions(); + //TODO: stub implementation of void QGraphicsWidget::addAction(QAction *action); + //QCOMPARE(mView->menu()->actions().size(), 2); +} + +void UT_LcView::testWatchInactivity() +{ + mView->init(); + + // test : in fullscreen mode already, dont start timer again + int tid = mView->timerId ; + mView->mEngine.setFullScreenMode( true ); + mView->watchInactivity(); + QVERIFY( tid==mView->timerId ); + + // test : not in full screen but dialpad view. dont start timer + mView->mEngine.setFullScreenMode( false ); + QVERIFY( mView->mDialpad ); + mView->openDialpad(); + mView->watchInactivity(); + QVERIFY( tid==mView->timerId ); + + // test : not in full screen and no dialpad , start timer + mView->mEngine.setFullScreenMode( false ); + QVERIFY( mView->mDialpad ); + mView->mDialpad->closeDialpad(); + mView->watchInactivity(); + QVERIFY( tid!=mView->timerId ); + +} + + + +void UT_LcView::testIsVideoPositionedCorrectly() +{ + //Test1: Null video Widget returns true + mRepository->mReturnSendVideo = false; + mView->init(); + QVERIFY( !mView->mSharedVideoWidget ); + QVERIFY(mView->isVideoPositionedCorrectly(mView->mSharedVideoWidget)); + + //Test2: Valid Video widgets with correct position returns true: + mRepository->mReturnSendVideo = true; + mView->init(); + QVERIFY( mView->mSharedVideoWidget ); + QVERIFY( mView->isVideoPositionedCorrectly(mView->mSharedVideoWidget )); + + //Test3: Vaild video widgets withi co-ordinates returns false. + mView->mSharedVideoWidget->setPos(QPointF(0,0)); + QVERIFY( mView->mSharedVideoWidget ); + QVERIFY( !mView->isVideoPositionedCorrectly(mView->mSharedVideoWidget )); +} + + +void UT_LcView::testIsPositioned() +{ + //Test: isViewReady is true and proper co-ordinates + mRepository->mReturnSendVideo = true; + mView->init(); + QVERIFY( !mView->isViewReady ); + QVERIFY( mView->mSharedVideoWidget ); + QVERIFY( mView->isVideoPositionedCorrectly(mView->mSharedVideoWidget )); + mView->isPositioned(); + QVERIFY( mView->isViewReady ); + + //Test: isViewReady is false and its first time and co ordinates are 0,0 + mView->isViewReady = false; + mView->mSharedVideoWidget->setPos(QPointF(0,0)); + QVERIFY( mView->mSharedVideoWidget ); + QVERIFY( !mView->isVideoPositionedCorrectly(mView->mSharedVideoWidget )); + mView->isPositioned(); + QVERIFY( !mView->isViewReady ); +} diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ut_lcui/src/ut_lcviewmanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/src/ut_lcviewmanager.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,184 @@ +/* +* 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 +#include +#include +#include +#include "ut_lcviewmanager.h" +#include "lcviewmanager.h" +#include "lcviewmanager_p.h" +#include "ut_lcuidefs.h" +#include "lcuiengine.h" +#include "lcuidefs.h" + +// Simulate completion of queued view change +#define LC_VIEW_CHANGE_COMPLETE( startup ) \ +mViewManager->activateCurrentView( startup ); + +void UT_LcUiViewManager::initTestCase() +{ + lcutStub_LcUiEngine_reset(); + +} + +void UT_LcUiViewManager::cleanupTestCase() +{ + lcutStub_LcUiEngine_reset(); + +} + +void UT_LcUiViewManager::init() +{ + lcutStub_LcUiEngine_reset(); + + mViewManagerDecorator = new LcViewManager( lcEngineName, lcDisplayName ); + mViewManager = mViewManagerDecorator->d_ptr; +} + +void UT_LcUiViewManager::cleanup() +{ + lcutStub_LcUiEngine_reset(); + delete mViewManagerDecorator; +} + +void UT_LcUiViewManager::testConstructor() +{ + QVERIFY( mViewManager ); + QVERIFY( mViewManager->mRepository ); + QVERIFY( mViewManager->mEngine ); + QVERIFY( mViewManager->mMainWindow.viewCount() == 1 ); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutNoCall ) ); + +} + +void UT_LcUiViewManager::testChangeView() +{ + QVERIFY( mViewManager ); + QVERIFY( mViewManager->mMainWindow.viewCount() == 1 ); + + mViewManager->changeView(); + LC_VIEW_CHANGE_COMPLETE( false ) + QVERIFY( mViewManager->mMainWindow.viewCount() == 1 ); + QVERIFY( mViewManager->mMainWindow.currentView()->objectName() == lcViewIdleId ); + + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_updateSession, 0 ) ); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_setOrientation, 1 ) ); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_setContentAreas, 2 ) ); + lcutStub_LcUiEngine_reset(); + + LC_VIEW_CHANGE_COMPLETE( true ) + QVERIFY( mViewManager->mMainWindow.viewCount() == 1 ); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_start ) ); + lcutStub_LcUiEngine_reset(); + + lcutStub_LcUiEngine_setLayout( Lc_ReceivedViewLayout ); + mViewManager->changeView(); + LC_VIEW_CHANGE_COMPLETE( false ) + QVERIFY( mViewManager->mMainWindow.viewCount() == 2 ); + QVERIFY( mViewManager->mMainWindow.currentView()->objectName() == lcViewReceiveId ); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_updateSession, 0 ) ); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_setOrientation, 1 ) ); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_setContentAreas, 2 ) ); + lcutStub_LcUiEngine_reset(); + + lcutStub_LcUiEngine_setLayout( Lc_SharedViewLayout ); + mViewManager->changeView(); + LC_VIEW_CHANGE_COMPLETE( false ) + QVERIFY( mViewManager->mMainWindow.viewCount() == 3 ); + QVERIFY( mViewManager->mMainWindow.currentView()->objectName() == lcViewSendId ); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_updateSession, 0 ) ); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_setOrientation, 1 ) ); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_setContentAreas, 2 ) ); + lcutStub_LcUiEngine_reset(); + + lcutStub_LcUiEngine_setLayout( Lc_TwowayViewLayout ); + mViewManager->changeView(); + QVERIFY( mViewManager->mMainWindow.viewCount() == 4 ); + QVERIFY( mViewManager->mMainWindow.currentView()->objectName() == lcViewTwowayId ); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_setContentAreas ) ); + lcutStub_LcUiEngine_reset(); + + lcutStub_LcUiEngine_setLayout( Lc_ReceivedOnlyViewLayout ); + mViewManager->changeView(); + QVERIFY( mViewManager->mMainWindow.viewCount() == 5 ); + QVERIFY( mViewManager->mMainWindow.currentView()->objectName() == lcViewReceiveOnlyId ); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_setContentAreas ) ); + lcutStub_LcUiEngine_reset(); + + lcutStub_LcUiEngine_setLayout( Lc_AllInOneViewLayout ); + mViewManager->changeView(); + LC_VIEW_CHANGE_COMPLETE( false ) + QVERIFY( mViewManager->mMainWindow.viewCount() == 6 ); + QVERIFY( mViewManager->mMainWindow.currentView()->objectName() == lcViewAllInOneId ); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_updateSession, 0 ) ); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_setOrientation, 1 ) ); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_setContentAreas, 2 ) ); + lcutStub_LcUiEngine_reset(); + + lcutStub_LcUiEngine_setLayout( (LcViewLayoutHint)777 ); + mViewManager->changeView(); + LC_VIEW_CHANGE_COMPLETE( false ) + QVERIFY( mViewManager->mMainWindow.viewCount() == 6 ); + QVERIFY( mViewManager->mMainWindow.currentView()->objectName() == lcViewIdleId ); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_updateSession, 0 ) ); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_setOrientation, 1 ) ); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_setContentAreas, 2 ) ); + lcutStub_LcUiEngine_reset(); + +} + +void UT_LcUiViewManager::testTerminateSession() +{ + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutNoCall ) ); + mViewManager->terminateSession(); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_stop ) ); + + + lcutStub_LcUiEngine_reset(); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutNoCall ) ); + mViewManagerDecorator->terminateSession(); + QVERIFY( lcutStub_LcUiEngine_expectCall( lcutStub_LcUiEngine_stop ) ); +} + +void UT_LcUiViewManager::testPrepareOrientationChange() +{ + mViewManager->prepareOrientationChange(); +} + +void UT_LcUiViewManager::testMainWindowEvent() +{ + QSignalSpy spy( &mViewManager->mMainWindow, SIGNAL(appFocusGained()) ); + // Not interesting event + QEvent event(QEvent::MaxUser); + mViewManager->mMainWindow.event(&event); + QVERIFY( spy.count() == 0 ); + + // Focus in event + QEvent event2(QEvent::FocusIn); + mViewManager->mMainWindow.event(&event2); + QVERIFY( spy.count() == 1 ); + + QSignalSpy spy2( &mViewManager->mMainWindow, SIGNAL(appFocusLost()) ); + // Focus in event + QEvent event3(QEvent::FocusOut); + mViewManager->mMainWindow.event(&event3); + QVERIFY( spy2.count() == 1 ); +} + +// end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcui/tsrc/ut_lcui/ut_lcui.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcui/tsrc/ut_lcui/ut_lcui.pro Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,101 @@ +# +# 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 = + +QT += testlib xml +CONFIG += hb qtestlib dll + +MUS_DIR = ../../../../.. +LCUI_DIR = ../.. +LCUIENGINE_DIR = ../../../lcuiengine + +RESOURCES += $$LCUI_DIR/livecommsui.qrc + +DEFINES += UNIT_TESTING +DEFINES += QT_NO_DEBUG_OUTPUT + +DEPENDPATH += . +INCLUDEPATH += . +INCLUDEPATH += $$LCUI_DIR/inc +INCLUDEPATH += hbstubs +INCLUDEPATH += $$MUS_DIR/tsrc/qtestutils/inc +INCLUDEPATH += $$MUS_DIR/mmsharinguis_plat/live_comms_plugin_api/inc +INCLUDEPATH += /epoc32/include/ecom +INCLUDEPATH += /epoc32/include/platform/app + +# Input +HEADERS += inc/ut_lcviewmanager.h +HEADERS += $$LCUI_DIR/inc/lcviewmanager.h +HEADERS += $$LCUI_DIR/inc/lcviewmanager_p.h +HEADERS += inc/ut_lcuicomponentrepository.h +HEADERS += $$LCUI_DIR/inc/lcuicomponentrepository.h +HEADERS += inc/ut_lcview.h +HEADERS += $$LCUI_DIR/inc/lcview.h +HEADERS += inc/ut_lceffecthandler.h +HEADERS += $$LCUI_DIR/inc/lceffecthandler.h +HEADERS += inc/ut_lcvideowidget.h +HEADERS += $$LCUI_DIR/inc/lcvideowidget.h +HEADERS += $$LCUIENGINE_DIR/inc/lcuiengine.h +HEADERS += ./hbstubs/dialpad.h +HEADERS += ./hbstubs/dialpadvtkeyhandler.h +HEADERS += ./hbstubs/hblineedit.h + +SOURCES += src/main.cpp +SOURCES += hbstubs/hbstubs.cpp +SOURCES += hbstubs/dialpad_stub.cpp +SOURCES += hbstubs/dialpadvtkeyhandler_stub.cpp +SOURCES += src/ut_lcviewmanager.cpp +SOURCES += $$LCUI_DIR/src/lcviewmanager.cpp +SOURCES += $$LCUI_DIR/src/lcviewmanager_p.cpp +SOURCES += src/ut_lcuicomponentrepository.cpp +SOURCES += $$LCUI_DIR/src/lcuicomponentrepository.cpp +SOURCES += src/ut_lcview.cpp +SOURCES += $$LCUI_DIR/src/lcview.cpp +SOURCES += src/ut_lceffecthandler.cpp +SOURCES += $$LCUI_DIR/src/lceffecthandler.cpp +SOURCES += src/ut_lcvideowidget.cpp +SOURCES += $$LCUI_DIR/src/lcvideowidget.cpp +SOURCES += $$LCUIENGINE_DIR/src/lcuiengine.cpp +SOURCES += $$MUS_DIR/tsrc/qtestutils/src/testresultxmlparser.cpp + + +symbian: { + DEFINES += BUILD_SYMBIAN + + INCLUDEPATH += $$LCUIENGINE_DIR/inc + + SOURCES += lcuiengine_stub/symbian/stub_lcuiengine_p.cpp + HEADERS += $$LCUIENGINE_DIR/inc/lcuiengine_p.h + + LIBS += -lecom -lflogger -lws32 -lbafl + + TARGET.CAPABILITY = ALL -TCB + TARGET.EPOCALLOWDLLDATA = 1 + TARGET.EPOCHEAPSIZE = 0x020000 0x800000 +} + +win32: { + INCLUDEPATH += $$LCUI_DIR/mmshlcuiengine/win32 + INCLUDEPATH += inc + INCLUDEPATH += $$LCUIENGINE_DIR/tsrc/win32 + INCLUDEPATH += $$LCUIENGINE_DIR/inc + + SOURCES += lcuiengine_stub/win32/stub_lcuiengine_p.cpp + HEADERS += $$LCUIENGINE_DIR/tsrc/win32/lcuiengine_p.h +} diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcuiengine/inc/lcactivitymanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcuiengine/inc/lcactivitymanager.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,69 @@ +/* +* 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 LCACTIVITYMANAGER_H +#define LCACTIVITYMANAGER_H + +// INCLUDES +#include + +// FORWARD DECLARATION + +// CLASS DECLARATION + +/** + * + */ +class LcActivityManager : public QObject +{ + friend class UT_LcActivityManager; + Q_OBJECT + +public: + + explicit LcActivityManager(); + ~LcActivityManager(); + +public slots: + + void enableActivitySimulation(bool enable); + +public: + + bool isActivitySimulationEnabled(); + + +private: + + int initInactivityTimeout(); + void stopTimer(); + void restartTimer(); + + //from QObject + void timerEvent(QTimerEvent *event); + +private: + + int mTimerId; + int mInactivityTimeout; + +}; + +#endif // LCACTIVITYMANAGER_H + + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcuiengine/inc/lcuiengine.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcuiengine/inc/lcuiengine.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,181 @@ +/* +* 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 LCUIENGINE_H +#define LCUIENGINE_H + +//USER + +//SYSTEM +#include +#include +#include + +class QTimer; +class HbProgressDialog; +class HbDialog; +class QRectF; +class LcUiEnginePrivate; +class HbView; + +const char lcEngSignalNameMuted[] = "muted"; +const char lcEngSignalNameUnmuted[] = "unmuted"; +const char lcEngSignalNameSpeakerEnabled[] = "speakerEnabled"; +const char lcEngSignalNameSpeakerDisabled[] = "speakerDisabled"; +const char lcEngSignalNameCameraChangedToMain[] = "cameraChangedToMain"; +const char lcEngSignalNameCameraChangedToSecondary[] = "cameraChangedToSecondary"; +const char lcEngSignalNameCameraEnabled[] = "cameraEnabled"; +const char lcEngSignalNameCameraDisabled[] = "cameraDisabled"; + + +/* + * Supported views + */ +enum LcViewLayoutHint { + Lc_NoViewLayout = -1, + Lc_IdleViewLayout, + Lc_SharedViewLayout, + Lc_ReceivedViewLayout, + Lc_ReceivedOnlyViewLayout, + Lc_TwowayViewLayout, + Lc_AllInOneViewLayout +}; + + +/* + * Struct of values for control + */ +class LcControlValues { +public: + int mMaxValue; + int mMinValue; + int mValue; +}; + +/* + * Live Comms UI Engine + */ +class LcUiEngine : public QObject +{ + Q_OBJECT + friend class UT_LcUiEngine; + +public: + //constructor + explicit LcUiEngine(const QString &engineName, + const QString &applicationDisplayName); + //destructor + ~LcUiEngine(); + +signals: + + //signaled when engine is stopped + void stopped(); + //signaled when layout is changed + void layoutChanged(); + //signaled when camera changes to main + void cameraChangedToMain(); + //signaled when camera changes to secondary + void cameraChangedToSecondary(); + //signaled when mic is muted + void muted(); + //signaled when mic is unmuted + void unmuted(); + //signaled when speaker is enabled + void speakerEnabled(); + //signaled when speaker is disabled + void speakerDisabled(); + //signaled when camera is disabled + void cameraDisabled(); + //signaled when camera is enabled + void cameraEnabled(); + //signaled when engine is blocked, + //no calls expected until signaled unblocked + void blocked(); + //signaled when engine is free + void unblocked(); + //signaled continuously while session is up and running + //carries current session duration + void sessionDurationChanged(const QString &duration); + void recipientChanged(const QString &recipient); + void phoneNumberChanged(const QString &number); + //signaled when player state changed + void localPlayerPlaying(); + void remotePlayerPlaying(); + void localPlayerPreparing(); + void remotePlayerPreparing(); + void localPlayerBuffering(); + void remotePlayerBuffering(); + void localPlayerPaused(); + void remotePlayerPaused(); + void localPlayerUnavailable(); + void remotePlayerUnavailable(); + +public slots: + + void zoom( int value ); + void stop(); + void minimize(); + void maximize(); + +public: // API + + void start(); + const QString& sessionTitle() const; + const QString& recipient() const; + const QString& phoneNumber() const; + LcViewLayoutHint viewLayout() const; + void setContentAreas(const QRectF& sharedContent, + const QRectF& receivedContent); + bool setOrientation(Qt::Orientation orientation); + void setUiComponents(HbProgressDialog* invitingNote, + HbProgressDialog* waitingNote, + HbDialog* acceptQuery, + HbDialog* recipientQuery, + HbDialog* shareOwnVideoQuery); + void toggleMute(); + bool isMuted() const; + void toggleSpeaker(); + bool isSpeakerOn() const; + int zoomValues(LcControlValues& values) const; + void toggleDisableCamera(); + void setMainCamera(const bool aMainCamera); + bool mainCamera() const; + void toggleCamera(); + bool fullScreenMode(); + void setFullScreenMode(bool aMode); + void updateSession(); + bool isLocalPlayerPlaying() const; + bool isRemotePlayerPlaying() const; + bool isMinimized()const; + bool isMaximized()const{return !isMinimized();}; + void shareImage(const QString&); + void shareCamera(); + void setCurrentView(HbView* view); + bool SendDialTone( const QChar aKey ); + + +private: + + LcUiEnginePrivate* d; + +friend class LcUiEnginePrivate; // access to signals +}; + +#endif // LCUIENGINE_H + + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcuiengine/inc/lcuiengine_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcuiengine/inc/lcuiengine_p.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,201 @@ +/* +* 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 LCUIENGINEPRIVATE_H +#define LCUIENGINEPRIVATE_H + +//USER +#include "lcsessionobserver.h" +#include "lcuiprovider.h" + +//SYSTEM +#include +#include +#include +#include +#include + +class MLcSession; +class MLcAudioControl; +class MLcZoomControl; +class HbDialog; +class HbMessageBox; +class QTimer; +class QRectF; +class LcUiEngine; +class HbView; +class LcActivityManager; + +/* + * Live Comms UI Engine + */ +class LcUiEnginePrivate : public QObject, + public MLcSessionObserver, + public MLcUiProvider +{ + Q_OBJECT + friend class UT_LcUiEngine; + +public: + + explicit LcUiEnginePrivate(LcUiEngine& uiEngine, + const QString &engineName, + const QString &applicationDisplayName); + ~LcUiEnginePrivate(); + +public slots: + + void zoom( int value ); + void stop(); + void stopLocalVideo(); + void startLocalVideo(); + +public: // API + + void start(); + const QString& sessionTitle() const; + const QString& recipient() const; + const QString& phoneNumber() const; + LcViewLayoutHint viewLayout() const; + void setContentAreas(const QRectF& sharedContent, + const QRectF& receivedContent); + bool setOrientation(Qt::Orientation orientation ); + void setUiComponents(HbProgressDialog* invitingNote, + HbProgressDialog* waitingNote, + HbDialog* acceptQuery, + HbDialog* recipientQuery, + HbDialog* shareOwnVideoQuery ); + void toggleMute(); + bool isMuted() const; + void toggleSpeaker(); + bool isSpeakerOn() const; + int zoomValues( LcControlValues& values ) const; + void toggleDisableCamera(); + void setMainCamera(const bool aMainCamera); + bool mainCamera() const; + void toggleCamera(); + bool fullScreenMode(); + void setFullScreenMode(bool aMode); + void updateSession(); + bool isLocalPlayerPlaying() const; + bool isRemotePlayerPlaying() const; + bool isMinimized()const; + void minimize(); + void maximize(); + void shareImage(const QString&){}; + void shareCamera(){}; + void setCurrentView(HbView* view); + bool SendDialTone(const QChar aKey ); + +protected: // From QObject + + void timerEvent(QTimerEvent *event); + +private slots: + + void startReceiving(); + void stopForcefully(); + void handleEngineForegroundStatus(); + +private: // From MLcSessionObserver + + void StateChanged( MLcSession& aSession ); + void StateChanged( MLcVideoPlayer& aPlayer ); + void Updated( MLcSession& aSession ); + void Updated( MLcVideoPlayer& aPlayer ); + void Failed( MLcSession& aSession, TInt aError ); + void Failed( MLcVideoPlayer& aPlayer, TInt aError ); + void SessionTimeChanged( MLcSession& aSession, const TTimeIntervalSeconds& aSeconds ); + +private: // From MLcUiProvider + + TBool SelectRecipient( MDesCArray& aRecipientAddresses, TDes& aSelectedRecipientAddress ); + TBool InputRecipient( TDes& aRecipientAddress ); + void HandleForegroundStatus( TBool aForeground ); + void BlockUi( TBool aBlocked ); + +private: // New functions + + LcViewLayoutHint setViewLayout(); + void emitViewLayoutChanged(); + void startLiveContent(); + void startPlayback(); + void startRemoteVideo(); + void startCloseTimer(); + void cancelCloseTimer(); + void hideNotes( bool hideWaitingNote ); + void completeAction( const char* actionMethod ); + void setPendingAction( const char* actionMethod ); + void completePendingAction(); + bool usingVideoTelephoneEngine(); + MLcSession& session() const; + MLcVideoPlayer* visibleLocalPlayer() const; + MLcVideoPlayer* visibleRemotePlayer() const; + MLcAudioControl* audioControl() const; + MLcZoomControl* zoomControl() const; + bool featureSupported( CLcEngine::TLcFeature feature ); + void startSessionDurationTimer(); + void stopSessionDurationTimer(); + void fillRemoteInfo(bool informChanges); + void startStopGuardTimer(); + bool isAllowedToShareVideo(); + +private: // New functions wrapping the leaving functions in LC plug-in API + + int establishSession(); + int terminateSession(); + int setWindowRect( MLcVideoPlayer* player, TRect rect ); + int enableWindow( MLcVideoPlayer* player, bool enable ); + int play( MLcVideoPlayer* player ); + int pause( MLcVideoPlayer* player ); + int enableSpeaker( bool enable ); + int muteMic( bool mute ); + +private: // Data + + QByteArray mEngineName; + QString mSessionTitle; + QString mRecipient; + QString mPhoneNumber; + LcViewLayoutHint mViewLayout; + CLcEngine* mLiveCommsEngine; + QTimer* mCloseTimer; + HbProgressDialog* mInvitingNote; // Not owned + HbProgressDialog* mWaitingNote; // Not owned + HbDialog* mAcceptQuery; // Not owned + HbDialog* mRecipientQuery; // Not owned + HbDialog* mShareOwnVideoQuery; // Not Owned + QString mPendingAction; + bool mBlocked; + bool mFullScreen; + int mSessionDurationTimerId; + QTime mSessionDurationStartTime; + bool mMainCamera; + LcUiEngine& mUiEngine; + bool mIsMinimized; + bool mFirstForegroundSwitch; + HbView* mCurrentView; // Not owned + TRect mLocalRect; + TRect mRemoteRect; + LcActivityManager* mActivityManager; + +friend class LcUiEngine; +}; + +#endif // LCUIENGINEPRIVATE_H + + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcuiengine/src/lcactivitymanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcuiengine/src/lcactivitymanager.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,138 @@ +/* +* 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: +* +*/ + +// INCLUDES +#include +#include +#include +#include +#include "lcactivitymanager.h" +#include "lclogger.h" + + +const int lcDefaultInactivityTimeout = 5; //timeout in seconds, used if fetching + //value from cenrep fails +const int lcInvalidTimerId = -1; + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +LcActivityManager::LcActivityManager() : + mTimerId(lcInvalidTimerId) +{ + if (initInactivityTimeout() != 0) { + mInactivityTimeout = lcDefaultInactivityTimeout; + } +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +LcActivityManager::~LcActivityManager() +{ + stopTimer(); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void LcActivityManager::enableActivitySimulation(bool enable) +{ + if (enable) { + restartTimer(); + } else { + stopTimer(); + } +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +bool LcActivityManager::isActivitySimulationEnabled() +{ + return (mTimerId != lcInvalidTimerId); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +int LcActivityManager::initInactivityTimeout() +{ + CRepository* repository = 0; + TRAPD(err, repository = CRepository::NewL(KCRUidLightSettings)); + if (err == KErrNone) { + // Let's fetching display light timeout value (in seconds ) + TInt displayTimeOut(0); + err = repository->Get(KDisplayLightsTimeout, displayTimeOut); + if (displayTimeOut > 2) { + //taking away 2 seconds just in case, to ensure we keep + //simulating user activity frequently enough + displayTimeOut -= 2; + } + mInactivityTimeout = displayTimeOut; + } + delete repository; + return err; +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void LcActivityManager::stopTimer() +{ + if (mTimerId != lcInvalidTimerId) { + killTimer(mTimerId); + mTimerId = lcInvalidTimerId; + } +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void LcActivityManager::restartTimer() +{ + stopTimer(); + + int timeLeftInSeconds = mInactivityTimeout - User::InactivityTime().Int(); + if ( timeLeftInSeconds < 1 ) { + User::ResetInactivityTime(); + timeLeftInSeconds = mInactivityTimeout; + } + + LC_QDEBUG_2( "livecomms [UI] -> LcActivityManager::startTimer(), interval: ", timeLeftInSeconds); + + mTimerId = startTimer(timeLeftInSeconds*1000); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void LcActivityManager::timerEvent(QTimerEvent* event) +{ + if (event->timerId() == mTimerId) { + LC_QDEBUG( "livecomms [UI] -> LcActivityManager::timerEvent()" ); + restartTimer(); + } +} diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcuiengine/src/lcuiengine.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcuiengine/src/lcuiengine.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,382 @@ +/* +* 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: +* +*/ + +//USER +#include "lcuiengine_p.h" +#include "lcuiengine.h" +#include "lclogger.h" + + +// ----------------------------------------------------------------------------- +// LcUiEngine::LcUiEngine +// ----------------------------------------------------------------------------- +// +LcUiEngine::LcUiEngine( const QString& engineName, + const QString& applicationDisplayName ) +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEngine::LcUiEngine()" ) + d = new LcUiEnginePrivate( *this,engineName,applicationDisplayName ); + LC_QDEBUG( "livecomms [UI] <- LcUiEngine::LcUiEngine()" ) +} + +// ----------------------------------------------------------------------------- +// LcUiEngine::~LcUiEngine +// ----------------------------------------------------------------------------- +// +LcUiEngine::~LcUiEngine() +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEngine::~LcUiEngine()" ) + delete d; + LC_QDEBUG( "livecomms [UI] <- LcUiEngine::~LcUiEngine()" ) +} + +// ----------------------------------------------------------------------------- +// LcUiEngine::zoom +// ----------------------------------------------------------------------------- +// +void LcUiEngine::zoom( int value ) +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEngine::zoom()" ) + d->zoom(value); + LC_QDEBUG( "livecomms [UI] <- LcUiEngine::zoom()" ) +} + +// ----------------------------------------------------------------------------- +// LcUiEngine::stop +// ----------------------------------------------------------------------------- +// +void LcUiEngine::stop() +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEngine::stop()" ) + d->stop(); + LC_QDEBUG( "livecomms [UI] <- LcUiEngine::stop()" ) +} + +// ----------------------------------------------------------------------------- +// LcUiEngine::start +// ----------------------------------------------------------------------------- +// +void LcUiEngine::start() +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEngine::start()" ) + d->start(); + LC_QDEBUG( "livecomms [UI] <- LcUiEngine::start()" ) +} + +// ----------------------------------------------------------------------------- +// LcUiEngine::sessionTitle +// ----------------------------------------------------------------------------- +// +const QString& LcUiEngine::sessionTitle() const +{ + LC_QDEBUG( "livecomms [UI] <-> LcUiEngine::sessionTitle()" ) + return d->sessionTitle(); +} + +// ----------------------------------------------------------------------------- +// LcUiEngine::recipient +// ----------------------------------------------------------------------------- +// +const QString& LcUiEngine::recipient() const +{ + LC_QDEBUG( "livecomms [UI] <-> LcUiEngine::recipient()" ) + return d->recipient(); +} + +// ----------------------------------------------------------------------------- +// LcUiEngine::phoneNumber +// ----------------------------------------------------------------------------- +// +const QString& LcUiEngine::phoneNumber() const +{ + LC_QDEBUG( "livecomms [UI] <-> LcUiEngine::phoneNumber()" ) + return d->phoneNumber(); +} + +// ----------------------------------------------------------------------------- +// LcUiEngine::viewLayout +// ----------------------------------------------------------------------------- +// +LcViewLayoutHint LcUiEngine::viewLayout() const +{ + LC_QDEBUG( "livecomms [UI] <-> LcUiEngine::viewLayout()" ) + return d->viewLayout(); +} + +// ----------------------------------------------------------------------------- +// LcUiEngine::setContentAreas +// ----------------------------------------------------------------------------- +// +void LcUiEngine::setContentAreas( const QRectF& sharedContent, + const QRectF& receivedContent ) +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEngine::setContentAreas()" ) + d->setContentAreas( sharedContent,receivedContent ); + LC_QDEBUG( "livecomms [UI] <- LcUiEngine::setContentAreas()" ) +} + +// ----------------------------------------------------------------------------- +// LcUiEngine::setOrientation +// ----------------------------------------------------------------------------- +// +bool LcUiEngine::setOrientation( Qt::Orientation orientation ) +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEngine::setOrientation()" ) + bool ret = d->setOrientation( orientation ); + LC_QDEBUG( "livecomms [UI] <- LcUiEngine::setOrientation()" ) + return ret; +} + +// ----------------------------------------------------------------------------- +// LcUiEngine::setUiComponents +// ----------------------------------------------------------------------------- +// +void LcUiEngine::setUiComponents( HbProgressDialog* invitingNote, + HbProgressDialog* waitingNote, + HbDialog* acceptQuery, + HbDialog* recipientQuery, + HbDialog* shareOwnVideoQuery ) +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEngine::setUiComponents()" ) + d->setUiComponents( invitingNote,waitingNote,acceptQuery,recipientQuery, + shareOwnVideoQuery ); + LC_QDEBUG( "livecomms [UI] <- LcUiEngine::setUiComponents()" ) +} + +// ----------------------------------------------------------------------------- +// LcUiEngine::toggleMute +// ----------------------------------------------------------------------------- +// +void LcUiEngine::toggleMute() +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEngine::toggleMute()" ) + d->toggleMute(); + LC_QDEBUG( "livecomms [UI] <- LcUiEngine::toggleMute()" ) +} + +// ----------------------------------------------------------------------------- +// LcUiEngine::isMuted +// ----------------------------------------------------------------------------- +// +bool LcUiEngine::isMuted() const +{ + LC_QDEBUG( "livecomms [UI] <-> LcUiEngine::isMuted()" ) + return d->isMuted(); +} + +// ----------------------------------------------------------------------------- +// LcUiEngine::toggleSpeaker +// ----------------------------------------------------------------------------- +// +void LcUiEngine::toggleSpeaker() +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEngine::toggleSpeaker()" ) + d->toggleSpeaker(); + LC_QDEBUG( "livecomms [UI] <- LcUiEngine::toggleSpeaker()" ) +} + +// ----------------------------------------------------------------------------- +// LcUiEngine::isSpeakerOn +// ----------------------------------------------------------------------------- +// +bool LcUiEngine::isSpeakerOn() const +{ + LC_QDEBUG( "livecomms [UI] <-> LcUiEngine::isSpeakerOn()" ) + return d->isSpeakerOn(); +} + +// ----------------------------------------------------------------------------- +// LcUiEngine::zoomValues +// ----------------------------------------------------------------------------- +// +int LcUiEngine::zoomValues( LcControlValues& values ) const +{ + LC_QDEBUG( "livecomms [UI] <-> LcUiEngine::zoomValues()" ) + return d->zoomValues(values); +} + +// ----------------------------------------------------------------------------- +// LcUiEngine::toggleEnableCamera +// ----------------------------------------------------------------------------- +// +void LcUiEngine::toggleDisableCamera() +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEngine::toggleDisableCamera()" ) + d->toggleDisableCamera(); + LC_QDEBUG( "livecomms [UI] <- LcUiEngine::toggleDisableCamera()" ) +} + +// ----------------------------------------------------------------------------- +// LcUiEngine::setCameraMain +// ----------------------------------------------------------------------------- +// +void LcUiEngine::setMainCamera(const bool aMainCamera) +{ + LC_QDEBUG_2( "livecomms [UI] -> LcUiEngine::setCameraMain()", aMainCamera ) + d->setMainCamera( aMainCamera ); + LC_QDEBUG( "livecomms [UI] <- LcUiEngine::setCameraMain()" ) +} + +// ----------------------------------------------------------------------------- +// LcUiEngine::cameraIndex +// ----------------------------------------------------------------------------- +// +bool LcUiEngine::mainCamera() const +{ + LC_QDEBUG( "livecomms [UI] <-> LcUiEngine::mainCamera()" ) + return d->mainCamera(); +} + +// ----------------------------------------------------------------------------- +// LcUiEngine::toggleCamera +// ----------------------------------------------------------------------------- +// +void LcUiEngine::toggleCamera() +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEngine::toggleCamera()" ) + d->toggleCamera(); + LC_QDEBUG( "livecomms [UI] <- LcUiEngine::toggleCamera()" ) +} + +// ----------------------------------------------------------------------------- +// LcUiEngine::fullScreenMode +// ----------------------------------------------------------------------------- +// +bool LcUiEngine::fullScreenMode() +{ + LC_QDEBUG( "livecomms [UI] <-> LcUiEngine::fullScreenMode()" ) + return d->fullScreenMode(); +} + +// ----------------------------------------------------------------------------- +// LcUiEngine::setFullScreenMode +// ----------------------------------------------------------------------------- +// +void LcUiEngine::setFullScreenMode(bool aMode) +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEngine::setFullScreenMode()" ) + d->setFullScreenMode( aMode ); + LC_QDEBUG( "livecomms [UI] <- LcUiEngine::setFullScreenMode()" ) +} + + +// ----------------------------------------------------------------------------- +// LcUiEngine::updateSession +// ----------------------------------------------------------------------------- +// +void LcUiEngine::updateSession() +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEngine::updateSession()" ) + d->updateSession(); + LC_QDEBUG( "livecomms [UI] <- LcUiEngine::updateSession()" ) +} + +// ----------------------------------------------------------------------------- +// LcUiEngine::isLocalPlayerPlaying +// ----------------------------------------------------------------------------- +// +bool LcUiEngine::isLocalPlayerPlaying() const +{ + LC_QDEBUG( "livecomms [UI] <-> LcUiEngine::isLocalPlayerPlaying()" ) + return d->isLocalPlayerPlaying(); +} + +// ----------------------------------------------------------------------------- +// LcUiEngine::isRemotePlayerPlaying +// ----------------------------------------------------------------------------- +// +bool LcUiEngine::isRemotePlayerPlaying() const +{ + LC_QDEBUG( "livecomms [UI] <-> LcUiEngine::isRemotePlayerPlaying()" ) + return d->isRemotePlayerPlaying(); +} + +// ----------------------------------------------------------------------------- +// LcUiEngine::isMinimized +// ----------------------------------------------------------------------------- +// +bool LcUiEngine::isMinimized() const +{ + LC_QDEBUG( "livecomms [UI] <-> LcUiEngine::isMinimized()" ) + return d->isMinimized(); +} + +// ----------------------------------------------------------------------------- +// LcUiEngine::minimize +// ----------------------------------------------------------------------------- +// +void LcUiEngine::minimize() +{ + LC_QDEBUG( "livecomms [UI] <-> LcUiEngine::minimize()" ) + // TODO : Remove this function when XqServiceUtil taken into use compleatly + d->minimize(); +} + +// ----------------------------------------------------------------------------- +// LcUiEngine::maximize +// ----------------------------------------------------------------------------- +// +void LcUiEngine::maximize() +{ + LC_QDEBUG( "livecomms [UI] <-> LcUiEngine::maximize()" ) + // TODO : Remove this function when XqServiceUtil taken into use compleatly + d->maximize(); +} + +// ----------------------------------------------------------------------------- +// LcUiEngine::shareImage +// ----------------------------------------------------------------------------- +// +void LcUiEngine::shareImage(const QString& fileName) +{ + LC_QDEBUG( "livecomms [UI] <-> LcUiEngine::shareImage()" ) + d->shareImage(fileName); +} + +// ----------------------------------------------------------------------------- +// LcUiEngine::shareCamera +// ----------------------------------------------------------------------------- +// +void LcUiEngine::shareCamera() +{ + LC_QDEBUG( "livecomms [UI] <-> LcUiEngine::shareCamera()" ) + d->shareCamera(); +} + +// ----------------------------------------------------------------------------- +// LcUiEngine::setCurrentView +// ----------------------------------------------------------------------------- +// +void LcUiEngine::setCurrentView(HbView* view) +{ + LC_QDEBUG( "livecomms [UI] <-> LcUiEngine::setCurrentView()" ) + d->setCurrentView(view); +} + + +// ----------------------------------------------------------------------------- +// LcUiEngine::SendDialTone +// ----------------------------------------------------------------------------- +// + +bool LcUiEngine::SendDialTone( const QChar aKey ) +{ + return d->SendDialTone(aKey); +} + + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcuiengine/src/lcuiengine_p.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcuiengine/src/lcuiengine_p.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,1459 @@ +/* +* 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: +* +*/ + +//USER +#include "lcuiengine_p.h" +#include "lcuidefs.h" +#include "lclogger.h" +#include "lcactivitymanager.h" + +//SYSTEM +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + + +#define LC_VTPLUGIN_NAME "Videotelephony"; + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::LcUiEnginePrivate +// ----------------------------------------------------------------------------- +// +LcUiEnginePrivate::LcUiEnginePrivate(LcUiEngine& uiEngine, + const QString& engineName, + const QString& applicationDisplayName) + : mEngineName( engineName.toUtf8() ), + mSessionTitle( applicationDisplayName ), + mViewLayout( Lc_IdleViewLayout ), + mLiveCommsEngine( 0 ), + mCloseTimer(0), + mInvitingNote(0), + mWaitingNote(0), + mAcceptQuery(0), + mRecipientQuery(0), + mShareOwnVideoQuery(0), + mBlocked(false), + mFullScreen(false), + mSessionDurationTimerId(0), + mMainCamera(true), + mUiEngine( uiEngine ), + mIsMinimized(false), + mFirstForegroundSwitch(true), + mCurrentView(0), + mActivityManager(0) +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEnginePrivate::LcUiEnginePrivate()" ) + + mPendingAction.clear(); + + TPtrC8 name( reinterpret_cast< const TUint8* >( mEngineName.constData() ) ); + // TODO: + // Replace the TRAPs with QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION (Qt4.5.2) + TRAPD( err, mLiveCommsEngine = CLcEngine::NewL( name ) ); + if ( err != KErrNone ) { + // Cannot proceed with the execution, exit the application + LC_QDEBUG_2( "livecomms [UI] <- LcUiEnginePrivate::LcUiEnginePrivate(), failed:", err ) + qApp->exit(err); + return; + } + + mLiveCommsEngine->Session().SetLcSessionObserver( this ); + mLiveCommsEngine->Session().SetLcUiProvider( this ); + + fillRemoteInfo( false ); + + if ( usingVideoTelephoneEngine() ) { + mViewLayout = Lc_AllInOneViewLayout; + } + + LC_QDEBUG( "livecomms [UI] Setting window for plug-in" ) + CCoeControl* coeControl = + reinterpret_cast( + HbInstance::instance()->allMainWindows().at(0)->winId()); + if ( coeControl ) { + TInt windowPtr = reinterpret_cast(coeControl->DrawableWindow()); + // Return value ignored as plugin may not be interested about window + mLiveCommsEngine->Session().SetParameter(0,windowPtr); + } + + mActivityManager = new LcActivityManager; + + LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::LcUiEnginePrivate()" ) +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::~LcUiEnginePrivate +// ----------------------------------------------------------------------------- +// +LcUiEnginePrivate::~LcUiEnginePrivate() +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEnginePrivate::~LcUiEnginePrivate()" ) + delete mLiveCommsEngine; + delete mCloseTimer; + delete mActivityManager; + LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::~LcUiEnginePrivate()" ) +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::zoom +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::zoom( int value ) +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEnginePrivate::zoom()" ) + + // TODO: Replace TRAP with QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION (Qt4.5.2) + MLcZoomControl* zoom = zoomControl(); + if ( zoom ) { + TRAP_IGNORE( zoom->SetLcZoomValueL( value ) ); + } + + LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::zoom()" ) +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::stop +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::stop() +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEnginePrivate::stop()" ) + + mActivityManager->enableActivitySimulation(false); + + stopSessionDurationTimer(); + cancelCloseTimer(); + hideNotes( true ); + + // Start guard timer already before terminate call just in case + // something goes horribly wrong in termination + startStopGuardTimer(); + + int err = terminateSession(); + + if ( !err && session().LcSessionState() == MLcSession::EClosing ) { + LC_QDEBUG( "livecomms [UI] not closing UI yet, waiting for session termination..." ) + } else { + LC_QDEBUG( "livecomms [UI] closing UI..." ) + emit mUiEngine.stopped(); + } + LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::stop()" ) +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::start +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::start() +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEnginePrivate::start()" ) + + mActivityManager->enableActivitySimulation(true); + + if ( session().LcSessionState() != MLcSession::EReceived ) { + startLiveContent(); + } else { + //wait callback + LC_QDEBUG( "livecomms [UI] MT start waiting callback" ) + } + + LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::start()" ) +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::sessionTitle +// ----------------------------------------------------------------------------- +// +const QString& LcUiEnginePrivate::sessionTitle() const +{ + return mSessionTitle; +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::recipient +// ----------------------------------------------------------------------------- +// +const QString& LcUiEnginePrivate::recipient() const +{ + return ( mRecipient.isEmpty() ) ? mPhoneNumber : mRecipient; +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::phoneNumber +// ----------------------------------------------------------------------------- +// +const QString& LcUiEnginePrivate::phoneNumber() const +{ + return mPhoneNumber; +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::viewLayout +// ----------------------------------------------------------------------------- +// +LcViewLayoutHint LcUiEnginePrivate::viewLayout() const +{ + return mViewLayout; +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::setContentAreas +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::setContentAreas( const QRectF& sharedContent, + const QRectF& receivedContent ) +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEnginePrivate::setContentAreas()" ) + LC_QDEBUG_2( "livecomms [UI] shared window: ", sharedContent ) + LC_QDEBUG_2( "livecomms [UI] received window: ", receivedContent ) + + mLocalRect = TRect(); + mRemoteRect = TRect(); + + if ( sharedContent.height() != 0 ) { + mLocalRect.SetRect( sharedContent.topLeft().x(), + sharedContent.topLeft().y(), + sharedContent.bottomRight().x(), + sharedContent.bottomRight().y() ); + } + + if ( receivedContent.height() != 0 ) { + mRemoteRect.SetRect( receivedContent.topLeft().x(), + receivedContent.topLeft().y(), + receivedContent.bottomRight().x(), + receivedContent.bottomRight().y() ); + } + + setWindowRect( session().LocalVideoPlayer(), mLocalRect ); + setWindowRect( session().RemoteVideoPlayer(), mRemoteRect ); + + LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::setContentAreas()" ) +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::setOrientation +// Currently the only supported orientation is landscape. +// ----------------------------------------------------------------------------- +// +bool LcUiEnginePrivate::setOrientation( Qt::Orientation orientation ) +{ + bool ok( false ); + TInt error1( KErrNone ); + TInt error2( KErrNone ); + MLcVideoPlayer* localPlayer = session().LocalVideoPlayer(); + MLcVideoPlayer* remotePlayer = session().RemoteVideoPlayer(); + + Q_UNUSED(orientation); + + if ( localPlayer && localPlayer->LcWindow() ) { + TRAP(error1, localPlayer->LcWindow()->SetLcWindowOrientationL( MLcWindow::ELandscape ) ); + } + if ( remotePlayer && remotePlayer->LcWindow() ) { + TRAP(error2, remotePlayer->LcWindow()->SetLcWindowOrientationL( MLcWindow::ELandscape )); + } + + if ( (error1 == KErrNone) && (error2 == KErrNone) ) { + ok = true; + } + + return ok; +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::setUiComponents +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::setUiComponents( + HbProgressDialog* invitingNote, + HbProgressDialog* waitingNote, + HbDialog* acceptQuery, + HbDialog* recipientQuery, + HbDialog* shareOwnVideoQuery ) +{ + mInvitingNote = invitingNote; + mWaitingNote = waitingNote; + mAcceptQuery = acceptQuery; + mRecipientQuery = recipientQuery; + mShareOwnVideoQuery = shareOwnVideoQuery; + + if (mAcceptQuery && (mAcceptQuery->actions().size() == 2)) { + connect(mAcceptQuery->actions().at(0), SIGNAL(triggered()), + this, SLOT(startReceiving()) ); + connect(mAcceptQuery->actions().at(1), SIGNAL(triggered()), + this, SLOT(stop()) ); + } + + if (mInvitingNote && (mInvitingNote->actions().size() == 1)) { + connect(mInvitingNote->actions().at(0), SIGNAL(triggered()), + this, SLOT(stop()) ); + } + if (mWaitingNote && (mWaitingNote->actions().size() == 1)) { + connect(mWaitingNote->actions().at(0), SIGNAL(triggered()), + this, SLOT(stop()) ); + } + if(mShareOwnVideoQuery && (mShareOwnVideoQuery->actions().size() == 2)) { + connect(mShareOwnVideoQuery->actions().at(0), SIGNAL(triggered()), + this, SLOT(startLocalVideo()) ); + connect(mShareOwnVideoQuery->actions().at(1), SIGNAL(triggered()), + this, SLOT(stopLocalVideo()) ); + + } +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::toggleMute +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::toggleMute() +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEnginePrivate::toggleMute()" ) + + bool mute( !isMuted() ); + muteMic( mute ); + + // Muting / unmuting the microphone is an asynchronous operation. + // Assuming here that the operation will eventually succeed. + if ( mute ) { + completeAction( lcEngSignalNameMuted ); + } else { + completeAction( lcEngSignalNameUnmuted ); + } + LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::toggleMute()" ) +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::isMuted +// ----------------------------------------------------------------------------- +// +bool LcUiEnginePrivate::isMuted() const +{ + bool micMuted( false ); + MLcAudioControl* audio = audioControl(); + // TODO: Replace TRAP with QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION (Qt4.5.2) + if ( audio ) { + TRAP_IGNORE( micMuted = audio->IsLcMicMutedL() ); + } + return micMuted; +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::toggleSpeaker +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::toggleSpeaker() +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEnginePrivate::toggleSpeaker()" ) + + bool enable( !isSpeakerOn() ); + enableSpeaker( enable ); + + // Enabling / disabling the speaker is an asynchronous operation. + // Assuming here that the operation will eventually succeed. + if ( enable ) { + completeAction( lcEngSignalNameSpeakerEnabled ); + } else { + completeAction( lcEngSignalNameSpeakerDisabled ); + } + LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::toggleSpeaker()" ) +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::isSpeakerOn +// ----------------------------------------------------------------------------- +// +bool LcUiEnginePrivate::isSpeakerOn() const +{ + return audioControl()->IsLcLoudspeakerEnabled(); +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::zoomValues +// ----------------------------------------------------------------------------- +// +int LcUiEnginePrivate::zoomValues( LcControlValues& values ) const +{ + int err( -1 ); + // TODO: Replace TRAP with QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION (Qt4.5.2) + MLcZoomControl* zoom = zoomControl(); + if ( zoom ) { + TRAP( err, + values.mMaxValue = zoom->MaxLcZoomL(); + values.mMinValue = zoom->MinLcZoomL(); + values.mValue = zoom->LcZoomValueL(); ); + } + return err; +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::toggleEnableCamera +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::toggleDisableCamera() +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEnginePrivate::toggleDisableCamera()" ) + MLcVideoPlayer* player = visibleLocalPlayer(); + if( player ) { + pause( session().LocalVideoPlayer() ); + completeAction( lcEngSignalNameCameraDisabled ); + } else { + play( session().LocalVideoPlayer() ); + completeAction( lcEngSignalNameCameraEnabled ); + } + emitViewLayoutChanged(); + LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::toggleDisableCamera()" ) +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::setCameraMain +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::setMainCamera(const bool aMainCamera) +{ + LC_QDEBUG_2( "livecomms [UI] -> LcUiEnginePrivate::setCameraMain()", aMainCamera ) + mMainCamera = aMainCamera; + LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::setCameraMain()" ) +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::cameraIndex +// ----------------------------------------------------------------------------- +// +bool LcUiEnginePrivate::mainCamera() const +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEnginePrivate::mainCamera()" ) + LC_QDEBUG_2( "livecomms [UI] <- LcUiEnginePrivate::mainCamera()", mMainCamera ) + return mMainCamera; +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::toggleCamera +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::toggleCamera() +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEnginePrivate::toggleCamera()" ) + + MLcVideoPlayer* localPlayer = session().LocalVideoPlayer(); + + // TODO: Replace TRAP with QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION (Qt4.5.2) + if ( localPlayer && localPlayer->LcCameraControl() ) { + TRAP_IGNORE( localPlayer->LcCameraControl()->ToggleLcCameraL() ); + } + + setMainCamera( !mMainCamera ); + + // Enabling / disabling the camera is an asynchronous operation. + // Assuming here that the operation will eventually succeed. + if ( mMainCamera ) { + completeAction( lcEngSignalNameCameraChangedToMain ); + } else { + completeAction( lcEngSignalNameCameraChangedToSecondary ); + } + + LC_QDEBUG_2( "livecomms [UI] <- LcUiEnginePrivate::toggleCamera(), mainCamera:", mMainCamera ) +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::fullScreenMode +// ----------------------------------------------------------------------------- +// +bool LcUiEnginePrivate::fullScreenMode() +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEnginePrivate::fullScreenMode()" ) + LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::fullScreenMode()" ) + return mFullScreen; +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::setFullScreenMode +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::setFullScreenMode(bool aMode) +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEnginePrivate::setFullScreenMode()" ) + mFullScreen = aMode; + LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::setFullScreenMode()" ) +} + + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::updateSession +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::updateSession() +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEnginePrivate::updateSession()" ) + // TODO: Replace TRAP with QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION (Qt4.5.2) + TRAP_IGNORE( session().UpdateLcSessionL() ); + + LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::updateSession()" ) +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::isLocalPlayerPlaying +// ----------------------------------------------------------------------------- +// +bool LcUiEnginePrivate::isLocalPlayerPlaying() const +{ + MLcVideoPlayer* player = session().LocalVideoPlayer(); + return ( player && + player->LcVideoPlayerState() == MLcVideoPlayer::EPlaying ); +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::isRemotePlayerPlaying +// ----------------------------------------------------------------------------- +// +bool LcUiEnginePrivate::isRemotePlayerPlaying() const +{ + MLcVideoPlayer* player = session().RemoteVideoPlayer(); + return ( player && + player->LcVideoPlayerState() == MLcVideoPlayer::EPlaying ); +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::timerEvent +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::timerEvent(QTimerEvent *event) +{ + if ( event->timerId() == mSessionDurationTimerId ) { + QTime curr(0, 0, 0, 0); + curr = curr.addSecs( + mSessionDurationStartTime.secsTo( QTime::currentTime() ) ); + emit mUiEngine.sessionDurationChanged(curr.toString()); + } +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::startReceiving +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::startReceiving() +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEnginePrivate::startReceiving()" ) + + if ( mAcceptQuery ) { + mAcceptQuery->hide(); + } + + establishSession(); + + if ( mWaitingNote && featureSupported( CLcEngine::ELcShowWaitingNote ) ) { + mWaitingNote->show(); + } + + LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::startReceiving()" ) +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::stopForcefully +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::stopForcefully() +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEnginePrivate::stopForcefully()" ) + + // This is only way to force exit in case CActiveScheduler is blocked + // by engine plugin. + User::Exit(0); + + LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::stopForcefully()" ) +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::StateChanged +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::StateChanged( MLcSession& aSession ) +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEnginePrivate::StateChanged( session )" ) + + MLcSession::TLcSessionState newState = MLcSession::EUninitialized; + newState = aSession.LcSessionState(); + + LC_QDEBUG_2( "livecomms [UI] new state=", newState ) + + if ( newState == MLcSession::EOpen ) { + LC_QDEBUG( "livecomms [UI] state is MLcSession::EOpen" ) + cancelCloseTimer(); + hideNotes( false ); + if( isAllowedToShareVideo() ) { + startLocalVideo(); + } + startRemoteVideo(); + fillRemoteInfo( true ); + emitViewLayoutChanged(); + startSessionDurationTimer(); + + } else if ( newState == MLcSession::EReceived ) { + LC_QDEBUG( "livecomms [UI] state is MLcSession::EReceived" ) + mRecipient = DESC_TO_QSTRING( session().RemoteDisplayName() ); + if ( mAcceptQuery && + featureSupported( CLcEngine::ELcShowAcceptQuery ) ) { + mAcceptQuery->show(); + } else { + startReceiving(); + } + } else if ( newState == MLcSession::EClosed ) { + LC_QDEBUG( "livecomms [UI] state is MLcSession::EClosed, closing UI..." ) + emit mUiEngine.stopped(); + + } else if ( newState == MLcSession::EOpening ){ + LC_QDEBUG( "livecomms [UI] state is MLcSession::EOpening" ) + } + + LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::StateChanged( session )" ) +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::StateChanged +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::StateChanged( MLcVideoPlayer& aPlayer ) +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEnginePrivate::StateChanged( player )" ) + + emitViewLayoutChanged(); + + if ( aPlayer.LcVideoPlayerState() == MLcVideoPlayer::EPlaying ) { + if ( &aPlayer == session().RemoteVideoPlayer() ) { + if ( mWaitingNote ) { + mWaitingNote->hide(); + } + emit mUiEngine.remotePlayerPlaying(); + } + if ( &aPlayer == session().LocalVideoPlayer() ) { + emit mUiEngine.localPlayerPlaying(); + } + } else if ( aPlayer.LcVideoPlayerState() == MLcVideoPlayer::EPreparing ) { + if ( &aPlayer == session().RemoteVideoPlayer() ) { + emit mUiEngine.remotePlayerPreparing(); + } + if ( &aPlayer == session().LocalVideoPlayer() ) { + emit mUiEngine.localPlayerPreparing(); + } + } else if ( aPlayer.LcVideoPlayerState() == MLcVideoPlayer::EBuffering ) { + if ( &aPlayer == session().RemoteVideoPlayer() ) { + emit mUiEngine.remotePlayerBuffering(); + } + if ( &aPlayer == session().LocalVideoPlayer() ) { + emit mUiEngine.localPlayerBuffering(); + } + } else if ( aPlayer.LcVideoPlayerState() == MLcVideoPlayer::EPaused ) { + if ( &aPlayer == session().RemoteVideoPlayer() ) { + emit mUiEngine.remotePlayerPaused(); + } + if ( &aPlayer == session().LocalVideoPlayer() ) { + emit mUiEngine.localPlayerPaused(); + } + } else if ( aPlayer.LcVideoPlayerState() == MLcVideoPlayer::EUnavailable ) { + if ( &aPlayer == session().RemoteVideoPlayer() ) { + emit mUiEngine.remotePlayerUnavailable(); + } + if ( &aPlayer == session().LocalVideoPlayer() ) { + emit mUiEngine.localPlayerUnavailable(); + } + } + + LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::StateChanged( player )" ) +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::Updated +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::Updated( MLcSession& /*aSession*/ ) +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEnginePrivate::Updated( session )" ) + emitViewLayoutChanged(); + LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::Updated( session )" ) +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::Updated +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::Updated( MLcVideoPlayer& /*aPlayer*/ ) +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEnginePrivate::Updated( player )" ) + emitViewLayoutChanged(); + LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::Updated( player )" ) +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::Failed +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::Failed( MLcSession& /*aSession*/, TInt /*aError*/ ) +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEnginePrivate::Failed( session )" ) + stop(); + LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::Failed( session )" ) +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::Failed +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::Failed( MLcVideoPlayer& /*aPlayer*/, TInt /*aError*/ ) +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEnginePrivate::Failed( player )" ) + stop(); + LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::Failed( player )" ) +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::SessionTimeChanged +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::SessionTimeChanged( MLcSession& /*aSession*/, + const TTimeIntervalSeconds& /*aSeconds*/ ) +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEnginePrivate::SessionTimeChanged()" ) + LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::SessionTimeChanged()" ) +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::SelectRecipient +// ----------------------------------------------------------------------------- +// +TBool LcUiEnginePrivate::SelectRecipient( MDesCArray& aRecipientAddresses, + TDes& aSelectedRecipientAddress ) +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEnginePrivate::SelectRecipient()" ) + aSelectedRecipientAddress = aRecipientAddresses.MdcaPoint(0); + mRecipient = DESC_TO_QSTRING( aSelectedRecipientAddress ); + LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::SelectRecipient()" ) + return ETrue; +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::SelectRecipient +// ----------------------------------------------------------------------------- +// +TBool LcUiEnginePrivate::InputRecipient( TDes& aRecipientAddress ) +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEnginePrivate::InputRecipient()" ) + + TBool answered( EFalse ); + + if ( mRecipientQuery ) { + mRecipient = DESC_TO_QSTRING( aRecipientAddress ); + HbLineEdit* lineEdit = new HbLineEdit( mRecipient ); + mRecipientQuery->setContentWidget( lineEdit ); + mRecipientQuery->open(); + TPtrC16 textPtr( + reinterpret_cast< const TUint16* >( mRecipient.utf16() ) ); + aRecipientAddress.Copy( textPtr ); + answered = ETrue; + } + + LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::InputRecipient()" ) + return answered; +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::HandleForegroundStatus +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::HandleForegroundStatus( TBool aForeground ) +{ + LC_QDEBUG_2( "livecomms [UI] -> LcUiEnginePrivate::HandleForegroundStatus(), fg:", + aForeground ) + + mActivityManager->enableActivitySimulation(aForeground); + + if ( aForeground && !HbInstance::instance()->allMainWindows().isEmpty() ){ + HbInstance::instance()->allMainWindows().at(0)->show(); + } + XQServiceUtil::toBackground(!aForeground); + + mIsMinimized = !aForeground; + + handleEngineForegroundStatus(); + + LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::HandleForegroundStatus()" ) +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::BlockUi +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::BlockUi( TBool aBlocked ) +{ + LC_QDEBUG_2( "livecomms [UI] -> LcUiEnginePrivate::BlockUi, blocked:", aBlocked ) + mBlocked = aBlocked; + + if ( mBlocked ){ + emit mUiEngine.blocked(); + } + else{ + emit mUiEngine.unblocked(); + completePendingAction(); + } + LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::BlockUi()" ) +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::setViewLayout +// ----------------------------------------------------------------------------- +// +LcViewLayoutHint LcUiEnginePrivate::setViewLayout() +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEnginePrivate::setViewLayout()" ) + + LcViewLayoutHint hint = (LcViewLayoutHint)Lc_NoViewLayout; + + MLcVideoPlayer* localPlayer = visibleLocalPlayer(); + MLcVideoPlayer* remotePlayer = visibleRemotePlayer(); + + if ( usingVideoTelephoneEngine() ) { + hint = Lc_AllInOneViewLayout; + LC_QDEBUG( "livecomms [UI] use Lc_AllInOneViewLayout" ) + } else if ( localPlayer && remotePlayer ) { + hint = Lc_TwowayViewLayout; + LC_QDEBUG( "livecomms [UI] use Lc_TwowayViewLayout" ) + } else if ( localPlayer ) { + hint = Lc_SharedViewLayout; + LC_QDEBUG( "livecomms [UI] use Lc_SharedViewLayout" ) + } else if ( remotePlayer && !session().LocalVideoPlayer() ) { + hint = Lc_ReceivedOnlyViewLayout; + LC_QDEBUG( "livecomms [UI] use Lc_ReceivedOnlyViewLayout" ) + } else if ( remotePlayer ) { + hint = Lc_ReceivedViewLayout; + LC_QDEBUG( "livecomms [UI] use Lc_ReceivedViewLayout" ) + } else { + hint = Lc_IdleViewLayout; + LC_QDEBUG( "livecomms [UI] ! no players ! use Lc_IdleViewLayout" ) + } + + mViewLayout = hint; + + LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::setViewLayout()" ) + + return viewLayout(); +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::emitViewLayoutChanged +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::emitViewLayoutChanged() +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEnginePrivate::emitViewLayoutChanged()" ) + + LcViewLayoutHint oldLayout = viewLayout(); + LcViewLayoutHint layout = setViewLayout(); + + if ( layout != oldLayout ) { + LC_QDEBUG( "livecomms [UI] layout has changed. signal" ) + emit mUiEngine.layoutChanged(); + } + LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::emitViewLayoutChanged()" ) +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::startLiveContent +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::startLiveContent() +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEnginePrivate::startLiveContent()" ) + + if ( mInvitingNote && featureSupported( CLcEngine::ELcShowInvitingNote ) ) { + mInvitingNote->show(); + } + enableSpeaker( true ); + establishSession(); + + LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::startLiveContent()" ) +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::startPlayback +// Utility style function to start both local and remote players if available. +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::startPlayback() +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEnginePrivate::startPlayback()" ) + startLocalVideo(); + startRemoteVideo(); + LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::startPlayback()" ) +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::startRemoteVideo +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::startRemoteVideo() +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEnginePrivate::startRemotePlayback()" ) + MLcVideoPlayer* remotePlayer = session().RemoteVideoPlayer(); + if ( remotePlayer ) { + LC_QDEBUG( "livecomms [UI] enable remote player window" ) + enableWindow( remotePlayer, true ); + } + LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::startRemotePlayback()" ) +} +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::startCloseTimer +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::startCloseTimer() +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEnginePrivate::startCloseTimer()" ) + delete mCloseTimer; + mCloseTimer = 0; + mCloseTimer = new QTimer(this); + mCloseTimer->setSingleShot(true); + connect(mCloseTimer, SIGNAL(timeout()), this, SLOT(stop())); + mCloseTimer->start(60000); + LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::startCloseTimer()" ) +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::cancelCloseTimer +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::cancelCloseTimer() +{ + if ( mCloseTimer && mCloseTimer->isActive()) { + mCloseTimer->stop(); + } +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::hideNotes +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::hideNotes( bool hideWaitingNote ) +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEnginePrivate::hideNotes()" ) + if ( mAcceptQuery ) { + mAcceptQuery->hide(); + } + if ( mWaitingNote && hideWaitingNote ) { + mWaitingNote->hide(); + } + if ( mInvitingNote ) { + mInvitingNote->hide(); + } + if ( mRecipientQuery ) { + mRecipientQuery->hide(); + } + LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::hideNotes()" ) +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::completeAction +// Completes method passed as argument. If engine is in blocked state +// action completion will be delayed until unblock occurs. +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::completeAction( const char* actionMethod ) +{ + LC_QDEBUG_2( "livecomms [UI] -> LcUiEnginePrivate::completeAction :", actionMethod ) + if ( mBlocked ) { + LC_QDEBUG( "livecomms [UI] Blocked, invoke later" ) + // store action and invoke it once unblocked + setPendingAction( actionMethod ); + } + else { + QMetaObject::invokeMethod( &mUiEngine, actionMethod ); + } + LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::completeAction" ) +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::setPendingAction +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::setPendingAction( const char* actionMethod ) +{ + mPendingAction = actionMethod; +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::completePendingAction +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::completePendingAction() +{ + if ( !mPendingAction.isEmpty() ) { + completeAction( mPendingAction.toAscii().constData() ); + mPendingAction.clear(); + } +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::videoTelephoneLayout +// ----------------------------------------------------------------------------- +// +bool LcUiEnginePrivate::usingVideoTelephoneEngine() +{ + return mEngineName == LC_VTPLUGIN_NAME; +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::session +// ----------------------------------------------------------------------------- +// +MLcSession& LcUiEnginePrivate::session() const +{ + return mLiveCommsEngine->Session(); +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::visibleLocalPlayer +// ----------------------------------------------------------------------------- +// +MLcVideoPlayer* LcUiEnginePrivate::visibleLocalPlayer() const +{ + // TODO: Replace TRAP with QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION (Qt4.5.2) + MLcVideoPlayer* localPlayer = session().LocalVideoPlayer(); + if ( localPlayer ) { + bool playing( true ); + TRAP_IGNORE( playing = localPlayer->LcIsPlayingL() ); + if ( !playing ) { + localPlayer = 0; + } + } + return localPlayer; +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::visibleRemotePlayer +// ----------------------------------------------------------------------------- +// +MLcVideoPlayer* LcUiEnginePrivate::visibleRemotePlayer() const +{ + MLcVideoPlayer* remotePlayer = session().RemoteVideoPlayer(); + if ( remotePlayer && + remotePlayer->LcVideoPlayerState() == MLcVideoPlayer::EPaused ) { + remotePlayer = 0; + } + return remotePlayer; +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::audioControl +// ----------------------------------------------------------------------------- +// +MLcAudioControl* LcUiEnginePrivate::audioControl() const +{ + MLcAudioControl* audioControl( 0 ); + if ( session().LocalVideoPlayer() ) { + audioControl = session().LocalVideoPlayer()->LcAudioControl(); + } + if ( !audioControl && session().RemoteVideoPlayer() ) { + audioControl = session().RemoteVideoPlayer()->LcAudioControl(); + } + return audioControl; +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::zoomControl +// ----------------------------------------------------------------------------- +// +MLcZoomControl* LcUiEnginePrivate::zoomControl() const +{ + MLcZoomControl* zoomControl( 0 ); + if ( session().LocalVideoPlayer() ) { + zoomControl = session().LocalVideoPlayer()->LcZoomControl(); + } + return zoomControl; +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::isFeatureSupported +// ----------------------------------------------------------------------------- +// +bool LcUiEnginePrivate::featureSupported( CLcEngine::TLcFeature feature ) +{ + bool isSupported( false ); + if ( mLiveCommsEngine ) { + isSupported = mLiveCommsEngine->IsFeatureSupported( feature ); + } + return isSupported; +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::startSessionDurationTimer +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::startSessionDurationTimer() +{ + const int sessionDurationTimerIntervalInMs = 1000; + if ( !mSessionDurationTimerId ){ + mSessionDurationTimerId = startTimer( sessionDurationTimerIntervalInMs ); + LC_QDEBUG_2( "livecomms [UI] -> duration timer id:", mSessionDurationTimerId ) + mSessionDurationStartTime = QTime::currentTime(); + } +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::stopSessionDurationTimer +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::stopSessionDurationTimer() +{ + if ( mSessionDurationTimerId ){ + killTimer( mSessionDurationTimerId ); + mSessionDurationTimerId = 0; + } +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::establishSession +// ----------------------------------------------------------------------------- +// +int LcUiEnginePrivate::establishSession() +{ + // TODO: Replace TRAP with QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION (Qt4.5.2) + TRAPD( err, mLiveCommsEngine->Session().EstablishLcSessionL() ); + if ( !err ) { + startCloseTimer(); + } + LC_QDEBUG_2( "livecomms [UI] LcUiEnginePrivate::establishSession, err", err ) + return err; +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::terminateSession +// ----------------------------------------------------------------------------- +// +int LcUiEnginePrivate::terminateSession() +{ + // TODO: Replace TRAP with QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION (Qt4.5.2) + TRAPD( err, mLiveCommsEngine->Session().TerminateLcSessionL() ); + LC_QDEBUG_2( "livecomms [UI] LcUiEnginePrivate::terminateSession, err", err ) + return err; +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::setWindowRect +// ----------------------------------------------------------------------------- +// +int LcUiEnginePrivate::setWindowRect( MLcVideoPlayer* player, TRect rect ) +{ + // TODO: Replace TRAP with QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION (Qt4.5.2) + int err( -1 ); + if ( player && + player->LcWindow() && + player->LcWindow()->LcWindowRect() != rect ) { + TRAP( err, player->LcWindow()->SetLcWindowRectL( rect ) ); + } + LC_QDEBUG_2( "livecomms [UI] LcUiEnginePrivate::setWindowRect, err", err ) + return err; +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::enableWindow +// ----------------------------------------------------------------------------- +// +int LcUiEnginePrivate::enableWindow( MLcVideoPlayer* player, bool enable ) +{ + // TODO: Replace TRAP with QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION (Qt4.5.2) + int err( -1 ); + if ( player && + player->LcWindow() ) { + TRAP( err, player->LcWindow()->EnableLcWindowL( enable ) ); + } + LC_QDEBUG_2( "livecomms [UI] LcUiEnginePrivate::enableWindow, err", err ) + return err; +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::play +// ----------------------------------------------------------------------------- +// +int LcUiEnginePrivate::play( MLcVideoPlayer* player ) +{ + // TODO: Replace TRAP with QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION (Qt4.5.2) + int err( -1 ); + if ( player ) { + TRAP( err, player->LcPlayL() ); + } + LC_QDEBUG_2( "livecomms [UI] LcUiEnginePrivate::play, err", err ) + return err; +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::pause +// ----------------------------------------------------------------------------- +// +int LcUiEnginePrivate::pause( MLcVideoPlayer* player ) +{ + // TODO: Replace TRAP with QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION (Qt4.5.2) + int err( -1 ); + if ( player ) { + TRAP( err, player->LcPauseL() ); + } + LC_QDEBUG_2( "livecomms [UI] LcUiEnginePrivate::pause, err", err ) + return err; +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::enableSpeaker +// ----------------------------------------------------------------------------- +// +int LcUiEnginePrivate::enableSpeaker( bool enable ) +{ + int err( -1 ); + // TODO: Replace TRAP with QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION (Qt4.5.2) + MLcAudioControl* audio = audioControl(); + if ( audio ) { + TRAP( err, audio->EnableLcLoudspeakerL( enable ) ); + } + LC_QDEBUG_2( "livecomms [UI] LcUiEnginePrivate::enableSpeaker, err", err ) + return err; +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::muteMic +// ----------------------------------------------------------------------------- +// +int LcUiEnginePrivate::muteMic( bool mute ) +{ + int err( -1 ); + // TODO: Replace TRAP with QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION (Qt4.5.2) + MLcAudioControl* audio = audioControl(); + if ( audio ) { + TRAP( err, audio->MuteLcMicL( mute ) ); + } + return err; +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::fillRemoteInfo +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::fillRemoteInfo(bool informChanges) +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEnginePrivate::fillRemoteInfo()" ) + + QString phoneNum = DESC_TO_QSTRING( session().RemoteDetails() ); + if ( phoneNum != mPhoneNumber) { + LC_QDEBUG_2( "remote number:", phoneNum ) + mPhoneNumber = phoneNum; + if ( informChanges ) { + emit mUiEngine.phoneNumberChanged(mPhoneNumber); + } + } + // If no recipient even at opened state and no phonenum, use unknown recipient + QString recipient = DESC_TO_QSTRING( session().RemoteDisplayName() ); + if ( recipient.isEmpty() ){ + recipient = mPhoneNumber; + } + if ( session().LcSessionState() == MLcSession::EOpen && recipient.isEmpty() ) { + recipient = hbTrId("txt_vt_custom_unknown_number"); + } + if ( recipient != mRecipient ){ + LC_QDEBUG_2( "remote name:", recipient ) + mRecipient = recipient; + if ( informChanges ) { + emit mUiEngine.recipientChanged(mRecipient); + } + } + LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::fillRemoteInfo()" ) +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::isMinimized +// ----------------------------------------------------------------------------- +// +bool LcUiEnginePrivate::isMinimized() const +{ + return mIsMinimized; +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::minimize +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::minimize() +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEnginePrivate::minimize()" ) + + if ( !isMinimized() ){ + TRect emptyRect; + setWindowRect( session().LocalVideoPlayer(), emptyRect ); + setWindowRect( session().RemoteVideoPlayer(), emptyRect ); + HandleForegroundStatus(EFalse); + } + LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::minimize()" ) +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::maximize +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::maximize() +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEnginePrivate::maximize()" ) + if ( isMinimized() ){ + setWindowRect( session().LocalVideoPlayer(), mLocalRect ); + setWindowRect( session().RemoteVideoPlayer(), mRemoteRect ); + HandleForegroundStatus(ETrue); + } + LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::maximize()" ) +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::setCurrentView +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::setCurrentView(HbView* view) +{ + LC_QDEBUG( "livecomms [UI] <-> LcUiEnginePrivate::setCurrentView()" ) + mCurrentView = view; +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::startStopGuardTimer +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::startStopGuardTimer() +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEnginePrivate::startStopGuardTimer()" ) + const int stoppingGuardTimerInMs = 5000; + QTimer::singleShot(stoppingGuardTimerInMs, this, SLOT(stopForcefully())); + LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::startStopGuardTimer()" ) +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::handleEngineForegroundStatus +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::handleEngineForegroundStatus() +{ + bool foreground = !mIsMinimized; + LC_QDEBUG_2( "livecomms [UI] -> LcUiEnginePrivate::handleEngineForegroundStatus(), fg:", + foreground ) + HbMainWindow *mainWindow = HbInstance::instance()->allMainWindows().at(0); + + if ( mLiveCommsEngine ){ + bool setStatusToEngine(true); + if ( foreground && mFirstForegroundSwitch ){ + // Have to wait that first paint has occured, otherwise video + // windows are shown too early. + // TODO: wk8 does not yet have viewReady signal so simulate it + // by using timer. Timer can be removed later. + if ( mCurrentView ){ + LC_QDEBUG( "livecomms [UI] Wait for first paint" ) + connect( mainWindow, SIGNAL(viewReady()), + this, SLOT(handleEngineForegroundStatus()) ); + setStatusToEngine = false; + } + + } + if ( setStatusToEngine ) { + LC_QDEBUG( "livecomms [UI] Set fg status to engine plugin" ) + session().SetForegroundStatus(foreground); + disconnect( mainWindow, SIGNAL(viewReady()), + this, SLOT(handleEngineForegroundStatus()) ); + } + mFirstForegroundSwitch = false; + } + LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::handleEngineForegroundStatus()" ) +} + + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::SendDialTone +// ----------------------------------------------------------------------------- +// +bool LcUiEnginePrivate::SendDialTone(const QChar aKey) +{ + if ( mLiveCommsEngine ){ + const TChar dialChar = static_cast(aKey.unicode()); + return mLiveCommsEngine->Session().SendDialTone(dialChar); + } + return false; +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::isAllowedToShareVideo +// ----------------------------------------------------------------------------- +// +bool LcUiEnginePrivate::isAllowedToShareVideo() +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEnginePrivate::isAllowedToShareVideo()" ) + if( featureSupported( CLcEngine::ELcSendVideoQuery ) && mShareOwnVideoQuery ){ + mShareOwnVideoQuery->show(); + return false; + } + LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::isAllowedToShareVideo()" ) + return true; +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::stopLocalVideo +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::stopLocalVideo() +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEnginePrivate::stopLocalVideo()" ) + MLcVideoPlayer* localPlayer = session().LocalVideoPlayer(); + if( localPlayer ) { + pause( localPlayer ); + enableWindow( localPlayer, false ); + completeAction( lcEngSignalNameCameraDisabled ); + } + LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::stopLocalVideo()" ) +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::startLocalVideo +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::startLocalVideo() +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEnginePrivate::startLocalVideo()" ) + MLcVideoPlayer* localPlayer = session().LocalVideoPlayer(); + if( localPlayer ){ + play( localPlayer ); + enableWindow( localPlayer, true ); + } + LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::startLocalVideo()" ) +} +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/hbstubs/hbaction.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/hbstubs/hbaction.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,37 @@ +/* +* 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: Orbit stubs for Live Comms UI unit tests +* +*/ +#ifndef HBACTION_H +#define HBACTION_H + +#include +#include +#include +#include + + +class HbAction : public QAction +{ +public: + explicit HbAction(QObject *parent = 0); + explicit HbAction(const QString &text, QObject *parent = 0); + virtual ~HbAction(); + +private: // Data added for the unit testing stub + HbIcon mIcon; +}; + +#endif // HBACTION_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/hbstubs/hbdialog.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/hbstubs/hbdialog.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,61 @@ +/* +* 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: Orbit stubs for Live Comms UI unit tests +* +*/ +#ifndef HBDIALOG_H +#define HBDIALOG_H + +#include +#include + + +class HbAction; + + +class HbDialog : public HbWidget +{ +public: + enum DismissPolicy + { + NoDismiss = 0, + TapInside = 1, + TapOutside = 2, + TapAnywhere = TapInside | TapOutside + }; + enum DefaultTimeout + { + NoTimeout, + ConfirmationNoteTimeout, + StandardTimeout, + ContextMenuTimeout + }; + + explicit HbDialog(QGraphicsItem *parent = 0); + virtual ~HbDialog(); + + void setContentWidget(QGraphicsWidget *contentWidget); + enum { Type = Hb::ItemType_Popup }; + void setTimeout( int timeout ) ; + void setDismissPolicy( HbDialog::DismissPolicy dismissPolicy ); + +public slots: + void open(QObject* receiver = 0, const char* member = 0); +protected: + + QVariant itemChange ( GraphicsItemChange change, const QVariant & value ); +}; + + +#endif // HBDIALOG_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/hbstubs/hbinstance.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/hbstubs/hbinstance.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,40 @@ +/* +* 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: Orbit stubs for Live Comms UI unit tests +* +*/ +#ifndef HBINSTANCE_H +#define HBINSTANCE_H + +#include +#include +#include + +#define hbInstance (HbInstance::instance()) + +class HbInstance +{ +public: + static HbInstance *instance(); + QList allMainWindows() const; + +private: + HbInstance(); + ~HbInstance(); + +private: // Data added for the unit testing stub + QList mAllMainWindows; +}; + +#endif // HBINSTANCE_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/hbstubs/hblabel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/hbstubs/hblabel.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,37 @@ +/* +* 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: Orbit stubs for Live Comms UI unit tests +* +*/ +#ifndef HBLABEL_H +#define HBLABEL_H + +#include +#include +#include + +class QGraphicsItem; + + +class HbLabel : public HbWidget +{ +public: + explicit HbLabel (QGraphicsItem *parent = 0); + explicit HbLabel (const QString &displayText, QGraphicsItem *parent = 0); + ~HbLabel (); + + enum { Type = Hb::ItemType_Label }; +}; + +#endif // HBLABEL_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/hbstubs/hblineedit.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/hbstubs/hblineedit.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,39 @@ +/* +* 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: Orbit stubs for Live Comms UI unit tests +* +*/ + +#ifndef HBLINEEDIT_H +#define HBLINEEDIT_H + +#include +#include +#include + + +class HbLineEdit: public HbWidget +{ +public: + + explicit HbLineEdit(const QString &text, QGraphicsItem *parent = 0); + virtual ~HbLineEdit(); + + enum { + Type = Hb::ItemType_LineEdit + }; + +}; + +#endif // HBLINEEDIT_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/hbstubs/hbmainwindow.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/hbstubs/hbmainwindow.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,37 @@ +/* +* 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: Orbit stubs for Live Comms UI unit tests +* +*/ + +#ifndef HBMAINWINDOW_H +#define HBMAINWINDOW_H + +#include +#include +#include + +class QGraphicsWidget; +class HbAction; +class HbView; + + +class HbMainWindow : public QGraphicsView +{ +public: + explicit HbMainWindow(QWidget *parent = 0, Hb::WindowFlags windowFlags = Hb::WindowFlagNone); + ~HbMainWindow(); +}; + +#endif // HBMAINWINDOW_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/hbstubs/hbmessagebox.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/hbstubs/hbmessagebox.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,81 @@ +/* +* 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: Orbit stubs for Live Comms UI unit tests +* +*/ + +#ifndef HBMESSAGEBOX_H +#define HBMESSAGEBOX_H + +#include +#include +#include + +class HbMessageBoxPrivate; +class HbStyleOptionMessageBox; + +class HB_WIDGETS_EXPORT HbMessageBox : public HbDialog +{ + +public: + enum MessageBoxType { + MessageTypeInformation, + MessageTypeQuestion, + MessageTypeWarning + }; + explicit HbMessageBox(MessageBoxType type=MessageTypeInformation,QGraphicsItem *parent = 0); + explicit HbMessageBox(const QString &text,MessageBoxType type =MessageTypeInformation, QGraphicsItem *parent = 0); + virtual ~HbMessageBox(); + + void setText(const QString &text); + QString text() const; + + void setIcon(const HbIcon &icon); + HbIcon icon() const; + + void setIconAlignment(Qt::Alignment align); + Qt::Alignment iconAlignment() const; + + enum { Type = Hb::ItemType_MessageBox }; + int type() const { return Type; } + +public: + static bool launchQuestionMessageBox(const QString &questionText, + const QString &primaryButtonText = tr("Yes"), + const QString &secondaryButtonText = tr("No"), + QGraphicsWidget *headWidget = 0, + QGraphicsScene *scene = 0, + QGraphicsItem *parent = 0 ); + + static void launchInformationMessageBox(const QString &informationText, + QGraphicsWidget *headWidget = 0, + QGraphicsScene *scene = 0, + QGraphicsItem *parent = 0 ); + + static void launchWarningMessageBox(const QString &warningText, + QGraphicsWidget *headWidget = 0, + QGraphicsScene *scene = 0, + QGraphicsItem *parent = 0 ); + +public slots: + void updatePrimitives(); + +protected: + HbMessageBox(HbMessageBoxPrivate &dd, QGraphicsItem *parent); + void initStyleOption(HbStyleOptionMessageBox *option) const; + void keyPressEvent(QKeyEvent *event); +}; + +#endif // HB_MESSAGEBOX_H + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/hbstubs/hbnote.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/hbstubs/hbnote.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,37 @@ +/* +* 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: Orbit stubs for Live Comms UI unit tests +* +*/ +#ifndef HBNOTE_H +#define HBNOTE_H + +#include +#include + + +class HbNote : public HbPopup +{ +public: + explicit HbNote(QGraphicsItem *parent = 0); + HbNote(const QString &text, QGraphicsItem *parent = 0); + virtual ~HbNote(); + + enum { Type = Hb::ItemType_Note }; + +protected: + QVariant itemChange(GraphicsItemChange change, const QVariant &value); +}; + +#endif // HBNOTE_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/hbstubs/hbprogressdialog.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/hbstubs/hbprogressdialog.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,35 @@ +/* +* 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: Orbit stubs for Live Comms UI unit tests +* +*/ +#ifndef HBPROGRESSDIALOG_H +#define HBPROGRESSDIALOG_H + +#include + +class HbProgressDialog : public HbDialog +{ +public: + + enum ProgressDialogType { ProgressNote,WaitNote }; + explicit HbProgressDialog(QGraphicsItem *parent = 0); + + enum { Type = Hb::ItemType_ProgressDialog }; + +protected: + QVariant itemChange(GraphicsItemChange change, const QVariant& value); +}; + +#endif // HBPROGRESSDIALOG_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/hbstubs/hbstubs.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/hbstubs/hbstubs.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,377 @@ +/* +* 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: +* +*/ + +// Orbit classes +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Static data that simulates HbInstance and HbMainWindow +static HbInstance* hbInstanceSingleton = 0; + +// HbInstance + +// ----------------------------------------------------------------------------- +// HbInstance::instance +// ----------------------------------------------------------------------------- +// +HbInstance* HbInstance::instance() +{ + if (!hbInstanceSingleton) + hbInstanceSingleton = new HbInstance; + return hbInstanceSingleton; +} + +// ----------------------------------------------------------------------------- +// HbInstance::allMainWindows +// ----------------------------------------------------------------------------- +// +QList HbInstance::allMainWindows() const +{ + return mAllMainWindows; +} + +// ----------------------------------------------------------------------------- +// HbInstance::HbInstance +// ----------------------------------------------------------------------------- +// +HbInstance::HbInstance() +{ + HbMainWindow *mainWindow = new HbMainWindow; + mAllMainWindows.append(mainWindow); +} + +// ----------------------------------------------------------------------------- +// HbInstance::~HbInstance +// ----------------------------------------------------------------------------- +// +HbInstance::~HbInstance() +{ + mAllMainWindows.clear(); +} + + +// HbMainWindow + +// ----------------------------------------------------------------------------- +// HbMainWindow::HbMainWindow +// ----------------------------------------------------------------------------- +// +HbMainWindow::HbMainWindow(QWidget *parent,Hb::WindowFlags windowFlags) +: QGraphicsView(parent) +{ + Q_UNUSED(windowFlags) +} + +// ----------------------------------------------------------------------------- +// HbMainWindow::~HbMainWindow +// ----------------------------------------------------------------------------- +// +HbMainWindow::~HbMainWindow() +{ +} + +// HbDialog + +// ----------------------------------------------------------------------------- +// HbDialog::HbDialog +// ----------------------------------------------------------------------------- +// +HbDialog::HbDialog(QGraphicsItem *parent) : HbWidget(parent) +{ +} + +// ----------------------------------------------------------------------------- +// HbDialog::~HbDialog +// ----------------------------------------------------------------------------- +// +HbDialog::~HbDialog() +{ +} + +// ----------------------------------------------------------------------------- +// HbDialog::open() +// ----------------------------------------------------------------------------- +// +void HbDialog::open(QObject* receiver, const char* member) +{ + Q_UNUSED(receiver); + Q_UNUSED(member); +} + +// ----------------------------------------------------------------------------- +// HbDialog::setContentWidget +// ----------------------------------------------------------------------------- +// +void HbDialog::setContentWidget(QGraphicsWidget *contentWidget) +{ + Q_UNUSED(contentWidget) +} + +// ----------------------------------------------------------------------------- +// HbDialog::itemChange +// ----------------------------------------------------------------------------- +// +QVariant HbDialog::itemChange(GraphicsItemChange change, const QVariant& value) +{ + Q_UNUSED(change) + return QVariant(value); +} + +// ----------------------------------------------------------------------------- +// HbDialog::setTimeout +// ----------------------------------------------------------------------------- +// +void HbDialog::setTimeout(int timeout ) +{ + Q_UNUSED(timeout) +} + +// ----------------------------------------------------------------------------- +// HbDialog::setDismissPolicy +// ----------------------------------------------------------------------------- +// +void HbDialog::setDismissPolicy( HbDialog::DismissPolicy dismissPolicy ) +{ + Q_UNUSED(dismissPolicy) +} + +// HbAction + +// ----------------------------------------------------------------------------- +// HbAction::HbAction +// ----------------------------------------------------------------------------- +// +HbAction::HbAction(QObject *parent) +: QAction(parent), mIcon(QString()) +{ +} + +// ----------------------------------------------------------------------------- +// HbAction::HbAction +// ----------------------------------------------------------------------------- +// +HbAction::HbAction(const QString &text, QObject *parent) +: QAction(text,parent), mIcon(QString()) +{ +} + +// ----------------------------------------------------------------------------- +// HbAction::~HbAction +// ----------------------------------------------------------------------------- +// +HbAction::~HbAction() +{ +} + + +// HbLabel + +// ----------------------------------------------------------------------------- +// HbLabel::HbLabel +// ----------------------------------------------------------------------------- +// +HbLabel::HbLabel(QGraphicsItem *parent) : HbWidget(parent) +{ +} + +// ----------------------------------------------------------------------------- +// HbLabel::HbLabel +// ----------------------------------------------------------------------------- +// +HbLabel::HbLabel(const QString &displayText, QGraphicsItem *parent) +: HbWidget(parent) +{ + Q_UNUSED(displayText) +} + +// ----------------------------------------------------------------------------- +// HbLabel::~HbLabel +// ----------------------------------------------------------------------------- +// +HbLabel::~HbLabel() +{ +} + + +// ----------------------------------------------------------------------------- +// HbProgressDialog + +// ----------------------------------------------------------------------------- +// HbProgressDialog::HbProgressDialog +// ----------------------------------------------------------------------------- +// +HbProgressDialog::HbProgressDialog(QGraphicsItem *parent) : HbDialog(parent) +{ +} + +// ----------------------------------------------------------------------------- +// HbProgressDialog::itemChange +// ----------------------------------------------------------------------------- +// +QVariant HbProgressDialog::itemChange(GraphicsItemChange change, const QVariant& value) +{ + Q_UNUSED(change) + return QVariant(value); +} + + +// HbLineEdit + +// ----------------------------------------------------------------------------- +// HbLineEdit::HbLineEdit +// ----------------------------------------------------------------------------- +// +HbLineEdit::HbLineEdit(const QString &text, QGraphicsItem *parent) +: HbWidget(parent) +{ + Q_UNUSED(text) +} + +// ----------------------------------------------------------------------------- +// HbLineEdit::~HbLineEdit +// ----------------------------------------------------------------------------- +// +HbLineEdit::~HbLineEdit() +{ +} + +// HbWidget + +// ----------------------------------------------------------------------------- +// HbWidget::HbWidget +// ----------------------------------------------------------------------------- +// +HbWidget::HbWidget(QGraphicsItem *parent, Qt::WindowFlags wFlags) +: QGraphicsWidget(parent,wFlags) +{ +} + +// ----------------------------------------------------------------------------- +// HbWidget::~HbWidget +// ----------------------------------------------------------------------------- +// +HbWidget::~HbWidget() +{ +} + +// ----------------------------------------------------------------------------- +// HbWidget::clearActions +// ----------------------------------------------------------------------------- +// +void HbWidget::clearActions() +{ +} + +// ----------------------------------------------------------------------------- +// HbWidget::itemChange +// ----------------------------------------------------------------------------- +// +QVariant HbWidget::itemChange(GraphicsItemChange change, const QVariant& value) +{ + Q_UNUSED(change) + return QVariant(value); +} + + +// HbView + +// ----------------------------------------------------------------------------- +// HbView::HbView +// ----------------------------------------------------------------------------- +// +HbView::HbView(QGraphicsItem *parent) : HbWidget(parent) +{ +} + +// ----------------------------------------------------------------------------- +// HbView::~HbView +// ----------------------------------------------------------------------------- +// +HbView::~HbView() +{ +} + +// ----------------------------------------------------------------------------- +// HbView::menu +// ----------------------------------------------------------------------------- +// +HbMenu* HbView::menu() const +{ + return 0; +} + +// ----------------------------------------------------------------------------- +// HbView::toolBar +// ----------------------------------------------------------------------------- +// +HbToolBar* HbView::toolBar() const +{ + return 0; +} + +// ----------------------------------------------------------------------------- +// HbView::setTitle +// ----------------------------------------------------------------------------- +// +void HbView::setTitle(const QString &title) +{ + Q_UNUSED(title) +} + +// ----------------------------------------------------------------------------- +// HbView::setContentFullScreen +// ----------------------------------------------------------------------------- +// +void HbView::setContentFullScreen(bool /*enable*/) +{ +} + +// ----------------------------------------------------------------------------- +// HbView::navigationAction +// ----------------------------------------------------------------------------- +// +HbAction *HbView::navigationAction() const +{ + return 0; +} + +// ----------------------------------------------------------------------------- +// HbView::setNavigationAction +// ----------------------------------------------------------------------------- +// +void HbView::setNavigationAction(HbAction *action) +{ + Q_UNUSED(action); +} + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +QString hbTrId(const char *id, int n) +{ + Q_UNUSED(n); + return QString(id); +} diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/hbstubs/hbview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/hbstubs/hbview.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,52 @@ +/* +* 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: Orbit stubs for Live Comms UI unit tests +* +*/ +#ifndef HBVIEW_H +#define HBVIEW_H + +#include +#include +#include + +class HbMenu; +class HbToolBar; +class HbAction; + +class HbView : public HbWidget +{ +public: + explicit HbView(QGraphicsItem *parent = 0); + virtual ~HbView(); + + HbMenu *menu() const; + HbToolBar *toolBar() const; + + void setContentFullScreen(bool enable = true); + HbAction *navigationAction() const; + void setNavigationAction(HbAction *action); + +public slots: + void setTitle(const QString &title); + +private: // Data added for the unit testing stub + HbMenu* mMenu; + HbToolBar* mToolBar; + bool mTitlePaneItem; + bool mIndicatorItems; + bool mSecondarySoftKeyItem; +}; + +#endif // HBVIEW_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/hbstubs/hbwidget.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/hbstubs/hbwidget.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,40 @@ +/* +* 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: Orbit stubs for Live Comms UI unit tests +* +*/ + +#ifndef HBWIDGET_H +#define HBWIDGET_H + +#include +#include +#include +#include + +class HbEvent; + + +class HbWidget : public QGraphicsWidget +{ +public: + explicit HbWidget( QGraphicsItem *parent=0, Qt::WindowFlags wFlags=0 ); + virtual ~HbWidget(); + void clearActions(); + +protected: + QVariant itemChange ( GraphicsItemChange change, const QVariant & value ); +}; + +#endif // HBWIDGET_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/hbstubs/qthighway_stub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/hbstubs/qthighway_stub.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,139 @@ +/* +* Copyright (c) 2008-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 +#include +#include +#include "qthighway_stub_helper.h" + +QString qtHighwayStubService; +QString qtHighwayStubMessage; +bool qtHighwayStubIsBg; + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// + +void QtHighwayStubHelper::reset() +{ + qtHighwayStubService.clear(); + qtHighwayStubMessage.clear(); + qtHighwayStubIsBg = false; +} + +QString QtHighwayStubHelper::service() +{ + return qtHighwayStubService; +} + +QString QtHighwayStubHelper::message() +{ + return qtHighwayStubMessage; +} + +bool QtHighwayStubHelper::isAtBg() +{ + return qtHighwayStubIsBg; +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +XQServiceProvider::XQServiceProvider( const QString& service, QObject *parent ) +{ + Q_UNUSED(service); + Q_UNUSED(parent); +} + +XQServiceProvider::~XQServiceProvider() +{ + +} + +void XQServiceProvider::SetPlugin(QObject* impl_plugin) +{ + Q_UNUSED(impl_plugin); +} + +void XQServiceProvider::publishAll() +{ + +} + +int XQServiceProvider::setCurrentRequestAsync() +{ + return 0; +} + +bool XQServiceProvider::completeRequest(int index, const QVariant& retValue) +{ + Q_UNUSED(index); + Q_UNUSED(retValue); + return true; +} + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +XQServiceRequest::XQServiceRequest( + const QString& service, const QString& message, const bool& synchronous) +{ + qtHighwayStubService = service; + qtHighwayStubMessage = message; +} + +XQServiceRequest::~XQServiceRequest() +{ + +} + + +void XQServiceRequest::setArguments(const QList &arguments) +{ + Q_UNUSED(arguments) +} + +QString XQServiceRequest::service() const +{ + return qtHighwayStubService; +} + +QString XQServiceRequest::message() const +{ + return qtHighwayStubMessage; +} + +bool XQServiceRequest::send(QVariant& retValue) +{ + Q_UNUSED(retValue); + return true; +} +void XQServiceRequest::addArg(const QVariant& v) +{ + Q_UNUSED(v); +} + +void XQServiceUtil::toBackground(bool value) +{ + qtHighwayStubIsBg = value; +} diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/hbstubs/qthighway_stub_helper.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/hbstubs/qthighway_stub_helper.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,28 @@ +/* +* 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: +* +*/ + +/** +* Helper class to control logcli stub behavior +* +*/ +class QtHighwayStubHelper{ + public: + static void reset(); + static QString service(); + static QString message(); + static bool isAtBg(); +}; diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/inc/ut_lcactivitymanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/inc/ut_lcactivitymanager.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,61 @@ +/* +* 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_LCACTIVITYMANAGER_H +#define UT_LCACTIVITYMANAGER_H + +#include +class LcActivityManager; + + +class UT_LcActivityManager : 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 testConstructor(); + void testInitInactivityTimeout(); + void testEnableActivitySimulation(); + void testIsActivitySimulationEnabled(); + void testTimerEvent(); + +private: + + LcActivityManager* mActivityManager; +}; + + + + +#endif //UT_LCACTIVITYMANAGER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/inc/ut_lcuiengine.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/inc/ut_lcuiengine.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,106 @@ +/* +* 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_LCUIENGINE_H +#define UT_LCUIENGINE_H + +#include +class LcUiEngine; +class HbProgressDialog; +class HbDialog; +class HbMainWindow; +class LcSignalSink; + + +class UT_LcUiEngine : 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 testConstructor(); + void testFeatureSupported(); + void testEstablishSession(); + void testTerminateSession(); + void testSetWindowRect(); + void testEnableWindow(); + void testPlay(); + void testPause(); + void testEnableSpeaker(); + void testMuteMic(); + void testStartLiveContent(); + void testStart(); + void testSetContentAreas(); + void testSetOrientation(); + void testToggleMute(); + void testToggleSpeaker(); + void testToggleDisableCamera(); + void testToggleCamera(); + void testSessionStateChanged(); + void testPlayerStateChanged(); + void testStartReceiving(); + void testStartPlayback(); + void testStop(); + void testSetViewLayout(); + void testHideNotes(); + void testSetUiComponents(); + void testZoom(); + void testBlockUi(); + void testCloseTimer(); + void testfullScreenMode(); + void testsetFullScreenMode(); + void testTimerEvent(); + void testFillRemoteInfo(); + void testUpdateSession(); + void testIsLocalPlayerPlaying(); + void testIsRemotePlayerPlaying(); + void testMinimized(); + void testMaximized(); + void testIsMinimized(); + void testHandleForegroundStatus(); + void testSendDialTone(); + +private: + + LcUiEngine* mEngine; + HbProgressDialog* mInvitingNote; + HbProgressDialog* mWaitingNote; + HbDialog* mAcceptQuery; + HbDialog* mRecipientQuery; + HbDialog* mShareOwnVideoQuery; +}; + + + + +#endif //UT_LCUIENGINE_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/lcstub/data/10203399.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/lcstub/data/10203399.rss Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,40 @@ +/* +* 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 "registryinfov2.rh" + +RESOURCE REGISTRY_INFO theInfo + { + resource_format_version = RESOURCE_FORMAT_VERSION_2; + dll_uid = 0x10203399; + interfaces = + { + INTERFACE_INFO + { + interface_uid = 0x20021340; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x10203399; + version_no = 1; + default_data = "MultimediaSharing"; + } + }; + } + }; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/lcstub/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/lcstub/group/bld.inf Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,23 @@ +/* +* 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 + +PRJ_MMPFILES +lcenginepluginstub.mmp + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/lcstub/group/lcenginepluginstub.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/lcstub/group/lcenginepluginstub.mmp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,55 @@ +/* +* 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 + +TARGET lcenginepluginstub.dll +TARGETTYPE PLUGIN +UID 0x10009d8d 0x10203399 +VENDORID VID_DEFAULT +CAPABILITY CAP_ECOM_PLUGIN + + +SOURCEPATH ../data +START RESOURCE 10203399.rss +TARGET lcenginepluginstub.rsc +END + +SOURCEPATH ../src +SOURCE dllentry.cpp +SOURCE lcvideoplayerstub.cpp +SOURCE lcenginestub.cpp +SOURCE lcsessionstub.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../../../../../mmsharing/inc +USERINCLUDE ../../../../../../inc + + + +APP_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/ecom + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY insock.lib + + + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/lcstub/inc/centralrepository_stub_helper.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/lcstub/inc/centralrepository_stub_helper.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,33 @@ +/* +* 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: +* +*/ + + +#ifndef __CENTRALREPOSITORYHELPER_H__ +#define __CENTRALREPOSITORYHELPER_H__ + +class CentralRepositoryStubHelper{ + +public: // Stub data + + static void reset(); + static void setFailCode(TInt err); + static void setCurrentVal(TInt val); + static TInt currentVal(); + +}; + +#endif // __CENTRALREPOSITORYHELPER_H__ diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/lcstub/inc/lcenginestub.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/lcstub/inc/lcenginestub.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,62 @@ +/* +* 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 LCENGINESTUB_H +#define LCENGINESTUB_H + + +extern void lcutStub_LcEngine_reset(); +extern void lcutStub_LcEngine_setFailure( int failure ); +extern int lcutStub_LcEngine_failure(); +extern void lcutStub_LcEngine_setLcFeatureSupported( bool supported ); + +// INCLUDES +#include "lcengine.h" + +// FORWARD DECLARATIONS +class CLcSession; +class MLcUiProvider; + +class CLcEngineStub : public CLcEngine + { + public: + + static CLcEngineStub* NewL(); + ~CLcEngineStub(); + + public: // From CLcEngine + + MLcSession& Session(); + + TBool IsFeatureSupported( TLcFeature aLcFeature ); + + private: // Constructors + + CLcEngineStub(); + void ConstructL(); + + private: // New functions + + CLcSession* CreateMusSessionL( int aUseCase ); + + public: // Data + + CLcSession* iSession; + }; +#endif // LCENGINESTUB_H + +// end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/lcstub/inc/lcsessionstub.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/lcstub/inc/lcsessionstub.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,222 @@ +/* +* 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 LCSESSIONSTUB_H +#define LCSESSIONSTUB_H + +#include +#include +#include + +class MLcUiProvider; + +extern bool lcutStub_LcSession_expectCall( const QString& call, int callNdx = 0); +extern void lcutStub_LcSession_reset(); +extern MLcUiProvider* lcutStub_LcSession_lcUiProvider(); + +const char lcutStub_LcSession_NoCall[] = "NOCALL"; +const char lcutStub_LcSession_establishSession[] = "LcEngine::EstablishLcSessionL"; +const char lcutStub_LcSession_terminateSession[] = "LcEngine::TerminateLcSessionL"; +const char lcutStub_LcSession_updateSession[] = "LcEngine::UpdateLcSessionL"; + +_LIT( KLcStubLocalDisplayName, "local"); +_LIT( KLcStubRemoteDisplayName, "remote"); +_LIT( KLcStubRemoteDetails, "112233459"); + +// INCLUDES +#include "lcsession.h" + +#include +#include + +// FORWARD DECLARATIONS +class MLcSessionObserver; +class MLcUiProvider; +class CLcVideoPlayer; + + +// CLASS DECLARATION +/** +* A class representing a Live Comms session. +*/ +class CLcSession : public CBase, + public MLcSession + { +public: + /** + * Creates new CLcSession. + * + * @return CLcSession* New instanse of specified class + */ + static CLcSession* NewL(); + + +public: + + /** + * Destructor + */ + ~CLcSession(); + +public: // from MLcSession + + /** + * Returns the current session state. + * @return the session state + */ + TLcSessionState LcSessionState() const; + + /** + * Sets the observer for the session related events. + * @param aObserver the observer + */ + void SetLcSessionObserver( MLcSessionObserver* aObserver ); + + /** + * Sets the callback for the UI prompts. + * @param aUiProvider callback for UI prompts + */ + void SetLcUiProvider( MLcUiProvider* aUiProvider ); + + /** + * Establishes the session. + * In case of a MO session initiates the session negotiation. + * In case of a MT session accepts the incoming session. + */ + void EstablishLcSessionL(); + + /** + * Terminates the session. + * Can be used for terminating an existing session as well as + * cancelling a MO session that has not yet been established. + * Can also be used for rejecting an incoming session. + */ + void TerminateLcSessionL(); + + /** + * Returns the video player for the received media. + * Is present if the session contains video + * received from the remote participant. + * @return the remote video player or NULL if not present + */ + MLcVideoPlayer* RemoteVideoPlayer(); + + /** + * Returns the video player for the media that is being sent. + * Is present if the session contains outgoing video. + * @return the local video player or NULL if not present + */ + MLcVideoPlayer* LocalVideoPlayer(); + + /** + * Returns the own display name for the session. + * @return the local display name + */ + const TDesC& LocalDisplayName(); + + /** + * Returns the remote party's display name for the session. + * @return the remote display name + */ + const TDesC& RemoteDisplayName(); + + /** + * Sets a parameter for the session. + * The parameters can be plug-in specific. + * @param aId the identifier for the parameter + * @param aValue the value for the parameter + */ + TInt SetParameter( TInt aId, TInt aValue ); + + /** + * Returns a value for a session parameter. + * @param aId the identifier for the parameter + * @return the value for the parameter or an error if not present + */ + TInt ParameterValue( TInt aId ); + + /** + * Checks whether application should be started in background mode. + * In background mode session will be pre-set up without user + * interaction and will be in paused state. + * @return ETrue if background mode should be used + */ + TBool IsBackgroundStartup(); + + /** + * Engine can be informed about application foreground status via + * this method. + * @param aIsForeground ETrue if application is at foreground, EFalse + * if at background + * @return KErrNone if succesfully handled + */ + TInt SetForegroundStatus( TBool aIsForeground ); + + /** + * Returns remote party details for the session + * @return remote party details or KNullDesC if those are not known + */ + const TDesC& RemoteDetails(); + + /** + * Updates established session. + * All the changes, if they are not yet delivered, to players, windows + * and session parameters has been commited after the call. + */ + void UpdateLcSessionL(); + + /** + * Send DTMF signals. + * @param aKey Key pressed from dialpad. Key can be [0-9],*,#,A,B,C,D. + * which is 16 key combination of DTMF. + * Send DTMF signals to remote party. + * @return ETrue upon success else EFalse. + */ + TBool SendDialTone( TChar aKey); + + +protected: + + /** + * Constructor + */ + CLcSession( ); + + /** + * Second-phase constructor + */ + void ConstructL(); +public: + + MLcSessionObserver* iSessionObserver; + MLcUiProvider* iLcUiProvider; + HBufC* iLocalDisplayName; + HBufC* iRemoteDisplayName; + HBufC* iRemoteDetails; + CLcVideoPlayer* iLocalPlayer; + CLcVideoPlayer* iRemotePlayer; + TBool iIsForeground; + TBool iForegroundChange; + TLcSessionState iState; + + QMap mParams; + + }; + +#endif // LCSESSIONSTUB_H + +// end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/lcstub/inc/lcvideoplayerstub.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/lcstub/inc/lcvideoplayerstub.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,217 @@ +/* +* 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 LCVIDEOPLAYERSTUB_H +#define LCVIDEOPLAYERSTUB_H + +#include // CBase + +// USER +#include "lcvideoplayer.h" +#include "lcaudiocontrol.h" +#include "lcwindow.h" +#include "lccameracontrol.h" +#include "lczoomcontrol.h" +#include "lcbrightnesscontrol.h" + +class MLcSourceFileControl; +class MLcDestinationFileControl; + + +#include + +extern bool lcutStub_LcPlayer_expectCall( const QString& call, int callNdx = 0); +extern void lcutStub_LcPlayer_reset(); +extern void lcutStub_LcPlayer_asyncCompletion( bool async ); + +const char lcutStub_LcPlayer_NoCall[] = "NOCALL"; +const char lcutStub_LcPlayer_LcPlayL[] = "LcPlayer::LcPlayL"; +const char lcutStub_LcPlayer_LcPauseL[] = "LcPlayer::LcPauseL"; +const char lcutStub_LcPlayer_SetLcWindowRectL[] = "LcWindow::SetLcWindowRectL"; +const char lcutStub_LcPlayer_EnableLcWindowL[] = "LcPlayer::EnableLcWindowL"; +const char lcutStub_LcPlayer_DecreaseLcBrightnessL[] = "LcPlayer::DecreaseLcBrightnessL"; +const char lcutStub_LcPlayer_EnableLcLoudspeakerL[] = "LcPlayer::EnableLcLoudspeakerL"; +const char lcutStub_LcPlayer_LcZoomInL[] = "LcPlayer::LcZoomInL"; +const char lcutStub_LcPlayer_LcZoomOutL[] = "LcPlayer::LcZoomOutL"; +const char lcutStub_LcPlayer_MuteLcAudioL[] = "LcPlayer::MuteLcAudioL"; +const char lcutStub_LcPlayer_MuteLcMicL[] = "LcPlayer::MuteLcMicL"; +const char lcutStub_LcPlayer_SetLcBrightnessL[] = "LcPlayer::SetLcBrightnessL"; +const char lcutStub_LcPlayer_IncreaseLcBrightnessL[] = "LcPlayer::IncreaseLcBrightnessL"; +const char lcutStub_LcPlayer_SetLcZoomValueL[] = "LcPlayer::SetLcZoomValueL"; +const char lcutStub_LcPlayer_ToggleLcCameraL[] = "LcPlayer::ToggleLcCameraL"; +const char lcutStub_LcPlayer_SetLcWindowOrientationL[] = "LcWindow::SetLcWindowOrientationL"; + + +// CLASS DECLARATION +/** +* +*/ +class CLcVideoPlayer : public CBase, + public MLcVideoPlayer, + public MLcAudioControl, + public MLcWindow, + public MLcCameraControl, + public MLcZoomControl, + public MLcBrightnessControl + { + public: + /** + * Creates new CLcSession. + * + * @return CLcSession* New instanse of specified class + */ + static CLcVideoPlayer* NewL(); + + public: + + /** + * Destructor + */ + ~CLcVideoPlayer(); + + + 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(); + +public: // from MLcAudioControl + + TBool IsLcAudioMutedL(); + + void MuteLcAudioL( TBool aMute ); + + TBool IsLcMicMutedL(); + + void MuteLcMicL( TBool aMute ); + + TBool IsLcLoudspeakerEnabled(); + + void EnableLcLoudspeakerL( TBool aEnabled ); + + TBool IsEnablingLcLoudspeakerAllowed(); + + TInt LcVolumeL(); + + void SetLcVolumeL( TInt aValue ); + + void IncreaseLcVolumeL(); + + void DecreaseLcVolumeL(); + + +public: //from MLcCameraControl + + TInt LcCameraCountL(); + TInt CurrentLcCameraIndex(); + void ToggleLcCameraL(); + +public: //from MLcZoomControl + + TInt MinLcZoomL(); + TInt MaxLcZoomL(); + TInt LcZoomValueL(); + void SetLcZoomValueL( TInt aValue ); + void LcZoomInL(); + void LcZoomOutL(); + +public: //from MLcBrightnessControl + + TInt MinLcBrightnessL(); + TInt MaxLcBrightnessL(); + TInt LcBrightnessL(); + void SetLcBrightnessL( TInt aValue ); + void IncreaseLcBrightnessL(); + void DecreaseLcBrightnessL(); + + protected: // CONSTRUCTORS + + /** + * Constructor + * + */ + CLcVideoPlayer( ); + + /** + * Second-phase constructor + * + */ + void ConstructL(); + + + public: + + /** + * Drawing area rect. + */ + TRect iRect; + + MLcWindow::TLcWindowOrientation iOrientation; + + TBool iWindowEnabled; + + TBool iMuted; + + TBool iMicMuted; + + TBool iLoudspeakerEnabled; + + TBool iEnablingLoudspeakerAllowed; + + TInt iVolume; + + MLcVideoPlayer::TLcVideoPlayerState iState; + TBool iPlaying; + + + }; + +#endif //LCVIDEOPLAYERSTUB_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/lcstub/src/DllEntry.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/lcstub/src/DllEntry.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,42 @@ +/* +* 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 "lcenginestub.h" +#include +#include + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +const TImplementationProxy KMusEnginePluginImplementationTableStub[] = + { + IMPLEMENTATION_PROXY_ENTRY( 0x20021340, CLcEngineStub::NewL ) + }; + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount ) + { + aTableCount = sizeof( KMusEnginePluginImplementationTableStub ) / + sizeof( TImplementationProxy ); + + return KMusEnginePluginImplementationTableStub; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/lcstub/src/centralrepository_stub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/lcstub/src/centralrepository_stub.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,102 @@ +/* +* Copyright (c) 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: +* +*/ + + +#include +#include "centralrepository_stub_helper.h" + +TInt mFailCode = KErrNone; +TInt mCurrentVal = 0; + +void CentralRepositoryStubHelper::reset() +{ + mFailCode = KErrNone; + mCurrentVal = 0; +} +void CentralRepositoryStubHelper::setFailCode(TInt err) +{ + mFailCode = err; +} +void CentralRepositoryStubHelper::setCurrentVal(TInt val) +{ + mCurrentVal = val; +} +TInt CentralRepositoryStubHelper::currentVal() +{ + return mCurrentVal; +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CRepository* CRepository::NewL( TUid aRepositoryUid ) + { + CRepository* self = CRepository::NewLC( aRepositoryUid ); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CRepository* CRepository::NewLC( TUid /*aRepositoryUid*/ ) + { + CRepository* self = new (ELeave) CRepository(); + if (mFailCode == KErrNoMemory) { + User::Leave(KErrNoMemory); + } + CleanupStack::PushL( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CRepository::~CRepository() + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CRepository::Get(TUint32 /*aKey*/, TInt& aValue) + { + aValue = mCurrentVal; + return mFailCode; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CRepository::Set(TUint32 /*aKey*/, TInt aValue) + { + if ( mFailCode == KErrNone ) + { + mCurrentVal = aValue; + } + return mFailCode; + } + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/lcstub/src/lcenginestub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/lcstub/src/lcenginestub.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,158 @@ +/* +* 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 "lcenginestub.h" +#include "lcsessionstub.h" +#include "mussessionproperties.h" +#include "lcsessionobserver.h" +#include "lcuiprovider.h" +#include "lcvideoplayerstub.h" +#include "musmanagercommon.h" + +static int lcutStub_LcEngine_failureValue = 0; +static bool lcutStub_LcEngine_lcFeatureSupported = false; + + +TAny* REComSession::CreateImplementationL( TUid /*aInterfaceUid*/, + TInt32 /*aKeyOffset*/, + const TEComResolverParams& /*aResolutionParameters*/ ) +{ + User::LeaveIfError( lcutStub_LcEngine_failureValue ); + return CLcEngineStub::NewL(); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CLcEngineStub* CLcEngineStub::NewL() + { + + CLcEngineStub* self = new( ELeave )CLcEngineStub(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CLcEngineStub::~CLcEngineStub() + { + delete iSession; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CLcEngineStub::CLcEngineStub( ) + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CLcEngineStub::ConstructL() + { + iSession = CLcSession::NewL(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +MLcSession& CLcEngineStub::Session() + { + return *iSession; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CLcEngineStub::IsFeatureSupported( TLcFeature /*aLcFeature*/ ) + { + return lcutStub_LcEngine_lcFeatureSupported; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CLcSession* CLcEngineStub::CreateMusSessionL( int aUseCase ) + { + CLcSession* session; + switch ( aUseCase ) + { + case MultimediaSharing::EMusReceive: + { + session = CLcSession::NewL(); + session->iRemotePlayer = CLcVideoPlayer::NewL(); + break; + } + + case MultimediaSharing::EMusLiveVideo: + { + session = CLcSession::NewL(); + session->iLocalPlayer = CLcVideoPlayer::NewL(); + break; + } + case MultimediaSharing::EMusTwoWayVideo: + case MultimediaSharing::EMusReceiveTwoWayVideo: + { + session = CLcSession::NewL(); + session->iLocalPlayer = CLcVideoPlayer::NewL(); + session->iRemotePlayer = CLcVideoPlayer::NewL(); + break; + } + + default: + User::Leave( KErrNotSupported ); + break; + } + return session; + } + + +//stub control + + +void lcutStub_LcEngine_reset() + { + lcutStub_LcEngine_failureValue = 0; + lcutStub_LcEngine_lcFeatureSupported = false; + } + +void lcutStub_LcEngine_setFailure( int failure ) + { + lcutStub_LcEngine_failureValue = failure; + } + +int lcutStub_LcEngine_failure() + { + return lcutStub_LcEngine_failureValue; + } + +void lcutStub_LcEngine_setLcFeatureSupported( bool supported ) + { + lcutStub_LcEngine_lcFeatureSupported = supported; + } + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/lcstub/src/lcsessionstub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/lcstub/src/lcsessionstub.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,260 @@ +/* +* Copyright (c) 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: +* +*/ + + +// USER +#include "lcenginestub.h" +#include "lcsessionstub.h" +#include "lcvideoplayer.h" +#include "lcsessionobserver.h" +#include "lcuiprovider.h" +#include "lcvideoplayerstub.h" + +// SYSTEM +#include + + +static QStringList lcutStub_LcSession_calledMethods = 0; +static MLcUiProvider* lcutStub_LcSession_uiProvider = 0; + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CLcSession* CLcSession::NewL( ) + { + CLcSession* self = new( ELeave ) CLcSession( ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CLcSession::~CLcSession() + { + //delete iRemoteDisplayName; + delete iRemotePlayer; + delete iLocalPlayer; + delete iLocalDisplayName; + delete iRemoteDisplayName; + delete iRemoteDetails; + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// + + MLcSession::TLcSessionState CLcSession::LcSessionState() const + { + return iState; + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +void CLcSession::SetLcSessionObserver( MLcSessionObserver* aObserver ) + { + iSessionObserver = aObserver; + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +void CLcSession::SetLcUiProvider( MLcUiProvider* aUiProvider ) + { + iLcUiProvider = aUiProvider; + lcutStub_LcSession_uiProvider = aUiProvider; + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +void CLcSession::EstablishLcSessionL( ) + { + User::LeaveIfError( lcutStub_LcEngine_failure() ); + lcutStub_LcSession_calledMethods.insert(0,lcutStub_LcSession_establishSession ); + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +void CLcSession::TerminateLcSessionL( ) + { + User::LeaveIfError( lcutStub_LcEngine_failure() ); + lcutStub_LcSession_calledMethods.insert(0,lcutStub_LcSession_terminateSession ); + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +void CLcSession::UpdateLcSessionL( ) + { + User::LeaveIfError( lcutStub_LcEngine_failure() ); + lcutStub_LcSession_calledMethods.insert(0,lcutStub_LcSession_updateSession ); + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// + +TBool CLcSession::SendDialTone( TChar /*aKey*/) + { + return ETrue; + } + + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +MLcVideoPlayer* CLcSession::RemoteVideoPlayer( ) + { + return iRemotePlayer; + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +MLcVideoPlayer* CLcSession::LocalVideoPlayer( ) + { + return iLocalPlayer; + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +const TDesC& CLcSession::LocalDisplayName( ) + { + return *iLocalDisplayName; + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +const TDesC& CLcSession::RemoteDisplayName( ) + { + return *iRemoteDisplayName; + } +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// + TInt CLcSession::SetParameter( TInt aId, TInt aValue ) + { + mParams.insert( aId, aValue ); + return 0; + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +TInt CLcSession::ParameterValue( TInt /*aId*/ ) + { + return 0; + } + + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// + TBool CLcSession::IsBackgroundStartup() + { + return iIsForeground; + } + + // ----------------------------------------------------------------------------- + // From MLcSession + // ----------------------------------------------------------------------------- + // +TInt CLcSession::SetForegroundStatus( TBool aIsForeground ) + { + iIsForeground = aIsForeground; + return iForegroundChange; + } + + // ----------------------------------------------------------------------------- + // From MLcSession + // ----------------------------------------------------------------------------- + // +const TDesC& CLcSession::RemoteDetails() + { + return *iRemoteDetails; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CLcSession::CLcSession( ) + { + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CLcSession::ConstructL() + { + iLocalDisplayName = KLcStubLocalDisplayName().AllocL(); + iRemoteDisplayName = KLcStubRemoteDisplayName().AllocL(); + iLocalPlayer = CLcVideoPlayer::NewL(); + iRemotePlayer = CLcVideoPlayer::NewL(); + iRemoteDetails = KLcStubRemoteDetails().AllocL(); + } + + +//stub control + +bool lcutStub_LcSession_expectCall( const QString& call, int callNdx ) +{ + if ( callNdx >= lcutStub_LcSession_calledMethods.count() ) { + return call == lcutStub_LcSession_NoCall; + } + + return lcutStub_LcSession_calledMethods.count() > 0 ? + lcutStub_LcSession_calledMethods[callNdx] == call : + call == lcutStub_LcSession_NoCall; +} + + +void lcutStub_LcSession_reset() +{ + lcutStub_LcSession_calledMethods.clear(); +} + +MLcUiProvider* lcutStub_LcSession_lcUiProvider() +{ + return lcutStub_LcSession_uiProvider; +} diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/lcstub/src/lcvideoplayerstub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/lcstub/src/lcvideoplayerstub.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,485 @@ +/* +* Copyright (c) 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: +* +*/ + + +// USER +#include "lcenginestub.h" +#include "lcvideoplayerstub.h" +#include "lcvideoplayer.h" +#include "lcaudiocontrol.h" +#include "lccameracontrol.h" +#include "lczoomcontrol.h" +#include "lcbrightnesscontrol.h" +#include "lcsessionstub.h" +#include "lcuiprovider.h" + +#include + +static QStringList lcutStub_LcPlayer_calledMethods = 0; +static bool lcutStub_LcPlayer_asyncCompletionEnabled = false; + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CLcVideoPlayer* CLcVideoPlayer::NewL() + { + CLcVideoPlayer* self = new( ELeave )CLcVideoPlayer(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CLcVideoPlayer::CLcVideoPlayer() + : iRect( TRect(10,10,50,100)) + { + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CLcVideoPlayer::ConstructL() + { + + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CLcVideoPlayer::~CLcVideoPlayer() + { + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcVideoPlayer::TLcVideoPlayerState CLcVideoPlayer::LcVideoPlayerState() const + { + return iState; + } +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +TBool CLcVideoPlayer::LcIsPlayingL() + { + User::LeaveIfError( lcutStub_LcEngine_failure() ); + return iPlaying; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +void CLcVideoPlayer::LcPlayL(TLcVideoPlayerSource /*aSource*/) + { + User::LeaveIfError( lcutStub_LcEngine_failure() ); + iPlaying = ETrue; + iState = MLcVideoPlayer::EPlaying; + lcutStub_LcPlayer_calledMethods.insert(0,lcutStub_LcPlayer_LcPlayL ); + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +void CLcVideoPlayer::LcPauseL() + { + User::LeaveIfError( lcutStub_LcEngine_failure() ); + iPlaying = EFalse; + iState = MLcVideoPlayer::EPaused; + lcutStub_LcPlayer_calledMethods.insert(0,lcutStub_LcPlayer_LcPauseL ); + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcWindow* CLcVideoPlayer::LcWindow() + { + return this; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcCameraControl* CLcVideoPlayer::LcCameraControl() + { + return this; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcSourceFileControl* CLcVideoPlayer::LcSourceFileControl() + { + return NULL; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcDestinationFileControl* CLcVideoPlayer::LcDestinationFileControl() + { + return NULL; + } +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcAudioControl* CLcVideoPlayer::LcAudioControl() + { + return this; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcZoomControl* CLcVideoPlayer::LcZoomControl() + { + return this; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcBrightnessControl* CLcVideoPlayer::LcBrightnessControl() + { + return this; + } + +//----------------------------------------------------------------------------- +// From MLcWindow +// ----------------------------------------------------------------------------- +// +void CLcVideoPlayer::EnableLcWindowL( TBool aEnable ) + { + User::LeaveIfError( lcutStub_LcEngine_failure() ); + iWindowEnabled = aEnable; + lcutStub_LcPlayer_calledMethods.insert(0,lcutStub_LcPlayer_EnableLcWindowL ); + } + +// ----------------------------------------------------------------------------- +// From MLcWindow +// ----------------------------------------------------------------------------- +// +TBool CLcVideoPlayer::IsLcWindowEnabled() + { + return iWindowEnabled; + } + +// ----------------------------------------------------------------------------- +// From MLcWindow +// ----------------------------------------------------------------------------- +// +void CLcVideoPlayer::SetLcWindowRectL( TRect aRect ) + { + User::LeaveIfError( lcutStub_LcEngine_failure() ); + iRect = aRect; + lcutStub_LcPlayer_calledMethods.insert(0,lcutStub_LcPlayer_SetLcWindowRectL ); + } + +// ----------------------------------------------------------------------------- +// From MLcWindow +// ----------------------------------------------------------------------------- +// +TRect CLcVideoPlayer::LcWindowRect() + { + return iRect; + } + +// ----------------------------------------------------------------------------- +// From MLcWindow +// ----------------------------------------------------------------------------- +// +void CLcVideoPlayer::SetLcWindowOrientationL( + TLcWindowOrientation aOrientation ) + { + User::LeaveIfError( lcutStub_LcEngine_failure() ); + iOrientation = aOrientation; + lcutStub_LcPlayer_calledMethods.insert(0,lcutStub_LcPlayer_SetLcWindowOrientationL ); + } + +// ----------------------------------------------------------------------------- +// From MLcWindow +// ----------------------------------------------------------------------------- +// +MLcWindow::TLcWindowOrientation CLcVideoPlayer::LcWindowOrientationL() + { + User::LeaveIfError( lcutStub_LcEngine_failure() ); + MLcWindow::TLcWindowOrientation orientation; + if ( iOrientation == ELandscape ) + { + orientation = MLcWindow::ELandscape; + } + else + { + orientation = MLcWindow::EPortrait; + } + return orientation; + } +// ----------------------------------------------------------------------------- +// From MLcAudioControl +// ----------------------------------------------------------------------------- +// +TBool CLcVideoPlayer::IsLcAudioMutedL() + { + User::LeaveIfError( lcutStub_LcEngine_failure() ); + return iMuted; + } + +// ----------------------------------------------------------------------------- +// From MLcAudioControl +// ----------------------------------------------------------------------------- +// +void CLcVideoPlayer::MuteLcAudioL( TBool aMute ) + { + User::LeaveIfError( lcutStub_LcEngine_failure() ); + lcutStub_LcPlayer_calledMethods.insert(0,lcutStub_LcPlayer_MuteLcAudioL ); + iMuted = aMute; + } + +// ----------------------------------------------------------------------------- +// From MLcAudioControl +// ----------------------------------------------------------------------------- +// +TBool CLcVideoPlayer::IsEnablingLcLoudspeakerAllowed() + { + return iEnablingLoudspeakerAllowed; + } + +// ----------------------------------------------------------------------------- +// From MLcAudioControl +// ----------------------------------------------------------------------------- +// +TBool CLcVideoPlayer::IsLcMicMutedL() + { + User::LeaveIfError( lcutStub_LcEngine_failure() ); + return iMicMuted; + } + +// ----------------------------------------------------------------------------- +// From MLcAudioControl +// ----------------------------------------------------------------------------- +// +void CLcVideoPlayer::MuteLcMicL( TBool aMute ) + { + User::LeaveIfError( lcutStub_LcEngine_failure() ); + lcutStub_LcPlayer_calledMethods.insert(0,lcutStub_LcPlayer_MuteLcMicL ); + iMicMuted = aMute; + + if ( lcutStub_LcPlayer_asyncCompletionEnabled && + lcutStub_LcSession_lcUiProvider() ) + { + lcutStub_LcSession_lcUiProvider()->BlockUi( ETrue ); + } + } + +// ----------------------------------------------------------------------------- +// From MLcAudioControl +// ----------------------------------------------------------------------------- +// +TBool CLcVideoPlayer::IsLcLoudspeakerEnabled() + { + return iLoudspeakerEnabled; + } + +// ----------------------------------------------------------------------------- +// From MLcAudioControl +// ----------------------------------------------------------------------------- +// +void CLcVideoPlayer::EnableLcLoudspeakerL( TBool aEnabled ) + { + User::LeaveIfError( lcutStub_LcEngine_failure() ); + lcutStub_LcPlayer_calledMethods.insert(0,lcutStub_LcPlayer_EnableLcLoudspeakerL ); + iLoudspeakerEnabled = aEnabled; + + if ( lcutStub_LcPlayer_asyncCompletionEnabled && + lcutStub_LcSession_lcUiProvider() ) + { + lcutStub_LcSession_lcUiProvider()->BlockUi( ETrue ); + } + } + +// ----------------------------------------------------------------------------- +// From MLcAudioControl +// ----------------------------------------------------------------------------- +// +TInt CLcVideoPlayer::LcVolumeL() + { + User::LeaveIfError( lcutStub_LcEngine_failure() ); + return iVolume; + } + +// ----------------------------------------------------------------------------- +// From MLcAudioControl +// ----------------------------------------------------------------------------- +// +void CLcVideoPlayer::SetLcVolumeL( TInt aValue ) + { + User::LeaveIfError( lcutStub_LcEngine_failure() ); + iVolume = aValue; + } + +// ----------------------------------------------------------------------------- +// From MLcAudioControl +// ----------------------------------------------------------------------------- +// +void CLcVideoPlayer::IncreaseLcVolumeL() + { + User::LeaveIfError( lcutStub_LcEngine_failure() ); + iVolume++; + } + +// ----------------------------------------------------------------------------- +// From MLcAudioControl +// ----------------------------------------------------------------------------- +// +void CLcVideoPlayer::DecreaseLcVolumeL() + { + User::LeaveIfError( lcutStub_LcEngine_failure() ); + iVolume--; + } + +TInt CLcVideoPlayer::LcCameraCountL() + { + User::LeaveIfError( lcutStub_LcEngine_failure() ); + return 2; + } + +TInt CLcVideoPlayer::CurrentLcCameraIndex() + { + return 0; + } + +void CLcVideoPlayer::ToggleLcCameraL() + { + User::LeaveIfError( lcutStub_LcEngine_failure() ); + lcutStub_LcPlayer_calledMethods.insert(0,lcutStub_LcPlayer_ToggleLcCameraL ); + } + +TInt CLcVideoPlayer::MinLcZoomL() + { + User::LeaveIfError( lcutStub_LcEngine_failure() ); + return 0; + } + +TInt CLcVideoPlayer::MaxLcZoomL() + { + User::LeaveIfError( lcutStub_LcEngine_failure() ); + return 10; + } + +TInt CLcVideoPlayer::LcZoomValueL() + { + User::LeaveIfError( lcutStub_LcEngine_failure() ); + return 0; + } + +void CLcVideoPlayer::SetLcZoomValueL( TInt /*aValue*/ ) + { + User::LeaveIfError( lcutStub_LcEngine_failure() ); + lcutStub_LcPlayer_calledMethods.insert(0,lcutStub_LcPlayer_SetLcZoomValueL ); + } + +void CLcVideoPlayer::LcZoomInL() + { + User::LeaveIfError( lcutStub_LcEngine_failure() ); + lcutStub_LcPlayer_calledMethods.insert(0,lcutStub_LcPlayer_LcZoomInL ); + } + +void CLcVideoPlayer::LcZoomOutL() + { + User::LeaveIfError( lcutStub_LcEngine_failure() ); + lcutStub_LcPlayer_calledMethods.insert(0,lcutStub_LcPlayer_LcZoomOutL ); + } + +TInt CLcVideoPlayer::MinLcBrightnessL() + { + User::LeaveIfError( lcutStub_LcEngine_failure() ); + return 0; + } + +TInt CLcVideoPlayer::MaxLcBrightnessL() + { + User::LeaveIfError( lcutStub_LcEngine_failure() ); + return 20; + } + +TInt CLcVideoPlayer::LcBrightnessL() + { + User::LeaveIfError( lcutStub_LcEngine_failure() ); + return 10; + } + +void CLcVideoPlayer::SetLcBrightnessL( TInt /*aValue*/ ) + { + User::LeaveIfError( lcutStub_LcEngine_failure() ); + lcutStub_LcPlayer_calledMethods.insert(0,lcutStub_LcPlayer_SetLcBrightnessL ); + } + +void CLcVideoPlayer::IncreaseLcBrightnessL() + { + User::LeaveIfError( lcutStub_LcEngine_failure() ); + lcutStub_LcPlayer_calledMethods.insert(0,lcutStub_LcPlayer_IncreaseLcBrightnessL ); + } + +void CLcVideoPlayer::DecreaseLcBrightnessL() + { + User::LeaveIfError( lcutStub_LcEngine_failure() ); + lcutStub_LcPlayer_calledMethods.insert(0,lcutStub_LcPlayer_DecreaseLcBrightnessL ); + } + + +//stub control + +bool lcutStub_LcPlayer_expectCall( const QString& call, int callNdx ) +{ + if ( callNdx >= lcutStub_LcPlayer_calledMethods.count() ) { + return call == lcutStub_LcPlayer_NoCall; + } + return lcutStub_LcPlayer_calledMethods.count() > 0 ? + lcutStub_LcPlayer_calledMethods[callNdx] == call : + call == lcutStub_LcPlayer_NoCall; +} + + +void lcutStub_LcPlayer_reset() +{ + lcutStub_LcPlayer_calledMethods.clear(); + lcutStub_LcPlayer_asyncCompletion( false ); +} + +void lcutStub_LcPlayer_asyncCompletion( bool async ) +{ + lcutStub_LcPlayer_asyncCompletionEnabled = async; +} + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/runtest.cmd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/runtest.cmd Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,22 @@ +@rem +@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +@rem All rights reserved. +@rem This component and the accompanying materials are made available +@rem under the terms of "Eclipse Public License v1.0" +@rem which accompanies this distribution, and is available +@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +@rem +@rem Initial Contributors: +@rem Nokia Corporation - initial contribution. +@rem +@rem Contributors: +@rem +@rem Description: +@rem + +#call qmake +#call bldmake bldfiles +#call abld build winscw udeb +call \epoc32\release\winscw\udeb\ut_lcuieng.exe -xml -o c:\ut_lcuieng.xml +call copy R:\epoc32\winscw\c\ut_lcuieng.xml . +call type ut_lcuieng.xml \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/src/main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/src/main.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,65 @@ +/* +* 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_lcuiengine.h" +#include "testresultxmlparser.h" + +#if defined(Q_OS_SYMBIAN) +#include "ut_lcactivitymanager.h" +#endif + +int main(int argc, char *argv[]) +{ + bool promptOnExit(true); + for (int i=0; i + +const int utDisplayTimeout = 10; + +////////////////////////////////////////////////////////////////////////////// +// Stub of User::InactivityTime() and User::ResetInactivityTime() +TTimeIntervalSeconds utInactivityInterval = 0; + +TTimeIntervalSeconds User::InactivityTime() +{ + return utInactivityInterval; +} + +void User::ResetInactivityTime() +{ + utInactivityInterval = 0; +} +////////////////////////////////////////////////////////////////////////////// + + + +void UT_LcActivityManager::initTestCase() +{ +} + +void UT_LcActivityManager::cleanupTestCase() +{ +} + + +void UT_LcActivityManager::init() +{ + CentralRepositoryStubHelper::reset(); + CentralRepositoryStubHelper::setCurrentVal(utDisplayTimeout); + mActivityManager = new LcActivityManager; +} + +void UT_LcActivityManager::cleanup() +{ + delete mActivityManager; +} + +void UT_LcActivityManager::testConstructor() +{ + // Inactivity timeout initialized with value from cenrep + QVERIFY( mActivityManager ); + QVERIFY( mActivityManager->mTimerId == -1 ); + QVERIFY( mActivityManager->mInactivityTimeout == utDisplayTimeout - 2 ); + + // Fetching value from cenrep failed, timeout initialized with default value + delete mActivityManager; + mActivityManager = 0; + CentralRepositoryStubHelper::setFailCode(-1); + mActivityManager = new LcActivityManager; + QVERIFY( mActivityManager->mTimerId == -1 ); + QVERIFY( mActivityManager->mInactivityTimeout == 5 ); //see lcDefaultInactivityTimeout + QVERIFY( mActivityManager->mInactivityTimeout != utDisplayTimeout - 2 ); +} + +void UT_LcActivityManager::testInitInactivityTimeout() +{ + // Creation of cenrep failed, timeout value not changed + QVERIFY( mActivityManager->mTimerId == -1 ); + QVERIFY( mActivityManager->mInactivityTimeout == utDisplayTimeout - 2 ); + CentralRepositoryStubHelper::setFailCode(KErrNoMemory); + CentralRepositoryStubHelper::setCurrentVal(2); + QVERIFY( mActivityManager->initInactivityTimeout() == KErrNoMemory ); + QVERIFY( mActivityManager->mTimerId == -1 ); + QVERIFY( mActivityManager->mInactivityTimeout + != CentralRepositoryStubHelper::currentVal() - 2 ); + QVERIFY( mActivityManager->mInactivityTimeout == utDisplayTimeout - 2 ); + + // Fetching value from cenrep failed + CentralRepositoryStubHelper::setFailCode(KErrNotFound); + CentralRepositoryStubHelper::setCurrentVal(3); + QVERIFY( mActivityManager->initInactivityTimeout() == KErrNotFound ); + QVERIFY( mActivityManager->mTimerId == -1 ); + QVERIFY( mActivityManager->mInactivityTimeout + == CentralRepositoryStubHelper::currentVal() - 2 ); + + // Timeout initialized with cenrep value + CentralRepositoryStubHelper::reset(); + CentralRepositoryStubHelper::setCurrentVal(2); + QVERIFY( mActivityManager->initInactivityTimeout() == KErrNone ); + QVERIFY( mActivityManager->mTimerId == -1 ); + QVERIFY( mActivityManager->mInactivityTimeout + == CentralRepositoryStubHelper::currentVal() ); +} + +void UT_LcActivityManager::testEnableActivitySimulation() +{ + // Starting activity simulation for the 1st time + QVERIFY( mActivityManager->mTimerId == -1 ); + mActivityManager->mInactivityTimeout = 5; + utInactivityInterval = 1; + QVERIFY( User::InactivityTime().Int() == 1 ); + mActivityManager->enableActivitySimulation(true); + QVERIFY( mActivityManager->mTimerId > 0 ); + QVERIFY( User::InactivityTime().Int() == 1 ); + + // Starting activity simulation again, user inactivity reached threshold + utInactivityInterval = mActivityManager->mInactivityTimeout = 5; + QVERIFY( User::InactivityTime().Int() == 5 ); + mActivityManager->enableActivitySimulation(true); + QVERIFY( mActivityManager->mTimerId > 0 ); + QVERIFY( User::InactivityTime().Int() == 0 ); + + // Disabling ongoing activity simulation + QVERIFY( mActivityManager->mTimerId > 0 ); + mActivityManager->enableActivitySimulation(false); + QVERIFY( mActivityManager->mTimerId == -1 ); + + // Disabling when no activity simulation running + QVERIFY( mActivityManager->mTimerId == -1 ); + mActivityManager->enableActivitySimulation(false); + QVERIFY( mActivityManager->mTimerId == -1 ); +} + +void UT_LcActivityManager::testIsActivitySimulationEnabled() +{ + QVERIFY( mActivityManager->mTimerId == -1 ); + QVERIFY( !mActivityManager->isActivitySimulationEnabled() ); + + mActivityManager->mTimerId = 1; + QVERIFY( mActivityManager->isActivitySimulationEnabled() ); +} + +void UT_LcActivityManager::testTimerEvent() +{ + // Time event for some other timer, nothing to do + mActivityManager->mTimerId = 10; + QTimerEvent dummyTimerEvent(5); + mActivityManager->timerEvent(&dummyTimerEvent); + QVERIFY( mActivityManager->mTimerId == 10 ); + + // Time event for inactivity timer, timer is restarted + QTimerEvent inactivityTimerEvent(mActivityManager->mTimerId); + mActivityManager->timerEvent(&inactivityTimerEvent); + QVERIFY( mActivityManager->mTimerId != 10 ); +} diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/src/ut_lcuiengine.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/src/ut_lcuiengine.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,1204 @@ +/* +* 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 "ut_lcuiengine.h" +#include "lcuiengine.h" +#include "lcuiengine_p.h" +#include "lcactivitymanager.h" + +#include "lcenginestub.h" +#include "lcsessionstub.h" +#include "lcvideoplayerstub.h" +#include "lcuidefs.h" +#include "qthighway_stub_helper.h" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +const char lcutMultimediaSharingEng[] = "MultimediaSharing"; +const char lcutVideotelephonyEng[] = "Videotelephony"; + +const char lcutMultimediaSharingApp[] = "Multimedia Sharing"; +const char lcutVideotelephonyApp[] = "Videotelephony"; + +#define LC_ENGINE( uiengine )\ + (static_cast( uiengine->d->mLiveCommsEngine ) ) + +#define LC_SESSION( uiengine )\ + (LC_ENGINE(uiengine)->iSession) + +void UT_LcUiEngine::initTestCase() +{ + lcutStub_LcEngine_reset(); + lcutStub_LcSession_reset(); + lcutStub_LcPlayer_reset(); + +} + +void UT_LcUiEngine::cleanupTestCase() +{ + lcutStub_LcEngine_reset(); + lcutStub_LcSession_reset(); + lcutStub_LcPlayer_reset(); +} + + +void UT_LcUiEngine::init() +{ + lcutStub_LcEngine_reset(); + lcutStub_LcSession_reset(); + lcutStub_LcPlayer_reset(); + mEngine = new LcUiEngine( lcutMultimediaSharingEng, + lcutMultimediaSharingApp ); + mInvitingNote = new HbProgressDialog(); + mWaitingNote = new HbProgressDialog(); + mAcceptQuery = new HbDialog(); + mRecipientQuery = new HbDialog(); + mShareOwnVideoQuery = new HbDialog(); + +} + +void UT_LcUiEngine::cleanup() +{ + lcutStub_LcEngine_reset(); + lcutStub_LcSession_reset(); + lcutStub_LcPlayer_reset(); + delete mEngine; + delete mInvitingNote; + delete mWaitingNote; + delete mAcceptQuery; + delete mRecipientQuery; + delete mShareOwnVideoQuery; +} + +void UT_LcUiEngine::testConstructor() +{ + // "MuS plug-in" loaded + QVERIFY( mEngine ); + QCOMPARE( mEngine->d->mViewLayout, Lc_IdleViewLayout ); + QVERIFY( !mEngine->d->mInvitingNote ); + QVERIFY( !mEngine->d->mWaitingNote ); + QVERIFY( !mEngine->d->mAcceptQuery ); + QVERIFY( !mEngine->d->mRecipientQuery ); + QVERIFY( !mEngine->d->mCloseTimer ); + QVERIFY( mEngine->d->mLiveCommsEngine ); + QCOMPARE( mEngine->d->mEngineName, QByteArray( lcutMultimediaSharingEng ) ); + QVERIFY( mEngine->d->recipient() != hbTrId("txt_vt_custom_unknown_number") ); + QCOMPARE( mEngine->d->sessionTitle(), QString( lcutMultimediaSharingApp ) ); + int engineWindowParam = 0; + QVERIFY( LC_SESSION( mEngine )->mParams.contains( engineWindowParam ) ); + QVERIFY( mEngine->d->mActivityManager ); + QVERIFY( !mEngine->d->mActivityManager->isActivitySimulationEnabled() ); + QVERIFY( !mEngine->d->mShareOwnVideoQuery ); + + // "VT plug-in" loaded + lcutStub_LcEngine_reset(); + lcutStub_LcSession_reset(); + delete mEngine; + mEngine = 0; + mEngine = new LcUiEngine( lcutVideotelephonyEng, + lcutVideotelephonyApp ); + QVERIFY( mEngine ); + QCOMPARE( mEngine->d->mViewLayout, Lc_AllInOneViewLayout ); + QVERIFY( !mEngine->d->mInvitingNote ); + QVERIFY( !mEngine->d->mWaitingNote ); + QVERIFY( !mEngine->d->mAcceptQuery ); + QVERIFY( !mEngine->d->mRecipientQuery ); + QVERIFY( !mEngine->d->mCloseTimer ); + QVERIFY( mEngine->d->mLiveCommsEngine ); + QCOMPARE( mEngine->d->mEngineName, QByteArray( lcutVideotelephonyEng ) ); + QVERIFY( mEngine->d->recipient() != hbTrId("txt_vt_custom_unknown_number") ); + QCOMPARE( mEngine->d->sessionTitle(), QString( lcutVideotelephonyApp ) ); + QVERIFY( LC_SESSION( mEngine )->mParams.contains( engineWindowParam ) ); + QVERIFY( !mEngine->d->mFullScreen ); + QVERIFY( mEngine->d->mActivityManager ); + QVERIFY( !mEngine->d->mActivityManager->isActivitySimulationEnabled() ); + QVERIFY( !mEngine->d->mShareOwnVideoQuery ); +} + +void UT_LcUiEngine::testFeatureSupported() +{ + // Engine not loaded + CLcEngine* enginePtr = mEngine->d->mLiveCommsEngine; + mEngine->d->mLiveCommsEngine = 0; + QVERIFY( !mEngine->d->featureSupported( CLcEngine::ELcShowAcceptQuery ) ); + + // Engine loaded, feature not supported + mEngine->d->mLiveCommsEngine = enginePtr; + QVERIFY( !mEngine->d->featureSupported( CLcEngine::ELcShowAcceptQuery ) ); + + // Feature supported + lcutStub_LcEngine_setLcFeatureSupported( true ); + QVERIFY( mEngine->d->featureSupported( CLcEngine::ELcShowAcceptQuery ) ); +} + +void UT_LcUiEngine::testEstablishSession() +{ + // Leave + lcutStub_LcEngine_setFailure( -1 ); + QCOMPARE( mEngine->d->establishSession(), -1 ); + QVERIFY( !mEngine->d->mCloseTimer ); + + // No leave + lcutStub_LcEngine_reset(); + QCOMPARE( mEngine->d->establishSession(), 0 ); + QVERIFY( mEngine->d->mCloseTimer ); +} + +void UT_LcUiEngine::testTerminateSession() +{ + // Leave + lcutStub_LcEngine_setFailure( -1 ); + QCOMPARE( mEngine->d->terminateSession(), -1 ); + + // No leave + lcutStub_LcEngine_reset(); + QCOMPARE( mEngine->d->establishSession(), 0 ); +} + +void UT_LcUiEngine::testSetWindowRect() +{ + TRect rect; + MLcVideoPlayer* player = + mEngine->d->mLiveCommsEngine->Session().LocalVideoPlayer(); + + // No player + QCOMPARE( mEngine->d->setWindowRect( 0, rect ), -1 ); + + // Leave + lcutStub_LcEngine_setFailure( -2 ); + QCOMPARE( mEngine->d->setWindowRect( player, rect ), -2 ); + + // No leave + lcutStub_LcEngine_reset(); + QCOMPARE( mEngine->d->setWindowRect( player, rect ), 0 ); +} + +void UT_LcUiEngine::testEnableWindow() +{ + MLcVideoPlayer* player = + mEngine->d->mLiveCommsEngine->Session().LocalVideoPlayer(); + + // No player + QCOMPARE( mEngine->d->enableWindow( 0, true ), -1 ); + + // Leave + lcutStub_LcEngine_setFailure( -2 ); + QCOMPARE( mEngine->d->enableWindow( player, true ), -2 ); + + // No leave + lcutStub_LcEngine_reset(); + QCOMPARE( mEngine->d->enableWindow( player, true ), 0 ); +} + +void UT_LcUiEngine::testPlay() +{ + MLcVideoPlayer* player = + mEngine->d->mLiveCommsEngine->Session().LocalVideoPlayer(); + + // No player + QCOMPARE( mEngine->d->play( 0 ), -1 ); + + // Leave + lcutStub_LcEngine_setFailure( -2 ); + QCOMPARE( mEngine->d->play( player ), -2 ); + + // No leave + lcutStub_LcEngine_reset(); + QVERIFY( !player->LcIsPlayingL() ); + QCOMPARE( mEngine->d->play( player ), 0 ); + QVERIFY( player->LcIsPlayingL() ); +} + +void UT_LcUiEngine::testPause() +{ + MLcVideoPlayer* player = + mEngine->d->mLiveCommsEngine->Session().LocalVideoPlayer(); + + // No player + QCOMPARE( mEngine->d->pause( 0 ), -1 ); + + // Leave + lcutStub_LcEngine_setFailure( -2 ); + QCOMPARE( mEngine->d->pause( player ), -2 ); + + // No leave + lcutStub_LcEngine_reset(); + QCOMPARE( mEngine->d->play( player ), 0 ); + QVERIFY( player->LcIsPlayingL() ); + QCOMPARE( mEngine->d->pause( player ), 0 ); + QVERIFY( !player->LcIsPlayingL() ); +} + +void UT_LcUiEngine::testEnableSpeaker() +{ + // Leave + lcutStub_LcEngine_setFailure( -1 ); + QCOMPARE( mEngine->d->enableSpeaker( true ), -1 ); + QVERIFY( !mEngine->d->isSpeakerOn() ); + + // No leave + lcutStub_LcEngine_reset(); + QCOMPARE( mEngine->d->enableSpeaker( true ), 0 ); + QVERIFY( mEngine->d->isSpeakerOn() ); +} + +void UT_LcUiEngine::testMuteMic() +{ + // Leave + lcutStub_LcEngine_setFailure( -1 ); + QCOMPARE( mEngine->d->muteMic( true ), -1 ); + lcutStub_LcEngine_reset(); + QVERIFY( !mEngine->d->isMuted() ); + + // No leave + QCOMPARE( mEngine->d->muteMic( true ), 0 ); + QVERIFY( mEngine->d->isMuted() ); +} + +void UT_LcUiEngine::testStartLiveContent() +{ + // mInvitingNote not set + mInvitingNote->hide(); + mEngine->d->startLiveContent(); + QVERIFY( !mInvitingNote->isVisible() ); + QVERIFY( lcutStub_LcSession_expectCall( lcutStub_LcSession_establishSession ) ); + + // mInvitingNote set, but the engine does not support the feature + lcutStub_LcSession_reset(); + mEngine->d->mInvitingNote = mInvitingNote; + mEngine->d->startLiveContent(); + QVERIFY( !mInvitingNote->isVisible() ); + QVERIFY( lcutStub_LcSession_expectCall( lcutStub_LcSession_establishSession ) ); + + // mInvitingNote set and the engine supports the feature + lcutStub_LcSession_reset(); + lcutStub_LcEngine_setLcFeatureSupported( true ); + mEngine->d->startLiveContent(); + QVERIFY( mInvitingNote->isVisible() ); + QVERIFY( lcutStub_LcSession_expectCall( lcutStub_LcSession_establishSession ) ); +} + +void UT_LcUiEngine::testStart() +{ + LC_SESSION( mEngine )->iState = MLcSession::EReceived; + mEngine->d->start(); + QVERIFY( mEngine->d->mActivityManager->isActivitySimulationEnabled() ); + QVERIFY( lcutStub_LcSession_expectCall( lcutStub_LcSession_NoCall ) ); + + lcutStub_LcSession_reset(); + lcutStub_LcPlayer_reset(); + + LC_SESSION( mEngine )->iState = MLcSession::EInitialized; + mEngine->d->start(); + QVERIFY( lcutStub_LcSession_expectCall( lcutStub_LcSession_establishSession ) ); + + lcutStub_LcSession_reset(); + lcutStub_LcPlayer_reset(); + + mEngine->d->setUiComponents( mInvitingNote, mWaitingNote, + mAcceptQuery, mRecipientQuery,mShareOwnVideoQuery ); + LC_SESSION( mEngine )->iState = MLcSession::EInitialized; + mEngine->d->start(); + QVERIFY( lcutStub_LcSession_expectCall( lcutStub_LcSession_establishSession ) ); +} + +void UT_LcUiEngine::testSetUiComponents() +{ + QVERIFY( !mEngine->d->mInvitingNote ); + QVERIFY( !mEngine->d->mWaitingNote ); + QVERIFY( !mEngine->d->mAcceptQuery ); + QVERIFY( !mEngine->d->mRecipientQuery ); + + mEngine->d->setUiComponents(0,0,0,0,0); + + QVERIFY( !mEngine->d->mInvitingNote ); + QVERIFY( !mEngine->d->mWaitingNote ); + QVERIFY( !mEngine->d->mAcceptQuery ); + QVERIFY( !mEngine->d->mRecipientQuery ); + + mEngine->d->setUiComponents(mInvitingNote,mWaitingNote,mAcceptQuery,mRecipientQuery,mShareOwnVideoQuery); + QVERIFY( mEngine->d->mInvitingNote ); + QVERIFY( mEngine->d->mWaitingNote ); + QVERIFY( mEngine->d->mAcceptQuery ); + QVERIFY( mEngine->d->mRecipientQuery ); +} + +void UT_LcUiEngine::testSessionStateChanged() +{ + LC_SESSION( mEngine )->iState = MLcSession::EUninitialized; + mEngine->d->StateChanged( *LC_SESSION( mEngine ) ); + QVERIFY( lcutStub_LcSession_expectCall( lcutStub_LcSession_NoCall ) ); + + lcutStub_LcSession_reset(); + lcutStub_LcPlayer_reset(); + + QVERIFY( mEngine->d->mSessionDurationTimerId == 0 ); + LC_SESSION( mEngine )->iState = MLcSession::EOpen; + mEngine->d->StateChanged( *LC_SESSION( mEngine ) ); + QVERIFY( lcutStub_LcSession_expectCall( lcutStub_LcSession_NoCall ) ); + QVERIFY( lcutStub_LcPlayer_expectCall( lcutStub_LcPlayer_EnableLcWindowL ) ); + // Session duration is started when session opened + QVERIFY( mEngine->d->mSessionDurationTimerId != 0 ); + + lcutStub_LcSession_reset(); + lcutStub_LcPlayer_reset(); + + LC_SESSION( mEngine )->iState = MLcSession::EClosed; + QSignalSpy spy(mEngine, SIGNAL(stopped())); + mEngine->d->StateChanged( *LC_SESSION( mEngine ) ); + QVERIFY( lcutStub_LcSession_expectCall( lcutStub_LcSession_NoCall ) ); + QVERIFY( lcutStub_LcPlayer_expectCall( lcutStub_LcPlayer_NoCall ) ); + QCOMPARE( spy.count(), 1 ); + + // mAcceptQuery not set + lcutStub_LcSession_reset(); + lcutStub_LcPlayer_reset(); + mAcceptQuery->hide(); + LC_SESSION( mEngine )->iState = MLcSession::EReceived; + mEngine->d->StateChanged( *LC_SESSION( mEngine ) ); + QVERIFY( !mAcceptQuery->isVisible() ); + QVERIFY( lcutStub_LcSession_expectCall( lcutStub_LcSession_establishSession ) ); + QVERIFY( lcutStub_LcPlayer_expectCall( lcutStub_LcPlayer_NoCall ) ); + + // mAcceptQuery set, but the engine does not support the feature + lcutStub_LcSession_reset(); + lcutStub_LcPlayer_reset(); + LC_SESSION( mEngine )->iState = MLcSession::EReceived; + mEngine->d->mAcceptQuery = mAcceptQuery; + mEngine->d->StateChanged( *LC_SESSION( mEngine ) ); + QVERIFY( !mAcceptQuery->isVisible() ); + QVERIFY( lcutStub_LcSession_expectCall( lcutStub_LcSession_establishSession ) ); + QVERIFY( lcutStub_LcPlayer_expectCall( lcutStub_LcPlayer_NoCall ) ); + + // mAcceptQuery set and the engine supports the feature + lcutStub_LcSession_reset(); + lcutStub_LcPlayer_reset(); + LC_SESSION( mEngine )->iState = MLcSession::EReceived; + lcutStub_LcEngine_setLcFeatureSupported( true ); + mEngine->d->StateChanged( *LC_SESSION( mEngine ) ); + QVERIFY( mAcceptQuery->isVisible() ); + QVERIFY( lcutStub_LcSession_expectCall( lcutStub_LcSession_NoCall ) ); + QVERIFY( lcutStub_LcPlayer_expectCall( lcutStub_LcPlayer_NoCall ) ); + + // MT call and sharing own video not allowed by default , popup query shown + lcutStub_LcSession_reset(); + lcutStub_LcPlayer_reset(); + mShareOwnVideoQuery->hide(); + mEngine->d->setUiComponents(mInvitingNote,mWaitingNote,mAcceptQuery,mRecipientQuery,mShareOwnVideoQuery); + LC_SESSION( mEngine )->iState = MLcSession::EOpen; + lcutStub_LcEngine_setLcFeatureSupported( true ); + mEngine->d->StateChanged( *LC_SESSION( mEngine ) ); + QVERIFY( mEngine->d->mShareOwnVideoQuery ); + QVERIFY( mEngine->d->mShareOwnVideoQuery->isVisible() ); + CLcVideoPlayer* localPlayer = LC_SESSION( mEngine )->iLocalPlayer; + //QVERIFY( localPlayer->iState == MLcVideoPlayer::EPaused ); + + // MO call and sharing own video allowed by default , popup query not shown + lcutStub_LcSession_reset(); + lcutStub_LcPlayer_reset(); + mShareOwnVideoQuery->hide(); + mEngine->d->setUiComponents(mInvitingNote,mWaitingNote,mAcceptQuery,mRecipientQuery,mShareOwnVideoQuery); + LC_SESSION( mEngine )->iState = MLcSession::EOpen; + lcutStub_LcEngine_setLcFeatureSupported( false ); + mEngine->d->StateChanged( *LC_SESSION( mEngine ) ); + QVERIFY( mEngine->d->mShareOwnVideoQuery ); + QVERIFY( !mEngine->d->mShareOwnVideoQuery->isVisible() ); + localPlayer = LC_SESSION( mEngine )->iLocalPlayer; + QVERIFY( localPlayer->iState == MLcVideoPlayer::EPlaying ); + +} + +void UT_LcUiEngine::testPlayerStateChanged() +{ + CLcVideoPlayer* localPlayer = LC_SESSION( mEngine )->iLocalPlayer; + QVERIFY( localPlayer != NULL ); + QSignalSpy localPlayerSignalSpy( mEngine, SIGNAL( localPlayerPlaying() ) ); + QSignalSpy localPlayerSignalSpy2( mEngine, SIGNAL( localPlayerPreparing() ) ); + QSignalSpy localPlayerSignalSpy3( mEngine, SIGNAL( localPlayerBuffering() ) ); + QSignalSpy localPlayerSignalSpy4( mEngine, SIGNAL( localPlayerPaused() ) ); + QSignalSpy localPlayerSignalSpy5( mEngine, SIGNAL( localPlayerUnavailable() ) ); + + CLcVideoPlayer* remotePlayer = LC_SESSION( mEngine )->iRemotePlayer; + QVERIFY( remotePlayer != NULL ); + QSignalSpy remotePlayerSignalSpy( mEngine, SIGNAL( remotePlayerPlaying() ) ); + QSignalSpy remotePlayerSignalSpy2( mEngine, SIGNAL( remotePlayerPreparing() ) ); + QSignalSpy remotePlayerSignalSpy3( mEngine, SIGNAL( remotePlayerBuffering() ) ); + QSignalSpy remotePlayerSignalSpy4( mEngine, SIGNAL( remotePlayerPaused() ) ); + QSignalSpy remotePlayerSignalSpy5( mEngine, SIGNAL( remotePlayerUnavailable() ) ); + + // Use local player, player not playing + mEngine->d->StateChanged( *localPlayer ); + QCOMPARE( localPlayerSignalSpy.count(), 0 ); + QCOMPARE( localPlayerSignalSpy2.count(), 0 ); + QCOMPARE( localPlayerSignalSpy3.count(), 0 ); + QCOMPARE( localPlayerSignalSpy4.count(), 0 ); + QCOMPARE( localPlayerSignalSpy5.count(), 0 ); + + // Use local player, player preparing + localPlayer->iState = MLcVideoPlayer::EPreparing; + mEngine->d->StateChanged( *localPlayer ); + QCOMPARE( localPlayerSignalSpy2.count(), 1 ); + + // Use local player, player buffering + localPlayer->iState = MLcVideoPlayer::EBuffering; + mEngine->d->StateChanged( *localPlayer ); + QCOMPARE( localPlayerSignalSpy3.count(), 1 ); + + // Use local player, player playing + localPlayer->iState = MLcVideoPlayer::EPlaying; + mEngine->d->StateChanged( *localPlayer ); + QCOMPARE( localPlayerSignalSpy.count(), 1 ); + + // Use local player, player paused + localPlayer->iState = MLcVideoPlayer::EPaused; + mEngine->d->StateChanged( *localPlayer ); + QCOMPARE( localPlayerSignalSpy4.count(), 1 ); + + // Use local player, player unavailable + localPlayer->iState = MLcVideoPlayer::EUnavailable; + mEngine->d->StateChanged( *localPlayer ); + QCOMPARE( localPlayerSignalSpy5.count(), 1 ); + + // Use remote player, no waiting note + mEngine->d->StateChanged( *remotePlayer ); + QVERIFY( mWaitingNote->isVisible() ); + QCOMPARE( remotePlayerSignalSpy.count(), 0 ); + QCOMPARE( remotePlayerSignalSpy2.count(), 0 ); + QCOMPARE( remotePlayerSignalSpy3.count(), 0 ); + QCOMPARE( remotePlayerSignalSpy4.count(), 0 ); + QCOMPARE( remotePlayerSignalSpy5.count(), 0 ); + + // Use remote player, waiting note present, player not playing + mEngine->d->mWaitingNote = mWaitingNote; + mEngine->d->StateChanged( *remotePlayer ); + QVERIFY( mWaitingNote->isVisible() ); + QCOMPARE( remotePlayerSignalSpy.count(), 0 ); + QCOMPARE( remotePlayerSignalSpy2.count(), 0 ); + QCOMPARE( remotePlayerSignalSpy3.count(), 0 ); + QCOMPARE( remotePlayerSignalSpy4.count(), 0 ); + QCOMPARE( remotePlayerSignalSpy5.count(), 0 ); + + // Use remote player, player preparing + remotePlayer->iState = MLcVideoPlayer::EPreparing; + mEngine->d->StateChanged( *remotePlayer ); + QVERIFY( mWaitingNote->isVisible() ); + QCOMPARE( remotePlayerSignalSpy2.count(), 1 ); + + // Use remote player, player buffering + remotePlayer->iState = MLcVideoPlayer::EBuffering; + mEngine->d->StateChanged( *remotePlayer ); + QVERIFY( mWaitingNote->isVisible() ); + QCOMPARE( remotePlayerSignalSpy3.count(), 1 ); + + // Use remote player, waiting note present, player playing + remotePlayer->iState = MLcVideoPlayer::EPlaying; + mEngine->d->StateChanged( *remotePlayer ); + QVERIFY( !mWaitingNote->isVisible() ); + QCOMPARE( remotePlayerSignalSpy.count(), 1 ); + + // Use remote player, waiting note present, player playing + remotePlayer->iState = MLcVideoPlayer::EUnavailable; + mEngine->d->StateChanged( *remotePlayer ); + QVERIFY( !mWaitingNote->isVisible() ); + QCOMPARE( remotePlayerSignalSpy5.count(), 1 ); + + // Use remote player, player paused + remotePlayer->iState = MLcVideoPlayer::EPaused; + mEngine->d->StateChanged( *remotePlayer ); + QVERIFY( !mWaitingNote->isVisible() ); + QCOMPARE( remotePlayerSignalSpy4.count(), 1 ); + + QCOMPARE( localPlayerSignalSpy.count(), 1 ); + QCOMPARE( localPlayerSignalSpy2.count(), 1 ); + QCOMPARE( localPlayerSignalSpy3.count(), 1 ); + QCOMPARE( localPlayerSignalSpy4.count(), 1 ); + QCOMPARE( localPlayerSignalSpy5.count(), 1 ); + + QCOMPARE( remotePlayerSignalSpy.count(), 1 ); + QCOMPARE( remotePlayerSignalSpy2.count(), 1 ); + QCOMPARE( remotePlayerSignalSpy3.count(), 1 ); + QCOMPARE( remotePlayerSignalSpy4.count(), 1 ); + QCOMPARE( remotePlayerSignalSpy5.count(), 1 ); + +} + +void UT_LcUiEngine::testSetContentAreas() +{ + QRectF shared; + QRectF received; + + QVERIFY( LC_SESSION( mEngine )->iLocalPlayer ); + QVERIFY( LC_SESSION( mEngine )->iRemotePlayer ); + QVERIFY( LC_SESSION( mEngine )->iLocalPlayer->iRect.iTl.iX != 0); + QVERIFY( LC_SESSION( mEngine )->iRemotePlayer->iRect.iTl.iX != 0); + + mEngine->d->setContentAreas( shared, received ); + QVERIFY( lcutStub_LcPlayer_expectCall( lcutStub_LcPlayer_SetLcWindowRectL ) ); + QVERIFY( LC_SESSION( mEngine )->iLocalPlayer->iRect.iTl.iX == 0); + QVERIFY( LC_SESSION( mEngine )->iRemotePlayer->iRect.iTl.iX == 0); + + lcutStub_LcSession_reset(); + lcutStub_LcPlayer_reset(); + + mEngine->d->setContentAreas( shared, received ); + QVERIFY( lcutStub_LcPlayer_expectCall( lcutStub_LcPlayer_NoCall ) ); + + lcutStub_LcSession_reset(); + lcutStub_LcPlayer_reset(); + + shared.setHeight(100); + received.setHeight(100); + + mEngine->d->setContentAreas( shared, received ); + QVERIFY( lcutStub_LcPlayer_expectCall( lcutStub_LcPlayer_SetLcWindowRectL ) ); + + lcutStub_LcSession_reset(); + lcutStub_LcPlayer_reset(); + + delete LC_SESSION( mEngine )->iLocalPlayer; + LC_SESSION( mEngine )->iLocalPlayer = 0; + delete LC_SESSION( mEngine )->iRemotePlayer; + LC_SESSION( mEngine )->iRemotePlayer = 0; + + mEngine->d->setContentAreas( shared, received ); + QVERIFY( lcutStub_LcPlayer_expectCall( lcutStub_LcPlayer_NoCall ) ); +} + +void UT_LcUiEngine::testSetOrientation() +{ + bool ok( false ); + + //1. setting landscape + QVERIFY( LC_SESSION( mEngine )->iLocalPlayer ); + QVERIFY( LC_SESSION( mEngine )->iRemotePlayer ); + + ok = mEngine->d->setOrientation( Qt::Horizontal ); + QVERIFY( ok ); + QVERIFY( lcutStub_LcPlayer_expectCall( lcutStub_LcPlayer_SetLcWindowOrientationL ) ); + QVERIFY( LC_SESSION( mEngine )->iLocalPlayer->iOrientation == MLcWindow::ELandscape ); + QVERIFY( LC_SESSION( mEngine )->iRemotePlayer->iOrientation == MLcWindow::ELandscape ); + + //2. setting layout failed + // Leave + lcutStub_LcEngine_setFailure( -1 ); + lcutStub_LcPlayer_reset(); + ok = mEngine->d->setOrientation( Qt::Horizontal ); + QVERIFY( !ok ); + QVERIFY( lcutStub_LcPlayer_expectCall( lcutStub_LcPlayer_NoCall ) ); + + //3. setting layout with no players + lcutStub_LcEngine_reset(); + lcutStub_LcPlayer_reset(); + delete LC_SESSION( mEngine )->iLocalPlayer; + LC_SESSION( mEngine )->iLocalPlayer = 0; + delete LC_SESSION( mEngine )->iRemotePlayer; + LC_SESSION( mEngine )->iRemotePlayer = 0; + + ok = mEngine->d->setOrientation( Qt::Horizontal ); + QVERIFY( ok ); + QVERIFY( lcutStub_LcPlayer_expectCall( lcutStub_LcPlayer_NoCall ) ); +} + + +void UT_LcUiEngine::testToggleMute() +{ + QSignalSpy mutedSpy(mEngine, SIGNAL(muted())); + QSignalSpy unmutedSpy(mEngine, SIGNAL(unmuted())); + + + // Leave from isMuted + mEngine->d->toggleMute(); + QVERIFY( mEngine->d->isMuted() ); + lcutStub_LcEngine_setFailure( -2 ); + QVERIFY( !mEngine->d->isMuted() ); + + // No leave + lcutStub_LcEngine_reset(); + lcutStub_LcSession_reset(); + lcutStub_LcPlayer_reset(); + mutedSpy.clear(); + unmutedSpy.clear(); + + mEngine->d->toggleMute(); + QVERIFY( !mEngine->d->isMuted() ); + mutedSpy.clear(); + unmutedSpy.clear(); + + mEngine->d->toggleMute(); + QVERIFY( lcutStub_LcPlayer_expectCall( lcutStub_LcPlayer_MuteLcMicL ) ); + QVERIFY( mEngine->d->isMuted() ); + QCOMPARE(mutedSpy.count(), 1); // make sure the signal was emitted exactly one time + lcutStub_LcSession_reset(); + lcutStub_LcPlayer_reset(); + mutedSpy.clear(); + unmutedSpy.clear(); + + mEngine->d->toggleMute(); + QVERIFY( lcutStub_LcPlayer_expectCall( lcutStub_LcPlayer_MuteLcMicL ) ); + QVERIFY( !mEngine->d->isMuted() ); + QCOMPARE(unmutedSpy.count(), 1); // make sure the signal was emitted exactly one time + + lcutStub_LcSession_reset(); + lcutStub_LcPlayer_reset(); + mutedSpy.clear(); + unmutedSpy.clear(); + + // test async mute + lcutStub_LcPlayer_asyncCompletion( true ); + mEngine->d->toggleMute(); + QVERIFY( lcutStub_LcPlayer_expectCall( lcutStub_LcPlayer_MuteLcMicL ) ); + QVERIFY( mEngine->d->isMuted() ); + QVERIFY( mEngine->d->mBlocked ); + QVERIFY( mEngine->d->mPendingAction == "muted" ); + + // nothing yet signaled as completion is pending + QCOMPARE(mutedSpy.count(), 0); + QCOMPARE(unmutedSpy.count(), 0); + + + lcutStub_LcPlayer_asyncCompletion( false ); +} + +void UT_LcUiEngine::testToggleSpeaker() +{ + QSignalSpy speakerEnabledSpy(mEngine, SIGNAL(speakerEnabled())); + QSignalSpy speakerDisabledSpy(mEngine, SIGNAL(speakerDisabled())); + + QVERIFY( !mEngine->d->isSpeakerOn() ); + + mEngine->d->toggleSpeaker(); + QVERIFY( lcutStub_LcPlayer_expectCall( lcutStub_LcPlayer_EnableLcLoudspeakerL ) ); + QVERIFY( mEngine->d->isSpeakerOn() ); + QCOMPARE(speakerEnabledSpy.count(), 1); + + + lcutStub_LcSession_reset(); + lcutStub_LcPlayer_reset(); + speakerEnabledSpy.clear(); + speakerDisabledSpy.clear(); + + mEngine->d->toggleSpeaker(); + QVERIFY( lcutStub_LcPlayer_expectCall( lcutStub_LcPlayer_EnableLcLoudspeakerL ) ); + QVERIFY( !mEngine->d->isSpeakerOn() ); + QCOMPARE(speakerDisabledSpy.count(), 1); + + lcutStub_LcSession_reset(); + lcutStub_LcPlayer_reset(); + speakerEnabledSpy.clear(); + speakerDisabledSpy.clear(); + + // test asynch speaker functionality. + + lcutStub_LcPlayer_asyncCompletion( true ); + mEngine->d->toggleSpeaker(); + QVERIFY( lcutStub_LcPlayer_expectCall( lcutStub_LcPlayer_EnableLcLoudspeakerL ) ); + QVERIFY( mEngine->d->isSpeakerOn() ); + QVERIFY( mEngine->d->mBlocked ); + QVERIFY( mEngine->d->mPendingAction == "speakerEnabled" ); + + // nothing yet signaled as completion is pending + QCOMPARE(speakerEnabledSpy.count(), 0); + QCOMPARE(speakerDisabledSpy.count(), 0); + + lcutStub_LcPlayer_asyncCompletion( false ); +} + +void UT_LcUiEngine::testToggleDisableCamera() +{ + QSignalSpy enabledSpy(mEngine, SIGNAL(cameraEnabled())); + QSignalSpy disabledSpy(mEngine, SIGNAL(cameraDisabled())); + + QVERIFY( LC_SESSION( mEngine )->iLocalPlayer ); + LC_SESSION( mEngine )->iLocalPlayer->iPlaying = ETrue; + LC_SESSION( mEngine )->iRemotePlayer->iState = MLcVideoPlayer::EPlaying; + QVERIFY( LC_SESSION( mEngine )->iLocalPlayer->iPlaying ); + + mEngine->d->toggleDisableCamera(); + QVERIFY( lcutStub_LcPlayer_expectCall( lcutStub_LcPlayer_LcPauseL ) ); + QVERIFY( !LC_SESSION( mEngine )->iLocalPlayer->iPlaying ); + QVERIFY( LC_SESSION( mEngine )->iLocalPlayer->iState == MLcVideoPlayer::EPaused ); + QCOMPARE(enabledSpy.count(), 0); + QCOMPARE(disabledSpy.count(), 1); + + mEngine->d->toggleDisableCamera(); + QVERIFY( lcutStub_LcPlayer_expectCall( lcutStub_LcPlayer_LcPlayL ) ); + QVERIFY( LC_SESSION( mEngine )->iLocalPlayer->iPlaying ); + QVERIFY( LC_SESSION( mEngine )->iLocalPlayer->iState == MLcVideoPlayer::EPlaying ); + QCOMPARE(enabledSpy.count(), 1); + QCOMPARE(disabledSpy.count(), 1); +} + +void UT_LcUiEngine::testToggleCamera() +{ + // Leave + lcutStub_LcEngine_setFailure( -1 ); + mEngine->d->toggleCamera(); + QVERIFY( lcutStub_LcPlayer_expectCall( lcutStub_LcPlayer_NoCall ) ); + + // No leave + lcutStub_LcEngine_reset(); + mEngine->d->toggleCamera(); + QVERIFY( lcutStub_LcPlayer_expectCall( lcutStub_LcPlayer_ToggleLcCameraL ) ); +} + +void UT_LcUiEngine::testStartReceiving() +{ + // mAcceptQuery not set, mWaitingNote not set + mAcceptQuery->show(); + mWaitingNote->hide(); + mEngine->d->startReceiving(); + QVERIFY( mAcceptQuery->isVisible() ); + QVERIFY( !mWaitingNote->isVisible() ); + QVERIFY( lcutStub_LcSession_expectCall( lcutStub_LcSession_establishSession ) ); + + // mAcceptQuery set, mWaitingNote not set + lcutStub_LcSession_reset(); + mEngine->d->mAcceptQuery = mAcceptQuery; + mEngine->d->startReceiving(); + QVERIFY( !mAcceptQuery->isVisible() ); + QVERIFY( !mWaitingNote->isVisible() ); + QVERIFY( lcutStub_LcSession_expectCall( lcutStub_LcSession_establishSession ) ); + + // mWaitingNote set, but the engine does not support the feature + lcutStub_LcSession_reset(); + mEngine->d->mWaitingNote = mWaitingNote; + mEngine->d->startReceiving(); + QVERIFY( !mAcceptQuery->isVisible() ); + QVERIFY( !mWaitingNote->isVisible() ); + QVERIFY( lcutStub_LcSession_expectCall( lcutStub_LcSession_establishSession ) ); + + // mWaitingNote set and the engine supports the feature + lcutStub_LcSession_reset(); + lcutStub_LcEngine_setLcFeatureSupported( true ); + mEngine->d->startReceiving(); + QVERIFY( !mAcceptQuery->isVisible() ); + QVERIFY( mWaitingNote->isVisible() ); + QVERIFY( lcutStub_LcSession_expectCall( lcutStub_LcSession_establishSession ) ); +} + +void UT_LcUiEngine::testStartPlayback() +{ + mEngine->d->startPlayback(); + QVERIFY( lcutStub_LcSession_expectCall( lcutStub_LcSession_NoCall ) ); + QVERIFY( lcutStub_LcPlayer_expectCall( lcutStub_LcPlayer_EnableLcWindowL,0 ) ); + QVERIFY( lcutStub_LcPlayer_expectCall( lcutStub_LcPlayer_EnableLcWindowL,1 ) ); + + lcutStub_LcSession_reset(); + lcutStub_LcPlayer_reset(); + + delete LC_SESSION( mEngine )->iLocalPlayer; + LC_SESSION( mEngine )->iLocalPlayer = 0; + mEngine->d->startPlayback(); + QVERIFY( lcutStub_LcSession_expectCall( lcutStub_LcSession_NoCall ) ); + QVERIFY( lcutStub_LcPlayer_expectCall( lcutStub_LcPlayer_EnableLcWindowL,0 ) ); + QVERIFY( lcutStub_LcPlayer_expectCall( lcutStub_LcPlayer_NoCall,1 ) ); + + lcutStub_LcSession_reset(); + lcutStub_LcPlayer_reset(); + + delete LC_SESSION( mEngine )->iRemotePlayer; + LC_SESSION( mEngine )->iRemotePlayer = 0; + + mEngine->d->startPlayback(); + QVERIFY( lcutStub_LcSession_expectCall( lcutStub_LcSession_NoCall ) ); + QVERIFY( lcutStub_LcPlayer_expectCall( lcutStub_LcPlayer_NoCall,0 ) ); + QVERIFY( lcutStub_LcPlayer_expectCall( lcutStub_LcPlayer_NoCall,1 ) ); +} + +void UT_LcUiEngine::testStop() +{ + // Ensure that in MLcSession::EClosing state, "stopped" signal won't be emited + // Check also that session duration timer is stopped + LC_SESSION( mEngine )->iState = MLcSession::EClosing; + mEngine->d->startSessionDurationTimer(); + QVERIFY( mEngine->d->mSessionDurationTimerId != 0 ); + QSignalSpy spy(mEngine, SIGNAL(stopped())); + mEngine->d->mActivityManager->enableActivitySimulation(true); + mEngine->d->stop(); + QVERIFY( !mEngine->d->mActivityManager->isActivitySimulationEnabled() ); + QVERIFY( lcutStub_LcSession_expectCall( lcutStub_LcSession_terminateSession ) ); + QVERIFY( lcutStub_LcPlayer_expectCall( lcutStub_LcPlayer_NoCall ) ); + QCOMPARE( spy.count(), 0 ); + QVERIFY( mEngine->d->mSessionDurationTimerId == 0 ); + + // Ensure that any other state than MLcSession::EClosing, will cause emition + // of "stopped" signal + lcutStub_LcSession_reset(); + lcutStub_LcPlayer_reset(); + LC_SESSION( mEngine )->iState = MLcSession::EInitialized; + mEngine->d->stop(); + QVERIFY( lcutStub_LcSession_expectCall( lcutStub_LcSession_terminateSession ) ); + QVERIFY( lcutStub_LcPlayer_expectCall( lcutStub_LcPlayer_NoCall ) ); + QCOMPARE( spy.count(), 1 ); +} + +void UT_LcUiEngine::testSetViewLayout() +{ + QVERIFY( LC_SESSION( mEngine )->iLocalPlayer ); + QVERIFY( LC_SESSION( mEngine )->iRemotePlayer ); + QVERIFY( !LC_SESSION( mEngine )->iLocalPlayer->iPlaying ); + QVERIFY( !LC_SESSION( mEngine )->iRemotePlayer->iPlaying ); + LC_SESSION( mEngine )->iRemotePlayer->iState = MLcVideoPlayer::EPaused; + QVERIFY( !mEngine->d->usingVideoTelephoneEngine() ); + + mEngine->d->setViewLayout(); + QVERIFY( mEngine->d->viewLayout() == Lc_IdleViewLayout ); + + LC_SESSION( mEngine )->iLocalPlayer->iPlaying = ETrue; + + mEngine->d->setViewLayout(); + QVERIFY( mEngine->d->viewLayout() == Lc_SharedViewLayout ); + + LC_SESSION( mEngine )->iLocalPlayer->iPlaying = EFalse; + LC_SESSION( mEngine )->iRemotePlayer->iState = MLcVideoPlayer::EPlaying; + + mEngine->d->setViewLayout(); + QVERIFY( mEngine->d->viewLayout() == Lc_ReceivedViewLayout ); + + LC_SESSION( mEngine )->iLocalPlayer->iPlaying = ETrue; + LC_SESSION( mEngine )->iRemotePlayer->iState = MLcVideoPlayer::EPlaying; + + mEngine->d->setViewLayout(); + QVERIFY( mEngine->d->viewLayout() == Lc_TwowayViewLayout ); + + delete LC_SESSION( mEngine )->iLocalPlayer; + LC_SESSION( mEngine )->iLocalPlayer = 0; + + mEngine->d->setViewLayout(); + QVERIFY( mEngine->d->viewLayout() == Lc_ReceivedOnlyViewLayout ); + + delete LC_SESSION( mEngine )->iRemotePlayer; + LC_SESSION( mEngine )->iRemotePlayer = 0; + + mEngine->d->setViewLayout(); + QVERIFY( mEngine->d->viewLayout() == Lc_IdleViewLayout ); + + mEngine->d->mEngineName = lcutVideotelephonyApp; + QVERIFY( mEngine->d->usingVideoTelephoneEngine() ); + + mEngine->d->setViewLayout(); + QVERIFY( mEngine->d->viewLayout() == Lc_AllInOneViewLayout ); +} + +void UT_LcUiEngine::testHideNotes() +{ + // Notes not set + mEngine->d->hideNotes( true ); + QVERIFY( lcutStub_LcSession_expectCall( lcutStub_LcSession_NoCall ) ); + QVERIFY( lcutStub_LcPlayer_expectCall( lcutStub_LcPlayer_NoCall ) ); + QVERIFY( mInvitingNote->isVisible() ); + QVERIFY( mWaitingNote->isVisible() ); + QVERIFY( mAcceptQuery->isVisible() ); + QVERIFY( mRecipientQuery->isVisible() ); + + // Notes set, hide all + mEngine->d->setUiComponents( mInvitingNote, mWaitingNote, + mAcceptQuery, mRecipientQuery,mShareOwnVideoQuery ); + mEngine->d->hideNotes( true ); + QVERIFY( lcutStub_LcSession_expectCall( lcutStub_LcSession_NoCall ) ); + QVERIFY( lcutStub_LcPlayer_expectCall( lcutStub_LcPlayer_NoCall ) ); + QVERIFY( !mInvitingNote->isVisible() ); + QVERIFY( !mWaitingNote->isVisible() ); + QVERIFY( !mAcceptQuery->isVisible() ); + QVERIFY( !mRecipientQuery->isVisible() ); + + // Notes not set, do not hide waiting note + mInvitingNote->show(); + mWaitingNote->show(); + mAcceptQuery->show(); + mRecipientQuery->show(); + mEngine->d->hideNotes( false ); + QVERIFY( lcutStub_LcSession_expectCall( lcutStub_LcSession_NoCall ) ); + QVERIFY( lcutStub_LcPlayer_expectCall( lcutStub_LcPlayer_NoCall ) ); + QVERIFY( !mInvitingNote->isVisible() ); + QVERIFY( mWaitingNote->isVisible() ); + QVERIFY( !mAcceptQuery->isVisible() ); + QVERIFY( !mRecipientQuery->isVisible() ); +} + +void UT_LcUiEngine::testZoom() +{ + LcControlValues zoomData; + + // Leave + lcutStub_LcEngine_setFailure( -1 ); + mEngine->d->zoom( 1 ); + QVERIFY( lcutStub_LcPlayer_expectCall( lcutStub_LcPlayer_NoCall ) ); + QCOMPARE( mEngine->d->zoomValues( zoomData ), -1 ); + QVERIFY( lcutStub_LcPlayer_expectCall( lcutStub_LcPlayer_NoCall ) ); + + // No leave + lcutStub_LcEngine_reset(); + lcutStub_LcPlayer_reset(); + QCOMPARE( mEngine->d->zoomValues( zoomData ), 0 ); + mEngine->d->zoom( 2 ); + mEngine->d->zoom( 1 ); + mEngine->d->zoom( 3 ); + + QVERIFY( lcutStub_LcPlayer_expectCall( lcutStub_LcPlayer_SetLcZoomValueL, 0 ) ); + QVERIFY( lcutStub_LcPlayer_expectCall( lcutStub_LcPlayer_SetLcZoomValueL, 1 ) ); + QVERIFY( lcutStub_LcPlayer_expectCall( lcutStub_LcPlayer_SetLcZoomValueL, 2 ) ); + QVERIFY( lcutStub_LcPlayer_expectCall( lcutStub_LcSession_NoCall, 3 ) ); +} + +void UT_LcUiEngine::testBlockUi() +{ + QSignalSpy blockedSpy(mEngine, SIGNAL(blocked())); + QSignalSpy unblockedSpy(mEngine, SIGNAL(unblocked())); + QSignalSpy mutedSpy(mEngine, SIGNAL(muted())); + + mEngine->d->BlockUi( ETrue ); + + QCOMPARE(blockedSpy.count(), 1); + QCOMPARE(unblockedSpy.count(), 0); + QCOMPARE(mutedSpy.count(), 0); + + // no pending action once unblocked + blockedSpy.clear(); + + mEngine->d->BlockUi( EFalse ); + QCOMPARE(blockedSpy.count(), 0); + QCOMPARE(unblockedSpy.count(), 1); + QCOMPARE(mutedSpy.count(), 0); + + + // pending action once unblocked + unblockedSpy.clear(); + mEngine->d->setPendingAction( "muted" ); + mEngine->d->BlockUi( EFalse ); + QCOMPARE(blockedSpy.count(), 0); + QCOMPARE(unblockedSpy.count(), 1); + QCOMPARE(mutedSpy.count(), 1); + QVERIFY( mEngine->d->mPendingAction.isEmpty() ); +} + +void UT_LcUiEngine::testCloseTimer() +{ + // Try to cancel without timer + mEngine->d->cancelCloseTimer(); + QVERIFY( !mEngine->d->mCloseTimer ); + + // Try to cancel without timer being active + mEngine->d->startCloseTimer(); + QVERIFY( mEngine->d->mCloseTimer ); + QVERIFY( mEngine->d->mCloseTimer->isActive() ); + mEngine->d->mCloseTimer->stop(); + QVERIFY( !mEngine->d->mCloseTimer->isActive() ); + mEngine->d->cancelCloseTimer(); + QVERIFY( mEngine->d->mCloseTimer ); + QVERIFY( !mEngine->d->mCloseTimer->isActive() ); + + // Cancel an active timer + mEngine->d->startCloseTimer(); + QVERIFY( mEngine->d->mCloseTimer ); + QVERIFY( mEngine->d->mCloseTimer->isActive() ); + mEngine->d->cancelCloseTimer(); + QVERIFY( mEngine->d->mCloseTimer ); + QVERIFY( !mEngine->d->mCloseTimer->isActive() ); +} + + +void UT_LcUiEngine::testfullScreenMode() +{ + QVERIFY( !mEngine->d->fullScreenMode() ); +} + + +void UT_LcUiEngine::testsetFullScreenMode() +{ + mEngine->d->setFullScreenMode(true); + QVERIFY( mEngine->d->fullScreenMode() ); +} + +void UT_LcUiEngine::testTimerEvent() +{ + mEngine->d->startSessionDurationTimer(); + QSignalSpy spy(mEngine, SIGNAL(sessionDurationChanged(const QString &))); + + QTimerEvent wrongTimerEvent(9999); + mEngine->d->timerEvent(&wrongTimerEvent); + QVERIFY( spy.count() == 0 ); + + QTimerEvent correctTimerEvent(mEngine->d->mSessionDurationTimerId); + mEngine->d->timerEvent(&correctTimerEvent); + QVERIFY( spy.count() == 1 ); + QVERIFY( spy.at(0).count() == 1 ); // one arg which is duration as string + QTime currDuration = QTime::fromString(spy.at(0).at(0).toString()); + QVERIFY( currDuration.isValid() ); +} + +void UT_LcUiEngine::testFillRemoteInfo() +{ + QSignalSpy recipientSpy(mEngine, SIGNAL(recipientChanged(const QString &))); + QSignalSpy numberSpy(mEngine, SIGNAL(phoneNumberChanged(const QString &))); + + // test filling without signal emitting + + // number and name changed + mEngine->d->mRecipient = ""; + mEngine->d->mPhoneNumber = ""; + mEngine->d->fillRemoteInfo( false ); + QVERIFY( mEngine->d->mRecipient.length() > 0 ); + QVERIFY( mEngine->d->mPhoneNumber.length() > 0 ); + QVERIFY( recipientSpy.count() == 0 ); + QVERIFY( numberSpy.count() == 0 ); + + // nothing changed + QString prevRecipient = mEngine->d->mRecipient; + QString prevNumber = mEngine->d->mPhoneNumber; + mEngine->d->fillRemoteInfo( false ); + QVERIFY( mEngine->d->mRecipient == prevRecipient ); + QVERIFY( mEngine->d->mPhoneNumber == prevNumber ); + QVERIFY( recipientSpy.count() == 0 ); + QVERIFY( numberSpy.count() == 0 ); + + // test filling with signal emitting + + // number and name changed + mEngine->d->mRecipient = ""; + mEngine->d->mPhoneNumber = ""; + mEngine->d->fillRemoteInfo( true ); + QVERIFY( mEngine->d->mRecipient == prevRecipient ); + QVERIFY( mEngine->d->mPhoneNumber == prevNumber ); + QVERIFY( recipientSpy.count() == 1 ); + QVERIFY( numberSpy.count() == 1 ); + + // state is opened and name not found and no number, unknown name is used + LC_SESSION( mEngine )->iState = MLcSession::EOpen; + delete LC_SESSION( mEngine )->iRemoteDisplayName; + LC_SESSION( mEngine )->iRemoteDisplayName = NULL; + LC_SESSION( mEngine )->iRemoteDisplayName = KNullDesC().AllocL(); + delete LC_SESSION( mEngine )->iRemoteDetails; + LC_SESSION( mEngine )->iRemoteDetails = NULL; + LC_SESSION( mEngine )->iRemoteDetails = KNullDesC().AllocL(); + mEngine->d->mPhoneNumber = ""; + mEngine->d->fillRemoteInfo( true ); + QVERIFY( mEngine->d->mRecipient == hbTrId("txt_vt_custom_unknown_number") ); + QVERIFY( mEngine->d->mPhoneNumber.isEmpty() ); + QVERIFY( recipientSpy.count() == 2 ); + QVERIFY( numberSpy.count() == 1 ); + + // name not found but number exists, number is used at opened state as recipient + mEngine->d->mRecipient = ""; + mEngine->d->mPhoneNumber = ""; + delete LC_SESSION( mEngine )->iRemoteDetails; + LC_SESSION( mEngine )->iRemoteDetails = NULL; + LC_SESSION( mEngine )->iRemoteDetails = _L("123445").AllocL(); + mEngine->d->fillRemoteInfo( true ); + QVERIFY( mEngine->d->mRecipient == "123445" ); + QVERIFY( mEngine->d->mPhoneNumber == "123445" ); + QVERIFY( recipientSpy.count() == 3 ); + QVERIFY( numberSpy.count() == 2 ); + +} + +void UT_LcUiEngine::testUpdateSession() +{ + mEngine->d->updateSession(); + QVERIFY( lcutStub_LcSession_expectCall( lcutStub_LcSession_updateSession ) ); +} + +void UT_LcUiEngine::testIsLocalPlayerPlaying() +{ + // Not playing + QVERIFY( !mEngine->d->isLocalPlayerPlaying() ); + + // Playing + LC_SESSION( mEngine )->iLocalPlayer->LcPlayL(); + QVERIFY( mEngine->d->isLocalPlayerPlaying() ); +} + +void UT_LcUiEngine::testIsRemotePlayerPlaying() +{ + // Not playing + QVERIFY( !mEngine->d->isRemotePlayerPlaying() ); + + // Playing + LC_SESSION( mEngine )->iRemotePlayer->LcPlayL(); + QVERIFY( mEngine->d->isRemotePlayerPlaying() ); +} + +void UT_LcUiEngine::testMinimized() +{ + mEngine->minimize(); + QVERIFY( mEngine->isMinimized() ); + mEngine->minimize(); // Doing nothing + QVERIFY( mEngine->isMinimized() ); +} + +void UT_LcUiEngine::testMaximized() +{ + mEngine->maximize(); + QVERIFY(mEngine->isMaximized() ); + mEngine->maximize(); // Doing nothing + QVERIFY(mEngine->isMaximized() ); +} + +void UT_LcUiEngine::testIsMinimized() +{ + mEngine->minimize(); + QVERIFY( mEngine->isMinimized() ); +} + +void UT_LcUiEngine::testHandleForegroundStatus() +{ + QtHighwayStubHelper::reset(); + + // First time to foreground, engine is not set to foreground until viewReady signal + HbView currView; + mEngine->d->setCurrentView(&currView); + QVERIFY( mEngine->d->mFirstForegroundSwitch ); + QVERIFY( !mEngine->d->mActivityManager->isActivitySimulationEnabled() ); + + mEngine->d->HandleForegroundStatus(ETrue); + QVERIFY( mEngine->d->mActivityManager->isActivitySimulationEnabled() ); + QVERIFY( !mEngine->d->session().IsBackgroundStartup() ); // Stub returns fg status in this + QVERIFY( !QtHighwayStubHelper::isAtBg() ); + QVERIFY( !mEngine->d->mFirstForegroundSwitch ); + + //Simulate viewReady signal happens, funciton will be called again. + mEngine->d->HandleForegroundStatus(ETrue); + QVERIFY( mEngine->d->session().IsBackgroundStartup() ); // Stub returns fg status in this + QVERIFY( !mEngine->d->mFirstForegroundSwitch ); + + // Bg switch + QtHighwayStubHelper::reset(); + QVERIFY( mEngine->d->mActivityManager->isActivitySimulationEnabled() ); + mEngine->d->HandleForegroundStatus(EFalse); + QVERIFY( !mEngine->d->mActivityManager->isActivitySimulationEnabled() ); + QVERIFY( QtHighwayStubHelper::isAtBg() ); + QVERIFY( !mEngine->d->session().IsBackgroundStartup() ); // Stub returns fg status in this + +} + + +void UT_LcUiEngine::testSendDialTone() +{ + //Dumy test: Ensure Conversion does not cause any problem. + QVERIFY( mEngine->d->SendDialTone('3') ); +} + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/ut_lcuieng.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/ut_lcuieng.pro Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,65 @@ +###################################################################### +# Automatically generated by qmake (2.01a) Fri May 22 10:46:25 2009 +###################################################################### + +TEMPLATE = app +TARGET = + +QT += testlib xml +CONFIG += qtestlib + +MUS_DIR = ../../../../.. +LCUI_DIR = ../../../lcui +LCUIENGINE_DIR = ../.. + +DEPENDPATH += . + +INCLUDEPATH += . +INCLUDEPATH += hbstubs +INCLUDEPATH += /epoc32/include +INCLUDEPATH += /epoc32/include/platform/app +INCLUDEPATH += /epoc32/include/ecom +INCLUDEPATH += inc +INCLUDEPATH += $$LCUIENGINE_DIR +INCLUDEPATH += $$LCUIENGINE_DIR/inc +INCLUDEPATH += $$LCUI_DIR/mmshlcuiengine/tsrc/lcstub/inc +INCLUDEPATH += $$LCUI_DIR/inc +INCLUDEPATH += $$LCUI_DIR/../inc +INCLUDEPATH += lcstub/inc +INCLUDEPATH += $$MUS_DIR/tsrc/qtestutils/inc +INCLUDEPATH += $$MUS_DIR/inc + +CONFIG += hb + +DEFINES += QT_NO_DEBUG_OUTPUT + +# Input +HEADERS += inc/ut_lcuiengine.h +HEADERS += $$LCUIENGINE_DIR/inc/lcuiengine.h + +SOURCES += src/main.cpp +SOURCES += src/ut_lcuiengine.cpp +SOURCES += $$LCUIENGINE_DIR/src/lcuiengine.cpp +SOURCES += hbstubs/hbstubs.cpp +SOURCES += hbstubs/qthighway_stub.cpp +SOURCES += lcstub/src/lcsessionstub.cpp +SOURCES += lcstub/src/lcvideoplayerstub.cpp +SOURCES += lcstub/src/lcenginestub.cpp +SOURCES += $$MUS_DIR/tsrc/qtestutils/src/testresultxmlparser.cpp + +symbian: { + INCLUDEPATH += $$LCUIENGINE_DIR/inc + HEADERS += inc/ut_lcactivitymanager.h + HEADERS += $$LCUIENGINE_DIR/inc/lcuiengine_p.h + HEADERS += $$LCUIENGINE_DIR/inc/lcactivitymanager.h + SOURCES += src/ut_lcactivitymanager.cpp + SOURCES += $$LCUIENGINE_DIR/src/lcuiengine_p.cpp + SOURCES += $$LCUIENGINE_DIR/src/lcactivitymanager.cpp + SOURCES += lcstub/src/centralrepository_stub.cpp + + TARGET.UID2 = 0x100039CE + TARGET.UID3 = 0xEfa329b2 + TARGET.CAPABILITY = ALL -TCB + LIBS += -lecom -lflogger -lws32 -lbafl -lxqservice -lxqserviceutil -lcone + TARGET.EPOCALLOWDLLDATA = 1 +} diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcuiengine/tsrc/win32/launch.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcuiengine/tsrc/win32/launch.bat Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,17 @@ +@rem +@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +@rem All rights reserved. +@rem This component and the accompanying materials are made available +@rem under the terms of "Eclipse Public License v1.0" +@rem which accompanies this distribution, and is available +@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +@rem +@rem Initial Contributors: +@rem Nokia Corporation - initial contribution. +@rem +@rem Contributors: +@rem +@rem Description: +@rem + +musui.exe -1 -2 -3 \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcuiengine/tsrc/win32/lcconfig.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcuiengine/tsrc/win32/lcconfig.xml Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,3 @@ + + +in seconds diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcuiengine/tsrc/win32/lcconfiguration.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcuiengine/tsrc/win32/lcconfiguration.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,92 @@ +/* +* 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 "LcConfiguration.h" +#include + +// File name +const char fileName[] = "c:\\data\\lcconfig.xml"; + +// XML configuration elements +const char setupElement[] = "setup"; +const char timerElement[] = "timer"; + +// XML configuration attriputes +const char layoutAttr[] = "layout"; +const char sessionNameAttr[] = "sessionname"; +const char phoneNoAttr[] = "phoneno"; +const char remoteAttr[] = "remote"; +const char durationAttr[] = "duration"; + + +// ----------------------------------------------------------------------------- +// LcConfiguration::LcConfiguration +// ----------------------------------------------------------------------------- +// +LcConfiguration::LcConfiguration() + :mLayout(5), + mSessionTitle(QString::fromAscii("Homer Simpson")), + mRecipient(QString::fromAscii("sip:march@simpsons.com")), + mPhoneNumber(QString::fromAscii("+35850898282")), + mTimerDuration(4*1000) +{ +} + +// ----------------------------------------------------------------------------- +// LcConfiguration::LcConfiguration +// ----------------------------------------------------------------------------- +// +LcConfiguration::~LcConfiguration() +{ +} + +// ----------------------------------------------------------------------------- +// TestResultXmlParser::parse +// ----------------------------------------------------------------------------- +// +int LcConfiguration::parse() +{ + QFile file(fileName); + QXmlInputSource inputSource(&file); + QXmlSimpleReader reader; + reader.setContentHandler(this); + return reader.parse(inputSource); +} + +// ----------------------------------------------------------------------------- +// LcConfiguration::startElement +// ----------------------------------------------------------------------------- +// +bool LcConfiguration::startElement( + const QString& /*namespaceURI*/, + const QString& /*localName*/, + const QString& qName, + const QXmlAttributes& atts) +{ + if( qName == setupElement) { + mLayout = atts.value(layoutAttr).toInt(); + mSessionTitle = atts.value(sessionNameAttr); + mRecipient = atts.value(phoneNoAttr); + mPhoneNumber = atts.value(durationAttr); + } + else if (qName == timerElement) { + mTimerDuration = atts.value(durationAttr).toInt()*1000;// ms to s + } + return true; +} + +// End of File. diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcuiengine/tsrc/win32/lcconfiguration.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcuiengine/tsrc/win32/lcconfiguration.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,54 @@ +/* +* 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 LCCONFIGURATION_H +#define LCCONFIGURATION_H + +#include + + +class LcConfiguration : public QXmlDefaultHandler +{ +public: // Constructors and destructor + LcConfiguration(); + ~LcConfiguration(); + +public: + int parse(); + +protected: // From QXmlContentHandler + bool startElement( + const QString& namespaceURI, + const QString& localName, + const QString& qName, + const QXmlAttributes& atts); + +public: // Data + int mLayout; + QString mSessionTitle; + QString mRecipient; + QString mPhoneNumber; + int mTimerDuration; +}; + + +#endif // LCCONFIGURATION_H + + + + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcuiengine/tsrc/win32/lcuiengine_p.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcuiengine/tsrc/win32/lcuiengine_p.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,480 @@ +/* +* 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: +* +*/ + +//USER +#include "lcuiengine_p.h" +#include "lcuidefs.h" +#include "lclogger.h" +#include "lcuienginesimulator.h" + +//SYSTEM +#include +#include +#include +#include + + +#define LC_VTPLUGIN_NAME "Videotelephony"; + +const char localMovieName[] = "c:\\data\\local.3gp"; +const char local2MovieName[] = "c:\\data\\local2.mpeg"; +const char remoteMovieName[] = "c:\\data\\remote.3gp"; +const char mPlayer[] = "c:\\data\\mplayer.exe"; +const char msPaint[] = "mspaint"; + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::LcUiEnginePrivate +// ----------------------------------------------------------------------------- +// +LcUiEnginePrivate::LcUiEnginePrivate( LcUiEngine& uiEngine, + const QString& engineName, + const QString& applicationDisplayName) + :mUiEngine( uiEngine ) +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEnginePrivate::LcUiEnginePrivate()" ) + mSimulator = new LcUiEngineSimulator( *this ); + mViewLayout = (LcViewLayoutHint)mSimulator->layout(); + mSessionTitle = mSimulator->sessionTitle(); + mRecipient = mSimulator->remoteAddress(); + mPhoneNumber = mSimulator->phoneNo(); + mLocalPlayerProcess = new QProcess(); + mRemotePlayerProcess = new QProcess(); + mProgram = QString::fromAscii(mPlayer); + mProgramImage = QString::fromAscii(msPaint); + mLocalMovieName = QString::fromAscii(localMovieName); + LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::LcUiEnginePrivate()" ) +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::~LcUiEnginePrivate +// ----------------------------------------------------------------------------- +// +LcUiEnginePrivate::~LcUiEnginePrivate() +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEnginePrivate::~LcUiEnginePrivate()" ) + delete mSimulator; + delete mLocalPlayerProcess; + delete mRemotePlayerProcess; + LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::~LcUiEnginePrivate()" ) +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::zoom +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::zoom( int value ) +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEnginePrivate::zoom()" ) + + LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::zoom()" ) +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::stop +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::stop() +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEnginePrivate::stop()" ) + mSimulator->stop(); + LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::stop()" ) +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::start +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::start() +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEnginePrivate::start()" ) + mSimulator->start(); + LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::start()" ) +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::sessionTitle +// ----------------------------------------------------------------------------- +// +const QString& LcUiEnginePrivate::sessionTitle() const +{ + return mSessionTitle; +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::recipient +// ----------------------------------------------------------------------------- +// +const QString& LcUiEnginePrivate::recipient() const +{ + return mRecipient; +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::phoneNumber +// ----------------------------------------------------------------------------- +// +const QString& LcUiEnginePrivate::phoneNumber() const +{ + return mPhoneNumber; +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::viewLayout +// ----------------------------------------------------------------------------- +// +LcViewLayoutHint LcUiEnginePrivate::viewLayout() const +{ + return mViewLayout; +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::setContentAreas +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::setContentAreas( const QRectF& sharedContent, + const QRectF& receivedContent ) +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEnginePrivate::setContentAreas()" ) + LC_QDEBUG_2( "livecomms [UI] shared window: ", sharedContent ) + LC_QDEBUG_2( "livecomms [UI] received window: ", receivedContent ) + LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::setContentAreas()" ) +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::setOrientation +// ----------------------------------------------------------------------------- +// +bool LcUiEnginePrivate::setOrientation( Qt::Orientation orientation ) +{ + bool ok( false ); + return ok; +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::setUiComponents +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::setUiComponents( + HbDialog* invitingNote, + HbDialog* waitingNote, + HbDialog* acceptQuery, + HbDialog* recipientQuery ) +{ + mInvitingNote = invitingNote; + mWaitingNote = waitingNote; + mAcceptQuery = acceptQuery; + mRecipientQuery = recipientQuery; + + +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::toggleMute +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::toggleMute() +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEnginePrivate::toggleMute()" ) + if( mMuteState ){ + unmuted(); + }else{ + muted(); + } + LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::toggleMute()" ) +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::isMuted +// ----------------------------------------------------------------------------- +// +bool LcUiEnginePrivate::isMuted() const +{ + return mMuteState; +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::toggleSpeaker +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::toggleSpeaker() +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEnginePrivate::toggleSpeaker()" ) + if ( mSpeakerState ){ + speakerDisabled(); + }else{ + speakerEnabled(); + } + LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::toggleSpeaker()" ) +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::isSpeakerOn +// ----------------------------------------------------------------------------- +// +bool LcUiEnginePrivate::isSpeakerOn() const +{ + return mSpeakerState; +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::zoomValues +// ----------------------------------------------------------------------------- +// +int LcUiEnginePrivate::zoomValues( LcControlValues& values ) const +{ + int err( 1 ); + return err; +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::toggleEnableCamera +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::toggleDisableCamera() +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEnginePrivate::toggleDisableCamera()" ) + if( mPlayerStateLocal == EPlaying ){ + localPlayerPaused(); + cameraDisabled(); + }else if( mPlayerStateLocal == EPaused){ + localPlayerPlaying(); + cameraEnabled(); + } + LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::toggleDisableCamera()" ) +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::setCameraMain +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::setMainCamera(const bool aMainCamera) +{ + LC_QDEBUG_2( "livecomms [UI] -> LcUiEnginePrivate::setCameraMain()", aMainCamera ) + if(aMainCamera){ + cameraChangedToMain(); + }else{ + cameraChangedToSecondary(); + } + LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::setCameraMain()" ) +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::cameraIndex +// ----------------------------------------------------------------------------- +// +bool LcUiEnginePrivate::mainCamera() const +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEnginePrivate::mainCamera()" ) + LC_QDEBUG_2( "livecomms [UI] <- LcUiEnginePrivate::mainCamera()", mMainCamera ) + return mMainCamera; +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::toggleCamera +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::toggleCamera() +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEnginePrivate::toggleCamera()" ) + if( mMainCamera ){ + cameraChangedToSecondary(); + }else{ + cameraChangedToMain(); + } + if( mPlayerStateLocal==EPlaying ){ + localPlayerPaused(); + mSimulator->setSimulation(2); + mSimulator->start(); + } + LC_QDEBUG_2( "livecomms [UI] <- LcUiEnginePrivate::toggleCamera(), mainCamera:", mMainCamera ) +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::fullScreenMode +// ----------------------------------------------------------------------------- +// +bool LcUiEnginePrivate::fullScreenMode() +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEnginePrivate::fullScreenMode()" ) + LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::fullScreenMode()" ) + return mFullScreen; +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::setFullScreenMode +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::setFullScreenMode(bool aMode) +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEnginePrivate::setFullScreenMode()" ) + mFullScreen = aMode; + LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::setFullScreenMode()" ) +} + + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::updateSession +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::updateSession() +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEnginePrivate::updateSession()" ) + + LC_QDEBUG( "livecomms [UI] <- LcUiEnginePrivate::updateSession()" ) +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::isLocalPlayerPlaying +// ----------------------------------------------------------------------------- +// +bool LcUiEnginePrivate::isLocalPlayerPlaying() const +{ + return ( mPlayerStateLocal == EPlaying )? true : false; +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::isRemotePlayerPlaying +// ----------------------------------------------------------------------------- +// +bool LcUiEnginePrivate::isRemotePlayerPlaying() const +{ + return ( mSimulatorRemote == EPlaying )? true : false; +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::localPlayerPlaying +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::localPlayerPlaying() +{ + QStringList args; + args << mLocalMovieName; + mLocalPlayerProcess->start(mProgram,args); + mPlayerStateLocal=EPlaying; + emit mUiEngine.localPlayerPlaying(); +} + + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::remotePlayerPlaying +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::remotePlayerPlaying() +{ + QStringList args; + args << QString::fromAscii(remoteMovieName); + mRemotePlayerProcess->start(mProgram,args); + mSimulatorRemote=EPlaying; + emit mUiEngine.remotePlayerPlaying(); +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::localPlayerPaused +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::localPlayerPaused() +{ + mLocalPlayerProcess->close(); + mPlayerStateLocal=EPaused; + emit mUiEngine.localPlayerPaused(); +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::remotePlayerPaused +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::remotePlayerPaused() +{ + mRemotePlayerProcess->close(); + mSimulatorRemote=EPaused; + emit mUiEngine.remotePlayerPaused(); +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::cameraChangedToSecondary +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::cameraChangedToSecondary() +{ + mLocalMovieName= QString::fromAscii(local2MovieName); + mMainCamera=false; + emit mUiEngine.cameraChangedToSecondary(); +} + + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::cameraChangedToSecondary +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::cameraChangedToMain() +{ + mLocalMovieName= QString::fromAscii(localMovieName); + mMainCamera=true; + emit mUiEngine.cameraChangedToMain(); +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::isMinimized +// ----------------------------------------------------------------------------- +// +bool LcUiEnginePrivate::isMinimized() const +{ + return (QApplication::activeWindow()->windowState()==Qt::WindowMinimized); +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::minimize +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::minimize() +{ + QApplication::activeWindow()->setWindowState(Qt::WindowMinimized); +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::maximize +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::maximize() +{ + QApplication::activeWindow()->setWindowState(Qt::WindowMaximized); +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::shareImage +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::shareImage(const QString& fileName) +{ + localPlayerPaused(); + QStringList args; + args << fileName; + mLocalPlayerProcess->start(mProgramImage,args); + mPlayerStateLocal=EPlaying; + emit mUiEngine.localPlayerPlaying(); +} + +// ----------------------------------------------------------------------------- +// LcUiEnginePrivate::shareCamera +// ----------------------------------------------------------------------------- +// +void LcUiEnginePrivate::shareCamera() +{ + localPlayerPaused(); + localPlayerPlaying(); +} +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcuiengine/tsrc/win32/lcuiengine_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcuiengine/tsrc/win32/lcuiengine_p.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,180 @@ +/* +* 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 LCUIENGINEPRIVATE_H +#define LCUIENGINEPRIVATE_H + +//SYSTEM +#include +#include +#include +#include +#include + +class QTimer; +class QRectF; +class HbDialog; +class LcUiEngine; +class LcUiEngineSimulator; + +enum simulationState { + ENone, + EPreparing, + EBuffering, + EPlaying, + EPaused, + EStopped, + EUnavailable +}; + +/* + * Live Comms UI Engine + */ +class LcUiEnginePrivate + +{ + +public: + + LcUiEnginePrivate ( LcUiEngine& uiEngine, + const QString &engineName, + const QString &applicationDisplayName ); + ~LcUiEnginePrivate (); + +public : + + void zoom( int value ); + void stop(); + +private: + + //signaled when engine is stopped + void stopped(){ emit mUiEngine.stopped();}; + //signaled when layout is changed + void layoutChanged(){ emit mUiEngine.layoutChanged();}; + //signaled when camera changes to main + void cameraChangedToMain(); + //signaled when camera changes to secondary + void cameraChangedToSecondary(); + //signaled when mic is muted + void muted(){ mMuteState = true; emit mUiEngine.muted();}; + //signaled when mic is unmuted + void unmuted(){ mMuteState = false; emit mUiEngine.unmuted();}; + //signaled when speaker is enabled + void speakerEnabled(){ mSpeakerState = true; emit mUiEngine.speakerEnabled();}; + //signaled when speaker is disabled + void speakerDisabled(){ mSpeakerState = false; emit mUiEngine.speakerDisabled();}; + //signaled when camera is disabled + void cameraDisabled(){ mPlayerStateLocal = EPaused; emit mUiEngine.cameraDisabled();}; + //signaled when camera is enabled + void cameraEnabled(){ mPlayerStateLocal = EPlaying; emit mUiEngine.cameraEnabled();}; + //signaled when engine is blocked, + //no calls expected until signaled unblocked + void blocked(){ emit mUiEngine.blocked();}; + //signaled when engine is free + void unblocked(){ emit mUiEngine.unblocked();}; + //signaled continuously while session is up and running + //carries current session duration + void sessionDurationChanged(const QString &duration){ emit mUiEngine.sessionDurationChanged(duration);}; + void recipientChanged(const QString &recipient){ emit mUiEngine.recipientChanged(recipient);}; + void phoneNumberChanged(const QString &number){ emit mUiEngine.phoneNumberChanged(number);}; + //signaled when player state changed + void localPlayerPlaying(); + void remotePlayerPlaying(); + void localPlayerPreparing(){ mPlayerStateLocal=EPreparing;emit mUiEngine.localPlayerPreparing();}; + void remotePlayerPreparing(){ mSimulatorRemote=EPreparing;emit mUiEngine.remotePlayerPreparing();}; + void localPlayerBuffering(){ mPlayerStateLocal=EBuffering;emit mUiEngine.localPlayerBuffering();}; + void remotePlayerBuffering(){ mSimulatorRemote=EBuffering;emit mUiEngine.remotePlayerBuffering();}; + void localPlayerPaused(); + void remotePlayerPaused(); + void localPlayerUnavailable(){ mPlayerStateLocal=EUnavailable;emit mUiEngine.localPlayerUnavailable();}; + void remotePlayerUnavailable(){ mSimulatorRemote=EUnavailable;emit mUiEngine.remotePlayerUnavailable();}; + +public: + + void start(); + const QString& sessionTitle() const; + const QString& recipient() const; + const QString& phoneNumber() const; + LcViewLayoutHint viewLayout() const; + void setContentAreas( const QRectF& sharedContent, + const QRectF& receivedContent ); + bool setOrientation( Qt::Orientation orientation ); + void setUiComponents(HbDialog* invitingNote, + HbDialog* waitingNote, + HbDialog* acceptQuery, + HbDialog* recipientQuery); + void toggleMute(); + bool isMuted() const; + void toggleSpeaker(); + bool isSpeakerOn() const; + int zoomValues( LcControlValues& values ) const; + void toggleDisableCamera(); + void setMainCamera(const bool aMainCamera); + bool mainCamera() const; + void toggleCamera(); + bool fullScreenMode(); + void setFullScreenMode(bool aMode); + void updateSession(); + bool isLocalPlayerPlaying() const; + bool isRemotePlayerPlaying() const; + bool isMinimized()const; + void minimize(); + void maximize(); + void shareImage(const QString&); + void shareCamera(); + +public: // Data + + QByteArray mEngineName; + QString mSessionTitle; + QString mRecipient; + QString mPhoneNumber; + LcViewLayoutHint mViewLayout; + QTimer* mCloseTimer; + HbDialog* mInvitingNote; // Not owned + HbDialog* mWaitingNote; // Not owned + HbDialog* mAcceptQuery; // Not owned + HbDialog* mRecipientQuery; // Not owned + QString mPendingAction; + bool mBlocked; + bool mFullScreen; + int mSessionDurationTimerId; + QTime mSessionDurationStartTime; + LcUiEngine& mUiEngine; + +public: + simulationState mPlayerStateLocal; + simulationState mSimulatorRemote; + bool mSpeakerState; + bool mMuteState; + bool mMainCamera; + QProcess *mLocalPlayerProcess; + QProcess *mRemotePlayerProcess; + QString mProgram; + QString mProgramImage; + QString mLocalMovieName; + +private: + LcUiEngineSimulator* mSimulator; + +friend class LcUiEngineSimulator; +}; + +#endif // LCUIENGINEPRIVATE_H + + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcuiengine/tsrc/win32/lcuienginesimulator.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcuiengine/tsrc/win32/lcuienginesimulator.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,281 @@ +/* +* 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: +* +*/ + +//USER +#include "lcconfiguration.h" +#include "LcUiEngine_p.h" +#include "lcuidefs.h" +#include "lclogger.h" +#include "lcuienginesimulator.h" + + +//SYSTEM +#include +#include +#include +#include +#include +#include +#include + + +#define LC_VTPLUGIN_NAME "Videotelephony"; + +// ----------------------------------------------------------------------------- +// LcUiEngineSimulator::LcUiEngineSimulator +// ----------------------------------------------------------------------------- +// +LcUiEngineSimulator::LcUiEngineSimulator( LcUiEnginePrivate& uiEngine) + :mUiEngine( uiEngine ) +{ + mConfig = new LcConfiguration(); + mConfig->parse(); + mTimer = new QTimer( this ); + connect( mTimer, SIGNAL(timeout()), this, SLOT(timerEvent()) ); + iSimulatorCount = 0; +} + +// ----------------------------------------------------------------------------- +// LcUiEngineSimulator::~LcUiEngineSimulator +// ----------------------------------------------------------------------------- +// +LcUiEngineSimulator::~LcUiEngineSimulator() +{ + LC_QDEBUG( "livecomms [UI] -> LcUiEngineSimulator::~LcUiEngineSimulator()" ) + delete mConfig; + delete mTimer; + LC_QDEBUG( "livecomms [UI] <- LcUiEngineSimulator::~LcUiEngineSimulator()" ) +} + +// ----------------------------------------------------------------------------- +// LcUiEngineSimulator::~LcUiEngineSimulator +// ----------------------------------------------------------------------------- +// +void LcUiEngineSimulator::start() +{ + mTimer->start(mConfig->mTimerDuration); +} + +// ----------------------------------------------------------------------------- +// LcUiEngineSimulator::~LcUiEngineSimulator +// ----------------------------------------------------------------------------- +// +void LcUiEngineSimulator::stop() +{ + mTimer->stop(); + mUiEngine.stopped(); +} + +// ----------------------------------------------------------------------------- +// LcUiEngineSimulator::~LcUiEngineSimulator +// ----------------------------------------------------------------------------- +// +int LcUiEngineSimulator::layout() +{ + return mConfig->mLayout; +} + +// ----------------------------------------------------------------------------- +// LcUiEngineSimulator::~LcUiEngineSimulator +// ----------------------------------------------------------------------------- +// +QString LcUiEngineSimulator::phoneNo() +{ + return mConfig->mPhoneNumber; +} + +// ----------------------------------------------------------------------------- +// LcUiEngineSimulator::~LcUiEngineSimulator +// ----------------------------------------------------------------------------- +// +QString LcUiEngineSimulator::sessionTitle() +{ + return mConfig->mSessionTitle; +} + +// ----------------------------------------------------------------------------- +// LcUiEngineSimulator::~LcUiEngineSimulator +// ----------------------------------------------------------------------------- +// +QString LcUiEngineSimulator::remoteAddress() +{ + return mConfig->mRecipient; +} + +// ----------------------------------------------------------------------------- +// LcUiEngineSimulator::zoom +// ----------------------------------------------------------------------------- +// +void LcUiEngineSimulator::timerEvent() +{ + switch( mConfig->mLayout ){ + case 0 : { + break; + } + case 1:{ + simulateLiveSharingSend(); + break; + } + case 2:{ + simulateLiveSharingReceive(); + break; + } + case 3:{ + // TODO : Add simulation + break; + } + case 4:{ + simulateTwoWaySharing(); + break; + } + case 5:{ + simulateVideoTelephony(); + break; + } + default:{ + + break; + } + } + + iSimulatorCount++; +} + +// ----------------------------------------------------------------------------- +// LcUiEngineSimulator::zoom +// ----------------------------------------------------------------------------- +// +void LcUiEngineSimulator::simulateLiveSharingSend() +{ + switch ( iSimulatorCount ){ + case 0:{ + mUiEngine.mInvitingNote->show(); + mUiEngine.localPlayerPreparing(); + break; + } + case 1:{ + mUiEngine.mInvitingNote->hide();; + mUiEngine.localPlayerBuffering(); + break; + } + case 2:{ + mUiEngine.localPlayerPlaying(); + break; + } + default:{ + mUiEngine.sessionDurationChanged(QString::number(iSimulatorCount)); + break; + } + } +} + +// ----------------------------------------------------------------------------- +// LcUiEngineSimulator::zoom +// ----------------------------------------------------------------------------- +// +void LcUiEngineSimulator::simulateLiveSharingReceive() +{ + switch ( iSimulatorCount ){ + case 0:{ + mUiEngine.mAcceptQuery->show(); + mUiEngine.remotePlayerPreparing(); + break; + } + case 1:{ + mUiEngine.mAcceptQuery->hide(); + mUiEngine.mWaitingNote->show(); + mUiEngine.remotePlayerBuffering(); + break; + } + case 2:{ + mUiEngine.mWaitingNote->hide(); + mUiEngine.remotePlayerPlaying(); + break; + } + default:{ + mUiEngine.sessionDurationChanged(QString::number(iSimulatorCount)); + break; + } + } +} + +// ----------------------------------------------------------------------------- +// LcUiEngineSimulator::zoom +// ----------------------------------------------------------------------------- +// +void LcUiEngineSimulator::simulateTwoWaySharing() +{ + switch ( iSimulatorCount ){ + case 0:{ + mUiEngine.localPlayerPreparing(); + mUiEngine.remotePlayerPreparing(); + break; + } + case 1:{ + mUiEngine.localPlayerBuffering(); + mUiEngine.remotePlayerBuffering(); + break; + } + case 2:{ + mUiEngine.localPlayerPlaying(); + mUiEngine.remotePlayerPlaying(); + break; + } + default:{ + mUiEngine.sessionDurationChanged(QString::number(iSimulatorCount)); + break; + } + } +} + +// ----------------------------------------------------------------------------- +// LcUiEngineSimulator::zoom +// ----------------------------------------------------------------------------- +// +void LcUiEngineSimulator::simulateVideoTelephony() +{ + switch ( iSimulatorCount ){ + case 0:{ + mUiEngine.localPlayerPreparing(); + mUiEngine.remotePlayerPreparing(); + break; + } + case 1:{ + mUiEngine.localPlayerBuffering(); + mUiEngine.remotePlayerBuffering(); + break; + } + case 2:{ + if( !mUiEngine.isRemotePlayerPlaying() ){ + mUiEngine.remotePlayerPlaying(); + } + break; + } + case 3:{ + if( !mUiEngine.isLocalPlayerPlaying() ){ + mUiEngine.localPlayerPlaying(); + } + break; + } + default:{ + mUiEngine.sessionDurationChanged(QString::number(iSimulatorCount)); + break; + } + } +} + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcuiengine/tsrc/win32/lcuienginesimulator.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcuiengine/tsrc/win32/lcuienginesimulator.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,72 @@ +/* +* 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 LCUIENGINESIMULATOR_H +#define LCUIENGINESIMULATOR_H + +//SYSTEM +#include +#include +#include + +class QTimer; +class LcUiEnginePrivate; +class LcConfiguration; + +/* + * Live Comms simulator + */ +class LcUiEngineSimulator : public QObject +{ + Q_OBJECT + +public: + + LcUiEngineSimulator ( LcUiEnginePrivate& uiEngine ); + ~LcUiEngineSimulator (); + int layout(); + QString sessionTitle(); + QString remoteAddress(); + QString phoneNo(); + void setSimulation(int index){iSimulatorCount = index;}; + int simulation(){return iSimulatorCount;}; +public: + void start(); + void stop(); + +public slots: + + void timerEvent(); + +private: + void simulateLiveSharingSend(); + void simulateLiveSharingReceive(); + void simulateTwoWaySharing(); + void simulateVideoTelephony(); + +private: // Data + + QTimer* mTimer; + LcConfiguration* mConfig; + LcUiEnginePrivate& mUiEngine; + int iSimulatorCount; + +}; + +#endif // LCUIENGINESIMULATOR_H + + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcuiengine/tsrc/win32/lcvideowidget.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcuiengine/tsrc/win32/lcvideowidget.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,91 @@ +/* +* 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: +* +*/ + +//USER +#include "lcvideowidget.h" + +//SYSTEM +#include + +const qreal lcVideoWidgetCornerRounding = 10.0; + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +LcVideoWidget::LcVideoWidget(QGraphicsItem *parent, bool showVideo) : + HbTransparentWindow(parent), + mShowVideo(showVideo) +{ +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +LcVideoWidget::~LcVideoWidget() +{ +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void LcVideoWidget::paint( + QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) +{ + Q_UNUSED(widget) + if ( mShowVideo ){ + QPainter::CompositionMode origCompositionMode = painter->compositionMode(); + QPoint point(10,10); + QString str = QString::fromAscii("Playing..."); + if( mLocalPlayer ){ + painter->setBrush( Qt::red ); + }else{ + painter->setBrush( Qt::green ); + } + painter->setPen( Qt::white ); + painter->drawRoundedRect( option->exposedRect, + lcVideoWidgetCornerRounding, lcVideoWidgetCornerRounding); + painter->drawText(option->exposedRect.center(),str); + painter->setCompositionMode(origCompositionMode); // restore + } else { + painter->setBrush(QColor(0,0,0,255)); + painter->drawRoundedRect( option->exposedRect, + lcVideoWidgetCornerRounding, lcVideoWidgetCornerRounding); + } +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void LcVideoWidget::setShowVideo(bool showVideo) +{ + mShowVideo = showVideo; +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +bool LcVideoWidget::isShowingVideo() +{ + return mShowVideo; +} + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/lcuiengine/tsrc/win32/package.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/lcuiengine/tsrc/win32/package.bat Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,65 @@ +@rem +@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +@rem All rights reserved. +@rem This component and the accompanying materials are made available +@rem under the terms of "Eclipse Public License v1.0" +@rem which accompanies this distribution, and is available +@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +@rem +@rem Initial Contributors: +@rem Nokia Corporation - initial contribution. +@rem +@rem Contributors: +@rem +@rem Description: +@rem + +@goto invoke_perl + +#!perl +#line 5 + +################################################################################################################ +# This Script will package livecomms ui compoenents to run in windows environment +################################################################################################################ + +# Packages needed +use File::Find; # File operations +File::Spec::Win32; # File operartions +use Getopt::Long; # parameter handling +use Cwd; # Directory operations +Getopt::Long::Configure( "bundling_override","ignore_case_always" ); + +# Global variables +my $orbit_bin_dir = "c:\\hb\\bin"; +my $qt_bin_dir = "C:\\Qt\\4.6.0-beta1\\bin"; +my $mingw_dll = "C:\\MinGW\\bin\\mingwm10.dll"; +my $livecomms_ui_exe = "$qt_bin_dir\\musui.exe"; +my $livecomms_ui_dll = "$qt_bin_dir\\livecommsui.dll"; +my $package_name = "livecommsui_win"; +my $launch_bat = "launch.bat"; +my $config_file = "lcconfig.xml"; + + +opendir(DIR,$orbit_bin_dir) or die "Can't find dir: $!\n"; +closedir(DIR); +opendir(DIR,$qt_bin_dir) or die "Can't find dir: $!\n"; +closedir(DIR); +die "$livecomms_ui_exe Doesn't Exist!" unless (-e $livecomms_ui_exe) ; +die "$livecomms_ui_dll Doesn't Exist!" unless (-e $livecomms_ui_dll); +die "$mingw_dll Doesn't Exist!" unless (-e $mingw_dll); +opendir(DIR,$package_name) or system("mkdir $package_name"); +closedir(DIR); +system("copy $orbit_bin_dir $package_name\\*"); +system("copy $qt_bin_dir $package_name\\*"); +system("copy $mingw_dll $package_name\\*"); +system("copy $launch_bat $package_name\\*"); +system("copy $config_file $package_name\\*"); +system("del $package_name\.zip") if( -e "$package_name\.zip" ); +system("zip $package_name $package_name\\*"); +system("rmdir /s/q $package_name"); + +__END__ + +:invoke_perl +@perl -x -S C:\SynergyWorkArea\Mercurial\mmsharinguis\mmsharing\mmshlcui\mmshlcuiengine\win32\package.bat %1 %2 %3 %4 %5 %6 %7 %8 %9 diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/livecommsui.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/livecommsui.pro Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,95 @@ +# 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 = livecommsui +CONFIG += hb \ + dll \ + svg + +QT += xml + +DEFINES += LIVECOMMSUI_LIB +TRANSLATIONS = dialer.ts + +LCUI_DIR = lcui +LCUIENGINE_DIR = lcuiengine + +RESOURCES += $$LCUI_DIR/livecommsui.qrc + +INCLUDEPATH += $$LCUI_DIR/inc +INCLUDEPATH += $$LCUIENGINE_DIR/inc +INCLUDEPATH += ../inc + +# Input +HEADERS += $$LCUI_DIR/inc/lcviewmanager.h +HEADERS += $$LCUI_DIR/inc/lcviewmanager_p.h +HEADERS += $$LCUI_DIR/inc/lcview.h +HEADERS += $$LCUI_DIR/inc/lcuicomponentrepository.h +HEADERS += $$LCUI_DIR/inc/lceffecthandler.h +HEADERS += $$LCUI_DIR/inc/lcvideowidget.h +HEADERS += $$LCUIENGINE_DIR/inc/lcuiengine.h + +SOURCES += $$LCUI_DIR/src/lcviewmanager.cpp +SOURCES += $$LCUI_DIR/src/lcviewmanager_p.cpp +SOURCES += $$LCUI_DIR/src/lcview.cpp +SOURCES += $$LCUI_DIR/src/lcuicomponentrepository.cpp +SOURCES += $$LCUI_DIR/src/lceffecthandler.cpp +SOURCES += $$LCUIENGINE_DIR/src/lcuiengine.cpp + +libFiles.sources = livecommsui.dll +DEPLOYMENT += libFiles + +symbian: { + DOCML_DIR = lcui/resources/lcviews + + INCLUDEPATH += /epoc32/include/ecom + INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE + + HEADERS += $$LCUIENGINE_DIR/inc/lcuiengine_p.h + HEADERS += $$LCUIENGINE_DIR/inc/lcactivitymanager.h + + SOURCES += $$LCUIENGINE_DIR/src/lcuiengine_p.cpp + SOURCES += $$LCUIENGINE_DIR/src/lcactivitymanager.cpp + SOURCES += $$LCUI_DIR/src/lcvideowidget.cpp + + TARGET.UID2 = 0x1000008d + TARGET.UID3 = 0x2002434D + TARGET.CAPABILITY = CAP_GENERAL_DLL + TARGET.EPOCALLOWDLLDATA = 1 + + libFiles.path = "!:/sys/bin" + LIBS += -lecom \ + -lflogger \ + -lws32 \ + -lbafl \ + -lcone \ + -lcentralrepository \ + -lxqserviceutil \ + -ldialpad + + defFiles = "$${LITERAL_HASH}ifdef WINS" \ + "DEFFILE bwins/livecommsui.def" \ + "$${LITERAL_HASH}else" \ + "DEFFILE eabi/livecommsui.def" \ + "$${LITERAL_HASH}endif" + MMP_RULES += defFiles + + :BLD_INF_RULES.prj_exports += "$$LCUI_DIR/inc/lcviewmanager.h /epoc32/include/lcviewmanager.h" + :BLD_INF_RULES.prj_exports += "$$LCUI_DIR/inc/lcexport.h /epoc32/include/lcexport.h" + :BLD_INF_RULES.prj_exports += "$$DOCML_DIR/lcidleview.docml z:/data/others/lcidleview.docml" + :BLD_INF_RULES.prj_exports += "$$DOCML_DIR/lcreceiveView.docml z:/data/others/lcreceiveview.docml" + :BLD_INF_RULES.prj_exports += "$$DOCML_DIR/lcsendview.docml z:/data/others/lcsendview.docml" + :BLD_INF_RULES.prj_exports += "$$DOCML_DIR/lctwowayview.docml z:/data/others/lctwowayview.docml" + :BLD_INF_RULES.prj_exports += "$$DOCML_DIR/lcvtview.docml z:/data/others/lcvtview.docml" + :BLD_INF_RULES.prj_exports += "$$DOCML_DIR/lcreceiveonlyView.docml z:/data/others/lcreceiveonlyview.docml" +} + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/livecommsui/tsrc/win32/livecommsui.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/livecommsui/tsrc/win32/livecommsui.pro Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,61 @@ +# 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 = livecommsui +CONFIG += hb \ + dll \ + svg + +QT += xml + +DEFINES += LIVECOMMSUI_LIB + +LCUI_DIR = ../../lcui +LCUIENGINE_DIR = ../../lcuiengine +LCUIENGINE_WIN32_DIR = $$LCUIENGINE_DIR/tsrc/win32 + +RESOURCES += $$LCUI_DIR/livecommsui.qrc + +INCLUDEPATH += $$LCUI_DIR/inc +INCLUDEPATH += $$LCUIENGINE_WIN32_DIR +INCLUDEPATH += $$LCUIENGINE_DIR/inc + +# Input +HEADERS += $$LCUI_DIR/inc/lcviewmanager.h +HEADERS += $$LCUI_DIR/inc/lcviewmanager_p.h +HEADERS += $$LCUI_DIR/inc/lcview.h +HEADERS += $$LCUI_DIR/inc/lcuicomponentrepository.h +HEADERS += $$LCUI_DIR/inc/lceffecthandler.h +HEADERS += $$LCUI_DIR/inc/lcvideowidget.h +HEADERS += $$LCUIENGINE_DIR/inc/lcuiengine.h + +SOURCES += $$LCUI_DIR/src/lcviewmanager.cpp +SOURCES += $$LCUI_DIR/src/lcviewmanager_p.cpp +SOURCES += $$LCUI_DIR/src/lcview.cpp +SOURCES += $$LCUI_DIR/src/lcuicomponentrepository.cpp +SOURCES += $$LCUI_DIR/src/lceffecthandler.cpp +SOURCES += $$LCUIENGINE_DIR/src/lcuiengine.cpp + +libFiles.sources = livecommsui.dll +DEPLOYMENT += libFiles + +win32: { + INCLUDEPATH += $$LCUIENGINE_WIN32_DIR + + HEADERS += $$LCUIENGINE_WIN32_DIR/lcuiengine_p.h + HEADERS += $$LCUIENGINE_WIN32_DIR/lcuienginesimulator.h + HEADERS += $$LCUIENGINE_WIN32_DIR/lcconfiguration.h + SOURCES += $$LCUIENGINE_WIN32_DIR/lcuiengine_p.cpp + SOURCES += $$LCUIENGINE_WIN32_DIR/lcuienginesimulator.cpp + SOURCES += $$LCUIENGINE_WIN32_DIR/lcconfiguration.cpp + SOURCES += $$LCUIENGINE_WIN32_DIR/lcvideowidget.cpp +} diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshapp/help/data/xhtml.zip Binary file mmsharing/mmshapp/help/data/xhtml.zip has changed diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshapp/help/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshapp/help/group/bld.inf Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,26 @@ +/* +* 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: +* Export help related files. +* +*/ + +#include +PRJ_EXPORTS +:zip ../data/xhtml.zip /epoc32/data/z/resource/ overwrite +:zip ../data/xhtml.zip /epoc32/winscw/c/resource/ overwrite + +../inc/msh.hlp.hrh MW_LAYER_PLATFORM_EXPORT_PATH(csxhelp/msh.hlp.hrh) +../rom/mmshuihelps_variant.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(mmshuihelps_variant.iby) diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshapp/help/inc/msh.hlp.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshapp/help/inc/msh.hlp.hrh Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,17 @@ +// +// msh.hlp.hrh +// + +// +// File generated by CSXHelp Utilities on 2009-04-17 +// + +#ifndef __MSH_HLP_HRH__ +#define __MSH_HLP_HRH__ + +_LIT(KMSH_HLP_LIVE, "MSH_HLP_LIVE"); // +_LIT(KMSH_HLP_CLIP, "MSH_HLP_CLIP"); // +_LIT(KMSH_HLP_SETTINGS, "MSH_HLP_SETTINGS"); // +_LIT(KMSH_HLP_RECEIVE, "MSH_HLP_RECEIVE"); // + +#endif \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshapp/help/rom/mmshuihelps_variant.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshapp/help/rom/mmshuihelps_variant.iby Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 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: +* +*/ + +#ifndef __MMSHUIHELPS_VARIANT_IBY__ +#define __MMSHUIHELPS_VARIANT_IBY__ + +#if defined(FF_S60_HELPS_IN_USE) && defined(__MULTIMEDIA_SHARING) + data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x10282391\contents.zip, RESOURCE_FILES_DIR\xhtml\%02d\0x10282391\contents.zip) + data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x10282391\index.xml, RESOURCE_FILES_DIR\xhtml\%02d\0x10282391\index.xml) + data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x10282391\keywords.xml, RESOURCE_FILES_DIR\xhtml\%02d\0x10282391\keywords.xml) + data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x10282391\meta.xml, RESOURCE_FILES_DIR\xhtml\%02d\0x10282391\meta.xml) +#endif + +#endif \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshapp/inc/lcapplication.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshapp/inc/lcapplication.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,47 @@ +/* +* 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 LCAPPLICATION_H +#define LCAPPLICATION_H + +#include + +class LcHbApplication : public HbApplication +{ + Q_OBJECT + friend class UT_LcApplication; + +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 e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshapp/mmshapp.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshapp/mmshapp.pro Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,35 @@ +# +# 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 = musui +CONFIG += hb + +# Input +HEADERS += inc/lcapplication.h + +SOURCES += src/main.cpp +SOURCES += src/lcapplication.cpp + +LIBS += -llivecommsui + +symbian: { + TARGET.UID2 = 0x100039CE + TARGET.UID3 = 0x10282391 + TARGET.CAPABILITY = CAP_APPLICATION NetworkControl SwEvent Location MultimediaDD + RSS_RULES += "hidden = KAppIsHidden;" +} diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshapp/src/lcapplication.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshapp/src/lcapplication.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,56 @@ +/* +* 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: +* +*/ +//USER +#include "lcapplication.h" + +//SYSTEM +#include + +LcHbApplication* LcHbApplication::self = 0; + + +// ----------------------------------------------------------------------------- +// LcHbApplication::LcHbApplication +// ----------------------------------------------------------------------------- +// +LcHbApplication::LcHbApplication(int &argc, char *argv[]) : + HbApplication(argc, argv) +{ + self = this; +} + +// ----------------------------------------------------------------------------- +// LcHbApplication::~LcHbApplication +// ----------------------------------------------------------------------------- +// +LcHbApplication::~LcHbApplication() +{ + self = 0; +} + + +// ----------------------------------------------------------------------------- +// LcHbApplication::quit +// ----------------------------------------------------------------------------- +// +void LcHbApplication::quit() +{ + qDebug() << "LcHbApplication::quit()"; + if (self) { + emit self->handleQuit(); + } +} diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshapp/src/main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshapp/src/main.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,42 @@ +/* +* 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: +* +*/ +//USER +#include "lcapplication.h" + +//SYSTEM +#include +#include +#include + +int main(int argc, char *argv[]) +{ + int err=-1; + if (argc >= 2) + { + LcHbApplication app(argc, argv); + QString engineName(QString::fromUtf8(argv[1])); + QString applicationName("Video Sharing"); + LcViewManager viewManager(engineName,applicationName); + + QObject::connect( &app, SIGNAL( handleQuit() ), + &viewManager, SLOT( terminateSession() ), + Qt::QueuedConnection ); + + err = app.exec(); + } + return err; +} diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshapp/tsrc/ut_mmshapp/inc/ut_lcapplication.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshapp/tsrc/ut_mmshapp/inc/ut_lcapplication.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,58 @@ +/* +* 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_LCAPPLICATION_H +#define UT_LCAPPLICATION_H + + +#include + +class LcHbApplication; + +class UT_LcApplication : 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 testConstructorDestructor(); + void testQuit(); + +private: + + LcHbApplication* mLcApplication; + int mArgc; +}; + +#endif //UT_LCAPPLICATION_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshapp/tsrc/ut_mmshapp/src/main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshapp/tsrc/ut_mmshapp/src/main.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,48 @@ +/* +* 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_lcapplication.h" +#include "testresultxmlparser.h" + + +int main(int argc, char *argv[]) +{ + bool promptOnExit(true); + for (int i=0; i + + +void UT_LcApplication::initTestCase() +{ +} + +void UT_LcApplication::cleanupTestCase() +{ +} + + +void UT_LcApplication::init() +{ + mArgc = 0; + mLcApplication = new LcHbApplication( mArgc, 0 ); +} + +void UT_LcApplication::cleanup() +{ + delete mLcApplication; +} + +void UT_LcApplication::testConstructorDestructor() + { + QVERIFY( mLcApplication ); + QVERIFY( LcHbApplication::self == mLcApplication ); + + delete mLcApplication; + mLcApplication = 0; + QVERIFY( !LcHbApplication::self ); + } + +void UT_LcApplication::testQuit() +{ + QSignalSpy spy( mLcApplication, SIGNAL(handleQuit()) ); + LcHbApplication::quit(); + QCOMPARE( spy.count(), 1 ); + + mLcApplication->self = 0; + spy.clear(); + LcHbApplication::quit(); + QCOMPARE( spy.count(), 0 ); +} diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshapp/tsrc/ut_mmshapp/stubs/hbapplication.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshapp/tsrc/ut_mmshapp/stubs/hbapplication.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,30 @@ +/* +* 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 HBAPPLICATION_H +#define HBAPPLICATION_H + +#include +#include + +class HbApplication : public QObject +{ +public: + HbApplication(int &/*argc*/, char */*argv*/[]){}; + ~HbApplication(){}; +}; + +#endif//HBAPPLICATION_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshapp/tsrc/ut_mmshapp/ut_mmshapp.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshapp/tsrc/ut_mmshapp/ut_mmshapp.pro Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,50 @@ +# +# 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 = + +CONFIG += hb +QT += testlib xml +#CONFIG += qtestlib + +MUSAPP_DIR = ../.. +MUS_DIR = ../../../.. + +DEPENDPATH += . + +INCLUDEPATH += inc +INCLUDEPATH += stubs +INCLUDEPATH += $$MUSAPP_DIR/inc +INCLUDEPATH += $$MUS_DIR/tsrc/qtestutils/inc + +# Input +HEADERS += inc/ut_lcapplication.h +HEADERS += $$MUSAPP_DIR/inc/lcapplication.h + +SOURCES += src/main.cpp +SOURCES += src/ut_lcapplication.cpp +SOURCES += $$MUSAPP_DIR/src/lcapplication.cpp +SOURCES += $$MUS_DIR/tsrc/qtestutils/src/testresultxmlparser.cpp + + +symbian: { + TARGET.UID2 = 0x100039CE + TARGET.UID3 = 0xE5923aef + TARGET.CAPABILITY = ALL -TCB + TARGET.EPOCALLOWDLLDATA = 1 +} diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/bwins/musavailabilitypluginu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/bwins/musavailabilitypluginu.def Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,3 @@ +EXPORTS + ?ImplementationGroupProxy@@YAPBUTImplementationProxy@@AAH@Z @ 1 NONAME ; struct TImplementationProxy const * ImplementationGroupProxy(int &) + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/data/1028238E.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/data/1028238E.rss Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,52 @@ +/* +* 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: Registry file for the Mus Availability Plug-in +* Implementation. +* +*/ + + +// 0x1028238E.RSS +// + +#include "musuid.hrh" +#include "musversionnumbers.h" + +#include + +RESOURCE REGISTRY_INFO theInfo + { + resource_format_version = RESOURCE_FORMAT_VERSION_2; + dll_uid = KMusAvaPluginUid; + interfaces = + { + INTERFACE_INFO + { + interface_uid = KMusAvaPluginInterfaceUid; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = KMusAvaPluginUid; + version_no = KMusEcomVersionNumber; + display_name = "AvailabilityPlugin 1"; + default_data = "AvailabilityPlugin"; + opaque_data = "0"; + } + }; + } + }; + } + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/eabi/musavailabilitypluginu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/eabi/musavailabilitypluginu.def Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,61 @@ +EXPORTS + _Z24ImplementationGroupProxyRi @ 1 NONAME + _ZTI10CMusAvaSip @ 2 NONAME ; ## + _ZTI15CMusAvaTerminal @ 3 NONAME ; ## + _ZTI17CMusAvaCapability @ 4 NONAME ; ## + _ZTI17CMusAvaDefaultImp @ 5 NONAME ; ## + _ZTI18CMusAvaSettingsImp @ 6 NONAME ; ## + _ZTI18CMusAvaSipObserver @ 7 NONAME ; ## + _ZTI19CMusAvaSharedObject @ 8 NONAME ; ## + _ZTI20CMusAvaInviteHandler @ 9 NONAME ; ## + _ZTI20CMusAvaOptionHandler @ 10 NONAME ; ## + _ZTI22CMusAvaCapabilityQuery @ 11 NONAME ; ## + _ZTI22CMusAvaCapabilityTimer @ 12 NONAME ; ## + _ZTI22CMusAvaInviteResponder @ 13 NONAME ; ## + _ZTI23CMusAvaCallEventMonitor @ 14 NONAME ; ## + _ZTI24CMusAvaConnectionMonitor @ 15 NONAME ; ## + _ZTI24CMusAvaNetworkModeStatus @ 16 NONAME ; ## + _ZTI25CMusAvaCapabilityExchange @ 17 NONAME ; ## + _ZTI25CMusAvaCapabilitySipAgent @ 18 NONAME ; ## + _ZTI26CMusAvaCapabilityQueryBase @ 19 NONAME ; ## + _ZTI26CMusAvaContactAvailability @ 20 NONAME ; ## + _ZTI26CMusAvaNetworkAvailability @ 21 NONAME ; ## + _ZTI26CMusAvaTelephonyStatusBase @ 22 NONAME ; ## + _ZTI27CMusAvaDefaultOptionHandler @ 23 NONAME ; ## + _ZTI27CMusAvaRegisterAvailability @ 24 NONAME ; ## + _ZTI28CMusAvaSipConnectionObserver @ 25 NONAME ; ## + _ZTI29CMusAvaConnectionAvailability @ 26 NONAME ; ## + _ZTI32CMusAvaNetworkRegistrationStatus @ 27 NONAME ; ## + _ZTI33CMusAvaSipProfileRegistryObserver @ 28 NONAME ; ## + _ZTV10CMusAvaSip @ 29 NONAME ; ## + _ZTV15CMusAvaTerminal @ 30 NONAME ; ## + _ZTV17CMusAvaCapability @ 31 NONAME ; ## + _ZTV17CMusAvaDefaultImp @ 32 NONAME ; ## + _ZTV18CMusAvaSettingsImp @ 33 NONAME ; ## + _ZTV18CMusAvaSipObserver @ 34 NONAME ; ## + _ZTV19CMusAvaSharedObject @ 35 NONAME ; ## + _ZTV20CMusAvaInviteHandler @ 36 NONAME ; ## + _ZTV20CMusAvaOptionHandler @ 37 NONAME ; ## + _ZTV22CMusAvaCapabilityQuery @ 38 NONAME ; ## + _ZTV22CMusAvaCapabilityTimer @ 39 NONAME ; ## + _ZTV22CMusAvaInviteResponder @ 40 NONAME ; ## + _ZTV23CMusAvaCallEventMonitor @ 41 NONAME ; ## + _ZTV24CMusAvaConnectionMonitor @ 42 NONAME ; ## + _ZTV24CMusAvaNetworkModeStatus @ 43 NONAME ; ## + _ZTV25CMusAvaCapabilityExchange @ 44 NONAME ; ## + _ZTV25CMusAvaCapabilitySipAgent @ 45 NONAME ; ## + _ZTV26CMusAvaCapabilityQueryBase @ 46 NONAME ; ## + _ZTV26CMusAvaContactAvailability @ 47 NONAME ; ## + _ZTV26CMusAvaNetworkAvailability @ 48 NONAME ; ## + _ZTV26CMusAvaTelephonyStatusBase @ 49 NONAME ; ## + _ZTV27CMusAvaDefaultOptionHandler @ 50 NONAME ; ## + _ZTV27CMusAvaRegisterAvailability @ 51 NONAME ; ## + _ZTV28CMusAvaSipConnectionObserver @ 52 NONAME ; ## + _ZTV29CMusAvaConnectionAvailability @ 53 NONAME ; ## + _ZTV32CMusAvaNetworkRegistrationStatus @ 54 NONAME ; ## + _ZTV33CMusAvaSipProfileRegistryObserver @ 55 NONAME ; ## + _ZTI29CMusAvaSipprofileAvailability @ 56 NONAME ; ## + _ZTV29CMusAvaSipprofileAvailability @ 57 NONAME ; ## + _ZTI26CMusAvaSettingAvailability @ 58 NONAME ; ## + _ZTV26CMusAvaSettingAvailability @ 59 NONAME ; ## + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/group/bld.inf Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,30 @@ +/* +* 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: project specification +* +*/ + + +#include + +PRJ_PLATFORMS + DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES +musavailabilityplugin.mmp + + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/group/musavailabilityplugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/group/musavailabilityplugin.mmp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,107 @@ +/* +* Copyright (c) 2005-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 file for ECom MusAvailability plug-in +* +*/ + + +#include + +TARGET musavailabilityplugin.dll +TARGETTYPE PLUGIN +UID 0x10009D8D 0x1028238E + +CAPABILITY CAP_ECOM_PLUGIN +VENDORID VID_DEFAULT + +epocallowdlldata + +SOURCEPATH ../src +SOURCE musavaconnectionmonitor.cpp +SOURCE musavacontactavailability.cpp +SOURCE musavainvitehandler.cpp +SOURCE musavainviteresponder.cpp +SOURCE musavamain.cpp +SOURCE musavaoptionhandler.cpp +SOURCE musavadefaultoptionhandler.cpp +SOURCE musavanetworkavailability.cpp +SOURCE musavaproxy.cpp +SOURCE musavaregisteravailability.cpp +SOURCE musavadefaultimp.cpp +SOURCE musavasettingsimp.cpp +SOURCE musavasharedobject.cpp +SOURCE musavasip.cpp +SOURCE musavasipconnectionobserver.cpp +SOURCE musavasipobserver.cpp +SOURCE musavasipprofileregistryobserver.cpp +SOURCE musavaconnectionavailability.cpp +SOURCE musavatelephonystatusbase.cpp +SOURCE musavanetworkregistrationstatus.cpp +SOURCE musavanetworkmodestatus.cpp +SOURCE musavacapabilityexchange.cpp +SOURCE musavacapability.cpp +SOURCE musavacapabilitysipagent.cpp +SOURCE musavaterminal.cpp +SOURCE musavacapabilitycontext.cpp +SOURCE musavacalleventmonitor.cpp +SOURCE musavacapabilityquerybase.cpp +SOURCE musavacapabilityquery.cpp +SOURCE musavacapabilitytimer.cpp +SOURCE musavasipprofileavailability.cpp +SOURCE musavasettingavailability.cpp +SOURCE musavasipheaderutil.cpp +SOURCE musavaclientresolverutil.cpp + + +SOURCEPATH ../data + +START RESOURCE 1028238E.rss +TARGET musavailabilityplugin.rsc +END + +/* +START RESOURCE 1028238E.rss +#ifdef SYMBIAN_SECURE_ECOM +TARGET musavailabilityplugin.rsc +#endif +END*/ + +USERINCLUDE ../inc +USERINCLUDE ../../mmshshared/inc +USERINCLUDE ../../inc +USERINCLUDE ../../../inc +USERINCLUDE ../../cenrep + +APP_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY sipclient.lib +LIBRARY sipprofile.lib +LIBRARY sipprofilecli.lib +LIBRARY centralrepository.lib +LIBRARY cntmodel.lib // Contact Model +LIBRARY sipcodec.lib +LIBRARY sdpcodec.lib // SDP Codec +LIBRARY bafl.lib +LIBRARY etelmm.lib +LIBRARY etel.lib +LIBRARY connmon.lib +LIBRARY charconv.lib +LIBRARY inetprotutil.lib +LIBRARY estor.lib +DEBUGLIBRARY flogger.lib +LIBRARY insock.lib + +PAGED diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/inc/mmusavacapabilityqueryobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/inc/mmusavacapabilityqueryobserver.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,79 @@ +/* +* Copyright (c) 2005-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: Capability query observer +* +*/ + +#ifndef MMUSAVACAPABILITYQUERYOBSERVER_H +#define MMUSAVACAPABILITYQUERYOBSERVER_H + +#include +#include +#include + +class CMusAvaCapabilityQueryBase; + + + +/** + * Capability Query Observer + * + * @lib musavailabilityplugin.lib + */ +class MMusAvaCapabilityQueryObserver + { +public: + + virtual void CapabilitiesResolved( const CMusAvaCapabilityQueryBase& aSentQuery ) = 0; + + virtual void CapabilitiesResolvedL( const TDesC& aUri ) = 0; + + virtual void SetCapabilitiesResolvedForCingular() = 0; + + virtual TBool CapabilitiesResolvedForCingular() = 0; + + /** + * This is to advertise MMusAvaCapabilityQueryObserver implementors + * about sip header change. It is mainly used in below scneraio but could + * be used in future if anyother sip headers has to be set. + * + * Incase if we receive OPTIONS request already and + * P-Asserted-Identity Header is present then OPTIONS + * request should be sent to this ID. This function should be + * called to configure this id in CMusAvaSettingsImp& iSettings + * + * @aHeaders Array of SIP Headers. + * @aHeaderType Type of the header. + * Leavs if Array is empty or pointer is NULL. + * Ownership Transferred. + */ + virtual void SipHeadersL(const MDesCArray& aHeaders, + SipStrConsts::TStrings aHeaderType)=0; + + /** + * Advertise about video codec capabilities + */ + virtual void VideoCodecsResolvedL( const MDesCArray& aVideoCodecs ) = 0; + + virtual TBool CapabilityQueryAnswered( TBool aAnswered = EFalse ) = 0; + + /** + * Advertise about fast mode capability + */ + virtual void FastModeResolved( MusSettingsKeys::TFastMode aMode ) = 0; + }; + + +#endif //MMUSAVACAPABILITYQUERYOBSERVER_H + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/inc/musavaavailability.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/inc/musavaavailability.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,190 @@ +/* +* Copyright (c) 2005-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: Provide interface for the client requestin availability class. +* +*/ + + + +#ifndef __CMUSAVAAVAILABILITY_H__ +#define __CMUSAVAAVAILABILITY_H__ + + +#include +#include +#include "musavaobserver.h" +#include "musavaavailabilityobserver.h" +#include "muslogger.h" +#include "musunittesting.h" + +class MMusAvaAvailabilityObserver; + +/** + * Availability interface class definition. + * + * Provide interface for the client to availability class. + * + * @lib musavailabilityplugin.lib + */ +class CMusAvaAvailability : public CBase + { + +public: + + /** + * Current availability plugin state. + * + * @return Availability state + */ + MMusAvaObserver::TAvailabilityStatus AvailabilityPluginState() + { + return iObserver.AvailabilityPluginState(); + } + + /** + * Executes for the availability. + * + * @since S60 v3.2 + * @return KErrNone if ExecutePatternL operation was successfully executed; + * system wide error otherwise + */ + void Execute() + { + MMusAvaObserver::TAvailabilityName name = Name(); + MUS_LOG1( "mus: [MUSAVA] -> CMusAvaAvailability::Execute(%d)", name ) + if ( !Executing() && !Available() ) + { + TRAPD( error, DoExecuteL() ) + if ( error ) + { + MUS_LOG1( "mus: [MUSAVA] CMusAvaAvailability::Execute error:%d", error ) + iObserver.AvailabilityError( name, (MMusAvaObserver::TAvailabilityStatus)error ); + } + } + MUS_LOG( "mus: [MUSAVA] <- CMusAvaAvailability::Execute()" ) + } + + /** + * Executes *this* availability. + * + */ + virtual void DoExecuteL() = 0; + + /** + * Returns availability name. + * + * @return Name of *this* availability. + */ + virtual MMusAvaObserver::TAvailabilityName Name() = 0; + + /** + * Returns execution state. + * + * @return KErrNone if ExecutePatternL operation was successfully executed; + * system wide error otherwise + */ + TBool Executing() + { + return iState == MMusAvaObserver::EMusAvaStatusInProgress; + } + + /** + * Returns *this* availability state. + * + * @return ETrue if is available, EFalse otherwise + */ + TBool Available() + { + return iState == MMusAvaObserver::EMusAvaStatusAvailable; + } + + /** + * Stop the execution. + * + * @since S60 v3.2 + * @return KErrNone if stop operation was successfully executed; + * system wide error otherwise + */ + virtual void Stop() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaAvailability::Stop()" ) + iState = MMusAvaObserver::EMusAvaStatusNotExecuted; + MUS_LOG( "mus: [MUSAVA] <- CMusAvaAvailability::Stop()" ) + } + + /** + * Returns *this* availability state. + * + * @return Availability state. + */ + MMusAvaObserver::TAvailabilityStatus State() + { + return iState; + } + + /** + * Set availability state. + * + */ + void SetState( MMusAvaObserver::TAvailabilityStatus aState ) + { + MUS_LOG1( "mus: [MUSAVA] -> CMusAvaAvailability::SetState(%d)", aState ) + if ( iState != aState ) + { + iState = aState; + iObserver.AvailabilityChanged( Name(), iState ); + } + MUS_LOG( "mus: [MUSAVA] <- CMusAvaAvailability::SetState" ) + } + + /** + * Returns specific availability state. + * + * @return Availability state. + */ + TBool Available( MMusAvaObserver::TAvailabilityName aAvailability ) + { + return iObserver.Available( aAvailability ); + } + + /** + * Invitation has been received. + */ + virtual void PrepareForReceivedInviteL() + { + MUS_LOG( "mus: [MUSAVA] <-> CMusAvaAvailability::PrepareForReceivedInviteL" ) + } + + virtual ~CMusAvaAvailability() {}; + +protected: + CMusAvaAvailability( MMusAvaAvailabilityObserver& aObserver ) + :iObserver( aObserver ), + iState( MMusAvaObserver::EMusAvaStatusNotExecuted ) {} + +protected: // data + MMusAvaAvailabilityObserver& iObserver; + MMusAvaObserver::TAvailabilityStatus iState; + + MUS_UNITTEST ( CMusAvaAvailabilityStub ) + MUS_UNITTEST ( CMusAvaDefaultImp ) + MUS_UNITTEST ( UT_CMusAvaConnectionAvailability ) + MUS_UNITTEST ( UT_CMusAvaDefaultImp ) + MUS_UNITTEST ( UT_CMusAvaOptionHandler ) + MUS_UNITTEST ( UT_CMusAvaDefaultOptionHandler ) + MUS_UNITTEST ( UT_CMusAvaSettingAvailability ) + }; + + +#endif // __CMUSAVAAVAILABILITY_H__ diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/inc/musavaavailabilityobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/inc/musavaavailabilityobserver.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,64 @@ +/* +* Copyright (c) 2005-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: This observer is used by +* availabilities to observer function from the availability +* +*/ + + + +#ifndef MMUSAVAAVAILABILITYOBSERVER +#define MMUSAVAAVAILABILITYOBSERVER + +#include + +#include "musavaobserver.h" + +/** + * MusAvailability Observer base class + * + * Observer interface for ECOM clients. + * + * @lib musavailabilityplugin.lib + */ + +class MMusAvaAvailabilityObserver + { + +public: + + /** + * Availability report + * + * @param aStatus New status for availability. + */ + virtual void AvailabilityChanged( + MMusAvaObserver::TAvailabilityName aName, + MMusAvaObserver::TAvailabilityStatus aStatus ) = 0; + + virtual void AvailabilityError( + MMusAvaObserver::TAvailabilityName aName, + MMusAvaObserver::TAvailabilityStatus aStatus ) = 0; + + virtual TBool Available( + MMusAvaObserver::TAvailabilityName aAvailability ) = 0; + + + virtual MMusAvaObserver::TAvailabilityStatus + AvailabilityPluginState() = 0; + + }; + + +#endif //MMUSAVAAVAILABILITYOBSERVER diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/inc/musavaavailabilityobserverimp.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/inc/musavaavailabilityobserverimp.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,128 @@ +/* +* 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: This observer is used by +* ECOM clients to get function call from the availability Plug-in +* +*/ + + + +#ifndef __MUSAVAAVAILABILITYOBSERVERIMP_H__ +#define __MUSAVAAVAILABILITYOBSERVERIMP_H__ + +#include "musavaavailabilityobserver.h" +//#include "musavaobserver.h" +#include "musunittesting.h" +#include +#include + +#ifdef MUS_UNITTEST +#undef IMPORT_C +#define IMPORT_C +#endif + +class CMusAvaController; +class MMusAvaObserver; +/** + * MusAvailability Observer base class + * + * Observer interface for ECOM clients. + * + * @lib musavailabilityplugin.lib + * @since S60 v3.2 + */ + +class CMusAvaAvailabilityObserverImp : public CBase, + public MMusAvaAvailabilityObserver + + { +public: + + /** + * Two-phased constructor + * + * @since S60 v3.2 + * @param + * @return Returns pointer to CMusAvaController object + */ + + static CMusAvaAvailabilityObserverImp* NewL( ); + + /** + * Destructor + * + * @since S60 v3.2 + * @param + * @return + */ + + ~CMusAvaAvailabilityObserverImp(); + + protected: + + /** + * Constructor + * + * @since S60 v3.2 + * @return + */ + + CMusAvaAvailabilityObserverImp( ); + + /** + * Perform the second phase construction of a + * CMusAvaController object + * + * @since S60 v3.2 + * @param + * @return + */ + + void ConstructL(); + +// from base class MMusAvaAvailabilityObserver + +public: + + /** + * Availability report + * + * @since S60 v3.2 + * @param aStatus New status for availability. + */ + virtual void AvailabilityChanged( + MMusAvaObserver::TAvailabilityName aName, + MMusAvaObserver::TAvailabilityStatus aStatus ); + + virtual void AvailabilityError( + MMusAvaObserver::TAvailabilityName aName, + MMusAvaObserver::TAvailabilityStatus aStatus ); + + virtual TBool Available( + MMusAvaObserver::TAvailabilityName aAvailability ); + + + virtual MMusAvaObserver::TAvailabilityStatus AvailabilityPluginState(); + + +public: + + MMusAvaObserver::TAvailabilityStatus iStatus; + MMusAvaObserver::TAvailabilityName iName; + MUS_UNITTEST ( UT_CMusAvaDefaultImp ) + }; + + +#endif // __MUSAVAAVAILABILITYOBSERVERIMP_H__ + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/inc/musavacalleventmonitor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/inc/musavacalleventmonitor.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,128 @@ +/* +* Copyright (c) 2005-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: +* +*/ + + + +#ifndef MUSAVACALLEVENTMONITOR_H +#define MUSAVACALLEVENTMONITOR_H + + +#include "musunittesting.h" +#include +#include + +class MMusCallMonitorObserver; + +/** + * this class is listening call monitor P&S keys + * + * @lib musaoplugin.dll + */ +class CMusAvaCallEventMonitor : public CActive + { +public: + + /** + * get call count + * + * @return call count + */ + TInt CallStatusL(); + + /** + * get call Direction + * + * @return call direction + */ + TInt CallDirectionL(); + + + void GetTelNumberL( TDes& aTelNumber, TBool& aIsSipUri ); + + /** + * Start to monitoring call state events + * + */ + void StartMonitoringL(); + + + /** + * Two-phased constructor + * + * @return New CMusAoPlugin instance + */ + static CMusAvaCallEventMonitor* NewL( MMusCallMonitorObserver& aObserver ); + + + /** + * C++ destructor. + */ + virtual ~CMusAvaCallEventMonitor(); + + // from etelmm.h::RMobilePhone::KMaxMobileTelNumberSize + static const TInt KMusTelNumberMaxLength = 100; + +protected: + +// from base class CActive + + /** + * From CActive. + * Cancels an outstanding asynchronous request. + */ + virtual void DoCancel(); + + /** + * From CActive. + * Handles an active object's request completion event. + */ + virtual void RunL(); + + /** + * From CActive. + * Handles a leave error in RunL method. + */ + virtual TInt RunError( TInt aError ); + +private: + + /** + * C++ constructor. + */ + CMusAvaCallEventMonitor( MMusCallMonitorObserver& aObserver ); + + /** + * Symbian second-phase constructor. + */ + void ConstructL(); + + TBool IsSipUri( const TDesC& aTelNumber ) const; + +private: // data + + /** + * properties for P&S + */ + RProperty iPropertyEvent; + + /** + * Reference to the observer object + */ + MMusCallMonitorObserver& iObserver; + }; + +#endif // MUSAVACALLEVENTMONITOR_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/inc/musavacapability.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/inc/musavacapability.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,246 @@ +/* +* Copyright (c) 2005-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: Capability +* +*/ + + +#ifndef CMUSAVACAPABILITY_H +#define CMUSAVACAPABILITY_H + + +#include // CBase +#include +#include +#include +#include "musunittesting.h" +#include "mussettingskeys.h" + +class CMusAvaCapabilityExchange; +class CSIPServerTransaction; +class CSIPHeaderBase; +class CSdpDocument; +class CSIPAcceptContactHeader; +class CSdpFmtAttributeField; +class CSdpAttributeField; +class CSdpOriginField; +class CSdpMediaField; +class RStringF; + +#define CAPABILITY_CONTAINS( tagSet, tag ) ( tagSet.Find( tag ) >= KErrNone ) +_LIT8( KCapabilitySwisFeature, "+g.3gpp.cs-voice"); +_LIT8( KCapabilitySwisApplication, "com.gsma.rts"); +_LIT8( KCapabilitySDPAttributeNameType, "type"); +_LIT8( KCapabilitySDPAttributeType, "videolive"); +_LIT8( KCapabilitySDPAttributeCodecH263, "H263-2000" ); +_LIT8( KCapabilitySwisFormatList, "98 96" ); +_LIT8( KCapabilitySwisFormatListH263Only, "96" ); +_LIT8( KCapabilitySDPAttributeCodecH264, "H264" ); +_LIT8( KCapabilitySDPAttributeFastMode, "fastmode" ); //a=keywds:fastmode, see RFC 4566 + +const TUint64 KCapabilitySDPAttributeClockrate = 90000; +const TUint64 KCapabilitySDPAttributePayloadType = 96; +const TUint64 KCapabilitySDPAttributePayloadTypeH264 = 98; + + +/** + * Capability + * + * @lib musavailabilityplugin.dll + */ +class CMusAvaCapability : public CBase + { + +public: // constructors and destructor + + static CMusAvaCapability* NewL( CMusAvaCapabilityExchange& aExchange ); + virtual ~CMusAvaCapability(); + + +protected: // constructors + + CMusAvaCapability( CMusAvaCapabilityExchange& aExchange ); + + void ConstructL( ); + +public: // new functions + + /** + * Returns exchance + * + * @return exchance + */ + CMusAvaCapabilityExchange& Exchange() const; + + /** + * Returns feature this capability represents + * + * @return feature this capability represents + */ + const RStringF& Feature() const; + + /** + * Checks if capability supports feature, found + * in Accept-Contact header + * + * @param acceptContact accept contact + * @return ETrue, if there is a match + */ + virtual TBool Supports( const CSIPAcceptContactHeader& acceptContact ); + + /** + * Uses for conrolling capability + * + * @return ETrue, if capability is enabled + */ + TBool& Enabled(); + + /** + * Populates response to query + * + * @param aQuery query as SIP server transaction + * @param aResponseHeaders SIP headers container for response + * @param aResponseContent SDP document container for response + */ + virtual void PopulateResponseL( + CSIPServerTransaction& aQuery, + RPointerArray& aResponseHeaders, + CSdpDocument& aResponseContent ); + + +private: + + /** + * Populates response to query + * + * @param aResponseContent SDP document container for response + */ + void DoPopulateResponseL( CSdpDocument& aResponseContent ); + + + +public: //static API + + + /** + * Creates SDP document + * + * @param aQuery received query + * @return SDP document + */ + static CSdpDocument* ResponseContentLC( + const CSIPServerTransaction& aQuery ); + + /** + * Finds and resolves the codecs from SDP document + * + * @return the supported media types + */ + static CDesCArrayFlat* ResolveCodecsL( CSdpDocument& aSDP ); + + /** + * Finds attribute field from SDP document + * + * @param aAttribute attribute name + * @param aSDP SDP document + * @return the attribute + */ + static const CSdpAttributeField* Attribute( const RStringF& aAttribute, + CSdpDocument& aSDP ); + + /** + * Finds attribute field from media part in SDP document + * + * @param aMedia name of the media + * @param aAttribute attribute name + * @param aSDP SDP document + * @return the attribute + */ + static const CSdpAttributeField* Attribute( const RStringF& aMedia, + const RStringF& aAttribute, + CSdpDocument& aSDP ); + + /** + * Finds fast mode value from the SDP document + */ + static MusSettingsKeys::TFastMode ResolveFastModeL( CSdpDocument& aSdp ); + + /** + * Add fast mode related attribute to SDP, if fast mode is supported + */ + static void AddFastModeL( CSdpDocument& aSdp ); + + +public://new functions + + /** + * Adds contact header to response of query + * + * @param aQuery query as SIP server transaction + * @param aResponseHeaders SIP headers container for response + */ + virtual void AddContactHeaderL( + CSIPServerTransaction& aQuery, + RPointerArray& aResponseHeaders ); + + /** + * Creates origin field for sdp + * + * @param aNetType net type + * @param aLocalHost local host + * @param aHostType host type + * @return origin field + */ + static CSdpOriginField* OriginFieldL( const RStringF& aNetType, + const TDesC8& aLocalHost, + const RStringF& aHostType ); + + /** + * Creates media line + * + * @param aMedia name of the media + * @param aFormatList format list + * @return media line + */ + CSdpMediaField* MediaLineLC( const RStringF& aMedia, + const TDesC8& aFormatList ) const; + + + /** + * Creates rtpmap line + * + * @param aCodec name of coded + * @param aPayloadType payload type + * @param aClockRate clockrate + * @param aParams optional params + * @return rtpmap line + */ + static CSdpFmtAttributeField* RtpMapLineLC( const TDesC8& aCodec, + const TUint64 aPayloadType, + const TUint64 aClockRate, + const TDesC8& aParams = KNullDesC8 ); + + +private: + + CMusAvaCapabilityExchange& iExchange; + RStringF iFeature; + TBool iIsEnabled; + + //for unit testing + //MUS_UNITTEST ( UT_ ) + + }; + +#endif // CMUSAVACAPABILITY_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/inc/musavacapabilitybase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/inc/musavacapabilitybase.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,217 @@ +/* +* Copyright (c) 2005-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: Capability +* +*/ + + +#ifndef CMUSAVACAPABILITYBASE_H +#define CMUSAVACAPABILITYBASE_H + + +#include // CBase +#include +#include +#include "musunittesting.h" + + +class CMusAvaCapabilityExchange; +class CSIPServerTransaction; +class CSIPHeaderBase; +class CSdpDocument; +class CSIPAcceptContactHeader; +class CSdpFmtAttributeField; +class CSdpAttributeField; +class CSdpOriginField; +class CSdpMediaField; +class RStringF; + +#define CAPABILITY_CONTAINS( tagSet, tag ) tagSet.Find( tag ) >= KErrNone + +/** + * Capability + * + * @lib musavailabilityplugin.dll + */ +class CMusAvaCapabilityBase : public CBase + { + +public: // constructors and destructor + + virtual ~CMusAvaCapabilityBase(); + + +protected: // constructors + + CMusAvaCapabilityBase( CMusAvaCapabilityExchange& aExchange ); + + void ConstructL( const TDesC8& aFeature ); + +public: // new functions + + /** + * Returns exchance + * + * @return exchance + */ + CMusAvaCapabilityExchange& Exchange() const; + + /** + * Returns feature this capability represents + * + * @return feature this capability represents + */ + const RStringF& Feature() const; + + /** + * Checks if capability supports feature, found + * in Accept-Contact header + * + * @param acceptContact accept contact + * @return ETrue, if there is a match + */ + virtual TBool Supports( const CSIPAcceptContactHeader& acceptContact ); + + /** + * Uses for conrolling capability + * + * @return ETrue, if capability is enabled + */ + TBool& Enabled(); + + /** + * Populates response to query + * + * @param aQuery query as SIP server transaction + * @param aResponseHeaders SIP headers container for response + * @param aResponseContent SDP document container for response + */ + virtual void PopulateResponseL( + CSIPServerTransaction& aQuery, + RPointerArray& aResponseHeaders, + CSdpDocument& aResponseContent ); + + +protected: //abstract methods + + /** + * Populates response to query + * + * @param aQuery query as SIP server transaction + * @param aResponseHeaders SIP headers container for response + * @param aResponseContent SDP document container for response + */ + virtual void DoPopulateResponseL( + CSIPServerTransaction& aQuery, + RPointerArray& aResponseHeaders, + CSdpDocument& aResponseContent ) = 0; + + + +public: //static API + + + /** + * Creates SDP document + * + * @param aQuery received query + * @return SDP document + */ + static CSdpDocument* ResponseContentLC( + const CSIPServerTransaction& aQuery ); + + /** + * Finds codec from SDP document + * + * @param aMedia name of the media + * @param aCodec name of codec + * @param aSDP SDP document + * @return the media line + */ + static const CSdpFmtAttributeField* CodecL( const RStringF& aMedia, + const TDesC8& aCodec, + CSdpDocument& aSDP ); + + /** + * Finds attribute field from SDP document + * + * @param aAttribute atrbute name + * @param aSDP SDP document + * @return the attribute + */ + static const CSdpAttributeField* Attribute( const RStringF& aAttribute, + CSdpDocument& aSDP ); + +protected://new functions + + /** + * Adds contact header to response of query + * + * @param aQuery query as SIP server transaction + * @param aResponseHeaders SIP headers container for response + */ + virtual void AddContactHeaderL( + CSIPServerTransaction& aQuery, + RPointerArray& aResponseHeaders ); + + /** + * Creates origin field for sdp + * + * @param aNetType net type + * @param aLocalHost local host + * @param aHostType host type + * @return origin field + */ + static CSdpOriginField* OriginFieldL( const RStringF& aNetType, + const TDesC8& aLocalHost, + const RStringF& aHostType ); + + /** + * Creates media line + * + * @param aMedia name of the media + * @param aFormatList format list + * @return media line + */ + CSdpMediaField* MediaLineLC( const RStringF& aMedia, + const TDesC8& aFormatList ) const; + + + /** + * Creates rtpmap line + * + * @param aCodec name of coded + * @param aPayloadType payload type + * @param aClockRate clockrate + * @param aParams optional params + * @return rtpmap line + */ + CSdpFmtAttributeField* RtpMapLineLC( const TDesC8& aCodec, + const TUint aPayloadType, + const TUint aClockRate, + const TDesC8& aParams = KNullDesC8 ) const; + + +private: + + CMusAvaCapabilityExchange& iExchange; + RStringF iFeature; + TBool iIsEnabled; + + //for unit testing + //MUS_UNITTEST ( UT_ ) + + }; + +#endif // CMUSAVACAPABILITYBASE_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/inc/musavacapabilitycontext.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/inc/musavacapabilitycontext.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,236 @@ +/* +* Copyright (c) 2005-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: Swis call context +* +*/ + +#ifndef MUSAVACAPABILITYCONTEXT_H +#define MUSAVACAPABILITYCONTEXT_H + +#include +#include "musunittesting.h" + + +const TInt KMUSAVASIP200 = 200; +const TInt KMUSAVASIPServerInternalError = 500; +const TInt KMUSAVASIPNotImplemented = 501; +const TInt KMUSAVASIPForbidden = 403; +const TInt KMUSAVASIPNotFound = 404; +const TInt KMUSAVASIPTimeout = 408; +const TInt KMUSAVASIPUnsupportedURIScheme = 416; +const TInt KMUSAVASIPTemporarilyUnavailable = 480; +const TUint KMUSAVASIPDecline = 603; + +const TInt KMUSAVAMaxLengthOfSDPMessage = 1000; +_LIT8( KMUSAVASIPMediaTypeApplication, "application" ); +_LIT8( KMUSAVASIPMediaSubTypeSDP, "sdp" ); +_LIT8( KMUSAVASIPHeaderUserAgent, "User-Agent" ); +_LIT8( KMUSAVASIPHeaderPAssertedIdentity, "P-Asserted-Identity" ); +_LIT8( KMUSAVASIPParamFalse, "false" ); +_LIT8( KMUSAVASemicolon, ";"); + + +class CSIPServerTransaction; +class RStringF; +class CSdpDocument; +class CSIPMessageElements; +class CSIPTransactionBase; +class CSIPHeaderBase; +class CSIPExtensionHeader; +class CSIPAcceptContactHeader; +class CSIPContactHeader; +class CUri8; + + +class MusAvaCapabilityContext + { +public: // static API + + /** + * Returns SDP string from pool + * + * @param aStringIndex SDP string index + * @return SDP String + */ + static RStringF SDPStringL( TInt aStringIndex ); + + /** + * Creates SDP string to pool + * + * @param aString the string as descriptor + * @return SDP String + */ + static RStringF SDPStringL( const TDesC8& aString ); + + /** + * Creates SIP string to pool + * + * @param aString the string as descriptor + * @return SIP String + */ + static RStringF SIPStringL( const TDesC8& aString ); + + /** + * Resolves local host + * + * @param aQuery query + * @return feature set + */ + static void LocalHostL( const CSIPServerTransaction& aRequest, + TPtrC8& aLocalHost, + RStringF& aHostType); + + /** + * Helper to create uri from descriptor + * + * @param aUri uri as descriptor + * @return uri + */ + static CUri8* ToUriL( const TDesC8& aUri ); + + /** + * Helper to transform SDP document to text + * + * @param aSdpContent SDP document + * @return SDP document as text + */ + static HBufC8* ToTextL( CSdpDocument& aSdpContent ); + + + /** + * Returns message elemensts from request/response + * + * @param aTrx server/client transaction + * @return message elemensts + */ + static const CSIPMessageElements& MessageElementsL( + const CSIPTransactionBase& aTrx ); + + /** + * Creates Accept-Contact header + * + * @param aValue value of header + * @return the header + */ + static CSIPAcceptContactHeader* AcceptContactHeaderLC( RStringF aValue ); + + /** + * returns Accept-Contact header from request/response + * + * @param aTrx request/response + * @return the header + */ + static const CSIPAcceptContactHeader* AcceptContactHeaderL( + const CSIPTransactionBase& aTrx ); + + /** + * Creates Contact header + * + * @param aAddress the address + * @param aValue value of header + * @return the header + */ + static CSIPContactHeader* ContactHeaderLC( const CUri8& aAddress, + RStringF aValue ); + + /** + * Returns Contact header from request/response + * + * @param aTrx request/response + * @return the header + */ + static const CSIPContactHeader* ContactHeaderL( + const CSIPTransactionBase& aTrx ); + + + /** + * Creates User-Agent header + * + * @param aValue value of header + * @return the header + */ + static CSIPExtensionHeader* UserAgentHeaderLC( const TDesC8& aValue ); + + /** + * returns User-Agent header from request/response + * + * @param aTrx request/response + * @return the header + */ + static const CSIPExtensionHeader* UserAgentHeaderL( + const CSIPTransactionBase& aTrx ); + + /** + * Creates P-Asserted-Identity header + * + * @param aValue value of header + * @return the header + */ + static CSIPExtensionHeader* PAssertedIdentityHeaderLC( + const TDesC8& aValue ); + + /** + * Returns originator from request + * + * @param aTrx request + * @return originator's URI + */ + static const CUri8& MusAvaCapabilityContext::OriginatorL( + const CSIPServerTransaction& aTrx ); + + /** + * Finds header from user headers based on header's name + * + * @param aHeaderName name of the header + * @param aMessage SIP message containg user headers + * @param aIndex index of the header in message + * @return the header + */ + static const CSIPHeaderBase* Header( RStringF aHeaderName, + const CSIPMessageElements& aMessage, + TUint aIndex ); + + /** + * Finds header from user headers based on header's name + * + * @param aHeaderName name of the header + * @param aMessage SIP message containg user headers + * @return the header + */ + static const CSIPHeaderBase* Header( RStringF aHeaderName, + const CSIPMessageElements& aMessage ); + /** + * Finds header count from user headers based on header's name + * + * @param aHeaderName name of the header + * @param aMessage SIP message containg user headers + * @return the count + */ + static TUint HeaderCount( RStringF aHeaderName, + const CSIPMessageElements& aMessage ); + + /** + * Finds and returns all P-Asserted-Identity header . + * + * @param aMessage SIP message header. + * @return array which has all P-Asserted-Identity header. + */ + static CDesCArrayFlat* MusAvaCapabilityContext::PAssertedIdentityHeaderL( + const CSIPMessageElements& aMessage ); + //MUS_UNITTEST ( UT_ ) + + }; + + +#endif // MUSAVACAPABILITYCONTEXT_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/inc/musavacapabilityexchange.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/inc/musavacapabilityexchange.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,153 @@ +/* +* Copyright (c) 2005-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: Capability Exchange +* +*/ + +#ifndef CMUSAVACAPABILITYEXCHANGE_H +#define CMUSAVACAPABILITYEXCHANGE_H + +#include // CBase +#include "musunittesting.h" + +class MMusAvaCapabilityQueryObserver; +class CMusAvaCapabilityQueryBase; +class CSIPClientTransaction; +class CSIPServerTransaction; +class CMusAvaTerminal; +class CMusAvaCapability; + +/** + * Capability Exchange + * + * @lib musavailabilityplugin.dll + */ +class CMusAvaCapabilityExchange : public CBase + { + +public: // constructors and destructor + + static CMusAvaCapabilityExchange* NewL( const TDesC8& aTerminalId, + MMusAvaCapabilityQueryObserver& aQueryObserver ); + + virtual ~CMusAvaCapabilityExchange(); + + +private: // constructors + + CMusAvaCapabilityExchange( + MMusAvaCapabilityQueryObserver& aQueryObserver ); + + void ConstructL( const TDesC8& aTerminalId ); + + +public: // new functions + + + /** + * Returns query observer + * + * @return query observer + */ + MMusAvaCapabilityQueryObserver& QueryObserver() const; + + /** + * Returns terminal ID + * + * @return terminal ID + */ + const TDesC8& TerminalId() const; + + /** + * Called when answer to query has been received + * + * @param aResponse SIP client transaction representing + * the response to query + */ + void AnswerToQueryReceived( const CSIPClientTransaction& aResponse ); + + /** + * Called when capability query has been received + * + * @param aQuery SIP server transaction representing + * a capability query, ownership is transferred + */ + void QueryReceived( CSIPServerTransaction* aQuery ); + + /** + * Called when capability query has been canceled + * + * @param aError system wide or SIP error code + * @param aTransaction SIP client transaction + */ + void CancelQuery( TInt aError, const CSIPClientTransaction& aTransaction ); + + +public: // new functions + + + /** + * Adds capability + * + * @param aCapability a capability, ownership is transferred + */ + void AddCapabilityL( CMusAvaCapability* aCapability ); + + /** + * Returns all discovered terminals + * + * @return all discovered terminals + */ + const RPointerArray& Terminals(); + + /** + * Returns all capabilities + * + * @return all capabilities + */ + const RPointerArray& Capabilities(); + + +public: // for internal use only + + /** + * Returns terminal based on remote URI + * + * @return terminal based on remote URI + */ + CMusAvaTerminal& TerminalL( const TDesC8& aRemoteUri ); + + +private: // new functions + + CMusAvaTerminal& TerminalL( const CSIPServerTransaction& aQuery ); + void DoQueryReceivedL( CSIPServerTransaction& aQuery ); + void RejectQueryL( CSIPServerTransaction& aQuery, + TInt aError ); + TInt FindByFeature( CMusAvaCapability& aCapablity ); + + +private: // data + + MMusAvaCapabilityQueryObserver& iQueryObserver; + HBufC8* iTerminalId; + RPointerArray iTerminals; + RPointerArray iCapabilities; + + MUS_UNITTEST ( UT_CMusAvaCapabilityExchange ) + MUS_UNITTEST ( UT_CMusAvaCapabilitySipAgent ) + }; + + +#endif // CMUSAVACAPABILITYEXCHANGE_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/inc/musavacapabilityquery.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/inc/musavacapabilityquery.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,150 @@ +/* +* 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: Sent SWIS capability query (OPTIONS) +* +*/ + + +#ifndef CMUSAVACAPABILITYQUERY_H +#define CMUSAVACAPABILITYQUERY_H + + +#include "musavacapabilityquerybase.h" +#include "musavacapabilitytimer.h" + +class CSIPResponseElements; +class CMusAvaCapability; +class CSdpDocument; + +const TInt KCapabilityTimervalue = 20 * 1000000; + +/** + * Sent SWIS capability query (OPTIONS) + * + * @lib AlwaysOnlineSwisPlugin.dll + */ +class CMusAvaCapabilityQuery : public CMusAvaCapabilityQueryBase, + public CMusAvaCapabilityTimer::MTimeOutNotify + { + +public: // constructors and destructor + + static CMusAvaCapabilityQuery* NewL( CMusAvaCapability& aCapability, + CSIPConnection& aSIPConnection, + CSIPProfile& aProfile, + const TDesC& aSipAddress ); + + + virtual ~CMusAvaCapabilityQuery(); + + +protected: // constructors + + CMusAvaCapabilityQuery( CMusAvaCapability& aCapability, + CSIPConnection& aSIPConnection, + CSIPProfile& aProfile ); + + void ConstructL( const TDesC& aSipAddress ); + + +public: // from CMusAvaCapabilityTimer::MTimeOutNotify + + /** + * Called when timer expires + * + * @param aStatus status + */ + void OnExpiredL( TInt aStatus ); + + +protected: // from CMusAvaCapabilityQueryBase + + /** + * Prepares query + * + * @param aRequestHeaders headers container for request + */ + void Prepare( RPointerArray& aRequestHeaders ); + + /** + * Complets the query + * + * @param aResponse a response to query as SIP client transaction + */ + void DoCompletedL( const CSIPClientTransaction& aResponse ); + + /** + * Complets the query with 200 OK + * + * @param aResponse a response to query as SIP client transaction + */ + virtual void DoCompleted200OKL( + const CSIPClientTransaction& aResponse ); + + /** + * Validates and store the supported codecs + * + * @param aSDP SDP document + * @return ETrue, if validation is OK + */ + virtual TBool ValidateAndStoreCodecsL( CSdpDocument& aSDP ); + + + /** + * Validates atributes + * + * @param aSDP SDP document + * @return ETrue, if OK + */ + virtual TBool ValidateAttributesL( CSdpDocument& aSDP ); + + /** + * Validates Contact header parameters + * + * @param aResponse a response to query as SIP client transaction + * @return ETrue, if OK + */ + virtual TBool ValidateContactL( const CSIPClientTransaction& aResponse ); + + /** + * Retries query + * + */ + void DoRetryL(); + + /** + * Set/Get re-trying status + * + * @return re-trying status + */ + TBool& Retrying(); + + +private: // OWNED data + + + CMusAvaCapabilityTimer* iTimer; + + +private: // data + + TBool iRetrying; + +//for unit testing + CAPABILITY_UT_DEFINITIONS + + }; + + +#endif // CMUSAVACAPABILITYQUERY_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/inc/musavacapabilityquerybase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/inc/musavacapabilityquerybase.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,224 @@ +/* +* 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: Sent capability query (OPTIONS) +* +*/ + + +#ifndef CMUSAVACAPABILITYQUERYBASE_H +#define CMUSAVACAPABILITYQUERYBASE_H + + +#include // CBase + +#ifdef CAPABILITY_UNIT_TESTING +#include "capabilitytestdefs.h" +#else +#define CAPABILITY_UT_DEFINITIONS +#endif + + + +class CMusAvaCapability; +class CSIPConnection; +class CSIPProfile; +class CSdpDocument; + +class CSIPClientTransaction; +class CMusAvaTerminal; +class CSIPHeaderBase; +class CUri8; + +const TInt KCapabilityQueryNotReady = 0; +const TInt KCapabilityCapabilitesReady = 1; +const TInt KCapabilityCapabilitesNotFound = 2; +const TInt KCapabilityCapabilitiesForbidden = 3; + + +/** + * Sent capability query (OPTIONS) + * + * @lib AlwaysOnlineSwisPlugin.dll + */ +class CMusAvaCapabilityQueryBase : public CBase + { + +public: + + enum TState + { + ECapabilityQueryCreated, + ECapabilityQueryPrepared, + ECapabilityQueryExecuting, + ECapabilityQueryCompleted + }; + +public: // constructors and destructor + + virtual ~CMusAvaCapabilityQueryBase(); + + +protected: // constructors + + CMusAvaCapabilityQueryBase( CMusAvaCapability& aCapability, + CSIPConnection& aSIPConnection, + CSIPProfile& aProfile ); + + + void ConstructL( const TDesC& aSipAddress ); + +public: // new functions + + /** + * Executes OPTIONS query + * + */ + virtual void ExecuteL(); + + /** + * Complets the query + * + * @param aResponse a response to query as SIP client transaction + */ + void CompletedL( const CSIPClientTransaction& aResponse ); + + /** + * Cancels query, if transaction is created by this query + * + * @param aResponse a response to query as SIP client transaction + */ + void Canceled( const CSIPClientTransaction& aTransaction ); + + /** + * Returns associated terminal + * + * @return returns associated terminal + */ + CMusAvaTerminal& Terminal(); + + /** + * Returns the sdp content. + * + */ + HBufC8* ContentLC(); + + + +public: // new functions + + /** + * Returns state of query + * + * @return state of query + */ + TState State() const; + + /** + * Returns result of query + * + * @return result of query + */ + TInt Result() const; + + +protected: // abstract functions + + /** + * Prepares query + * + * @param aRequestHeaders headers container for request + */ + virtual void Prepare( RPointerArray& aRequestHeaders ) = 0; + + /** + * Complets the query + * + * @param aResponse a response to query as SIP client transaction + */ + virtual void DoCompletedL( const CSIPClientTransaction& aResponse ) = 0; + + +protected: // new functions + + /** + * Returns capablity, which is beed queried + * + * @return capablity + */ + const CMusAvaCapability& Capability() const; + + /** + * Sets state + * + * @param aState new state + */ + void SetState( TState aState ); + + /** + * Sets result + * + * @param aResult the result + */ + void SetResult( TInt aResult ); + + /** + * Adds Contact header to request's user headers + * + * @param aRequestHeaders request's user headers + */ + virtual void AddContactHeaderL( RPointerArray& aRequestHeaders ); + + /** + * Resets and destroys transaction + */ + void ResetAndDestroyTrx(); + + /** + * Returns local address based on profile + * + * @return local adderss + */ + const CUri8& LocalAddress() const; + + /** + * Some Multimediasharing specific sdp contents are added. + * + */ + void OtherSDPHeadersL( CSdpDocument& aResponseContent ); + + +private: // NOT own data + + CMusAvaCapability& iCapability; + CSIPConnection& iSIPConnection; + CSIPProfile& iProfile; + + TState iState; + TInt iResult; + + CMusAvaTerminal* iTerminal; + +private: // own data + + CUri8* iRegisteredContact; + CUri8* iOriginator; + CSIPClientTransaction* iTrx; + +//for unit testing + CAPABILITY_UT_DEFINITIONS + + }; + + +#endif // CMUSAVACAPABILITYQUERYBASE_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/inc/musavacapabilitysipagent.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/inc/musavacapabilitysipagent.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,169 @@ +/* +* 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: SIP event handling class +* +*/ + + +#ifndef CMUSAVACAPABILITYSIPAGENT_H +#define CMUSAVACAPABILITYSIPAGENT_H + + +#include // CBase +#include "musunittesting.h" +#include "musavasipadapter.h" +#include "musavasipconnectionadapter.h" +#include "musavaavailabilityobserver.h" + + +class CMusAvaSharedObject; +class CSIPConnection; +class CSIPDialog; +class CSIPProfile; +class CSIPProfileRegistry; +class CSIPServerTransaction; +class CMusAvaCapabilityExchange; +class CMusAvaCapability; + +/** + * SIP event handling class + * + * @lib AlwaysOnlineSwisPlugin.dll + */ +class CMusAvaCapabilitySipAgent : + public CBase, + public MMusAvaSipAdapter, + public MMusAvaSipConnectionAdapter + { + +private: + + /** SIP connection state */ + + enum TSipConnectionState + { + /** Connection state unknown */ + ESipConnUnknown = 0, + /** Connection initializing */ + ESipConnInit, + /** Connection active */ + ESipConnActive, + /** Connection suspended */ + ESipConnSuspended, + /** Connection is inactive */ + ESipConnInactive, + /** Connection is permanently unavailable */ + ESipConnUnavailable + }; + + +public: // constructors and destructor + + static CMusAvaCapabilitySipAgent* NewL( + CMusAvaCapabilityExchange& aCapabilityExchange, + CMusAvaSharedObject& aSharedObject, + MMusAvaAvailabilityObserver& aAvaObserver ); + + virtual ~CMusAvaCapabilitySipAgent(); + + +private: // constructors + + CMusAvaCapabilitySipAgent( CMusAvaCapabilityExchange& aCapabilityExchange, + CMusAvaSharedObject& aSharedObject, + MMusAvaAvailabilityObserver& aAvaObserver ); + + +public: // new functions + + /** + * Executes capability query + * + *@param aCapability capability to query + *@param aSipAddress remote part address + */ + void ExecuteCapabilityQueryL( CMusAvaCapability& aCapability, + const TDesC& aSipAddress ); + + +public: // functions from base class MSIPObserver + + /** + * A SIP request has been received from the network. + * This function is called when the SIP request was received using such + * an IAP, for which the application has not created a CSIPConnection + * object. + * @pre aTransaction != 0 + * @param aIapId The IapId from which the SIP request was received. + * @param aTransaction contains local address, remote address of a SIP + * message, as well as optional SIP message method, headers and + * body. The ownership is transferred. + */ + TInt IncomingRequest( TUint32 aIapId, + CSIPServerTransaction* aTransaction ); + + /** + * The received SIP request time-outed and it has been destroyed. + * This will be called if the user fails to create a SIP + * connection and does not send an appropriate SIP response. + * @param aTransaction The time-outed transaction. + */ + TInt TimedOut( CSIPServerTransaction& /* aTransaction */ ); + + +public: // functions from base class MMusAvaSipConnectionAdapter + + /** + * A SIP request outside a dialog has been received from the + * network. + */ + TInt IncomingRequest( CSIPServerTransaction* aTransaction ); + + /** + * A SIP response received from the network. + * + * @param aTransaction contains response elements. + */ + TInt IncomingResponse (CSIPClientTransaction& aTransaction); + + /** + * An asynchronous error has occurred in the stack related to the + * request indicated by the given transaction. + * + * @param aError system wide or SIP error code + * @param aTransaction failed transaction + * @param aSIPConnection a SIP connection + */ + TInt ErrorOccured (TInt aError, CSIPTransactionBase& aTransaction ); + +private: + /** + * Handle incoming SIP request + * @param aTransaction incoming transaction + */ + void HandleIncomingRequestL( CSIPServerTransaction& aTransaction ); + +private: // data + + CSIPConnection* iSipConnection; + CMusAvaCapabilityExchange& iCapabilityExchange; + CMusAvaSharedObject& iSharedObj; + MMusAvaAvailabilityObserver& iAvailabilityObserver; + + MUS_UNITTEST ( UT_CMusAvaCapabilitySipAgent ) + + }; + + +#endif // CMUSAVACAPABILITYSIPAGENT_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/inc/musavacapabilitytimer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/inc/musavacapabilitytimer.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,63 @@ +/* +* 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: Timer +* +*/ + +#ifndef CMUSAVACAPABILITYTIMER_H +#define CMUSAVACAPABILITYTIMER_H + +#include + +/** +* Timer class. +* +* @lib +*/ +class CMusAvaCapabilityTimer : public CTimer + { + +public: // timer observer + + class MTimeOutNotify + { + public: + virtual void OnExpiredL( TInt aStatus ) = 0; + }; + + +public: // constructors and destructor + + static CMusAvaCapabilityTimer* NewL( MTimeOutNotify& aNotify ); + ~CMusAvaCapabilityTimer(); + +protected: // From CTimer + + void RunL(); + +private: + + CMusAvaCapabilityTimer( const TInt aPriority, MTimeOutNotify& aNotify ); + + void ConstructL(); + +private: + + MTimeOutNotify* iNotify; + + }; + +#endif // CMUSAVACAPABILITYTIMER_H + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/inc/musavaclientresolverutil.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/inc/musavaclientresolverutil.h Thu Jul 22 16:32:26 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: Utility class to handle SIP client resolver cenrep table. +* +*/ + + + + +#ifndef MUSAVACLIENTRESOLVERUTIL_H +#define MUSAVACLIENTRESOLVERUTIL_H + +#include + +class CRepository; +class CSIPProfile; + +/** + * Utility class to handle SIP client resolver cenrep table. + * This class must be used in __VOIP enabled builds in order to use common + * SIP client resolver plugin with VoIP. + * + * @code + * clientResolver = CMusAvaClientResolverUtil::NewLC(); + * clientResolver->RegisterClientWithUserL( + * KImplementation, iContactHeaderUser, KResolver ); + * CleanupStack::PopAndDestroy( clientResolver ); + * @endcode + * + */ +NONSHARABLE_CLASS( CMusAvaClientResolverUtil ) : public CBase + { +public: + + /** + * Two-phased constructor. + */ + static CMusAvaClientResolverUtil* NewL(); + /** + * Two-phased constructor. + */ + static CMusAvaClientResolverUtil* NewLC(); + + /** + * Destructor. + */ + virtual ~CMusAvaClientResolverUtil(); + + /** + * Register to SIP client resolver to be able to receive incoming sessions. + * + * @param aProfile + */ + void RegisterClientWithUserL( CSIPProfile& aProfile ) const; + + /** + * Register to SIP client resolver to be able to receive incoming sessions. + * + * @param aImplementation UID of client who handles incoming session + * @param aProfileContactHeaderUser Globally unique identifier of SIP profile + * @param aResolver UID of client resolver plug-in + */ + void RegisterClientWithUserL( + const TUid& aImplementation, + const TDesC8& aProfileContactHeaderUser, + const TUid& aResolver ) const; + + /** + * Un-register from SIP client resolver to deny accepting incoming sessions. + * + * @param aProfile + */ + void UnRegisterClientWithUserL( CSIPProfile& aProfile ) const; + + /** + * Un-register from SIP client resolver to deny accepting incoming sessions. + * + * @param aImplementation UID of client who handles incoming session + * @param aProfileContactHeaderUser Globally unique identifier of SIP profile + */ + void UnRegisterClientWithUserL( + const TUid& aImplementation, + const TDesC8& aProfileContactHeaderUser ) const; + + /** + * Resolve implementation Uid for incoming session. + * + * @param aImplementation UID of client who handles incoming session + * @param aProfileContactHeaderUser Globally unique identifier of SIP profile + */ + void GetImplementationUidWithUserL( + const TDesC8& aProfileContactHeaderUser, + TUid& aImplementation ) const; + + +private: + + /** + * C++ default constructor. + */ + CMusAvaClientResolverUtil(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + /** + * Finds all rows that match given search criterias. + * + * @param aImplementation UID of client who handles incoming session + * @param aProfileContactHeaderUser Globally unique identifier of SIP profile + * @param aFoundKeys On return contains keys that matched requested rows + * @return + */ + void GetClientWithUserL( + const TUid& aImplementation, + const TDesC8& aProfileContactHeaderUser, + RArray& aFoundKeys ) const; + + /** + * Creates unique key + * + * @param aNewKey New unique key to be used when inserting row to table + * @return + */ + void CreateNewKeyL( TUint32& aNewKey ) const; + + /** + * Gets Protocol Profile's User name from Contact header + * @param aProfile + * @param aContactHeaderUser + * @return KErrNone if succeed. + */ + TInt GetContactHeaderUser( CSIPProfile& aProfile, + RBuf8& aContactHeaderUser ) const; + + +private: // data + + /** + * Instance of central repository + * Own. + */ + CRepository* iRepository; + + }; + +#endif // C_SIPCLIENTRESOLVERUTILS_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/inc/musavaconnectionavailability.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/inc/musavaconnectionavailability.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,192 @@ +/* +* Copyright (c) 2005-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: Provide interface for the client requestin network availability. +* +*/ + + + +#ifndef __MUSAVACONNECTIONAVAILABILITY_H__ +#define __MUSAVACONNECTIONAVAILABILITY_H__ + + +#include "musavaavailability.h" +#include "musavatelephonystatusobserver.h" +#include "musavaconnectionmonitorobserver.h" +#include "musunittesting.h" +#include +#include + +class MMusAvaObserver; +class CMusAvaSharedObject; +class CMusAvaConnectionMonitor; +class CConnMonEventBase; +class CMusAvaNetworkRegistrationStatus; +class CMusAvaNetworkModeStatus; +class TAvailabilityStatus; +class CMusAvaSettingsImp; +class TMobilePhoneRegistrationStatus; + + +/** + * Implemets register vailability. + * + * Provide interface for the client to availability class. + * + * @lib musavailabilityplugin.lib + * @since S60 v3.2 + */ +class CMusAvaConnectionAvailability : public CMusAvaAvailability, + public MMusAvaTelephonyStatusObserver, + public MMusAvaConnectionMonitorObserver + { + public: + /** + * Two-phased constructor + * + * @since S60 v3.2 + * @param aObserver Pointer to observer intercase + * @param aName availability name + * @param aModules is data container + * @return Returns pointer to CMusAvaInterface object + */ + static CMusAvaConnectionAvailability* NewL( MMusAvaAvailabilityObserver& aObserver, + CMusAvaSettingsImp& aSettings ); + + static CMusAvaConnectionAvailability* NewLC( MMusAvaAvailabilityObserver& aObserver, + CMusAvaSettingsImp& aSettings ); + + /** + * Destructor + */ + + ~CMusAvaConnectionAvailability(); + +protected: + + CMusAvaConnectionAvailability( MMusAvaAvailabilityObserver& aObserver, + CMusAvaSettingsImp& aSettings ); + + void ConstructL(); + +// from base class CMusAvaAvailability + +public: + + /** + * Executes for the availability. + * + * @since S60 v3.2 + * @return KErrNone if ExecutePatternL operation was + * successfully executed; system wide error otherwise + */ + virtual void DoExecuteL(); + + /** + * Stop the execution. + */ + virtual void Stop(); + + /** + * From CMusAvaAvailability. + * Returns availability name. + * + * @return Name of *this* availability. + */ + virtual MMusAvaObserver::TAvailabilityName Name(); + +public: // from MMusAvaTelephonyStatusObserver + + /** + * Current Network Mode Status + * + * @since S60 v3.2 + * @return + */ + void PhoneNetworkModeStatus( + RMobilePhone::TMobilePhoneNetworkMode aStatus ); + /** + * Current Network Registration Status + * + * @since S60 v3.2 + * @return + */ + void NetworkRegistrationStatus( + RMobilePhone::TMobilePhoneRegistrationStatus aRegStatus ); + +public: //from MMusAvaConnectionMonitorObserver + + /** + * Event from connection monitor server + * + */ + void EventL(const CConnMonEventBase& aConnMonEvent); + + + +private: + + /** + * Check needs to have manual activation + * + * @since S60 v3.2 + * @return TAvailabilityStatus is returned + */ + MMusAvaObserver::TAvailabilityStatus ManualActivationL(); + + /** + * Current test network registration agains the settings + * + * @since S60 v3.2 + * @return TAvailabilityStatus is returned + */ + MMusAvaObserver::TAvailabilityStatus NetworkRegistrationAndSettingsL(); + +private: // data + + /** + * Pointer to CMusAvaNetworkRegistrationStatus object + */ + CMusAvaNetworkRegistrationStatus* iNetworkRegistrationStatus; + + /** + * Pointer to CMusAvaNetworkModeStatus object + */ + CMusAvaNetworkModeStatus* iNetworkModeStatus; + + /** + * Pointer to CMusAvaConnectionMonitor object + */ + CMusAvaConnectionMonitor* iConnectionMonitor; + + /** + * Pointer to CMusAvaSharedObject + */ + CMusAvaSharedObject* iSharedObj; + + /** + * Connection ID + */ + TUint iConnectionID; + + /** + * Reference to availability settings + */ + CMusAvaSettingsImp& iSettings; + + MUS_UNITTEST( UT_CMusAvaConnectionAvailability ) + }; + + +#endif // __MUSAVACONNECTIONAVAILABILITY_H__ diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/inc/musavaconnectionmonitor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/inc/musavaconnectionmonitor.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,227 @@ +/* +* 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: Provide interface for the client requestin network availability. +* +*/ + + +#ifndef __MUSAVACONNECTIONMONITOR_H__ +#define __MUSAVACONNECTIONMONITOR_H__ + +#include "musavaavailability.h" +#include "musunittesting.h" + +#include +#include +#include + + +class MMusAvaAvailabilityObserver; +class MMusAvaObserver; +class CMusAvaSharedObject; +class CMusAvaPhoneStatus; +class CConnMonEventBase; +class MMusAvaConnectionMonitorObserver; + +/** + * Implemets register vailability. + * + * Provide interface for the client to availability class. + * + * @lib musavailabilityplugin.lib + * @since S60 v3.2 + */ + + + +class CMusAvaConnectionMonitor : public CBase, + public MConnectionMonitorObserver + { + public: + /** + * Two-phased constructor + * + * @since S60 v3.2 + * @param aSharedObject reference to CMusAvaSharedObject + * @return Returns pointer to CMusAvaInterface object + */ + + static CMusAvaConnectionMonitor* NewL( CMusAvaSharedObject& aSharedObject ); + + /** + * Destructor + * + * @since S60 v3.2 + * @param + * @return + */ + + ~CMusAvaConnectionMonitor(); + + protected: + + /** + * Constructor + * + * @since S60 v3.2 + * @param aSharedObject reference to CMusAvaSharedObject + * @return + */ + + CMusAvaConnectionMonitor( CMusAvaSharedObject& aSharedObject ); + + + + /** + * Perform the second phase construction of a + * CMusAvaConnectionMonitor object + * + * @since S60 v3.2 + * @param + * @return + */ + + void ConstructL(); + +public: // from MConnectionMonitorObserver + + /** + * Event from connection monitor server + * + */ + void EventL(const CConnMonEventBase& aConnMonEvent); + +public: + + /** + * + * + * @since S60 v3.2 + * @param + */ + void AddAdapterL( MMusAvaConnectionMonitorObserver& aAdapter ); + + /** + * Test Current bearer type + * + * @since S60 v3.2 + * @return ETrue if bearer type is activated, + * EFalse otherwise + */ + TBool BearerType( TInt aBearer = EBearerWCDMA ); + + + /** + * Created connection ID for multimedia sharing is returned + * + * @since S60 v3.2 + * @return KErrNone if parameter was not found, + * Connection ID otherwise + */ + TUint CreatedConnectionID(); + + + /** + * Store connection ID + * + * @since S60 v3.2 + */ + void SetConnectionID( TUint aConnectionID ); + + /** + * Active connection ID for multimedia sharing is returned. + * + * @since S60 v3.2 + * @return KErrNotFound if parameter was not found, + * Connection ID otherwise + */ + TUint ConnectionIDL(); + + /** + * + * + * @since S60 v3.2 + * @param + */ + TBool KillPdpContext(); + + /** + * + * + * @since S60 v3.2 + * @param + */ + void RemoveAdapter( MMusAvaConnectionMonitorObserver& aAdapter ); + + /** + * + * + * @since S60 v3.2 + * @param + */ + void NotifyEventL(); + + /** + * Active connection count for multimedia sharing is returned. + * + * @since S60 v3.2 + * @return KErrNotFound if parameter was not found, + * Connection count otherwise + */ + + TUint ConnectionCount(); + + /** + * Active Access Point ID for multimedia sharing is returned + * + * @since S60 v3.2 + * @return KErrNotFound if parameter was not found, + * Access Point ID otherwise + */ + TUint MultimediaSharingAccessPointID(); + +private: + + + /** + * Session to connection monitor server + */ + RConnectionMonitor iConnectionMonitor; + + /** + * Array of MMusAvaConnectionMonitorObserver instances + */ + RPointerArray iConnectionMonitorObserver; + + /** + * Pointer to CMusAvaSharedObject + */ + CMusAvaSharedObject* iSharedObj; + + /** + * Connection ID + */ + TUint iConnectionID; + + /** + * Profile ID + */ + TUint32 iProfileId; + + MUS_UNITTEST( UT_CMusAvaConnectionMonitor ) + MUS_UNITTEST( UT_CMusAvaConnectionAvailability ) + }; + + +#endif // __MUSAVACONNECTIONMONITOR_H__ diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/inc/musavaconnectionmonitorobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/inc/musavaconnectionmonitorobserver.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,49 @@ +/* +* 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: This observer is used to get function call +* from the ConnectionMonitor +* +*/ + + +#ifndef __MMUSAVACONNECTIONMONITOROBSERVER_H__ +#define __MMUSAVACONNECTIONMONITOROBSERVER_H__ + +#include "musavaobserver.h" + +class CConnMonEventBase; +/** + * ConnectionMonitor Observer base class + * + * Observer interface for ConnectionMonitor. + * + * @lib musavailabilityplugin.lib + * @since S60 v3.2 + */ + +class MMusAvaConnectionMonitorObserver + { + +public: + + /** + * Event from connection monitor server + * + */ + virtual void EventL(const CConnMonEventBase& aConnMonEvent) = 0; + + }; + + +#endif //__MMUSAVACONNECTIONMONITOROBSERVER_H__ diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/inc/musavacontactavailability.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/inc/musavacontactavailability.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,140 @@ +/* +* Copyright (c) 2005-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: Provide interface for the client requestin network availability. +* +*/ + + +#ifndef __MUSAVACONTACTAVAILABILITY_H__ +#define __MUSAVACONTACTAVAILABILITY_H__ + +#include "musavaavailability.h" +#include "musunittesting.h" +#include "mussettingskeys.h" + +#include + +class MMusAvaAvailabilityObserver; +class MMusAvaObserver; +class CMusAvaSharedObject; +class CContactIdArray; +class CContactItem; +class CMusAvaSettingsImp; + + +/** + * Implemets register vailability. + * + * Provide interface for the client to availability class. + * + * @lib musavailabilityplugin.lib + */ +class CMusAvaContactAvailability : public CMusAvaAvailability + { + +public: + + /** + * Two-phased constructor. + * + * @param aObserver Pointer to observer interface. + * @param aSettings Reference to settings object. + * @return Returns pointer to CMusAvaInterface object. + */ + static CMusAvaContactAvailability* NewL( + MMusAvaAvailabilityObserver& aObserver, + CMusAvaSettingsImp& aConcreteSettings ); + + /** + * Two-phased constructor. + * + * @param aObserver Pointer to observer interface. + * @param aSettings Reference to settings object. + * @return Returns pointer to CMusAvaInterface object. + */ + static CMusAvaContactAvailability* NewLC( + MMusAvaAvailabilityObserver& aObserver, + CMusAvaSettingsImp& aConcreteSettings ); + + /** + * Destructor + */ + ~CMusAvaContactAvailability(); + + +protected: + + CMusAvaContactAvailability( MMusAvaAvailabilityObserver& aObserver, + CMusAvaSettingsImp& aConcreteSettings ); + + void ConstructL(); + + +public: // from base class CMusAvaAvailability + + /** + * Executes for the availability. + */ + virtual void DoExecuteL(); + + /** + * From CMusAvaAvailability. + * Returns availability name. + * + * @return Name of *this* availability. + */ + virtual MMusAvaObserver::TAvailabilityName Name(); + +private: + + /** + * + */ + TBool ActiveCallL( CDesCArrayFlat*& aContactsArray ); + + + /** + * + */ + TBool ResolveAddressesL( const TDesC& aContactId, + CDesCArrayFlat*& aContactsArray ); + + +private: + + /** + * resolved contact name + */ + HBufC* iContactName; + + /** + * Pointer to CMusAvaSharedObject object + */ + CMusAvaSharedObject* iSharedObj; + + CMusAvaSettingsImp& iSettings; + + /** + * Flag indicating if the contact name should begin + * with first name or last name + */ + TBool iBeginWithFirstName; + + MusSettingsKeys::TOperatorVariant iOperatorVariant; + + MUS_UNITTEST( UT_CMusAvaContactAvailability ) + }; + + +#endif // __MUSAVACONTACTAVAILABILITY_H__ diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/inc/musavadefaultimp.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/inc/musavadefaultimp.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,222 @@ +/* +* 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: This is default implementation class for CMusAvaInterface +* +*/ + + +#ifndef __MUSAVADEFAULTIMP_H__ +#define __MUSAVADEFAULTIMP_H__ + +// USER +#include "musavainterface.h" +#include "musavaavailabilityobserver.h" +#include "musunittesting.h" + +// SYSTEM +#include +#include + +class MMusAvaObserver; +class CMusAvaSettingsImp; +class CMusAvaSettings; +class CMusAvaSharedObject; +class CMusAvaAvailability; +class MMusAvaAvailabilityObserver; +class MMusAvaSettingsObserver; + +/** + * CMusAvaDefaultImp class represent the interface of application. + * + * It accept request from the API for creating the corresponding + * availability report. + * + * @lib musavailabilityplugin.lib + */ +class CMusAvaDefaultImp : public CMusAvaInterface, + private MMusAvaAvailabilityObserver + { + public: // Constructors and destructor + + /** + * Two-phased constructor + * + * @return Returns pointer to CMusAvaDefaultImp object + */ + static CMusAvaDefaultImp* NewL(); + + /** + * Destructor + * + */ + ~CMusAvaDefaultImp(); + + protected: // Constructors + + /** + * Constructor + * + * @param aObserver Pointer to observer intercase + */ + CMusAvaDefaultImp( ); + + /** + * Perform the second phase construction of a + * CMusAvaDefaultImp object + * + */ + void ConstructL(); + + + protected: + + + /** + * Create availability setting. + * + */ + void CreateAvailabilityModulesL(); + + + /** + * Create work for executing availability report. + * + */ + void ExecuteAvailablitityModules(); + + /** + * Create handler (Invite/Options) availability module. + * + */ + void ConstuctHandlerAvailabilityModulesL(); + + /** + * Create static ( Sipprofile / activation ) availability module. + * + */ + void ConstructStaticAvailabilityModulesL(); + + /** + * Create dynamic ( call / network / bearer ) availability module. + * + */ + void ConstructDynamicAvailabilityModulesL(); + + + public: // from base class CMusAvaInterface + + /** + * Called by the ECOM framework when MusAvailability Plug-in is request + * retuns setting interface for the client. + * + */ + virtual MMusAvaSettings& Settings(); + + /** + * Called by the ECOM framework when MusAvailability Plug-in is for + * Observer interface for the client. + * + * @since S60 v3.2 + * @param aObserver bserver interface + */ + virtual void SetObserver( MMusAvaObserver& aObserver ); + + /** + * Called by the ECOM framework when MusAvailability Plug-in is for + * setting Observer interface for the client. + * + * @since S60 v3.2 + * @param aObserver MMusAvaSettingsObserver interface + */ + virtual void SetSettingsObserver( MMusAvaSettingsObserver& aObserver ); + + /** + * Called by the ECOM framework when MusAvailability Plug-in is request + * to investigate availabilites for the client. + * + */ + virtual void StartL(); + + /** + * Called by the ECOM framework when MusAvailability Plug-in is request + * to stop investigate or monitoring availabilites for the client. + * + */ + virtual void Stop(); + + void CalculateAvailability(); + virtual MMusAvaObserver::TAvailabilityName CurrentAvailability(); + virtual MMusAvaObserver::TAvailabilityStatus AvailabilityStatus(); + virtual TBool MinimumAvailability(); + virtual TBool MandatoryAvailability(); + virtual TBool ExtensionAvailability(); + virtual MMusAvaObserver::TAvailabilityStatus AvailabilityState( MMusAvaObserver::TAvailabilityName aAvailability ); + virtual void PrepareForReceivedInviteL(); + + public: // from base class MMusAvaAvailabilityObserver + + /** + * Availability report + * + * @param aName Availability name + * @param aStatus Current availability Status + */ + virtual void AvailabilityChanged( + MMusAvaObserver::TAvailabilityName aName, + MMusAvaObserver::TAvailabilityStatus aStatus ); + + /** + * Availability error report + * + * @param aName Availability name + * @param aStatus Current availability Status + */ + virtual void AvailabilityError( + MMusAvaObserver::TAvailabilityName aName, + MMusAvaObserver::TAvailabilityStatus aStatus ); + + virtual TBool Available( MMusAvaObserver::TAvailabilityName aAvailability ); + + virtual MMusAvaObserver::TAvailabilityStatus AvailabilityPluginState(); + + + private: // data + + RPointerArray iAvailabilities; + + /** + * Pointer to Observer interface for the ECOM Client + */ + MMusAvaObserver* iObserver; + + /** + * Pointer to CMusAvaSettings object + */ + CMusAvaSettingsImp* iSettings; + + MMusAvaObserver::TAvailabilityName iCurrentAvailability; + MMusAvaObserver::TAvailabilityStatus iAvailabilityStatus; + + TBool iStopping; + TBool iExecuteStarted; + + TInt iForbidden; + + MUS_UNITTEST( UT_CMusAvaDefaultImp ) + + }; + + +#endif // __MUSAVADEFAULTIMP_H__ + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/inc/musavadefaultoptionhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/inc/musavadefaultoptionhandler.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,324 @@ +/* +* Copyright (c) 2005-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: Provide interface for the client requestin network availability. +* +*/ + + + +#ifndef __MUSAVADEFAULTOPTIONEHANDLER_H__ +#define __MUSAVADEFAULTOPTIONEHANDLER_H__ + + +#include "musavaavailability.h" +#include "musavaobserver.h" +#include "musavainviteresponderobserver.h" +#include "musavasipconnectionadapter.h" +#include "musavasipadapter.h" +#include "mussettingskeys.h" +#include "musunittesting.h" +#include +#include + + +class CSIPServerTransaction; +class CMusAvaInviteResponder; +class CMusAvaSharedObject; +class CSIPResponseElements; +class MMusAvaAvailabilityObserver; +class CSIPResponse; +class CSdpDocument; +class CSdpOriginField; +class RStringF; +class CSdpMediaField; +class CSdpFmtAttributeField; +class CMusAvaSettingsImp; + + +/** + * Implements handling of non-desired SIP invites. + * + * Provide interface for the client to availability class. + * + * @lib musavailabilityplugin.lib + * @since S60 v3.2 + */ +class CMusAvaDefaultOptionHandler : public CMusAvaAvailability, + public MMusAvaSipConnectionAdapter, + public MMusAvaSipAdapter + { + public: + /** + * Two-phased constructor + * + * @param aObserver Pointer to observer intercase + * @param aName availability name + * @param aModules is data container + * @return Returns pointer to CMusAvaInterface object + */ + + static CMusAvaDefaultOptionHandler* NewL( + MMusAvaAvailabilityObserver& aObserver, + CMusAvaSettingsImp& aConcreteSettings ); + + /** + * Two-phased constructor + * + * @param aObserver Pointer to observer intercase + * @param aName availability name + * @param aModules is data container + * @return Returns pointer to CMusAvaInterface object + */ + + static CMusAvaDefaultOptionHandler* NewLC( + MMusAvaAvailabilityObserver& aObserver, + CMusAvaSettingsImp& aConcreteSettings ); + + /** + * Destructor. + */ + ~CMusAvaDefaultOptionHandler(); + +private: + + /** + * Handles incoming Option request + * + * @param aTransaction Pointer to CSIPServerTransaction + */ + void IncomingOptionRequestL( CSIPServerTransaction* aTransaction ); + + /** + * Send Response to reques. + * + * @param aResponseElements Pointer to CSIPResponseElements + * @param aTransaction Pointer to CSIPServerTransaction + */ + void ResponseL( CSIPResponseElements* aResponseElements, + CSIPServerTransaction* aTransaction ); + + /** + * Send No capability response to request. + * + * @param aTransaction Reference to CSIPServerTransaction + * @param aStatusCode a known SIP response status code + * @param aReason reason string + */ + void NoCapabilityResponseL( CSIPServerTransaction* aTransaction, + TUint aStatusCode, + SipStrConsts::TStrings aReason ); + + /** + * Create CSIPResponseElements for the OPTION response. + * + * @param aTransaction Reference to CSIPServerTransaction + * @return CSIPResponseElements is returned, + */ + CSIPResponseElements* CreateResponseL( + CSIPServerTransaction& aTransaction ); + + /** + * Create Sdp for the OPTION response. + * + * @param aTransaction Pointer to CSIPServerTransaction + * @return CSdpDocument is returned, + */ + CSdpDocument* CreateSDPL( CSIPServerTransaction& aTransaction ); + + /** + * Create Origin Field for SDP. + * + * @param aLocalHost Reference to IP address + * @param aHostType Reference to IP address type + * @return CSdpOriginField is returned. + */ + CSdpOriginField* CreateOriginFieldL( + const TDesC8& aLocalHost, + const RStringF& aHostType) const; + /** + * Creates SDP string to pool + * + * @param aString the string as descriptor + * @return SDP String + */ + static RStringF SDPStringL( const TDesC8& aString ); + + /** + * Creates SDP string to pool + * + * @param aStringIndex index for SDP strings + * @return SDP String + */ + static RStringF SDPStringL( TInt aStringIndex ); + + /** + * Resolves local host + * + * @param aLocalHost IP address to be set + * @param aHostType IP address type to be set + * @return feature set + */ + static void LocalHostL( const CSIPServerTransaction& aRequest, + TPtrC8& aLocalHost, + RStringF& aHostType); + + /** + * Creates media line + * + * @param aMedia name of the media + * @param aFormatList format list + * @return media line + */ + CSdpMediaField* MediaLineLC( const RStringF& aMedia, + const TDesC8& aFormatList ) const; + + + /** + * Creates rtpmap line + * + * @param aCodec name of coded + * @param aPayloadType payload type + * @param aClockRate clockrate + * @param aParams optional params + * @return rtpmap line + */ + CSdpFmtAttributeField* RtpMapLineLC( const TDesC8& aCodec, + const TUint64 aPayloadType, + const TUint64 aClockRate, + const TDesC8& aParams = KNullDesC8 ) const; + + /** + * Helper to transform SDP document to text + * + * @param aSdpContent SDP document + * @return SDP document as text + */ + static HBufC8* ToTextL( CSdpDocument& aSdpContent ); + + + + +public: //From MMusAvaSipConnectionAdapter + + /** + * A SIP request outside a dialog has been received from the network. + * + * @pre aTransaction != 0 + * @param aTransaction SIP server transaction. The ownership is + * transferred. + */ + virtual TInt IncomingRequest (CSIPServerTransaction* aTransaction); + +public: //From MMusAvaSipAdapter + + /** + * A SIP request has been received from the network. + * This function is called when the SIP request was received using such + * an IAP, for which the application has not created a CSIPConnection + * object. + * @pre aTransaction != 0 + * @param aIapId The IapId from which the SIP request was received. + * @param aTransaction contains local address, remote address of a SIP + * message, as well as optional SIP message method, headers and + * body. The ownership is transferred. + */ + virtual TInt IncomingRequest(TUint32 aIapId, + CSIPServerTransaction* aTransaction); + + /** + * The received SIP request time-outed and it is invalid i.e. cannot be used + * anymore. + * This will be called if the user fails to create a SIP connection and + * does not send an appropriate SIP response. + * @param aTransaction The time-outed transaction. + */ + virtual TInt TimedOut(CSIPServerTransaction& aTransaction); + +protected: + + /** + * Constructor + * + * @since S60 v3.2 + * @param aObserver Pointer to observer intercase + * @param aName availability name + * @param aModules is data container + * @return + */ + + CMusAvaDefaultOptionHandler( + MMusAvaAvailabilityObserver& aObserver, + CMusAvaSettingsImp& aConcreteSettings ); + + + + /** + * Perform the second phase construction of a + * CMusAvaDefaultOptionHandler object + * + * @since S60 v3.2 + * @param + * @return + */ + + void ConstructL(); + + + +// from base class CMusAvaAvailability + +public: + + /** + * Executes for the availability. + * + * @since S60 v3.2 + * @return KErrNone if ExecutePatternL operation was + * successfully executed; system wide error otherwise + */ + virtual void DoExecuteL(); + + + /** + * Return availability name. + * + * @since S60 v3.2 + * @param + * @return TAvailabilityName is returned + */ + virtual MMusAvaObserver::TAvailabilityName Name(); + + +private: + + /** + * Reference to availability settings (data store) + */ + CMusAvaSettingsImp& iSettings; + + /** + * Pointer to CMusAvaSharedObject object + */ + CMusAvaSharedObject* iSharedObj; + + /** + * Operator variant indicator + */ + MusSettingsKeys::TOperatorVariant iOperatorVariant; + + MUS_UNITTEST ( UT_CMusAvaDefaultOptionHandler ) + }; + + +#endif // __MUSAVADEFAULTOPTIONEHANDLER_H__ \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/inc/musavailabilityplugin.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/inc/musavailabilityplugin.hrh Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,35 @@ +/* +* 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: enumerations and UID constants +* +*/ + + +#ifndef MUSAVAILABILITYPLUGIN_HRH +#define MUSAVAILABILITYPLUGIN_HRH + + +// The Mus Availability Plug-in implementation UID. +#define KAvailabilityPluginImplementationUid 0x1028238E + +// Mus Availability client ECOM interface uid. +#define KMusAvaPluginInterfaceUid 0x10282393 + +// Mus Availability Plug-in implementation uid. +//#define KClientImplementationUid 0x1028238E + + + + +#endif // MUSAVAILABILITYPLUGIN_HRH diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/inc/musavainvitehandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/inc/musavainvitehandler.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,225 @@ +/* +* Copyright (c) 2005-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: Provide interface for the client requestin network availability. +* +*/ + + +#ifndef __MUSAVAINVITEHANDLER_H__ +#define __MUSAVAINVITEHANDLER_H__ + +#include "musavaavailability.h" +#include "musavaobserver.h" +#include "musavainviteresponderobserver.h" +#include "musavasipconnectionadapter.h" +#include "musavasipadapter.h" +#include "musunittesting.h" + +#include + +class CSIPServerTransaction; +class CMusAvaInviteResponder; +class CMusAvaSharedObject; +class MMusAvaAvailabilityObserver; +class CMusAvaSettingsImp; + +/** + * Implements handling of non-desired SIP invites. + * + * Provide interface for the client to availability class. + * + * @lib musavailabilityplugin.lib + * @since S60 v3.2 + */ +class CMusAvaInviteHandler : public CMusAvaAvailability, + public MMusAvaInviteResponderObserver, + public MMusAvaSipConnectionAdapter, + public MMusAvaSipAdapter + { + public: + + /** + * Two-phased constructor + * + * @since S60 v3.2 + * @param aObserver Pointer to observer intercase + * @param aModules is data container + * @return Returns pointer to CMusAvaInterface object + */ + + static CMusAvaInviteHandler* NewL( + MMusAvaAvailabilityObserver& aObserver, + CMusAvaSettingsImp& aSettings ); + + /** + * Two-phased constructor + * + * @since S60 v3.2 + * @param aObserver Pointer to observer intercase + * @param aModules is data container + * @return Returns pointer to CMusAvaInterface object + */ + + static CMusAvaInviteHandler* NewLC( + MMusAvaAvailabilityObserver& aObserver, + CMusAvaSettingsImp& aSettings ); + + /** + * Destructor + */ + ~CMusAvaInviteHandler(); + +public: + + /** + * A SIP request outside a dialog has been received from the network. + * + * @pre aTransaction != 0 + * @param aTransaction SIP server transaction. The ownership is + * transferred. + */ + virtual TInt IncomingRequest( + CSIPServerTransaction* aTransaction ); + + /** + * A SIP request within a dialog has been received from the network. + * The client must resolve the actual dialog association to which + * this request belongs. + * + * @pre aTransaction != 0 + * @param aTransaction SIP server transaction. The ownership is + * transferred. + * @param aDialog the dialog that this transaction belongs to. + */ +/* virtual TInt IncomingRequest (CSIPServerTransaction* aTransaction, + CSIPDialog& aDialog); +*/ + +public: + + /** + * A SIP request has been received from the network. + * This function is called when the SIP request was received using such + * an IAP, for which the application has not created a CSIPConnection + * object. + * @pre aTransaction != 0 + * @param aIapId The IapId from which the SIP request was received. + * @param aTransaction contains local address, remote address of a SIP + * message, as well as optional SIP message method, headers and + * body. The ownership is transferred. + */ + TInt IncomingRequest( + TUint32 aIapId, + CSIPServerTransaction* aTransaction ); + + /** + * The received SIP request time-outed and it is invalid i.e. cannot be used + * anymore. + * This will be called if the user fails to create a SIP connection and + * does not send an appropriate SIP response. + * @param aTransaction The time-outed transaction. + */ + TInt TimedOut( CSIPServerTransaction& aTransaction ); + + protected: + + /** + * Constructor + * + * @since S60 v3.2 + * @param aObserver Pointer to observer intercase + * @param aName availability name + * @param aModules is data container + * @return + */ + CMusAvaInviteHandler( + MMusAvaAvailabilityObserver& aObserver, + CMusAvaSettingsImp& aSettings ); + + void ConstructL(); + + +// from base class CMusAvaAvailability + +public: + + /** + * Executes for the availability. + * + * @since S60 v3.2 + * @return KErrNone if ExecutePatternL operation was + * successfully executed; system wide error otherwise + */ + virtual void DoExecuteL(); + + + /** + * Stop the execution. + * + * @since S60 v3.2 + * @return KErrNone if stop operation was successfully executed; + * system wide error otherwise + */ + virtual void Stop(); + + /** + * From CMusAvaAvailability. + * Returns availability name. + * + * @return Name of *this* availability. + */ + virtual MMusAvaObserver::TAvailabilityName Name(); + +public: + + /** + * Handles a received invitation + * + * @param aTransaction A SIP Transaction of the received invitation. + */ + void InvitationReceivedL( CSIPServerTransaction* aTransaction ); + + +public: // MMusAvaInviteResponderObserver + + MMusAvaSettingsObserver::TApplicationState ApplicationState(); + + /** + * Deletes a invitation responder instance after answering. + * + */ + void InvitationAnsweredLD(); + +private: + + /** + * Array of invitation responder instances + */ + RPointerArray iResponders; + + /** + * Reference to availability settings (data store) + */ + CMusAvaSettingsImp& iSettings; + + /** + * Pointer to CMusAvaSharedObject object + */ + CMusAvaSharedObject* iSharedObj; + + MUS_UNITTEST ( UT_CMusAvaInviteHandler ) + }; + + +#endif // __MUSAVAINVITEHANDLER_H__ \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/inc/musavainviteresponder.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/inc/musavainviteresponder.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,124 @@ +/* +* 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: Provide interface for the client requestin network availability. +* +*/ + + +#ifndef __MUSAVAINVITERESPONDER_H__ +#define __MUSAVAINVITERESPONDER_H__ + +#include "musunittesting.h" +#include + +class CSIPServerTransaction; +class MMusAvaInviteResponderObserver; +class CSIPTransactionBase; +class CSIPResponseElements; + +/** + * Responds to a non-desired invitation. + * + * @lib musavailabilityplugin.lib + * @since S60 v3.2 + */ +class CMusAvaInviteResponder : public CBase + { +public: + + /** + * + * + * @since S60 v3.2 + */ + static CMusAvaInviteResponder* NewL( CSIPServerTransaction* aTransaction, + MMusAvaInviteResponderObserver& aObserver ); + + /** + * + * + * @since S60 v3.2 + */ + static CMusAvaInviteResponder* NewLC( + CSIPServerTransaction* aTransAction, + MMusAvaInviteResponderObserver& aObserver ); + /** + * + * + * @since S60 v3.2 + */ + ~CMusAvaInviteResponder(); + + +public: + + /** + * + * + * @since S60 v3.2 + */ + void AnswerL(); + + /** + * Send response to request. + * + * @since S60 v3.2 + */ + + void SendResponseL( TUint aStatusCode, + const TDesC8& aReasonPhrase ); + + /** + * Returns response status. + * + * @since S60 v3.2 + */ + TBool ResponseComplete(); + + /** + * Send Response to reques. + * + * @since S60 v3.2 + */ + void ResponseL( CSIPResponseElements* aResponseElements ); + + + +private: + + /** + * + * + * @since S60 v3.2 + */ + CMusAvaInviteResponder( CSIPServerTransaction* aTransAction, + MMusAvaInviteResponderObserver& aObserver ); + + +private: + + /** + * Reference to observer. + */ + MMusAvaInviteResponderObserver& iObserver; + + /** + * SIP transaction. Owns. + */ + CSIPServerTransaction* iTransaction; + MUS_UNITTEST( UT_CMusAvaInviteResponder ) + }; + + +#endif // __MUSAVAINVITERESPONDER_H__ \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/inc/musavainviteresponderobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/inc/musavainviteresponderobserver.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,44 @@ +/* +* 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: Provide interface for the client requestin network availability. +* +*/ + + +#ifndef __MUSAVAINVITERESPONDEROBSERVER_H__ +#define __MUSAVAINVITERESPONDEROBSERVER_H__ + +#include "musavasettingsobserver.h" + +#include + +class CMusAvaInviteResponder; + +/** + * Responds to a non-desired invitation. + * + * @lib musavailabilityplugin.lib + * @since S60 v3.2 + */ +class MMusAvaInviteResponderObserver + { +public: + + virtual MMusAvaSettingsObserver::TApplicationState ApplicationState() = 0; + + virtual void InvitationAnsweredLD() = 0; + }; + + +#endif // __MUSAVAINVITERESPONDER_H__ \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/inc/musavanetworkavailability.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/inc/musavanetworkavailability.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,177 @@ +/* +* Copyright (c) 2005-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: Provide interface for the client requestin network availability. +* +*/ + + +#ifndef __MUSAVANETWORKAVAILABILITY_H__ +#define __MUSAVANETWORKAVAILABILITY_H__ + +#include "musavaavailability.h" +#include "muscallmonitorobserver.h" +#include + +#include + +class MMusAvaAvailabilityObserver; +class MMusAvaObserver; +class CMusAvaSharedObject; +class CMusAvaCallEventMonitor; +class CMusAvaSettingsImp; + +/** + * Implemets register vailability. + * + * Provide interface for the client to availability class. + * + * @lib musavailabilityplugin.lib + * @since S60 v3.2 + */ + + + +class CMusAvaNetworkAvailability : public CMusAvaAvailability, + public MMusCallMonitorObserver + { +public: + /** + * Two-phased constructor + * + * @since S60 v3.2 + * @param aObserver Pointer to observer intercase + * @param aModules is data container + * @return Returns pointer to CMusAvaInterface object + */ + static CMusAvaNetworkAvailability* NewL( + MMusAvaAvailabilityObserver& aObserver, + CMusAvaSettingsImp& aSettings ); + + + static CMusAvaNetworkAvailability* NewLC( + MMusAvaAvailabilityObserver& aObserver, + CMusAvaSettingsImp& aSettings ); + + + /** + * Destructor + */ + ~CMusAvaNetworkAvailability(); + +protected: + + /** + * Constructor + * + * @param aObserver Pointer to observer intercase + * @param aName availability name + * @param aModules is data container + */ + + CMusAvaNetworkAvailability( MMusAvaAvailabilityObserver& aObserver, + CMusAvaSettingsImp& aSettings ); + + void ConstructL(); + + +// from base class CMusAvaAvailability + +public: + + /** + * Executes for the availability. + * + * @since S60 v3.2 + * @return KErrNone if ExecutePatternL operation was + * successfully executed; system wide error otherwise + */ + virtual void DoExecuteL(); + + /** + * Stop the execution. + * + * @since S60 v3.2 + * @return KErrNone if stop operation was successfully executed; + * system wide error otherwise + */ + virtual void Stop(); + + /** + * From CMusAvaAvailability. + * Returns availability name. + * + * @return Name of *this* availability. + */ + virtual MMusAvaObserver::TAvailabilityName Name(); + +public: // from MMusCallMonitorObserver + + /** + * Call connected + * + * @since S60 v3.2 + * @return + */ + void CallConnectedL( const TDesC& aTelNumber, TBool aIsSipUri ); + + /** + * Call on hold + * + * @since S60 v3.2 + * @return + */ + virtual void CallHoldL( const TDesC& aTelNumber, TBool aIsSipUri ); + + /** + * Call disconnected + * + * @since S60 v3.2 + * @return + */ + virtual void NoActiveCallL(); + + /** + * Call on hold + * + * @since S60 v3.2 + * @return + */ + virtual void ConferenceCallL(); + +private: + + void SetRemoteHostL( const TDesC& aTelNumber, TBool aIsSipUri ); + +private: // data + + /** + * + */ + CMusAvaCallEventMonitor* iPhoneStatus; + + /** + * Pointer to CMusAvaSharedObject object + */ + CMusAvaSharedObject* iSharedObj; + + /** + * Reference to availability settings object. + */ + CMusAvaSettingsImp& iSettings; + + MUS_UNITTEST( UT_CMusAvaNetworkAvailability ) + }; + + +#endif // __MUSAVANETWORKAVAILABILITY_H__ diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/inc/musavanetworkmodestatus.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/inc/musavanetworkmodestatus.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,122 @@ +/* +* 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: Provide interface for the client requestin availability class. +* +*/ + + +#ifndef __MUSAVANETWORKMODESTATUS_H__ +#define __MUSAVANETWORKMODESTATUS_H__ + +#include "musavatelephonystatusbase.h" +#include "musunittesting.h" + +#include +#include +#include +#include +#include + + +/** + * This class monitors the phone status and resolves the contact + * information of the remote host in case of a connected cs call. + * + * @lib musavailabilityplugin.lib + * @since S60 v3.2 + */ +class CMusAvaNetworkModeStatus : public CMusAvaTelephonyStatusBase + { +public: + + /** + * Two-phased constructor. + * + * @since S60 v3.2 + */ + static CMusAvaNetworkModeStatus* NewL( ); + + + /** + * Default destructor + * + * @since S60 v3.2 + */ + ~CMusAvaNetworkModeStatus(); + +public: + + /** + * Test current network mode + * + * @since S60 v3.2 + * @return Returns the network mode + */ + RMobilePhone::TMobilePhoneNetworkMode PhoneNetworkMode( ); + +protected: + + /** + * Constructor. + * + * @since S60 v3.2 + */ + CMusAvaNetworkModeStatus(); + + /** + * Second-phase constructor + * + * @since S60 v3.2 + */ + void ConstructL(); + +public: // from CMusAvaTelephonyStatusBase + + /** + * + * + * @since S60 v3.2 + * @param + */ + void TelephonyStatus(); + +protected: + + /** + * + * @since S60 v3.2 + * + */ + void PhoneNetworkModeStatus( RMobilePhone::TMobilePhoneNetworkMode aStatus); + +protected: // from CActive + + void RunL(); + + void DoCancel(); + +private: // data + + + /** + * Reference to TMobilePhoneNetworkMode object + */ + RMobilePhone::TMobilePhoneNetworkMode iNetworkMode; + + + MUS_UNITTEST( UT_CMusAvaNetworkModeStatus ) + }; + + +#endif // __MUSAVANETWORKMODESTATUS_H__ \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/inc/musavanetworkregistrationstatus.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/inc/musavanetworkregistrationstatus.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,130 @@ +/* +* Copyright (c) 2005-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: Provide interface for the client requestin availability class. +* +*/ + + +#ifndef __MUSAVANETWORKREGISTRATIONSTATUS_H__ +#define __MUSAVANETWORKREGISTRATIONSTATUS_H__ + +#include "musavatelephonystatusbase.h" +#include "musunittesting.h" + +#include +#include +#include +#include +#include + + +/** + * This class monitors the phone status and resolves the contact + * information of the remote host in case of a connected cs call. + * + * @lib musavailabilityplugin.lib + * @since S60 v3.2 + */ +class CMusAvaNetworkRegistrationStatus : public CMusAvaTelephonyStatusBase + { +public: + + /** + * Two-phased constructor. + * + * @since S60 v3.2 + */ + static CMusAvaNetworkRegistrationStatus* NewL( ); + + + /** + * Default destructor + * + * @since S60 v3.2 + */ + ~CMusAvaNetworkRegistrationStatus(); + +public: + + /** + * Current network registration status + * + * @since S60 v3.2 + * @return TMobilePhoneRegistrationStatus + * EFalse otherwise + */ + void NetworkRegistration( + RMobilePhone::TMobilePhoneRegistrationStatus& aStatus ); + +protected: + + /** + * Constructor. + * + * @since S60 v3.2 + */ + CMusAvaNetworkRegistrationStatus(); + + /** + * Second-phase constructor + * + * @since S60 v3.2 + */ + void ConstructL(); + + +public: // from CMusAvaTelephonyStatusBase + + /** + * + * + * @since S60 v3.2 + * @param + */ + void TelephonyStatus(); + +protected: + + /** + * + * + * @since S60 v3.2 + * @param + */ + void NetworkRegistrationStatus( + RMobilePhone::TMobilePhoneRegistrationStatus aRegStatus ); + + /** + * descr + * + * @since S60 v3.2 + */ + void RunL(); + + +private: // data + + + /** + * Reference to TMobilePhoneRegistrationStatus object + */ + RMobilePhone::TMobilePhoneRegistrationStatus iRegistrationStatus; + + + MUS_UNITTEST( UT_CMusAvaNetworkRegistrationStatus ) + MUS_UNITTEST( UT_CMusAvaConnectionAvailability ) + }; + + +#endif // __MUSAVANETWORKREGISTRATIONSTATUS_H__ \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/inc/musavaoptionhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/inc/musavaoptionhandler.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,234 @@ +/* +* Copyright (c) 2005-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: Provide interface for the client request in capabilty +* availability. +* +*/ + +#ifndef __MUSAVAOPTIONHANDLER_H__ +#define __MUSAVAOPTIONHANDLER_H__ + +#include +#include +#include "musavaavailability.h" +#include "musavaobserver.h" +#include "musunittesting.h" +#include "mmusavacapabilityqueryobserver.h" + +class CMusAvaSharedObject; +class MMusAvaAvailabilityObserver; +class CMusAvaCapabilitySipAgent; +class CMusAvaCapabilityExchange; +class CMusAvaCapability; +class CMusAvaCapabilityQueryBase; +class CMusAvaSettingsImp; + + +/** + * Implements handling of non-desired SIP invites. + * + * Provide interface for the client to availability class. + * + * @lib musavailabilityplugin.lib + * @since S60 v3.2 + */ +class CMusAvaOptionHandler : public CMusAvaAvailability, + public MMusAvaCapabilityQueryObserver + { +public: + /** + * Two-phased constructor + * + * @param aObserver Pointer to observer intercase + * @param aSettings Availability settings. + * @return Returns pointer to CMusAvaInterface object + */ + static CMusAvaOptionHandler* NewL( + MMusAvaAvailabilityObserver& aObserver, + CMusAvaSettingsImp& aSettings ); + + /** + * Two-phased constructor + * + * @param aObserver Pointer to observer intercase + * @param aSettings Availability settings. + * @return Returns pointer to CMusAvaInterface object + */ + static CMusAvaOptionHandler* NewLC( + MMusAvaAvailabilityObserver& aObserver, + CMusAvaSettingsImp& aSettings ); + + /** + * Destructor + */ + ~CMusAvaOptionHandler(); + +protected: + + /** + * Constructor + * + * @since S60 v3.2 + * @param aObserver Pointer to observer intercase + * @param aName availability name + * @param aModules is data container + */ + + CMusAvaOptionHandler( + MMusAvaAvailabilityObserver& aObserver, + CMusAvaSettingsImp& aSettings ); + + void ConstructL(); + + void ConstructCapabilityExchangeL(); + + HBufC8* ConstructTerminalIdL(); + +public: // from base class CMusAvaAvailability + + /** + * Executes for the availability. + * + * @since S60 v3.2 + * @return KErrNone if ExecutePatternL operation was + * successfully executed; system wide error otherwise + */ + virtual void DoExecuteL(); + + + /** + * Stop the execution. + * + * @since S60 v3.2 + * @return KErrNone if stop operation was successfully executed; + * system wide error otherwise + */ + virtual void Stop(); + + /** + * From CMusAvaAvailability. + * Returns availability name. + * + * @return Name of *this* availability. + */ + virtual MMusAvaObserver::TAvailabilityName Name(); + + /** + * Invitation has been received. + */ + virtual void PrepareForReceivedInviteL(); + + +public: // functions from base class MMusAvaCapabilityQueryObserver + + void CapabilitiesResolved( const CMusAvaCapabilityQueryBase& aSentQuery ); + + void CapabilitiesResolvedL( const TDesC& aUri ); + + void SetCapabilitiesResolvedForCingular(); + + TBool CapabilitiesResolvedForCingular(); + + /** + * This is to advertise MMusAvaCapabilityQueryObserver implementors + * about sip header change. It is mainly used in below scneraio but could + * be used in future if anyother sip headers has to be set. + * + * Incase if we receive OPTIONS request already and + * P-Asserted-Identity Header is present then OPTIONS + * request should be sent to this ID. This function should be + * called to configure this id in CMusAvaSettingsImp& iSettings + * + * @aHeaders Array of SIP Headers. + * @aHeaderType Type of the header. + * Leavs if Array is empty or pointer is NULL. + * Ownership Transferred. + */ + void SipHeadersL(const MDesCArray& aHeaders, + SipStrConsts::TStrings aHeaderType); + + /** + * Advertise about video codec capabilities + */ + void VideoCodecsResolvedL( const MDesCArray& aVideoCodecs ); + + TBool CapabilityQueryAnswered( TBool aAnswered ); + + void FastModeResolved( MusSettingsKeys::TFastMode aMode ); + +private: + + /** + * Change state. + * @param aNewState, proposed new state + * @return KErrNone if successfull + */ + TInt DoSetState( MMusAvaObserver::TAvailabilityStatus aNewState ); + + /** + * Handle state change in fast mode, state change may be modified + * based on fast mode session setup progress. + * @param aNewState, proposed new state + * @param aCouldNotProceed, ETrue if state change occured because + * couldn't proceed (e.g. missing information) + * @return new state to set + */ + MMusAvaObserver::TAvailabilityStatus HandleFastModeL( + MMusAvaObserver::TAvailabilityStatus aNewState ); + + MMusAvaObserver::TAvailabilityStatus HandleFastModeAvailableL( + MMusAvaObserver::TAvailabilityStatus aNewState ); + + MMusAvaObserver::TAvailabilityStatus HandleFastModeOptionsNotSentL( + MMusAvaObserver::TAvailabilityStatus aNewState ); + + MMusAvaObserver::TAvailabilityStatus HandleFastModeOptionNotAvailableL( + MMusAvaObserver::TAvailabilityStatus aNewState ); + + void HandleFastModeQueryAnswered(); + + TBool FastModeNegotiatedByAnswerMT(); + + TBool FastModeNegotiationFailedMO(); + +private: + + /** + * Reference to availability settings (data store) + */ + CMusAvaSettingsImp& iSettings; + + /** + * Pointer to CMusAvaSharedObject object + */ + CMusAvaSharedObject* iSharedObj; + + CMusAvaCapabilitySipAgent* iSipAgent; + CMusAvaCapabilityExchange* iCapabilityExchange; + CMusAvaCapability* iSwisCapability; + TBool iCapabilitiesRequestAnswered; + TBool iCapabilityQueryAnswered; + + TBool iFastModeCapable; + TBool iFastModeAvailabilityDelayed; + + MUS_UNITTEST ( UT_CMusAvaOptionHandler ) + MUS_UNITTEST ( UT_CMusAvaCapabilityExchange ) + MUS_UNITTEST ( UT_CMusAvaCapability ) + MUS_UNITTEST ( UT_CMusAvaTerminal ) + MUS_UNITTEST ( UT_CMusAvaCapabilitySipAgent ) + MUS_UNITTEST ( UT_CMusAvaCapabilityQuery ) + }; + +#endif // __MUSAVAOPTIONHANDLER_H__ diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/inc/musavaregisteravailability.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/inc/musavaregisteravailability.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,234 @@ +/* +* Copyright (c) 2005-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". +* Version : %version: 15.1.5 % << Don't touch! Updated by Synergy at check-out. +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Provide interface for the client requestin register availability. +* +*/ + + + +#ifndef __MUSAVAREGISTERAVAILABILITY_H__ +#define __MUSAVAREGISTERAVAILABILITY_H___ + + +#include "musunittesting.h" +#include "musavaavailability.h" +#include "musavasipconnectionadapter.h" +#include "musavasipprofileregistryadapter.h" +#include +#include + + +class CMusAvaSettingsImp; +class CSIPProfileRegistry; +class CSIPProfile; +class MMusAvaObserver; +class CMusAvaSharedObject; +class CSIPProfile; +class CSIPProfileRegistry; +class CSIPConnection; + + +/** + * Implemets register vailability. + * + * Provide interface for the client to availability class. + * + * @lib musavailabilityplugin.lib + * @since S60 v3.2 + */ +class CMusAvaRegisterAvailability : public CMusAvaAvailability, + public MMusAvaSipProfileRegistryAdapter + { +public: + + /** + * Two-phased constructor + * + * @param aObserver Pointer to observer intercase + * @param aModules is data container + * @return Returns pointer to CMusAvaInterface object + */ + static CMusAvaRegisterAvailability* NewL( + MMusAvaAvailabilityObserver& aObserver, + CMusAvaSettingsImp& aSettings ); + + + static CMusAvaRegisterAvailability* NewLC( + MMusAvaAvailabilityObserver& aObserver, + CMusAvaSettingsImp& aSettings ); + + /** + * Destructor + */ + + ~CMusAvaRegisterAvailability(); + + protected: + + /** + * Constructor + * + * @param aObserver Pointer to observer intercase + * @param aName availability name + * @param aModules is data container + * @return + */ + CMusAvaRegisterAvailability( + MMusAvaAvailabilityObserver& aObserver, + CMusAvaSettingsImp& aSettings ); + + void ConstructL(); + +// from base class CMusAvaAvailability + +public: + + /** + * Executes for the availability. + */ + virtual void DoExecuteL(); + + /** + * Stop the execution. + */ + virtual void Stop(); + + /** + * From CMusAvaAvailability. + * Returns availability name. + * + * @return Name of *this* availability. + */ + virtual MMusAvaObserver::TAvailabilityName Name(); + +// from base class MSIPProfileRegistryObserver + +public: + + /** + * An event related to SIP Profile has accorred + * @param aProfileId a profile Id + * @param aEvent an occurred event + **/ + virtual void ProfileRegistryEventOccurred( + TUint32 aProfileId, + MSIPProfileRegistryObserver::TEvent aEvent ); + + /** + * An asynchronous error has occurred related to SIP profile + * Event is send to those observers, who have the + * corresponding profile instantiated. + * @param aProfileId the id of failed profile + * @param aError an occurred error + */ + virtual void ProfileRegistryErrorOccurred( + TUint32 aProfileId, + TInt aError ); + +// from base class MMusAvaSipConnectionAdapter + +public: + + /** + * Connection state has changed. + * If connection state has changed to EInactive or EUnavailable, + * SIP stack has removed all stand-alone SIP refreshes, registrations + * and dialog associations that client requested to refresh. Client may + * re-issue refresh requests (stand-alone, registration or dialog + * association related) when connection becomes EActive again. + * SIP stack also terminates all pending SIP client transactions and no + * errors are reported back to the client about the terminated + * transactions nor about removed refreshes in order to avoid event + * flood. + * + * @param aState indicates the current connection state + */ + TInt ConnectionStateChanged (CSIPConnection::TState aState ); + + +private: // Helpers + + /** + * Creates proposal sip address and send event. + * + */ + void CreateSipAddressProposalL(); + + /** + * Enables SIP Register. + * + */ + void EnableRegisterL(); + + /** + * Initialize SIP Register request. + * + * @return ETrue if Register request was initialized + * successfully; EFalse otherwise + */ + TBool InitializeRegister(); + + /** + * Send SIP Register request. + * + * @return ETrue if Register operation was + * successfully executed; EFalse otherwise + */ + TBool RegisterL(); + + /** + * Update SIP profile for general data. + * + * @return ETrue if SIP Profile was found; + * EFalse otherwise + */ + TBool UpdateSIPProfile(); + + /** + * Current SIP profile status. + * + * @return ETrue if SIP Profile is registred; + * EFalse otherwise + */ + TBool RegistrationStatusL(); + +private: // Data + + /** + * Pointer to CMusAvaSharedObject object + */ + CMusAvaSharedObject* iSharedObj; + + /** + * Pointer to CSIPProfileRegistry object + */ + CSIPProfileRegistry* iRegistry; + + /** + * Reference to CMusAvaSettingsImp object + */ + CMusAvaSettingsImp& iSettings; + + /** + * Pointer to CSIPConnection object + */ + CSIPConnection* iConnection; + + + MUS_UNITTEST( UT_CMusAvaRegisterAvailability ) + }; + + +#endif // __MUSAVAREGISTERAVAILABILITY_H__ \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/inc/musavasettingavailability.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/inc/musavasettingavailability.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,123 @@ +/* +* Copyright (c) 2005-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: Implements Settings Availability +* +*/ + + + +#ifndef __MUSAVASETTINGAVAILABILITY_H__ +#define __MUSAVASETTINGAVAILABILITY_H__ + +class CMusAvaAvailability; +class MMusAvaAvailabilityObserver; +class MMusAvaObserver; + +/** + * Implemets settings availability. + * + * @lib musavailabilityplugin.lib + * @since S60 v3.2 + */ +class CMusAvaSettingAvailability : public CMusAvaAvailability + + { +public: + + /** + * Two-phased constructor + * + * @since S60 v3.2 + * @param aObserver Pointer to observer intercase + * @param aModules is data container + * @return Returns pointer to CMusAvaInterface object + */ + static CMusAvaSettingAvailability* NewL( + MMusAvaAvailabilityObserver& aObserver); + + + static CMusAvaSettingAvailability* NewLC( + MMusAvaAvailabilityObserver& aObserver); + + /** + * Destructor + */ + + ~CMusAvaSettingAvailability(); + + protected: + + /** + * Constructor + * + * @since S60 v3.2 + * @param aObserver Pointer to observer intercase + * @param aName availability name + * @param aModules is data container + * @return + */ + CMusAvaSettingAvailability( + MMusAvaAvailabilityObserver& aObserver); + + void ConstructL(); + +// from base class CMusAvaAvailability + +public: + + /** + * Executes for the availability. + */ + virtual void DoExecuteL(); + + /** + * Stop the execution. + */ + virtual void Stop(); + + /** + * From CMusAvaAvailability. + * Returns availability name. + * + * @return Name of *this* availability. + */ + virtual MMusAvaObserver::TAvailabilityName Name(); + +private: + + /** + * Checks the options response state. + * + * @since S60 v3.2 + * @return Returns ETrue if options response is 200 + * else otherwise. + */ + TBool IsForbiddenByOptionsResponse(); + + + /** + * Checks the activation & Options response state. + * + * @since S60 v3.2 + */ + void CheckActivationState(); + + + + MUS_UNITTEST( UT_CMusAvaSettingAvailability ) + }; + + +#endif // __MUSAVASETTINGAVAILABILITY_H__ + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/inc/musavasettingsimp.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/inc/musavasettingsimp.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,371 @@ +/* +* Copyright (c) 2005-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: This is module interface class for MusAvailability Plug-in +* +*/ + + +#ifndef __MUSAVASETTINGSIMP_H__ +#define __MUSAVASETTINGSIMP_H__ + +// INCLUDES +#include "musavasettings.h" +#include "musavasettingsobserver.h" +#include "musunittesting.h" + +#include +#include +#include + +class CMusAvaSip; + +/** + * CMusAvaSettingsImp class represent the interface for module fetcher. + * + * This interface class encapsulates module selection for availability Plug-in. + * + * @lib musavailabilityplugin.lib + */ + +class CMusAvaSettingsImp : public CBase, + public MMusAvaSettings + { +public: + + /** + * Two-phased constructor + * + * @return Returns pointer to CMusAvaSettingsImp object + */ + + static CMusAvaSettingsImp* NewL(); + + /** + * Destructor + * + */ + + ~CMusAvaSettingsImp(); + + +public: // from MMusAvaSettings + + /** + * Returns the fast mode value. + */ + + virtual MusSettingsKeys::TFastMode FastMode() const; + + /** + * Returns the manual activation + * + */ + virtual TManualActivation ManualActivation(); + + /** + * Returns the telephone number of remote host of active CS call. + * + * @return The telephone number. + */ + virtual const TDesC& TelNumber() const; + + /** + * Returns the contact name of remote host of active CS call. + * + * @return The telephone number. + */ + virtual const TDesC& ContactName() const; + + /** + * Returns a guess for the SIP address of the remote host + * + * @return The proposal for SIP address + */ + virtual const TDesC& SipAddressProposal() const; + + /** + * Returns the possible SIP addresses of the remote host. + * + * @return The SIP addresses in an array. + */ + virtual const MDesCArray& SipAddresses() const; + + /** + * Returns the contact id of the remote host. + * + * @return The contact id; KErrNotFound, if not found any. + */ + virtual TInt ContactId() const; + + /** + * Returns the supported video codecs. + * + * @return The video codecs + */ + virtual const MDesCArray& VideoCodecs() const; + + /** + * Returns the supported audio codecs. + * + * @return The supported audio codecs. + */ + virtual const MDesCArray& AudioCodecs() const; + + /** + * Returns the id of the preferable SIP profile. + * + * @return The SIP profile id. + */ + virtual TInt SipProfileId() const; + + /** + * Sets the settings observer pointer + * + * @param aObserver Pointer to observer intercase + */ + virtual void SetObserver( MMusAvaSettingsObserver& aObserver ); + + /* + * Gets the settings observer pointer + * + */ + virtual MMusAvaSettingsObserver* Observer(); + + /** + * Sets the for the manual activation + * + */ + virtual void SetManualActivation( TManualActivation aManualActivation ); + + +public: + + /** + * Returns the current application state. + */ + MMusAvaSettingsObserver::TApplicationState ApplicationState(); + + /** + * Returns the direction of the mobile call. + * + * @return 0, if the direction of the call is unknown. + * 1, if the call was originated by this phone. + * 2, if the call was terminated by this phone + */ + TInt CallDirection(); + + /** + * Sets the call direction of mobile call. + * @param aDirection direction of mobile call + * 0, the direction of the call is unknown. + * 1, the call was originated by this phone. + * 2, the call was terminated by this phone + */ + void SetCallDirection( TInt aDirection ); + + /** + * Sets the telephone number of remote host of active CS call. + * @param aTelNumber telephone number of remote host + */ + void SetTelNumberL( const TDesC& aTelNumber ); + + /** + * Sets the contact name of remote host of active CS call. + * @param aContactName contact name of remote host + */ + void SetContactNameL( const TDesC& aContactName ); + + + /** + * Sets the telephone number of remote host of active CS call. + * @param aTelNumber username part of remote host + * @param aDomain host part of remote host + */ + void SetSipAddressProposalL( const TDesC& aTelNumber, + const TDesC& aDomain ); + + /** + * Releases current telphone number + * + */ + void ReleseTelNumberL(); + + /** + * Sets the possible SIP addresses of the remote host. + * + * @param aSipAddresses the SIP addresses in an array. + */ + void SetSipAddressesL( const MDesCArray& aSipAddresses ); + + /** + * Overaloaded function. + * Sets the possible SIP addresses of the remote host. + * + * @param aSipAddresses the SIP addresses in an array. + * Ownership is transferred. + */ + void SetSipAddressesL(CDesCArray* aSipAddresses ); + + /** + * Sets the contact id of the remote host. + * + * @param aContactId The contact id; + */ + void SetContactId( TInt aContactId ); + + /** + * Sets the supported video codecs. + * + * @param aVideoCodecs the video codecs in an array + */ + void SetVideoCodecsL( const MDesCArray& aVideoCodecs); + + /** + * Sets the supported audio codecs. + * + * @param aAudioCodecs the supported audio codecs in an array + */ + void SetAudioCodecsL( MDesCArray& aAudioCodecs ); + + /** + * Sets the id of the preferable SIP profile. + * + * @param aProfileId the SIP profile id. + */ + void SetSipProfileId( TInt aProfileId ); + + /** + * Returns the id of the preferable SIP profile. + * + * @return The SIP profile id. + */ + CMusAvaSip& Sip(); + + /** + * Sets the fast mode value + */ + void SetFastMode( MusSettingsKeys::TFastMode aMode ); + + /** + * Sets contact resolving uri + */ + void SetUriForContactResolvingL( const TDesC& aRemoteUri ); + + /** + * Gets contact resolving uri + */ + TPtrC ContactResolvingUri(); + +private: + + void CopyDescArrayL( CDesCArray& aTarget, + const MDesCArray& aSource ); + +protected: + /** + * Constructor + * + */ + + CMusAvaSettingsImp(); + + /** + * Perform the second phase construction of a + * CMusAvaSettingsImp object + * + */ + + void ConstructL(); + + +private: // data + + /** + * Current telphone number + * Owns. + */ + HBufC* iTelNumber; + + /** + * Current Call Direction + */ + TInt iCallDirection; + + /** + * Current contact name + * Owns. + */ + HBufC* iContactName; + + /** + * Current SIP address guess for the remote host + * Owns. + */ + HBufC* iSipAddressProposal; + + /** + * Contact id of the remote host + */ + TInt iContactId; + + /** + * Preferable SIP profile ID + */ + TInt iSipProfileId; + + /** + * Current contact list + * Owns. + */ + CDesCArray* iSipAddresses; + + /** + * Supported video codecs + * Owns. + */ + CDesCArray* iVideoCodecs; + + /** + * Supported audio codecs + * Owns. + */ + CDesCArray* iAudioCodecs; + + /** + * Setting observer. + * Not owns. + */ + MMusAvaSettingsObserver* iObserver; + + /** + * Setting for the Manual activation. + */ + TManualActivation iManualActivation; + + /** + * Fast mode + */ + MusSettingsKeys::TFastMode iFastMode; + + /** + * Contact resolving + */ + HBufC* iContactResolvingUri; + + MUS_UNITTEST( UT_CMusAvaSettingsImp ) + MUS_UNITTEST( UT_CMusAvaOptionHandler ) + }; + +#endif __MUSAVASETTINGSIMP_H__ + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/inc/musavasharedobject.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/inc/musavasharedobject.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,196 @@ +/* +* 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: This is client interface class for chared objects +* MusAvailability Plug-in +* +*/ + + +#ifndef __MUSAVASHAREDOBJ_H__ +#define __MUSAVASHAREDOBJ_H__ + +// INCLUDES +#include "musunittesting.h" +#include + +class CSIP; +class CMusAvaSipObserver; +class MSIPObserver; +class CMusAvaSip; +class MSIPConnectionObserver; +class MMusAvaSipConnectionAdapter; +class CMusAvaConnectionMonitor; +class CMusAvaNetworkRegistrationStatus; +class CMusAvaNetworkModeStatus; + +/** + * CMusAvaSharedObject class represent the interface for module fetcher. + * + * This interface class encapsulates module selection for availability Plug-in. + * + * @lib musavailabilityplugin.lib + * @since S60 v3.2 + */ +class CMusAvaSharedObject : public CBase + { + public: + + /** + * Returns singleton object + * + * @since S60 v3.2 + * @return pointer to CMusAvaSharedObject Object + */ + static CMusAvaSharedObject* GetSingletonL(); + + /** + * Delete singleton object + * + * @since S60 v3.2 + */ + static void DeleteSingleton(); + + + protected: + + /** + * Two-phased constructor + * + * @since S60 v3.2 + * @return Returns pointer to CMusAvaSharedObject object + */ + static CMusAvaSharedObject* NewL( ); + + /** + * Constructor + * + * @since S60 v3.2 + * @param aObserver Pointer to observer intercase + */ + CMusAvaSharedObject( ); + + /** + * Perform the second phase construction of a + * CMusAvaSharedObject object + * + * @since S60 v3.2 + */ + void ConstructL(); + + private: + + /** + * Destructor + * + * @since S60 v3.2 + */ + ~CMusAvaSharedObject(); + + + public: + + /** + * Returns CMusAvaConnectionMonitor object + * + * @since S60 v3.2 + * @return CMusAvaConnectionMonitor to Sip Object + */ + CMusAvaConnectionMonitor& ConnectionMonitor(); + + /** + * Returns MSIPConnectionObserver object + * + * @since S60 v3.2 + * @return referense to MSIPConnectionObserver + */ + MSIPConnectionObserver& SIPConnection(); + + /** + * Returns CMusAvaSip object + * + * @since S60 v3.2 + * @return referense to Sip Object + */ + CMusAvaSip& MusAvaSip(); + + /** + * Returns CSIP object + * + * @since S60 v3.2 + * @return referense to Sip Object + */ + CSIP& Sip(); + + /** + * Returns MSIPObserver object + * + * @since S60 v3.2 + * @return rreference to MSIPObserver object + */ + MSIPObserver& SIPObserver(); + + /** + * Returns CMusAvaNetworkRegistrationStatus object + * + * @since S60 v3.2 + * @return rreference to CMusAvaNetworkRegistrationStatus object + */ + CMusAvaNetworkRegistrationStatus& MusAvaTelephonyStatus(); + + /** + * Returns CMusAvaNetworkModeStatus object + * + * @since S60 v3.2 + * @return rreference to CMusAvaNetworkModeStatus object + */ + + CMusAvaNetworkModeStatus& NetworkModeStatus(); + + + private: //Data + + /** + * Pointer to Singleton object + */ + static CMusAvaSharedObject* iSelf; + + /** + * + */ + static TInt iSelfCounter; + + /** + * Pointer to CMusAvaSip object + */ + CMusAvaSip* iMusAvaSip; + + /** + * Pointer to CMusAvaConnectionMonitor object + */ + CMusAvaConnectionMonitor* iConnectionMonitor; + + /** + * Pointer to CMusAvaNetworkRegistrationStatus object + */ + CMusAvaNetworkRegistrationStatus* iNetworkRegistrationStatus; + + CMusAvaNetworkModeStatus* iNetworkModeStatus; + + MUS_UNITTEST( UT_CMusAvaSharedObject ) + MUS_UNITTEST( UT_CMusAvaConnectionMonitor ) + + }; + +#endif + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/inc/musavasip.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/inc/musavasip.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,311 @@ +/* +* 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: This is client interface class for SIP-server +* Version : %version: 24 % << Don't touch! Updated by Synergy at check-out. +* +*/ + + +#ifndef __MUSAVASIP_H__ +#define __MUSAVASIP_H__ + +// INCLUDES + +#include "musunittesting.h" + +#include +#include + +class CMusAvaSipConnectionObserver; +class CMusAvaSipObserver; +class CMusAvaSipProfileRegistryObserver; +class CSIP; +class CSIPProfile; +class CSIPProfileRegistry; +class MMusAvaSipConnectionAdapter; +class MMusAvaSipProfileRegistryAdapter; +class MSIPConnectionObserver; +class MMusAvaSipAdapter; +class CSIPProfileRegistryBase; +class CMusAvaClientResolverUtil; + +/** + * CMusAvaSip class represent the interface for module fetcher. + * + * This interface class encapsulates module selection for availability Plug-in. + * + * @lib musavailabilityplugin.lib + + */ + +class CMusAvaSip : public CBase + { +public: + + /** + * Two-phased constructor + * + * @since S60 v3.2 + * @param aCMusAvaSharedObj Pointer to CMusAvaSharedObject + * @return Returns pointer to CMusAvaSip object + */ + static CMusAvaSip* NewL(); + + /** + * Destructor + * + + * @param + * @return + */ + + ~CMusAvaSip(); + + protected: + + /** + * Constructor + * + * @since S60 v3.2 + * @param aCMusAvaSharedObj Pointer to CMusAvaSharedObject + * @return + */ + + CMusAvaSip(); + + /** + * Perform the second phase construction of a + * CMusAvaSip object + * + * @since S60 v3.2 + * @param + * @return + */ + + void ConstructL(); + +public: + /** + * + * + * @param + */ + void AddAdapterL( MMusAvaSipProfileRegistryAdapter& aAdapter ); + + /** + * + * + * @param + */ + void RemoveAdapter( MMusAvaSipProfileRegistryAdapter& aAdapter ); + + /** + * + * + * @param + */ + void AddAdapterL( MMusAvaSipConnectionAdapter& aAdapter, TInt aIndex = KErrNotFound ); + + /** + * Returns CSip object + * + * @param + */ + void RemoveAdapter( MMusAvaSipConnectionAdapter& aAdapter ); + + /** + * + * + * @param + */ + void AddAdapterL( MMusAvaSipAdapter& aAdapter, TInt aIndex = KErrNotFound ); + + /** + * Returns CSip object. + * + * @param + */ + void RemoveAdapter( MMusAvaSipAdapter& aAdapter ); + +public: + + /** + * Returns CSIPConnection object. + * Ownership is not transferred. + * @param aForceCreation, ETrue if connection should be created + * if it does not exists yet. + * @return referense to Sip Object. + */ + CSIPConnection* ConnectionL( TBool aForceCreation = ETrue ); + + /** + * Returns CSIPConnection object . + * Ownership is not transferred. + * + * @return referense to Sip Object. + */ + MSIPConnectionObserver& ConnectionObserver(); + + /** + * Create Profile object. + * + * return EFalse if Profile was not created, + * ETrue otherwise. + */ + TBool CreateProfileL(); + + /** + * Create CSIPProfile object. + * + * return EFalse if CSIPProfile was not created, + * ETrue otherwise. + */ + TBool CreateSipProfile(); + + /** + * Returns CSIPProfile object. + * Ownership is not transferred. + * + * @since S60 v3.2 + * @return referense to Sip Object. + */ + CSIPProfile* Profile(); + + /** + * Returns CSIPProfileRegistry object. + * Ownership is not transferred. + * + * @return reference to Sip Object. + */ + CSIPProfileRegistry& ProfileRegistryL(); + + /** + * Returns a buffer containing the own domain, if profile registered. + * Ownership is transferred. + * + * @return Pointer to a buffer containing the own domain name. + */ + HBufC* OwnDomainLC(); + + /** + * Returns CSip object + * Ownership is not transferred. + * + * @return reference to Sip Object. + */ + CSIP& Sip(); + + /** + * Returns SipProfileId + * + * @param aSipProfileId on return will contain SipProfileId value + * @return KErrNotFound if parameter was not found, KErrNone otherwise. + */ + TInt SipProfileId( TUint32& aSipProfileId ); + + /** + * Returns a pointer to utility object that handles special client resolving + * in __VOIP enabled terminals. In __VOIP disabled terminals this will + * return a NULL pointer. This function does not transfer ownership. + * + * @return Pointer to resolver utility object. Make sure to be prepared + * that this pointer is NULL. + */ + CMusAvaClientResolverUtil* ClientResolverUtil() const; + + +private: + + /** + * Create SIPConnection object. + * + */ + void CreateSIPConnectionL(); + + /** + * Gets profile to be used with Mus. + * + * @param Reference to used profile registry. + * @return Pointer to profile meant to be used with Mus. If not possible, + * returns poiner to default profile. Ownership is transferred. + * @leave KErrNotFound if not able to return even default profile. + */ + CSIPProfile* GetMusProfileL( CSIPProfileRegistryBase& aRegistry ); + + +private: + + /** + * Pointer to CSIP object. + * Owns. + */ + CSIP* iSip; + + /** + * + * Owns. + */ + CSIPConnection* iSipConnection; + + /** + * + * Owns. + */ + CSIPProfile* iSipProfile; + + /** + * + * Owns. + */ + CSIPProfileRegistry* iSipProfileRegistry; + + /** + * Pointer to CMusAvaSipObserver object. + * Owns. + */ + CMusAvaSipObserver* iSipObserver; + + /** + * Pointer to CMusAvaSipConnectionObserver object + * Owns. + */ + CMusAvaSipConnectionObserver* iSipConnectionObserver; + + /** + * Pointer to CMusAvaSipProfileRegistryObserver object + * Owns. + */ + CMusAvaSipProfileRegistryObserver* iSipProfileRegistryObserver; + + /** + * Pointer to utility object that handles special client resolving in + * __VOIP enabled terminals. In __VOIP disabled terminals creation of + * this object will fail because of missing UID in CenRep and thus this + * pointer can be NULL. If this object does not exist, standard client + * resolving will be used. + */ + CMusAvaClientResolverUtil* iClientResolverUtil; + + TUint32 iIapId; + + MUS_UNITTEST( UT_CMusAvaOptionHandler ) + MUS_UNITTEST( UT_CMusAvaSip ) + MUS_UNITTEST( UT_CMusAvaRegisterAvailability ) + MUS_UNITTEST( UT_CMusAvaConnectionMonitor ) + MUS_UNITTEST( UT_CMusAvaCapabilitySipAgent ) + MUS_UNITTEST( UT_CMusAvaCapabilityExchange ) + }; + +#endif + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/inc/musavasipadapter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/inc/musavasipadapter.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,71 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef MMUSAVASIPADAPTER_H +#define MMUSAVASIPADAPTER_H + +// INCLUDES +#include + +// FORWARD DECLARATIONS +class CSIPServerTransaction; + +// CLASS DECLARATION + +/** +* @publishedAll +* @released +* +* An interface to be implemented by users of CSIPConnection. +* Interface allows to be able to receive requests, responses, connection state +* notifications and error notifications from sip stack. +* +* Note: The client must not delete related CSIPConnection object +* during the execution of the interface function. +* +* @lib n/a +*/ + +class MMusAvaSipAdapter + { + public: + /** + * A SIP request has been received from the network. + * This function is called when the SIP request was received using such + * an IAP, for which the application has not created a CSIPConnection + * object. + * @pre aTransaction != 0 + * @param aIapId The IapId from which the SIP request was received. + * @param aTransaction contains local address, remote address of a SIP + * message, as well as optional SIP message method, headers and + * body. The ownership is transferred. + */ + virtual TInt IncomingRequest(TUint32 aIapId, + CSIPServerTransaction* aTransaction) = 0; + + /** + * The received SIP request time-outed and it is invalid i.e. cannot be used + * anymore. + * This will be called if the user fails to create a SIP connection and + * does not send an appropriate SIP response. + * @param aTransaction The time-outed transaction. + */ + virtual TInt TimedOut(CSIPServerTransaction& aTransaction) = 0; + }; + +#endif // MMUSAVASIPCONNECTIONADAPTER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/inc/musavasipconnectionadapter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/inc/musavasipconnectionadapter.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,232 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef MMUSAVASIPCONNECTIONADAPTER_H +#define MMUSAVASIPCONNECTIONADAPTER_H + +// INCLUDES +#include "sipconnection.h" + +// FORWARD DECLARATIONS +class CSIPDialogAssocBase; +class CSIPInviteDialogAssoc; +class CSIPRegistrationBinding; +class CSIPDialog; +class CSIPTransactionBase; +class CSIPServerTransaction; + +// CLASS DECLARATION + +/** +* @publishedAll +* @released +* +* An interface to be implemented by users of CSIPConnection. +* Interface allows to be able to receive requests, responses, connection state +* notifications and error notifications from sip stack. +* +* Note: The client must not delete related CSIPConnection object +* during the execution of the interface function. +* +* @lib n/a +*/ + +class MMusAvaSipConnectionAdapter + { + public: + /** + * A SIP request outside a dialog has been received from the network. + * + * @pre aTransaction != 0 + * @param aTransaction SIP server transaction. The ownership is + * transferred. + */ + virtual TInt IncomingRequest (CSIPServerTransaction* + /*aTransaction*/) { return KErrNotFound; } + + /** + * A SIP request within a dialog has been received from the network. + * The client must resolve the actual dialog association to which + * this request belongs. + * + * @pre aTransaction != 0 + * @param aTransaction SIP server transaction. The ownership is + * transferred. + * @param aDialog the dialog that this transaction belongs to. + */ + virtual TInt IncomingRequest (CSIPServerTransaction* /*aTransaction*/, + CSIPDialog& /*aDialog*/) { return KErrNotFound; } + + /** + * A SIP response received from the network. + * + * @param aTransaction contains response elements. + */ + virtual TInt IncomingResponse (CSIPClientTransaction& + /*aTransaction*/) { return KErrNotFound; } + + /** + * A SIP response received from the network that is within a dialog + * association or creates a dialog association. + * + * @param aTransaction contains response elements. + * @param aDialogAssoc a dialog association. + */ + virtual TInt IncomingResponse ( + CSIPClientTransaction& /*aTransaction*/, + CSIPDialogAssocBase& /*aDialogAssoc*/) { return KErrNotFound; } + + /** + * Multiple SIP responses have been received to the single INVITE due + * to the forking proxy. Note that each response creates a separate + * INVITE dialog association. + * Multiple responses can arrive until SIP stack completes UAC core + * INVITE transaction. + * If clients deletes INVITE transaction after first SIP response + * other possible responses will be consumed by the implementation. + * + * @param aTransaction contains response elements + * @param aDialogAssoc INVITE dialog association; the ownership is + * transferred + */ + virtual TInt IncomingResponse ( + CSIPClientTransaction& /*aTransaction*/, + CSIPInviteDialogAssoc* /*aDialogAssoc*/) { return KErrNotFound; } + + /** + * A SIP response related a registration binding or an error response + * that is related to registration binding has been received + * from the network. + * + * @param aTransaction contains response elements + * @param aRegistration registration binding this transaction belongs to + */ + virtual TInt + IncomingResponse (CSIPClientTransaction& /*aTransaction*/, + CSIPRegistrationBinding& /*aRegistration*/) { return KErrNotFound; } + + /** + * An asynchronous error has occurred in the stack related to the + * request indicated by the given transaction. + * + * @param aError system wide or SIP error code + * @param aTransaction failed transaction + * @param aSIPConnection a SIP connection + */ + virtual TInt ErrorOccured (TInt /*aError*/, + CSIPTransactionBase& /*aTransaction*/) { return KErrNotFound; } + + /** + * An asynchronous error has occurred in the stack related + * to the request indicated by the given transaction. + * + * @param aError system wide or SIP error code + * @param aTransaction the failed transaction + * @param aRegistration the failed registration binding + */ + virtual TInt ErrorOccured( TInt /*aError*/, + CSIPClientTransaction& /*aTransaction*/, + CSIPRegistrationBinding& /*aRegistration*/) + { return KErrNotFound; } + + /** + * An asynchronous error has occured related to a request within + * an existing dialog. + * + * @param aError system wide or SIP error code + * @param aTransaction the failed transaction. + * @param aDialogAssoc the failed dialog associoation. + */ + virtual TInt ErrorOccured ( + TInt /*aError*/, + CSIPTransactionBase& /*aTransaction*/, + CSIPDialogAssocBase& /*aDialogAssoc*/) { return KErrNotFound; } + + /** + * An asynchronous error has occured related to a refresh + * + * @param aError system wide or SIP error code + * @param aSIPRefresh original refresh object. + */ + virtual TInt ErrorOccured ( TInt /*aError*/, + CSIPRefresh& /*aSIPRefresh*/ ) { return KErrNotFound; } + + /** + * An asynchronous error has occured related to a periodical refresh + * that relates to a registration. + * + * @param aError system wide or SIP error code; + * KErrCouldNotConnect if the refresh has failed + * due to the suspended connection. + * @param aRegistration associated registration binding + */ + virtual TInt ErrorOccured( TInt /*aError*/, + CSIPRegistrationBinding& /*aRegistration*/ ) { return KErrNotFound; } + + /** + * An asynchronous error has occured related to a periodical refresh + * that belongs to SIP dialog association. + * + * @param aError system wide or SIP error code; + * KErrCouldNotConnect if the refresh has failed + * due to the suspended connection. + * @param aDialogAssoc SIP dialog association. + */ + virtual TInt ErrorOccured( TInt /*aError*/, + CSIPDialogAssocBase& /*aDialogAssoc*/) + { return KErrNotFound; } + + /** + * SIP stack has completed UAC core INVITE transaction 64*T1 seconds + * after the reception of the first 2xx response. No more 2xx responses + * can be received to the issued single INVITE. + * + * If the INVITE transaction does not create a dialog, or the INVITE + * transaction encounters an error, this event will not be sent. + * + * @param aTransaction a complete UAC core INVITE transaction + */ + virtual TInt InviteCompleted (CSIPClientTransaction& /*aTransaction*/) + { return KErrNotFound; } + + /** + * Invite was canceled with the CANCEL + * @param aTransaction a canceled INVITE UAS transaction + */ + virtual TInt InviteCanceled (CSIPServerTransaction& /*aTransaction*/) + { return KErrNotFound; } + + /** + * Connection state has changed. + * If connection state has changed to EInactive or EUnavailable, + * SIP stack has removed all stand-alone SIP refreshes, registrations + * and dialog associations that client requested to refresh. Client may + * re-issue refresh requests (stand-alone, registration or dialog + * association related) when connection becomes EActive again. + * SIP stack also terminates all pending SIP client transactions and no + * errors are reported back to the client about the terminated + * transactions nor about removed refreshes in order to avoid event + * flood. + * + * @param aState indicates the current connection state + */ + virtual TInt ConnectionStateChanged (CSIPConnection::TState /*aState*/) + { return KErrNotFound; } + }; + +#endif // MMUSAVASIPCONNECTIONADAPTER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/inc/musavasipconnectionobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/inc/musavasipconnectionobserver.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,285 @@ +/* +* 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: CMusAvaSipConObserver is SIP API observer class. +* +*/ + + + +#ifndef MUSAVASIPCONNECTIONOBSERVER_H +#define MUSAVASIPCONNECTIONOBSERVER_H + +#include +#include +#include "musunittesting.h" + +class CMusAvaSip; +class CSIPDialog; +class CSIPServerTransaction; +class CSIPClientTransaction; +class CSIPDialogAssocBase; +class CSIPRegistrationBinding; +class MMusAvaSipConnectionAdapter; +class CMusAvaSipDefaultHandler; + +/** + * CMusAvaSipConnectionObserver implements observer interface of SIP API + * + * + * + * @lib musavailabilityplugin.lib + * @since S60 v3.2 + */ + + +class CMusAvaSipConnectionObserver : public CBase, + public MSIPConnectionObserver + { + +public: // constructors and destructor + + /** + * Two-phased constructor. + * + * @since S60 v3.2 + * @param aMusAvaSip pointer to CMusAvaSip + */ + static CMusAvaSipConnectionObserver* NewL(); + + /** + * Destructor. + */ + ~CMusAvaSipConnectionObserver(); + +public: + /** + * . + */ + void AddObserverL( MMusAvaSipConnectionAdapter& aAdapter, TInt aIndex ); + + /** + * . + */ + void RemoveObserver( MMusAvaSipConnectionAdapter& aAdapter ); + + +public: // functions from base classes + + /** + * A SIP request outside a dialog has been received from the network. + * + * @since S60 v3.2 + * @param aTransaction SIP server transaction. The ownership is + * transferred. + */ + void IncomingRequest ( CSIPServerTransaction* aTransaction ); + + /** + * A SIP request within a dialog has been received from the network. + * The client must resolve the actual dialog association to which + * this request belongs. + * + * @since S60 v3.2 + * @param aTransaction SIP server transaction. The ownership is + * transferred. + * @param aDialog the dialog that this transaction belongs to. + */ + void IncomingRequest( CSIPServerTransaction* aTransaction, + CSIPDialog& aDialog ); + + /** + * A SIP response received from the network. + * + * @since S60 v3.2 + * @param aTransaction contains response elements. + */ + void IncomingResponse( CSIPClientTransaction& aTransaction ); + + /** + * A SIP response that is within a dialog association or creates + * a dialog association. + * + * @since S60 v3.2 + * @param aTransaction contains response elements. + * @param aDialogAssoc a dialog association. + */ + void IncomingResponse( CSIPClientTransaction& aTransaction, + CSIPDialogAssocBase& aDialogAssoc ); + + /** + * Multiple SIP responses have been received to the single INVITE due + * to the forking proxy. Note that each response creates a separate + * INVITE dialog association. + * Multiple responses can arrive until SIP stack completes UAC core + * INVITE transaction. + * If clients deletes INVITE transaction after first SIP response + * other possible responses will be consumed by the implementation. + * + * @since S60 v3.2 + * @param aTransaction contains response elements + * @param aDialogAssoc INVITE dialog association; the ownership is + * transferred + */ + void IncomingResponse( CSIPClientTransaction& aTransaction, + CSIPInviteDialogAssoc* aDialogAssoc ); + /** + * A SIP response related a registration binding or an error response + * that is related to a refreshed registration binding has been received + * from the network. + * + * @since S60 v3.2 + * @param aTransaction contains response elements. + * @param aRegistration associated registration binding. + */ + void IncomingResponse (CSIPClientTransaction& aTransaction, + CSIPRegistrationBinding& aRegistration); + + /** + * An asynchronous error has occurred in the stack related to the + * request indicated by the given transaction. + * + * @since S60 v3.2 + * @param aError error code + * @param aTransaction failed transaction. + * @param aSIPConnection a SIP connection + */ + void ErrorOccured( TInt aError, + CSIPTransactionBase& aTransaction ); + + /** + * An asynchronous error has occurred in the stack related + * to the request indicated by the given transaction. + * + * @since S60 v3.2 + * @param aError system wide or SIP error code + * @param aTransaction the failed transaction + * @param aRegistration the failed registration binding + */ + void ErrorOccured (TInt aError, + CSIPClientTransaction& aTransaction, + CSIPRegistrationBinding& aRegistration); + + /** + * An asynchronous error has occured related to a request within + * an existing dialog. + * + * @since S60 v3.2 + * @param aError error code + * @param aTransaction the failed transaction. + * @param aDialogAssoc the failed dialog associoation. + */ + void ErrorOccured( TInt aError, + CSIPTransactionBase& aTransaction, + CSIPDialogAssocBase& aDialogAssoc ); + + /** + * An asynchronous error has occured related to a refresh + * + * @since S60 v3.2 + * @param aError error code + * @param aSIPRefresh original refresh object. + */ + void ErrorOccured( TInt aError, CSIPRefresh& aSIPRefresh ); + + /** + * An asynchronous error has occured related to a periodical refresh + * that relates to a registration. + * + * @since S60 v3.2 + * @param aError system wide or SIP error code; + * KErrCouldNotConnect if the refresh has failed + * due to the suspended connection. + * @param aRegistration associated registration binding + */ + void ErrorOccured (TInt aError, + CSIPRegistrationBinding& aRegistration); + + /** + * An asynchronous error has occured related to a periodical refresh + * that belongs to SIP dialog association. + * + * @since S60 v3.2 + * @param aError error code + * @param aDialogAssoc SIP dialog association. + */ + void ErrorOccured( TInt aError, + CSIPDialogAssocBase& aDialogAssoc ); + + + /** + * SIP stack has completed UAC core INVITE transaction 64*T1 seconds + * after the reception of the first 2xx response. No more 2xx responses + * can be received to the issued single INVITE. + * + * If the INVITE transaction does not create a dialog, or the INVITE + * transaction encounters an error, this event will not be sent. + * + * @since S60 v3.2 + * @param aTransaction a complete UAC core INVITE transaction + */ + void InviteCompleted (CSIPClientTransaction& aTransaction); + + /** + * Invite was canceled with the CANCEL + * + * @since S60 v3.2 + * @param aTransaction a canceled INVITE UAS transaction + */ + void InviteCanceled (CSIPServerTransaction& aTransaction); + + /** + * Connection state has changed. + * If connection state has changed to EInactive or EUnavailable, + * SIP stack has removed all stand-alone SIP refreshes, registrations + * and dialog associations that client requested to refresh. Client may + * re-issue refresh requests (stand-alone, registration or dialog + * association related) when connection becomes EActive again. + * SIP stack also terminates all pending SIP client transactions and no + * errors are reported back to the client about the terminated + * transactions nor about removed refreshes in order to avoid event + * flood. + * + * @since S60 v3.2 + * @param aState indicates the current connection state + */ + void ConnectionStateChanged (CSIPConnection::TState aState); + + +private: + + /** + * C++ default constructor. + * @param aMusAvaSip pointer to CMusAvaSip + */ + CMusAvaSipConnectionObserver(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + +private: // data + + RPointerArray iObservers; + + CMusAvaSipDefaultHandler* iDefaultHandler; + +private: // For testing purposes + + //MUS_UNITTEST( UT_CMusAvaSip ) + MUS_UNITTEST( UT_CMusAvaSipConnectionObserver ) + + }; + +#endif // MUSAVASIPCONNECTIONOBSERVER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/inc/musavasipdefaulthandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/inc/musavasipdefaulthandler.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,244 @@ +/* +* 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: +* +*/ + + +#ifndef MUSAVASIPDEFAULTHANDLER_H +#define MUSAVASIPDEFAULTHANDLER_H + +// INCLUDES +#include "musavasipconnectionadapter.h" +#include "sipconnection.h" + +#include +#include +#include + +// FORWARD DECLARATIONS +class CSIPDialogAssocBase; +//class CSIPInviteDialogAssoc; +class CSIPRegistrationBinding; +class CSIPDialog; +class CSIPTransactionBase; +//class CSIPServerTransaction; + +// CLASS DECLARATION + +/** +* @publishedAll +* @released +* +* An interface to be implemented by users of CSIPConnection. +* Interface allows to be able to receive requests, responses, connection state +* notifications and error notifications from sip stack. +* +* Note: The client must not delete related CSIPConnection object +* during the execution of the interface function. +* +* @lib n/a +*/ + +class CMusAvaSipDefaultHandler : public CBase, + public MMusAvaSipConnectionAdapter + { + public: + /** + * A SIP request outside a dialog has been received from the network. + * + * @pre aTransaction != 0 + * @param aTransaction SIP server transaction. The ownership is + * transferred. + */ + virtual TInt IncomingRequest (CSIPServerTransaction* + aTransaction) + { + delete aTransaction; + return KErrNone; + } + + /** + * A SIP request within a dialog has been received from the network. + * The client must resolve the actual dialog association to which + * this request belongs. + * + * @pre aTransaction != 0 + * @param aTransaction SIP server transaction. The ownership is + * transferred. + * @param aDialog the dialog that this transaction belongs to. + */ + virtual TInt IncomingRequest (CSIPServerTransaction* aTransaction, + CSIPDialog& /*aDialog*/) + { + delete aTransaction; + return KErrNone; + } + + /** + * A SIP response received from the network. + * + * @param aTransaction contains response elements. + */ + virtual TInt IncomingResponse (CSIPClientTransaction& + /*aTransaction*/) { return KErrNone; } + + /** + * A SIP response received from the network that is within a dialog + * association or creates a dialog association. + * + * @param aTransaction contains response elements. + * @param aDialogAssoc a dialog association. + */ + virtual TInt IncomingResponse ( + CSIPClientTransaction& /*aTransaction*/, + CSIPDialogAssocBase& /*aDialogAssoc*/) { return KErrNone; } + + /** + * Multiple SIP responses have been received to the single INVITE due + * to the forking proxy. Note that each response creates a separate + * INVITE dialog association. + * Multiple responses can arrive until SIP stack completes UAC core + * INVITE transaction. + * If clients deletes INVITE transaction after first SIP response + * other possible responses will be consumed by the implementation. + * + * @param aTransaction contains response elements + * @param aDialogAssoc INVITE dialog association; the ownership is + * transferred + */ + virtual TInt IncomingResponse ( + CSIPClientTransaction& /*aTransaction*/, + CSIPInviteDialogAssoc* aDialogAssoc) + { + delete aDialogAssoc; + return KErrNone; + } + + /** + * A SIP response related a registration binding or an error response + * that is related to registration binding has been received + * from the network. + * + * @param aTransaction contains response elements + * @param aRegistration registration binding this transaction belongs to + */ + virtual TInt + IncomingResponse (CSIPClientTransaction& /*aTransaction*/, + CSIPRegistrationBinding& /*aRegistration*/) { return KErrNone; } + + /** + * An asynchronous error has occurred in the stack related to the + * request indicated by the given transaction. + * + * @param aError system wide or SIP error code + * @param aTransaction failed transaction + * @param aSIPConnection a SIP connection + */ + virtual TInt ErrorOccured (TInt /*aError*/, + CSIPTransactionBase& /*aTransaction*/) { return KErrNone; } + + /** + * An asynchronous error has occurred in the stack related + * to the request indicated by the given transaction. + * + * @param aError system wide or SIP error code + * @param aTransaction the failed transaction + * @param aRegistration the failed registration binding + */ + virtual TInt ErrorOccured (TInt /*aError*/, + CSIPClientTransaction& /*aTransaction*/, + CSIPRegistrationBinding& /*aRegistration*/) { return KErrNone; } + + /** + * An asynchronous error has occured related to a request within + * an existing dialog. + * + * @param aError system wide or SIP error code + * @param aTransaction the failed transaction. + * @param aDialogAssoc the failed dialog associoation. + */ + virtual TInt ErrorOccured ( + TInt /*aError*/, + CSIPTransactionBase& /*aTransaction*/, + CSIPDialogAssocBase& /*aDialogAssoc*/) { return KErrNone; } + + /** + * An asynchronous error has occured related to a refresh + * + * @param aError system wide or SIP error code + * @param aSIPRefresh original refresh object. + */ + virtual TInt ErrorOccured (TInt /*aError*/, CSIPRefresh& /*aSIPRefresh*/) { return KErrNone; } + + /** + * An asynchronous error has occured related to a periodical refresh + * that relates to a registration. + * + * @param aError system wide or SIP error code; + * KErrCouldNotConnect if the refresh has failed + * due to the suspended connection. + * @param aRegistration associated registration binding + */ + virtual TInt ErrorOccured (TInt /*aError*/, + CSIPRegistrationBinding& /*aRegistration*/) { return KErrNone; } + + /** + * An asynchronous error has occured related to a periodical refresh + * that belongs to SIP dialog association. + * + * @param aError system wide or SIP error code; + * KErrCouldNotConnect if the refresh has failed + * due to the suspended connection. + * @param aDialogAssoc SIP dialog association. + */ + virtual TInt ErrorOccured (TInt /*aError*/, + CSIPDialogAssocBase& /*aDialogAssoc*/) { return KErrNone; } + + /** + * SIP stack has completed UAC core INVITE transaction 64*T1 seconds + * after the reception of the first 2xx response. No more 2xx responses + * can be received to the issued single INVITE. + * + * If the INVITE transaction does not create a dialog, or the INVITE + * transaction encounters an error, this event will not be sent. + * + * @param aTransaction a complete UAC core INVITE transaction + */ + virtual TInt InviteCompleted (CSIPClientTransaction& /*aTransaction*/) { return KErrNone; } + + /** + * Invite was canceled with the CANCEL + * @param aTransaction a canceled INVITE UAS transaction + */ + virtual TInt InviteCanceled (CSIPServerTransaction& /*aTransaction*/) { return KErrNone; } + + /** + * Connection state has changed. + * If connection state has changed to EInactive or EUnavailable, + * SIP stack has removed all stand-alone SIP refreshes, registrations + * and dialog associations that client requested to refresh. Client may + * re-issue refresh requests (stand-alone, registration or dialog + * association related) when connection becomes EActive again. + * SIP stack also terminates all pending SIP client transactions and no + * errors are reported back to the client about the terminated + * transactions nor about removed refreshes in order to avoid event + * flood. + * + * @param aState indicates the current connection state + */ + virtual TInt ConnectionStateChanged (CSIPConnection::TState /*aState*/) { return KErrNone; } + }; + +#endif // MUSAVASIPDEFAULTHANDLER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/inc/musavasipheaderutil.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/inc/musavasipheaderutil.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,121 @@ +/* +* 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: Sent capability query (OPTIONS) +* +*/ + + +#ifndef CMUSAVASIPHEADERUTIL_H +#define CMUSAVASIPHEADERUTIL_H + + +#include +#include + +class CSIPHeaderBase; +class CSIPRequestElements; +class CSIPConnection; + +/** + * Utility class to add some of the sip headers. + * @precondition SIPStrings::OpenL() and + * SdpCodecStringPool::OpenL() should be called. + * Else most of the function will leave. + * @lib AlwaysOnlinePlugin.dll + */ +class CMusAvaSipheaderUtil : public CBase + { + +public: + + /** + * Utility class to add some of the sip headers. + * @precondition SIPStrings::OpenL() and + * SdpCodecStringPool::OpenL() should be called. + * Else most of the function will leave. + * @lib AlwaysOnlinePlugin.dll + */ + + static void AddAcceptContactHeaderL( + RPointerArray& aRequestHeaders, + const RStringF& aFeatureTag ); + + /** + * Utility class to add some of the sip headers. + * @precondition SIPStrings::OpenL() and + * SdpCodecStringPool::OpenL() should be called. + * Else most of the function will leave. + * @lib AlwaysOnlinePlugin.dll + */ + + static void AddAcceptEncodingHeaderL( + RPointerArray& aRequestHeaders ); + + /** + * Utility class to add some of the sip headers. + * @precondition SIPStrings::OpenL() and + * SdpCodecStringPool::OpenL() should be called. + * Else most of the function will leave. + * @lib AlwaysOnlinePlugin.dll + */ + + static void AddAcceptLanguageHeaderL( + RPointerArray& aRequestHeaders ); + + /** + * Utility class to add some of the sip headers. + * @precondition SIPStrings::OpenL() and + * SdpCodecStringPool::OpenL() should be called. + * Else most of the function will leave. + * @lib AlwaysOnlinePlugin.dll + */ + + static void AddSdpL( CSIPRequestElements* aRequest,HBufC8* aContent ); + + /** + * Utility class to add some of the sip headers. + * @precondition SIPStrings::OpenL() and + * SdpCodecStringPool::OpenL() should be called. + * Else most of the function will leave. + * @lib AlwaysOnlinePlugin.dll + */ + + static void AddPreferredIdentityHeaderL( + RPointerArray& aRequestHeaders, + const TDesC8& aVal ); + + /** + * Utility class to add some of the sip headers. + * @precondition SIPStrings::OpenL() and + * SdpCodecStringPool::OpenL() should be called. + * Else most of the function will leave. + * @lib AlwaysOnlinePlugin.dll + */ + + static void LocalHostL(const CSIPConnection& aConn, TPtrC8& aLocalHost); + + /** + * Utility class to add some of the sip headers. + * @precondition SIPStrings::OpenL() and + * SdpCodecStringPool::OpenL() should be called. + * Else most of the function will leave. + * @lib AlwaysOnlinePlugin.dll + */ + + static void AddAcceptSdpHeaderL(RPointerArray& aRequestHeaders ); + + }; + + +#endif // CMUSAVASIPHEADERUTIL_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/inc/musavasipobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/inc/musavasipobserver.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,132 @@ +/* +* 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: This observer is used to get function call from SIP Server +* +*/ + + +#ifndef MUSAVASIPOBSERVER +#define MUSAVASIPOBSERVER + +// INCLUDES +#include "musunittesting.h" +#include + +#include +#include + +class CSIPServerTransaction; +class MMusAvaSipAdapter; +/** + * SIP Observer class + * + * SIP Server Observer interface for MusAvailability Plug-in. + * + * @lib musavailabilityplugin.lib + * @since S60 v3.2 + */ + + +class CMusAvaSipObserver : public CBase, + public MSIPObserver + { +public: + /** + * Two-phased constructor + * + * @since S60 v3.2 + * @param aObserver Pointer to observer intercase + * @return Returns pointer to CMusAvaInterface object + */ + + static CMusAvaSipObserver* NewL(); + + /** + * Destructor + * + * @since S60 v3.2 + * @param + * @return + */ + + ~CMusAvaSipObserver(); + + protected: + /** + * Constructor + * + * @since S60 v3.2 + * @return + */ + + CMusAvaSipObserver(); + + /** + * Perform the second phase construction of a + * CMusAvaSipObserver object + * + * @since S60 v3.2 + * @param + * @return + */ + + void ConstructL(); + +public: // new functions + + void AddObserverL( MMusAvaSipAdapter& aAdapter, TInt aIndex ); + + void RemoveObserver( MMusAvaSipAdapter& aAdapter ); + +public: // from base class MSIPObserver + + /** + * A SIP request has been received from the network. + * This function is called when the SIP request was received using such + * an IAP, for which the application has not created a CSIPConnection + * object. + * + * @since S60 v3.2 + * @pre aTransaction != 0 + * @param aIapId The IapId from which the SIP request was received. + * @param aTransaction contains local address, remote address of a SIP + * message, as well as optional SIP message method, headers and + * body. The ownership is transferred. + * @return + */ + void IncomingRequest(TUint32 aIapId, + CSIPServerTransaction* aTransaction); + + /** + * The received SIP request time-outed and it is invalid i.e. cannot be used + * anymore. + * This will be called if the user fails to create a SIP connection and + * does not send an appropriate SIP response. + * + * @since S60 v3.2 + * @param aTransaction The time-outed transaction. + * @return + */ + void TimedOut(CSIPServerTransaction& aTransaction); + +private: + + RPointerArray iObservers; + + MUS_UNITTEST( UT_CMusAvaSipObserver ) + + }; + + +#endif //MMUSAVASIPOBSERVER diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/inc/musavasipprofileavailability.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/inc/musavasipprofileavailability.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,141 @@ +/* +* Copyright (c) 2005-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: Provide interface for the client requestin register availability. +* +*/ + + + +#ifndef __MUSAVASIPPROFILEAVAILABILITY_H__ +#define __MUSAVASIPPROFILEAVAILABILITY_H__ + + +#include "musunittesting.h" +#include "musavaavailability.h" +#include "musavasipconnectionadapter.h" +#include "musavasipprofileregistryadapter.h" +#include +#include + + +class CMusAvaSettingsImp; +class CSIPProfileRegistry; +class CSIPProfile; +class MMusAvaObserver; +class CMusAvaSharedObject; +class CSIPProfile; +class CSIPProfileRegistry; +class CSIPConnection; + + +/** + * Implemets register vailability. + * + * Provide interface for the client to availability class. + * + * @lib musavailabilityplugin.lib + * @since S60 v3.2 + */ +class CMusAvaSipprofileAvailability : public CMusAvaAvailability + + { +public: + + /** + * Two-phased constructor + * + * @since S60 v3.2 + * @param aObserver Pointer to observer intercase + * @param aModules is data container + * @return Returns pointer to CMusAvaInterface object + */ + static CMusAvaSipprofileAvailability* NewL( + MMusAvaAvailabilityObserver& aObserver); + + + static CMusAvaSipprofileAvailability* NewLC( + MMusAvaAvailabilityObserver& aObserver); + + /** + * Destructor + */ + + ~CMusAvaSipprofileAvailability(); + + protected: + + /** + * Constructor + * + * @since S60 v3.2 + * @param aObserver Pointer to observer intercase + * @param aName availability name + * @param aModules is data container + * @return + */ + CMusAvaSipprofileAvailability( + MMusAvaAvailabilityObserver& aObserver); + + void ConstructL(); + +// from base class CMusAvaAvailability + +public: + + /** + * Executes for the availability. + */ + virtual void DoExecuteL(); + + /** + * Stop the execution. + */ + virtual void Stop(); + + /** + * From CMusAvaAvailability. + * Returns availability name. + * + * @return Name of *this* availability. + */ + virtual MMusAvaObserver::TAvailabilityName Name(); + +private: // Helpers + + /** + * Creates proposal sip address and send event. + * + */ + TBool IsProfileExist(); + + /** + * Sets the iState to current state of sip profile existence. + * + */ + void SetProfileState(); + +private: // Data + + /** + * Pointer to CMusAvaSharedObject object + */ + CMusAvaSharedObject* iSharedObj; + + + MUS_UNITTEST( UT_CMusAvaSipprofileAvailability ) + }; + + +#endif // __MUSAVASIPPROFILEAVAILABILITY_H__ + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/inc/musavasipprofileregistryadapter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/inc/musavasipprofileregistryadapter.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,57 @@ +/* +* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 observer class for monitoring SIP profiles. +* +*/ + + +#ifndef MMUSAVASIPPROFILEREGISTRYADAPTER_H +#define MMUSAVASIPPROFILEREGISTRYADAPTER_H + +#include +#include + +/** +* @publishedAll +* @released +* +* The observer class for monitoring SIP profiles. +* Class must be implemented by the user in order to +* observe changes in the SIP profiles. +*/ +class MMusAvaSipProfileRegistryAdapter + { +public: // from MSIPProfileRegistryObserver + + /** + * An event related to SIP Profile has accorred + * @param aProfileId a profile Id + * @param aEvent an occurred event + **/ + virtual void ProfileRegistryEventOccurred( + TUint32 /*aProfileId*/, + MSIPProfileRegistryObserver::TEvent /*aEvent*/ ) { } + + /** + * An asynchronous error has occurred related to SIP profile + * Event is send to those observers, who have the + * corresponding profile instantiated. + * @param aProfileId the id of failed profile + * @param aError an occurred error + */ + virtual void ProfileRegistryErrorOccurred( TUint32 /*aProfileId*/, + TInt /*aError*/ ) { } + }; + +#endif // MMUSAVASIPPROFILEREGISTRYADAPTER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/inc/musavasipprofileregistryobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/inc/musavasipprofileregistryobserver.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,105 @@ +/* +* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 observer class for monitoring SIP profiles. +* +*/ + + +#ifndef MSIPPROFILEREGISTRYOBSERVER_H +#define MSIPPROFILEREGISTRYOBSERVER_H + +// INCLUDES +#include "musavasipprofileregistryobserver.h" +#include "musunittesting.h" + +#include +#include +#include + +// FORWARD DECLARATIONS + +class MMusAvaSipProfileRegistryAdapter; + +// CLASS DECLARATION +/** +* @publishedAll +* @released +* +* The observer class for monitoring SIP profiles. +* Class must be implemented by the user in order to +* observe changes in the SIP profiles. +*/ +class CMusAvaSipProfileRegistryObserver : public CBase, + public MSIPProfileRegistryObserver + + { +public: + + /** + * + **/ + static CMusAvaSipProfileRegistryObserver* NewL(); + + /** + * + **/ + ~CMusAvaSipProfileRegistryObserver(); + +public: + + /** + * + **/ + void AddAdapterL( MMusAvaSipProfileRegistryAdapter& aAdapter ); + + /** + * + **/ + void RemoveAdapter( MMusAvaSipProfileRegistryAdapter& aAdapter ); + +public: // from MSIPProfileRegistryObserver + + /** + * An event related to SIP Profile has accorred + * @param aProfileId a profile Id + * @param aEvent an occurred event + **/ + void ProfileRegistryEventOccurred(TUint32 aProfileId, + TEvent aEvent); + + /** + * An asynchronous error has occurred related to SIP profile + * Event is send to those observers, who have the + * corresponding profile instantiated. + * @param aProfileId the id of failed profile + * @param aError an occurred error + */ + void ProfileRegistryErrorOccurred(TUint32 aProfileId, + TInt aError); + +private: + + /** + * + **/ + CMusAvaSipProfileRegistryObserver(); + +private: + + MMusAvaSipProfileRegistryAdapter* iAdapter; + + MUS_UNITTEST( UT_CMusAvaSipProfileRegistryObserver ) + }; + +#endif // MSIPPROFILEREGISTRYOBSERVER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/inc/musavatelephonystatusbase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/inc/musavatelephonystatusbase.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,133 @@ +/* +* 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: Provide interface for the client requestin availability class. +* +*/ + + +#ifndef __MUSAVATELEPHONYSTATUSBASE_H__ +#define __MUSAVATELEPHONYSTATUSBASE_H__ + +#include "musunittesting.h" + +#include +#include +#include +#include +#include + +class MMusAvaTelephonyStatusObserver; + +/** + * This class monitors the phone status and resolves the contact + * information of the remote host in case of a connected cs call. + * + * @lib musavailabilityplugin.lib + * @since S60 v3.2 + */ +class CMusAvaTelephonyStatusBase : public CActive + { +public: + + /** + * Default destructor + * + * @since S60 v3.2 + */ + ~CMusAvaTelephonyStatusBase(); + +public: + + /** + * + * + * @since S60 v3.2 + * @param + */ + void AddAdapterL( MMusAvaTelephonyStatusObserver& aAdapter ); + + /** + * + * + * @since S60 v3.2 + * @param + */ + void RemoveAdapter( MMusAvaTelephonyStatusObserver& aAdapter ); + + + /** + * + * + * @since S60 v3.2 + * @param + */ + void virtual TelephonyStatus(); + +protected: // from CActive + + /** + * descr + * + * @since S60 v3.2 + */ + void RunL(); + + /** + * descr + * + * @since S60 v3.2 + */ + void DoCancel(); + + /** + * descr + * + * @since S60 v3.2 + */ + TInt RunError( TInt aError ); + +protected: + + /** + * Constructor. + * + * @since S60 v3.2 + */ + CMusAvaTelephonyStatusBase(); + + +protected: // data + + /** + * Array of MMusAvaConnectionMonitorObserver the callback interfaces + */ + RPointerArray iObserver; + + /** + * Reference to RMobilePhone object + */ + RMobilePhone iPhone; + + /** + * Reference to RTelServer object + */ + RTelServer iTelServer; + + + MUS_UNITTEST( UT_CMusAvaTelephonyStatusBase ) + MUS_UNITTEST( UT_CMusAvaConnectionAvailability ) + }; + + +#endif // __MUSAVATELEPHONYSTATUSBASE_H__ \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/inc/musavatelephonystatusobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/inc/musavatelephonystatusobserver.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,60 @@ +/* +* 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: This observer is used by master - slave pattern to get +* function call from the slave (availability) +* +*/ + + +#ifndef MUSAVATELEPHONYSTATUSOBSERVER_H +#define MUSAVATELEPHONYSTATUSOBSERVER_H + +/** + * Availability Observer base class + * + * Observer interface for master clients. + * + * @lib musavailabilityplugin.lib + * @since S60 v3.2 + */ + +#include + +class MMusAvaTelephonyStatusObserver + { + +public: + + /** + * Current Network Mode Status + * + * @since S60 v3.2 + * @return + */ + virtual void PhoneNetworkModeStatus( + RMobilePhone::TMobilePhoneNetworkMode aStatus ) = 0; + + /** + * Current Network Registration Status + * + * @since S60 v3.2 + * @return + */ + virtual void NetworkRegistrationStatus( + RMobilePhone::TMobilePhoneRegistrationStatus aRegStatus ) = 0; + }; + + + +#endif //MUSAVATELEPHONYSTATUSOBSERVER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/inc/musavaterminal.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/inc/musavaterminal.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,188 @@ +/* +* Copyright (c) 2005-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: Discovered terminal +* +*/ + +#ifndef CMUSAVATERMINAL_H +#define CMUSAVATERMINAL_H + +#include // CBase +#include "musunittesting.h" + + +class CMusAvaCapabilityQueryBase; +class CMusAvaCapability; +class CSIPClientTransaction; +class CSIPServerTransaction; +class CMusAvaCapabilityExchange; +class CSdpDocument; +class CSIPHeaderBase; +class CSIPResponseElements; + +/** + * Discovered terminal + * + * @lib musavailabilityplugin.dll + */ +class CMusAvaTerminal : public CBase + { + +public: // constructors and destructor + + + static CMusAvaTerminal* NewL( CMusAvaCapabilityExchange& aExchange, + const TDesC8& aTerminalUri, + const TDesC8& aTerminalId ); + + virtual ~CMusAvaTerminal(); + + +private: // constructors + + CMusAvaTerminal( CMusAvaCapabilityExchange& aExchange ); + + void ConstructL( const TDesC8& aTerminalUri , + const TDesC8& aTerminalId ); + + +public: // new functions + + /** + * Returns ID + * + * @return ID + */ + const TDesC8& Id() const; + + /** + * Returns (remote) URI + * + * @return (remote) URI + */ + const TDesC8& Uri() const; + + /** + * Checks if terminal matches given condition + * + * @param aTerminalUri terminal uri + * @param aTerminalId terminal uri + * @return ETrue, if there is a match + */ + TBool MatchL( const TDesC8& aTerminalUri, + const TDesC8& aTerminalId = KNullDesC8 ); + + /** + * Returns requested query (query from peer), if any + * + * @return executed query or NULL + */ + const CMusAvaCapability* RequestedQuery() const; + + /** + * Executes capability query. + * + * @param aQuery query to execute, ownership is transferred + */ + void ExecuteQueryL( CMusAvaCapabilityQueryBase* aQuery ); + + /** + * Called when final response to OPTIONS has been received + * + * @param aResponse final response to OPTIONS + * @return EFalse, if response was not consumed + */ + TBool QueryCompletedL( const CSIPClientTransaction& aResponse ); + + /** + * Called when query has been canceled. + * + * @return aTransaction the transaction, which caused cancelation + * @return EFalse, if not consumed + */ + TBool QueryCanceled( const CSIPClientTransaction& aTransaction ); + + /** + * Query state executing. + * + * @return ETrue if query executing, otherwise EFalse + */ + TBool QueryExecuting(); + + /** + * Called when OPTIONS request has been received + * + * @param aQuery query received + */ + void QueryRequestedL( CSIPServerTransaction& aQuery ); + + /** + * Attach query + * + * @param aQuery a query to be attached + * @return number of attached queries + */ + TInt AttachQuery( CMusAvaCapabilityQueryBase& aQuery ); + + /** + * Removes query + * + * @param aQuery a query to be detached + * @return number of attached queries + */ + TInt DetachQuery( CMusAvaCapabilityQueryBase& aQuery ); + + /** + * Returns ETrue, if terminal is fully discovered + * + * @return ETrue, if terminal is fully discovered + */ + TBool IsDiscovered(); + + +private: // new functions + + void AttachIdL( const TDesC8& aTerminalId ); + void AttachUriL( const TDesC8& aUri ); + void ResetAndDestroyQuery(); + TBool PopulateResponseL( CSIPServerTransaction& aQuery, + RPointerArray& aResponseHeaders, + CSdpDocument& aSdpContent ); + void AddResponseHeadersL( CSIPResponseElements& aResponse, + RPointerArray& aResponseHeaders ); + void AddResponseContentL( CSIPResponseElements& aResponse, + CSdpDocument& aSdpContent ); + + +private: // NOT owned data + + CMusAvaCapabilityExchange& iExchange; + CMusAvaCapability* iRequestedQuery; + +private: // data + + HBufC8* iTerminalId; + HBufC8* iUri; + CMusAvaCapabilityQueryBase* iQuery; + + TInt iQueries; + + MUS_UNITTEST ( UT_CMusAvaTerminal ) + MUS_UNITTEST ( UT_CMusAvaCapabilityExchange ) + MUS_UNITTEST ( UT_CMusAvaCapabilitySipAgent ) + MUS_UNITTEST ( UT_CMusAvaCapabilityQuery ) + }; + + +#endif // CMUSAVATERMINAL_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/src/musavacalleventmonitor.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/src/musavacalleventmonitor.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,285 @@ +/* +* Copyright (c) 2005-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 to watch call monitor event properties +* +*/ + + + +#include "musavacalleventmonitor.h" +#include "muslogger.h" +#include "mussesseioninformationapi.h" +#include "musresourceproperties.h" +#include "muscallmonitorobserver.h" +#include + +// -------------------------------------------------------------------------- +// Two phase constructor NewL() +// -------------------------------------------------------------------------- +// +CMusAvaCallEventMonitor* CMusAvaCallEventMonitor::NewL( + MMusCallMonitorObserver& aObserver ) + { + MUS_LOG( "mus: [MUSAOP] -> CMusAvaCallEventMonitor::NewL" ) + CMusAvaCallEventMonitor* self = + new (ELeave) CMusAvaCallEventMonitor( aObserver ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + MUS_LOG( "mus: [MUSAOP] <- CMusAvaCallEventMonitor::NewL" ) + return self; + } + +// -------------------------------------------------------------------------- +// Destructor +// -------------------------------------------------------------------------- +// +CMusAvaCallEventMonitor::~CMusAvaCallEventMonitor() + { + MUS_LOG( "-> CMusAvaCallEventMonitor::~CMusAoPlugin" ) + + MUS_LOG( "<- CMusAvaCallEventMonitor::~CMusAoPlugin" ) + } + +// -------------------------------------------------------------------------- +// Constructor +// -------------------------------------------------------------------------- +// +CMusAvaCallEventMonitor::CMusAvaCallEventMonitor( + MMusCallMonitorObserver& aObserver ) + :CActive( EPriorityNormal ), + iObserver( aObserver ) + { + } + +// -------------------------------------------------------------------------- +// Two phase constructor ConstructL() +// -------------------------------------------------------------------------- +// +void CMusAvaCallEventMonitor::ConstructL() + { + MUS_LOG( "mus: [MUSAOP] -> CMusAvaCallEventMonitor::ConstructL" ) + CActiveScheduler::Add( this ); + MUS_LOG( "mus: [MUSAOP] <- CMusAvaCallEventMonitor::ConstructL" ) + } + + +// -------------------------------------------------------------------------- +// Returns the status of the call +// -------------------------------------------------------------------------- +// +TInt CMusAvaCallEventMonitor::CallStatusL() + { + MUS_LOG( "mus: [CMusAvaCallEventMonitor] -> CMusAvaCallEventMonitor::\ + CallStatusL" ) + TInt callStatus; + User::LeaveIfError( RProperty::Get( + NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + callStatus ) ); + + MUS_LOG1( "mus: [CMusAvaCallEventMonitor] Call Event = %d ", + callStatus ) + MUS_LOG( "mus: [CMusAvaCallEventMonitor] <- CMusAvaCallEventMonitor::\ + CallStatusL" ) + return callStatus; + } + +// -------------------------------------------------------------------------- +// Returns the direction of connected call. +// -------------------------------------------------------------------------- +// +TInt CMusAvaCallEventMonitor::CallDirectionL() + { + MUS_LOG( "mus: [CMusAvaCallEventMonitor] -> CMusAvaCallEventMonitor::\ + CallDirectionL" ) + // retrieve call count + TInt direction( 0 ); + User::LeaveIfError( RProperty::Get( + NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallDirection, + direction ) ); + + MUS_LOG1( "mus: [CMusAvaCallEventMonitor] Call Direction = %d ", + direction ) + MUS_LOG( "mus: [CMusAvaCallEventMonitor] <- CMusAvaCallEventMonitor::\ + CallDirectionL" ) + return direction; + } + +// -------------------------------------------------------------------------- +// aTelNumber will be filled with telephone number or SIP URI of current +// connected call +// -------------------------------------------------------------------------- +// +void +CMusAvaCallEventMonitor::GetTelNumberL( TDes& aTelNumber, TBool& aIsSipUri ) + + { + MUS_LOG( "mus: [CMusAvaCallEventMonitor] -> CMusAvaCallEventMonitor::\ + GetTelNumberL" ) + + TInt error = RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusTelNumber, + aTelNumber ); + + MUS_LOG1( "mus: [CMusAvaCallEventMonitor] CMusAvaCallEventMonitor::\ + GetTelNumberL (%d)", error ) + + if ( error == KErrOverflow ) + { + MUS_LOG1( "mus: [CMusAvaCallEventMonitor] CMusAvaCallEventMonitor::\ + GetTelNumberL - Buffer too small (%d), leave", + aTelNumber.MaxLength() ) + User::Leave( error ); + } + User::LeaveIfError( error ); + + aIsSipUri = IsSipUri( aTelNumber ); + MUS_LOG1( "mus: [CMusAvaCallEventMonitor] CMusAvaCallEventMonitor::\ + GetTelNumberL (is SIP URI=%d)", aIsSipUri ) + + MUS_LOG( "mus: [CMusAvaCallEventMonitor] <- CMusAvaCallEventMonitor::\ + GetTelNumberL" ) + } + + +// -------------------------------------------------------------------------- +// Subscribe to the property, means start monitoring the property +// -------------------------------------------------------------------------- +// +void CMusAvaCallEventMonitor::StartMonitoringL() + { + MUS_LOG( "mus: [CMusAvaCallEventMonitor] -> CMusAvaCallEventMonitor::\ + StartMonitoringL" ) + if ( !IsActive() ) + { + MUS_LOG( "mus: [CMusAvaCallEventMonitor] CMusAvaCallEventMonitor::\ + StartMonitoringL - Not active, starting" ) + User::LeaveIfError( iPropertyEvent.Attach( + NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent ) ); + // initial subscription and process current property value + iPropertyEvent.Subscribe( iStatus ); + SetActive(); + } + MUS_LOG( "mus: [CMusAvaCallEventMonitor] <- CMusAvaCallEventMonitor::\ + StartMonitoringL" ) + } + + +// -------------------------------------------------------------------------- +// Called by Cancel() +// -------------------------------------------------------------------------- +// +void CMusAvaCallEventMonitor::DoCancel() + { + iPropertyEvent.Cancel(); + iPropertyEvent.Close(); + } + + +// -------------------------------------------------------------------------- +// Active Object RunL implementation. Will be called when property changes. +// -------------------------------------------------------------------------- +// +void CMusAvaCallEventMonitor::RunL() + { + MUS_LOG( "mus: [MUSAOP] -> CMusAvaCallEventMonitor::RunL" ) + + // resubscribe before processing new value to prevent missing updates + iPropertyEvent.Subscribe( iStatus ); + SetActive(); + + // property updated, get new value + TInt callStatus; + if ( iPropertyEvent.Get( callStatus ) == KErrNotFound ) + { + // property deleted + iObserver.NoActiveCallL(); + } + else + { + switch( callStatus ) + { + case NMusSessionInformationApi::ENoCall: + { + iObserver.NoActiveCallL(); + break; + } + + case NMusSessionInformationApi::ECallConnected: + { + TBuf telNumber; + TBool isSipUri( EFalse ); + GetTelNumberL( telNumber, isSipUri ); + iObserver.CallConnectedL( telNumber, isSipUri ); + break; + } + + case NMusSessionInformationApi::ECallHold: + { + TBuf telNumber; + TBool isSipUri( EFalse ); + GetTelNumberL( telNumber, isSipUri ); + iObserver.CallHoldL( telNumber, isSipUri ); + break; + } + + case NMusSessionInformationApi::EConferenceCall: + { + iObserver.ConferenceCallL(); + break; + } + + default: + { + iObserver.NoActiveCallL(); + break; + } + } + } + + MUS_LOG( "mus: [MUSAOP] <- CMusAvaCallEventMonitor::RunL" ) + } + + +// -------------------------------------------------------------------------- +// RunL leaves will be handled here. Make sure it returns KErrNone +// Otherwise Active Scheduler Error() will be called. +// -------------------------------------------------------------------------- +// +TInt CMusAvaCallEventMonitor::RunError( TInt aError ) + { + MUS_LOG1( "mus: [MUSAOP] -> CMusAvaCallEventMonitor::RunError(%d)", + aError ) + + // Not much things can be done here as cleanup operation. + aError = KErrNone; + + MUS_LOG( "mus: [MUSAOP] <- CMusAvaCallEventMonitor::RunError" ) + return aError; + } + + +// -------------------------------------------------------------------------- +// CMusAvaCallEventMonitor::IsSipUri() +// -------------------------------------------------------------------------- +// +TBool CMusAvaCallEventMonitor::IsSipUri( const TDesC& aTelNumber ) const + { + _LIT( KSipPrefix, "sip:" ); + TPtrC prefix = aTelNumber.Left( KSipPrefix().Length() ); + return prefix.Compare( KSipPrefix ) == 0; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/src/musavacapability.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/src/musavacapability.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,581 @@ +/* +* Copyright (c) 2005-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: Capability (answer to OPTIONS) +* +*/ + + + +#include "musavacapability.h" +#include "muslogger.h" +#include "musavacapabilityexchange.h" +#include "musavacapabilitycontext.h" +#include "mmusavacapabilityqueryobserver.h" +#include "mussettings.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +_LIT8(KSessionName, "-"); +_LIT8(KOriginFieldUser, "-"); + +const TInt KMaxNumAsStringSize = 16; + +// -------------------------------------------------------------------------- +// Symbian two-phase constructor +// -------------------------------------------------------------------------- +// + CMusAvaCapability* CMusAvaCapability::NewL( + CMusAvaCapabilityExchange& aExchange ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaCapability::NewL" ) + + CMusAvaCapability* self = new (ELeave) CMusAvaCapability( aExchange ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + MUS_LOG( "mus: [MUSAVA] <- CMusAvaCapability::NewL" ) + + return self; + } + +// -------------------------------------------------------------------------- +// C++ destructor +// -------------------------------------------------------------------------- +// +CMusAvaCapability::~CMusAvaCapability() + { + MUS_LOG( + "mus: [MUSAVA]: -> CMusAvaCapability::~CMusAvaCapability" ) + + iFeature.Close(); + SIPStrings::Close(); + SdpCodecStringPool::Close(); + + MUS_LOG( + "mus: [MUSAVA]: <- CMusAvaCapability::~CMusAvaCapability" ) + } + + +// -------------------------------------------------------------------------- +// C++ constructor +// -------------------------------------------------------------------------- +// +CMusAvaCapability::CMusAvaCapability( + CMusAvaCapabilityExchange& aExchange ) + : iExchange( aExchange ), + iIsEnabled( ETrue ) + { + } + + +// -------------------------------------------------------------------------- +// Symbian second-phase constructor +// -------------------------------------------------------------------------- +// +void CMusAvaCapability::ConstructL( ) + { + MUS_LOG( "mus: [MUSAVA]: -> CMusAvaCapability::ConstructL" ) + + MUS_LOG( "mus: [MUSAVATEST]: SIPStrings::OpenL()" ) + TRAP_IGNORE( SIPStrings::OpenL() ) + TRAP_IGNORE( SdpCodecStringPool::OpenL() ) + + MUS_LOG( "mus: [MUSAVATEST]: MusAvaCapabilityContext::SIPStringL( KCapabilitySwisFeature )" ) + iFeature = MusAvaCapabilityContext::SIPStringL( KCapabilitySwisFeature ); + + MUS_LOG( "mus: [MUSAVA]: <- CMusAvaCapability::ConstructL" ) + } + + +// -------------------------------------------------------------------------- +// CMusAvaCapability::Exchange +// -------------------------------------------------------------------------- +// +CMusAvaCapabilityExchange& CMusAvaCapability::Exchange() const + { + return iExchange; + } + + +// -------------------------------------------------------------------------- +// CMusAvaCapability::Feature +// -------------------------------------------------------------------------- +// +const RStringF& CMusAvaCapability::Feature() const + { + return iFeature; + } + + +// -------------------------------------------------------------------------- +// CMusAvaCapability::Supports +// -------------------------------------------------------------------------- +// +TBool CMusAvaCapability::Supports( + const CSIPAcceptContactHeader& acceptContact ) + { + return acceptContact.HasParam( Feature() ); + } + + +// -------------------------------------------------------------------------- +// CMusAvaCapability::Enabled +// -------------------------------------------------------------------------- +// +TBool& CMusAvaCapability::Enabled() + { + return iIsEnabled; + } + + +// -------------------------------------------------------------------------- +// CMusAvaCapability::PopulateResponseL +// -------------------------------------------------------------------------- +// +void CMusAvaCapability::PopulateResponseL( + CSIPServerTransaction& aQuery, + RPointerArray& aResponseHeaders, + CSdpDocument& aResponseContent ) + + { + MUS_LOG( "mus: [MUSAVA]: -> CMusAvaCapability::PopulateResponseL" ) + + AddContactHeaderL( aQuery, aResponseHeaders ); + + DoPopulateResponseL( aResponseContent ); + + MUS_LOG( "mus: [MUSAVA]: <- CMusAvaCapability::PopulateResponseL" ) + } + +// -------------------------------------------------------------------------- +// CMusAvaCapability::DoPopulateResponseL +// -------------------------------------------------------------------------- +// +void CMusAvaCapability::DoPopulateResponseL( CSdpDocument& aResponseContent ) + + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaCapability::DoPopulateResponseL" ) + + MUS_LOG( "mus: [MUSAVA] Adding application attribute to SDP" ) + //application + CSdpAttributeField* application = CSdpAttributeField::NewLC( + MusAvaCapabilityContext::SDPStringL( + SdpCodecStringConstants::EMediaApplication ), + KCapabilitySwisApplication ); + + aResponseContent.AttributeFields().AppendL( application ); + CleanupStack::Pop( application ); + + MUS_LOG( "mus: [MUSAVA] Adding type attribute to SDP" ) + //type + RStringF typeStr = MusAvaCapabilityContext::SDPStringL( + KCapabilitySDPAttributeNameType ); + CleanupClosePushL( typeStr ); + CSdpAttributeField* type = + CSdpAttributeField::NewL( typeStr, KCapabilitySDPAttributeType ); + CleanupStack::PopAndDestroy();//typeStr + CleanupStack::PushL( type ); + + aResponseContent.AttributeFields().AppendL( type ); + CleanupStack::Pop( type ); + + //Add fast startup mode, if supported + AddFastModeL( aResponseContent ); + + MUS_LOG( "mus: [MUSAVA] Adding media line to SDP" ) + //media line + CSdpMediaField* mediaLine = MediaLineLC( + MusAvaCapabilityContext::SDPStringL( + SdpCodecStringConstants::EMediaVideo ), + KCapabilitySwisFormatListH263Only ); + + //adding H.264 codec to SDP + if( !MultimediaSharingSettings::IsAvcDisabled()) + { + MUS_LOG( "mus: [MUSAVA] - Adding avc to supported codec list" ) + // reconstruct media line with H264 and H263 + CleanupStack::PopAndDestroy(mediaLine); + mediaLine = MediaLineLC( + MusAvaCapabilityContext::SDPStringL( + SdpCodecStringConstants::EMediaVideo ), + KCapabilitySwisFormatList ); + + //adding H.264 codec to SDP + CSdpFmtAttributeField* rtpMapH264 = + RtpMapLineLC( KCapabilitySDPAttributeCodecH264, + KCapabilitySDPAttributePayloadTypeH264, + KCapabilitySDPAttributeClockrate ); + + mediaLine->FormatAttributeFields().AppendL( rtpMapH264 ); + CleanupStack::Pop( rtpMapH264 ); + } + //H.263 codec + CSdpFmtAttributeField* rtpMapH263 = + RtpMapLineLC( KCapabilitySDPAttributeCodecH263, + KCapabilitySDPAttributePayloadType, + KCapabilitySDPAttributeClockrate ); + + mediaLine->FormatAttributeFields().AppendL( rtpMapH263 ); + CleanupStack::Pop( rtpMapH263 ); + + aResponseContent.MediaFields().AppendL( mediaLine ); + CleanupStack::Pop( mediaLine ); + + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaCapability::DoPopulateResponseL" ) + } + + +// -------------------------------------------------------------------------- +// CMusAvaCapability::ResponseContentLC +// -------------------------------------------------------------------------- +// +CSdpDocument* CMusAvaCapability::ResponseContentLC( + const CSIPServerTransaction& aQuery ) + + { + MUS_LOG( + "mus: [MUSAVA]: -> CMusAvaCapability::CreateResponseContentL" ) + + RStringF netType = + MusAvaCapabilityContext::SDPStringL( SdpCodecStringConstants::ENetType ); + + CSdpDocument* responseContent = CSdpDocument::NewLC(); + + responseContent->SetSessionNameL( KSessionName ); + + TPtrC8 localHost; + RStringF hostType; + + MusAvaCapabilityContext::LocalHostL( aQuery, localHost, hostType ); + + CSdpOriginField* originField = OriginFieldL( + netType, localHost, hostType ); + responseContent->SetOriginField( originField ); + + // Connection field + CSdpConnectionField* connectionField = + CSdpConnectionField::NewL( netType, hostType, localHost ); + responseContent->SetConnectionField( connectionField ); + + MUS_LOG( + "mus: [MUSAVA]: <- CMusAvaCapability::CreateResponseContentL" ) + + return responseContent; + } + + +// ----------------------------------------------------------------------------- +// CMusAvaCapability::Codec +// ----------------------------------------------------------------------------- +// +CDesCArrayFlat* CMusAvaCapability::ResolveCodecsL( CSdpDocument& aSDP ) + { + // TODO: use array of 2 elements, as we assume that max 2 codecs are supported (H.263 and H.264) + CDesCArrayFlat* codecs = new( ELeave ) CDesCArrayFlat( 2 ); + CleanupStack::PushL( codecs ); + + RStringF media = MusAvaCapabilityContext::SDPStringL( + SdpCodecStringConstants::EMediaVideo ); + + RStringF rtpmap = MusAvaCapabilityContext::SDPStringL( + SdpCodecStringConstants::EAttributeRtpmap ); + + RPointerArray& mediaFields = aSDP.MediaFields(); + + for ( TInt i=0; i < mediaFields.Count(); i++ ) + { + if ( mediaFields[ i ]->Media() == media ) + { + RPointerArray& fmtLines = + mediaFields[ i ]->FormatAttributeFields(); + + for ( TInt j=0; j < fmtLines.Count(); j++ ) + { + if ( fmtLines[ j ]->Attribute() == rtpmap ) + { + if ( CAPABILITY_CONTAINS( fmtLines[ j ]->Value(), KCapabilitySDPAttributeCodecH263 ) + || ( CAPABILITY_CONTAINS( fmtLines[ j ]->Value(), KCapabilitySDPAttributeCodecH264 ) && + !MultimediaSharingSettings::IsAvcDisabled() ) ) + { + HBufC* codecBuf = + EscapeUtils::ConvertToUnicodeFromUtf8L( fmtLines[ j ]->Value() ); + CleanupStack::PushL( codecBuf ); + codecs->AppendL( *codecBuf ); + CleanupStack::PopAndDestroy( codecBuf ); + } + } + } + } + } + CleanupStack::Pop( codecs ); + + return codecs; + } + +// ----------------------------------------------------------------------------- +// CMusAvaCapability::ResolveFastModeL +// ----------------------------------------------------------------------------- +// +MusSettingsKeys::TFastMode CMusAvaCapability::ResolveFastModeL( + CSdpDocument& aSDP ) + { + MUS_LOG( "mus: [MUSAVA]: -> CMusAvaCapability::ResolveFastModeL" ) + MusSettingsKeys::TFastMode mode = MusSettingsKeys::EFastModeOff; + if ( MultimediaSharingSettings::FastStartupModeL() == + MusSettingsKeys::EFastModeOn ) + { + MUS_LOG( "mus: [MUSAVA] Checking if a=keywds:fastmode present..." ) + const CSdpAttributeField* keywds = CMusAvaCapability::Attribute( + MusAvaCapabilityContext::SDPStringL( + SdpCodecStringConstants::EAttributeKeywds ), + aSDP ); + if ( keywds && + keywds->Value().Compare( KCapabilitySDPAttributeFastMode ) == 0 ) + { + mode = MusSettingsKeys::EFastModeOn; + } + } + MUS_LOG( "mus: [MUSAVA]: <- CMusAvaCapability::ResolveFastModeL" ) + return mode; + } + +// ----------------------------------------------------------------------------- +// CMusAvaCapability::ResolveFastModeL +// ----------------------------------------------------------------------------- +// +void CMusAvaCapability::AddFastModeL( CSdpDocument& aSdp ) + { + MUS_LOG( "mus: [MUSAVA]: -> CMusAvaCapability::AddFastModeL" ) + if ( MultimediaSharingSettings::FastStartupModeL() == + MusSettingsKeys::EFastModeOn ) + { + CSdpAttributeField* fastmode = CSdpAttributeField::NewLC( + MusAvaCapabilityContext::SDPStringL( + SdpCodecStringConstants::EAttributeKeywds ), + KCapabilitySDPAttributeFastMode ); + + aSdp.AttributeFields().AppendL( fastmode ); + CleanupStack::Pop( fastmode ); + } + MUS_LOG( "mus: [MUSAVA]: <- CMusAvaCapability::AddFastModeL" ) + } + + +// ----------------------------------------------------------------------------- +// CMusAvaCapability::Attribute +// ----------------------------------------------------------------------------- +// +const CSdpAttributeField* CMusAvaCapability::Attribute( + const RStringF& aAttribute, + CSdpDocument& aSDP ) + { + const CSdpAttributeField* field = NULL; + + TBool found = EFalse; + RPointerArray& attributes = aSDP.AttributeFields(); + + for ( TInt i=0; i < attributes.Count() && !found; i++ ) + { + if ( attributes[ i ]->Attribute() == aAttribute ) + { + field = attributes[ i ]; + found = ETrue; + } + } + + if ( !found ) + { + TRAP_IGNORE( field = Attribute( MusAvaCapabilityContext::SDPStringL( + SdpCodecStringConstants::EMediaVideo ), + aAttribute, + aSDP ) ); + } + return field; + } + + +// ----------------------------------------------------------------------------- +// CMusAvaCapability::Attribute +// ----------------------------------------------------------------------------- +// +const CSdpAttributeField* CMusAvaCapability::Attribute( + const RStringF& aMedia, + const RStringF& aAttribute, + CSdpDocument& aSDP ) + { + const CSdpAttributeField* field = NULL; + + TBool found = EFalse; + RPointerArray& mediaFields = aSDP.MediaFields(); + + for ( TInt i=0; i < mediaFields.Count() && !found; i++ ) + { + if ( mediaFields[ i ]->Media() == aMedia ) + { + RPointerArray& attributes = + mediaFields[ i ]->AttributeFields(); + + for ( TInt j=0; j < attributes.Count() && !found; j++ ) + { + if ( attributes[ j ]->Attribute() == aAttribute ) + { + field = attributes[ j ]; + found = ETrue; + } + } + } + } + return field; + } + + +// -------------------------------------------------------------------------- +// CMusAvaCapability::AddContactHeaderL +// -------------------------------------------------------------------------- +// +void CMusAvaCapability::AddContactHeaderL( + CSIPServerTransaction& aQuery, + RPointerArray& aResponseHeaders ) + { + MUS_LOG( "mus: [MUSAVA]: -> CMusAvaCapability::AddContactHeaderL" ) + + const CUri8& uri = aQuery.RequestElements()->RemoteUri(); + + + TBool cingular = + MultimediaSharingSettings::OperatorVariantSettingL() == + MusSettingsKeys::EOperatorSpecific; + + TBool alreadyRequested = iExchange.QueryObserver(). + CapabilitiesResolvedForCingular() && cingular; + + CSIPContactHeader* contact = NULL; + + if ( alreadyRequested ) + { + contact = MusAvaCapabilityContext::ContactHeaderLC( uri, + SIPStrings::StringF( SipStrConsts::EEmpty ) ); + } + else + { + //Contact header with feature tag + contact = MusAvaCapabilityContext::ContactHeaderLC( uri, Feature() ); + } + + aResponseHeaders.AppendL( contact ); + CleanupStack::Pop( contact ); + + MUS_LOG( "mus: [MUSAVA]: <- CMusAvaCapability::AddContactHeaderL" ) + } + + +// ---------------------------------------------------------------------------- +// CMusAvaCapability::OriginFieldL +// ---------------------------------------------------------------------------- +// +CSdpOriginField* CMusAvaCapability::OriginFieldL( + const RStringF& aNetType, + const TDesC8& aLocalHost, + const RStringF& aHostType ) + { +#ifdef CAPABILITY_UNIT_TESTING + TInt64 sessionID = 452027953; +#else + TTime now; + now.UniversalTime(); + TInt64 rand = now.Int64(); + TInt64 sessionID = Math::Rand( rand ); +#endif + + return CSdpOriginField::NewL( KOriginFieldUser, + sessionID, + sessionID, + aNetType, + aHostType, + aLocalHost ); + } + +// ----------------------------------------------------------------------------- +// CMusAvaCapability::MediaLineLC +// ----------------------------------------------------------------------------- +// +CSdpMediaField* CMusAvaCapability::MediaLineLC( const RStringF& aMedia, + const TDesC8& aFormatList ) const + { + return CSdpMediaField::NewLC( aMedia, + NULL, + MusAvaCapabilityContext::SDPStringL( + SdpCodecStringConstants::EProtocolRtpAvp ), + aFormatList ); + } + +// ----------------------------------------------------------------------------- +// CMusAvaCapability::RtpMapLineLC +// ------------------------------------------------ ----------------------------- +// +CSdpFmtAttributeField* CMusAvaCapability::RtpMapLineLC( + const TDesC8& aCodec, + const TUint64 aPayloadType, + const TUint64 aClockRate, + const TDesC8& aParams ) + { + + HBufC8* clockrate = HBufC8::NewLC( KMaxNumAsStringSize ); + clockrate->Des().Num( aClockRate, EDecimal ); + HBufC8* payload = HBufC8::NewLC( KMaxNumAsStringSize ); + payload->Des().Num( aPayloadType, EDecimal ); + + + TSdpRtpmapValue rtpmapValue( aCodec, + *clockrate, + aParams ); + + + HBufC8* rtpmap = rtpmapValue.EncodeL(); + CleanupStack::PushL( rtpmap ); + + CSdpFmtAttributeField* rtpmapAttribute = + CSdpFmtAttributeField::NewL( MusAvaCapabilityContext::SDPStringL( + SdpCodecStringConstants::EAttributeRtpmap ), + *payload, + *rtpmap ); + + CleanupStack::PopAndDestroy( rtpmap ); + CleanupStack::PopAndDestroy( payload ); + CleanupStack::PopAndDestroy( clockrate ); + + CleanupStack::PushL( rtpmapAttribute ); + + return rtpmapAttribute; + } + + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/src/musavacapabilitycontext.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/src/musavacapabilitycontext.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,458 @@ +/* +* Copyright (c) 2005-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: helper SIP related methods +* +*/ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "muslogger.h" +#include "musavacapabilitycontext.h" + +_LIT8( KMusAssertedIndentity,"P-Asserted-Identity" ); + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +RStringF MusAvaCapabilityContext::SDPStringL( TInt aStringIndex ) + { + return SdpCodecStringPool::StringPoolL(). + StringF( aStringIndex, SdpCodecStringPool::StringTableL() ); + } + + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +RStringF MusAvaCapabilityContext::SDPStringL( const TDesC8& aString ) + { + return SdpCodecStringPool::StringPoolL().OpenFStringL( aString ); + } + + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +RStringF MusAvaCapabilityContext::SIPStringL( const TDesC8& aString ) + { + return SIPStrings::Pool().OpenFStringL( aString ); + } + + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +void MusAvaCapabilityContext::LocalHostL( + const CSIPServerTransaction& aRequest, + TPtrC8& aLocalHost, + RStringF& aHostType ) + { + RStringPool strPool = SdpCodecStringPool::StringPoolL(); + + const CUri8& uri = aRequest.RequestElements()->RemoteUri(); + + aLocalHost.Set( uri.Uri().Extract( EUriHost ) ); + + if ( UriUtils::HostType( aLocalHost ) == UriUtils::EIPv6Host ) + { + aHostType = strPool.StringF( SdpCodecStringConstants::EAddressType, + SdpCodecStringPool::StringTableL() ); + } + else + { + aHostType = strPool.StringF( + SdpCodecStringConstants::EAddressTypeIP4, + SdpCodecStringPool::StringTableL() ); + } + } + + +// -------------------------------------------------------------------------- +// +// -------------------------------------------------------------------------- +// +CUri8* MusAvaCapabilityContext::ToUriL( const TDesC8& aUri ) + { + TUriParser8 uri; + User::LeaveIfError( uri.Parse( aUri ) ); + + return CUri8::NewL( uri ); + } + + +// -------------------------------------------------------------------------- +// +// -------------------------------------------------------------------------- +// +HBufC8* MusAvaCapabilityContext::ToTextL( CSdpDocument& aSdpContent ) + { + HBufC8* content = NULL; + + CBufFlat* encBuf = CBufFlat::NewL( KMUSAVAMaxLengthOfSDPMessage ); + CleanupStack::PushL( encBuf ); + RBufWriteStream writeStream( *encBuf, 0 ); + writeStream.PushL(); + aSdpContent.EncodeL( writeStream ); + CleanupStack::PopAndDestroy();//writeStream + + content = encBuf->Ptr( 0 ).AllocL(); + CleanupStack::PopAndDestroy( encBuf ); + + return content; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +const CSIPMessageElements& MusAvaCapabilityContext::MessageElementsL( + const CSIPTransactionBase& aTrx ) + { + const CSIPMessageElements* message = NULL; + + if ( aTrx.IsSIPClientTransaction() ) + { + + const CSIPResponseElements* response = + static_cast + ( aTrx ).ResponseElements(); + User::LeaveIfError( !response ? KErrGeneral : KErrNone ); + + message = &response->MessageElements(); + } + else + { + const CSIPRequestElements* request = + static_cast( aTrx ).RequestElements(); + User::LeaveIfError( !request ? KErrGeneral : KErrNone ); + + message = &request->MessageElements(); + } + + return *message; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CSIPAcceptContactHeader* MusAvaCapabilityContext::AcceptContactHeaderLC( + RStringF aValue ) + { + CSIPAcceptContactHeader* header = CSIPAcceptContactHeader::NewLC(); + + header->SetParamL( aValue ); + header->SetParamL( SIPStrings::StringF( SipStrConsts::EExplicit ) ); + + return header; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +const CSIPAcceptContactHeader* MusAvaCapabilityContext::AcceptContactHeaderL( + const CSIPTransactionBase& aTrx ) + { + return static_cast + ( Header( SIPStrings::StringF( SipStrConsts::EAcceptContactHeader ), + MessageElementsL( aTrx ) ) ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CSIPContactHeader* MusAvaCapabilityContext::ContactHeaderLC( + const CUri8& aAddress, + RStringF aValue ) + { + CUri8* uri = CUri8::NewLC( aAddress.Uri() ); + + /* + if ( !uri->Uri().IsPresent( EUriHost ) ) + { + uri->SetComponentL( + SIPStrings::StringF( SipStrConsts::ELocalHost ).DesC(), EUriHost ); + } + */ + + CSIPAddress* address = CSIPAddress::NewL( uri ); + CleanupStack::Pop( uri ); + CleanupStack::PushL( address ); + + CSIPContactHeader* header = CSIPContactHeader::NewL( address ); + CleanupStack::Pop( address ); + CleanupStack::PushL( header ); + + if ( aValue != SIPStrings::StringF( SipStrConsts::EEmpty ) ) + { + TInt separator = aValue.DesC().Find( KMUSAVASemicolon ); + if ( separator < KErrNone ) + { + header->SetParamL( aValue ); + } + else + { + TPtrC8 head = aValue.DesC().Left( separator ); + TPtrC8 tail = aValue.DesC().Mid( + separator + KMUSAVASemicolon().Length() ); + + RStringF theHead = SIPStringL( head ); + CleanupClosePushL( theHead ); + RStringF theTail = SIPStringL( tail ); + CleanupClosePushL( theTail ); + + header->SetParamL( theHead ); + header->SetParamL( theTail ); + + CleanupStack::PopAndDestroy();//theTail + CleanupStack::PopAndDestroy();//theHead + } + } + + return header; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +const CSIPContactHeader* MusAvaCapabilityContext::ContactHeaderL( + const CSIPTransactionBase& aTrx ) + { + return static_cast + ( Header( SIPStrings::StringF( SipStrConsts::EContactHeader ), + MessageElementsL( aTrx ) ) ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CSIPExtensionHeader* MusAvaCapabilityContext::UserAgentHeaderLC( + const TDesC8& aValue ) + { + return CSIPExtensionHeader::NewLC( KMUSAVASIPHeaderUserAgent, aValue ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +const CSIPExtensionHeader* MusAvaCapabilityContext::UserAgentHeaderL( + const CSIPTransactionBase& aTrx ) + { + RStringF userAgentHeaderName = SIPStringL( KMUSAVASIPHeaderUserAgent ); + CleanupClosePushL( userAgentHeaderName ); + + const CSIPExtensionHeader* header = + static_cast + ( Header( userAgentHeaderName, MessageElementsL( aTrx ) ) ); + + CleanupStack::PopAndDestroy();//userAgentHeaderName + + return header; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CSIPExtensionHeader* MusAvaCapabilityContext::PAssertedIdentityHeaderLC( + const TDesC8& aValue ) + { + return CSIPExtensionHeader::NewLC( KMUSAVASIPHeaderPAssertedIdentity, + aValue ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +const CUri8& MusAvaCapabilityContext::OriginatorL( + const CSIPServerTransaction& aTrx ) + { + const CSIPRequestElements* request = aTrx.RequestElements(); + User::LeaveIfError( !request ? KErrGeneral : KErrNone ); + + const CSIPFromHeader* from = request->FromHeader(); + + User::LeaveIfError( from ? KErrNone : KErrGeneral ); + + return from->SIPAddress().Uri8(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +const CSIPHeaderBase* MusAvaCapabilityContext::Header( + RStringF aHeaderName, + const CSIPMessageElements& aMessage ) + { + TBool found = EFalse; + CSIPHeaderBase* header = NULL; + const RPointerArray& headers = aMessage.UserHeaders(); + + for ( TInt i=0; i < headers.Count() && !found; i++ ) + { + header = headers[i]; + if ( header->Name() == aHeaderName ) + { + found = ETrue; + } + else + { + header = NULL; + } + } + return header; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +const CSIPHeaderBase* MusAvaCapabilityContext::Header( + RStringF aHeaderName, + const CSIPMessageElements& aMessage, + TUint aIndex ) + { + TInt found = -1; + CSIPHeaderBase* header = NULL; + const RPointerArray& headers = aMessage.UserHeaders(); + + for ( TInt i=0; i < headers.Count() && found != aIndex; i++ ) + { + header = headers[i]; + if ( header->Name() == aHeaderName ) + { + found++; + } + else + { + header = NULL; + } + } + return header; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TUint MusAvaCapabilityContext::HeaderCount( + RStringF aHeaderName, + const CSIPMessageElements& aMessage ) + { + TUint found = 0; + CSIPHeaderBase* header = NULL; + const RPointerArray& headers = aMessage.UserHeaders(); + + for ( TInt i=0; i < headers.Count(); i++ ) + { + header = headers[i]; + if ( header->Name() == aHeaderName ) + { + found++; + } + } + return found; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CDesCArrayFlat* MusAvaCapabilityContext::PAssertedIdentityHeaderL( + const CSIPMessageElements& aMessage ) + { + MUS_LOG( "mus: [MUSAVA] -> MusAvaCapabilityContext::PAssertedIdentityHeaderL" ) + + RStringF p = SIPStrings::Pool().OpenFStringL( KMusAssertedIndentity() ); + CleanupClosePushL( p ); + TInt headerCount = HeaderCount( p,aMessage); + + CDesCArrayFlat* headers = new( ELeave ) CDesCArrayFlat( 2 ); + CleanupStack::PushL( headers ); + + for ( TInt i=0; i < headerCount; i++ ) + { + const CSIPHeaderBase* pAssertedId = + MusAvaCapabilityContext::Header( p, aMessage, i ); + + if ( pAssertedId ) + { + HBufC8* value = pAssertedId->ToTextValueLC(); + CSIPAddress* address = CSIPAddress::DecodeL( *value ); + CleanupStack::PushL( address ); + const TDesC8& uriInPAssertedId = address->Uri8().Uri().UriDes(); + if ( uriInPAssertedId.Length() > 0 ) + { + HBufC* uriBuf = + EscapeUtils::ConvertToUnicodeFromUtf8L( uriInPAssertedId ); + CleanupStack::PushL( uriBuf ); + headers->AppendL( *uriBuf ); + CleanupStack::PopAndDestroy( uriBuf ); + } + CleanupStack::PopAndDestroy( address ); + CleanupStack::PopAndDestroy( value ); + } + } + + CleanupStack::Pop( headers ); + CleanupStack::PopAndDestroy( &p ); + + MUS_LOG( "mus: [MUSAVA] <- MusAvaCapabilityContext::PAssertedIdentityHeaderL" ) + return headers; + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/src/musavacapabilityexchange.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/src/musavacapabilityexchange.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,358 @@ +/* +* Copyright (c) 2005-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: Capability Exchange +* +*/ + + +#include "musavacapabilityexchange.h" +#include +#include +#include +#include +#include +#include +#include + + +#include "muslogger.h" +#include "musavaterminal.h" +#include "musavacapability.h" +#include "musavacapabilitycontext.h" + +// -------------------------------------------------------------------------- +// Symbian two-phase constructor +// -------------------------------------------------------------------------- +// +CMusAvaCapabilityExchange* CMusAvaCapabilityExchange::NewL( + const TDesC8& aTerminalId, + MMusAvaCapabilityQueryObserver& aQueryObserver ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaCapabilityExchange::NewL" ) + CMusAvaCapabilityExchange* self = + new (ELeave) CMusAvaCapabilityExchange( aQueryObserver ); + CleanupStack::PushL( self ); + self->ConstructL( aTerminalId ); + CleanupStack::Pop( self ); + MUS_LOG( "mus: [MUSAVA] <- CMusAvaCapabilityExchange::NewL" ) + return self; + } + + +// -------------------------------------------------------------------------- +// C++ destructor +// -------------------------------------------------------------------------- +// +CMusAvaCapabilityExchange::~CMusAvaCapabilityExchange() + { + MUS_LOG( + "mus: [MUSAVA] -> CMusAvaCapabilityExchange::~CMusAvaCapabilityExchange" ) + + delete iTerminalId; + iTerminals.ResetAndDestroy(); + iCapabilities.ResetAndDestroy(); + + MUS_LOG( + "mus: [MUSAVA] <- CMusAvaCapabilityExchange::~CMusAvaCapabilityExchange" ) + } + + +// -------------------------------------------------------------------------- +// C++ constructor +// -------------------------------------------------------------------------- +// +CMusAvaCapabilityExchange::CMusAvaCapabilityExchange( + MMusAvaCapabilityQueryObserver& aQueryObserver ) + : iQueryObserver( aQueryObserver ) + { + } + + +// -------------------------------------------------------------------------- +// Symbian second-phase constructor +// -------------------------------------------------------------------------- +// +void CMusAvaCapabilityExchange::ConstructL( const TDesC8& aTerminalId ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaCapabilityExchange::ConstructL" ) + + iTerminalId = aTerminalId.AllocL(); + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaCapabilityExchange::ConstructL" ) + } + + +// -------------------------------------------------------------------------- +// CMusAvaCapabilityExchange::QueryObserver +// -------------------------------------------------------------------------- +// +MMusAvaCapabilityQueryObserver& + CMusAvaCapabilityExchange::QueryObserver() const + { + return iQueryObserver; + } + + +// -------------------------------------------------------------------------- +// CMusAvaCapabilityExchange::TerminalId +// -------------------------------------------------------------------------- +// +const TDesC8& CMusAvaCapabilityExchange::TerminalId() const + { + return *iTerminalId; + } + + +// -------------------------------------------------------------------------- +// CMusAvaCapabilityExchange::AnswerToQueryReceived +// -------------------------------------------------------------------------- +// +void CMusAvaCapabilityExchange::AnswerToQueryReceived( + const CSIPClientTransaction& aResponse ) + { + MUS_LOG( + "mus: [MUSAVA] -> CMusAvaCapabilityExchange::AnswerToQueryReceived" ) + + TInt error = KErrNone; + CMusAvaTerminal* terminal = NULL; + TInt index = 0; + + while( !terminal && index < iTerminals.Count() ) + { + terminal = iTerminals[ index++ ]; + TRAP( error, terminal = terminal->QueryCompletedL( aResponse ) ? + terminal : NULL ); + terminal = error != KErrNone ? NULL : terminal; + } + + MUS_LOG( + "mus: [MUSAVA] <- CMusAvaCapabilityExchange::AnswerToQueryReceived" ) + } + + +// -------------------------------------------------------------------------- +// CMusAvaCapabilityExchange::QueryReceived +// -------------------------------------------------------------------------- +// +void CMusAvaCapabilityExchange::QueryReceived( + CSIPServerTransaction* aQuery ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaCapabilityExchange::QueryReceived" ) + + TRAPD( error, DoQueryReceivedL( *aQuery ) ); + + if ( error != KErrNone ) + { + TRAP_IGNORE( RejectQueryL( *aQuery, error ) ) + } + + delete aQuery; + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaCapabilityExchange::QueryReceived" ) + } + + +// -------------------------------------------------------------------------- +// CMusAvaCapabilityExchange::CancelQuery +// -------------------------------------------------------------------------- +// +void CMusAvaCapabilityExchange::CancelQuery( TInt /*aError*/, + const CSIPClientTransaction& aTransaction ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaCapabilityExchange::CancelQuery" ) + + CMusAvaTerminal* terminal = NULL; + TInt index = 0; + + while( !terminal && index < iTerminals.Count() ) + { + terminal = iTerminals[ index++ ]; + terminal = terminal->QueryCanceled( aTransaction ) ? + terminal : NULL; + } + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaCapabilityExchange::CancelQuery" ) + } + + +// -------------------------------------------------------------------------- +// CMusAvaCapabilityExchange::AddCapabilityL +// -------------------------------------------------------------------------- +// +void CMusAvaCapabilityExchange::AddCapabilityL( + CMusAvaCapability* aCapability ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaCapabilityExchange::AddCapabilityL" ) + + User::LeaveIfError( iCapabilities.Find( aCapability ) < KErrNone ? + KErrNone : KErrArgument ); + + User::LeaveIfError( FindByFeature( *aCapability ) < KErrNone ? + KErrNone : KErrArgument ); + + iCapabilities.AppendL( aCapability ); + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaCapabilityExchange::AddCapabilityL" ) + } + + +// -------------------------------------------------------------------------- +// CMusAvaCapabilityExchange::Terminals +// -------------------------------------------------------------------------- +// +const RPointerArray& CMusAvaCapabilityExchange::Terminals() + { + return iTerminals; + } + + +// -------------------------------------------------------------------------- +// CMusAvaCapabilityExchange::Capabilities +// -------------------------------------------------------------------------- +// +const RPointerArray& + CMusAvaCapabilityExchange::Capabilities() + { + return iCapabilities; + } + + +// -------------------------------------------------------------------------- +// CMusAvaCapabilityExchange::TerminalL +// -------------------------------------------------------------------------- +// +CMusAvaTerminal& CMusAvaCapabilityExchange::TerminalL( + const TDesC8& aRemoteUri ) + { + CMusAvaTerminal* terminal = NULL; + TInt index = 0; + + while ( !terminal && index < Terminals().Count() ) + { + terminal = Terminals()[ index++ ]; + terminal = terminal->MatchL( aRemoteUri ) ? terminal : NULL; + } + + if ( !terminal ) + { + terminal = CMusAvaTerminal::NewL( *this, aRemoteUri, KNullDesC8 ); + CleanupStack::PushL( terminal ); + iTerminals.AppendL( terminal ); + CleanupStack::Pop( terminal ); + } + + return *terminal; + } + + +// -------------------------------------------------------------------------- +// CMusAvaCapabilityExchange::TerminalL +// -------------------------------------------------------------------------- +// +CMusAvaTerminal& CMusAvaCapabilityExchange::TerminalL( + const CSIPServerTransaction& aQuery ) + { + CMusAvaTerminal* terminal = NULL; + + const CSIPExtensionHeader* userAgent = + MusAvaCapabilityContext::UserAgentHeaderL( aQuery ); + const CUri8& originator = MusAvaCapabilityContext::OriginatorL( aQuery ); + + const TDesC8& terminalUri = originator.Uri().UriDes(); + const TDesC8& terminalId = userAgent ? userAgent->Value() : KNullDesC8; + + TInt index = 0; + while( !terminal && index < Terminals().Count() ) + { + terminal = Terminals()[ index++ ]; + terminal = terminal->MatchL( terminalUri, terminalId ) + ? terminal : NULL; + } + + if ( !terminal ) + { + terminal = CMusAvaTerminal::NewL( *this, terminalUri, terminalId ); + CleanupStack::PushL( terminal ); + iTerminals.AppendL( terminal ); + CleanupStack::Pop( terminal ); + } + + return *terminal; + } + + +// -------------------------------------------------------------------------- +// CMusAvaCapabilityExchange::DoQueryReceivedL +// -------------------------------------------------------------------------- +// +void CMusAvaCapabilityExchange::DoQueryReceivedL( + CSIPServerTransaction& aQuery ) + { + MUS_LOG( + "mus: [MUSAVA] -> CMusAvaCapabilityExchange::DoQueryReceivedL" ) + + CMusAvaTerminal& terminal = TerminalL( aQuery ); + + terminal.QueryRequestedL( aQuery ); + + MUS_LOG( + "mus: [MUSAVA] <- CMusAvaCapabilityExchange::DoQueryReceivedL" ) + } + + +// -------------------------------------------------------------------------- +// CMusAvaCapabilityExchange::RejectQueryL +// -------------------------------------------------------------------------- +// +void CMusAvaCapabilityExchange::RejectQueryL( CSIPServerTransaction& aQuery, + TInt aError ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaCapabilityExchange::RejectQueryL" ) + TInt statusCode = aError < 0 ? KMUSAVASIPServerInternalError : aError; + RStringF reasonPhrase = + statusCode == KMUSAVASIPServerInternalError ? + SIPStrings::StringF( SipStrConsts::EPhraseServerInternalError ): + SIPStrings::StringF( SipStrConsts::EEmpty); + + CSIPResponseElements* response = + CSIPResponseElements::NewLC( statusCode, reasonPhrase ); + + aQuery.SendResponseL( response ); + + CleanupStack::Pop( response ); + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaCapabilityExchange::RejectQueryL" ) + } + + +// -------------------------------------------------------------------------- +// CMusAvaCapabilityExchange::FindByFeature +// -------------------------------------------------------------------------- +// +TInt CMusAvaCapabilityExchange::FindByFeature( + CMusAvaCapability& aCapability ) + { + TInt index = KErrNotFound; + CMusAvaCapability* capability = NULL; + + for ( TInt i=0; i < iCapabilities.Count() && index == KErrNotFound; i++ ) + { + capability = iCapabilities[i]; + if ( capability->Feature() == aCapability.Feature() ) + { + index = i; + } + } + return index; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/src/musavacapabilityquery.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/src/musavacapabilityquery.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,458 @@ +/* +* Copyright (c) 2005-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: Sent SWIS capability query (OPTIONS) +* +*/ + + +#include "musavacapabilityquery.h" +#include "muslogger.h" +#include "mussettings.h" +#include "mussettingskeys.h" +#include "musavacapability.h" +#include "musavacapabilitycontext.h" +#include "mussesseioninformationapi.h" +#include "musavacapabilityexchange.h" +#include "mmusavacapabilityqueryobserver.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +// -------------------------------------------------------------------------- +// C++ constructor +// -------------------------------------------------------------------------- +// +CMusAvaCapabilityQuery::CMusAvaCapabilityQuery( + CMusAvaCapability& aCapability, + CSIPConnection& aSIPConnection, + CSIPProfile& aProfile ) + + : CMusAvaCapabilityQueryBase( aCapability, aSIPConnection, aProfile ), + iRetrying( EFalse ) + { + } + +// -------------------------------------------------------------------------- +// Symbian two-phase constructor +// -------------------------------------------------------------------------- +// +CMusAvaCapabilityQuery* CMusAvaCapabilityQuery::NewL( + CMusAvaCapability& aCapability, + CSIPConnection& aSIPConnection, + CSIPProfile& aProfile, + const TDesC& aSipAddress ) + + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaCapabilityQuery::NewL" ) + + CMusAvaCapabilityQuery* self = NULL; + + self = new (ELeave) CMusAvaCapabilityQuery( aCapability, + aSIPConnection, + aProfile ); + CleanupStack::PushL( self ); + self->ConstructL( aSipAddress ); + CleanupStack::Pop( self ); + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaCapabilityQuery::NewL" ) + return self; + } + +// -------------------------------------------------------------------------- +// Symbian second-phase constructor +// -------------------------------------------------------------------------- +// +void CMusAvaCapabilityQuery::ConstructL( const TDesC& aSipAddress ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaCapabilityQuery::ConstructL" ) + + CMusAvaCapabilityQueryBase::ConstructL( aSipAddress ); + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaCapabilityQuery::ConstructL" ) + } + +// -------------------------------------------------------------------------- +// C++ destructor +// -------------------------------------------------------------------------- +// +CMusAvaCapabilityQuery::~CMusAvaCapabilityQuery() + { + MUS_LOG( + "mus: [MUSAVA] -> CMusAvaCapabilityQuery::~CMusAvaCapabilityQuery" ) + + delete iTimer; + + MUS_LOG( + "mus: [MUSAVA] <- CMusAvaCapabilityQuery::~CMusAvaCapabilityQuery" ) + } + +// -------------------------------------------------------------------------- +// CMusAvaCapabilityQuery::Prepare +// -------------------------------------------------------------------------- +// +void CMusAvaCapabilityQuery::Prepare( + RPointerArray& /*aRequestHeaders*/ ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaCapabilityQuery::Prepare" ) + + if ( !Retrying() ) + { + MUS_LOG( "mus: [MUSAVA] query prepared" ) + SetState( ECapabilityQueryPrepared ); + } + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaCapabilityQuery::Prepare" ) + } + +// -------------------------------------------------------------------------- +// CMusAvaCapabilityQuery::DoCompletedL +// -------------------------------------------------------------------------- +// +void CMusAvaCapabilityQuery::DoCompletedL( + const CSIPClientTransaction& aResponse ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaCapabilityQuery::DoCompletedL" ) + + const CSIPResponseElements* response = aResponse.ResponseElements(); + User::LeaveIfError( !response ? KErrGeneral : KErrNone ); + + TUint statusCode = response->StatusCode(); + + MUS_LOG1( "mus: [MUSAVA] result %d", statusCode ) + + switch ( statusCode ) + { + case KMUSAVASIP200: + { + DoCompleted200OKL( aResponse ); + break; + } + case KMUSAVASIPNotImplemented: + { + MUS_LOG( "mus: [MUSAVA] => OK" ) + SetResult( KCapabilityCapabilitesReady ); + SetState( ECapabilityQueryCompleted ); + break; + } + case KMUSAVASIPForbidden: + { + MUS_LOG( "mus: [MUSAVA] => FAILED" ) + if ( MultimediaSharingSettings::OperatorVariantSettingL() == + MusSettingsKeys::EOperatorSpecific ) + { + SetResult( KCapabilityCapabilitiesForbidden ); + SetState( ECapabilityQueryCompleted ); + // set forbidden property + TInt result = + RProperty::Set( + NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMUSForbidden, + ( TInt ) NMusSessionInformationApi::EMUSForbidden ); + MUS_LOG1( "mus: [MUSAVA] Property::Ser( KMUSForbidden )\ + returns %d", result ) + } + else + { + SetResult( KCapabilityCapabilitesNotFound ); + SetState( ECapabilityQueryCompleted ); + } + break; + } + case KMUSAVASIPUnsupportedURIScheme: + MUS_LOG( "mus: [MUSAVA] Unsupported URI Schem" ) + SetState( ECapabilityQueryCompleted ); + break; + case KMUSAVASIPNotFound: + case KMUSAVASIPTimeout: + case KMUSAVASIPTemporarilyUnavailable: + { + DoRetryL(); + break; + } + default: + { + MUS_LOG( "mus: [MUSAVA] => FAILED" ) + SetResult( KCapabilityCapabilitesNotFound ); + SetState( ECapabilityQueryCompleted ); + break; + } + } + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaCapabilityQuery::DoCompletedL" ) + } + +// -------------------------------------------------------------------------- +// CMusAvaCapabilityQuery::DoCompleted200OKL +// -------------------------------------------------------------------------- +// +void CMusAvaCapabilityQuery::DoCompleted200OKL( +// const CSIPResponseElements& aResponse ) + const CSIPClientTransaction& aResponse ) + { + SetState( ECapabilityQueryCompleted ); + + // check if P-Asserted-Identity header exists + _LIT8( KHeader,"P-Asserted-Identity" ); + RStringF p = SIPStrings::Pool().OpenFStringL( KHeader() ); + CleanupClosePushL( p ); + + TInt count = MusAvaCapabilityContext::HeaderCount( p, + aResponse.ResponseElements()->MessageElements() ); + + if ( count > 0 ) + { + TUint index = 0; + const CSIPHeaderBase* pAssertedId = MusAvaCapabilityContext::Header( + p, + aResponse.ResponseElements()->MessageElements(), + index ); + + if ( pAssertedId ) + { // get SIP uri + HBufC8* value = pAssertedId->ToTextValueLC(); + CSIPAddress* address = CSIPAddress::DecodeL( *value ); + CleanupStack::PushL( address ); + + const TDesC8& uriInPAssertedId = address->Uri8().Uri().UriDes(); + if ( uriInPAssertedId.Length() > 0 ) + { + HBufC* uri = EscapeUtils::ConvertToUnicodeFromUtf8L( + uriInPAssertedId ); + CleanupStack::PushL( uri ); + Capability().Exchange().QueryObserver(). + CapabilitiesResolvedL( *uri ); + CleanupStack::PopAndDestroy( uri ); + } + CleanupStack::PopAndDestroy( 2 ); //address, value + } + } + CleanupStack::PopAndDestroy( 1 ); //p + + const CSIPContentTypeHeader* contentTypeHeader = NULL; + + const CSIPResponseElements* response = aResponse.ResponseElements(); + + contentTypeHeader = response->MessageElements().ContentType(); + + if ( contentTypeHeader && + contentTypeHeader-> + MediaType().Compare( KMUSAVASIPMediaTypeApplication ) == 0 && + contentTypeHeader-> + MediaSubtype().Compare( KMUSAVASIPMediaSubTypeSDP ) == 0 ) + { + CSdpDocument* sdp = + CSdpDocument::DecodeL( response->MessageElements().Content() ); + CleanupStack::PushL( sdp ); + + TBool codec = ValidateAndStoreCodecsL( *sdp ); + TBool attributes = ValidateAttributesL( *sdp ); + TBool featureTag = ValidateContactL( aResponse ); + TBool operatorVariant = + MultimediaSharingSettings::OperatorVariantSettingL() == + MusSettingsKeys::EOperatorSpecific; + + if ( ( codec && attributes && featureTag ) || + ( codec && !operatorVariant && featureTag ) ) + + { + MUS_LOG( "mus: [MUSAVA] => OK" ) + SetResult( KCapabilityCapabilitesReady ); + } + + else + { + MUS_LOG( "mus: [MUSAVA] => FAILED due SDP validation" ) + SetResult( KCapabilityCapabilitesNotFound ); + } + + CleanupStack::PopAndDestroy( sdp ); + + } + else + { + MUS_LOG( "mus: [MUSAVA] => FAILED due wrong content type" ) + SetResult( KCapabilityCapabilitesNotFound ); + } + } + +// -------------------------------------------------------------------------- +// CMusAvaCapabilityQuery::ValidateCodecL +// -------------------------------------------------------------------------- +// +TBool CMusAvaCapabilityQuery::ValidateAndStoreCodecsL( CSdpDocument& aSDP ) + { + MUS_LOG("mus: [MUSAVA] -> CMusAvaCapabilityQuery::ValidateAndStoreCodecsL" ) + + TBool valid = EFalse; + + CDesCArrayFlat* codecs = CMusAvaCapability::ResolveCodecsL( aSDP ); + CleanupStack::PushL( codecs ); + + Capability().Exchange().QueryObserver().VideoCodecsResolvedL( *codecs ); + MUS_LOG1("mus: [MUSAVA] -> codecs count = %d", codecs->MdcaCount() ) + + if ( codecs->MdcaCount() > 0 ) + { + valid = ETrue; + } + + codecs->Reset(); + CleanupStack::PopAndDestroy( codecs ); + + MUS_LOG("mus: [MUSAVA] <- CMusAvaCapabilityQuery::ValidateAndStoreCodecsL" ) + return valid; + } + +// -------------------------------------------------------------------------- +// CMusAvaCapabilityQuery::ValidateAttributesL +// -------------------------------------------------------------------------- +// +TBool CMusAvaCapabilityQuery::ValidateAttributesL( CSdpDocument& aSDP ) + { + TBool valid = EFalse; + + const CSdpAttributeField* application = NULL; + const CSdpAttributeField* type = NULL; + RStringF attrTypeName = MusAvaCapabilityContext::SDPStringL( + KCapabilitySDPAttributeNameType ); + CleanupClosePushL( attrTypeName ); + + // "a=application:comgsma.rts" + application = CMusAvaCapability::Attribute( + MusAvaCapabilityContext::SDPStringL( + SdpCodecStringConstants::EMediaApplication ), + aSDP ); + + // "a=type:videolive" + type = CMusAvaCapability::Attribute( attrTypeName, aSDP ); + CleanupStack::PopAndDestroy();//attrTypeName + + if ( MultimediaSharingSettings::OperatorVariantSettingL() == + MusSettingsKeys::EOperatorSpecific ) + { + valid = application && + application->Value().Compare( KCapabilitySwisApplication ) == 0 && + type && + type->Value().Compare( KCapabilitySDPAttributeType ) == 0; + } + else + { + valid = ( application && + application->Value().Compare( KCapabilitySwisApplication ) == 0 ) || + ( type && + type->Value().Compare( KCapabilitySDPAttributeType ) == 0 ) ; + + } + + MusSettingsKeys::TFastMode mode = CMusAvaCapability::ResolveFastModeL( aSDP ); + Capability().Exchange().QueryObserver().FastModeResolved( mode ); + + return valid; + } + +// -------------------------------------------------------------------------- +// CMusAvaCapabilityQuery::ValidateContactL +// -------------------------------------------------------------------------- +// +TBool CMusAvaCapabilityQuery::ValidateContactL( + const CSIPClientTransaction& aResponse ) + { + TBool valid = EFalse; + RStringF falseParam = MusAvaCapabilityContext::SIPStringL( + KMUSAVASIPParamFalse ); + CleanupClosePushL( falseParam ); + + const CSIPContactHeader* contact = + MusAvaCapabilityContext::ContactHeaderL( aResponse ); + + if ( !contact ) + { + MUS_LOG( "STCE: => FAILED due lack of contact header" ) + } + else + { + if ( contact->HasParam( Capability().Feature() ) && + !contact->HasParam( falseParam ) ) + { + valid = ETrue; + } + else + { + MUS_LOG( "STCE: => FAILED due wrong contact header" ) + } + } + CleanupStack::PopAndDestroy();//falseParam + + return valid; + } + +// -------------------------------------------------------------------------- +// CMusAvaCapabilityQuery::DoRetryL +// -------------------------------------------------------------------------- +// +void CMusAvaCapabilityQuery::DoRetryL() + { + + if ( !iTimer ) + { + MUS_LOG( "mus: [MUSAVA] => RE-TRYING" ) + + iTimer = CMusAvaCapabilityTimer::NewL( *this ); + iTimer->After( KCapabilityTimervalue ); + Retrying() = ETrue; + SetResult( KCapabilityQueryNotReady ); + SetState( ECapabilityQueryCreated ); + } + else + { + MUS_LOG( "mus: [MUSAVA] => FAILED due failing retry" ) + Retrying() = EFalse; + SetResult( KCapabilityCapabilitesNotFound ); + SetState( ECapabilityQueryCompleted ); + delete iTimer; + iTimer = NULL; + } + } + +// -------------------------------------------------------------------------- +// CMusAvaCapabilityQuery::OnExpired +// -------------------------------------------------------------------------- +// +void CMusAvaCapabilityQuery::OnExpiredL( TInt /*aStatus*/ ) + { + Retrying() = EFalse; + + ExecuteL(); + } + +// -------------------------------------------------------------------------- +// CMusAvaCapabilityQuery::Retrying +// -------------------------------------------------------------------------- +// +TBool& CMusAvaCapabilityQuery::Retrying() + { + return iRetrying; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/src/musavacapabilityquerybase.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/src/musavacapabilityquerybase.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,544 @@ +/* +* Copyright (c) 2005-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: Sent capability query (OPTIONS) +* +*/ + + +#include "musavacapabilityquerybase.h" +#include "muscleanupresetanddestroy.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#include "mussettings.h" +#include "muslogger.h" +#include "mmusavacapabilityqueryobserver.h" +#include "musavacapability.h" +#include "musavacapabilityexchange.h" +#include "musavaterminal.h" +#include "musavacapabilitycontext.h" +#include "musavasipheaderutil.h" + +// -------------------------------------------------------------------------- +// C++ constructor +// -------------------------------------------------------------------------- +// +CMusAvaCapabilityQueryBase::CMusAvaCapabilityQueryBase( + CMusAvaCapability& aCapability, + CSIPConnection& aSIPConnection, + CSIPProfile& aProfile ) + : iCapability( aCapability ), + iSIPConnection( aSIPConnection ), + iProfile( aProfile ), + iState( ECapabilityQueryCreated ), + iResult( KCapabilityQueryNotReady ) + { + } + +// -------------------------------------------------------------------------- +// C++ destructor +// -------------------------------------------------------------------------- +// +CMusAvaCapabilityQueryBase::~CMusAvaCapabilityQueryBase() + { + MUS_LOG( + "mus: [MUSAVA] -> CMusAvaCapabilityQueryBase::~CMusAvaCapabilityQueryBase" ) + + delete iRegisteredContact; + delete iOriginator; + if ( iTerminal ) + { + iTerminal->DetachQuery( *this ); + } + ResetAndDestroyTrx(); + MUS_LOG( "mus: [MUSAVA] -> StringPools are getting closed." ) + MUS_LOG( + "mus: [MUSAVA] <- CMusAvaCapabilityQueryBase::~CMusAvaCapabilityQueryBase" ) + } + +// -------------------------------------------------------------------------- +// CMusAvaCapabilityQueryBase::ConstructL +// -------------------------------------------------------------------------- +// +void CMusAvaCapabilityQueryBase::ConstructL( const TDesC& aSipAddress ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaCapabilityQueryBase::ConstructL" ) + + // If string pool is opened already , then dont care. + + User::LeaveIfError( aSipAddress.Length() > 0 ? KErrNone : KErrArgument ); + + // If it is not registered , just leave. + TBool isRegistered = ETrue; + iProfile.GetParameter( KSIPProfileRegistered, isRegistered ); + User::LeaveIfError( isRegistered ? KErrNone : KErrArgument ); + + TInt err( KErrNotFound ); + const TDesC8* registeredContact( NULL ); + err = iProfile.GetParameter( KSIPRegisteredContact, registeredContact ); + if( err ) + { + MUS_LOG1( "mus: [MUSAVA] iProfile.GetParameter Contact -> %d", err ) + User::LeaveIfError( err ); + } + + // contactHeader array will only contain one instance of CSIPContactHeader, + // since only one registered contact is decoded + RPointerArray contactHeader = + CSIPContactHeader::DecodeL( *registeredContact ); + MusCleanupResetAndDestroyPushL( contactHeader ); + + // leave if there is at least one contact not present + if ( contactHeader.Count() < 1 ) + { + MUS_LOG1( "mus: [MUSAVA] contactHeader has %d instances, instead of 1", + contactHeader.Count() ); + User::Leave( KErrNotFound ); + } + + // if more contact than pick the first one. Sip assures in idle case + // it should always return only one registered contact. + CSIPAddress* sipAddress = contactHeader[0]->SIPAddress(); + if ( !sipAddress ) + { + MUS_LOG( "mus: [MUSAVA] name-address not present") + User::Leave( KErrNotFound ); + } + iRegisteredContact = CUri8::NewL( sipAddress->Uri8().Uri() ); + MUS_LOG_TDESC8( " mus: [MUSAVA] iRegisteredContact : ", (iRegisteredContact->Uri().UriDes())); + CleanupStack::PopAndDestroy( &contactHeader ); + + sipAddress = NULL; + const MDesC8Array* aors = NULL; + User::LeaveIfError(iProfile.GetParameter( KSIPRegisteredAors, aors )); + MUS_LOG( "mus: [MUSAVA] iProfile.GetParameter -> OK " ) + if( !aors || aors->MdcaCount() <= 0 ) User::Leave(KErrArgument); + MUS_LOG_TDESC8( " mus: [MUSAVA] AOR -> 0 : ", aors->MdcaPoint(0)); + sipAddress = CSIPAddress::DecodeL( aors->MdcaPoint(0) ); + MUS_LOG( "mus: [MUSAVA] CSIPAddress::DecodeL -> OK " ) + CleanupStack::PushL( sipAddress ); + iOriginator = CUri8::NewL(sipAddress->Uri8().Uri()); + MUS_LOG_TDESC8( " mus: [MUSAVA] iOriginator : ", (iOriginator->Uri().UriDes())); + CleanupStack::PopAndDestroy(sipAddress); + + HBufC8* sipAddress8 = EscapeUtils::ConvertFromUnicodeToUtf8L( aSipAddress ); + CleanupStack::PushL( sipAddress8 ); + iTerminal = &Capability().Exchange().TerminalL( sipAddress8->Des() ); + CleanupStack::PopAndDestroy( sipAddress8 ) ; + iTerminal->AttachQuery( *this ); + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaCapabilityQueryBase::ConstructL" ) + } + +// -------------------------------------------------------------------------- +// CMusAvaCapabilityQueryBase::Capability +// -------------------------------------------------------------------------- +// +const CMusAvaCapability& CMusAvaCapabilityQueryBase::Capability() const + { + return iCapability; + } + +// -------------------------------------------------------------------------- +// CMusAvaCapabilityQueryBase::SetState +// -------------------------------------------------------------------------- +// +void CMusAvaCapabilityQueryBase::SetState( + CMusAvaCapabilityQueryBase::TState aState ) + { + iState = aState; + } + +// -------------------------------------------------------------------------- +// CMusAvaCapabilityQueryBase::SetResult +// -------------------------------------------------------------------------- +// +void CMusAvaCapabilityQueryBase::SetResult( TInt aResult ) + { + iResult = aResult; + } + +// -------------------------------------------------------------------------- +// CMusAvaCapabilityQueryBase::Terminal +// -------------------------------------------------------------------------- +// +CMusAvaTerminal& CMusAvaCapabilityQueryBase::Terminal() + { + return *iTerminal; + } + +// -------------------------------------------------------------------------- +// CMusAvaCapabilityQueryBase::ExecuteL +// -------------------------------------------------------------------------- +// +void CMusAvaCapabilityQueryBase::ExecuteL() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaCapabilityQueryBase::ExecuteL" ) + + __ASSERT_ALWAYS( + State() != ECapabilityQueryPrepared, User::Leave( KErrGeneral ) ); + + if ( State() == ECapabilityQueryCreated ) + { + RPointerArray headers; + CSIPHeaderBase::PushLC( &headers ); + + Prepare( headers ); + + if ( State() == ECapabilityQueryPrepared ) + { + CMusAvaSipheaderUtil::AddAcceptContactHeaderL( headers, + Capability().Feature() ); + MUS_LOG( "mus: [MUSAVA] AddAcceptContactHeaderL -> Success ") + CMusAvaSipheaderUtil::AddAcceptEncodingHeaderL(headers); + MUS_LOG( "mus: [MUSAVA] AddAcceptEncodingHeaderL -> Success ") + CMusAvaSipheaderUtil::AddAcceptLanguageHeaderL(headers); + MUS_LOG( "mus: [MUSAVA] AddAcceptLanguageHeaderL -> Success ") + CMusAvaSipheaderUtil::AddAcceptSdpHeaderL(headers); + MUS_LOG( "mus: [MUSAVA] AddAcceptSDPHeaderL -> Success ") + CMusAvaSipheaderUtil::AddPreferredIdentityHeaderL(headers, + iOriginator->Uri().UriDes()); + MUS_LOG( "mus: [MUSAVA] AddPreferredIdentityHeaderL -> Success ") + AddContactHeaderL( headers ); + MUS_LOG( "mus: [MUSAVA] AddContactHeaderL -> Success ") + //terminal ID + if ( Capability().Exchange().TerminalId().Length() > 0 ) + { + MUS_LOG( "mus: [MUSAVA] Adding User-Agent header" ) + CSIPHeaderBase* userAgent = + MusAvaCapabilityContext::UserAgentHeaderLC( + Capability().Exchange().TerminalId() ); + headers.AppendL( userAgent ); + CleanupStack::Pop( userAgent ); + } + + //remote uri ( will be used as ToHeader ) + CUri8* remoteUri = + MusAvaCapabilityContext::ToUriL( Terminal().Uri() ); + CleanupStack::PushL( remoteUri ); + CSIPRequestElements* request = + CSIPRequestElements::NewL( remoteUri ); + CleanupStack::Pop( remoteUri ); + CleanupStack::PushL( request ); + + request->SetMethodL( + SIPStrings::StringF( SipStrConsts::EOptions ) ); + + CSIPMessageElements& message = request->MessageElements(); + message.SetUserHeadersL( headers ); + + HBufC8* content = ContentLC(); + CMusAvaSipheaderUtil::AddSdpL(request,content); + CleanupStack::Pop(content) ; + + ResetAndDestroyTrx(); + + MUS_LOG( "mus: [MUSAVA] Sending OPTIONS request ...." ) + iTrx = iSIPConnection.SendRequestL( request, iProfile ); + CleanupStack::Pop( request ); + + iState = ECapabilityQueryExecuting; + MUS_LOG( "mus: [MUSAVA] OPTIONS request sent" ) + } + + CleanupStack::PopAndDestroy( &headers ); + } + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaCapabilityQueryBase::ExecuteL" ) + } + +// -------------------------------------------------------------------------- +// CMusAvaCapabilityQueryBase::CompletedL +// -------------------------------------------------------------------------- +// +void CMusAvaCapabilityQueryBase::CompletedL( + const CSIPClientTransaction& aResponse ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaCapabilityQueryBase::CompletedL" ) + + if ( iTrx && *iTrx == aResponse ) + { + TUint statusCode = aResponse.ResponseElements()->StatusCode(); + if ( 100 <= statusCode && statusCode < 200 ) + { + return; + } + DoCompletedL( aResponse ); + if ( State() == ECapabilityQueryCompleted ) + { + MUS_LOG( "mus: [MUSAVA] query completed" ) + Capability().Exchange().QueryObserver().CapabilitiesResolved( + *this ); + } + } + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaCapabilityQueryBase::CompletedL" ) + } + +// -------------------------------------------------------------------------- +// CMusAvaCapabilityQueryBase::Canceled +// -------------------------------------------------------------------------- +// +void CMusAvaCapabilityQueryBase::Canceled( + const CSIPClientTransaction& aTransaction ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaCapabilityQueryBase::Canceled" ) + if ( iTrx && *iTrx == aTransaction ) + { + MUS_LOG( "mus: [MUSAVA] query canceled" ) + + SetState( ECapabilityQueryCompleted ); + SetResult( KCapabilityCapabilitesNotFound ); + Capability().Exchange().QueryObserver().CapabilitiesResolved( + *this ); + } + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaCapabilityQueryBase::Canceled" ) + } + + +// -------------------------------------------------------------------------- +// CMusAvaCapabilityQueryBase::AddContactHeaderL +// -------------------------------------------------------------------------- +// +void CMusAvaCapabilityQueryBase::AddContactHeaderL( + RPointerArray& aRequestHeaders ) + { + + MUS_LOG( + "mus: [MUSAVA] -> CMusAvaCapabilityQueryBase::AddContactHeaderL" ) + CSIPContactHeader* contact = + MusAvaCapabilityContext::ContactHeaderLC( *iRegisteredContact, + Capability().Feature() ); + aRequestHeaders.AppendL( contact ); + CleanupStack::Pop( contact ); + MUS_LOG( + "mus: [MUSAVA] <- CMusAvaCapabilityQueryBase::AddContactHeaderL" ) + } + +// -------------------------------------------------------------------------- +// CMusAvaCapabilityQueryBase::State +// -------------------------------------------------------------------------- +// +CMusAvaCapabilityQueryBase::TState CMusAvaCapabilityQueryBase::State() const + { + return iState; + } + +// -------------------------------------------------------------------------- +// CMusAvaCapabilityQueryBase::Result +// -------------------------------------------------------------------------- +// +TInt CMusAvaCapabilityQueryBase::Result() const + { + return iResult; + } + +// -------------------------------------------------------------------------- +// CMusAvaCapabilityQueryBase::ResetAndDestroyTrx +// -------------------------------------------------------------------------- +// +void CMusAvaCapabilityQueryBase::ResetAndDestroyTrx() + { + delete iTrx; + iTrx = NULL; + } + +// -------------------------------------------------------------------------- +// CMusAvaCapabilityQueryBase::LocalAddress +// -------------------------------------------------------------------------- +// +const CUri8& CMusAvaCapabilityQueryBase::LocalAddress() const + { + return *iOriginator; + } + +// -------------------------------------------------------------------------- +// CMusAvaCapabilityQueryBase::ResponseContentLC +// -------------------------------------------------------------------------- +// +HBufC8* CMusAvaCapabilityQueryBase::ContentLC() + + { + MUS_LOG("mus: [MUSAVA]: -> CMusAvaCapabilityQueryBase::ContentLC" ) + + CSdpDocument* content = CSdpDocument::NewLC(); + + RStringPool strPool = SdpCodecStringPool::StringPoolL(); + RStringF netType = + MusAvaCapabilityContext::SDPStringL( SdpCodecStringConstants::ENetType ); + + _LIT8(KOriginFieldUser1, "-"); + _LIT8(KSessionName, "-"); + content->SetSessionNameL( KSessionName ); + + TPtrC8 localHost; + RStringF hostType; + + TTime now; + now.UniversalTime(); + TInt64 rand = now.Int64(); + TInt64 sessionID = Math::Rand( rand ); + + hostType = strPool.StringF( SdpCodecStringConstants::EAddressTypeIP4, + SdpCodecStringPool::StringTableL() ); + MUS_LOG( "EAddressTypeIP4 from string pool" ) + + TInetAddr aAddr(0); + iSIPConnection.GetLocalAddrL(aAddr); + TBuf<50> ipAddress; + aAddr.Output(ipAddress); + MUS_LOG_TDESC( "mus: [MUSAVA]: LocalIP Address",ipAddress ) + HBufC8 * ipaddr8=HBufC8::NewLC(ipAddress.Length()); + ipaddr8->Des().Copy(ipAddress); + + MUS_LOG( "mus: [MUSAVA]: SetOriginField" ) + CSdpOriginField* originField = CSdpOriginField::NewL( KOriginFieldUser1, + sessionID, + sessionID, + netType, + hostType, + *ipaddr8); + content->SetOriginField( originField ); + // Connection field + MUS_LOG( "mus: [MUSAVA]: SetConnectionField" ) + CSdpConnectionField* connectionField = + CSdpConnectionField::NewL( netType, hostType,*ipaddr8); + content->SetConnectionField( connectionField ); + CleanupStack::PopAndDestroy(ipaddr8); + + OtherSDPHeadersL(*content); + + MUS_LOG( "mus: [MUSAVA]: Constructing the Sdp Content" ) + CBufFlat* encBuf = CBufFlat::NewL( KMUSAVAMaxLengthOfSDPMessage ); + CleanupStack::PushL( encBuf ); + RBufWriteStream writeStream( *encBuf, 0 ); + writeStream.PushL(); + content->EncodeL( writeStream ); + CleanupStack::PopAndDestroy();//writeStream + HBufC8* textContent = encBuf->Ptr( 0 ).AllocL(); + CleanupStack::PopAndDestroy( encBuf ); + + CleanupStack::PopAndDestroy(content); + + CleanupStack::PushL(textContent); + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaCapabilityQueryBase::ContentLC" ) + return textContent; + } + +// -------------------------------------------------------------------------- +// CMusAvaCapabilityQueryBase::OtherSDPHeadersL +// -------------------------------------------------------------------------- +// +void CMusAvaCapabilityQueryBase::OtherSDPHeadersL( CSdpDocument& aResponseContent ) + + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaCapabilityQueryBase::OtherSDPHeadersL" ) + + MUS_LOG( "mus: [MUSAVA] Adding application attribute to SDP" ) + //application + CSdpAttributeField* application = CSdpAttributeField::NewLC( + MusAvaCapabilityContext::SDPStringL( + SdpCodecStringConstants::EMediaApplication ), + KCapabilitySwisApplication ); + + aResponseContent.AttributeFields().AppendL( application ); + CleanupStack::Pop( application ); + + MUS_LOG( "mus: [MUSAVA] Adding type attribute to SDP" ) + //type + RStringF typeStr = MusAvaCapabilityContext::SDPStringL( + KCapabilitySDPAttributeNameType ); + CleanupClosePushL( typeStr ); + CSdpAttributeField* type = + CSdpAttributeField::NewL( typeStr, KCapabilitySDPAttributeType ); + CleanupStack::PopAndDestroy();//typeStr + CleanupStack::PushL( type ); + + aResponseContent.AttributeFields().AppendL( type ); + CleanupStack::Pop( type ); + + // Fast startup mode + CMusAvaCapability::AddFastModeL( aResponseContent ); + + MUS_LOG( "mus: [MUSAVA] Adding media line to SDP" ) + //media line + CSdpMediaField* mediaLine = CSdpMediaField::NewLC( + MusAvaCapabilityContext::SDPStringL + (SdpCodecStringConstants::EMediaVideo ), + NULL, + MusAvaCapabilityContext::SDPStringL + (SdpCodecStringConstants::EProtocolRtpAvp ), + KCapabilitySwisFormatListH263Only ); + + //adding H.264 codec to SDP + if( !MultimediaSharingSettings::IsAvcDisabled()) + { + MUS_LOG( "mus: [MUSAVA] - Adding avc to supported codec list" ) + // reconstruct media line with H264 and H263 + CleanupStack::PopAndDestroy(mediaLine); + mediaLine = CSdpMediaField::NewLC( + MusAvaCapabilityContext::SDPStringL + (SdpCodecStringConstants::EMediaVideo ), + NULL, + MusAvaCapabilityContext::SDPStringL + (SdpCodecStringConstants::EProtocolRtpAvp ), + KCapabilitySwisFormatList ); + + CSdpFmtAttributeField* rtpMapH264 = + CMusAvaCapability::RtpMapLineLC( KCapabilitySDPAttributeCodecH264, + KCapabilitySDPAttributePayloadTypeH264, + KCapabilitySDPAttributeClockrate ); + + mediaLine->FormatAttributeFields().AppendL( rtpMapH264 ); + CleanupStack::Pop( rtpMapH264 ); + } + + //H.263 codec + MUS_LOG( "mus: [ENGINE] - Adding h263 to supported codec list" ) + CSdpFmtAttributeField* rtpMapH263 = + CMusAvaCapability::RtpMapLineLC( KCapabilitySDPAttributeCodecH263, + KCapabilitySDPAttributePayloadType, + KCapabilitySDPAttributeClockrate ); + + mediaLine->FormatAttributeFields().AppendL( rtpMapH263 ); + CleanupStack::Pop( rtpMapH263 ); + + aResponseContent.MediaFields().AppendL( mediaLine ); + CleanupStack::Pop( mediaLine ); + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaCapabilityQueryBase::OtherSDPHeadersL" ) + } + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/src/musavacapabilitysipagent.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/src/musavacapabilitysipagent.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,260 @@ +/* +* Copyright (c) 2005-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: SIP event handling class +* +*/ + + +#include "musavacapabilitysipagent.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "muslogger.h" +#include "musavacapabilityexchange.h" +#include "musavacapabilityquery.h" +#include "musavaterminal.h" +#include "musavasharedobject.h" +#include "musavasip.h" +#include "musavacapabilitycontext.h" +#include "mmusavacapabilityqueryobserver.h" + +// -------------------------------------------------------------------------- +// C++ constructor +// -------------------------------------------------------------------------- +// +CMusAvaCapabilitySipAgent::CMusAvaCapabilitySipAgent( + CMusAvaCapabilityExchange& aCapabilityExchange, + CMusAvaSharedObject& aSharedObject, + MMusAvaAvailabilityObserver& aAvaObserver) + : iCapabilityExchange( aCapabilityExchange ), + iSharedObj( aSharedObject ), + iAvailabilityObserver( aAvaObserver ) + { + } + + +// -------------------------------------------------------------------------- +// Symbian two-phase constructor +// -------------------------------------------------------------------------- +// +CMusAvaCapabilitySipAgent* CMusAvaCapabilitySipAgent::NewL( + CMusAvaCapabilityExchange& aCapabilityExchange, + CMusAvaSharedObject& aSharedObject, + MMusAvaAvailabilityObserver& aAvaObserver) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaCapabilitySipAgent::NewL" ) + CMusAvaCapabilitySipAgent* self = + new (ELeave) CMusAvaCapabilitySipAgent( aCapabilityExchange, + aSharedObject, + aAvaObserver ); + MUS_LOG( "mus: [MUSAVA] <- CMusAvaCapabilitySipAgent::NewL" ) + return self; + } + + +// -------------------------------------------------------------------------- +// C++ destructor +// -------------------------------------------------------------------------- +// +CMusAvaCapabilitySipAgent::~CMusAvaCapabilitySipAgent() + { + MUS_LOG( + "mus: [MUSAVA] -> CMusAvaCapabilitySipAgent::~CMusAvaCapabilitySipAgent" ) + + delete iSipConnection; + + MUS_LOG( + "mus: [MUSAVA] <- CMusAvaCapabilitySipAgent::~CMusAvaCapabilitySipAgent" ) + } + +// -------------------------------------------------------------------------- +// CMusAvaCapabilitySipAgent::ExecuteCapabilityQueryL +// -------------------------------------------------------------------------- +// +void CMusAvaCapabilitySipAgent::ExecuteCapabilityQueryL( + CMusAvaCapability& aCapability, + const TDesC& aSipAddress ) + { + MUS_LOG( + "mus: [MUSAVA] -> CMusAvaCapabilitySipAgent::ExecuteCapabilityQueryL" ) + + CSIPProfile* profile = iSharedObj.MusAvaSip().Profile(); + if ( !profile ) + { + User::Leave( KErrNotFound ); + } + + // Fetching connection leaves if profile is not registered for some reason, + // Thats what we want, forced creation of connection would activate PDP + // context although there's no reason to do that without registration. + CMusAvaCapabilityQuery* query = CMusAvaCapabilityQuery::NewL( + aCapability, + *iSharedObj.MusAvaSip().ConnectionL( EFalse ), + *profile, + aSipAddress ); + + CleanupStack::PushL( query ); + + query->Terminal().ExecuteQueryL( query ); + + CleanupStack::Pop( query ); + + MUS_LOG( + "mus: [MUSAVA] <- CMusAvaCapabilitySipAgent::ExecuteCapabilityQueryL" ) + } + +// -------------------------------------------------------------------------- +// From MSIPObserver, incoming SIP request outside dialog is handled here +// already. +// -------------------------------------------------------------------------- +// + +TInt CMusAvaCapabilitySipAgent::IncomingRequest( TUint32 /*aIapId*/, + CSIPServerTransaction* /*aTransaction*/ ) + { + MUS_LOG( + "mus: [MUSAVA] -> CMusAvaCapabilitySipAgent::IncomingRequest()" ) + // If this method was called, there's no connection for this IAP + MUS_LOG( "mus: [MUSAVA] if this method was called,\ + there's no capability" ) + MUS_LOG( + "mus: [MUSAVA] <- CMusAvaCapabilitySipAgent::IncomingRequest()" ) + return KErrNotFound; + } + +// ------------------------------------------------------------------------- +// SIP request timed-out and has been destroyed. +// ------------------------------------------------------------------------- +// +TInt CMusAvaCapabilitySipAgent::TimedOut( + CSIPServerTransaction& /*aTransaction*/ ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaCapabilitySipAgent::ConstructL()" ) + MUS_LOG( "mus: [MUSAVA] <- CMusAvaCapabilitySipAgent::ConstructL()" ) + return KErrNotSupported; + } + +// -------------------------------------------------------------------------- +// A SIP request outside a dialog has been received from the network. +// -------------------------------------------------------------------------- +// +TInt CMusAvaCapabilitySipAgent::IncomingRequest( + CSIPServerTransaction* aTransaction ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaCapabilitySipAgent::IncomingRequest" ) + TInt retval = KErrNone; + if ( aTransaction->Type() == + SIPStrings::StringF( SipStrConsts::EOptions ) ) + { + // Answer 200OK only when CS call remain at Availability States + if ( MMusAvaObserver::EMusAvaStatusNotExecuted <= + iAvailabilityObserver.AvailabilityPluginState() ) + { + retval = + iCapabilityExchange.QueryObserver().CapabilityQueryAnswered() ? + KErrNotFound : KErrNone; + + if ( !retval ) + { + MUS_LOG( "mus: [MUSAVA] Responding to OPTIONS" ) + iCapabilityExchange.QueryReceived( aTransaction ); + } + } + else + { + retval = KErrNotFound; + } + } + else + { + MUS_LOG( "mus: [MUSAVA] Default response" ) + TRAP_IGNORE( HandleIncomingRequestL( *aTransaction ) ) + delete aTransaction; + MUS_LOG( "mus: [MUSAVA] Default response sent" ) + } + MUS_LOG( "mus: [MUSAVA] <- CMusAvaCapabilitySipAgent::IncomingRequest" ) + return retval; + } + +// -------------------------------------------------------------------------- +// From MSIPConnectionObserver, incoming SIP request outside dialog is +// handled here already. +// -------------------------------------------------------------------------- +// +void CMusAvaCapabilitySipAgent::HandleIncomingRequestL( + CSIPServerTransaction& aTransaction ) + { + MUS_LOG( + "mus: [MUSAVA] -> CMusAvaCapabilitySipAgent::HandleIncomingRequestL" ) + RStringF phrase = + SIPStrings::StringF( SipStrConsts::EPhraseNotImplemented ); + CSIPResponseElements* response = + CSIPResponseElements::NewLC( KMUSAVASIPNotImplemented, phrase ); + aTransaction.SendResponseL( response ); + CleanupStack::Pop( response ); + MUS_LOG( + "mus: [MUSAVA] <- CMusAvaCapabilitySipAgent::HandleIncomingRequestL" ) + } + +// -------------------------------------------------------------------------- +// CMusAvaCapabilitySipAgent::IncomingResponse +// -------------------------------------------------------------------------- +// +TInt CMusAvaCapabilitySipAgent::IncomingResponse( + CSIPClientTransaction& aTransaction ) + { + MUS_LOG( + "mus: [MUSAVA] -> CMusAvaCapabilitySipAgent::IncomingResponse" ) + iCapabilityExchange.AnswerToQueryReceived( aTransaction ); + MUS_LOG( + "mus: [MUSAVA] <- CMusAvaCapabilitySipAgent::IncomingResponse" ) + return KErrNone; + } + +// -------------------------------------------------------------------------- +// CMusAvaCapabilitySipAgent::ErrorOccured +// -------------------------------------------------------------------------- +// +TInt CMusAvaCapabilitySipAgent::ErrorOccured( TInt aError, + CSIPTransactionBase& aTransaction ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaCapabilitySipAgent:.ErrorOccured" ) + + if ( aTransaction.IsSIPClientTransaction() ) + { + MUS_LOG( "mus: [MUSAVA] Canceling query" ) + + iCapabilityExchange.CancelQuery( + aError, + static_cast( aTransaction ) ); + } + else + { + MUS_LOG( "mus: [MUSAVA] Server transaction, nothing to do" ) + } + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaCapabilitySipAgent:.ErrorOccured" ) + return KErrNone; + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/src/musavacapabilitytimer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/src/musavacapabilitytimer.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,85 @@ +/* +* Copyright (c) 2005-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: Timer +* +*/ + + +// INCLUDE FILES +#include "musavacapabilitytimer.h" + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------------------------- +// Two-phased constructor. +// --------------------------------------------------------------------------- +// +CMusAvaCapabilityTimer* CMusAvaCapabilityTimer::NewL( + CMusAvaCapabilityTimer::MTimeOutNotify& aNotify ) + { + CMusAvaCapabilityTimer* self = + new ( ELeave ) CMusAvaCapabilityTimer( EPriorityStandard, aNotify ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +// --------------------------------------------------------------------------- +// Destructor +// --------------------------------------------------------------------------- +// +CMusAvaCapabilityTimer::~CMusAvaCapabilityTimer() + { + Cancel(); + } + + +// --------------------------------------------------------------------------- +// CMusAvaCapabilityTimer::RunL() +// +// --------------------------------------------------------------------------- +// +void CMusAvaCapabilityTimer::RunL() + { + iNotify->OnExpiredL( iStatus.Int() ); + } + + +// --------------------------------------------------------------------------- +// C++ default constructor can NOT contain any code, that +// might leave. +// --------------------------------------------------------------------------- +// +CMusAvaCapabilityTimer::CMusAvaCapabilityTimer( const TInt aPriority, + CMusAvaCapabilityTimer::MTimeOutNotify& aNotify ) + : CTimer( aPriority ), + iNotify( &aNotify ) + { + } + + +// --------------------------------------------------------------------------- +// Symbian 2nd phase constructor can leave. +// --------------------------------------------------------------------------- +// +void CMusAvaCapabilityTimer::ConstructL() + { + CTimer::ConstructL(); + CActiveScheduler::Add( this ); + } + +// End of File + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/src/musavaclientresolverutil.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/src/musavaclientresolverutil.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,410 @@ +/* +* 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: Utility class to handle SIP client resolver cenrep table. +* +*/ + + + + +#include "musavaclientresolverutil.h" +#include "musuid.hrh" +#include "muslogger.h" +#include +#include + +// SipMXResolverImplUid +const TUid KSipMXResolverImplUid = { 0x10283140 }; + + +// + +// The following constant is defined in sipprofile.h in Sawfish. +// Since the constant is not defined in all releases, it must be copied here. + +/** +* A unique Contact-header's user-part +* generated automatically by the SIP implementation. +* The value is of type TDesC8. +* This parameter is read-only and +* trying to set it will fail with KErrAccessDenied. +*/ +const TUint32 KCopyOfKSIPContactHeaderUser = 15; + +// The following Uids and keys are defined in file +// sipclientresolverconfigcrkeys.h in Sawfish. Since the header is not present +// in all releases, the values must be defined here. + +/// Defines configuration parameters used by SIP Client Resolver +const TUid KCRUidSIPClientResolverConfig = { 0x10282EE7 }; + +/// Mask for the less significant bits in setting keys. +/// These bits are reserved for field type information. +const TUint32 KSIPClientResolverFieldTypeMask = 0xf0000000; + +/// Mask for the most significant bits in setting keys. +/// These bits are reserved for the actual key part. +const TUint32 KSIPClientResolverKeyMask = 0x0fffffff; + +/** +* Mask for username field. +* Field type is TDesC8. +*/ +const TUint32 KSIPClientResolverUserNameMask = 0x10000000; + +/** +* Mask for plug-in implementation UID field. +* Field type is TInt32. +*/ +const TUint32 KSIPClientResolverPluginUIDMask = 0x20000000; + +/** +* Mask for client UID field. +* Field type is TInt32. +*/ +const TUint32 KSIPClientResolverClientUIDMask = 0x30000000; + +// + + +// ======== MEMBER FUNCTIONS ======== + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusAvaClientResolverUtil::CMusAvaClientResolverUtil() + { + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusAvaClientResolverUtil::ConstructL() + { + iRepository = CRepository::NewL( KCRUidSIPClientResolverConfig ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusAvaClientResolverUtil* CMusAvaClientResolverUtil::NewL() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaClientResolverUtil::NewL()" ) + CMusAvaClientResolverUtil* self = CMusAvaClientResolverUtil::NewLC(); + CleanupStack::Pop( self ); + MUS_LOG( "mus: [MUSAVA] <- CMusAvaClientResolverUtil::NewL()" ) + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusAvaClientResolverUtil* CMusAvaClientResolverUtil::NewLC() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaClientResolverUtil::NewLC()" ) + CMusAvaClientResolverUtil* self = new( ELeave ) CMusAvaClientResolverUtil; + CleanupStack::PushL( self ); + self->ConstructL(); + MUS_LOG( "mus: [MUSAVA] <- CMusAvaClientResolverUtil::NewLC()" ) + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusAvaClientResolverUtil::~CMusAvaClientResolverUtil() + { + MUS_LOG( "mus: [MUSAVA] -> ~CMusAvaClientResolverUtil()" ) + delete iRepository; + MUS_LOG( "mus: [MUSAVA] <- ~CMusAvaClientResolverUtil()" ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusAvaClientResolverUtil::RegisterClientWithUserL( + CSIPProfile& aProfile ) const + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaClientResolverUtil::RegisterClientWithUserL( profile )" ) + RBuf8 contactHeaderUser; + contactHeaderUser.CleanupClosePushL(); + User::LeaveIfError( GetContactHeaderUser( aProfile, contactHeaderUser ) ); + + RegisterClientWithUserL( TUid::Uid( KMusUiUid ), + contactHeaderUser, + KSipMXResolverImplUid ); + + CleanupStack::PopAndDestroy( &contactHeaderUser ); + MUS_LOG( "mus: [MUSAVA] <- CMusAvaClientResolverUtil::RegisterClientWithUserL( profile )" ) + } + + +// ----------------------------------------------------------------------------- +// Add line to client resolver cenrep table +// ----------------------------------------------------------------------------- +// +void CMusAvaClientResolverUtil::RegisterClientWithUserL( + const TUid& aImplementation, + const TDesC8& aProfileContactHeaderUser, + const TUid& aResolver ) const + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaClientResolverUtil::RegisterClientWithUserL()" ) + + if( aImplementation.iUid <= 0 || + aProfileContactHeaderUser.Length() <= 0 || + aResolver.iUid <= 0 ) + { + User::Leave( KErrArgument ); + } + + // Remove all earlier instances of client&user combination + UnRegisterClientWithUserL( aImplementation, aProfileContactHeaderUser ); + + User::LeaveIfError( + iRepository->StartTransaction( CRepository::EConcurrentReadWriteTransaction ) ); + TUint32 newKey = 0; + CreateNewKeyL( newKey ); + // Add the new row + TInt uid = aImplementation.iUid; + User::LeaveIfError( + iRepository->Create(newKey|KSIPClientResolverClientUIDMask, uid ) ); + User::LeaveIfError( + iRepository->Create(newKey|KSIPClientResolverUserNameMask, aProfileContactHeaderUser ) ); + uid = aResolver.iUid; + User::LeaveIfError( + iRepository->Create(newKey|KSIPClientResolverPluginUIDMask, uid ) ); + + // Commit the transaction + User::LeaveIfError( iRepository->CommitTransaction( newKey ) ); + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaClientResolverUtil::RegisterClientWithUserL()" ) + } + + +// ----------------------------------------------------------------------------- +// Remove line from client resolver cenrep table +// ----------------------------------------------------------------------------- +// +void CMusAvaClientResolverUtil::UnRegisterClientWithUserL( + CSIPProfile& aProfile ) const + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaClientResolverUtil::UnRegisterClientWithUserL( profile )" ) + + RBuf8 contactHeaderUser; + contactHeaderUser.CleanupClosePushL(); + User::LeaveIfError( GetContactHeaderUser( aProfile, contactHeaderUser ) ); + + UnRegisterClientWithUserL( TUid::Uid( KMusUiUid ), contactHeaderUser ); + + CleanupStack::PopAndDestroy( &contactHeaderUser ); + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaClientResolverUtil::UnRegisterClientWithUserL( profile )" ) + } + + +// ----------------------------------------------------------------------------- +// Remove line from client resolver cenrep table +// ----------------------------------------------------------------------------- +// +void CMusAvaClientResolverUtil::UnRegisterClientWithUserL( + const TUid& aImplementation, + const TDesC8& aProfileContactHeaderUser ) const + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaClientResolverUtil::UnRegisterClientWithUserL()" ) + + if( aImplementation.iUid <= 0 || + aProfileContactHeaderUser.Length() <= 0 ) + { + User::Leave( KErrArgument ); + } + + RArray keys; + CleanupClosePushL( keys ); + GetClientWithUserL( aImplementation, aProfileContactHeaderUser, keys ); + for ( TInt i = 0; i < keys.Count(); i++ ) + { + TUint32 errorKey; + User::LeaveIfError( + iRepository->StartTransaction( + CRepository::EConcurrentReadWriteTransaction ) ); + iRepository->Delete( keys[i], KSIPClientResolverKeyMask, errorKey ); + // Commit the transaction + User::LeaveIfError( iRepository->CommitTransaction( errorKey ) ); + } + CleanupStack::PopAndDestroy( &keys ); + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaClientResolverUtil::UnRegisterClientWithUserL()" ) + } + + +// ----------------------------------------------------------------------------- +// Resolve correct implementation UID for contact header +// ----------------------------------------------------------------------------- +// +void CMusAvaClientResolverUtil::GetImplementationUidWithUserL( + const TDesC8& aProfileContactHeaderUser, + TUid& aImplementation ) const + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaClientResolverUtil::GetImplementationUidWithUserL()" ) + + RArray keys; + CleanupClosePushL( keys ); + // Find all rows where KSIPClientResolverUserNameMask is aProfileContactHeaderUser + iRepository->FindEqL( KSIPClientResolverUserNameMask, + KSIPClientResolverFieldTypeMask, + aProfileContactHeaderUser, + keys ); + if (keys.Count() > 1) + { + //resolve correct Key + } + else if(keys.Count() == 1) + { + TInt implementationValue = KErrNotFound; + // Get implmentation uid of found user name + iRepository->Get( ( keys[0]^KSIPClientResolverUserNameMask ) | + KSIPClientResolverClientUIDMask, implementationValue ); + + User::LeaveIfError(implementationValue); + aImplementation.iUid = implementationValue; + } + else + { + User::Leave(KErrNotFound); + } + + CleanupStack::PopAndDestroy( &keys ); + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaClientResolverUtil::GetImplementationUidWithUserL()" ) + } + + +// ----------------------------------------------------------------------------- +// Find clients from resolver cenrep table +// ----------------------------------------------------------------------------- +// +void CMusAvaClientResolverUtil::GetClientWithUserL( + const TUid& aImplementation, + const TDesC8& aProfileContactHeaderUser, + RArray& aFoundKeys ) const + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaClientResolverUtil::GetClientWithUserL()" ) + + RArray keys; + + CleanupClosePushL( keys ); + // Find all rows where KSIPClientResolverUserNameMask is aProfileUserName + iRepository->FindEqL( KSIPClientResolverUserNameMask, + KSIPClientResolverFieldTypeMask, + aProfileContactHeaderUser, keys ); + for ( TInt i = 0; i < keys.Count(); i++ ) + { + TInt implementationValue = KErrNotFound; + // Get implmentation uid of found user name + iRepository->Get( ( keys[i]^KSIPClientResolverUserNameMask ) | + KSIPClientResolverClientUIDMask, implementationValue ); + // If implementation uid matches given uid, add row to found keys + if ( implementationValue == aImplementation.iUid ) + { + aFoundKeys.Append( keys[i]^KSIPClientResolverUserNameMask ); + } + + } + CleanupStack::PopAndDestroy( &keys ); + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaClientResolverUtil::GetClientWithUserL()" ) + } + + +// ----------------------------------------------------------------------------- +// Create a new key for the new row +// ----------------------------------------------------------------------------- +// +void CMusAvaClientResolverUtil::CreateNewKeyL( + TUint32& aNewKey ) const + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaClientResolverUtil::CreateNewKeyL()" ) + + RArray keys; + CleanupClosePushL( keys ); + TInt err = KErrNone; + + TRAPD( leaveCode, err = iRepository->FindL( KSIPClientResolverUserNameMask, + KSIPClientResolverFieldTypeMask, + keys ) ); + if ( KErrNotFound == leaveCode ) + { + err = KErrNotFound; + leaveCode = KErrNone; + } + User::LeaveIfError( leaveCode ); + if ( ( KErrNotFound == err ) || ( keys.Count() == 0 ) ) + { + aNewKey = 1; + } + else + { + User::LeaveIfError( err ); + // Find the biggest key and increment it by one + keys.SortUnsigned(); + aNewKey = KSIPClientResolverUserNameMask^keys[ keys.Count() - 1 ] + 1; + } + CleanupStack::PopAndDestroy( &keys ); + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaClientResolverUtil::CreateNewKeyL()" ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CMusAvaClientResolverUtil::GetContactHeaderUser( + CSIPProfile& aProfile, + RBuf8& aContactHeaderUser ) const + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaClientResolverUtil::GetContactHeaderUser()" ) + + TInt result( KErrNotFound ); + const TDesC8* contactHeaderUser( NULL ); + + // Get SIP's Username + result = aProfile.GetParameter( KCopyOfKSIPContactHeaderUser, contactHeaderUser ); + + if ( result == KErrNone && contactHeaderUser ) + { + result = aContactHeaderUser.ReAlloc( contactHeaderUser->Length() ); + if ( KErrNone == result ) + { + aContactHeaderUser.Copy( *contactHeaderUser ); + } + } + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaClientResolverUtil::GetContactHeaderUser()" ) + + return result; + } + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/src/musavaconnectionavailability.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/src/musavaconnectionavailability.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,567 @@ +/* +* Copyright (c) 2005-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: Provide interface for the client requestin availability class. +* +*/ + + + +#include "musavaconnectionavailability.h" +#include "musavaavailabilityobserver.h" +#include "musavasettingsimp.h" +#include "musavaobserver.h" +#include "musavaavailability.h" +#include "musavasharedobject.h" +#include "musavaconnectionmonitor.h" +#include "musavanetworkregistrationstatus.h" +#include "musavanetworkmodestatus.h" +#include "musavasip.h" +#include "mussettings.h" +#include "mussettingskeys.h" +#include "muslogger.h" +#include "musfactorysettings.h" + +#include +#include +#include +#include +#include + + +// -------------------------------------------------------------------------- +// Symbian two-phase constructor +// -------------------------------------------------------------------------- +// +CMusAvaConnectionAvailability* CMusAvaConnectionAvailability::NewL( + MMusAvaAvailabilityObserver& aObserver, + CMusAvaSettingsImp& aSettings ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaConnectionAvailability::NewL()" ) + CMusAvaConnectionAvailability* self = + CMusAvaConnectionAvailability::NewLC( + aObserver, aSettings ); + CleanupStack::Pop( self ); + MUS_LOG( "mus: [MUSAVA] <- CMusAvaConnectionAvailability::NewL()" ) + return self; + } + + +// ------------------------------------------------------------------------- +// Two-phased constructor. +// ------------------------------------------------------------------------- +// +CMusAvaConnectionAvailability* CMusAvaConnectionAvailability::NewLC( + MMusAvaAvailabilityObserver& aObserver, + CMusAvaSettingsImp& aSettings ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaConnectionAvailability::NewLC()" ) + CMusAvaConnectionAvailability* self = + new( ELeave ) CMusAvaConnectionAvailability( + aObserver, aSettings ); + CleanupStack::PushL( self ); + self->ConstructL(); + MUS_LOG( "mus: [MUSAVA] <- CMusAvaConnectionAvailability::NewLC()" ) + return self; + } + + +// ------------------------------------------------------------------------- +// Destructor. +// ------------------------------------------------------------------------- +// +CMusAvaConnectionAvailability::~CMusAvaConnectionAvailability() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaConnectionAvailability::\ + ~CMusAvaConnectionAvailability()" ) + if( iSharedObj ) + { + iSharedObj->DeleteSingleton(); + } + MUS_LOG( "mus: [MUSAVA] <- CMusAvaConnectionAvailability::\ + ~CMusAvaConnectionAvailability()" ) + } + + +// ------------------------------------------------------------------------- +// Constructor. +// ------------------------------------------------------------------------- +// +CMusAvaConnectionAvailability::CMusAvaConnectionAvailability( + MMusAvaAvailabilityObserver& aObserver, + CMusAvaSettingsImp& aSettings ) + :CMusAvaAvailability( aObserver ), + iSettings( aSettings ) + { + } + + +// --------------------------------------------------------------------------- +// Symbian 2nd phase constructor can leave. +// --------------------------------------------------------------------------- +// +void CMusAvaConnectionAvailability::ConstructL() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaConnectionAvailability::ConstructL()" ) + iSharedObj = CMusAvaSharedObject::GetSingletonL(); + iNetworkRegistrationStatus = &iSharedObj->MusAvaTelephonyStatus(); + iNetworkModeStatus = &iSharedObj->NetworkModeStatus(); + iConnectionMonitor = &iSharedObj->ConnectionMonitor(); + iNetworkRegistrationStatus->AddAdapterL( *this ); + iNetworkModeStatus->AddAdapterL( *this ); + iConnectionMonitor->AddAdapterL( *this ); + iConnectionMonitor->NotifyEventL(); + MUS_LOG( "mus: [MUSAVA] <- CMusAvaConnectionAvailability::ConstructL()" ) + } + + +// --------------------------------------------------------------------------- +// From CMusAvaAvailability. +// Executes for the availability +// --------------------------------------------------------------------------- +// + +void CMusAvaConnectionAvailability::DoExecuteL() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaConnectionAvailability::DoExecuteL()" ) + MMusAvaObserver::TAvailabilityStatus status; + MUS_LOG( "mus: [MUSAVA] Check network mode" ) + RMobilePhone::TMobilePhoneNetworkMode networkmode = + iNetworkModeStatus->PhoneNetworkMode(); + + TBool SupportedNetwork = EFalse; + + TRAPD( err, SupportedNetwork = MusFactorySettings::IsSupportedL(networkmode) ); + + + if ( err != KErrNone ) + { + MUS_LOG1( "mus: [MUSAVA] Reading activation setting error:%d", err ) + SetState( MMusAvaObserver::EMusActivationError ); + } + + else if ( SupportedNetwork ) + { + if ( networkmode == RMobilePhone::ENetworkModeGsm ) + { + MUS_LOG( "mus: [MUSAVA] Edge Network Mode allowed in settings " ) + if( iConnectionMonitor->ConnectionCount() > 0) + { + MUS_LOG( "mus: [MUSAVA] Atlease one packect connection exists " ) + SetState( NetworkRegistrationAndSettingsL() ); + } + else + { + MUS_LOG( "mus: [MUSAVA] No Packet connection exists now." ) + SetState( MMusAvaObserver::EMusAvaEdgeDtmStatusUnknown ); + } + } + + else + { + status = NetworkRegistrationAndSettingsL(); + MUS_LOG1( "mus: [MUSAVA] Activation Status: %d", status ) + SetState( status ); + } + } + else + { + MUS_LOG( "mus: [MUSAVA] Network not available" ) + SetState( MMusAvaObserver::EMusAvaNetworkType ); + } + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaConnectionAvailability::DoExecuteL()" ) + } + + +// --------------------------------------------------------------------------- +// From CMusAvaAvailability. +// Stops execution. +// --------------------------------------------------------------------------- +// +void CMusAvaConnectionAvailability::Stop() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaConnectionAvailability::Stop()" ) + + iNetworkRegistrationStatus->RemoveAdapter( *this ); + iNetworkModeStatus->RemoveAdapter( *this ); + iConnectionMonitor->RemoveAdapter( *this ); + + SetState( MMusAvaObserver::EMusAvaStatusNotExecuted ); + MUS_LOG( "mus: [MUSAVA] <- CMusAvaConnectionAvailability::Stop()" ) + } + + +// --------------------------------------------------------------------------- +// From CMusAvaAvailability. +// Returns name of *this* availability module. +// --------------------------------------------------------------------------- +// +MMusAvaObserver::TAvailabilityName CMusAvaConnectionAvailability::Name() + { + return MMusAvaObserver::EMusAvaBearerStatus; + } + +// --------------------------------------------------------------------------- +// CMusAvaConnectionAvailability::PhoneNetworkModeStatus +// +// --------------------------------------------------------------------------- +// +void CMusAvaConnectionAvailability::PhoneNetworkModeStatus( + RMobilePhone::TMobilePhoneNetworkMode aStatus ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaConnectionAvailability::\ + PhoneNetworkModeStatus()" ) + MUS_LOG1( "mus: [MUSAVA] Mobile Phone Network Status = ", aStatus ) + + TBool SupportedNetwork = EFalse; + + TRAPD( err, SupportedNetwork = MusFactorySettings::IsSupportedL(aStatus) ); + + if ( err != KErrNone || !SupportedNetwork ) + { + MUS_LOG( "mus: [MUSAVA] Network not available" ) + SetState( MMusAvaObserver::EMusAvaNetworkType ); + } + else + { + MMusAvaObserver::TAvailabilityStatus status = + MMusAvaObserver::EMusActivationError; + TRAP_IGNORE( status = NetworkRegistrationAndSettingsL() ); + SetState( status ); + } + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaConnectionAvailability::\ + PhoneNetworkModeStatus()" ) + } + +// --------------------------------------------------------------------------- +// CMusAvaConnectionAvailability::NetworkRegistrationStatus +// +// --------------------------------------------------------------------------- +// +void CMusAvaConnectionAvailability::NetworkRegistrationStatus( + RMobilePhone::TMobilePhoneRegistrationStatus aRegStatus ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaConnectionAvailability::\ + NetworkRegistrationStatus()" ) + MUS_LOG1( "Mobile Phone Network Status = ", aRegStatus ) + + MusSettingsKeys::TActivation activation = MusSettingsKeys::ENever; + + TRAPD( err, activation = MultimediaSharingSettings::ActivationSettingL() ); + if( err != KErrNone ) + { + MUS_LOG1( "mus: [MUSAVA] Reading activation setting error:%d", err ) + SetState( MMusAvaObserver::EMusActivationError ); + } + else + { + if( activation == MusSettingsKeys::EActiveInHomeNetworks && + aRegStatus != RMobilePhone::ERegisteredOnHomeNetwork ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaConnectionAvailability::\ + NetworkRegistrationStatus()" ) + SetState( MMusAvaObserver::EMusAvaRoamingError ); + } + } + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaConnectionAvailability::\ + NetworkRegistrationStatus()" ) + } + + +// --------------------------------------------------------------------------- +// CMusAvaConnectionAvailability::EventL +// +// --------------------------------------------------------------------------- +// +void CMusAvaConnectionAvailability::EventL( + const CConnMonEventBase& aConnMonEvent) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaConnectionAvailability::EventL()" ) + TInt connectionId = 0; + TInt event = aConnMonEvent.EventType(); + TUint connId = aConnMonEvent.ConnectionId(); + CMusAvaConnectionMonitor& connectionMonitor = + iSharedObj->ConnectionMonitor(); + TUint musConnID = connectionMonitor.CreatedConnectionID(); + MUS_LOG1( "mus: [MUSAVA] Current connection ID %d = ", musConnID ) + MUS_LOG1( "mus: [MUSAVA] Event connection ID %d = ", connId ) + + switch ( event ) + { + case EConnMonCreateConnection: + { + MUS_LOG( "mus: [MUSAVA] Event type = EConnMonCreateConnection" ) + if( musConnID == 0 ) + { + MUS_LOG( "mus: [MUSAVA] Store Connection ID" ) + TRAPD( err, connectionId = + iConnectionMonitor->ConnectionIDL() ); + if ( err == KErrNotFound ) + { + SetState( MMusAvaObserver::EMusAvaConnectionErr ); + } + else + { + iConnectionMonitor->SetConnectionID( connectionId ); + } + } + break; + } + case EConnMonDeleteConnection: + { + MUS_LOG( "mus: [MUSAVA] Event type = EConnMonDeleteConnection" ) + if( connId == musConnID ) + { + SetState( MMusAvaObserver::EMusAvaConnectionErr ); + } + break; + } + + case EConnMonConnectionStatusChange: + { + MUS_LOG( "mus: [MUSAVA] Event type = \ + EConnMonConnectionStatusChange" ) + const CConnMonConnectionStatusChange* connectionStatusChange + = (const CConnMonConnectionStatusChange*)(&aConnMonEvent); + TInt connStatus = connectionStatusChange->ConnectionStatus(); + MUS_LOG1( "mus: [MUSAVA] ConnectionStatus = %d", connStatus ) + if ( connId == musConnID ) + { + if( connStatus == KConnectionFailure || + connStatus == KConnectionClosed || + connStatus == KDataTransferTemporarilyBlocked || + connStatus == KLinkLayerClosed || + connStatus == KPsdSuspended || + connStatus == KPsdFinishedDeactivation ) + { + SetState( MMusAvaObserver::EMusAvaConnectionErr ); + } + if( connStatus == KConnectionOpen || + connStatus == KLinkLayerOpen ) + { + SetState( NetworkRegistrationAndSettingsL() ); + } + } + break; + } + case EConnMonNetworkStatusChange: + { + MUS_LOG( "mus: [MUSAVA] Event type = EConnMonNetworkStatusChange" ) + const CConnMonNetworkStatusChange* networkStatusChange + = (const CConnMonNetworkStatusChange*)(&aConnMonEvent); + TInt networkStatus = networkStatusChange->NetworkStatus(); + MUS_LOG1( "mus: [MUSAVA] NetworkStatus = %d", networkStatus ) + if( connId == EBearerIdWCDMA || connId == EBearerIdWcdmaCSD ) + { + if( EConnMonStatusAttached == networkStatus || + EConnMonStatusActive == networkStatus ) + { + SetState( NetworkRegistrationAndSettingsL() ); + } + else + { + SetState( MMusAvaObserver::EMusAvaConnectionErr ); + } + } + break; + } + case EConnMonNetworkRegistrationChange: + { + MUS_LOG( "mus: [MUSAVA] Event type = \ + EConnMonNetworkRegistrationChange" ) + const CConnMonNetworkRegistrationChange* registrationChange + = (const CConnMonNetworkRegistrationChange*)(&aConnMonEvent); + TInt registrationStatus = registrationChange->RegistrationStatus(); + MUS_LOG1( "mus: [MUSAVA] RegistrationStatus = %d", + registrationStatus ) + if( connId == EBearerIdWCDMA || connId == EBearerIdWcdmaCSD ) + { + if ( ENetworkRegistrationRoaming == registrationStatus ) + { + SetState( MMusAvaObserver::EMusAvaRoamingError ); + } + else + { + SetState( NetworkRegistrationAndSettingsL() ); + } + } + break; + } + case EConnMonBearerChange: + { + MUS_LOG( "mus: [MUSAVA] Event type = EConnMonBearerChange" ) + MUS_LOG1( "mus: [MUSAVA] Bearer = %d",connId ) + if( connId == EBearerIdGPRS || + connId == EBearerIdWCDMA || + connId == EBearerIdWcdmaCSD ) + { + SetState( NetworkRegistrationAndSettingsL() ); + } + else + { + SetState( MMusAvaObserver::EMusAvaNetworkType ); + } + break; + } + + case EConnMonPacketDataAvailable: + { + MUS_LOG( "mus: [MUSAVA] EConnMonPacketDataAvailable" ) + /* This is for EDGE /DTM support , This is the only place we can be + sure that packet data available along with CS call. Here we have to + check again for activation settings and based on that availability + state has to be set + */ + MMusAvaObserver::TAvailabilityStatus status + = NetworkRegistrationAndSettingsL(); + SetState( status ); + break; + } + + case EConnMonPacketDataUnavailable: + { + if( connId == musConnID ) + { + SetState( MMusAvaObserver::EMusAvaNetworkType ); + MUS_LOG( "mus: [MUSAVA] EConnMonPacketDataUnavailable" ) + } + else + { + MUS_LOG2( +"mus: [MUSAVA] different connId (%d,%d) ignore EConnMonPacketDataUnavailable", + musConnID, connId ) + } + break; + } + + case EConnMonBearerInfoChange: + { + MUS_LOG( "mus: [MUSAVA] EConnMonBearerInfoChange" ) + break; + } + default : + { + MUS_LOG( "mus: [MUSAVA] Event type is not implemented" ) + MUS_LOG1( "mus: [MUSAVA] Event type %d = ", event ) + break; + } + } + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaConnectionAvailability::EventL()" ) + } + +// ------------------------------------------------------------------------- +// CMusAvaConnectionAvailability::MusAvaManualActivation +// +// ------------------------------------------------------------------------- +// +MMusAvaObserver::TAvailabilityStatus CMusAvaConnectionAvailability:: + ManualActivationL() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaConnectionAvailability::\ + ManualActivationL()" ) + + MusSettingsKeys::TOperatorVariant operatorVariant = + MusSettingsKeys::EStandard; + operatorVariant = MultimediaSharingSettings::OperatorVariantSettingL(); + + if( operatorVariant == MusSettingsKeys::EOperatorSpecific ) + { + MUS_LOG( "mus: [MUSAVA] Operator Specific No Manual query" ) + MUS_LOG( "mus: [MUSAVA] <- CMusAvaConnectionAvailability::\ + NetworkRegistrationAndSettingsL()" ) + return MMusAvaObserver::EMusActivationError; + } + else + { + if ( iSettings.ManualActivation() == + MMusAvaSettings::EActivationAllowed ) + { + MUS_LOG( "mus: [MUSAVA] Manual activation allowed" ) + MUS_LOG( "mus: [MUSAVA] <- CMusAvaConnectionAvailability::\ + ManualActivationL()" ) + return MMusAvaObserver::EMusAvaStatusAvailable; + } + else if ( iSettings.ManualActivation() == + MMusAvaSettings::EActivationNotExecuted ) + { + MUS_LOG( "mus: [MUSAVA] Manual activation is not executed" ) + MUS_LOG( "mus: [MUSAVA] <- CMusAvaConnectionAvailability::\ + ManualActivationL()" ) + return MMusAvaObserver::EMusAvaManualActivation; + } + else + { + MUS_LOG( "mus: [MUSAVA] Activation error" ) + MUS_LOG( "mus: [MUSAVA] <- CMusAvaConnectionAvailability::\ + ManualActivationL()" ) + return MMusAvaObserver::EMusActivationError; + } + } + } + +// ------------------------------------------------------------------------- +// CMusAvaConnectionAvailability::NetworkRegistrationAndSettingsL +// +// ------------------------------------------------------------------------- +// +MMusAvaObserver::TAvailabilityStatus CMusAvaConnectionAvailability:: + NetworkRegistrationAndSettingsL() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaConnectionAvailability::\ + NetworkRegistrationAndSettingsL()" ) + MUS_LOG( "mus: [MUSAVA] Check registration network status" ) + MUS_LOG( "mus: [MUSAVA] Check roaming" ) + + RMobilePhone::TMobilePhoneRegistrationStatus regStatus; + iNetworkRegistrationStatus->NetworkRegistration( regStatus ); + + MUS_LOG1( "mus: [MUSAVA] NetworkRegistration returned %d", regStatus ) + + MMusAvaObserver::TAvailabilityStatus status; + MusSettingsKeys::TActivation activation = MusSettingsKeys::EAlwaysActive; + + activation = MultimediaSharingSettings::ActivationSettingL(); + + MUS_LOG1( "mus: [MUSAVA] ActivationSetting returned %d", + activation ) + + if ( activation == MusSettingsKeys::EAlwaysActive ) + { + status = MMusAvaObserver::EMusAvaStatusAvailable; + } + else if ( activation == MusSettingsKeys::EActiveInHomeNetworks && + regStatus == RMobilePhone::ERegisteredOnHomeNetwork ) + { + status = MMusAvaObserver::EMusAvaStatusAvailable; + } + else if( activation == MusSettingsKeys::EActiveInHomeNetworks && + regStatus == RMobilePhone::ERegisteredRoaming ) + { + status = ManualActivationL(); + } + else + { + status = MMusAvaObserver::EMusActivationError; + } + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaConnectionAvailability::\ + NetworkRegistrationAndSettingsL()" ) + return status; + } + +// End of File + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/src/musavaconnectionmonitor.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/src/musavaconnectionmonitor.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,345 @@ +/* +* Copyright (c) 2005-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: Provide interface for the client requestin availability class. +* +*/ + + + +#include "musavaconnectionmonitor.h" +#include "musavasettingsimp.h" +#include "musavanetworkavailability.h" +#include "musavaobserver.h" +#include "musavaavailability.h" +#include "musavasharedobject.h" +#include "musavaconnectionmonitorobserver.h" +#include "musavasip.h" +#include "muslogger.h" + +#include +#include +#include + +// ------------------------------------------------------------------------- +// Two-phased constructor. +// ------------------------------------------------------------------------- +// +CMusAvaConnectionMonitor* CMusAvaConnectionMonitor::NewL( + CMusAvaSharedObject& aSharedObject ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaConnectionMonitor::NewL()" ) + CMusAvaConnectionMonitor* self = + new( ELeave ) CMusAvaConnectionMonitor( aSharedObject ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + MUS_LOG( "mus: [MUSAVA] <- CMusAvaConnectionMonitor::NewL()" ) + return self; + } + + +// ------------------------------------------------------------------------- +// Destructor. +// ------------------------------------------------------------------------- +// +CMusAvaConnectionMonitor::~CMusAvaConnectionMonitor() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaConnectionMonitor::\ + ~CMusAvaConnectionMonitor()" ) + iConnectionMonitorObserver.Reset(); + iConnectionMonitorObserver.Close(); + // Close the monitor when event notifications are no longer required + iConnectionMonitor.Close(); + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaConnectionMonitor::\ + ~CMusAvaConnectionMonitor()" ) + } + +// ------------------------------------------------------------------------- +// Constructor function. +// ------------------------------------------------------------------------- +// +void CMusAvaConnectionMonitor::EventL(const CConnMonEventBase& aConnMonEvent) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaConnectionMonitor::EventL()" ) + TUint connectionId = aConnMonEvent.ConnectionId(); + TInt eventType = aConnMonEvent.EventType(); + MUS_LOG1( "Connection ID = %d", connectionId ) + MUS_LOG1( "Event type = %d", eventType ) + + for( TInt i=0; iEventL( aConnMonEvent ); + } + MUS_LOG( "mus: [MUSAVA] <- CMusAvaConnectionMonitor::EventL()" ) + } + + +// ------------------------------------------------------------------------- +// Constructor function. +// ------------------------------------------------------------------------- +// +CMusAvaConnectionMonitor::CMusAvaConnectionMonitor( + CMusAvaSharedObject& aSharedObject ): +iSharedObj( &aSharedObject ) + { + } + +// ------------------------------------------------------------------------- +// Second phase constructor. +// ------------------------------------------------------------------------- +// +void CMusAvaConnectionMonitor::ConstructL() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaConnectionMonitor::ConstructL()" ) + User::LeaveIfError( iConnectionMonitor.ConnectL() ); + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaConnectionMonitor::ConstructL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +void CMusAvaConnectionMonitor::AddAdapterL( + MMusAvaConnectionMonitorObserver& aAdapter ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaConnectionMonitor::\ + AddAdapterL( MMusAvaConnectionMonitorObserver& aAdapter )" ) + iConnectionMonitorObserver.AppendL( &aAdapter ); + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSip::\ + AddAdapterL( MMusAvaConnectionMonitorObserver& aAdapter )" ) + } + +// ------------------------------------------------------------------------- +// Created connection ID for multimedia sharing is returned +// ------------------------------------------------------------------------- +// +TUint CMusAvaConnectionMonitor::CreatedConnectionID() + { + return iConnectionID; + } + +// ------------------------------------------------------------------------- +// Connection ID is stored +// ------------------------------------------------------------------------- +// +void CMusAvaConnectionMonitor::SetConnectionID( TUint aConnectionID ) + { + iConnectionID = aConnectionID; + } +// ------------------------------------------------------------------------- +// Active connection ID for multimedia sharing is returned +// ------------------------------------------------------------------------- +// +TUint CMusAvaConnectionMonitor::ConnectionIDL() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaConnectionMonitor::ConnectionIDL()" ) + TUint iap = 0; //Internet acces point + TUint sipIap = 0; //SIP acces point + TUint count = 0; //Number of connections + TUint id = 0; //Connection ID + TUint activeIapID = 0; //Connection ID for active SIP IAP + TUint subId = 0; //SubconnectionID + TUint subCount; //Subconnectioncount + TRequestStatus status; + + //Fetch number of connections to count + count = ConnectionCount(); + if ( count == 0 ) + { + MUS_LOG( "mus: [MUSAVA] Non connections" ) + } + else + { + MUS_LOG1( "mus: [MUSAVA] Fetch number of connections: %d", count ) + + //Fetch internet access point to iap + sipIap = MultimediaSharingAccessPointID(); + if ( sipIap == 0 ) + { + MUS_LOG( "mus: [MUSAVA] Non Access Point ID's for app" ) + } + else + { + MUS_LOG1( "mus: [MUSAVA] Internet access point for sip: %d", + sipIap ) + + TBool goOn = ETrue; + for ( TUint i = 1; i <= count && goOn; i++ ) + { + //Fetch connectionId to id + User::LeaveIfError(iConnectionMonitor.GetConnectionInfo( + i, id, subCount )); + MUS_LOG1( "mus: [MUSAVA] Connection ID = %d", id ) + + //Fetch internet access point to iap + iConnectionMonitor.GetUintAttribute( id, subId, KIAPId, + iap, status ); + #ifndef UNIT_TESTING + User::WaitForRequest( status ); + #endif + MUS_LOG1( "mus: [MUSAVA] Internet access point %d ", iap ) + + // when correct Iap found ... + if( iap == sipIap ) + { + MUS_LOG( "mus: [MUSAVA] Connection ID found" ) + activeIapID = id; + goOn = EFalse; + } + } + + } + } + MUS_LOG( "mus: [MUSAVA] <- CMusAvaConnectionMonitor::ConnectionIDL()" ) + return activeIapID; + } +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +TBool CMusAvaConnectionMonitor::KillPdpContext() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaConnectionMonitor::KillPdpContext" ) + + TUint connId = 0; + TUint subConnectionCount = 0; + TRequestStatus requestStatus; + TUint count = ConnectionCount(); + TInt ret = 0; + TBool retval = EFalse; + + for ( TUint i = 1; i <= count && !retval; i++ ) + { + TInt bearerType = 0; + iConnectionMonitor.GetIntAttribute( connId, + subConnectionCount, + KBearer, + bearerType, + requestStatus ); + User::WaitForRequest( requestStatus ); + if ( bearerType == EBearerCSD || + bearerType == EBearerHSCSD || + bearerType == EBearerGPRS || + bearerType == EBearerEdgeGPRS || + bearerType == EBearerWCDMA || + bearerType == EBearerWcdmaCSD ) + { + MUS_LOG1( "mus: [MUSAVA] now killing connection whose connId \ + == <%d>", connId ) + ret = iConnectionMonitor.GetConnectionInfo( i, connId, + subConnectionCount ); + if ( ret == KErrNone ) + { + ret = iConnectionMonitor.SetBoolAttribute( connId, 0, + KConnectionStop, ETrue ); + if ( ret == KErrNone ) + { + retval = ETrue; + } + } + } + } + MUS_LOG( "mus: [MUSAVA] <- CMusAvaConnectionMonitor::KillPdpContext" ) + return retval; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +void CMusAvaConnectionMonitor::RemoveAdapter( + MMusAvaConnectionMonitorObserver& aAdapter ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaConnectionMonitor::\ + RemoveAdapter( MMusAvaConnectionMonitorObserver& aAdapter )" ) + TInt index = iConnectionMonitorObserver.Find( &aAdapter ); + + if( index != KErrNotFound ) + { + iConnectionMonitorObserver.Remove( index ); + } + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSip::\ + RemoveAdapter( MMusAvaConnectionMonitorObserver& aAdapter )" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +void CMusAvaConnectionMonitor::NotifyEventL() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaConnectionMonitor::NotifyEventL()" ) + iConnectionMonitor.NotifyEventL( *this ); + MUS_LOG( "mus: [MUSAVA] <- CMusAvaConnectionMonitor::NotifyEventL()" ) + } + +// ------------------------------------------------------------------------- +// Active connection count for multimedia sharing is returned +// ------------------------------------------------------------------------- +// +TUint CMusAvaConnectionMonitor::ConnectionCount() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaConnectionMonitor::ConnectionCount()" ) + TUint count = (TUint) KErrNotFound; + TRequestStatus status; + + iConnectionMonitor.GetConnectionCount( count, status ); + #ifndef UNIT_TESTING + User::WaitForRequest( status ); + #endif + if ( status.Int() != KErrNone ) + { + MUS_LOG( "mus: [MUSAVA] Phone doesn't have any active connections" ) + } + MUS_LOG( "mus: [MUSAVA] <- CMusAvaConnectionMonitor::ConnectionCount()" ) + return count; + } + +// ------------------------------------------------------------------------- +// Active Internet Access Point ID for multimedia sharing is returned +// ------------------------------------------------------------------------- +// +TUint CMusAvaConnectionMonitor::MultimediaSharingAccessPointID() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaConnectionMonitor::\ + MultimediaSharingAccessPointID()" ) + TUint retval = KErrNone; + TBool profileCreated = EFalse; + TRAPD( err, profileCreated = iSharedObj->MusAvaSip().CreateProfileL() ); + if ( err || !profileCreated ) + { + retval = (TUint)KErrNotFound; + } + else + { + CSIPProfile* profile = iSharedObj->MusAvaSip().Profile(); + // Get IAP ID + MUS_LOG( "mus: [MUSAVA] Get IAP ID" ) + + TInt ret = profile->GetParameter( KSIPAccessPointId, iProfileId ); + if( ret ) + { + MUS_LOG( "mus: [MUSAVA] IAP ID is not found" ) + MUS_LOG( "mus: [MUSAVA] <- CMusAvaConnectionMonitor::\ + MultimediaSharingAccessPointID()" ) + retval = (TUint)ret; + } + else + { + MUS_LOG1( "mus: [MUSAVA] IAP ID = %d", iProfileId ) + retval = iProfileId; + } + } + MUS_LOG( "mus: [MUSAVA] <- CMusAvaConnectionMonitor::\ + MultimediaSharingAccessPointID()" ) + return retval; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/src/musavacontactavailability.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/src/musavacontactavailability.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,186 @@ +/* +* Copyright (c) 2005-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: Provide interface for the client requestin availability class. +* +*/ + + +#include "musavacontactavailability.h" +#include "musavaavailabilityobserver.h" +#include "musavasettingsimp.h" +#include "musavaobserver.h" +#include "muslogger.h" +#include "mussettings.h" + +#include +#ifdef UNIT_TESTING // if unit testing +#include +#endif // UNIT_TESTING + +const TInt KContactsArraySize = 10; + +_LIT( KMusAvaTel, "tel:" ); +_LIT( KMusAvaPlus, "+" ); + +CMusAvaContactAvailability* CMusAvaContactAvailability::NewL( + MMusAvaAvailabilityObserver& aObserver, + CMusAvaSettingsImp& aSettings ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaContactAvailability::NewL()" ) + + CMusAvaContactAvailability* self = + CMusAvaContactAvailability::NewLC( + aObserver, + aSettings ); + CleanupStack::Pop( self ); + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaContactAvailability::NewL()" ) + return self; + } + + +CMusAvaContactAvailability* CMusAvaContactAvailability::NewLC( + MMusAvaAvailabilityObserver& aObserver, + CMusAvaSettingsImp& aSettings ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaContactAvailability::NewL()" ) + CMusAvaContactAvailability* self = + new( ELeave ) CMusAvaContactAvailability( + aObserver, + aSettings ); + CleanupStack::PushL( self ); + self->ConstructL(); + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaContactAvailability::NewL()" ) + return self; + } + + +CMusAvaContactAvailability::~CMusAvaContactAvailability() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaContactAvailability::\ + ~CMusAvaContactAvailability()" ) + delete iContactName; + iContactName = NULL; + MUS_LOG( "mus: [MUSAVA] <- CMusAvaContactAvailability::\ + ~CMusAvaContactAvailability()" ) + } + + +CMusAvaContactAvailability::CMusAvaContactAvailability( + MMusAvaAvailabilityObserver& aObserver, + CMusAvaSettingsImp& aSettings ) + :CMusAvaAvailability( aObserver ), + iContactName( NULL ), + iSettings( aSettings ) + { + } + + +void CMusAvaContactAvailability::ConstructL() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaContactAvailability::ConstructL()" ) + iOperatorVariant = MultimediaSharingSettings::OperatorVariantSettingL(); + MUS_LOG( "mus: [MUSAVA] <- CMusAvaContactAvailability::ConstructL()" ) + } + + +// ------------------------------------------------------------------------- +// Starts the loopy execution. +// ------------------------------------------------------------------------- +// +void CMusAvaContactAvailability::DoExecuteL() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaContactAvailability::DoExecuteL()" ) + + CDesCArrayFlat* contactsArray + = new ( ELeave ) CDesCArrayFlat( KContactsArraySize ); + CleanupStack::PushL( contactsArray ); + + ActiveCallL( contactsArray ); + + iSettings.SetSipAddressesL( *contactsArray ); + + contactsArray->Reset(); + + CleanupStack::PopAndDestroy( contactsArray ); + + SetState( MMusAvaObserver::EMusAvaStatusAvailable ); + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaContactAvailability::DoExecuteL()" ) + } + + +// ------------------------------------------------------------------------- +// +// ------------------------------------------------------------------------- +// +TBool CMusAvaContactAvailability::ActiveCallL( CDesCArrayFlat*& aContactsArray ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaContactAvailability::ActiveCallL()" ) + + const TDesC& phoneNumber = iSettings.TelNumber(); + TInt retval = EFalse; + const MDesCArray& addresses = iSettings.SipAddresses(); + TInt addressesCount = addresses.MdcaCount(); + + if ( phoneNumber.Length() > 0 && + ( iOperatorVariant == MusSettingsKeys::EOperatorSpecific || + phoneNumber.Left(1).Compare( KMusAvaPlus() ) == 0 ) ) + { + MUS_LOG( "mus: [MUSAVA] Phone number found with + prefix \ + (or operator variant)" ) + // No, it doesn't, so add the prefix to the new address. + MUS_LOG( "mus: [MUSAVA] Prefix to the new address is added" ) + //Create contact array + //Create tel bufer + HBufC* tmpDescriptor = HBufC::NewLC( KMusAvaTel().Length() + + phoneNumber.Length() ); + tmpDescriptor->Des().Append( KMusAvaTel() ); + tmpDescriptor->Des().Append( phoneNumber ); + //Add to array + aContactsArray->AppendL( tmpDescriptor->Des() ); + CleanupStack::PopAndDestroy( tmpDescriptor ); + retval = ETrue; + } + else if ( addressesCount > 0 ) + { + MUS_LOG1( "mus: [MUSAVA] addresses.MdcaCount() %d", + addressesCount ) + const TDesC& sipAddress = addresses.MdcaPoint( 0 ); + MUS_LOG_TDESC( "mus: [MUSAVA] SIP Address: ", + sipAddress ) + aContactsArray->AppendL( sipAddress ); + retval = ETrue; + } + else + { + MUS_LOG( "mus: [MUSAVA] Phone number or SIP URL not found " ) + retval = EFalse; + } + MUS_LOG1( "mus: [MUSAVA] <- CMusAvaContactAvailability::\ + ActiveCallL return %d", retval ) + + return retval; + } + +MMusAvaObserver::TAvailabilityName CMusAvaContactAvailability::Name() + { + return MMusAvaObserver::EMusAvaNameContactStatus; + } + + + + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/src/musavadefaultimp.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/src/musavadefaultimp.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,527 @@ +/* +* Copyright (c) 2005-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: This is default implementation class for CMusAvaInterface +* +*/ + + + +#include "musavadefaultimp.h" +#include "musavaavailabilityobserver.h" +#include "musavaobserver.h" +#include "musavasettingsimp.h" +#include "musavasharedobject.h" +#include "muslogger.h" +#include "musavainvitehandler.h" +#include "musavanetworkavailability.h" +#include "musavacontactavailability.h" +#include "musavaconnectionavailability.h" +#include "musavaregisteravailability.h" +#include "musavaoptionhandler.h" +#include "musavadefaultoptionhandler.h" +#include "musavasipprofileavailability.h" +#include "musavasettingavailability.h" + +#include "mussesseioninformationapi.h" + +#include + + +const MMusAvaObserver::TAvailabilityName KMinimumAvailability + = MMusAvaObserver::EMusAvaBearerStatus; + +const MMusAvaObserver::TAvailabilityName KMandatoryAvailability + = MMusAvaObserver::EMusAvaNameRegistration; + +const MMusAvaObserver::TAvailabilityName KExtensionAvailability + = MMusAvaObserver::EMusAvaOptionHandler; + + +// ----------------------------------------------------------------------------- +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CMusAvaDefaultImp* CMusAvaDefaultImp::NewL() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaDefaultImp::NewL" ) + CMusAvaDefaultImp* self = new (ELeave) CMusAvaDefaultImp(); + CleanupStack::PushL (self); + self->ConstructL(); + CleanupStack::Pop( self ); + MUS_LOG( "mus: [MUSAVA] <- CMusAvaDefaultImp::NewL" ) + return self; + } + + +// ----------------------------------------------------------------------------- +// C++ destructor. +// ----------------------------------------------------------------------------- +// +CMusAvaDefaultImp::~CMusAvaDefaultImp() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaDefaultImp::~CMusAvaDefaultImp" ) + this->Stop(); + iAvailabilities.ResetAndDestroy(); + delete iSettings; + iSettings = NULL; + MUS_LOG( "mus: [MUSAVA] <- CMusAvaDefaultImp::~CMusAvaDefaultImp" ) + } + + +// ----------------------------------------------------------------------------- +// Symbian second-phase constructor. +// ----------------------------------------------------------------------------- +// +void CMusAvaDefaultImp::ConstructL() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaDefaultImp::ConstructL" ) + iSettings = CMusAvaSettingsImp::NewL(); + CreateAvailabilityModulesL(); + MUS_LOG( "mus: [MUSAVA] <- CMusAvaDefaultImp::ConstructL" ) + } + + +// ----------------------------------------------------------------------------- +// C++ Constructor +// ----------------------------------------------------------------------------- +// +CMusAvaDefaultImp::CMusAvaDefaultImp() + :iObserver( NULL ), + iCurrentAvailability( MMusAvaObserver::EMusAvaNameNotDefined ), + iAvailabilityStatus ( MMusAvaObserver::EMusAvaStatusNotExecuted ), + iStopping( EFalse ), + iExecuteStarted( EFalse ) + { + } + + +// ----------------------------------------------------------------------------- +// Creates concrete factory and all availability objects +// ----------------------------------------------------------------------------- +// +void CMusAvaDefaultImp::CreateAvailabilityModulesL() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaDefaultImp::\ + CreateAvailabilityModulesL" ) + + if ( iAvailabilities.Count() ) + { + Stop(); + iAvailabilities.ResetAndDestroy(); + } + + /* We need handlers all the time to respond incoming Invite/Options + So construct this modules first. + */ + ConstuctHandlerAvailabilityModulesL(); + + /* We must check the static availability modules like sipprofile + mus activation settings. if this fails then this + will be fatal and no need to go and construct further. + */ + ConstructStaticAvailabilityModulesL(); + + /* Check the handler and static availability modules are OK . If it is not + * OK then dont need to create further availability modules. + */ + for ( TInt i = 0; i < iAvailabilities.Count(); i++ ) + { + if ( !iAvailabilities[i]->Available()) + { + MUS_LOG1( "mus: [MUSAVA] <- CMusAvaDefaultImp:: \ + CreateAvailabilityModulesL Fails! Module = %d ",i ) + return ; + } + } + + /* This should construct modules in where availability could change + * dynamically such as network,bearer and call status etc. + */ + ConstructDynamicAvailabilityModulesL(); + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaDefaultImp::\ + CreateAvailabilityModulesL" ) + } + +// ----------------------------------------------------------------------------- +// Creates concrete standard availability objects +// ----------------------------------------------------------------------------- +// +void CMusAvaDefaultImp::ConstuctHandlerAvailabilityModulesL() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaDefaultImp::\ + ConstuctHandlerAvailabilityModulesL" ) + + CMusAvaInviteHandler* inviteHandler = CMusAvaInviteHandler::NewLC( + *this, *iSettings ) ; + iAvailabilities.AppendL( inviteHandler ); + CleanupStack::Pop( inviteHandler ); + + CMusAvaDefaultOptionHandler* defaultOptionHandler = + CMusAvaDefaultOptionHandler::NewLC( *this, *iSettings ); + iAvailabilities.AppendL( defaultOptionHandler ); + CleanupStack::Pop( defaultOptionHandler ); + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaDefaultImp::\ + ConstuctHandlerAvailabilityModulesL" ) + } + +// ----------------------------------------------------------------------------- +// Creates concrete standard availability objects +// ----------------------------------------------------------------------------- +// +void CMusAvaDefaultImp::ConstructStaticAvailabilityModulesL() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaDefaultImp::\ + ConstructStaticAvailabilityModulesL" ) + + /* Mus Activation Settings */ + CMusAvaSettingAvailability* settingAvailability = + CMusAvaSettingAvailability::NewLC( *this ); + iAvailabilities.AppendL( settingAvailability ); + CleanupStack::Pop( settingAvailability ); + + /* Existence of Sip profile */ + CMusAvaSipprofileAvailability* sipprofileExist = + CMusAvaSipprofileAvailability::NewLC( *this ) ; + iAvailabilities.AppendL( sipprofileExist ); + CleanupStack::Pop( sipprofileExist ); + MUS_LOG( "mus: [MUSAVA] <- CMusAvaDefaultImp:: \ + ConstructStaticAvailabilityModulesL" ) + } + +// ----------------------------------------------------------------------------- +// Creates concrete standard availability objects +// ----------------------------------------------------------------------------- +// +void CMusAvaDefaultImp::ConstructDynamicAvailabilityModulesL() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaDefaultImp::\ + ConstructDynamicAvailabilityModulesL" ) + // Create network availability + CMusAvaNetworkAvailability* networkAvailability = + CMusAvaNetworkAvailability::NewLC( *this, *iSettings ) ; + iAvailabilities.AppendL( networkAvailability ); + CleanupStack::Pop( networkAvailability ); + + // Contact availability + CMusAvaContactAvailability* contactAvailability = + CMusAvaContactAvailability::NewLC( *this, *iSettings ); + iAvailabilities.AppendL( contactAvailability ); + CleanupStack::Pop( contactAvailability ); + + //Connection monitor + CMusAvaConnectionAvailability* connectionAvailability = + CMusAvaConnectionAvailability::NewLC( *this, *iSettings ); + iAvailabilities.AppendL( connectionAvailability ); + CleanupStack::Pop( connectionAvailability ); + + // Create register availability + CMusAvaRegisterAvailability* registerAvailability = + CMusAvaRegisterAvailability::NewLC( *this, *iSettings ); + iAvailabilities.AppendL( registerAvailability ); + CleanupStack::Pop( registerAvailability ); + + // Extension availabilities -> + + // Create SIP options availability + CMusAvaOptionHandler* optionHandler = + CMusAvaOptionHandler::NewLC( *this, *iSettings ); + iAvailabilities.AppendL( optionHandler ); + CleanupStack::Pop( optionHandler ); + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaDefaultImp::ConstructDynamicAvailabilityModulesL" ) + } + +// ----------------------------------------------------------------------------- +// Create work for executing availability report. +// ----------------------------------------------------------------------------- +// +void CMusAvaDefaultImp::ExecuteAvailablitityModules() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaDefaultImp::\ + ExecuteAvailablitityModules" ) + iExecuteStarted = ETrue; + TBool goOn = ETrue; + for ( TInt i = 0; i < iAvailabilities.Count() && goOn; i++ ) + { + if ( !iAvailabilities[i]->Available() && + !iAvailabilities[i]->Executing()) + { + iAvailabilities[i]->Execute(); + if ( iAvailabilities[i]->State() < MMusAvaObserver::EMusAvaStatusInProgress ) + { + goOn = EFalse; + } + } + } + iExecuteStarted = EFalse; + MUS_LOG( "mus: [MUSAVA] <- CMusAvaDefaultImp::\ + ExecuteAvailablitityModules" ) + } + + +// ----------------------------------------------------------------------------- +// Retuns setting interface for the client. +// ----------------------------------------------------------------------------- +// +MMusAvaSettings& CMusAvaDefaultImp::Settings() + { + return *iSettings; + } + + +// ----------------------------------------------------------------------------- +// Set Observer interface for the client. +// ----------------------------------------------------------------------------- +// +void CMusAvaDefaultImp::SetObserver( MMusAvaObserver& aObserver ) + { + iObserver = &aObserver; + } + +// ----------------------------------------------------------------------------- +// Set MMusAvaSettingsObserver interface for the client. +// ----------------------------------------------------------------------------- +// +void CMusAvaDefaultImp::SetSettingsObserver( MMusAvaSettingsObserver& aObserver ) + { + iSettings->SetObserver( aObserver ); + } +// ----------------------------------------------------------------------------- +// Requests the implementation to start to investigate availabilites. +// ----------------------------------------------------------------------------- +// +void CMusAvaDefaultImp::StartL() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaDefaultImp::StartL" ) + ExecuteAvailablitityModules(); + MUS_LOG( "mus: [MUSAVA] <- CMusAvaDefaultImp::StartL" ) + } + + +// ----------------------------------------------------------------------------- +// Requests the implementation to stop investigating or monitoring availabilites +// for the client. +// ----------------------------------------------------------------------------- +// +void CMusAvaDefaultImp::Stop() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaDefaultImp::Stop" ) + iStopping = ETrue; + for ( TInt i = iAvailabilities.Count() - 1; i >= 0; i-- ) + { + if ( iAvailabilities[i]->State() > MMusAvaObserver::EMusAvaStatusNotExecuted ) + { + iAvailabilities[i]->Stop(); + } + } + CalculateAvailability(); + iStopping = EFalse; + if ( iObserver ) + { + iObserver->AvailabilityChanged( + CurrentAvailability(), + AvailabilityStatus() ); + } + MUS_LOG( "mus: [MUSAVA] <- CMusAvaDefaultImp::Stop" ) + } + + +// ----------------------------------------------------------------------------- +// Availability report. +// ----------------------------------------------------------------------------- +// +void CMusAvaDefaultImp::AvailabilityChanged( + MMusAvaObserver::TAvailabilityName aName, + MMusAvaObserver::TAvailabilityStatus aStatus ) + { + MUS_LOG2( "mus: [MUSAVA] -> CMusAvaDefaultImp::AvailabilityChanged(%d,%d)", + aName, aStatus ) + + CalculateAvailability(); + if ( iObserver ) + { + iObserver->AvailabilityChanged( aName, aStatus ); + } + + if ( !iStopping && aStatus >= MMusAvaObserver::EMusAvaStatusNotExecuted ) + { + if ( !iExecuteStarted ) + { + ExecuteAvailablitityModules(); + } + } + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaDefaultImp::AvailabilityChanged()" ) + } + + +// ----------------------------------------------------------------------------- +// Availability error. +// ----------------------------------------------------------------------------- +// +void CMusAvaDefaultImp::AvailabilityError( + MMusAvaObserver::TAvailabilityName aName, + MMusAvaObserver::TAvailabilityStatus aStatus ) + { + MUS_LOG2( "mus: [MUSAVA] -> CMusAvaDefaultImp::AvailabilityError\ + ( %d, %d)", aName, aStatus ) + + CalculateAvailability(); + if ( iObserver ) + { + iObserver->AvailabilityError( aName, aStatus ); + } + MUS_LOG( "mus: [MUSAVA] <- CMusAvaDefaultImp::AvailabilityError()" ) + } + +// ----------------------------------------------------------------------------- +// Checks if the current availability is at least the same as given as +// parameter +// ----------------------------------------------------------------------------- +// +TBool CMusAvaDefaultImp::Available( + MMusAvaObserver::TAvailabilityName aAvailability ) + { + return iCurrentAvailability > aAvailability + || ( iCurrentAvailability == aAvailability + && MMusAvaObserver::EMusAvaStatusAvailable == iAvailabilityStatus ) + || ( iCurrentAvailability == aAvailability + && ( MMusAvaObserver::EMusAvaStatusOptionsNotSent == iAvailabilityStatus + || MMusAvaObserver::EMusAvaStatusOptionsSent == iAvailabilityStatus) ); + } + +// ----------------------------------------------------------------------------- +// Calculates current availability +// ----------------------------------------------------------------------------- +MMusAvaObserver::TAvailabilityStatus CMusAvaDefaultImp::AvailabilityPluginState() + { + return iAvailabilityStatus; + } +// ----------------------------------------------------------------------------- +// Calculates current availability +// ----------------------------------------------------------------------------- +// +void CMusAvaDefaultImp::CalculateAvailability() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaDefaultImp::CalculateAvailability()" ) + iCurrentAvailability = MMusAvaObserver::EMusAvaFullAvailability; + iAvailabilityStatus = MMusAvaObserver::EMusAvaStatusAvailable; + TBool goOn = ETrue; + for ( TInt i = 0; i < iAvailabilities.Count() && goOn; i++ ) + { + if ( !iAvailabilities[i]->Available() ) + { + iCurrentAvailability = iAvailabilities[i]->Name(); + iAvailabilityStatus = iAvailabilities[i]->State(); + goOn = EFalse; + } + } + MUS_LOG2( "mus: [MUSAVA] Avaialability name and status (%d,%d)", + iCurrentAvailability, iAvailabilityStatus ) + MUS_LOG( "mus: [MUSAVA] <- CMusAvaDefaultImp::CalculateAvailability()" ) + } + +// ----------------------------------------------------------------------------- +// Current availability +// ----------------------------------------------------------------------------- +// +MMusAvaObserver::TAvailabilityName CMusAvaDefaultImp::CurrentAvailability() + { + return iCurrentAvailability; + } + + +// ----------------------------------------------------------------------------- +// Current availability status +// ----------------------------------------------------------------------------- +// +MMusAvaObserver::TAvailabilityStatus CMusAvaDefaultImp::AvailabilityStatus() + { + return iAvailabilityStatus; + } + + +// ----------------------------------------------------------------------------- +// Checks if current availability is at least minimum availability +// ----------------------------------------------------------------------------- +// +TBool CMusAvaDefaultImp::MinimumAvailability() + { + return iCurrentAvailability > KMinimumAvailability; + } + + +// ----------------------------------------------------------------------------- +// Checks if current availability is at least mandatory availability +// ----------------------------------------------------------------------------- +// +TBool CMusAvaDefaultImp::MandatoryAvailability() + { + return iCurrentAvailability > KMandatoryAvailability; + } + + +// ----------------------------------------------------------------------------- +// Checks if current availability is extension availability +// ----------------------------------------------------------------------------- +// +TBool CMusAvaDefaultImp::ExtensionAvailability() + { + return iCurrentAvailability > KExtensionAvailability; + } + +// ----------------------------------------------------------------------------- +// Returns the sate of the given availability +// ----------------------------------------------------------------------------- +// +MMusAvaObserver::TAvailabilityStatus CMusAvaDefaultImp::AvailabilityState( + MMusAvaObserver::TAvailabilityName aAvailability ) + { + MUS_LOG1( "mus: [MUSAVA] -> CMusAvaDefaultImp::AvailabilityState(%d)", + aAvailability ) + MMusAvaObserver::TAvailabilityStatus retval = + MMusAvaObserver::EMusAvaStatusNotExecuted; + MMusAvaObserver::TAvailabilityStatus state = + MMusAvaObserver::EMusAvaStatusAvailable; + + for ( TInt i = 0; i < iAvailabilities.Count() + && state > MMusAvaObserver::EMusAvaStatusNotExecuted; i++ ) + { + state = iAvailabilities[i]->State(); + + if ( iAvailabilities[i]->Name() == aAvailability ) + { + retval = iAvailabilities[i]->State(); + } + } + MUS_LOG1( "mus: [MUSAVA] <- CMusAvaDefaultImp::AvailabilityState(%d)", + retval ) + return retval; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusAvaDefaultImp::PrepareForReceivedInviteL() + { + for ( TInt i = 0; i < iAvailabilities.Count(); i++ ) + { + iAvailabilities[i]->PrepareForReceivedInviteL(); + } + } + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/src/musavadefaultoptionhandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/src/musavadefaultoptionhandler.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,648 @@ +/* +* Copyright (c) 2005-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: Provide interface for the client requestin availability class. +* +*/ + + +#include "musavadefaultoptionhandler.h" +#include "musavasharedobject.h" +#include "muslogger.h" +#include "musavasip.h" +#include "musavasettingsimp.h" +#include "sipservertransaction.h" +#include "mussettings.h" +#include "musavacapability.h" +#include "musavacapabilitycontext.h" +#include "musavanetworkmodestatus.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +const TInt KMaxNumAsStringSize = 16; +_LIT8( KMUSAVAOriginFieldUser, "-"); + + +// -------------------------------------------------------------------------- +// Symbian two-phase constructor +// -------------------------------------------------------------------------- +// +CMusAvaDefaultOptionHandler* CMusAvaDefaultOptionHandler::NewL( + MMusAvaAvailabilityObserver& aObserver, + CMusAvaSettingsImp& aConcreteSettings ) + { + MUS_LOG( "mus: [MUSAVA] <- CMusAvaDefaultOptionHandler::NewL()" ) + CMusAvaDefaultOptionHandler* self = CMusAvaDefaultOptionHandler::NewLC( + aObserver, + aConcreteSettings ); + CleanupStack::Pop( self ); + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaDefaultOptionHandler::NewL()" ) + return self; + } + + +// ------------------------------------------------------------------------- +// Two-phased constructor. +// ------------------------------------------------------------------------- +// +CMusAvaDefaultOptionHandler* CMusAvaDefaultOptionHandler::NewLC( + MMusAvaAvailabilityObserver& aObserver, + CMusAvaSettingsImp& aConcreteSettings ) + { + MUS_LOG( "mus: [MUSAVA] <- CMusAvaDefaultOptionHandler::NewLC()" ) + CMusAvaDefaultOptionHandler* self = new( ELeave ) + CMusAvaDefaultOptionHandler( aObserver, aConcreteSettings ); + CleanupStack::PushL( self ); + self->ConstructL(); + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaDefaultOptionHandler::NewLC()" ) + return self; + } + + +// ------------------------------------------------------------------------- +// Constructor. +// ------------------------------------------------------------------------- +// +CMusAvaDefaultOptionHandler::CMusAvaDefaultOptionHandler( + MMusAvaAvailabilityObserver& aObserver, + CMusAvaSettingsImp& aConcreteSettings ) + :CMusAvaAvailability( aObserver ), + iSettings( aConcreteSettings ) + { + } + + +// --------------------------------------------------------------------------- +// Symbian 2nd phase constructor can leave. +// --------------------------------------------------------------------------- +// +void CMusAvaDefaultOptionHandler::ConstructL() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaDefaultOptionHandler::ConstructL()" ) + iSharedObj = CMusAvaSharedObject::GetSingletonL(); + iSharedObj->MusAvaSip().AddAdapterL( + ( MMusAvaSipConnectionAdapter& ) *this ); + iSharedObj->MusAvaSip().AddAdapterL( ( MMusAvaSipAdapter& ) *this ); + SIPStrings::OpenL(); + SdpCodecStringPool::OpenL(); + iOperatorVariant = MultimediaSharingSettings::OperatorVariantSettingL(); + // set this only for static availability modules + iState = MMusAvaObserver::EMusAvaStatusAvailable ; + MUS_LOG( "mus: [MUSAVA] <- CMusAvaDefaultOptionHandler::ConstructL()" ) + } + + +// --------------------------------------------------------------------------- +// Destructor. +// --------------------------------------------------------------------------- +// +CMusAvaDefaultOptionHandler::~CMusAvaDefaultOptionHandler() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaDefaultOptionHandler::\ + ~CMusAvaDefaultOptionHandler()" ) + + if ( iSharedObj ) + { + iSharedObj->DeleteSingleton(); + } + SIPStrings::Close(); + SdpCodecStringPool::Close(); + MUS_LOG( "mus: [MUSAVA] <- CMusAvaDefaultOptionHandler::\ + ~CMusAvaDefaultOptionHandler()" ) + } + + +// --------------------------------------------------------------------------- +// A SIP request outside a dialog has been received from the network. +// --------------------------------------------------------------------------- +// +TInt CMusAvaDefaultOptionHandler::IncomingRequest( + CSIPServerTransaction* aTransaction ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaDefaultOptionHandler::\ + IncomingRequest()" ) + TInt err = KErrNotFound; + if( aTransaction->Type() == SIPStrings::StringF( SipStrConsts::EOptions ) + //&& !Available( MMusAvaObserver::EMusAvaOptionHandler ) + ) + { + TRAP( err, IncomingOptionRequestL( aTransaction ) ) + if( !err ) + { + delete aTransaction; + } + } + else + { + MUS_LOG( "mus: [MUSAVA] Not OPTIONS request or not handled in defaultOptionHandler" ) + } + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaDefaultOptionHandler::\ + IncomingRequest()" ) + return err; + } + + + + +// --------------------------------------------------------------------------- +// Starts the loopy execution. +// --------------------------------------------------------------------------- +// +void CMusAvaDefaultOptionHandler::DoExecuteL() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaDefaultOptionHandler::\ + ExecutePatternL()" ) + // set status available + SetState( MMusAvaObserver::EMusAvaStatusAvailable ); + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaDefaultOptionHandler::\ + ExecutePatternL()" ) + } + + +// --------------------------------------------------------------------------- +// CMusAvaDefaultOptionHandler::Name +// +// --------------------------------------------------------------------------- +// +MMusAvaObserver::TAvailabilityName CMusAvaDefaultOptionHandler::Name() + { + MUS_LOG( "mus: [MUSAVA] CMusAvaDefaultOptionHandler::Name()" ) + return MMusAvaObserver::EMusAvaDefaultOptionHandler; + } + + +// --------------------------------------------------------------------------- +// CMusAvaDefaultOptionHandler::IncomingRequest +// +// --------------------------------------------------------------------------- +// +TInt CMusAvaDefaultOptionHandler::IncomingRequest( + TUint32 aIapId, + CSIPServerTransaction* aTransaction ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaDefaultOptionHandler::\ + IncomingRequest()" ) + MUS_LOG1( "mus: [MUSAVA] Iap ( %d )", aIapId ) + TInt err = KErrNotFound; + CSIPConnection* connection = NULL; + if( aTransaction->Type() == SIPStrings::StringF( SipStrConsts::EOptions ) + && !Available( MMusAvaObserver::EMusAvaOptionHandler ) ) + { + MUS_LOG( "mus: [MUSAVA] create CSIPConnection" ) + TRAP( err, connection = CSIPConnection::NewL( + iSharedObj->MusAvaSip().Sip(), + aIapId, + iSharedObj->MusAvaSip().ConnectionObserver() ) ); + + if( err != KErrNone ) + { + MUS_LOG1( "mus: [MUSAVA] CSIPConnection error ( %d )", err ) + } + else + { + MUS_LOG( "mus: [MUSAVA] create CSIPConnection" ) + TRAP_IGNORE( IncomingOptionRequestL ( aTransaction ) ) + delete connection; + delete aTransaction; + } + } + else + { + MUS_LOG( "mus: [MUSAVA] Not OPTIONS request or not handled in defaultOptionHandler" ) + } + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaDefaultOptionHandler::\ + IncomingRequest()" ) + return err; + } + + +// --------------------------------------------------------------------------- +// CMusAvaDefaultOptionHandler::TimedOut +// +// --------------------------------------------------------------------------- +// +TInt CMusAvaDefaultOptionHandler::TimedOut(CSIPServerTransaction& + /*aTransaction*/ ) + { + MUS_LOG( "mus: [MUSAVA] CMusAvaDefaultOptionHandler::ConstructL()" ) + return KErrNotSupported; + } + + +// ------------------------------------------------------------------------- +// CMusAvaDefaultOptionHandler::IncomingOptionRequestL +// +// ------------------------------------------------------------------------- +// +void CMusAvaDefaultOptionHandler::IncomingOptionRequestL( + CSIPServerTransaction* aTransaction ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaDefaultOptionHandler::\ + IncomingOptionRequestL()" ) + + MusSettingsKeys::TActivation activation = + MultimediaSharingSettings::ActivationSettingL(); + + if ( activation == MusSettingsKeys::ENever ) + { + MUS_LOG( "mus: [MUSAVA] Sending 603 Decline" ) + NoCapabilityResponseL( aTransaction, + KMUSAVASIPDecline, + SipStrConsts::EPhraseDecline ); + } + else + { + MUS_LOG( "mus: [MUSAVA] Sending 480 Temporarily Unavilable" ) + NoCapabilityResponseL( aTransaction, + KMUSAVASIPTemporarilyUnavailable, + SipStrConsts::EPhraseTemporarilyNotAvailable ); + } + + MUS_LOG( "mus: [MUSAVA] <- \ + CMusAvaDefaultOptionHandler::IncomingOptionRequest()" ) + } + +// ------------------------------------------------------------------------ +// Send Response to reques. +// +// ------------------------------------------------------------------------ +void CMusAvaDefaultOptionHandler::ResponseL( + CSIPResponseElements* aResponseElements, + CSIPServerTransaction* aTransaction ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaDefaultOptionHandler::ResponseL" ) + + if ( ( aTransaction->StateL() == CSIPTransactionBase::ETrying || + aTransaction->StateL() == CSIPTransactionBase::EProceeding ) && + aTransaction->ResponseAllowed() ) + { + aTransaction->SendResponseL( aResponseElements ); + MUS_LOG( " Send response" ) + MUS_LOG( "mus: [MUSAVA] <- CMusAvaDefaultOptionHandler::ResponseL" ) + } + else + { + MUS_LOG( "mus: [MUSAVA] Not allow to sent response " ) + MUS_LOG( "mus: [MUSAVA] <- CMusAvaDefaultOptionHandler::ResponseL" ) + User::Leave( KErrNotReady ); + } + } + + +// ------------------------------------------------------------------------ +// Send response to request. +// +// ------------------------------------------------------------------------ +void CMusAvaDefaultOptionHandler::NoCapabilityResponseL( + CSIPServerTransaction* aTransaction, + TUint aStatusCode, + SipStrConsts::TStrings aReason ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaDefaultOptionHandler::SendResponseL()" ) + MUS_LOG( "mus: [MUSAVA] Create response elements " ) + CSIPResponseElements* respElem = NULL; + + if( iOperatorVariant == MusSettingsKeys::EOperatorSpecific ) + { + MUS_LOG( "mus: [MUSAVA] Operator Specific response" ) + respElem = CreateResponseL( *aTransaction ); + CleanupStack::PushL( respElem ); + } + else + { + MUS_LOG( "mus: [MUSAVA] Standard response" ) + RStringF reasonPhrase = + SIPStrings::StringF( aReason ); + respElem = + CSIPResponseElements::NewLC( aStatusCode, reasonPhrase ); + } + + ResponseL( respElem, aTransaction ); + MUS_LOG( "mus: [MUSAVA] Response sent " ) + CleanupStack::Pop( respElem ); + MUS_LOG( "mus: [MUSAVA] <- CMusAvaDefaultOptionHandler::SendResponseL()" ) + } + + +// ------------------------------------------------------------------------ +// CMusAvaDefaultOptionHandler::CreateResponseL +// +// ---------------------------------------------------------------------------- +// +CSIPResponseElements* CMusAvaDefaultOptionHandler::CreateResponseL( + CSIPServerTransaction& aTransaction ) + { + HBufC8* sdpBody = NULL; + CSIPResponseElements* respElem = + CSIPResponseElements::NewLC( KMUSAVASIP200, + SIPStrings::StringF(SipStrConsts::EPhraseOk) ); + + RPointerArray responseHeaders; + CSIPHeaderBase::PushLC( &responseHeaders ); + + const CUri8& uri = aTransaction.RequestElements()->RemoteUri(); + CSIPContactHeader* contact = MusAvaCapabilityContext::ContactHeaderLC( + uri, SIPStrings::StringF( SipStrConsts::EEmpty ) ); + responseHeaders.AppendL( contact ); + CleanupStack::Pop( contact ); + + CSIPMessageElements& messageElements = respElem->MessageElements(); + messageElements.SetUserHeadersL( responseHeaders ); + CleanupStack::Pop( &responseHeaders ); + + CSIPContentTypeHeader* contenType = + CSIPContentTypeHeader::NewLC( SIPStrings::StringF( + SipStrConsts::EApplication).DesC(), + KMUSAVASIPMediaSubTypeSDP ); + + // Set content + CSdpDocument* sdpDocument = CreateSDPL( aTransaction ); + CleanupStack::PushL( sdpDocument ); + sdpBody = ToTextL( *sdpDocument ); + CleanupStack::PopAndDestroy( sdpDocument ); + CleanupStack::PushL( sdpBody ); + messageElements.SetContentL( sdpBody, contenType ); + CleanupStack::Pop( sdpBody ); + CleanupStack::Pop( contenType ); + CleanupStack::Pop( respElem ); + return respElem; + } + + +// ------------------------------------------------------------------------ +// Create SDP response. +// +// ------------------------------------------------------------------------ +CSdpDocument* CMusAvaDefaultOptionHandler::CreateSDPL( + CSIPServerTransaction& aTransaction ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaDefaultOptionHandler::CreateSDPL" ) + // Origin field + TPtrC8 localHost; + RStringF hostType; + RStringF netType = SDPStringL( SdpCodecStringConstants::ENetType ); + CSdpDocument* sdpDocument = CSdpDocument::NewLC(); + LocalHostL( aTransaction,localHost,hostType); + CSdpOriginField* originField = CreateOriginFieldL(localHost,hostType); + sdpDocument->SetOriginField(originField); + // Connection field + CSdpConnectionField* connectionField = + CSdpConnectionField::NewL( netType, hostType, localHost ); + sdpDocument->SetConnectionField( connectionField ); + + MUS_LOG( "mus: [MUSAVA] Adding application attribute to SDP" ) + //application + CSdpAttributeField* application = + CSdpAttributeField::NewLC( + SDPStringL( SdpCodecStringConstants::EMediaApplication ), + KCapabilitySwisApplication ); + + sdpDocument->AttributeFields().AppendL( application ); + CleanupStack::Pop( application ); + + MUS_LOG( "mus: [MUSAVA] Adding type attribute to SDP" ) + //type + RStringF typeStr = SDPStringL( KCapabilitySDPAttributeNameType ); + CleanupClosePushL( typeStr ); + CSdpAttributeField* type = + CSdpAttributeField::NewL( typeStr, KCapabilitySDPAttributeType ); + CleanupStack::PopAndDestroy();//typeStr + CleanupStack::PushL( type ); + + sdpDocument->AttributeFields().AppendL( type ); + CleanupStack::Pop( type ); + + // Fast startup mode + CMusAvaCapability::AddFastModeL( *sdpDocument ); + + MUS_LOG( "mus: [MUSAVA] Adding media line to SDP" ) + //media line + CSdpMediaField* mediaLine = + MediaLineLC( SDPStringL( SdpCodecStringConstants::EMediaVideo ), + KCapabilitySwisFormatList ); + + //rtpmap + MUS_LOG( "mus: [MUSAVA] Adding rtpmap to SDP" ) + //adding H.264 codec to SDP + CSdpFmtAttributeField* rtpMapH264 = + RtpMapLineLC( KCapabilitySDPAttributeCodecH264, + KCapabilitySDPAttributePayloadTypeH264, + KCapabilitySDPAttributeClockrate ); + + mediaLine->FormatAttributeFields().AppendL( rtpMapH264 ); + CleanupStack::Pop( rtpMapH264 ); + + //H.263 codec + CSdpFmtAttributeField* rtpMapH263 = RtpMapLineLC( + KCapabilitySDPAttributeCodecH263, + KCapabilitySDPAttributePayloadType, + KCapabilitySDPAttributeClockrate ); + + mediaLine->FormatAttributeFields().AppendL( rtpMapH263 ); + CleanupStack::Pop( rtpMapH263 ); + + sdpDocument->MediaFields().AppendL( mediaLine ); + CleanupStack::Pop( mediaLine ); + CleanupStack::Pop( sdpDocument ); + MUS_LOG( "mus: [MUSAVA] <- CMusAvaDefaultOptionHandler::CreateSDPL" ) + return sdpDocument; + } + + +// ---------------------------------------------------------------------------- +// CMusAvaDefaultOptionHandler::CreateOriginFieldL +// +// ---------------------------------------------------------------------------- +// +CSdpOriginField* CMusAvaDefaultOptionHandler::CreateOriginFieldL( + const TDesC8& aLocalHost, + const RStringF& aHostType) const + { + #ifdef UNIT_TESTING + TInt64 sessionID = 452027953; +#else + TTime now; + now.UniversalTime(); + TInt64 rand = now.Int64(); + TInt64 sessionID = Math::Rand( rand ); +#endif + + return CSdpOriginField::NewL( + KMUSAVAOriginFieldUser, + sessionID, + sessionID, + SDPStringL( SdpCodecStringConstants::ENetType ), + aHostType, + aLocalHost); + } + + +// ---------------------------------------------------------------------------- +// CMusAvaDefaultOptionHandler::LocalHostL +// +// ---------------------------------------------------------------------------- +// +void CMusAvaDefaultOptionHandler::LocalHostL( + const CSIPServerTransaction& aRequest, + TPtrC8& aLocalHost, + RStringF& aHostType ) + { + RStringPool strPool = SdpCodecStringPool::StringPoolL(); + + const CUri8& uri = aRequest.RequestElements()->RemoteUri(); + + aLocalHost.Set( uri.Uri().Extract( EUriHost ) ); + + if ( UriUtils::HostType( aLocalHost ) == UriUtils::EIPv6Host ) + { + aHostType = strPool.StringF( SdpCodecStringConstants::EAddressType, + SdpCodecStringPool::StringTableL() ); + } + else + { + aHostType = strPool.StringF( + SdpCodecStringConstants::EAddressTypeIP4, + SdpCodecStringPool::StringTableL() ); + } + } + + +// ---------------------------------------------------------------------------- +// CMusAvaDefaultOptionHandler::SDPStringL +// +// ---------------------------------------------------------------------------- +// +RStringF CMusAvaDefaultOptionHandler::SDPStringL( const TDesC8& aString ) + { + return SdpCodecStringPool::StringPoolL().OpenFStringL( aString ); + } + + +// ---------------------------------------------------------------------------- +// CMusAvaDefaultOptionHandler::SDPStringL +// +// ---------------------------------------------------------------------------- +// +RStringF CMusAvaDefaultOptionHandler::SDPStringL( TInt aStringIndex ) + { + return SdpCodecStringPool::StringPoolL(). + StringF( aStringIndex, SdpCodecStringPool::StringTableL() ); + } + + +// ----------------------------------------------------------------------------- +// CMusAvaDefaultOptionHandler::MediaLineLC +// +// ----------------------------------------------------------------------------- +// +CSdpMediaField* CMusAvaDefaultOptionHandler::MediaLineLC( + const RStringF& aMedia, + const TDesC8& aFormatList ) const + { + return CSdpMediaField::NewLC( aMedia, + NULL, + SDPStringL( + SdpCodecStringConstants::EProtocolRtpAvp ), + aFormatList ); + } + + +// ---------------------------------------------------------------------------- +// CMusAvaDefaultOptionHandler::RtpMapLineLC +// +// ---------------------------------------------------------------------------- +// +CSdpFmtAttributeField* CMusAvaDefaultOptionHandler::RtpMapLineLC( + const TDesC8& aCodec, + const TUint64 aPayloadType, + const TUint64 aClockRate, + const TDesC8& aParams ) const + { + HBufC8* clockrate = HBufC8::NewLC( KMaxNumAsStringSize ); + clockrate->Des().Num( aClockRate, EDecimal ); + HBufC8* payload = HBufC8::NewLC( KMaxNumAsStringSize ); + payload->Des().Num( aPayloadType, EDecimal ); + + + TSdpRtpmapValue rtpmapValue( aCodec, + *clockrate, + aParams ); + + + HBufC8* rtpmap = rtpmapValue.EncodeL(); + CleanupStack::PushL( rtpmap ); + + CSdpFmtAttributeField* rtpmapAttribute = + CSdpFmtAttributeField::NewL( SDPStringL( + SdpCodecStringConstants::EAttributeRtpmap ), + *payload, + *rtpmap ); + + CleanupStack::PopAndDestroy( rtpmap ); + CleanupStack::PopAndDestroy( payload ); + CleanupStack::PopAndDestroy( clockrate ); + + CleanupStack::PushL( rtpmapAttribute ); + + return rtpmapAttribute; + } + + +// -------------------------------------------------------------------------- +// CMusAvaDefaultOptionHandler::ToTextL +// +// -------------------------------------------------------------------------- +// +HBufC8* CMusAvaDefaultOptionHandler::ToTextL( CSdpDocument& aSdpContent ) + { + HBufC8* content = NULL; + + CBufFlat* encBuf = CBufFlat::NewL( KMUSAVAMaxLengthOfSDPMessage ); + CleanupStack::PushL( encBuf ); + RBufWriteStream writeStream( *encBuf, 0 ); + writeStream.PushL(); + writeStream.Open( *encBuf, 0 ); + aSdpContent.EncodeL( writeStream ); + writeStream.Close(); + CleanupStack::PopAndDestroy();//writeStream + + content = encBuf->Ptr( 0 ).AllocL(); + CleanupStack::PopAndDestroy( encBuf ); + + return content; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/src/musavainvitehandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/src/musavainvitehandler.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,257 @@ +/* +* Copyright (c) 2005-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: Provide interface for the client requestin availability class. +* +*/ + + + + +#include "musunittesting.h" +#include "musavainviteresponder.h" +#include "musavainvitehandler.h" +#include "musavasharedobject.h" +#include "muslogger.h" +#include "musavasip.h" +#include "musavasettingsimp.h" +#include "sipservertransaction.h" +#include +#include + + +CMusAvaInviteHandler* CMusAvaInviteHandler::NewL( + MMusAvaAvailabilityObserver& aObserver, + CMusAvaSettingsImp& aSettings ) + { + MUS_LOG( "mus: [MUSAVA] <- CMusAvaInviteHandler::NewL()" ) + CMusAvaInviteHandler* self = CMusAvaInviteHandler::NewLC( + aObserver, + aSettings ); + CleanupStack::Pop( self ); + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaInviteHandler::NewL()" ) + return self; + } + + +CMusAvaInviteHandler* CMusAvaInviteHandler::NewLC( + MMusAvaAvailabilityObserver& aObserver, + CMusAvaSettingsImp& aSettings ) + { + MUS_LOG( "mus: [MUSAVA] <- CMusAvaInviteHandler::NewLC()" ) + CMusAvaInviteHandler* self = new( ELeave ) CMusAvaInviteHandler( + aObserver, + aSettings ); + + CleanupStack::PushL( self ); + self->ConstructL(); + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaInviteHandler::NewLC()" ) + return self; + } + + +CMusAvaInviteHandler::~CMusAvaInviteHandler() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaInviteHandler::~CMusAvaInviteHandler()" ) + iResponders.ResetAndDestroy(); + if ( iSharedObj ) + { + iSharedObj->DeleteSingleton(); + } + MUS_LOG( "mus: [MUSAVA] <- CMusAvaInviteHandler::~CMusAvaInviteHandler()" ) + } + + +CMusAvaInviteHandler::CMusAvaInviteHandler( + MMusAvaAvailabilityObserver& aObserver, + CMusAvaSettingsImp& aSettings ) + :CMusAvaAvailability( aObserver ), + iSettings( aSettings ) + { + } + + +void CMusAvaInviteHandler::ConstructL() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaInviteHandler::ConstructL()" ) + iSharedObj = CMusAvaSharedObject::GetSingletonL(); + iSharedObj->MusAvaSip().AddAdapterL( ( MMusAvaSipConnectionAdapter& ) *this ); + iSharedObj->MusAvaSip().AddAdapterL( ( MMusAvaSipAdapter& ) *this ); + // set this only for static availability modules + iState = MMusAvaObserver::EMusAvaStatusAvailable ; + MUS_LOG( "mus: [MUSAVA] <- CMusAvaInviteHandler::ConstructL()" ) + } + + +// ------------------------------------------------------------------------- +// A SIP request outside a dialog has been received from the network. +// ------------------------------------------------------------------------- +// +TInt CMusAvaInviteHandler::IncomingRequest (CSIPServerTransaction* + aTransaction) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaInviteHandler::IncomingRequest (CSIPServerTransaction* aTransaction)" ) + if( aTransaction->Type() == SIPStrings::StringF( SipStrConsts::EInvite ) ) + { + TRAPD ( err, InvitationReceivedL( aTransaction ) ) + MUS_LOG( "mus: [MUSAVA] <- CMusAvaInviteHandler::IncomingRequest()" ) + if ( err != KErrNone ) + { + delete aTransaction; + } + return KErrNone; + } + else + { + MUS_LOG( "mus: [MUSAVA] <- CMusAvaInviteHandler::IncomingRequest(KErrNotFound)" ) + return KErrNotFound; + } + } + + +// ------------------------------------------------------------------------- +// Starts the loopy execution. +// ------------------------------------------------------------------------- +// +void CMusAvaInviteHandler::DoExecuteL() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaInviteHandler::ExecutePatternL()" ) + // set status available + SetState( MMusAvaObserver::EMusAvaStatusAvailable ); + MUS_LOG( "mus: [MUSAVA] <- CMusAvaInviteHandler::ExecutePatternL()" ) + } + + +// ------------------------------------------------------------------------- +// Stops the loop. +// ------------------------------------------------------------------------- +// +void CMusAvaInviteHandler::Stop() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaInviteHandler::StopPatternL()" ) + iResponders.ResetAndDestroy(); + MUS_LOG( "mus: [MUSAVA] <- CMusAvaInviteHandler::StopPatternL()" ) + } + + +// ------------------------------------------------------------------------- +// CMusAvaInviteHandler::Name +// ------------------------------------------------------------------------- +// +MMusAvaObserver::TAvailabilityName CMusAvaInviteHandler::Name() + { + return MMusAvaObserver::EMusAvaInviteHandler; + } + +// ------------------------------------------------------------------------- +// This function is called when a SIP invite is received. +// ------------------------------------------------------------------------- +// +void CMusAvaInviteHandler::InvitationReceivedL( + CSIPServerTransaction* aTransaction ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaInviteHandler::InvitationReceivedL()" ) + + // create a new responder instance + CMusAvaInviteResponder* responder = CMusAvaInviteResponder::NewLC( + aTransaction, *this ); + TRAPD( err, responder->AnswerL() ); + if( err != KErrNone ) + { + CleanupStack::PopAndDestroy( responder ); + MUS_LOG1( "mus: [MUSAVA] InvitationReceivedL( aTransaction )\ + err #%d", err ) + } + else + { + TRAP( err, iResponders.AppendL( responder ) ); + if ( err != KErrNone ) + { + CleanupStack::PopAndDestroy( responder ); + } + else + { + CleanupStack::Pop( responder ); + } + InvitationAnsweredLD(); + } + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaInviteHandler::InvitationReceivedL()" ) + } + + +// ------------------------------------------------------------------------- +// This function is called when SIP invite is properly responded. +// ------------------------------------------------------------------------- +// +void CMusAvaInviteHandler::InvitationAnsweredLD() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaInviteHandler::InvitationAnsweredLD()" ) + + // look for that responder instance from the array + if ( iResponders.Count() ) + { + for ( TInt i = 0; i < iResponders.Count(); i++ ) + { + CMusAvaInviteResponder* responder = ( iResponders )[ i ]; + if( responder->ResponseComplete() ) + { + MUS_LOG( "mus: [MUSAVA] Remove responder" ) + delete responder; + iResponders.Remove( i ); + } + } + } + + MUS_LOG( "mus: [MUSAVA] -> CMusAvaInviteHandler::InvitationAnsweredLD()" ) + } + + +// ------------------------------------------------------------------------- +// CMusAvaInviteHandler::ApplicationState +// ------------------------------------------------------------------------- +// +MMusAvaSettingsObserver::TApplicationState + CMusAvaInviteHandler::ApplicationState() + { + return iSettings.ApplicationState(); + } + + +// ------------------------------------------------------------------------- +// CMusAvaInviteHandler::IncomingRequest +// ------------------------------------------------------------------------- +// +TInt CMusAvaInviteHandler::IncomingRequest( + TUint32 /*aIapId*/, + CSIPServerTransaction* aTransaction ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaInviteHandler::IncomingRequest()" ) + TInt retval = IncomingRequest( aTransaction ); + MUS_LOG( "mus: [MUSAVA] <- CMusAvaInviteHandler::IncomingRequest()" ) + return retval; + } + + +// ------------------------------------------------------------------------- +// CMusAvaInviteHandler::TimedOut +// ------------------------------------------------------------------------- +// +TInt CMusAvaInviteHandler::TimedOut(CSIPServerTransaction& /*aTransaction*/ ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaInviteHandler::ConstructL()" ) + MUS_LOG( "mus: [MUSAVA] <- CMusAvaInviteHandler::ConstructL()" ) + return KErrNotSupported; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/src/musavainviteresponder.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/src/musavainviteresponder.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,201 @@ +/* +* 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: Provide interface for the client requestin availability class. +* +*/ + + + +#include "musavainviteresponder.h" +#include "musavainviteresponderobserver.h" +#include "muslogger.h" + +#include +#include +#include +#include +#include +#include +#include + +const TUint KMUSAVA486 = 486; // Busy +const TUint KMUSAVA603 = 603; // Decline/Reject + +_LIT8( KMusAvaStatusBusy, "Busy Here" ); +_LIT8( KMusAvaStatusDecline, "Decline" ); + + +// ------------------------------------------------------------------------- +// Two-phased constructor. +// ------------------------------------------------------------------------- +// +CMusAvaInviteResponder* CMusAvaInviteResponder::NewL( + CSIPServerTransaction* aTransaction, + MMusAvaInviteResponderObserver& aObserver ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaInviteResponder::NewL()" ) + + CMusAvaInviteResponder* self = CMusAvaInviteResponder::NewLC( + aTransaction, + aObserver ); + CleanupStack::Pop( self ); + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaInviteResponder::NewL()" ) + return self; + } + + +// ------------------------------------------------------------------------- +// Destructor. +// ------------------------------------------------------------------------- +// +CMusAvaInviteResponder::~CMusAvaInviteResponder() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaInviteResponder::~CMusAvaInviteResponder()" ) + delete iTransaction; + MUS_LOG( "mus: [MUSAVA] <- CMusAvaInviteResponder::~CMusAvaInviteResponder()" ) + } + +// ------------------------------------------------------------------------- +// Two-phased constructor. +// ------------------------------------------------------------------------- +// +CMusAvaInviteResponder* CMusAvaInviteResponder::NewLC( + CSIPServerTransaction* aTransaction, + MMusAvaInviteResponderObserver& aObserver ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaInviteResponder::NewLC()" ) + CMusAvaInviteResponder* self = new( ELeave ) CMusAvaInviteResponder( + aTransaction, + aObserver ); + CleanupStack::PushL( self ); + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaInviteResponder::NewLC()" ) + return self; + } + +// ------------------------------------------------------------------------- +// Constructor. +// ------------------------------------------------------------------------- +// +CMusAvaInviteResponder::CMusAvaInviteResponder( + CSIPServerTransaction* aTransAction, + MMusAvaInviteResponderObserver& aObserver ) + : iObserver( aObserver ), iTransaction( aTransAction ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaInviteResponder::CMusAvaInviteResponder()" ) + MUS_LOG( "mus: [MUSAVA] <- CMusAvaInviteResponder::CMusAvaInviteResponder()" ) + } + +// ------------------------------------------------------------------------- +// +// ------------------------------------------------------------------------- +// +void CMusAvaInviteResponder::AnswerL() + { + if( iObserver.ApplicationState() == + MMusAvaSettingsObserver::EApplicationIsRunning ) + { + SendResponseL( KMUSAVA486, KMusAvaStatusBusy ); + } + else + { + SendResponseL( KMUSAVA603, KMusAvaStatusDecline ); + } + } + +// ------------------------------------------------------------------------ +// Send response to request. +// ------------------------------------------------------------------------ +void CMusAvaInviteResponder::SendResponseL( TUint aStatusCode, + const TDesC8& aReasonPhrase ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaInviteResponder::SendResponseL()" ) + MUS_LOG1( "mus: [MUSAVA] aStatusCode == <%d>", aStatusCode ) + + RStringF responseString = SIPStrings::Pool().OpenFStringL( aReasonPhrase ); + CleanupClosePushL( responseString ); + CSIPResponseElements* respElem = + CSIPResponseElements::NewL( aStatusCode, responseString ); + CleanupStack::PopAndDestroy(); //responseString + CleanupStack::PushL( respElem ); + + ResponseL( respElem ); + CleanupStack::Pop( respElem ); + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaInviteResponder::SendResponseL()" ) + } + + +// ------------------------------------------------------------------------ +// Returns response status. +// ------------------------------------------------------------------------ +TBool CMusAvaInviteResponder::ResponseComplete() + { + + MUS_LOG( "mus: [MUSAVA] -> CMusAvaInviteResponder::ResponseComplete()" ) + TBool res = EFalse; + + CSIPTransactionBase::TState state = CSIPTransactionBase::ETerminated; + TRAPD( err, state = iTransaction->StateL() ); + + if( err != KErrNone ) + { + MUS_LOG1( "mus: [MUSAVA] serverTran.StateL, err #%d", err ) + return res; + } + + if ( state == CSIPTransactionBase::ECompleted || + state == CSIPTransactionBase::EConfirmed || + state == CSIPTransactionBase::ETerminated && + iTransaction->ResponseAllowed() ) + { + res = ETrue; + } + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaInviteResponder::ResponseComplete()" ) + return res; + } + +// ------------------------------------------------------------------------ +// Send Response to reques. +// ------------------------------------------------------------------------ +void CMusAvaInviteResponder::ResponseL( + CSIPResponseElements* aResponseElements ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaInviteResponder::ResponseL" ) + CSIPServerTransaction& serverTran = + static_cast( *iTransaction ); + + if ( iTransaction->IsSIPClientTransaction() ) + { + User::Leave( KErrNotReady ); + } + + else if ( ( serverTran.StateL() == CSIPTransactionBase::ETrying || + serverTran.StateL() == CSIPTransactionBase::EProceeding ) && + serverTran.ResponseAllowed() ) + { + MUS_LOG( " Send response" ) + serverTran.SendResponseL( aResponseElements ); + } + else + { + User::Leave( KErrNotReady ); + MUS_LOG( "mus: [MUSAVA] Not allow to sent response " ) + MUS_LOG( "mus: [MUSAVA] <- CMusAvaInviteResponder::ResponseL" ) + } + } + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/src/musavamain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/src/musavamain.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,33 @@ +/* +* 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: DLL entry point +* +*/ + + + +#include +#include + +//TODO Poista entry +// Remove the next function when build with Bullseye + +#ifndef EKA2 +GLDEF_C TInt E32Dll( TDllReason /*aReason*/ ) + { + return( KErrNone ); + } +#endif + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/src/musavanetworkavailability.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/src/musavanetworkavailability.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,244 @@ +/* +* Copyright (c) 2005-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: Provide interface for the client requestin availability class. +* +*/ + + + +#include "musavanetworkavailability.h" +#include "musavaavailabilityobserver.h" +#include "musavasettingsimp.h" +#include "musavanetworkavailability.h" +#include "mussesseioninformationapi.h" +#include "musavaobserver.h" +#include "musavasharedobject.h" +#include "muslogger.h" +#include "musavacalleventmonitor.h" + +#include + +const TInt KSipUriArrayGranularity = 1; + +CMusAvaNetworkAvailability* CMusAvaNetworkAvailability::NewL( + MMusAvaAvailabilityObserver& aObserver, + CMusAvaSettingsImp& aSettings ) + { + CMusAvaNetworkAvailability* self = + CMusAvaNetworkAvailability::NewLC( + aObserver, + aSettings ); + + CleanupStack::Pop( self ); + return self; + } + + +CMusAvaNetworkAvailability* CMusAvaNetworkAvailability::NewLC( + MMusAvaAvailabilityObserver& aObserver, + CMusAvaSettingsImp& aSettings ) + { + CMusAvaNetworkAvailability* self = + new( ELeave ) CMusAvaNetworkAvailability( + aObserver, + aSettings ); + + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +CMusAvaNetworkAvailability::~CMusAvaNetworkAvailability() + { + if ( iPhoneStatus ) + { + iPhoneStatus->Cancel(); + } + delete iPhoneStatus; + iPhoneStatus = NULL; + } + + +CMusAvaNetworkAvailability::CMusAvaNetworkAvailability( + MMusAvaAvailabilityObserver& aObserver, + CMusAvaSettingsImp& aSettings ) + :CMusAvaAvailability( aObserver ), + iSettings( aSettings ) + { + } + + +void CMusAvaNetworkAvailability::ConstructL() + { + iPhoneStatus = CMusAvaCallEventMonitor::NewL( *this ); + } + + +// ------------------------------------------------------------------------- +// Starts the loopy execution. +// ------------------------------------------------------------------------- +// +void CMusAvaNetworkAvailability::DoExecuteL() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaNetworkAvailability::\ + Execute()" ) + + // read the current value and subscribe for changes + // that's done in RunL + switch (iPhoneStatus->CallStatusL()) + { + case NMusSessionInformationApi::ECallConnected: + { + TBuf telNumber; + TBool isSipUri( EFalse ); + iPhoneStatus->GetTelNumberL( telNumber, isSipUri ); + SetRemoteHostL( telNumber, isSipUri ); + iSettings.SetCallDirection( iPhoneStatus->CallDirectionL() ); + SetState( MMusAvaObserver::EMusAvaStatusAvailable ); + break; + } + case NMusSessionInformationApi::ECallHold: + SetState( MMusAvaObserver::EMusAvaStatusCallOnHold ); + break; + case NMusSessionInformationApi::EConferenceCall: + SetState( MMusAvaObserver::EMusAvaStatusConferenceCall ); + break; + case NMusSessionInformationApi::ENoCall: + SetState( MMusAvaObserver::EMusAvaStatusNoCall ); + break; + default: + SetState( MMusAvaObserver::EMusAvaStatusNoCall ); + break; + } + + // subscribe for the future changes. + iPhoneStatus->StartMonitoringL(); + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaNetworkAvailability::\ + ExecutePatternL()" ) + } + + +void CMusAvaNetworkAvailability::Stop() + { + iPhoneStatus->Cancel(); + SetState( MMusAvaObserver::EMusAvaStatusNotExecuted ); + } + + +MMusAvaObserver::TAvailabilityName CMusAvaNetworkAvailability::Name() + { + return MMusAvaObserver::EMusAvaNameNetworkStatus; + } + +// ------------------------------------------------------------------------- +// This function is called when a cs call is connected. +// ------------------------------------------------------------------------- +// +void CMusAvaNetworkAvailability::CallConnectedL( const TDesC& aTelNumber, + TBool aIsSipUri) + { + MUS_LOG( "mus: [MUSAVA] \ + -> CMusAvaNetworkAvailability::CallConnectedL()" ) + // try to resolve to contact information of the remote host + SetRemoteHostL( aTelNumber, aIsSipUri ); + iSettings.SetCallDirection( iPhoneStatus->CallDirectionL() ); + SetState( MMusAvaObserver::EMusAvaStatusAvailable ); + + MUS_LOG( "mus: [MUSAVA] \ + <- CMusAvaNetworkAvailability::CallConnectedL()" ) + } + + +// ------------------------------------------------------------------------- +// This function is called when a cs call goes into a state +// that is not connected. +// ------------------------------------------------------------------------- +// +void CMusAvaNetworkAvailability::ConferenceCallL() + { + MUS_LOG( "mus: [MUSAVA] \ + -> CMusAvaNetworkAvailability::ConferenceCallL()" ) + //Report line status + SetState( MMusAvaObserver::EMusAvaStatusConferenceCall ); + MUS_LOG( "mus: [MUSAVA] \ + <- CMusAvaNetworkAvailability::ConferenceCallL()" ) + } + + +// ------------------------------------------------------------------------- +// This function is called when a cs call goes hold +// ------------------------------------------------------------------------- +// +void CMusAvaNetworkAvailability::CallHoldL( const TDesC& aTelNumber, + TBool aIsSipUri) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaNetworkAvailability::CallHoldL()" ) + //Report line status + SetRemoteHostL( aTelNumber, aIsSipUri ); + iSettings.SetCallDirection( iPhoneStatus->CallDirectionL() ); + SetState( MMusAvaObserver::EMusAvaStatusCallOnHold ); + MUS_LOG( "mus: [MUSAVA] <- CMusAvaNetworkAvailability::CallHoldL()" ) + } + + +// ------------------------------------------------------------------------- +// This function is called when a cs call goes into a state +// that is not connected. +// ------------------------------------------------------------------------- +// +void CMusAvaNetworkAvailability::NoActiveCallL() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaNetworkAvailability::NoActiveCallL()" ) + + iSettings.SetTelNumberL( KNullDesC() ); + CDesCArrayFlat* sipUris = + new ( ELeave ) CDesCArrayFlat( KSipUriArrayGranularity ); + CleanupStack::PushL( sipUris ); + iSettings.SetSipAddressesL( sipUris ); + CleanupStack::Pop( sipUris ); + + //Report line status + //Availability status + SetState( MMusAvaObserver::EMusAvaStatusNoCall ); + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaNetworkAvailability::NoActiveCallL()" ) + } + + +void CMusAvaNetworkAvailability::SetRemoteHostL( const TDesC& aTelNumber, + TBool aIsSipUri ) + { + MUS_LOG1( "mus: [MUSAVA] -> CMusAvaNetworkAvailability::SetRemoteHostL(%d)", + aIsSipUri ) + + if ( aIsSipUri ) + { + CDesCArrayFlat* sipUris = + new ( ELeave ) CDesCArrayFlat( KSipUriArrayGranularity ); + CleanupStack::PushL( sipUris ); + sipUris->AppendL( aTelNumber ); + iSettings.SetSipAddressesL( sipUris ); + CleanupStack::Pop( sipUris ); + + iSettings.SetUriForContactResolvingL( aTelNumber ); + } + else + { + iSettings.SetTelNumberL( aTelNumber ); + } + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaNetworkAvailability::SetRemoteHostL()" ) + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/src/musavanetworkmodestatus.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/src/musavanetworkmodestatus.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,158 @@ +/* +* Copyright (c) 2005-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: Provide interface for the client requestin availability class. +* +*/ + + + +#include "musavanetworkmodestatus.h" +#include "musavatelephonystatusobserver.h" +#include "musavaavailability.h" +#include "musunittesting.h" +#include "mussettingskeys.h" +#include "mussettings.h" +#include "muslogger.h" + +#include +#include + +// ------------------------------------------------------------------------- +// Two-phased constructor. +// ------------------------------------------------------------------------- +// +CMusAvaNetworkModeStatus* CMusAvaNetworkModeStatus::NewL() + { + CMusAvaNetworkModeStatus* self = + new( ELeave ) CMusAvaNetworkModeStatus(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + + +// ------------------------------------------------------------------------- +// Destructor. +// ------------------------------------------------------------------------- +// +CMusAvaNetworkModeStatus::~CMusAvaNetworkModeStatus() + { + Cancel(); + iObserver.Reset(); + iObserver.Close(); + iPhone.Close(); + iTelServer.UnloadPhoneModule( KMmTsyModuleName ); + iTelServer.Close(); + } + + +// ------------------------------------------------------------------------- +// Test Current Phone Network Mode +// ------------------------------------------------------------------------- +// +RMobilePhone::TMobilePhoneNetworkMode CMusAvaNetworkModeStatus::PhoneNetworkMode() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaNetworkModeStatus::PhoneNetworkMode()" ) + RMobilePhone::TMobilePhoneNetworkMode networkMode; + TInt retval = iPhone.GetCurrentMode( networkMode ); + MUS_LOG1( "mus: [MUSAVA] <- CMusAvaNetworkModeStatus::PhoneNetworkMode()=%d",networkMode ) + return networkMode; + } + + +// ------------------------------------------------------------------------- +// Reads the telephony status. +// ------------------------------------------------------------------------- +// +void CMusAvaNetworkModeStatus::TelephonyStatus() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaNetworkModeStatus::TelephonyStatus()" ) + MUS_LOG( "mus: [MUSAVA] NotifyModeChange" ) + iPhone.NotifyModeChange( iStatus, iNetworkMode ); + SetActive(); + MUS_LOG( "mus: [MUSAVA] -> CMusAvaNetworkModeStatus::TelephonyStatus()" ) + } + +// ------------------------------------------------------------------------- +// +// ------------------------------------------------------------------------- +// +void CMusAvaNetworkModeStatus::PhoneNetworkModeStatus( + RMobilePhone::TMobilePhoneNetworkMode aStatus ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaNetworkModeStatus::\ + PhoneNetworkModeStatus()" ) + MUS_LOG1( "TMobilePhoneNetworkMode = ", aStatus ) + + for( TInt i=0; iPhoneNetworkModeStatus( aStatus ); + } + MUS_LOG( "mus: [MUSAVA] <- CMusAvaNetworkModeStatus::\ + PhoneNetworkModeStatus()" ) + } + +// ------------------------------------------------------------------------- +// Reads the call status property value and subscribes again. +// ------------------------------------------------------------------------- +// +void CMusAvaNetworkModeStatus::RunL() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaNetworkModeStatus::RunL()" ) + if( iStatus == KErrNone ) + { + PhoneNetworkModeStatus( iNetworkMode ); + } + //Subscribes registration status again. + MUS_LOG( "mus: [MUSAVA] Subscribes registration status again" ) + TelephonyStatus(); + MUS_LOG( "mus: [MUSAVA] -> CMusAvaNetworkModeStatus::RunL()" ) + } + + +// ------------------------------------------------------------------------- +// Cancel pendig request +// ------------------------------------------------------------------------- +// +void CMusAvaNetworkModeStatus::DoCancel() + { + iPhone.CancelAsyncRequest( EMobilePhoneNotifyModeChange ); + } + + +// ------------------------------------------------------------------------- +// Constructor function. +// ------------------------------------------------------------------------- +// +CMusAvaNetworkModeStatus::CMusAvaNetworkModeStatus( ) + { + + } + +// ------------------------------------------------------------------------- +// Second phase constructor. +// ------------------------------------------------------------------------- +// +void CMusAvaNetworkModeStatus::ConstructL() + { + RTelServer::TPhoneInfo phoneInfo; + User::LeaveIfError( iTelServer.Connect() ); + User::LeaveIfError( iTelServer.LoadPhoneModule( KMmTsyModuleName ) ); + User::LeaveIfError( iTelServer.GetPhoneInfo( 0, phoneInfo ) ); + User::LeaveIfError( iPhone.Open( iTelServer, phoneInfo.iName ) ); + User::LeaveIfError( iPhone.Initialise() ); + TelephonyStatus(); + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/src/musavanetworkregistrationstatus.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/src/musavanetworkregistrationstatus.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,149 @@ +/* +* Copyright (c) 2005-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: Provide interface for the client requestin availability class. +* +*/ + + + +#include "musavanetworkregistrationstatus.h" +#include "musavatelephonystatusobserver.h" +#include "musavaavailability.h" +#include "musunittesting.h" +#include "muslogger.h" + +#include +#include + +// ------------------------------------------------------------------------- +// Two-phased constructor. +// ------------------------------------------------------------------------- +// +CMusAvaNetworkRegistrationStatus* CMusAvaNetworkRegistrationStatus::NewL() + { + CMusAvaNetworkRegistrationStatus* self = + new( ELeave ) CMusAvaNetworkRegistrationStatus(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + + +// ------------------------------------------------------------------------- +// Destructor. +// ------------------------------------------------------------------------- +// +CMusAvaNetworkRegistrationStatus::~CMusAvaNetworkRegistrationStatus() + { + iObserver.Reset(); + iObserver.Close(); + iPhone.Close(); + iTelServer.UnloadPhoneModule( KMmTsyModuleName ); + iTelServer.Close(); + } + + +// ------------------------------------------------------------------------- +// Test Current network registration status +// ------------------------------------------------------------------------- +// +void CMusAvaNetworkRegistrationStatus::NetworkRegistration( + RMobilePhone::TMobilePhoneRegistrationStatus& aStatus ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaNetworkRegistrationStatus::\ + NetworkRegistrationStatus()" ) + + TRequestStatus status; + iPhone.GetNetworkRegistrationStatus( status, aStatus ); + #ifndef UNIT_TESTING + User::WaitForRequest( status ); + #endif + MUS_LOG1( "mus: [MUSAVA] RMobilePhone::\ + GetNetworkRegistrationStatus %d", aStatus ) + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaNetworkRegistrationStatus::\ + NetworkRegistrationStatus()" ) + } + +// ------------------------------------------------------------------------- +// Reads the telephony status. +// ------------------------------------------------------------------------- +// +void CMusAvaNetworkRegistrationStatus::TelephonyStatus() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaNetworkRegistrationStatus::TelephonyStatus()" ) + MUS_LOG( "mus: [MUSAVA] NotifyNetworkRegistrationStatusChange" ) + iPhone.NotifyNetworkRegistrationStatusChange( iStatus, iRegistrationStatus ); + SetActive(); + MUS_LOG( "mus: [MUSAVA] -> CMusAvaNetworkRegistrationStatus::TelephonyStatus()" ) + } + +// ------------------------------------------------------------------------- +// +// ------------------------------------------------------------------------- +// +void CMusAvaNetworkRegistrationStatus::NetworkRegistrationStatus( + RMobilePhone::TMobilePhoneRegistrationStatus aRegStatus ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaNetworkRegistrationStatus::RegistrationStatus()" ) + MUS_LOG1( "TRegistrationStatus = ", aRegStatus ) + + for( TInt i=0; iNetworkRegistrationStatus( aRegStatus ); + } + MUS_LOG( "mus: [MUSAVA] <- CMusAvaNetworkRegistrationStatus::NetworkRegistrationStatus()" ) + } + +// ------------------------------------------------------------------------- +// Reads the call status property value and subscribes again. +// ------------------------------------------------------------------------- +// +void CMusAvaNetworkRegistrationStatus::RunL() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaNetworkRegistrationStatus::RunL()" ) + if( iStatus==KErrNone ) + { + NetworkRegistrationStatus( iRegistrationStatus ); + } + //Subscribes registration status again. + MUS_LOG( "mus: [MUSAVA] Subscribes registration status again" ) + TelephonyStatus(); + MUS_LOG( "mus: [MUSAVA] -> CMusAvaNetworkRegistrationStatus::RunL()" ) + } + +// ------------------------------------------------------------------------- +// Constructor function. +// ------------------------------------------------------------------------- +// +CMusAvaNetworkRegistrationStatus::CMusAvaNetworkRegistrationStatus( ) + { + + } + +// ------------------------------------------------------------------------- +// Second phase constructor. +// ------------------------------------------------------------------------- +// +void CMusAvaNetworkRegistrationStatus::ConstructL() + { + RTelServer::TPhoneInfo phoneInfo; + User::LeaveIfError( iTelServer.Connect() ); + User::LeaveIfError( iTelServer.LoadPhoneModule( KMmTsyModuleName ) ); + User::LeaveIfError( iTelServer.GetPhoneInfo( 0, phoneInfo ) ); + User::LeaveIfError( iPhone.Open( iTelServer, phoneInfo.iName ) ); + User::LeaveIfError( iPhone.Initialise() ); + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/src/musavaoptionhandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/src/musavaoptionhandler.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,784 @@ +/* +* Copyright (c) 2005-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: Provide interface for the client requestin availability class. +* +*/ + + +#include "musavaoptionhandler.h" + +#include +#include +#include "musunittesting.h" +#include "musavasharedobject.h" +#include "muslogger.h" +#include "musavasip.h" +#include "musavasettingsimp.h" +#include "musavacapabilitysipagent.h" +#include "musavacapabilityexchange.h" +#include "musavacapabilityquery.h" +#include "musavacapability.h" +#include "musavacapabilityquerybase.h" +#include "musavaterminal.h" +#include "mussettingskeys.h" +#include "mussettings.h" +#include "mussesseioninformationapi.h" + + +_LIT( KMusSipPrefix, "sip:" ); +_LIT( KMusTelPrefix, "tel:" ); +_LIT( KMusPlusSign, "+" ); + +const TInt KMaxUriLength = 512; +const TInt KMusMinDigitCountInTelNumber = 7; + +const TInt KMusOptionsHandlerIndex = 1; + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusAvaOptionHandler* CMusAvaOptionHandler::NewL( + MMusAvaAvailabilityObserver& aObserver, + CMusAvaSettingsImp& aSettings ) + { + MUS_LOG( "mus: [MUSAVA] <- CMusAvaOptionHandler::NewL()" ) + CMusAvaOptionHandler* self = CMusAvaOptionHandler::NewLC( + aObserver, + aSettings ); + CleanupStack::Pop( self ); + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaOptionHandler::NewL()" ) + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusAvaOptionHandler* CMusAvaOptionHandler::NewLC( + MMusAvaAvailabilityObserver& aObserver, + CMusAvaSettingsImp& aSettings ) + { + MUS_LOG( "mus: [MUSAVA] <- CMusAvaOptionHandler::NewLC()" ) + CMusAvaOptionHandler* self = new( ELeave ) CMusAvaOptionHandler( + aObserver, + aSettings ); + CleanupStack::PushL( self ); + self->ConstructL(); + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaOptionHandler::NewLC()" ) + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusAvaOptionHandler::~CMusAvaOptionHandler() + { + MUS_LOG( + "mus: [MUSAVA] -> CMusAvaOptionHandler::~CMusAvaOptionHandler()" ) + if (iSharedObj ) + { + iSharedObj->DeleteSingleton(); + } + delete iCapabilityExchange; + iCapabilityExchange = NULL; + delete iSipAgent; + iSipAgent = NULL; + + MUS_LOG( + "mus: [MUSAVA] <- CMusAvaOptionHandler::~CMusAvaOptionHandler()" ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusAvaOptionHandler::CMusAvaOptionHandler( + MMusAvaAvailabilityObserver& aObserver, + CMusAvaSettingsImp& aSettings ) + :CMusAvaAvailability( aObserver ), + iSettings( aSettings ) + { + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusAvaOptionHandler::ConstructL() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaOptionHandler::ConstructL()" ) + + //construct capability exchange + ConstructCapabilityExchangeL(); + + iSharedObj = CMusAvaSharedObject::GetSingletonL(); + iSipAgent = CMusAvaCapabilitySipAgent::NewL( *iCapabilityExchange, + *iSharedObj, + iObserver ); + iSharedObj->MusAvaSip().AddAdapterL( + ( MMusAvaSipConnectionAdapter& ) *iSipAgent, + KMusOptionsHandlerIndex ); + iSharedObj->MusAvaSip().AddAdapterL( + ( MMusAvaSipAdapter& ) *iSipAgent, + KMusOptionsHandlerIndex ); + + MUS_LOG( "mus: [MUSAVA] Check fast mode capability" ) + + TRAPD( err, + iFastModeCapable = + MultimediaSharingSettings::FastStartupModeL() == MusSettingsKeys::EFastModeOn && + MultimediaSharingSettings::VideoDirectionL() == MusSettingsKeys::ETwoWayVideo && + MultimediaSharingSettings::CapabilityQuerySettingL() == MusSettingsKeys::EParallel ); + if ( err == KErrNoMemory ) + { + User::Leave( err ); + } + + MUS_LOG2( "mus: [MUSAVA] Fast mode check, err:%d, capable:%d", + err, iFastModeCapable ) + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaOptionHandler::ConstructL()" ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMusAvaOptionHandler::CapabilityQueryAnswered( TBool aAnswered ) + { + MUS_LOG1( "mus: [MUSAVA] <-> CMusAvaOptionHandler::CapabilityQueryAnswered():%d", + aAnswered ) + + iCapabilityQueryAnswered = aAnswered ? aAnswered : iCapabilityQueryAnswered; + + HandleFastModeQueryAnswered(); + + return iCapabilityQueryAnswered; + + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusAvaOptionHandler::ConstructCapabilityExchangeL() + { + MUS_LOG( + "mus: [MUSAVA] -> CMusAvaOptionHandler::ConstructCapabilityExchangeL()" ) + HBufC8* terminalId = ConstructTerminalIdL(); + CleanupStack::PushL( terminalId ); + + //create capability exchange + iCapabilityExchange = + CMusAvaCapabilityExchange::NewL( *terminalId, *this ); + + //create SWIS capability + CMusAvaCapability* capability = CMusAvaCapability::NewL( + *iCapabilityExchange ); + CleanupStack::PushL( capability ); + iCapabilityExchange->AddCapabilityL( capability ); + CleanupStack::Pop( capability ); + + iSwisCapability = capability; + + CleanupStack::PopAndDestroy( terminalId ); + MUS_LOG( + "mus: [MUSAVA] <- CMusAvaOptionHandler::ConstructCapabilityExchangeL()" ) + } + + +// ----------------------------------------------------------------------------- +// @TODO: Currently terminal id is not in use i.e User-Agent header is not +// sent in request nor response. +// ----------------------------------------------------------------------------- +// +HBufC8* CMusAvaOptionHandler::ConstructTerminalIdL() + { + return KNullDesC8().AllocL(); + } + + +// ----------------------------------------------------------------------------- +// Starts the loopy execution. +// ----------------------------------------------------------------------------- +// +void CMusAvaOptionHandler::DoExecuteL() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaOptionHandler::DoExecuteL()" ) + + MusSettingsKeys::TOperatorVariant variantSetting = + MultimediaSharingSettings::OperatorVariantSettingL(); + + /* + Do not resent the OPTIONS request in the below scenario + i) Options Sent and waiting for Response. + ii) We already sent OPTIONS and got positive response.So we know that + other device is VS capable. + iii) We already sent OPTIONS and got negative response.So we know that + other device is VS incapable. + + Also OPTIONS should be sent only once if it matches to VS Call criteria. + */ + MUS_LOG1( "mus: [MUSAVA] - Current State %d",State() ) + + if ( State() == MMusAvaObserver::EMusAvaStatusOptionsSent || + State() == MMusAvaObserver::EMusAvaStatusAvailable || + State() == MMusAvaObserver::EMusAvaOptionNotAvailable ) + { + return; + } + + if ( variantSetting == MusSettingsKeys::EOperatorSpecific + && iSettings.CallDirection() == 2 && !iCapabilitiesRequestAnswered ) + { // terminated party + DoSetState( MMusAvaObserver::EMusAvaStatusOptionsNotSent ); + } + else if ( MusSettingsKeys::ESequential == + MultimediaSharingSettings::CapabilityQuerySettingL() + && iSettings.CallDirection() == 2 && !iCapabilitiesRequestAnswered ) + { // terminated party + DoSetState( MMusAvaObserver::EMusAvaStatusOptionsNotSent ); + } + else + { + if ( MusSettingsKeys::EOperatorSpecific == variantSetting || + MusSettingsKeys::EParallel == + MultimediaSharingSettings::CapabilityQuerySettingL() || + MusSettingsKeys::ESequential == + MultimediaSharingSettings::CapabilityQuerySettingL() ) + { + const MDesCArray& addresses = iSettings.SipAddresses(); + + TInt addressesCount = addresses.MdcaCount(); + MUS_LOG1( "mus: [MUSAVA] addresses.MdcaCount() %d", + addressesCount ) + if( addressesCount ) + { + const TDesC& sipAddress = addresses.MdcaPoint( 0 ); + MUS_LOG_TDESC( "mus: [MUSAVA] SIP Address: ", + sipAddress ) + TRAPD( err, iSipAgent->ExecuteCapabilityQueryL( + *iSwisCapability, sipAddress ) ); + // set status available and report to the observer + if ( err == KErrNone ) + { + HBufC8* sipAddress8 = + EscapeUtils::ConvertFromUnicodeToUtf8L( sipAddress ); + CleanupStack::PushL( sipAddress8 ); + if ( iCapabilityExchange-> + TerminalL( sipAddress8->Des() ).QueryExecuting() ) + { + DoSetState( MMusAvaObserver::EMusAvaStatusOptionsSent ); + } + else + { + DoSetState( MMusAvaObserver::EMusAvaStatusAvailable ); + } + CleanupStack::PopAndDestroy( sipAddress8 ); + } + // when profile is in when needed mode and registration still on + // going we get this error and wait untill registration is successful + // since we did not send any options set the state EMusAvaStatusNotExecuted. + else if( err == KErrSIPInvalidRegistrationState ) + { + DoSetState( MMusAvaObserver::EMusAvaStatusNotExecuted ); + } + // anything other than this should be considered default , means options sent + // and was not successful. + else + { + DoSetState( MMusAvaObserver::EMusAvaOptionNotAvailable ); + } + } + else + { + DoSetState( MMusAvaObserver::EMusAvaStatusOptionsNotSent ); + } + } + else + { + // option sending not needed + DoSetState( MMusAvaObserver::EMusAvaStatusOptionsNotSent ); + } + } + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaOptionHandler::DoExecuteL()" ) + } + + +// ----------------------------------------------------------------------------- +// Stops executing availability. +// ----------------------------------------------------------------------------- +// +void CMusAvaOptionHandler::Stop() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaOptionHandler::Stop()" ) + // TBD + MUS_LOG( "mus: [MUSAVA] <- CMusAvaOptionHandler::Stop()" ) + } + + +// ----------------------------------------------------------------------------- +// Returns name of *this* availability. +// ----------------------------------------------------------------------------- +// +MMusAvaObserver::TAvailabilityName CMusAvaOptionHandler::Name() + { + return MMusAvaObserver::EMusAvaOptionHandler; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusAvaOptionHandler::PrepareForReceivedInviteL() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaOptionHandler::PrepareForReceivedInviteL()" ) + + if ( iFastModeAvailabilityDelayed ) + { + MUS_LOG( "mus: [MUSAVA] Set delayed availability" ) + SetState( MMusAvaObserver::EMusAvaStatusAvailable ); + iFastModeAvailabilityDelayed = EFalse; + } + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaOptionHandler::PrepareForReceivedInviteL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusAvaOptionHandler::CapabilitiesResolved( + const CMusAvaCapabilityQueryBase& aSentQuery ) + { + MUS_LOG( + "mus: [MUSAVA] -> CMusAvaOptionHandler::CapabilitiesResolved()" ) + if ( aSentQuery.Result() == KCapabilityCapabilitesReady ) + { + // tell the upper layer that + // query was succesfull. VS is available + DoSetState( MMusAvaObserver::EMusAvaStatusAvailable ); + } + else if ( aSentQuery.Result() == KCapabilityCapabilitiesForbidden ) + { + // query returned with response "403 Forbidden". VS is NOT available + DoSetState( MMusAvaObserver::EMusAvaFailureCode ); + } + else + { + //query failed. VS is NOT available + DoSetState( MMusAvaObserver::EMusAvaOptionNotAvailable ); + } + + MUS_LOG( + "mus: [MUSAVA] <- CMusAvaOptionHandler::CapabilitiesResolved()" ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusAvaOptionHandler::CapabilitiesResolvedL( const TDesC& aUri ) + { + MUS_LOG( + "mus: [MUSAVA] -> CMusAvaOptionHandler::CapabilitiesResolvedL()" ) + if ( aUri.Length() > 0 ) + { + // Set the sip address resolved from succesfull OPTIONS response + // Old adress(es) are destroyed + CDesCArrayFlat* sipAddresses = new( ELeave ) CDesCArrayFlat( 1 ); + CleanupStack::PushL( sipAddresses ); + + sipAddresses->AppendL( aUri ); + iSettings.SetSipAddressesL( *sipAddresses ); + + MUS_LOG_TDESC( "mus: [MUSAVA] SIP Address: ", aUri ) + + sipAddresses->Reset(); + CleanupStack::PopAndDestroy( sipAddresses ); + } + + MUS_LOG( + "mus: [MUSAVA] <- CMusAvaOptionHandler::CapabilitiesResolvedL()" ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusAvaOptionHandler::SetCapabilitiesResolvedForCingular() + { + MUS_LOG( + "mus: [MUSAVA] -> CMusAvaOptionHandler::\ + SetCapabilitiesResolvedForCingular()" ) + iCapabilitiesRequestAnswered = ETrue; + + TRAPD( error, DoExecuteL() ); + if ( error ) + { + MUS_LOG1( "mus: [MUSAVA] <- CMusAvaOptionHandler::\ + SetCapabilitiesResolvedForCingular() leave code = %d", error ) + } + else + { + MUS_LOG( "mus: [MUSAVA] <- CMusAvaOptionHandler::\ + SetCapabilitiesResolvedForCingular()" ) + } + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMusAvaOptionHandler::CapabilitiesResolvedForCingular() + { + MUS_LOG( + "mus: [MUSAVA] CMusAvaOptionHandler::CapabilitiesResolvedForCingular()" ) + return iCapabilitiesRequestAnswered; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusAvaOptionHandler::SipHeadersL( + const MDesCArray& aHeaders, + SipStrConsts::TStrings aHeaderType) + { + MUS_LOG("mus: [MUSAVA] -> CMusAvaOptionHandler::SipHeadersL()" ) + + // if header type is to then store in iSettings , so then future + // request will be send there. + if(aHeaderType == SipStrConsts::EToHeader) + { + // All addresses received should be valid, so choose just one to avoid + // situation where user has to choose one from equal addresses. + // Prefer SIP URI, but accept also TEL URI. + + TBuf sipUri; + TBuf telUri; + + for ( TInt i = 0; i < aHeaders.MdcaCount(); ++i ) + { + if ( aHeaders.MdcaPoint( i ).FindF( KMusSipPrefix ) != + KErrNotFound ) + { + sipUri.Copy( aHeaders.MdcaPoint( i ) ); + } + else if ( aHeaders.MdcaPoint(i).FindF( KMusTelPrefix ) != + KErrNotFound ) + { + telUri.Copy( aHeaders.MdcaPoint( i ) ); + } + else + { + // NOP + } + } + + CDesCArray* addresses = new( ELeave ) CDesCArrayFlat( 1 ); + CleanupStack::PushL( addresses ); + + if ( telUri.Length() > 0 ) + { + telUri.Trim(); + addresses->AppendL( telUri ); + // Check if TEL URI conforms to phone number currently hold. + // If they do not match, we replace phone number with one parsed + // out of received from P-Asserted-Identity header. Since in this + // scenario we cannot be sure about validity of contact name either, + // we empty the contact name. This is only not to show incorrect + // information, but this solution does not show possibly existing + // contact name. + + // We compare last seven digits, since that is the minimum amount + // that can make up a valid telephone number. + // Variable telUri holds also prefix, but that does not affect the + // righthand comparison. + + MUS_LOG_TDESC( "mus: [MUSUI ] iSettings.TelNumber(): ", + iSettings.TelNumber() ) + MUS_LOG_TDESC( "mus: [MUSUI ] telUri: ", telUri ) + + TPtrC16 telUriWithoutPrefix = + telUri.Right( telUri.Length() - KMusTelPrefix().Length() ); + + TPtrC16 numberPartOfTelUri = + telUriWithoutPrefix.Find( KMusPlusSign ) == 0 ? + telUriWithoutPrefix.Right( telUriWithoutPrefix.Length() - 1 ) : + telUriWithoutPrefix; + + if ( !( iSettings.TelNumber().Length() >= KMusMinDigitCountInTelNumber && + numberPartOfTelUri.Length() >= KMusMinDigitCountInTelNumber && + iSettings.TelNumber().Right( KMusMinDigitCountInTelNumber ) == + telUri.Right( KMusMinDigitCountInTelNumber ) ) ) + { + iSettings.SetTelNumberL( telUriWithoutPrefix ); + iSettings.SetContactNameL( KNullDesC() ); + iSettings.SetContactId( KErrNotFound ); + } + } + + if ( sipUri.Length() > 0 ) + { + // Replace possibly existing TEL URI with SIP URI + addresses->Reset(); + addresses->AppendL( sipUri ); + } + + iSettings.SetSipAddressesL( addresses ); // Transfers ownership + CleanupStack::Pop( addresses ); + } + else + { + // should go for future need if any. + } + MUS_LOG("mus: [MUSAVA] <- CMusAvaOptionHandler::SipHeadersL()" ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusAvaOptionHandler::VideoCodecsResolvedL( const MDesCArray& aVideoCodecs ) + { + MUS_LOG("mus: [MUSAVA] -> CMusAvaOptionHandler::VideoCodecsResolvedL()" ) + + iSettings.SetVideoCodecsL( aVideoCodecs ); + + MUS_LOG("mus: [MUSAVA] <- CMusAvaOptionHandler::VideoCodecsResolvedL()" ) + } + + +// ----------------------------------------------------------------------------- +// If MO side fast mode negotiation has failed, cannot change the value anymore +// as it is very likely that automatic invitation fails as well. +// ----------------------------------------------------------------------------- +// +void CMusAvaOptionHandler::FastModeResolved( MusSettingsKeys::TFastMode aMode ) + { + MUS_LOG1("mus: [MUSAVA] -> CMusAvaOptionHandler::FastModeResolved():%d", + aMode ) + + if ( FastModeNegotiationFailedMO() ) + { + MUS_LOG("mus: [MUSAVA] Ignore setting as failed already" ) + } + else + { + iSettings.SetFastMode( aMode ); + } + + MUS_LOG("mus: [MUSAVA] <- CMusAvaOptionHandler::FastModeResolved()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CMusAvaOptionHandler::DoSetState( MMusAvaObserver::TAvailabilityStatus aNewState ) + { + MUS_LOG1( "mus: [MUSAVA] -> CMusAvaOptionHandler::DoSetState() state:%d", + aNewState ) + TInt err( KErrNone ); + + if ( iFastModeCapable ) + { + TRAP( err, aNewState = HandleFastModeL( aNewState ) ); + } + + SetState( aNewState ); + + MUS_LOG1("mus: [MUSAVA] <- CMusAvaOptionHandler::DoSetState(), err:%d", err ) + + return err; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +MMusAvaObserver::TAvailabilityStatus CMusAvaOptionHandler::HandleFastModeL( + MMusAvaObserver::TAvailabilityStatus aNewState ) + { + MUS_LOG("mus: [MUSAVA] -> CMusAvaOptionHandler::HandleFastModeL()" ) + + switch ( aNewState ) + { + case MMusAvaObserver::EMusAvaOptionNotAvailable: + { + aNewState = HandleFastModeOptionNotAvailableL( aNewState ); + break; + } + case MMusAvaObserver::EMusAvaStatusOptionsNotSent: + { + aNewState = HandleFastModeOptionsNotSentL( aNewState ); + break; + } + case MMusAvaObserver::EMusAvaStatusAvailable: + { + aNewState = HandleFastModeAvailableL( aNewState ); + break; + } + default: + { + break; + } + } + + MUS_LOG("mus: [MUSAVA] <- CMusAvaOptionHandler::HandleFastModeL()" ) + + return aNewState; + } + +// ----------------------------------------------------------------------------- +// If fast mode and call originator, application is started +// automatically at background with two-way MO use case. If fast mode is +// negotiated, availability publishing is delayed at MT side until invitation +// is received (as MO will send invite automatically). +// ----------------------------------------------------------------------------- +// +MMusAvaObserver::TAvailabilityStatus CMusAvaOptionHandler::HandleFastModeAvailableL( + MMusAvaObserver::TAvailabilityStatus aNewState ) + { + MUS_LOG("mus: [MUSAVA] -> CMusAvaOptionHandler::HandleFastModeAvailableL()" ) + + __ASSERT_ALWAYS( iSettings.Observer(), User::Leave( KErrNotReady ) ); + + if ( State() != MMusAvaObserver::EMusAvaStatusAvailable && + iSettings.FastMode() == MusSettingsKeys::EFastModeOn ) + { + if ( iSettings.CallDirection() == NMusSessionInformationApi::ECallOrginated ) + { + MUS_LOG("mus: [MUSAVA] Starting application at background" ) + iSettings.Observer()->StartApplicationL( MultimediaSharing::EMusTwoWayVideo ); + } + else + { + MUS_LOG("mus: [MUSAVA] Delay availability publishing" ) + iFastModeAvailabilityDelayed = ETrue; + aNewState = State(); + } + } + + MUS_LOG("mus: [MUSAVA] <- CMusAvaOptionHandler::HandleFastModeAvailableL()" ) + + return aNewState; + } + +// ----------------------------------------------------------------------------- +// If fast mode and call terminated side, answering to 200 ok is already enough +// to set us available in delayed manner as other end can start sending +// invitation already after getting fast mode information in answer. +// ----------------------------------------------------------------------------- +// +void CMusAvaOptionHandler::HandleFastModeQueryAnswered() + { + if ( FastModeNegotiatedByAnswerMT() ) + { + MUS_LOG( "mus: [MUSAVA] Set fastmode available already as answered" ) + + // Will result delayed availability handling + DoSetState( MMusAvaObserver::EMusAvaStatusOptionsNotSent ); + } + } + +// ----------------------------------------------------------------------------- +// If options wasn't sent because of missing information, state can be set to +// available immediately as MT cannot start waiting for invite unless it is +// sure that other end is about to send it. +// ----------------------------------------------------------------------------- +// +MMusAvaObserver::TAvailabilityStatus +CMusAvaOptionHandler::HandleFastModeOptionsNotSentL( + MMusAvaObserver::TAvailabilityStatus aNewState ) + { + MUS_LOG("mus: [MUSAVA] -> CMusAvaOptionHandler::HandleFastModeOptionsNotSentL()" ) + + if ( FastModeNegotiatedByAnswerMT() ) + { + MUS_LOG("mus: [MUSAVA] Answered already, set available" ) + // Make available but start waiting for invitation + aNewState = HandleFastModeAvailableL( MMusAvaObserver::EMusAvaStatusAvailable ); + } + + MUS_LOG("mus: [MUSAVA] <- CMusAvaOptionHandler::HandleFastModeOptionsNotSentL()" ) + + return aNewState; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +MMusAvaObserver::TAvailabilityStatus +CMusAvaOptionHandler::HandleFastModeOptionNotAvailableL( + MMusAvaObserver::TAvailabilityStatus aNewState ) + { + MUS_LOG("mus: [MUSAVA] -> CMusAvaOptionHandler::HandleFastModeOptionNotAvailableL()" ) + + if ( iFastModeAvailabilityDelayed || + State() == MMusAvaObserver::EMusAvaStatusAvailable ) + { + MUS_LOG("mus: [MUSAVA] In delayed mode or available, ignore" ) + aNewState = State(); + } + + MUS_LOG("mus: [MUSAVA] <- CMusAvaOptionHandler::HandleFastModeOptionNotAvailableL()" ) + + return aNewState; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMusAvaOptionHandler::FastModeNegotiatedByAnswerMT() + { + return ( iFastModeCapable && + iCapabilityQueryAnswered && + iSettings.FastMode() == MusSettingsKeys::EFastModeOn && + iSettings.CallDirection() == NMusSessionInformationApi::ECallTerminated ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMusAvaOptionHandler::FastModeNegotiationFailedMO() + { + return ( iFastModeCapable && + iSettings.FastMode() != MusSettingsKeys::EFastModeOn && + iSettings.CallDirection() == NMusSessionInformationApi::ECallOrginated && + State() != MMusAvaObserver::EMusAvaStatusAvailable && + State() != MMusAvaObserver::EMusAvaStatusOptionsSent ); + } + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/src/musavaproxy.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/src/musavaproxy.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,58 @@ +/* +* 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: Plug-in entry point +* +*/ + + + +// INCLUDE FILES +#include "musunittesting.h" + +#include "musavadefaultimp.h" +#include "musavailabilityplugin.hrh" + + +// SYSTEM +#include +#include +#include + +// Disabled PC-Lint warning for "suspicious typecast" caused by Symbian's +// ECom declarations +/*lint -e611 */ + +// ------------------------------------------------------------------------------ +// Exported proxy for instantiation method resolution. Use the interface +// UID (same as the DLL UID) and the implementation factory function as a +// pair for ECom instantiation. +// ------------------------------------------------------------------------------ +// +const TImplementationProxy ImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( + KAvailabilityPluginImplementationUid, CMusAvaDefaultImp::NewL ) + }; + + +// ------------------------------------------------------------------------------ +// Give the table to the caller. +// ------------------------------------------------------------------------------ +// . +EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) + { + aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); + return ImplementationTable; + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/src/musavaregisteravailability.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/src/musavaregisteravailability.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,587 @@ +/* +* Copyright (c) 2005-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: Provide interface for the client requestin availability class. +* +*/ + + + +#include "musavaregisteravailability.h" +#include "musavaavailabilityobserver.h" +#include "musunittesting.h" +#include "musavaobserver.h" +#include "musavaavailability.h" +#include "musavasharedobject.h" +#include "muslogger.h" +#include "musavasettingsimp.h" +#include "musavasip.h" +#include "musavaconnectionmonitor.h" +#include "mussettings.h" +#include "musavaclientresolverutil.h" + +#include +#include +#include +#include +#include + + +// ----------------------------------------------------------------------------- +// Symbian two-phase constructor +// ----------------------------------------------------------------------------- +// +CMusAvaRegisterAvailability* CMusAvaRegisterAvailability::NewL( + MMusAvaAvailabilityObserver& aObserver, + CMusAvaSettingsImp& aSettings ) + { + CMusAvaRegisterAvailability* self = + CMusAvaRegisterAvailability::NewLC( + aObserver, + aSettings ); + CleanupStack::Pop( self ); + return self; + } + + +// ---------------------------------------------------------------------------- +// Two-phased constructor. +// ---------------------------------------------------------------------------- +// +CMusAvaRegisterAvailability* CMusAvaRegisterAvailability::NewLC( + MMusAvaAvailabilityObserver& aObserver, + CMusAvaSettingsImp& aSettings ) + { + CMusAvaRegisterAvailability* self = + new (ELeave) CMusAvaRegisterAvailability( + aObserver, + aSettings ); + CleanupStack::PushL (self); + self->ConstructL(); + return self; + } + + +// ------------------------------------------------------------------------------ +// Destructor. +// ------------------------------------------------------------------------------ +// +CMusAvaRegisterAvailability::~CMusAvaRegisterAvailability() + { + if ( iSharedObj ) + { + iSharedObj->MusAvaSip().RemoveAdapter( *this ); + iSharedObj->DeleteSingleton(); + } + } + + +// ------------------------------------------------------------------------------ +// Symbian 2nd phase constructor can leave. +// ------------------------------------------------------------------------------ +// +void CMusAvaRegisterAvailability::ConstructL() + { + iSharedObj = CMusAvaSharedObject::GetSingletonL(); + iSharedObj->MusAvaSip().AddAdapterL( *this ); + } + + +// ----------------------------------------------------------------------------- +// Constructor. +// ----------------------------------------------------------------------------- +// +CMusAvaRegisterAvailability::CMusAvaRegisterAvailability( + MMusAvaAvailabilityObserver& aObserver, + CMusAvaSettingsImp& aSettings ) + :CMusAvaAvailability( aObserver ), + iSettings( aSettings ) + { + } + + +// ----------------------------------------------------------------------------- +// Executes for the master - salve pattern. +// ----------------------------------------------------------------------------- +// +void CMusAvaRegisterAvailability::DoExecuteL() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaRegisterAvailability::DoExecuteL " ) + SetState( MMusAvaObserver::EMusAvaStatusInProgress ); + RegisterL(); + // TBD: SetState( MMusAvaObserver::EMusAvaNameRegistration ); + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaRegisterAvailability::DoExecuteL " ) + } + + +// ----------------------------------------------------------------------------- +// Stop the execution. +// ----------------------------------------------------------------------------- +// +void CMusAvaRegisterAvailability::Stop() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaRegisterAvailability::Stop" ) + CSIPProfile* profile = iSharedObj->MusAvaSip().Profile(); + if ( profile ) + { + CSIPProfileRegistry* registry = NULL; // not own, so not deleted + TRAPD( error_register, registry = + &iSharedObj->MusAvaSip().ProfileRegistryL() ); + if ( error_register == KErrNone ) + { + MUS_LOG( "mus: [MUSAVA] Sip profile registry found" ) + TInt error = registry->Disable( *profile ); + MUS_LOG1( "mus: [MUSAVA] Disable Sip profile ( %d )", error ) + } + } + + SetState( MMusAvaObserver::EMusAvaStatusNotExecuted ); + MUS_LOG( "mus: [MUSAVA] <- CMusAvaRegisterAvailability::Stop" ) + } + + +// ----------------------------------------------------------------------------- +// CMusAvaRegisterAvailability::Name +// +// ----------------------------------------------------------------------------- +// +MMusAvaObserver::TAvailabilityName CMusAvaRegisterAvailability::Name() + { + return MMusAvaObserver::EMusAvaNameRegistration; + } + + +// ----------------------------------------------------------------------------- +// An event related to SIP Profile has accorred +// ----------------------------------------------------------------------------- +// +void CMusAvaRegisterAvailability::ProfileRegistryEventOccurred( + TUint32 aProfileId, + MSIPProfileRegistryObserver::TEvent aEvent) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaRegisterAvailability::\ + ProfileRegistryEventOccurred " ) + + CSIPProfile* profile = iSharedObj->MusAvaSip().Profile(); + if ( !profile ) + { + MUS_LOG( "mus: [MUSAVA] no sip profile found, returning!" ) + return; + } + + + TUint32 profileId = 0; + TUint connectionId = 0; + + profile->GetParameter( KSIPProfileId, profileId ); + + if ( aProfileId == profileId ) + { + switch (aEvent) + { + case MSIPProfileRegistryObserver::EProfileCreated: + { + MUS_LOG( "mus: [MUSAVA] Profile is created" ) + MUS_LOG( "mus: [MUSAVA] <- CMusAvaRegisterAvailability\ + ::ProfileRegistryEventOccurred" ) + } + break; + + case MSIPProfileRegistryObserver::EProfileUpdated: + { + MUS_LOG( "mus: [MUSAVA] Profile is updated" ) + } + break; + + case MSIPProfileRegistryObserver::EProfileRegistered: + { + MUS_LOG( "mus: [MUSAVA] Profile is registred" ) + + // Make sure that valid connection exists when registered + CSIPConnection* sipConnection = NULL; + TRAPD( err, sipConnection = iSharedObj->MusAvaSip().ConnectionL() ); + if ( err != KErrNone || + !sipConnection || + sipConnection->State() == CSIPConnection::EUnavailable || + sipConnection->State() == CSIPConnection::ESuspended || + sipConnection->State() == CSIPConnection::EInactive ) + { + MUS_LOG1( "mus: [MUSAVA] CreateSIPConnectionL \ + leave #%d", err ) + SetState( MMusAvaObserver::MMusAvaObserver::EMusAvaConnectionErr ); + } + else + { + TRAP( err, connectionId = + iSharedObj->ConnectionMonitor().ConnectionIDL() ); + if ( err == KErrNotFound ) + { + SetState( MMusAvaObserver::EMusAvaConnectionErr ); + } + else + { + iSharedObj->ConnectionMonitor().SetConnectionID( + connectionId ); + if( err != KErrNone ) + { + MUS_LOG1( "mus: [MUSAVA] ConnectionIdL \ + leave #%d", err ) + } + } + } + + MUS_LOG( "mus: [MUSAVA] Enable profile." ) + TRAP( err, EnableRegisterL() ); + if( err != KErrNone ) + { + MUS_LOG1( "mus: [MUSAVA] EnableRegisterL leave #%d", + err ) + } + + TRAP( err, CreateSipAddressProposalL(); ); + if( err != KErrNone ) + { + MUS_LOG1( "mus: [MUSAVA] CreateSipAddressProposalL \ + err #%d", err ) + } + + SetState( MMusAvaObserver::EMusAvaStatusAvailable ); + + // update sipprofile in settings + if ( profileId != iSettings.SipProfileId() ) + { + MUS_LOG1( "mus: [MUSAVA] Profile id in settings before\ + update:%d", iSettings.SipProfileId() ) + iSettings.SetSipProfileId( profileId ); + MUS_LOG1( "mus: [MUSAVA] Profile id in settings after\ + update:%d", iSettings.SipProfileId() ) + } + else + { + MUS_LOG( "Profile is not needed to update!!!!!" ) + } + } + break; + + case MSIPProfileRegistryObserver::EProfileDeregistered: + { + MUS_LOG( "mus: [MUSAVA] Profile is deregistered" ) + SetState( MMusAvaObserver::EMusAvaStatusNotRegistered ); + } + break; + + case MSIPProfileRegistryObserver::EProfileDestroyed: + { + MUS_LOG( "mus: [MUSAVA] Profile is destroyed " ) + SetState( MMusAvaObserver::EMusAvaStatusNotRegistered ); + } + break; + + default: + MUS_LOG( "mus: [MUSAVA] Unknown Profile Id" ) + break; + } + } + else + { + MUS_LOG( "mus: [MUSAVA] aProfileId != profileId" ) + } + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaRegisterAvailability::\ + ProfileRegistryEventOccurred" ) + } + +// ----------------------------------------------------------------------------- +// An asynchronous error has occurred related to SIP profile +// Event is send to those observers, who have the +// corresponding profile instantiated. +// ----------------------------------------------------------------------------- +// +void CMusAvaRegisterAvailability::ProfileRegistryErrorOccurred( + TUint32 aProfileId, + TInt /* aError */ ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaRegisterAvailability::\ + ProfileRegistryErrorOccurred" ) + + CSIPProfile* profile = iSharedObj->MusAvaSip().Profile(); + if ( !profile ) + { + return; + } + + TUint32 profileId; + + profile->GetParameter( KSIPProfileId, profileId ); + + if( profileId == aProfileId ) + { + SetState( MMusAvaObserver::EMusAvaStatusNotRegistered ); + } + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaRegisterAvailability::\ + ProfileRegistryErrorOccurred" ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusAvaRegisterAvailability::CreateSipAddressProposalL() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaRegisterAvailability::\ + CreateSipAddressProposalL() " ) + + HBufC* domain = iSharedObj->MusAvaSip().OwnDomainLC(); + + const TDesC& telNumber = iSettings.TelNumber(); + + iSettings.SetSipAddressProposalL( telNumber, *domain ); + + CleanupStack::PopAndDestroy( domain ); + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaRegisterAvailability::\ + CreateSipAddressProposalL() " ) + } + + +// ----------------------------------------------------------------------------- +// Connection state has changed. +// iSipConnection has to be instantiated for us to get these callbacks. +// from base class MSIPConnectionObserver +// ----------------------------------------------------------------------------- +// +TInt CMusAvaRegisterAvailability::ConnectionStateChanged( + CSIPConnection::TState aState ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaRegisterAvailability::\ + ConnectionStateChanged" ) + TInt err = 0; + switch ( aState ) + { + case CSIPConnection::EInit: + { + MUS_LOG( "mus: [MUSAVA] aState == CSIPConnection::EInit" ) + break; + } + case CSIPConnection::EActive: + { + MUS_LOG( "mus: [MUSAVA] aState == CSIPConnection::EActive" ) + break; + } + case CSIPConnection::ESuspended: + { + MUS_LOG( "mus: [MUSAVA] aState == CSIPConnection::ESuspended" ) + SetState( MMusAvaObserver::EMusAvaConnectionErr ); + break; + } + case CSIPConnection::EInactive: + { + MUS_LOG( "mus: [MUSAVA] aState == CSIPConnection::EInactive" ) + // If we get here, then PDP context is probably + // unavailable => close an existing PDP context. + MUS_LOG( "mus: [MUSAVA] now calling CloseExistingConnectionL" ) + iSharedObj->ConnectionMonitor().KillPdpContext(); + TRAPD( leaveCode, err = RegisterL() ) + if ( !leaveCode || err ) + { + SetState( MMusAvaObserver::EMusAvaConnectionErr ); + } + else + { + SetState( MMusAvaObserver::EMusAvaStatusAvailable ); + } + break; + } + case CSIPConnection::EUnavailable: + { + MUS_LOG( "mus: [MUSAVA] aState == CSIPConnection::EUnavailable" ) + SetState( MMusAvaObserver::EMusAvaConnectionErr ); + break; + } + default: + { + MUS_LOG( "mus: [MUSAVA] in default branch => ESipConnUnknown" ) + break; + } + } + + MUS_LOG( "mus: [MUSAVA]: <- CMusAvaRegisterAvailability::ConnectionStateChanged" ) + + return ETrue; + } + +// ----------------------------------------------------------------------------- +// Initialize SIP Registration. +// ----------------------------------------------------------------------------- +// +TBool CMusAvaRegisterAvailability::InitializeRegister() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaRegisterAvailability::\ + InitializeRegister " ) + + MUS_LOG( "mus: [MUSAVA] Create SIP Profile " ) + TBool profileCreated = EFalse; + TRAPD( err, profileCreated = iSharedObj->MusAvaSip().CreateProfileL() ); + if ( err || !profileCreated ) + { + MUS_LOG( "mus: [MUSAVA] Profile is not created " ) + MUS_LOG( "mus: [MUSAVA] <- CMusAvaRegisterAvailability::\ + InitializeRegister " ) + SetState( MMusAvaObserver::EMusAvaStatusNoSipProfile ); + return EFalse; + } + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaRegisterAvailability::\ + InitializeRegister " ) + + return ETrue; + } + + +// ----------------------------------------------------------------------------- +// SIP Registration. +// ----------------------------------------------------------------------------- +// +TBool CMusAvaRegisterAvailability::RegisterL() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaRegisterAvailability::RegisterL " ) + + MUS_LOG( "mus: [MUSAVA] Checks if the profile is not enabled - \ + Enable" ) + if ( !InitializeRegister()) + { + MUS_LOG( "mus: [MUSAVA] SIP register initilisation fails " ) + MUS_LOG( "mus: [MUSAVA] <- CMusAvaRegisterAvailability::\ + Register " ) + return EFalse; + } + + EnableRegisterL(); + if ( !UpdateSIPProfile() ) + { + return EFalse; + } + return RegistrationStatusL(); + } + +// ----------------------------------------------------------------------------- +// Enable SIP Registration. +// ----------------------------------------------------------------------------- +// +void CMusAvaRegisterAvailability::EnableRegisterL() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaRegisterAvailability::EnableRegisterL " ) + MUS_LOG( "mus: [MUSAVA] Fetch SIP ProfileRegistry" ) + + CSIPProfileRegistry& registry = iSharedObj->MusAvaSip().ProfileRegistryL(); + MUS_LOG( "mus: [MUSAVA] Profile status" ) + if ( !registry.IsEnabled( *iSharedObj->MusAvaSip().Profile() ) ) + { + MUS_LOG("mus: [MUSAVA] Calling EnableL()" ) + registry.EnableL( *iSharedObj->MusAvaSip().Profile(), + iSharedObj->MusAvaSip().ConnectionObserver() ); + } + + // Try to write client information to CenRep of client resolver. + // This functionality is needed in __VOIP enabled terminals. + // In __VOIP disabled builds this will fail because of a lack of needed + // CenRep UID. To avoid branching, we just try to do this and let it fail + // in normal build. + CMusAvaClientResolverUtil* resolver = + iSharedObj->MusAvaSip().ClientResolverUtil(); + if ( resolver ) + { + TRAP_IGNORE( resolver->RegisterClientWithUserL( + *iSharedObj->MusAvaSip().Profile() ) ) + } + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaRegisterAvailability::EnableRegisterL " ) + } + + +// ----------------------------------------------------------------------------- +// Update SIP Registration. +// ----------------------------------------------------------------------------- +// +TBool CMusAvaRegisterAvailability::UpdateSIPProfile() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaRegisterAvailability::UpdateSIPProfile " ) + TUint32 profileId = 0; // Initial value doesn't matter. + // but better to set it to default profile + TInt err = iSharedObj->MusAvaSip().Profile()->GetParameter( + KSIPProfileId, profileId ); + if( err == KErrNone) + { + MUS_LOG1("mus: [MUSAVA] Set SIP Profile ID in Central Repositary \ + to %d",profileId ) + iSettings.SetSipProfileId( profileId ); + MUS_LOG( "mus: [MUSAVA] <- CMusAvaRegisterAvailability::UpdateSIPProfile " ) + return ETrue; + } + else + { + MUS_LOG1("mus: [MUSAVA] SIP Profile ID is not found. \ + remove Id away from Central Repositary %d",err ) + iSettings.SetSipProfileId( err ); + MUS_LOG( "mus: [MUSAVA] <- CMusAvaRegisterAvailability::UpdateSIPProfile " ) + return EFalse; + } + } + +// ----------------------------------------------------------------------------- +// SIP profile Registration status. +// ----------------------------------------------------------------------------- +// +TBool CMusAvaRegisterAvailability::RegistrationStatusL() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaRegisterAvailability::RegistrationStatusL " ) + MUS_LOG("mus: [MUSAVA] Checking profile registration" ) + + TBool registered; + + TInt err = iSharedObj->MusAvaSip().Profile()->GetParameter( + KSIPProfileRegistered, registered ); + + if( err != KErrNone || !registered ) + { + MUS_LOG2( "mus: [MUSAVA] Profile not registered, get error=%d, \ + register value=%d", err, registered ) + + SetState( MMusAvaObserver::EMusAvaStatusInProgress ); + MUS_LOG( "mus: [MUSAVA] <- CMusAvaRegisterAvailability::RegistrationStatusL " ) + return EFalse; + } + else + { + MUS_LOG("mus: [MUSAVA] profile is registred " ) + + iSharedObj->MusAvaSip().ConnectionL(); + + MUS_LOG("mus: [MUSAVA] connection created " ) + + HBufC* domain = iSharedObj->MusAvaSip().OwnDomainLC(); + const TDesC& telNumber = iSettings.TelNumber(); + + iSettings.SetSipAddressProposalL( telNumber, *domain ); + + CleanupStack::PopAndDestroy( domain ); + SetState( MMusAvaObserver::EMusAvaStatusAvailable ); + MUS_LOG( "mus: [MUSAVA] <- CMusAvaRegisterAvailability::RegistrationStatusL " ) + return ETrue; + } + } + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/src/musavasettingavailability.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/src/musavasettingavailability.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,212 @@ +/* +* Copyright (c) 2005-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: Implements Settings Availability +* +*/ + + + +#include "musavaavailabilityobserver.h" +#include "musavaavailability.h" +#include "musunittesting.h" +#include "musavaobserver.h" +#include "muslogger.h" +#include "mussettings.h" +#include +#include + +#include "musavasettingavailability.h" +#include "mussesseioninformationapi.h" + + + +// -------------------------------------------------------------------------- +// Symbian two-phase constructor +// -------------------------------------------------------------------------- +// +CMusAvaSettingAvailability* CMusAvaSettingAvailability::NewL( + MMusAvaAvailabilityObserver& aObserver) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSettingAvailability::NewL " ) + CMusAvaSettingAvailability* self = + CMusAvaSettingAvailability::NewLC( + aObserver); + CleanupStack::Pop( self ); + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSettingAvailability::NewL " ) + return self; + } + + +// ------------------------------------------------------------------------- +// Two-phased constructor. +// ------------------------------------------------------------------------- +// +CMusAvaSettingAvailability* CMusAvaSettingAvailability::NewLC( + MMusAvaAvailabilityObserver& aObserver) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSettingAvailability::NewLC " ) + CMusAvaSettingAvailability* self = + new (ELeave) CMusAvaSettingAvailability( + aObserver); + CleanupStack::PushL (self); + self->ConstructL(); + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSettingAvailability::NewLC " ) + return self; + } + + +// --------------------------------------------------------------------------- +// Destructor. +// --------------------------------------------------------------------------- +// +CMusAvaSettingAvailability::~CMusAvaSettingAvailability() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSettingAvailability::\ + ~CMusAvaSettingAvailability " ) + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSettingAvailability::\ + ~CMusAvaSettingAvailability " ) + + } + + +// --------------------------------------------------------------------------- +// Symbian 2nd phase constructor can leave. +// --------------------------------------------------------------------------- +// +void CMusAvaSettingAvailability::ConstructL() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSettingAvailability::ConstructL " ) + // set this only for static availability modules + CheckActivationState(); + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSettingAvailability::ConstructL " ) + } + + +// ------------------------------------------------------------------------- +// Constructor. +// ------------------------------------------------------------------------- +// +CMusAvaSettingAvailability::CMusAvaSettingAvailability( + MMusAvaAvailabilityObserver& aObserver) + :CMusAvaAvailability( aObserver ) + { + } + + +// ------------------------------------------------------------------------- +// Executes for the master - salve pattern. +// ------------------------------------------------------------------------- +// +void CMusAvaSettingAvailability::DoExecuteL() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSettingAvailability::DoExecuteL " ) + CheckActivationState(); + SetState(iState); + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSettingAvailability::DoExecuteL " ) + } + +// ------------------------------------------------------------------------- +// CMusAvaSettingAvailability::CheckActivationState +// ------------------------------------------------------------------------- +// +void CMusAvaSettingAvailability::CheckActivationState() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSettingAvailability::SetActivationState " ) + MusSettingsKeys::TActivation activation = MusSettingsKeys::EAlwaysActive; + TRAPD( err, activation = + MultimediaSharingSettings::ActivationSettingL() ); + if( err == KErrNone ) + { + switch( activation ) + { + case MusSettingsKeys::ENever: + iState = MMusAvaObserver::EMusActivationError ; + break; + case MusSettingsKeys::EAlwaysActive: + case MusSettingsKeys::EActiveInHomeNetworks: + default: + if ( !IsForbiddenByOptionsResponse()) + { + iState = MMusAvaObserver::EMusAvaStatusAvailable ; + } + else + { + iState = MMusAvaObserver::EMusAvaFailureCode ; + } + break; + } + } + else + { + iState = MMusAvaObserver::EMusActivationError ; + } + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSettingAvailability::SetActivationState " ) + } +// ------------------------------------------------------------------------- +// Stop the execution. +// ------------------------------------------------------------------------- +// +void CMusAvaSettingAvailability::Stop() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSettingAvailability::Stop" ) + SetState( MMusAvaObserver::EMusAvaStatusNotExecuted ); + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSettingAvailability::Stop" ) + } + + +// ------------------------------------------------------------------------- +// CMusAvaSettingAvailability::Name +// +// ------------------------------------------------------------------------- +// +MMusAvaObserver::TAvailabilityName CMusAvaSettingAvailability::Name() + { + return MMusAvaObserver::EMusAvaNameSetting; + } + + +// ------------------------------------------------------------------------- +// CMusAvaSettingAvailability::IsForbiddenByOptionsResponse +// +// ------------------------------------------------------------------------- +// +TBool CMusAvaSettingAvailability::IsForbiddenByOptionsResponse() + { + MUS_LOG( "mus: [MUSAVA] -> \ + CMusAvaSettingAvailability::IsForbiddenByOptionsResponse" ) + TInt forbidden; + TInt err= RProperty::Get( NMusSessionInformationApi::KCategoryUid , + NMusSessionInformationApi::KMUSForbidden , + forbidden ); + TBool result = EFalse; + /* If the property is not defined then it means options/operator + specification may not exist . So we return it is Not forbidden + */ + if ( err==KErrNone && + NMusSessionInformationApi::EMUSForbidden == forbidden ) + { + result = ETrue; + } + + MUS_LOG1( "mus: [MUSAVA] <- \ + CMusAvaSettingAvailability::IsForbiddenByOptionsResponse = %d",result ) + return result; + } + + + + +// end of file + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/src/musavasettingsimp.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/src/musavasettingsimp.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,494 @@ +/* +* Copyright (c) 2005-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: This is module interface class for MusAvailability Plug-in +* +*/ + + + +// INCLUDE FILES +#include "musavasettingsimp.h" +#include "musavasettingsobserver.h" +#include "muslogger.h" +#include "musavasip.h" + +#include +#include +#include +#include + +// ----------------------------------------------------------------------------- +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CMusAvaSettingsImp* CMusAvaSettingsImp::NewL() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSettingsImp::NewL()" ) + CMusAvaSettingsImp* self = new (ELeave) CMusAvaSettingsImp; + CleanupStack::PushL (self); + self->ConstructL(); + CleanupStack::Pop( self ); + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSettingsImp::NewL()" ) + return self; + } + +// ----------------------------------------------------------------------------- +// C++ destructor. +// ----------------------------------------------------------------------------- +// +CMusAvaSettingsImp::~CMusAvaSettingsImp() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSettingsImp::~CMusAvaSettingsImp()" ) + + delete iTelNumber; + iTelNumber = NULL ; + + delete iContactName; + iContactName = NULL; + + delete iSipAddressProposal; + iSipAddressProposal = NULL ; + + if( iSipAddresses ) + { + iSipAddresses->Reset(); + delete iSipAddresses; + iSipAddresses = NULL ; + } + + if( iVideoCodecs ) + { + iVideoCodecs->Reset(); + delete iVideoCodecs; + iVideoCodecs = NULL ; + } + + if( iAudioCodecs ) + { + iAudioCodecs->Reset(); + delete iAudioCodecs; + iAudioCodecs = NULL ; + } + + delete iContactResolvingUri; + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSettingsImp::~CMusAvaSettingsImp()" ) + } + +// ----------------------------------------------------------------------------- +// C++ Constructor +// ----------------------------------------------------------------------------- +// +CMusAvaSettingsImp::CMusAvaSettingsImp() : + iFastMode( MusSettingsKeys::EFastModeOff ) + { + } + +// ----------------------------------------------------------------------------- +// Symbian second-phase constructor. +// ----------------------------------------------------------------------------- +// +void CMusAvaSettingsImp::ConstructL() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSettingsImp::ConstructL()" ) + iTelNumber = HBufC::NewL( 0 ); + + iContactName = HBufC::NewL( 0 ); + + iSipAddressProposal = HBufC::NewL( 0 ); + + iContactId = KErrNotFound; + + iSipProfileId = KErrNotFound; + + iSipAddresses = new( ELeave ) CDesCArrayFlat( 1 ); + + iVideoCodecs = new( ELeave ) CDesCArrayFlat( 1 ); + + iAudioCodecs = new( ELeave ) CDesCArrayFlat( 1 ); + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSettingsImp::ConstructL()" ) + } +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +MMusAvaSettings::TManualActivation CMusAvaSettingsImp::ManualActivation() + { + return iManualActivation; + } +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +const TDesC& CMusAvaSettingsImp::TelNumber() const + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSettingsImp::TelNumber()" ) + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSettingsImp::TelNumber()" ) + return *iTelNumber; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +const TDesC& CMusAvaSettingsImp::ContactName() const + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSettingsImp::ContactName()" ) + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSettingsImp::ContactName()" ) + return *iContactName; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +const MDesCArray& CMusAvaSettingsImp::SipAddresses() const + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSettingsImp::SipAddresses() " ) + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSettingsImp::SipAddresses() " ) + return *iSipAddresses; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +const TDesC& CMusAvaSettingsImp::SipAddressProposal() const + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSettingsImp::SipAddressProposal() " ) + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSettingsImp::SipAddressProposal() " ) + return *iSipAddressProposal; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CMusAvaSettingsImp::ContactId() const + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSettingsImp::ContactId() " ) + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSettingsImp::ContactId() " ) + return iContactId; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +const MDesCArray& CMusAvaSettingsImp::VideoCodecs() const + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSettingsImp::VideoCodecs() " ) + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSettingsImp::VideoCodecs() " ) + return *iVideoCodecs; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +const MDesCArray& CMusAvaSettingsImp::AudioCodecs() const + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSettingsImp::AudioCodecs() " ) + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSettingsImp::AudioCodecs() " ) + return *iAudioCodecs; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CMusAvaSettingsImp::SipProfileId() const + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSettingsImp::SipProfileId() " ) + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSettingsImp::SipProfileId() " ) + return iSipProfileId; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusAvaSettingsImp::SetTelNumberL( const TDesC& aTelNumber ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSettingsImp::SetTelNumberL() " ) + MUS_LOG_TDESC( "mus: [MUSAVA] aTelNumber = ", aTelNumber ) + delete iTelNumber; + iTelNumber = NULL ; + iTelNumber = aTelNumber.AllocL(); + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSettingsImp::SetTelNumberL() " ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusAvaSettingsImp::SetContactNameL( const TDesC& aContactName ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSettingsImp::SetContactNameL() " ) + MUS_LOG_TDESC( "mus: [MUSAVA] aContactName = ", aContactName ) + delete iContactName; + iContactName = NULL ; + iContactName = aContactName.AllocL(); + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSettingsImp::SetContactNameL() " ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusAvaSettingsImp::SetSipAddressProposalL( const TDesC& aTelNumber, + const TDesC& aDomain ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSettingsImp::\ + SetSipAddressProposalL( const TDesC& aTelNumber, \ + const TDesC& aDomain ) " ) + _LIT( KAt, "@" ); + + HBufC* buffer = HBufC::NewL( aTelNumber.Length() + + KAt().Length() + + aDomain.Length() ); + buffer->Des().Append( aTelNumber ) ; + buffer->Des().Append( KAt() ); + buffer->Des().Append( aDomain ); + + delete iSipAddressProposal; + iSipAddressProposal = buffer; + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSettingsImp::\ + SetSipAddressProposalL( const TDesC& aTelNumber, \ + const TDesC& aDomain ) " ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusAvaSettingsImp::ReleseTelNumberL() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSettingsImp::ReleseTelNumberL() " ) + delete iTelNumber; + iTelNumber = NULL; + iTelNumber = HBufC::NewL( 0 ); + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSettingsImp::ReleseTelNumberL() " ) + } +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusAvaSettingsImp::SetSipAddressesL( const MDesCArray& aSipAddresses ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSettingsImp::SetSipAddressesL( MDesCArray& aSipAddresses ) " ) + CopyDescArrayL( *iSipAddresses, aSipAddresses ); + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSettingsImp::SetSipAddressesL() " ) + } + +// ----------------------------------------------------------------------------- +// CMusAvaSettingsImp::SetSipAddressesL(CDesCArrayFlat* aSipAddresses ) +// ----------------------------------------------------------------------------- +// +void CMusAvaSettingsImp::SetSipAddressesL( CDesCArray* aSipAddresses ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSettingsImp::SetSipAddressesL(CDesCArrayFlat*) " ) + + iSipAddresses->Reset(); + delete iSipAddresses; + iSipAddresses = aSipAddresses; + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSettingsImp::SetSipAddressesL(CDesCArrayFlat*) " ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusAvaSettingsImp::SetContactId( TInt aContactId ) + { + MUS_LOG1( "mus: [MUSAVA] -> CMusAvaSettingsImp::SetContactId( %d )", aContactId ) + iContactId = aContactId; + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSettingsImp::SetContactId()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusAvaSettingsImp::SetVideoCodecsL( const MDesCArray& aVideoCodecs) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSettingsImp::SetVideoCodecsL( MDesCArray& aVideoCodecs) " ) + CopyDescArrayL( *iVideoCodecs, aVideoCodecs ); + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSettingsImp::SetVideoCodecsL() " ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusAvaSettingsImp::SetAudioCodecsL( MDesCArray& aAudioCodecs ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSettingsImp::SetAudioCodecsL( MDesCArray& aAudioCodecs )" ) + CopyDescArrayL( *iAudioCodecs, aAudioCodecs ); + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSettingsImp::SetAudioCodecsL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusAvaSettingsImp::SetSipProfileId( TInt aSipProfileId ) + { + MUS_LOG1( "mus: [MUSAVA] -> CMusAvaSettingsImp::SetSipProfileId( %d )", aSipProfileId ) + iSipProfileId = aSipProfileId; + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSettingsImp::SetSipProfileId()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusAvaSettingsImp::CopyDescArrayL( CDesCArray& aTarget, + const MDesCArray& aSource ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSettingsImp::CopyDescArrayL(\ + CDesCArrayFlat& aTarget, MDesCArray& aSource )" ) + aTarget.Reset(); + + for( TInt i(0); i CMusAvaSettingsImp::SetObserver" ) + iObserver = &aObserver; + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSettingsImp::SetObserver" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +MMusAvaSettingsObserver* CMusAvaSettingsImp::Observer() + { + return iObserver; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusAvaSettingsImp::SetManualActivation( TManualActivation aManualActivation ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSettingsImp::SetManualActivation" ) + iManualActivation = aManualActivation; + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSettingsImp::SetManualActivation" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +MMusAvaSettingsObserver::TApplicationState CMusAvaSettingsImp::ApplicationState() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSettingsImp::ApplicationState()" ) + MMusAvaSettingsObserver::TApplicationState state( + MMusAvaSettingsObserver::EApplicationStateNotDefined ); + + if( iObserver ) + { + state = iObserver->ApplicationState(); + } + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSettingsImp::ApplicationState()" ) + return state; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CMusAvaSettingsImp::CallDirection() + { + return iCallDirection; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusAvaSettingsImp::SetCallDirection( TInt aDirection ) + { + iCallDirection = aDirection; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusAvaSettingsImp::SetFastMode( MusSettingsKeys::TFastMode aMode ) + { + iFastMode = aMode; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +MusSettingsKeys::TFastMode CMusAvaSettingsImp::FastMode() const + { + return iFastMode; + } + +// ----------------------------------------------------------------------------- +// In case of not having tel number, contact for remote end may be searched +// based on sip uri +// ----------------------------------------------------------------------------- +// +void CMusAvaSettingsImp::SetUriForContactResolvingL( + const TDesC& aRemoteUri ) + { + HBufC* tempResolvingUri = aRemoteUri.AllocL(); + delete iContactResolvingUri; + iContactResolvingUri = tempResolvingUri; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TPtrC CMusAvaSettingsImp::ContactResolvingUri() + { + TPtrC resolvingUri( KNullDesC ); + if ( iContactResolvingUri ) + { + resolvingUri.Set( iContactResolvingUri->Des() ); + } + return resolvingUri; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/src/musavasharedobject.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/src/musavasharedobject.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,174 @@ +/* +* 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: This is client interface class for chared objects MusAvailability Plug-in +* +*/ + + + +// USER +#include "musunittesting.h" +#include "musavasharedobject.h" +#include "musavasip.h" +#include "musavasipobserver.h" +#include "musavaconnectionmonitor.h" +#include "musavanetworkregistrationstatus.h" +#include "musavanetworkmodestatus.h" +#include "muslogger.h" +#include "musavailabilityplugin.hrh" + +// SYSTEM +#include +#include + +CMusAvaSharedObject* CMusAvaSharedObject::iSelf = 0; +TInt CMusAvaSharedObject::iSelfCounter = 0; + +// ----------------------------------------------------------------------------- +// Delete singleton object +// ----------------------------------------------------------------------------- +// +void CMusAvaSharedObject::DeleteSingleton() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSharedObject::DeleteSingleton" ) + iSelfCounter--; + if( !iSelfCounter ) + { + delete iSelf; + iSelf = NULL; + } + MUS_LOG1( "mus: [MUSAVA] <- CMusAvaSharedObject::DeleteSingleton count=%d",\ + iSelfCounter ) + } + +// ----------------------------------------------------------------------------- +// Returns singleton object +// ----------------------------------------------------------------------------- +// +CMusAvaSharedObject* CMusAvaSharedObject::GetSingletonL() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSharedObject::GetSingletonL" ) + if(!iSelf) + { + iSelf = CMusAvaSharedObject::NewL(); + MUS_LOG1( "mus: [MUSAVA] <- CMusAvaSharedObject::GetSingletonL\ + count=%d",iSelfCounter ) + } + else + { + MUS_LOG1( "mus: [MUSAVA] <- CMusAvaSharedObject::GetSingletonL\ + count=%d",iSelfCounter ) + } + iSelfCounter++; + return iSelf; + } + +// ----------------------------------------------------------------------------- +// Two-phased constructor. +// ------------------------------------------------------------------------- +// +CMusAvaSharedObject* CMusAvaSharedObject::NewL( ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSharedObject::NewL" ) + CMusAvaSharedObject* self = new (ELeave) CMusAvaSharedObject; + CleanupStack::PushL (self); + self->ConstructL(); + CleanupStack::Pop( self ); + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSharedObject::NewL" ) + return self; + } + +// ------------------------------------------------------------------------- +// C++ Constructor +// ------------------------------------------------------------------------- +// +CMusAvaSharedObject::CMusAvaSharedObject() + { + + } + +// ------------------------------------------------------------------------- +// Symbian second-phase constructor. +// ------------------------------------------------------------------------- +// +void CMusAvaSharedObject::ConstructL() + { + iMusAvaSip = CMusAvaSip::NewL(); + iConnectionMonitor = CMusAvaConnectionMonitor::NewL( *this ); + iNetworkRegistrationStatus = CMusAvaNetworkRegistrationStatus::NewL( ); + iNetworkModeStatus = CMusAvaNetworkModeStatus::NewL(); + } + +// ----------------------------------------------------------------------------- +// C++ destructor. +// ----------------------------------------------------------------------------- +// +CMusAvaSharedObject::~CMusAvaSharedObject() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSharedObject::~CMusAvaSharedObject" ) + delete iMusAvaSip; + delete iConnectionMonitor; + delete iNetworkRegistrationStatus; + delete iNetworkModeStatus; + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSharedObject::~CMusAvaSharedObject" ) + } + +// ------------------------------------------------------------------------- +// Returns CMusAvaConnectionMonitor object +// ------------------------------------------------------------------------- +// +CMusAvaConnectionMonitor& CMusAvaSharedObject::ConnectionMonitor() + { + return *iConnectionMonitor; + } + +// ------------------------------------------------------------------------- +// Returns CSip object +// ------------------------------------------------------------------------- +// +CSIP& CMusAvaSharedObject::Sip() + { + return iMusAvaSip->Sip(); + } + +// ------------------------------------------------------------------------- +// Returns CMusAvaSip object +// ------------------------------------------------------------------------- +// + CMusAvaSip& CMusAvaSharedObject::MusAvaSip() + { + return *iMusAvaSip; + } +// ------------------------------------------------------------------------- +// Returns CMusAvaNetworkRegistrationStatus object +// ------------------------------------------------------------------------- +// +CMusAvaNetworkRegistrationStatus& CMusAvaSharedObject::MusAvaTelephonyStatus() + { + return *iNetworkRegistrationStatus; + } + +// ------------------------------------------------------------------------- +// Returns CMusAvaNetworkModeStatus object +// ------------------------------------------------------------------------- +// +CMusAvaNetworkModeStatus& CMusAvaSharedObject::NetworkModeStatus() + { + return *iNetworkModeStatus; + } + + + + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/src/musavasip.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/src/musavasip.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,483 @@ +/* +* 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". +* Version : %version: 30.1.5 % << Don't touch! Updated by Synergy at check-out. +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This is main SIP class for MusAvailability Plug-in +* +*/ + + + +// INCLUDE FILES +#include "musavasip.h" +#include "musavasharedobject.h" +#include "musavasipobserver.h" +#include "musavasipconnectionobserver.h" +#include "musavailabilityplugin.hrh" +#include "musavasipprofileregistryobserver.h" +#include "muslogger.h" +#include "mussettingskeys.h" +#include "mussettings.h" +#include "musavaclientresolverutil.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +const TInt KMaxUriLength = 512; + +// ----------------------------------------------------------------------------- +// C++ destructor. +// ----------------------------------------------------------------------------- +// +CMusAvaSip::~CMusAvaSip() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSip::~CMusAvaSip()" ) + // Try to remove client information from CenRep of client resolver. + // This functionality is needed in __VOIP enabled builds. + // In normal build this will fail because of a lack of needed CenRep + // UID. To avoid branching, we just try to do this and let it fail in + // normal build. + MUS_LOG( "mus: [MUSAVA] Deleting CSIPProfile instance" ) + if ( iSipProfile && iClientResolverUtil ) + { + TRAP_IGNORE( + iClientResolverUtil->UnRegisterClientWithUserL( *iSipProfile ) ) + } + delete iSipProfile; + delete iClientResolverUtil; + + MUS_LOG( "mus: [MUSAVA] Deleting CSIPProfileRegistry instance" ) + delete iSipProfileRegistry; + MUS_LOG( "mus: [MUSAVA] Deleting SIP registry observer" ) + delete iSipProfileRegistryObserver; + MUS_LOG( "mus: [MUSAVA] Deleting CSIPConnection instance" ) + delete iSipConnection; + MUS_LOG( "mus: [MUSAVA] Deleting SIP connection observer" ) + delete iSipConnectionObserver; + MUS_LOG( "mus: [MUSAVA] Deleting CSIP instance" ) + delete iSip; + delete iSipObserver; + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSip::~CMusAvaSip()" ) + } + + +// ----------------------------------------------------------------------------- +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CMusAvaSip* CMusAvaSip::NewL() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSip::NewL()" ) + CMusAvaSip* self = new (ELeave) CMusAvaSip(); + CleanupStack::PushL (self); + self->ConstructL(); + CleanupStack::Pop( self ); + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSip::NewL()" ) + return self; + } + + +// ----------------------------------------------------------------------------- +// C++ Constructor +// ----------------------------------------------------------------------------- +// +CMusAvaSip::CMusAvaSip() + { + iSipProfileRegistry = NULL; + iSipProfile = NULL; + iSipConnection = NULL; + } + + +// ----------------------------------------------------------------------------- +// Symbian second-phase constructor. +// ----------------------------------------------------------------------------- +// +void CMusAvaSip::ConstructL() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSip::ConstructL()" ) + // create observer classes (that are not dependant on actual instances) + iSipObserver = CMusAvaSipObserver::NewL(); + iSipConnectionObserver = CMusAvaSipConnectionObserver::NewL(); + iSipProfileRegistryObserver = CMusAvaSipProfileRegistryObserver::NewL(); + + TUid KUidMusAva = { 0x1028238D }; + // create sip instance + iSip = CSIP::NewL( KUidMusAva, *iSipObserver ); + + /** + * Try to instantiate utility object that handles special client resolving + * in __VOIP enabled terminals. In __VOIP disabled terminals creation of + * this object will fail because of missing UID in CenRep and thus this + * pointer can be NULL. If this object does not exist, standard client + * resolving will be used. + */ + TRAP_IGNORE( iClientResolverUtil = CMusAvaClientResolverUtil::NewL() ) + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSip::ConstructL()" ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +void CMusAvaSip::AddAdapterL( MMusAvaSipConnectionAdapter& aAdapter, TInt aIndex ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSip::\ + AddAdapterL( MMusAvaSipConnectionAdapter& aAdapter )" ) + iSipConnectionObserver->AddObserverL( aAdapter, aIndex ); + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSip::\ + AddAdapterL( MMusAvaSipConnectionAdapter& aAdapter )" ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +void CMusAvaSip::RemoveAdapter( MMusAvaSipConnectionAdapter& aAdapter ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSip::\ + RemoceAdapter( MMusAvaSipConnectionAdapter& aAdapter )" ) + iSipConnectionObserver->RemoveObserver( aAdapter ); + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSip::\ + RemoceAdapter( MMusAvaSipConnectionAdapter& aAdapter )" ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +void CMusAvaSip::AddAdapterL( MMusAvaSipAdapter& aAdapter, TInt aIndex ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSip::\ + AddAdapterL( MMusAvaSipAdapter& aAdapter )" ) + iSipObserver->AddObserverL( aAdapter, aIndex ); + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSip::\ + AddAdapterL( MMusAvaSipAdapter& aAdapter )" ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +void CMusAvaSip::RemoveAdapter( MMusAvaSipAdapter& aAdapter ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSip::RemoveAdapter( MMusAvaSipAdapter& aAdapter )" ) + iSipObserver->RemoveObserver( aAdapter ); + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSip::RemoveAdapter( MMusAvaSipAdapter& aAdapter )" ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +void CMusAvaSip::AddAdapterL( MMusAvaSipProfileRegistryAdapter& aAdapter ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSip::\ + AddAdapterL( MMusAvaSipProfileRegistryAdapter& aAdapter )" ) + iSipProfileRegistryObserver->AddAdapterL( aAdapter ); + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSip::\ + AddAdapterL( MMusAvaSipProfileRegistryAdapter& aAdapter )" ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +void CMusAvaSip::RemoveAdapter( MMusAvaSipProfileRegistryAdapter& aAdapter ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSip::\ + RemoveAdapter( MMusAvaSipProfileRegistryAdapter& aAdapter )" ) + iSipProfileRegistryObserver->RemoveAdapter( aAdapter ); + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSip::\ + RemoveAdapter( MMusAvaSipProfileRegistryAdapter& aAdapter )" ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +CSIPConnection* CMusAvaSip::ConnectionL( TBool aForceCreation ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSip::Connection()" ) + if ( aForceCreation ) + { + CreateSIPConnectionL(); + } + __ASSERT_ALWAYS( iSipConnection, User::Leave( KErrSIPInvalidRegistrationState ) ); + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSip::Connection()" ) + return iSipConnection; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +MSIPConnectionObserver& CMusAvaSip::ConnectionObserver() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSip::ConnectionObserver()" ) + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSip::ConnectionObserver()" ) + return *iSipConnectionObserver; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +TBool CMusAvaSip::CreateProfileL() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSip::CreateProfileL()" ) + + TBool retVal = ETrue; + if ( CreateSipProfile() ) + { + TInt err = iSipProfile->GetParameter( KSIPAccessPointId, iIapId ); + if ( err != KErrNone ) + { + MUS_LOG1( "SIP Access Point not found = %d", err ) + retVal = EFalse; + } + } + else + { + retVal = EFalse; + } + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSip::CreateProfileL()" ) + return retVal; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +TBool CMusAvaSip::CreateSipProfile() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSip::CreateSipProfile()" ) + if ( iSipProfile ) + { + MUS_LOG( "mus: [MUSAVA] Profile is already created" ) + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSip::CreateSipProfile()" ) + return ETrue; + } + + CSIPProfileRegistry* registry = NULL; + + //get profile registry + MUS_LOG( "mus: [MUSAVA] Fetch profile registry" ) + TRAPD( error_registry, registry = &ProfileRegistryL() ); + if( error_registry ) + { + MUS_LOG( "mus: [MUSAVA] ProfileRegistry is not created" ) + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSip::CreateSipProfile()" ) + return EFalse; + } + // try to resolve the profile + MUS_LOG( "mus: [MUSAVA] Fetch SIP Profile" ) + TRAPD( error_profile, iSipProfile = GetMusProfileL( *registry ) ); + if( error_profile ) + { + MUS_LOG( "mus: [MUSAVA] Profile is not found" ) + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSip::CreateSipProfile()" ) + return EFalse; + } + else + { + MUS_LOG( "mus: [MUSAVA] Profile is created" ) + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSip::CreateSipProfile()" ) + return ETrue; + } + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +CSIPProfile* CMusAvaSip::Profile() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSip::Profile()" ) + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSip::Profile()" ) + return iSipProfile; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +CSIPProfileRegistry& CMusAvaSip::ProfileRegistryL() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSip::ProfileRegistry()" ) + if ( !iSipProfileRegistry ) + { + MUS_LOG( "mus: [MUSAVA] create sip profile registry" ) + // create sip profile registry + iSipProfileRegistry = CSIPProfileRegistry::NewL( + *iSip, + *iSipProfileRegistryObserver ); + } + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSip::ProfileRegistry()" ) + return *iSipProfileRegistry; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +HBufC* CMusAvaSip::OwnDomainLC() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSip::OwnDomainLC()" ) + + HBufC* domain = KNullDesC().AllocLC(); + if( iSipProfile ) + { + const MDesC8Array* domainNameArray( NULL ); + iSipProfile->GetParameter( KSIPRegisteredAors, domainNameArray ); + + if( domainNameArray ) + { + if( domainNameArray->MdcaCount() > 0 ) + { + TBuf domain16; + const TDesC8& domain8 = domainNameArray->MdcaPoint( 0 ); + + _LIT8( KAt, "@" ); + + TInt index = domain8.Find( KAt() ); + + User::LeaveIfError( + CnvUtfConverter::ConvertToUnicodeFromUtf8( + domain16, + domain8.Mid( index + KAt().Length() ) ) ); + CleanupStack::PopAndDestroy( domain ); + domain = domain16.AllocLC(); + } + } + } + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSip::OwnDomainLC()" ) + return domain; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +CSIP& CMusAvaSip::Sip() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSip::Sip()" ) + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSip::Sip()" ) + return *iSip; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +TInt CMusAvaSip::SipProfileId( TUint32& aSipProfileId ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSip::SipProfile()" ) + //SIP Profile ID + TInt profile_id_err = iSipProfile->GetParameter( KSIPProfileId, aSipProfileId ); + MUS_LOG1( "Profile id = %d", profile_id_err ) + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSip::SipProfile()" ) + return profile_id_err; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +CMusAvaClientResolverUtil* CMusAvaSip::ClientResolverUtil() const + { + return iClientResolverUtil; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +void CMusAvaSip::CreateSIPConnectionL() + { + MUS_LOG1( "mus: [MUSAVA] -> CMusAvaSip::CreateSIPConnectionL(), iapid:%d", + iIapId ) + + if ( !iSipConnection ) + { + iSipConnection = CSIPConnection::NewL( *iSip, + iIapId, + *iSipConnectionObserver ); + } + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSip::CreateSIPConnectionL()" ) + } + + +// --------------------------------------------------------------------------------- +// Gets profile to be used with Mus. +// --------------------------------------------------------------------------------- +// +CSIPProfile* CMusAvaSip::GetMusProfileL( CSIPProfileRegistryBase& aRegistry ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSip::GetMusProfileL" ) + CSIPProfile* profile = NULL; + TUint32 profileId = KErrNone; + + // Try to fetch profileId for profile meant to be used with Mus + TRAPD( err, profileId = + MultimediaSharingSettings::SipProfileSettingL() ); + + if( err != KErrNone || profileId == KErrNone ) + { + MUS_LOG( "mus: [MUSAVA] Using default profile" ) + profile = aRegistry.DefaultProfileL(); + } + else if ( (TInt )profileId == KErrNotFound ) + { + MUS_LOG( "mus: [MUSAVA] Setting: Mus is not allowed to use any \ + SIP profiles" ) + MUS_LOG1( "mus: [MUSAVA] User::Leave( %d )", + KErrNotSupported ) + User::Leave( KErrNotSupported ); + } + else + { + MUS_LOG( "mus: [MUSAVA] Try to fetch profile meant to be used with Mus" ) + profile = aRegistry.ProfileL( profileId ); + err = profile->GetParameter( KSIPProfileId,profileId ); + if( err != KErrNone) + { + MUS_LOG1("mus: [MUSAVA] SIP Profile ID %d",profileId ) + } + } + + // If not possible, use default profile. If not able, leave. + if ( !profile ) + { + MUS_LOG( "mus: [MUSAVA] Not found" ) + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSip::GetMusProfileL" ) + User::Leave( KErrNotFound ); + } + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSip::GetMusProfileL" ) + return profile; + }; + + + + + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/src/musavasipconnectionobserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/src/musavasipconnectionobserver.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,402 @@ +/* +* 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: mussipobserver is SIP API observer class for the MUS availability plug-in. +* +*/ + + + +#include "musunittesting.h" +#include "musavasipconnectionobserver.h" +#include "musavasipconnectionadapter.h" +#include "musavasipdefaulthandler.h" +#include "musavasip.h" +#include "muslogger.h" + +#include +#include +#include +#include + + + + +// ----------------------------------------------------------------------------- +// Two-phased constructor. +// ----------------------------------------------------------------------------- +CMusAvaSipConnectionObserver* CMusAvaSipConnectionObserver::NewL() + { + CMusAvaSipConnectionObserver* self = + new( ELeave ) CMusAvaSipConnectionObserver(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +// Destructor +CMusAvaSipConnectionObserver::~CMusAvaSipConnectionObserver() + { + delete iDefaultHandler; + iObservers.Reset(); + iObservers.Close(); + } + + +// ----------------------------------------------------------------------------- +// A SIP request outside a dialog has been received from the network. +// ----------------------------------------------------------------------------- +void CMusAvaSipConnectionObserver::IncomingRequest( + CSIPServerTransaction* aTransaction ) + { + for( TInt i=0; iIncomingRequest( aTransaction ); + if( retval == KErrNone) + { + return; + } + } + } + + +// ----------------------------------------------------------------------------- +// A SIP request within a dialog has been received from the network. +// ----------------------------------------------------------------------------- +void CMusAvaSipConnectionObserver::IncomingRequest( + CSIPServerTransaction* aTransaction, + CSIPDialog& aSIPDialog ) + + { + for( TInt i=0; iIncomingRequest( aTransaction, aSIPDialog ); + if( retval == KErrNone) + { + return; + } + } + } + + +// ----------------------------------------------------------------------------- +// A SIP response that is within a dialog association or creates a +// dialog association. +// ----------------------------------------------------------------------------- +void CMusAvaSipConnectionObserver::IncomingResponse( + CSIPClientTransaction& aTransaction ) + { + for( TInt i=0; iIncomingResponse( aTransaction ); + if( retval == KErrNone) + { + return; + } + } + } + + +// ----------------------------------------------------------------------------- +// A SIP response that is within a dialog association or creates a +// dialog association. +// ----------------------------------------------------------------------------- +void CMusAvaSipConnectionObserver::IncomingResponse( + CSIPClientTransaction& aTransaction, + CSIPDialogAssocBase& aDialogAssoc) + { + for( TInt i=0; iIncomingResponse( aTransaction, aDialogAssoc ); + if( retval == KErrNone) + { + return; + } + } + } + + +// ----------------------------------------------------------------------------- +// Multiple SIP responses have been received to the single INVITE. +// ----------------------------------------------------------------------------- +void CMusAvaSipConnectionObserver::IncomingResponse( + CSIPClientTransaction& aTransaction, + CSIPInviteDialogAssoc* aDialogAssoc ) + { + for( TInt i=0; iIncomingResponse( aTransaction, aDialogAssoc ); + if( retval == KErrNone) + { + return; + } + } + } + + +// ----------------------------------------------------------------------------- +// SIP stack has completed UAC core INVITE transaction. +// ----------------------------------------------------------------------------- +void CMusAvaSipConnectionObserver::InviteCompleted( + CSIPClientTransaction& aTransaction ) + { + for( TInt i=0; iInviteCompleted( aTransaction ); + if( retval == KErrNone) + { + return; + } + } + } + + +// ----------------------------------------------------------------------------- +// A SIP response creating a registration binding or an error response +// that is related to an existing refreshed registration binding has +// been received from the network. +// ----------------------------------------------------------------------------- +void CMusAvaSipConnectionObserver::IncomingResponse( + CSIPClientTransaction& aTransaction, + CSIPRegistrationBinding& aRegistration ) + { + for( TInt i=0; iIncomingResponse( aTransaction, aRegistration ); + if( retval == KErrNone) + { + return; + } + } + } + + +// ----------------------------------------------------------------------------- +// An asynchronous error has occurred in the stack related to the +// request indicated by the given transaction. +// ----------------------------------------------------------------------------- +void CMusAvaSipConnectionObserver::ErrorOccured( + TInt aError, + CSIPTransactionBase& aTransaction ) + { + for( TInt i=0; iErrorOccured( aError, aTransaction ); + if( retval == KErrNone) + { + return; + } + } + } + + +// ----------------------------------------------------------------------------- +// An asynchronous error has occurred in the stack related to the +// request indicated by the given transaction. +// ----------------------------------------------------------------------------- +void CMusAvaSipConnectionObserver::ErrorOccured( + TInt aError, + CSIPClientTransaction& aTransaction, + CSIPRegistrationBinding& aRegistration ) + { + for( TInt i=0; iErrorOccured( aError, aTransaction, aRegistration ); + if( retval == KErrNone) + { + return; + } + } + } + + +// ----------------------------------------------------------------------------- +// An asynchronous error has occured related to a request within an +// existing dialog. +// ----------------------------------------------------------------------------- +void CMusAvaSipConnectionObserver::ErrorOccured( + TInt aError, + CSIPTransactionBase& aSIPTransactionBase, + CSIPDialogAssocBase& aSIPDialogAssociation ) + { + for( TInt i=0; iErrorOccured( aError, + aSIPTransactionBase, + aSIPDialogAssociation ); + if( retval == KErrNone) + { + return; + } + } + } + + +// ----------------------------------------------------------------------------- +// An asynchronous error has occured related to a refresh. +// ----------------------------------------------------------------------------- +void CMusAvaSipConnectionObserver::ErrorOccured( TInt aError, + CSIPRefresh& aSIPRefresh ) + { + for( TInt i=0; iErrorOccured( aError, aSIPRefresh ); + if( retval == KErrNone) + { + return; + } + } + } + + +// ----------------------------------------------------------------------------- +// An asynchronous error has occured related to a periodical refresh +// that relates to a registration. +// ----------------------------------------------------------------------------- +void CMusAvaSipConnectionObserver::ErrorOccured( + TInt aError, + CSIPRegistrationBinding& aRegistration ) + { + for( TInt i=0; iErrorOccured( aError, aRegistration ); + if( retval == KErrNone) + { + return; + } + } + } + + +// ----------------------------------------------------------------------------- +// An asynchronous error has occured related to a periodical refresh +// that belongs to SIP dialog association. +// ----------------------------------------------------------------------------- +void CMusAvaSipConnectionObserver::ErrorOccured( + TInt aError, + CSIPDialogAssocBase& aSIPDialogAssociation ) + { + for( TInt i=0; iErrorOccured( aError, aSIPDialogAssociation ); + if( retval == KErrNone) + { + return; + } + } + } + + +// ----------------------------------------------------------------------------- +// Invite was canceled with the CANCEL +// ----------------------------------------------------------------------------- +void CMusAvaSipConnectionObserver::InviteCanceled( + CSIPServerTransaction& aTransaction ) + { + for( TInt i=0; iInviteCanceled( aTransaction ); + if( retval == KErrNone) + { + return; + } + } + } + + +// ----------------------------------------------------------------------------- +// Is called when the connection state changes +// ----------------------------------------------------------------------------- +void CMusAvaSipConnectionObserver::ConnectionStateChanged ( + CSIPConnection::TState aState ) + { + for( TInt i=0; iConnectionStateChanged( aState ); + if( retval == KErrNone) + { + return; + } + } + } + +// ----------------------------------------------------------------------------- +// C++ default constructor. +// ----------------------------------------------------------------------------- +CMusAvaSipConnectionObserver::CMusAvaSipConnectionObserver() + { + } + + +// ----------------------------------------------------------------------------- +// Symbian 2nd phase constructor. +// ----------------------------------------------------------------------------- +void CMusAvaSipConnectionObserver::ConstructL() + { + iDefaultHandler = new( ELeave ) CMusAvaSipDefaultHandler(); + iObservers.AppendL( iDefaultHandler ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +void CMusAvaSipConnectionObserver::AddObserverL( + MMusAvaSipConnectionAdapter& aAdapter, + TInt aIndex ) + { + TInt index = iObservers.Find( &aAdapter ); + + if( index == KErrNotFound ) + { + TInt count = iObservers.Count(); + if ( aIndex > KErrNotFound && aIndex < iObservers.Count() ) + { + iObservers.InsertL( &aAdapter, aIndex ); + } + else + { + iObservers.InsertL( &aAdapter, count-1 ); + } + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +void CMusAvaSipConnectionObserver::RemoveObserver( MMusAvaSipConnectionAdapter& aAdapter ) + { + TInt index = iObservers.Find( &aAdapter ); + + if( index != KErrNotFound ) + { + iObservers.Remove( index ); + } + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/src/musavasipheaderutil.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/src/musavasipheaderutil.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,231 @@ +/* +* Copyright (c) 2005-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: Utility class to add sip headers. This class will just have +* static utility functions. +* +*/ + + +#include "musavasipheaderutil.h" +#include "muscleanupresetanddestroy.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "sipextensionheader.h" +#include +#include +#include +#include +#include +#include +#include + +#include "muslogger.h" + +// -------------------------------------------------------------------------- +// CMusAvaSipheaderUtil::AddAcceptContactHeaderL +// -------------------------------------------------------------------------- +// +void CMusAvaSipheaderUtil::AddAcceptContactHeaderL( + RPointerArray& aRequestHeaders, + const RStringF& aFeatureTag ) + { + MUS_LOG("mus: [MUSAVA] -> CMusAvaSipheaderUtil::AddAcceptContactHeaderL" ) + CSIPAcceptContactHeader* header = CSIPAcceptContactHeader::NewLC(); + header->SetParamL( aFeatureTag ); + header->SetParamL( SIPStrings::StringF( SipStrConsts::EExplicit ) ); + aRequestHeaders.AppendL( header ); // ownership transferred. + CleanupStack::Pop( header ); + MUS_LOG("mus: [MUSAVA] <- CMusAvaSipheaderUtil::AddAcceptContactHeaderL" ) + } + + +// -------------------------------------------------------------------------- +// CMusAvaSipheaderUtil::AddAcceptEncodingHeaderL +// -------------------------------------------------------------------------- +// +void CMusAvaSipheaderUtil::AddAcceptEncodingHeaderL( + RPointerArray& aRequestHeaders ) + { + MUS_LOG("mus: [MUSAVA] -> CMusAvaSipheaderUtil::AddAcceptEncodingHeaderL" ) + _LIT8(KHeader,"gzip"); + RPointerArray + headers(CSIPAcceptEncodingHeader::DecodeL(KHeader)); + MusCleanupResetAndDestroyPushL(headers); + + TInt count = headers.Count(); + CSIPHeaderBase* header = NULL;; + TInt status = NULL; + + for (TInt i=0; i < count; i++) + { + header = headers[i]; + status = aRequestHeaders.Append(header); + if ( status != KErrNone ) + { + header = NULL; + } + else + { + headers.Remove( i ); + } + } + CleanupStack::PopAndDestroy( &headers ); + MUS_LOG("mus: [MUSAVA] <- CMusAvaSipheaderUtil::AddAcceptEncodingHeaderL" ) + } + + +// -------------------------------------------------------------------------- +// CMusAvaSipheaderUtil::AddAcceptLanguageHeaderL +// -------------------------------------------------------------------------- +// +void CMusAvaSipheaderUtil::AddAcceptLanguageHeaderL( + RPointerArray& aRequestHeaders ) + { + MUS_LOG("mus: [MUSAVA] -> CMusAvaSipheaderUtil::AddAcceptLanguageHeaderL" ) + _LIT8(KHeader,"en"); + RPointerArray + headers(CSIPAcceptLanguageHeader::DecodeL(KHeader)); + MusCleanupResetAndDestroyPushL(headers); + + TInt count = headers.Count(); + CSIPHeaderBase* header = NULL;; + TInt status = NULL; + + for (TInt i=0; i < count; i++) + { + header = headers[i]; + status = aRequestHeaders.Append(header); + if ( status != KErrNone ) + { + header = NULL; + } + else + { + headers.Remove( i ); + } + } + CleanupStack::PopAndDestroy( &headers ); + MUS_LOG("mus: [MUSAVA] <- CMusAvaSipheaderUtil::AddAcceptLanguageHeaderL" ) + } + +// -------------------------------------------------------------------------- +// CMusAvaSipheaderUtil::AddSdpL +// -------------------------------------------------------------------------- +// +void CMusAvaSipheaderUtil::AddSdpL( CSIPRequestElements* aRequest, + HBufC8* aContent ) + { + MUS_LOG("mus: [MUSAVA] -> CMusAvaSipheaderUtil::AddSdpL" ) + _LIT8(contentType,"application/sdp"); + CSIPContentTypeHeader* type = CSIPContentTypeHeader::DecodeL( + contentType); + CleanupStack::PushL( type ); + CSIPMessageElements& messageElements = aRequest->MessageElements(); + messageElements.SetContentL(aContent,type); + CleanupStack::Pop( type );//Ownership transferred + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSipheaderUtil::AddSdpL" ) + } + +// -------------------------------------------------------------------------- +// CMusAvaSipheaderUtil::AddPreferredIdentityHeaderL +// -------------------------------------------------------------------------- +// +void CMusAvaSipheaderUtil::AddPreferredIdentityHeaderL( + RPointerArray& aRequestHeaders, + const TDesC8& aVal ) + { + MUS_LOG_TDESC8( " mus: [MUSAVA] -> CMusAvaSipheaderUtil::\ + AddPreferredIdentityHeaderL", aVal); + _LIT8(KHeader,"P-Preferred-Identity"); + CSIPExtensionHeader* header = CSIPExtensionHeader::NewLC( + KHeader,aVal) ; + aRequestHeaders.AppendL( header ); + CleanupStack::Pop( header );//Ownership transferred. + MUS_LOG("mus: [MUSAVA] <- CMusAvaSipheaderUtil::AddPreferredIdentityHeaderL") + } + +// ---------------------------------------------------------------------------- +// MusAvaCapabilityContext::LocalHostL +// ---------------------------------------------------------------------------- +// +void CMusAvaSipheaderUtil::LocalHostL(const CSIPConnection& aConn, + TPtrC8& aLocalHost) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSipheaderUtil::LocalHostL" ) + RStringPool strPool = SdpCodecStringPool::StringPoolL(); + TInetAddr aAddr(0); + aConn.GetLocalAddrL(aAddr); + TBuf<50> ipAddress; + aAddr.Output(ipAddress); + MUS_LOG_TDESC( "mus: [MUSAVA] ipAddress",ipAddress ) + HBufC8 * ipaddr8=HBufC8::NewLC(ipAddress.Length()); + ipaddr8->Des().Copy(ipAddress); + aLocalHost.Set( *ipaddr8 ); + CleanupStack::PopAndDestroy(1);//ipaddr8 + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSipheaderUtil::LocalHostL" ) + } + + +// -------------------------------------------------------------------------- +// CMusAvaSipheaderUtil::AddAcceptSdpHeaderL +// -------------------------------------------------------------------------- +// +void CMusAvaSipheaderUtil::AddAcceptSdpHeaderL( + RPointerArray& aRequestHeaders ) + { + MUS_LOG("mus: [MUSAVA] -> CMusAvaSipheaderUtil::AddAcceptSDPHeaderL" ) + _LIT8(KHeader,"application/sdp"); + RPointerArray headers(CSIPAcceptHeader::DecodeL(KHeader)); + MusCleanupResetAndDestroyPushL(headers); + + TInt count = headers.Count(); + CSIPHeaderBase* header = NULL;; + TInt status = NULL; + + for (TInt i=0; i < count; i++) + { + header = headers[i]; + status = aRequestHeaders.Append(header); + if ( status != KErrNone ) + { + header = NULL; + } + else + { + headers.Remove( i ); + } + } + CleanupStack::PopAndDestroy( &headers ); + MUS_LOG( + "mus: [MUSAVA] <- CMusAvaSipheaderUtil::AddAcceptSDPHeaderL" ) + } + + + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/src/musavasipobserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/src/musavasipobserver.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,136 @@ +/* +* 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: Implementation class is used to get function call from SIP Server. +* +*/ + + + +#include "musavasipobserver.h" +#include "musavasipadapter.h" + +#include +#include +// ----------------------------------------------------------------------------- +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CMusAvaSipObserver* CMusAvaSipObserver::NewL() + { + CMusAvaSipObserver* self = new (ELeave) CMusAvaSipObserver(); + CleanupStack::PushL (self); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// C++ destructor. +// ----------------------------------------------------------------------------- +// +CMusAvaSipObserver::~CMusAvaSipObserver() + { + iObservers.Reset(); + iObservers.Close(); + } + +// ----------------------------------------------------------------------------- +// Symbian second-phase constructor. +// ----------------------------------------------------------------------------- +// +void CMusAvaSipObserver::ConstructL() + { + } + +// ----------------------------------------------------------------------------- +// C++ constructor. +// ----------------------------------------------------------------------------- +// +CMusAvaSipObserver::CMusAvaSipObserver() + { + } + +// ----------------------------------------------------------------------------- +// A SIP request has been received from the network. +// ----------------------------------------------------------------------------- +// +void CMusAvaSipObserver::IncomingRequest( + TUint32 aIapId, + CSIPServerTransaction* aTransaction ) + { + for( TInt i=0; iIncomingRequest( aIapId, + aTransaction ); + if( retval == KErrNone) + { + return; + } + } + delete aTransaction; + } +// ----------------------------------------------------------------------------- +// The received SIP request time-outed and it is invalid i.e. cannot be used +// anymore. +// ----------------------------------------------------------------------------- +// +void CMusAvaSipObserver::TimedOut(CSIPServerTransaction& aTransaction ) + { + for( TInt i=0; iTimedOut( aTransaction ); + if( retval == KErrNone) + { + return; + } + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusAvaSipObserver::AddObserverL( MMusAvaSipAdapter& aAdapter, TInt aIndex ) + { + TInt index = iObservers.Find( &aAdapter ); + + if( index == KErrNotFound ) + { + if ( aIndex > KErrNotFound && aIndex < iObservers.Count() ) + { + iObservers.InsertL( &aAdapter, aIndex ); + } + else + { + iObservers.AppendL( &aAdapter ); + } + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusAvaSipObserver::RemoveObserver( MMusAvaSipAdapter& aAdapter ) + { + TInt index = iObservers.Find( &aAdapter ); + + if( index != KErrNotFound ) + { + iObservers.Remove( index ); + } + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/src/musavasipprofileavailability.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/src/musavasipprofileavailability.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,187 @@ +/* +* Copyright (c) 2005-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: This class just checks whether videosharing sip profile exist +* +*/ + + + +#include "musavasipprofileavailability.h" +#include "musavaavailabilityobserver.h" +#include "musunittesting.h" +#include "musavaobserver.h" +#include "musavaavailability.h" +#include "musavasharedobject.h" +#include "muslogger.h" +#include "musavasip.h" +#include + + + +// -------------------------------------------------------------------------- +// Symbian two-phase constructor +// -------------------------------------------------------------------------- +// +CMusAvaSipprofileAvailability* CMusAvaSipprofileAvailability::NewL( + MMusAvaAvailabilityObserver& aObserver) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSipprofileAvailability::NewL " ) + CMusAvaSipprofileAvailability* self = + CMusAvaSipprofileAvailability::NewLC( + aObserver); + CleanupStack::Pop( self ); + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSipprofileAvailability::NewL " ) + return self; + } + + +// ------------------------------------------------------------------------- +// Two-phased constructor. +// ------------------------------------------------------------------------- +// +CMusAvaSipprofileAvailability* CMusAvaSipprofileAvailability::NewLC( + MMusAvaAvailabilityObserver& aObserver) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSipprofileAvailability::NewLC " ) + CMusAvaSipprofileAvailability* self = + new (ELeave) CMusAvaSipprofileAvailability( + aObserver); + CleanupStack::PushL (self); + self->ConstructL(); + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSipprofileAvailability::NewLC " ) + return self; + } + + +// --------------------------------------------------------------------------- +// Destructor. +// --------------------------------------------------------------------------- +// +CMusAvaSipprofileAvailability::~CMusAvaSipprofileAvailability() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSipprofileAvailability::\ + ~CMusAvaSipprofileAvailability " ) + if( iSharedObj )iSharedObj->DeleteSingleton(); + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSipprofileAvailability::\ + ~CMusAvaSipprofileAvailability " ) + + } + + +// --------------------------------------------------------------------------- +// Symbian 2nd phase constructor can leave. +// --------------------------------------------------------------------------- +// +void CMusAvaSipprofileAvailability::ConstructL() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSipprofileAvailability::ConstructL " ) + iSharedObj = CMusAvaSharedObject::GetSingletonL(); + SetProfileState(); + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSipprofileAvailability::ConstructL " ) + } + + +// ------------------------------------------------------------------------- +// Constructor. +// ------------------------------------------------------------------------- +// +CMusAvaSipprofileAvailability::CMusAvaSipprofileAvailability( + MMusAvaAvailabilityObserver& aObserver) + :CMusAvaAvailability( aObserver ) + { + } + + +// ------------------------------------------------------------------------- +// Executes for the master - salve pattern. +// ------------------------------------------------------------------------- +// +void CMusAvaSipprofileAvailability::DoExecuteL() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSipprofileAvailability::DoExecuteL " ) + SetProfileState(); + SetState( iState ); + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSipprofileAvailability::DoExecuteL " ) + } + + +// ------------------------------------------------------------------------- +// Stop the execution. +// ------------------------------------------------------------------------- +// +void CMusAvaSipprofileAvailability::Stop() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSipprofileAvailability::Stop" ) + SetState( MMusAvaObserver::EMusAvaStatusNotExecuted ); + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSipprofileAvailability::Stop" ) + } + + +// ------------------------------------------------------------------------- +// CMusAvaSipprofileAvailability::Name +// +// ------------------------------------------------------------------------- +// +MMusAvaObserver::TAvailabilityName CMusAvaSipprofileAvailability::Name() + { + return MMusAvaObserver::EMusAvaNameSipprofileExist; + } + +// ------------------------------------------------------------------------- +// CMusAvaSipprofileAvailability::IsProfileExist. +// ------------------------------------------------------------------------- +// +TBool CMusAvaSipprofileAvailability::IsProfileExist() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSipprofileAvailability::IsProfileExist ") + TBool bExist = EFalse ; + if ( iSharedObj->MusAvaSip().CreateSipProfile() ) + { + TUint32 profileId; + TInt err = iSharedObj->MusAvaSip().SipProfileId( profileId ); + if( err == KErrNotFound ) + { + MUS_LOG( "mus: [MUSAVA] No Sip profile " ) + bExist = EFalse ; + } + else + { + MUS_LOG( "mus: [MUSAVA] Fetch profile " ) + bExist = ETrue ; + } + } + MUS_LOG1( "mus: [MUSAVA] <- CMusAvaSipprofileAvailability::IsProfileExist\ + = %d",bExist) + return bExist; + } + + +// ------------------------------------------------------------------------- +// CMusAvaSipprofileAvailability::SetProfileState +// +// ------------------------------------------------------------------------- +// +void CMusAvaSipprofileAvailability::SetProfileState() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSipprofileAvailability::SetProfileState ") + if ( IsProfileExist() ) + { + iState = MMusAvaObserver::EMusAvaStatusAvailable; + } + else + { + iState = MMusAvaObserver::EMusAvaStatusNoSipProfile ; + } + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSipprofileAvailability::SetProfileState ") + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/src/musavasipprofileregistryobserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/src/musavasipprofileregistryobserver.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,102 @@ +/* +* 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: mussipobserver is SIP API observer class for the MUS availability plug-in. +* +*/ + + + +#include "musavasipprofileregistryobserver.h" +#include "musavasipprofileregistryadapter.h" +#include "muslogger.h" + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +CMusAvaSipProfileRegistryObserver* CMusAvaSipProfileRegistryObserver::NewL() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSipProfileRegistryObserver::NewL" ) + CMusAvaSipProfileRegistryObserver* self + = new( ELeave ) CMusAvaSipProfileRegistryObserver(); + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSipProfileRegistryObserver::NewL" ) + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +CMusAvaSipProfileRegistryObserver::~CMusAvaSipProfileRegistryObserver() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSipProfileRegistryObserver::~CMusAvaSipProfileRegistryObserver" ) + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSipProfileRegistryObserver::~CMusAvaSipProfileRegistryObserver" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +void CMusAvaSipProfileRegistryObserver::AddAdapterL( MMusAvaSipProfileRegistryAdapter& aAdapter ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSipProfileRegistryObserver::AddAdapter" ) + iAdapter = &aAdapter; + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSipProfileRegistryObserver::AddAdapter" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +void CMusAvaSipProfileRegistryObserver::RemoveAdapter( MMusAvaSipProfileRegistryAdapter& aAdapter ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSipProfileRegistryObserver::RemoveAdapter" ) + if ( iAdapter == &aAdapter ) + { + iAdapter = NULL; + } + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSipProfileRegistryObserver::RemoveAdapter" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +void CMusAvaSipProfileRegistryObserver::ProfileRegistryEventOccurred(TUint32 aProfileId, + TEvent aEvent) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSipProfileRegistryObserver::ProfileRegistryEventOccurred" ) + if ( iAdapter ) + { + iAdapter->ProfileRegistryEventOccurred( aProfileId, aEvent ); + } + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSipProfileRegistryObserver::ProfileRegistryEventOccurred" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +void CMusAvaSipProfileRegistryObserver::ProfileRegistryErrorOccurred(TUint32 aProfileId, + TInt aError) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaSipProfileRegistryObserver::ProfileRegistryErrorOccurred" ) + if ( iAdapter ) + { + iAdapter->ProfileRegistryErrorOccurred( aProfileId, aError ); + } + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSipProfileRegistryObserver::ProfileRegistryErrorOccurred" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +CMusAvaSipProfileRegistryObserver::CMusAvaSipProfileRegistryObserver() + { + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/src/musavatelephonystatusbase.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/src/musavatelephonystatusbase.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,129 @@ +/* +* Copyright (c) 2005-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: Provide interface for the client requestin availability class. +* +*/ + + +#include "musavatelephonystatusbase.h" +#include "musavatelephonystatusobserver.h" +#include "musavaavailability.h" +#include "musunittesting.h" +#include "muslogger.h" + +#include + + +// ------------------------------------------------------------------------- +// Destructor. +// ------------------------------------------------------------------------- +// +CMusAvaTelephonyStatusBase::~CMusAvaTelephonyStatusBase() + { + CActive::Cancel(); + } + +// ----------------------------------------------------------------------------- +// Adds new observer +// ----------------------------------------------------------------------------- +void CMusAvaTelephonyStatusBase::AddAdapterL( MMusAvaTelephonyStatusObserver& aAdapter ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaTelephonyStatusBase::\ + AddAdapterL( MMusAvaTelephonyStatusObserver& aAdapter )" ) + iObserver.AppendL( &aAdapter ); + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSip::\ + AddAdapterL( MMusAvaTelephonyStatusObserver& aAdapter )" ) + } + + +// ------------------------------------------------------------------------- +// Reads the telephony status. +// ------------------------------------------------------------------------- +// +void CMusAvaTelephonyStatusBase::TelephonyStatus() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaTelephonyStatusBase::TelephonyStatus()" ) + + MUS_LOG( "mus: [MUSAVA] -> CMusAvaTelephonyStatusBase::TelephonyStatus()" ) + } + +// ----------------------------------------------------------------------------- +// Removes the adapter +// ----------------------------------------------------------------------------- +void CMusAvaTelephonyStatusBase::RemoveAdapter( + MMusAvaTelephonyStatusObserver& aAdapter ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaTelephonyStatusBase::\ + RemoveAdapter( MMusAvaTelephonyStatusObserver& aAdapter )" ) + TInt index = iObserver.Find( &aAdapter ); + + if( index != KErrNotFound ) + { + iObserver.Remove( index ); + } + + if( iObserver.Count() == 0 ) + { + CActive::Cancel(); + } + MUS_LOG( "mus: [MUSAVA] <- CMusAvaSip::\ + RemoveAdapter( MMusAvaTelephonyStatusObserver& aAdapter )" ) + } +// ------------------------------------------------------------------------- +// Derived from CActive. +// ------------------------------------------------------------------------- +// +void CMusAvaTelephonyStatusBase::RunL() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaTelephonyStatusBase::RunL()" ) + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaTelephonyStatusBase::RunL()" ) + } + +// ------------------------------------------------------------------------- +// Derived from CActive. Called after somebody calls Cancel; +// ------------------------------------------------------------------------- +// +void CMusAvaTelephonyStatusBase::DoCancel() + { + + } + +// ------------------------------------------------------------------------- +// If RunL() leaves,It should be handled here. +// ------------------------------------------------------------------------- +// +TInt CMusAvaTelephonyStatusBase::RunError( TInt aError ) + { + MUS_LOG1( "mus: [MUSAVA] -> CMusAvaTelephonyStatusBase::\ + RunError() return #%d", aError ) + + // Nothing can be done here. + aError = KErrNone; + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaTelephonyStatusBase::RunError()" ) + return aError; + } + +// ------------------------------------------------------------------------- +// Constructor function. +// ------------------------------------------------------------------------- +// +CMusAvaTelephonyStatusBase::CMusAvaTelephonyStatusBase( ) + : CActive( EPriorityStandard ) + { + CActiveScheduler::Add( this ); + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/src/musavaterminal.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/src/musavaterminal.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,616 @@ +/* +* Copyright (c) 2005-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: Discovered terminal +* +*/ + + +#include "musavaterminal.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "muslogger.h" +#include "musavacapabilityexchange.h" +#include "musavacapability.h" +#include "musavacapabilityquerybase.h" +#include "musavacapabilitycontext.h" +#include "mmusavacapabilityqueryobserver.h" +#include "mussettings.h" +#include "mussettingskeys.h" +#include "musavasipheaderutil.h" + +// -------------------------------------------------------------------------- +// Symbian two-phase constructor +// -------------------------------------------------------------------------- +// +CMusAvaTerminal* CMusAvaTerminal::NewL( CMusAvaCapabilityExchange& aExchange, + const TDesC8& aTerminalUri, + const TDesC8& aTerminalId ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaTerminal::NewL" ) + CMusAvaTerminal* self = new (ELeave) CMusAvaTerminal( aExchange ); + CleanupStack::PushL( self ); + self->ConstructL( aTerminalUri, aTerminalId ); + CleanupStack::Pop( self ); + MUS_LOG( "mus: [MUSAVA] <- CMusAvaTerminal::NewL" ) + return self; + } + + +// -------------------------------------------------------------------------- +// C++ destructor +// -------------------------------------------------------------------------- +// +CMusAvaTerminal::~CMusAvaTerminal() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaTerminal::~CMusAvaTerminal" ) + + ResetAndDestroyQuery(); + + delete iUri; + delete iTerminalId; + iRequestedQuery = NULL; + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaTerminal::~CMusAvaTerminal" ) + } + +// -------------------------------------------------------------------------- +// C++ constructor +// -------------------------------------------------------------------------- +// +CMusAvaTerminal::CMusAvaTerminal( CMusAvaCapabilityExchange& aExchange ) + : iExchange( aExchange ) + { + } + + +// -------------------------------------------------------------------------- +// Symbian second-phase constructor +// -------------------------------------------------------------------------- +// +void CMusAvaTerminal::ConstructL( const TDesC8& aTerminalUri, + const TDesC8& aTerminalId ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaTerminal::ConstructL" ) + + MUS_LOG_TDESC8( "mus: [MUSAVA] - CMusAvaTerminal::Id ",aTerminalId) + MUS_LOG_TDESC8( "mus: [MUSAVA] - CMusAvaTerminal::MatchL Uri",aTerminalUri ) + iUri = aTerminalUri.AllocL(); + iTerminalId = aTerminalId.AllocL(); + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaTerminal::ConstructL" ) + } + + +// -------------------------------------------------------------------------- +// CMusAvaTerminal::Id +// -------------------------------------------------------------------------- +// +const TDesC8& CMusAvaTerminal::Id() const + { + return *iTerminalId; + } + + +// -------------------------------------------------------------------------- +// CMusAvaTerminal::ToUriL +// -------------------------------------------------------------------------- +// +const TDesC8& CMusAvaTerminal::Uri() const + { + return *iUri; + } + + +// -------------------------------------------------------------------------- +// CMusAvaTerminal::MacthL +// -------------------------------------------------------------------------- +// +TBool CMusAvaTerminal::MatchL( const TDesC8& aTerminalUri, + const TDesC8& aTerminalId ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaTerminal::MatchL" ) + TBool match = EFalse; + TBool useDoubleKeyMatch = Id().Length() > 0 && aTerminalId.Length() > 0; + + MUS_LOG_TDESC8( "mus: [MUSAVA] - CMusAvaTerminal::MatchL aTerminalId ",aTerminalId ) + MUS_LOG_TDESC8( "mus: [MUSAVA] - CMusAvaTerminal::MatchL aTerminalUri ",aTerminalUri ) + if ( useDoubleKeyMatch ) + { + match = Uri().Compare( aTerminalUri ) == 0 && + Id().CompareF( aTerminalId ) == 0; + } + else //not known yet or no terminal id in request i.e. best guess + { + match = Uri().Compare( aTerminalUri ) == 0; + } + + if ( match ) + { + AttachUriL( aTerminalUri ); + AttachIdL( aTerminalId ); + } + + MUS_LOG1( "mus: [MUSAVA] <- CMusAvaTerminal::MatchL = %d",match ) + return match; + } + + +// -------------------------------------------------------------------------- +// CMusAvaTerminal::RequestedQuery +// -------------------------------------------------------------------------- +// +const CMusAvaCapability* CMusAvaTerminal::RequestedQuery() const + { + return iRequestedQuery; + } + + +// -------------------------------------------------------------------------- +// CMusAvaTerminal::ExecuteQueryL +// -------------------------------------------------------------------------- +// +void CMusAvaTerminal::ExecuteQueryL( CMusAvaCapabilityQueryBase* aQuery ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaTerminal::ExecuteQueryL" ) + + __ASSERT_ALWAYS( aQuery , User::Leave( KErrArgument ) ); + __ASSERT_ALWAYS( + aQuery->State() == CMusAvaCapabilityQueryBase::ECapabilityQueryCreated, + User::Leave( KErrArgument ) ); + __ASSERT_ALWAYS( !iQuery, User::Leave( KErrAlreadyExists ) ); + + ResetAndDestroyQuery(); + + aQuery->ExecuteL(); + + iQuery = aQuery; + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaTerminal::ExecuteQueryL" ) + } + + +// -------------------------------------------------------------------------- +// CMusAvaTerminal::QueryCompletedL +// -------------------------------------------------------------------------- +// +TBool CMusAvaTerminal::QueryCompletedL( const CSIPClientTransaction& aResponse ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaTerminal::QueryCompletedL" ) + TBool consumed = EFalse; + + if ( iQuery && iQuery->State() != + CMusAvaCapabilityQueryBase::ECapabilityQueryCompleted ) + { + iQuery->CompletedL( aResponse ); + consumed = iQuery->State() == + CMusAvaCapabilityQueryBase::ECapabilityQueryCompleted; + + if ( consumed ) + { + const CSIPExtensionHeader* userAgent = + MusAvaCapabilityContext::UserAgentHeaderL( aResponse ); + if ( userAgent ) + { + AttachIdL( userAgent->Value() ); + } + } + } + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaTerminal::QueryCompletedL" ) + + return consumed; + } + + +// -------------------------------------------------------------------------- +// CMusAvaTerminal::QueryCanceled +// -------------------------------------------------------------------------- +// +TBool CMusAvaTerminal::QueryCanceled( + const CSIPClientTransaction& aTransaction ) + { + TBool consumed = EFalse; + if ( iQuery && iQuery->State() != + CMusAvaCapabilityQueryBase::ECapabilityQueryCompleted ) + { + iQuery->Canceled( aTransaction ); + consumed = iQuery->State() == + CMusAvaCapabilityQueryBase::ECapabilityQueryCompleted; + } + return consumed; + } + + +// -------------------------------------------------------------------------- +// CMusAvaTerminal::QueryExecuting +// -------------------------------------------------------------------------- +// +TBool CMusAvaTerminal::QueryExecuting() + { + TBool executing = EFalse; + if ( iQuery && iQuery->State() == + CMusAvaCapabilityQueryBase::ECapabilityQueryExecuting ) + { + executing = ETrue; + } + return executing; + } + + +// -------------------------------------------------------------------------- +// CMusAvaTerminal::QueryRequestedL +// -------------------------------------------------------------------------- +// +void CMusAvaTerminal::QueryRequestedL( CSIPServerTransaction& aQuery ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaTerminal::QueryRequestedL" ) + + CSIPResponseElements* response = + CSIPResponseElements::NewLC( + KMUSAVASIP200, + SIPStrings::StringF( SipStrConsts::EPhraseOk ) ); + + CSdpDocument* sdpContent = + CMusAvaCapability::ResponseContentLC( aQuery ); + + RPointerArray headers; + CSIPHeaderBase::PushLC( &headers ); + + if ( PopulateResponseL( aQuery, headers, *sdpContent ) ) + { + RStringF feature = + MusAvaCapabilityContext::SIPStringL( KCapabilitySwisFeature ); + CleanupClosePushL( feature ); + CMusAvaSipheaderUtil::AddAcceptContactHeaderL( headers, + feature ); + CleanupStack::PopAndDestroy(); //feature + MUS_LOG( "mus: [MUSAVA] AddAcceptContactHeaderL -> Success ") + + MUS_LOG( "mus: [MUSAVA] AddAcceptEncodingHeaderL -> Success ") + + MUS_LOG( "mus: [MUSAVA] AddAcceptLanguageHeaderL -> Success ") + CMusAvaSipheaderUtil::AddAcceptSdpHeaderL(headers); + MUS_LOG( "mus: [MUSAVA] AddAcceptSDPHeaderL -> Success ") + AddResponseHeadersL( *response, headers ); + CleanupStack::Pop( &headers ); + AddResponseContentL( *response, *sdpContent ); + } + else + { + CleanupStack::PopAndDestroy( &headers ); + response->SetStatusCodeL( KMUSAVASIPNotImplemented ); + response->SetReasonPhraseL( + SIPStrings::StringF( SipStrConsts::EPhraseNotImplemented ) ); + } + CleanupStack::PopAndDestroy( sdpContent ); + + MUS_LOG( "mus: [MUSAVA] -> Sending Response For Options Request ..." ) + aQuery.SendResponseL( response ); + CleanupStack::Pop( response ); + + iExchange.QueryObserver().CapabilityQueryAnswered( ETrue ); + + // Add sipaddress proposal + if ( response->StatusCode( ) == KMUSAVASIP200 ) + { + + const CSIPContactHeader* contact = + MusAvaCapabilityContext::ContactHeaderL( aQuery ); + + if ( !contact ) + { + MUS_LOG( "mus: [MUSAVA] => FAILED due lack of contact header" ) + } + else + { + /* + const TDesC8& uriInContact = + contact->SIPAddress()->Uri8().Uri().UriDes(); + if ( uriInContact.Length() > 0 ) + { + HBufC* uri = + EscapeUtils::ConvertToUnicodeFromUtf8L( uriInContact ); + CleanupStack::PushL( uri ); + iExchange.QueryObserver().CapabilitiesResolvedL( *uri ); + CleanupStack::PopAndDestroy( uri ); + } + */ + + // If there is P-Asserted-Identity header then send the OPTIONS + // to this. Store it in settings data as To header so then future + // request can be sent there. + + CDesCArrayFlat* pAssertedIdentityHeaders = + MusAvaCapabilityContext::PAssertedIdentityHeaderL( + MusAvaCapabilityContext::MessageElementsL(aQuery)); + CleanupStack::PushL( pAssertedIdentityHeaders ); + __ASSERT_ALWAYS(pAssertedIdentityHeaders,User::Leave(KErrArgument)); + if(pAssertedIdentityHeaders->Count()>0) + { + iExchange.QueryObserver().SipHeadersL(*pAssertedIdentityHeaders, + SipStrConsts::EToHeader); + } + else + { + // P-Asserted-Identity header not exist. So rely on other contacts + // read from phone book or Tel URI to send request. + } + pAssertedIdentityHeaders->Reset(); + CleanupStack::PopAndDestroy( pAssertedIdentityHeaders ); + + TBool sequential = + MultimediaSharingSettings::OperatorVariantSettingL() == + MusSettingsKeys::EOperatorSpecific || + MusSettingsKeys::ESequential == + MultimediaSharingSettings::CapabilityQuerySettingL(); + + TBool alreadyRequested = iExchange.QueryObserver(). + CapabilitiesResolvedForCingular(); + + if ( sequential && !alreadyRequested ) + { + iExchange.QueryObserver().SetCapabilitiesResolvedForCingular(); + } + } + } + + + //if pending query + if ( iQuery ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaTerminal::QueryRequestedL Executing Pending Query" ) + iQuery->ExecuteL(); + } + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaTerminal::QueryRequestedL" ) + } + + +// -------------------------------------------------------------------------- +// CMusAvaTerminal::AttachQuery +// -------------------------------------------------------------------------- +// +TInt CMusAvaTerminal::AttachQuery( CMusAvaCapabilityQueryBase& /*aQuery*/ ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaTerminal::AttachQuery" ) + iQueries++; + MUS_LOG( "mus: [MUSAVA] <- CMusAvaTerminal::AttachQuery" ) + return iQueries; + } + + +// -------------------------------------------------------------------------- +// CMusAvaTerminal::DetachQuery +// -------------------------------------------------------------------------- +// +TInt CMusAvaTerminal::DetachQuery( CMusAvaCapabilityQueryBase& /*aQuery*/ ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaTerminal::DetachQuery" ) + iQueries--; + __ASSERT_ALWAYS( iQueries >= 0, + User::Panic( _L("CMusAvaTerminal"), KErrGeneral ) ); + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaTerminal::DetachQuery" ) + + return iQueries; + } + + +// -------------------------------------------------------------------------- +// CMusAvaTerminal::AttachIdL +// -------------------------------------------------------------------------- +// +void CMusAvaTerminal::AttachIdL( const TDesC8& aTerminalId ) + { + if ( aTerminalId.Length() > 0 ) + { + //terminal id might change + HBufC8* tmpTerminalId = aTerminalId.AllocL(); + delete iTerminalId; + iTerminalId = tmpTerminalId; + } + } + + +// -------------------------------------------------------------------------- +// CMusAvaTerminal::AttachUriL +// -------------------------------------------------------------------------- +// +void CMusAvaTerminal::AttachUriL( const TDesC8& aUri ) + { + if ( aUri.Length() > 0 ) + { + delete iUri; + iUri = NULL; + iUri = aUri.AllocL(); + } + } + + +// -------------------------------------------------------------------------- +// CMusAvaTerminal::ResetAndDestroyQuery +// -------------------------------------------------------------------------- +// +void CMusAvaTerminal::ResetAndDestroyQuery() + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaTerminal::ResetAndDestroyQuery" ) + CMusAvaCapabilityQueryBase* query = iQuery; + iQuery = NULL; + delete query; + MUS_LOG( "mus: [MUSAVA] <- CMusAvaTerminal::ResetAndDestroyQuery" ) + } + + +// -------------------------------------------------------------------------- +// CMusAvaTerminal::PopulateResponseL +// -------------------------------------------------------------------------- +// +TBool CMusAvaTerminal::PopulateResponseL( CSIPServerTransaction& aQuery, + RPointerArray& aResponseHeaders, + CSdpDocument& aSdpContent ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaTerminal::PopulateResponseL" ) + + TBool supported = EFalse; + + const CSIPAcceptContactHeader* featureSet = + MusAvaCapabilityContext::AcceptContactHeaderL( aQuery ); + + User::LeaveIfError( !featureSet ? KErrGeneral : KErrNone ); + + for( TInt i = 0; i < iExchange.Capabilities().Count();i++ ) + { + CMusAvaCapability* capability = iExchange.Capabilities()[ i ]; + TBool containsFeature = capability->Supports( *featureSet ); + supported = containsFeature ? ETrue : supported; + + if ( containsFeature ) + { + const CSIPMessageElements& elements = + MusAvaCapabilityContext::MessageElementsL( aQuery ); + const TDesC8& content = elements.Content(); + CSdpDocument* sdp = NULL; + + if ( content.Length() > 0 ) + { + sdp = CSdpDocument::DecodeLC( content ); + } + else + { + sdp = CSdpDocument::NewLC(); + } + + //store video codecs that came from the other terminal + CDesCArrayFlat* videoCodecs = CMusAvaCapability::ResolveCodecsL( *sdp ); + CleanupStack::PushL( videoCodecs ); + capability->Exchange().QueryObserver().VideoCodecsResolvedL( *videoCodecs ); + CleanupStack::PopAndDestroy( videoCodecs ); + + //store fast startup mode if present + MusSettingsKeys::TFastMode mode = + CMusAvaCapability::ResolveFastModeL( *sdp ); + capability->Exchange().QueryObserver().FastModeResolved( mode ); + + CleanupStack::PopAndDestroy( sdp ); + + capability->PopulateResponseL( aQuery, + aResponseHeaders, + aSdpContent ); + iRequestedQuery = capability; + } + } + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaTerminal::PopulateResponseL" ) + + return supported; + } + + +// -------------------------------------------------------------------------- +// CMusAvaTerminal::AddResponseHeadersL +// -------------------------------------------------------------------------- +// +void CMusAvaTerminal::AddResponseHeadersL( CSIPResponseElements& aResponse, + RPointerArray& aResponseHeaders ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaTerminal::AddResponseHeadersL" ) + + CSIPMessageElements& message = aResponse.MessageElements(); + + if ( iExchange.TerminalId().Length() > 0 ) + { + //terminal id + CSIPHeaderBase* userAgent = + MusAvaCapabilityContext::UserAgentHeaderLC( + iExchange.TerminalId() ); + aResponseHeaders.AppendL( userAgent ); + CleanupStack::Pop( userAgent ); + } + + //Set user headers + message.SetUserHeadersL( aResponseHeaders ); + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaTerminal::AddResponseHeadersL" ) + } + + +// -------------------------------------------------------------------------- +// CMusAvaTerminal::AddResponseContentL +// -------------------------------------------------------------------------- +// +void CMusAvaTerminal::AddResponseContentL( CSIPResponseElements& aResponse, + CSdpDocument& aSdpContent ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaTerminal::AddResponseContentL" ) + + CSIPMessageElements& message = aResponse.MessageElements(); + + //create content from SDP document + HBufC8* content = MusAvaCapabilityContext::ToTextL( aSdpContent ); + CleanupStack::PushL( content ); + + //create content type + CSIPContentTypeHeader* contentTypeHeader = NULL; + contentTypeHeader = + CSIPContentTypeHeader::NewLC( KMUSAVASIPMediaTypeApplication, + KMUSAVASIPMediaSubTypeSDP ); + + //set content + message.SetContentL( content, contentTypeHeader ); + CleanupStack::Pop( contentTypeHeader ); + CleanupStack::Pop( content ); + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaTerminal::AddResponseContentL" ) + } +// -------------------------------------------------------------------------- +// CMusAvaTerminal::IsDiscovered +// -------------------------------------------------------------------------- +// +TBool CMusAvaTerminal::IsDiscovered() + { + TBool isDiscovered = EFalse; + TBool isGarbage = !iQueries && !RequestedQuery(); + + if ( !isGarbage ) + { + isDiscovered = + iQueries == 1 && + iQuery && + iQuery->State() == CMusAvaCapabilityQueryBase::ECapabilityQueryCompleted; + } + else + { + isDiscovered = ETrue; + } + + return isDiscovered; + + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/BWINS/ut_availabilityU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/BWINS/ut_availabilityU.DEF Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,282 @@ +EXPORTS + ?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 1 NONAME ; class MEUnitTest * CreateTestSuiteL(void) + ??0RMobilePhone@@QAE@XZ @ 2 NONAME ; RMobilePhone::RMobilePhone(void) + ??0TMobileAddress@RMobilePhone@@QAE@XZ @ 3 NONAME ; RMobilePhone::TMobileAddress::TMobileAddress(void) + ??0TMobilePhoneBatteryInfoV1@RMobilePhone@@QAE@XZ @ 4 NONAME ; RMobilePhone::TMobilePhoneBatteryInfoV1::TMobilePhoneBatteryInfoV1(void) + ??0TMobilePhoneCBChangeV1@RMobilePhone@@QAE@XZ @ 5 NONAME ; RMobilePhone::TMobilePhoneCBChangeV1::TMobilePhoneCBChangeV1(void) + ??0TMobilePhoneCBInfoEntryV1@RMobilePhone@@QAE@XZ @ 6 NONAME ; RMobilePhone::TMobilePhoneCBInfoEntryV1::TMobilePhoneCBInfoEntryV1(void) + ??0TMobilePhoneCCBSEntryV1@RMobilePhone@@QAE@XZ @ 7 NONAME ; RMobilePhone::TMobilePhoneCCBSEntryV1::TMobilePhoneCCBSEntryV1(void) + ??0TMobilePhoneCFChangeV1@RMobilePhone@@QAE@XZ @ 8 NONAME ; RMobilePhone::TMobilePhoneCFChangeV1::TMobilePhoneCFChangeV1(void) + ??0TMobilePhoneCFInfoEntryV1@RMobilePhone@@QAE@XZ @ 9 NONAME ; RMobilePhone::TMobilePhoneCFInfoEntryV1::TMobilePhoneCFInfoEntryV1(void) + ??0TMobilePhoneCWInfoEntryV1@RMobilePhone@@QAE@XZ @ 10 NONAME ; RMobilePhone::TMobilePhoneCWInfoEntryV1::TMobilePhoneCWInfoEntryV1(void) + ??0TMobilePhoneCostInfoV1@RMobilePhone@@QAE@XZ @ 11 NONAME ; RMobilePhone::TMobilePhoneCostInfoV1::TMobilePhoneCostInfoV1(void) + ??0TMobilePhoneCspFileV1@RMobilePhone@@QAE@XZ @ 12 NONAME ; RMobilePhone::TMobilePhoneCspFileV1::TMobilePhoneCspFileV1(void) + ??0TMobilePhoneIdentityV1@RMobilePhone@@QAE@XZ @ 13 NONAME ; RMobilePhone::TMobilePhoneIdentityV1::TMobilePhoneIdentityV1(void) + ??0TMobilePhoneLocationAreaV1@RMobilePhone@@QAE@XZ @ 14 NONAME ; RMobilePhone::TMobilePhoneLocationAreaV1::TMobilePhoneLocationAreaV1(void) + ??0TMobilePhoneLockInfoV1@RMobilePhone@@QAE@XZ @ 15 NONAME ; RMobilePhone::TMobilePhoneLockInfoV1::TMobilePhoneLockInfoV1(void) + ??0TMobilePhoneMessageWaitingV1@RMobilePhone@@QAE@XZ @ 16 NONAME ; RMobilePhone::TMobilePhoneMessageWaitingV1::TMobilePhoneMessageWaitingV1(void) + ??0TMobilePhoneMulticallSettingsV1@RMobilePhone@@QAE@XZ @ 17 NONAME ; RMobilePhone::TMobilePhoneMulticallSettingsV1::TMobilePhoneMulticallSettingsV1(void) + ??0TMobilePhoneNITZ@RMobilePhone@@QAE@HW4TMonth@@HHHHH@Z @ 18 NONAME ; RMobilePhone::TMobilePhoneNITZ::TMobilePhoneNITZ(int, enum TMonth, int, int, int, int, int) + ??0TMobilePhoneNITZ@RMobilePhone@@QAE@XZ @ 19 NONAME ; RMobilePhone::TMobilePhoneNITZ::TMobilePhoneNITZ(void) + ??0TMobilePhoneNetworkInfoV1@RMobilePhone@@QAE@XZ @ 20 NONAME ; RMobilePhone::TMobilePhoneNetworkInfoV1::TMobilePhoneNetworkInfoV1(void) + ??0TMobilePhoneNetworkSelectionV1@RMobilePhone@@QAE@XZ @ 21 NONAME ; RMobilePhone::TMobilePhoneNetworkSelectionV1::TMobilePhoneNetworkSelectionV1(void) + ??0TMobilePhonePasswordChangeV1@RMobilePhone@@QAE@XZ @ 22 NONAME ; RMobilePhone::TMobilePhonePasswordChangeV1::TMobilePhonePasswordChangeV1(void) + ??0TMobilePhonePuctV1@RMobilePhone@@QAE@XZ @ 23 NONAME ; RMobilePhone::TMobilePhonePuctV1::TMobilePhonePuctV1(void) + ??0TMobilePhoneServiceTableV1@RMobilePhone@@QAE@XZ @ 24 NONAME ; RMobilePhone::TMobilePhoneServiceTableV1::TMobilePhoneServiceTableV1(void) + ??1CSIP@@UAE@XZ @ 25 NONAME ; CSIP::~CSIP(void) + ??1CSIPClientTransaction@@UAE@XZ @ 26 NONAME ; CSIPClientTransaction::~CSIPClientTransaction(void) + ??1CSIPConnection@@UAE@XZ @ 27 NONAME ; CSIPConnection::~CSIPConnection(void) + ??1CSIPManagedProfileRegistry@@UAE@XZ @ 28 NONAME ; CSIPManagedProfileRegistry::~CSIPManagedProfileRegistry(void) + ??1CSIPMessageElements@@UAE@XZ @ 29 NONAME ; CSIPMessageElements::~CSIPMessageElements(void) + ??1CSIPProfile@@UAE@XZ @ 30 NONAME ; CSIPProfile::~CSIPProfile(void) + ??1CSIPProfileRegistry@@UAE@XZ @ 31 NONAME ; CSIPProfileRegistry::~CSIPProfileRegistry(void) + ??1CSIPProfileRegistryBase@@UAE@XZ @ 32 NONAME ; CSIPProfileRegistryBase::~CSIPProfileRegistryBase(void) + ??1CSIPRequestElements@@UAE@XZ @ 33 NONAME ; CSIPRequestElements::~CSIPRequestElements(void) + ??1CSIPResponseElements@@UAE@XZ @ 34 NONAME ; CSIPResponseElements::~CSIPResponseElements(void) + ??1CSIPServerTransaction@@UAE@XZ @ 35 NONAME ; CSIPServerTransaction::~CSIPServerTransaction(void) + ??8CSIPTransactionBase@@QBEHABV0@@Z @ 36 NONAME ; int CSIPTransactionBase::operator==(class CSIPTransactionBase const &) const + ?AbortSecurityCode@RMobilePhone@@QBEHW4TMobilePhoneSecurityCode@1@@Z @ 37 NONAME ; int RMobilePhone::AbortSecurityCode(enum RMobilePhone::TMobilePhoneSecurityCode) const + ?AuthoritativeDelete@CConnMonDeleteConnection@@QBEHXZ @ 38 NONAME ; int CConnMonDeleteConnection::AuthoritativeDelete(void) const + ?AuthoritativeDelete@CConnMonDeleteSubConnection@@QBEHXZ @ 39 NONAME ; int CConnMonDeleteSubConnection::AuthoritativeDelete(void) const + ?Availability@CConnMonBearerAvailabilityChange@@QBEHXZ @ 40 NONAME ; int CConnMonBearerAvailabilityChange::Availability(void) const + ?Bearer@CConnMonBearerChange@@QBEHXZ @ 41 NONAME ; int CConnMonBearerChange::Bearer(void) const + ?CSeqHeader@CSIPRequestElements@@QBEPBVCSIPCSeqHeader@@XZ @ 42 NONAME ; class CSIPCSeqHeader const * CSIPRequestElements::CSeqHeader(void) const + ?CSeqHeader@CSIPResponseElements@@QBEPBVCSIPCSeqHeader@@XZ @ 43 NONAME ; class CSIPCSeqHeader const * CSIPResponseElements::CSeqHeader(void) const + ?CancelAllowed@CSIPClientTransaction@@QBEHXZ @ 44 NONAME ; int CSIPClientTransaction::CancelAllowed(void) const + ?CancelAsyncRequest@RConnectionMonitor@@QAEXH@Z @ 45 NONAME ; void RConnectionMonitor::CancelAsyncRequest(int) + ?CancelL@CSIPClientTransaction@@QAEPAV1@XZ @ 46 NONAME ; class CSIPClientTransaction * CSIPClientTransaction::CancelL(void) + ?CancelNotifications@RConnectionMonitor@@QAEXXZ @ 47 NONAME ; void RConnectionMonitor::CancelNotifications(void) + ?ChangeSecurityCode@RMobilePhone@@QBEXAAVTRequestStatus@@W4TMobilePhoneSecurityCode@1@ABVTMobilePhonePasswordChangeV1@1@@Z @ 48 NONAME ; void RMobilePhone::ChangeSecurityCode(class TRequestStatus &, enum RMobilePhone::TMobilePhoneSecurityCode, class RMobilePhone::TMobilePhonePasswordChangeV1 const &) const + ?ClearCostMeter@RMobilePhone@@QBEXAAVTRequestStatus@@W4TMobilePhoneCostMeters@1@@Z @ 49 NONAME ; void RMobilePhone::ClearCostMeter(class TRequestStatus &, enum RMobilePhone::TMobilePhoneCostMeters) const + ?Close@RConnectionMonitor@@QAEXXZ @ 50 NONAME ; void RConnectionMonitor::Close(void) + ?ConnectL@RConnectionMonitor@@QAEHXZ @ 51 NONAME ; int RConnectionMonitor::ConnectL(void) + ?Connection@CSIP@@QBEPAVCSIPConnection@@K@Z @ 52 NONAME ; class CSIPConnection * CSIP::Connection(unsigned long) const + ?ConnectionActivity@CConnMonConnectionActivityChange@@QBEHXZ @ 53 NONAME ; int CConnMonConnectionActivityChange::ConnectionActivity(void) const + ?ConnectionId@CConnMonEventBase@@QBEIXZ @ 54 NONAME ; unsigned int CConnMonEventBase::ConnectionId(void) const + ?ConnectionStatus@CConnMonConnectionStatusChange@@QBEHXZ @ 55 NONAME ; int CConnMonConnectionStatusChange::ConnectionStatus(void) const + ?ConstructL@RMobilePhone@@MAEXXZ @ 56 NONAME ; void RMobilePhone::ConstructL(void) + ?Content@CSIPMessageElements@@QBEABVTDesC8@@XZ @ 57 NONAME ; class TDesC8 const & CSIPMessageElements::Content(void) const + ?ContentType@CSIPMessageElements@@QBEPBVCSIPContentTypeHeader@@XZ @ 58 NONAME ; class CSIPContentTypeHeader const * CSIPMessageElements::ContentType(void) const + ?ContinueDTMFStringSending@RMobilePhone@@QBEHH@Z @ 59 NONAME ; int RMobilePhone::ContinueDTMFStringSending(int) const + ?Data@CConnMonGenericEvent@@QBEPAXXZ @ 60 NONAME ; void * CConnMonGenericEvent::Data(void) const + ?DefaultProfileL@CSIPProfileRegistryBase@@QAEPAVCSIPProfile@@XZ @ 61 NONAME ; class CSIPProfile * CSIPProfileRegistryBase::DefaultProfileL(void) + ?Destruct@RMobilePhone@@MAEXXZ @ 62 NONAME ; void RMobilePhone::Destruct(void) + ?Disable@CSIPProfileRegistry@@QAEHAAVCSIPProfile@@@Z @ 63 NONAME ; int CSIPProfileRegistry::Disable(class CSIPProfile &) + ?DownlinkData@CConnMonDeleteConnection@@QBEIXZ @ 64 NONAME ; unsigned int CConnMonDeleteConnection::DownlinkData(void) const + ?DownlinkData@CConnMonDeleteSubConnection@@QBEIXZ @ 65 NONAME ; unsigned int CConnMonDeleteSubConnection::DownlinkData(void) const + ?DownlinkData@CConnMonDownlinkDataThreshold@@QBEIXZ @ 66 NONAME ; unsigned int CConnMonDownlinkDataThreshold::DownlinkData(void) const + ?EnableL@CSIPProfileRegistry@@QAEXAAVCSIPProfile@@AAVMSIPConnectionObserver@@@Z @ 67 NONAME ; void CSIPProfileRegistry::EnableL(class CSIPProfile &, class MSIPConnectionObserver &) + ?EventType@CConnMonEventBase@@QBEHXZ @ 68 NONAME ; int CConnMonEventBase::EventType(void) const + ?ExtensionId@TMultimodeType@RMobilePhone@@QBEHXZ @ 69 NONAME ; int RMobilePhone::TMultimodeType::ExtensionId(void) const + ?ExtractContent@CSIPMessageElements@@QAEPAVHBufC8@@XZ @ 70 NONAME ; class HBufC8 * CSIPMessageElements::ExtractContent(void) + ?FromHeader@CSIPRequestElements@@QBEPBVCSIPFromHeader@@XZ @ 71 NONAME ; class CSIPFromHeader const * CSIPRequestElements::FromHeader(void) const + ?FromHeader@CSIPResponseElements@@QBEPBVCSIPFromHeader@@XZ @ 72 NONAME ; class CSIPFromHeader const * CSIPResponseElements::FromHeader(void) const + ?GetALSLine@RMobilePhone@@QBEHAAW4TMobilePhoneALSLine@1@@Z @ 73 NONAME ; int RMobilePhone::GetALSLine(enum RMobilePhone::TMobilePhoneALSLine &) const + ?GetAlternatingCallCaps@RMobilePhone@@QBEHAAK@Z @ 74 NONAME ; int RMobilePhone::GetAlternatingCallCaps(unsigned long &) const + ?GetAlternatingCallMode@RMobilePhone@@QBEHAAW4TMobilePhoneAlternatingCallMode@1@AAW4TMobileService@1@@Z @ 75 NONAME ; int RMobilePhone::GetAlternatingCallMode(enum RMobilePhone::TMobilePhoneAlternatingCallMode &, enum RMobilePhone::TMobileService &) const + ?GetBatteryCaps@RMobilePhone@@QBEHAAK@Z @ 76 NONAME ; int RMobilePhone::GetBatteryCaps(unsigned long &) const + ?GetBatteryInfo@RMobilePhone@@QBEXAAVTRequestStatus@@AAVTMobilePhoneBatteryInfoV1@1@@Z @ 77 NONAME ; void RMobilePhone::GetBatteryInfo(class TRequestStatus &, class RMobilePhone::TMobilePhoneBatteryInfoV1 &) const + ?GetBoolAttribute@RConnectionMonitor@@QAEXIIIAAHAAVTRequestStatus@@@Z @ 78 NONAME ; void RConnectionMonitor::GetBoolAttribute(unsigned int, unsigned int, unsigned int, int &, class TRequestStatus &) + ?GetCCBSStatus@RMobilePhone@@QBEXAAVTRequestStatus@@AAW4TMobilePhoneCCBSStatus@1@W4TMobileInfoLocation@1@@Z @ 79 NONAME ; void RMobilePhone::GetCCBSStatus(class TRequestStatus &, enum RMobilePhone::TMobilePhoneCCBSStatus &, enum RMobilePhone::TMobileInfoLocation) const + ?GetCallServiceCaps@RMobilePhone@@QBEHAAK@Z @ 80 NONAME ; int RMobilePhone::GetCallServiceCaps(unsigned long &) const + ?GetConnectionCount@RConnectionMonitor@@QAEXAAIAAVTRequestStatus@@@Z @ 81 NONAME ; void RConnectionMonitor::GetConnectionCount(unsigned int &, class TRequestStatus &) + ?GetConnectionInfo@RConnectionMonitor@@QBEHIAAI0@Z @ 82 NONAME ; int RConnectionMonitor::GetConnectionInfo(unsigned int, unsigned int &, unsigned int &) const + ?GetCostCaps@RMobilePhone@@QBEHAAK@Z @ 83 NONAME ; int RMobilePhone::GetCostCaps(unsigned long &) const + ?GetCostInfo@RMobilePhone@@QBEXAAVTRequestStatus@@AAVTDes8@@@Z @ 84 NONAME ; void RMobilePhone::GetCostInfo(class TRequestStatus &, class TDes8 &) const + ?GetCurrentMode@RMobilePhone@@QBEHAAW4TMobilePhoneNetworkMode@1@@Z @ 85 NONAME ; int RMobilePhone::GetCurrentMode(enum RMobilePhone::TMobilePhoneNetworkMode &) const + ?GetCurrentNetwork@RMobilePhone@@QBEXAAVTRequestStatus@@AAVTDes8@@AAVTMobilePhoneLocationAreaV1@1@@Z @ 86 NONAME ; void RMobilePhone::GetCurrentNetwork(class TRequestStatus &, class TDes8 &, class RMobilePhone::TMobilePhoneLocationAreaV1 &) const + ?GetCustomerServiceProfile@RMobilePhone@@QBEXAAVTRequestStatus@@AAVTDes8@@@Z @ 87 NONAME ; void RMobilePhone::GetCustomerServiceProfile(class TRequestStatus &, class TDes8 &) const + ?GetDTMFCaps@RMobilePhone@@QBEHAAK@Z @ 88 NONAME ; int RMobilePhone::GetDTMFCaps(unsigned long &) const + ?GetDefaultPrivacy@RMobilePhone@@QBEHAAW4TMobilePhonePrivacy@1@@Z @ 89 NONAME ; int RMobilePhone::GetDefaultPrivacy(enum RMobilePhone::TMobilePhonePrivacy &) const + ?GetFdnStatus@RMobilePhone@@QBEHAAW4TMobilePhoneFdnStatus@1@@Z @ 90 NONAME ; int RMobilePhone::GetFdnStatus(enum RMobilePhone::TMobilePhoneFdnStatus &) const + ?GetFeatureCode@RMobilePhone@@QBEXAAVTRequestStatus@@AAVTDes16@@W4TMobilePhoneNetworkService@1@W4TMobilePhoneServiceAction@1@@Z @ 91 NONAME ; void RMobilePhone::GetFeatureCode(class TRequestStatus &, class TDes16 &, enum RMobilePhone::TMobilePhoneNetworkService, enum RMobilePhone::TMobilePhoneServiceAction) const + ?GetHomeNetwork@RMobilePhone@@QBEXAAVTRequestStatus@@AAVTDes8@@@Z @ 92 NONAME ; void RMobilePhone::GetHomeNetwork(class TRequestStatus &, class TDes8 &) const + ?GetIccAccessCaps@RMobilePhone@@QBEHAAK@Z @ 93 NONAME ; int RMobilePhone::GetIccAccessCaps(unsigned long &) const + ?GetIccMessageWaitingIndicators@RMobilePhone@@QBEXAAVTRequestStatus@@AAVTDes8@@@Z @ 94 NONAME ; void RMobilePhone::GetIccMessageWaitingIndicators(class TRequestStatus &, class TDes8 &) const + ?GetIdentityCaps@RMobilePhone@@QBEHAAK@Z @ 95 NONAME ; int RMobilePhone::GetIdentityCaps(unsigned long &) const + ?GetIdentityServiceStatus@RMobilePhone@@QBEXAAVTRequestStatus@@W4TMobilePhoneIdService@1@AAW4TMobilePhoneIdServiceStatus@1@W4TMobileInfoLocation@1@@Z @ 96 NONAME ; void RMobilePhone::GetIdentityServiceStatus(class TRequestStatus &, enum RMobilePhone::TMobilePhoneIdService, enum RMobilePhone::TMobilePhoneIdServiceStatus &, enum RMobilePhone::TMobileInfoLocation) const + ?GetIncomingCallType@RMobilePhone@@QBEXAAVTRequestStatus@@AAW4TMobilePhoneIncomingCallType@1@AAVTDes8@@@Z @ 97 NONAME ; void RMobilePhone::GetIncomingCallType(class TRequestStatus &, enum RMobilePhone::TMobilePhoneIncomingCallType &, class TDes8 &) const + ?GetIndicator@RMobilePhone@@QBEXAAVTRequestStatus@@AAK@Z @ 98 NONAME ; void RMobilePhone::GetIndicator(class TRequestStatus &, unsigned long &) const + ?GetIndicatorCaps@RMobilePhone@@QBEHAAK0@Z @ 99 NONAME ; int RMobilePhone::GetIndicatorCaps(unsigned long &, unsigned long &) const + ?GetIntAttribute@RConnectionMonitor@@QAEXIIIAAHAAVTRequestStatus@@@Z @ 100 NONAME ; void RConnectionMonitor::GetIntAttribute(unsigned int, unsigned int, unsigned int, int &, class TRequestStatus &) + ?GetLockInfo@RMobilePhone@@QBEXAAVTRequestStatus@@W4TMobilePhoneLock@1@AAVTDes8@@@Z @ 101 NONAME ; void RMobilePhone::GetLockInfo(class TRequestStatus &, enum RMobilePhone::TMobilePhoneLock, class TDes8 &) const + ?GetMulticallParams@RMobilePhone@@QBEXAAVTRequestStatus@@AAVTDes8@@@Z @ 102 NONAME ; void RMobilePhone::GetMulticallParams(class TRequestStatus &, class TDes8 &) const + ?GetMultimodeAPIVersion@RMobilePhone@@QBEHAAH@Z @ 103 NONAME ; int RMobilePhone::GetMultimodeAPIVersion(int &) const + ?GetMultimodeCaps@RMobilePhone@@QBEHAAK@Z @ 104 NONAME ; int RMobilePhone::GetMultimodeCaps(unsigned long &) const + ?GetNITZInfo@RMobilePhone@@QBEHAAVTMobilePhoneNITZ@1@@Z @ 105 NONAME ; int RMobilePhone::GetNITZInfo(class RMobilePhone::TMobilePhoneNITZ &) const + ?GetNetworkCaps@RMobilePhone@@QBEHAAK@Z @ 106 NONAME ; int RMobilePhone::GetNetworkCaps(unsigned long &) const + ?GetNetworkRegistrationStatus@RMobilePhone@@QBEXAAVTRequestStatus@@AAW4TMobilePhoneRegistrationStatus@1@@Z @ 107 NONAME ; void RMobilePhone::GetNetworkRegistrationStatus(class TRequestStatus &, enum RMobilePhone::TMobilePhoneRegistrationStatus &) const + ?GetNetworkSelectionSetting@RMobilePhone@@QBEHAAVTDes8@@@Z @ 108 NONAME ; int RMobilePhone::GetNetworkSelectionSetting(class TDes8 &) const + ?GetParameter@CSIPProfile@@QBEHKAAH@Z @ 109 NONAME ; int CSIPProfile::GetParameter(unsigned long, int &) const + ?GetParameter@CSIPProfile@@QBEHKAAK@Z @ 110 NONAME ; int CSIPProfile::GetParameter(unsigned long, unsigned long &) const + ?GetParameter@CSIPProfile@@QBEHKAAPBVMDesC8Array@@@Z @ 111 NONAME ; int CSIPProfile::GetParameter(unsigned long, class MDesC8Array const * &) const + ?GetParameter@CSIPProfile@@QBEHKAAPBVTDesC8@@@Z @ 112 NONAME ; int CSIPProfile::GetParameter(unsigned long, class TDesC8 const * &) const + ?GetPckgAttribute@RConnectionMonitor@@QBEXIIIAAVTDes16@@AAVTRequestStatus@@@Z @ 113 NONAME ; void RConnectionMonitor::GetPckgAttribute(unsigned int, unsigned int, unsigned int, class TDes16 &, class TRequestStatus &) const + ?GetPckgAttribute@RConnectionMonitor@@QBEXIIIAAVTDes8@@AAVTRequestStatus@@@Z @ 114 NONAME ; void RConnectionMonitor::GetPckgAttribute(unsigned int, unsigned int, unsigned int, class TDes8 &, class TRequestStatus &) const + ?GetPhoneId@RMobilePhone@@QBEXAAVTRequestStatus@@AAVTMobilePhoneIdentityV1@1@@Z @ 115 NONAME ; void RMobilePhone::GetPhoneId(class TRequestStatus &, class RMobilePhone::TMobilePhoneIdentityV1 &) const + ?GetPhoneStoreInfo@RMobilePhone@@QBEXAAVTRequestStatus@@AAVTDes8@@ABVTDesC16@@@Z @ 116 NONAME ; void RMobilePhone::GetPhoneStoreInfo(class TRequestStatus &, class TDes8 &, class TDesC16 const &) const + ?GetSecurityCaps@RMobilePhone@@QBEHAAK@Z @ 117 NONAME ; int RMobilePhone::GetSecurityCaps(unsigned long &) const + ?GetServiceTable@RMobilePhone@@QBEXAAVTRequestStatus@@W4TMobilePhoneServiceTable@1@AAVTDes8@@@Z @ 118 NONAME ; void RMobilePhone::GetServiceTable(class TRequestStatus &, enum RMobilePhone::TMobilePhoneServiceTable, class TDes8 &) const + ?GetSignalCaps@RMobilePhone@@QBEHAAK@Z @ 119 NONAME ; int RMobilePhone::GetSignalCaps(unsigned long &) const + ?GetSignalStrength@RMobilePhone@@QBEXAAVTRequestStatus@@AAJAAC@Z @ 120 NONAME ; void RMobilePhone::GetSignalStrength(class TRequestStatus &, long &, signed char &) const + ?GetStringAttribute@RConnectionMonitor@@QBEXIIIAAVTDes16@@AAVTRequestStatus@@@Z @ 121 NONAME ; void RConnectionMonitor::GetStringAttribute(unsigned int, unsigned int, unsigned int, class TDes16 &, class TRequestStatus &) const + ?GetSubConnectionInfo@RConnectionMonitor@@QBEHIIAAI@Z @ 122 NONAME ; int RConnectionMonitor::GetSubConnectionInfo(unsigned int, unsigned int, unsigned int &) const + ?GetSubscriberId@RMobilePhone@@QBEXAAVTRequestStatus@@AAV?$TBuf@$0P@@@@Z @ 123 NONAME ; void RMobilePhone::GetSubscriberId(class TRequestStatus &, class TBuf<15> &) const + ?GetUUSSetting@RMobilePhone@@QBEXAAVTRequestStatus@@AAW4TMobilePhoneUUSSetting@1@@Z @ 124 NONAME ; void RMobilePhone::GetUUSSetting(class TRequestStatus &, enum RMobilePhone::TMobilePhoneUUSSetting &) const + ?GetUintAttribute@RConnectionMonitor@@QAEXIIIAAIAAVTRequestStatus@@@Z @ 125 NONAME ; void RConnectionMonitor::GetUintAttribute(unsigned int, unsigned int, unsigned int, unsigned int &, class TRequestStatus &) + ?IapAvailability@CConnMonIapAvailabilityChange@@QBE?AVTConnMonIapInfo@@XZ @ 126 NONAME ; class TConnMonIapInfo CConnMonIapAvailabilityChange::IapAvailability(void) const + ?IapId@CSIPConnection@@QBEKXZ @ 127 NONAME ; unsigned long CSIPConnection::IapId(void) const + ?ImplementationGroupProxy@@YAPBUTImplementationProxy@@AAH@Z @ 128 NONAME ; struct TImplementationProxy const * ImplementationGroupProxy(int &) + ?IsEnabled@CSIPProfileRegistry@@QBEHABVCSIPProfile@@@Z @ 129 NONAME ; int CSIPProfileRegistry::IsEnabled(class CSIPProfile const &) const + ?IsSIPClientTransaction@CSIPTransactionBase@@QBEHXZ @ 130 NONAME ; int CSIPTransactionBase::IsSIPClientTransaction(void) const + ?IsSigCompSupportedL@CSIP@@QBEHXZ @ 131 NONAME ; int CSIP::IsSigCompSupportedL(void) const + ?LastRegistrationError@CSIPProfileRegistryBase@@QBEHABVCSIPProfile@@@Z @ 132 NONAME ; int CSIPProfileRegistryBase::LastRegistrationError(class CSIPProfile const &) const + ?MessageElements@CSIPRequestElements@@QAEAAVCSIPMessageElements@@XZ @ 133 NONAME ; class CSIPMessageElements & CSIPRequestElements::MessageElements(void) + ?MessageElements@CSIPRequestElements@@QBEABVCSIPMessageElements@@XZ @ 134 NONAME ; class CSIPMessageElements const & CSIPRequestElements::MessageElements(void) const + ?MessageElements@CSIPResponseElements@@QAEAAVCSIPMessageElements@@XZ @ 135 NONAME ; class CSIPMessageElements & CSIPResponseElements::MessageElements(void) + ?MessageElements@CSIPResponseElements@@QBEABVCSIPMessageElements@@XZ @ 136 NONAME ; class CSIPMessageElements const & CSIPResponseElements::MessageElements(void) const + ?Method@CSIPRequestElements@@QBE?AVRStringF@@XZ @ 137 NONAME ; class RStringF CSIPRequestElements::Method(void) const + ?NegotiatedSecurityMechanismL@CSIP@@QAEPAVHBufC8@@ABVTDesC8@@@Z @ 138 NONAME ; class HBufC8 * CSIP::NegotiatedSecurityMechanismL(class TDesC8 const &) + ?NetworkStatus@CConnMonNetworkStatusChange@@QBEHXZ @ 139 NONAME ; int CConnMonNetworkStatusChange::NetworkStatus(void) const + ?NewL@CSIP@@SAPAV1@ABVTUid@@AAVMSIPObserver@@@Z @ 140 NONAME ; class CSIP * CSIP::NewL(class TUid const &, class MSIPObserver &) + ?NewL@CSIPClientTransaction@@SAPAV1@VRStringF@@@Z @ 141 NONAME ; class CSIPClientTransaction * CSIPClientTransaction::NewL(class RStringF) + ?NewL@CSIPConnection@@SAPAV1@AAVCSIP@@KAAVMSIPConnectionObserver@@@Z @ 142 NONAME ; class CSIPConnection * CSIPConnection::NewL(class CSIP &, unsigned long, class MSIPConnectionObserver &) + ?NewL@CSIPManagedProfileRegistry@@SAPAV1@AAVMSIPProfileRegistryObserver@@@Z @ 143 NONAME ; class CSIPManagedProfileRegistry * CSIPManagedProfileRegistry::NewL(class MSIPProfileRegistryObserver &) + ?NewL@CSIPMessageElements@@SAPAV1@XZ @ 144 NONAME ; class CSIPMessageElements * CSIPMessageElements::NewL(void) + ?NewL@CSIPProfileRegistry@@SAPAV1@AAVCSIP@@AAVMSIPProfileRegistryObserver@@@Z @ 145 NONAME ; class CSIPProfileRegistry * CSIPProfileRegistry::NewL(class CSIP &, class MSIPProfileRegistryObserver &) + ?NewL@CSIPRequestElements@@SAPAV1@PAVCUri8@@@Z @ 146 NONAME ; class CSIPRequestElements * CSIPRequestElements::NewL(class CUri8 *) + ?NewL@CSIPResponseElements@@SAPAV1@IVRStringF@@@Z @ 147 NONAME ; class CSIPResponseElements * CSIPResponseElements::NewL(unsigned int, class RStringF) + ?NewL@CSIPServerTransaction@@SAPAV1@VRStringF@@@Z @ 148 NONAME ; class CSIPServerTransaction * CSIPServerTransaction::NewL(class RStringF) + ?NewLC@CSIP@@SAPAV1@ABVTUid@@AAVMSIPObserver@@@Z @ 149 NONAME ; class CSIP * CSIP::NewLC(class TUid const &, class MSIPObserver &) + ?NewLC@CSIPManagedProfileRegistry@@SAPAV1@AAVMSIPProfileRegistryObserver@@@Z @ 150 NONAME ; class CSIPManagedProfileRegistry * CSIPManagedProfileRegistry::NewLC(class MSIPProfileRegistryObserver &) + ?NewLC@CSIPMessageElements@@SAPAV1@XZ @ 151 NONAME ; class CSIPMessageElements * CSIPMessageElements::NewLC(void) + ?NewLC@CSIPProfileRegistry@@SAPAV1@AAVCSIP@@AAVMSIPProfileRegistryObserver@@@Z @ 152 NONAME ; class CSIPProfileRegistry * CSIPProfileRegistry::NewLC(class CSIP &, class MSIPProfileRegistryObserver &) + ?NewLC@CSIPRequestElements@@SAPAV1@PAVCUri8@@@Z @ 153 NONAME ; class CSIPRequestElements * CSIPRequestElements::NewLC(class CUri8 *) + ?NewLC@CSIPResponseElements@@SAPAV1@IVRStringF@@@Z @ 154 NONAME ; class CSIPResponseElements * CSIPResponseElements::NewLC(unsigned int, class RStringF) + ?NotifyALSLineChange@RMobilePhone@@QBEXAAVTRequestStatus@@AAW4TMobilePhoneALSLine@1@@Z @ 155 NONAME ; void RMobilePhone::NotifyALSLineChange(class TRequestStatus &, enum RMobilePhone::TMobilePhoneALSLine &) const + ?NotifyAlternatingCallCapsChange@RMobilePhone@@QBEXAAVTRequestStatus@@AAK@Z @ 156 NONAME ; void RMobilePhone::NotifyAlternatingCallCapsChange(class TRequestStatus &, unsigned long &) const + ?NotifyAlternatingCallModeChange@RMobilePhone@@QBEXAAVTRequestStatus@@AAW4TMobilePhoneAlternatingCallMode@1@AAW4TMobileService@1@@Z @ 157 NONAME ; void RMobilePhone::NotifyAlternatingCallModeChange(class TRequestStatus &, enum RMobilePhone::TMobilePhoneAlternatingCallMode &, enum RMobilePhone::TMobileService &) const + ?NotifyBatteryInfoChange@RMobilePhone@@QBEXAAVTRequestStatus@@AAVTMobilePhoneBatteryInfoV1@1@@Z @ 158 NONAME ; void RMobilePhone::NotifyBatteryInfoChange(class TRequestStatus &, class RMobilePhone::TMobilePhoneBatteryInfoV1 &) const + ?NotifyCCBSStatusChange@RMobilePhone@@QBEXAAVTRequestStatus@@AAW4TMobilePhoneCCBSStatus@1@@Z @ 159 NONAME ; void RMobilePhone::NotifyCCBSStatusChange(class TRequestStatus &, enum RMobilePhone::TMobilePhoneCCBSStatus &) const + ?NotifyCallBarringStatusChange@RMobilePhone@@QBEXAAVTRequestStatus@@AAW4TMobilePhoneCBCondition@1@@Z @ 160 NONAME ; void RMobilePhone::NotifyCallBarringStatusChange(class TRequestStatus &, enum RMobilePhone::TMobilePhoneCBCondition &) const + ?NotifyCallForwardingActive@RMobilePhone@@QBEXAAVTRequestStatus@@AAW4TMobileService@1@AAW4TMobilePhoneCFActive@1@@Z @ 161 NONAME ; void RMobilePhone::NotifyCallForwardingActive(class TRequestStatus &, enum RMobilePhone::TMobileService &, enum RMobilePhone::TMobilePhoneCFActive &) const + ?NotifyCallForwardingStatusChange@RMobilePhone@@QBEXAAVTRequestStatus@@AAW4TMobilePhoneCFCondition@1@@Z @ 162 NONAME ; void RMobilePhone::NotifyCallForwardingStatusChange(class TRequestStatus &, enum RMobilePhone::TMobilePhoneCFCondition &) const + ?NotifyCallServiceCapsChange@RMobilePhone@@QBEXAAVTRequestStatus@@AAK@Z @ 163 NONAME ; void RMobilePhone::NotifyCallServiceCapsChange(class TRequestStatus &, unsigned long &) const + ?NotifyCallWaitingStatusChange@RMobilePhone@@QBEXAAVTRequestStatus@@AAVTDes8@@@Z @ 164 NONAME ; void RMobilePhone::NotifyCallWaitingStatusChange(class TRequestStatus &, class TDes8 &) const + ?NotifyCostCapsChange@RMobilePhone@@QBEXAAVTRequestStatus@@AAK@Z @ 165 NONAME ; void RMobilePhone::NotifyCostCapsChange(class TRequestStatus &, unsigned long &) const + ?NotifyCostInfoChange@RMobilePhone@@QBEXAAVTRequestStatus@@AAVTDes8@@@Z @ 166 NONAME ; void RMobilePhone::NotifyCostInfoChange(class TRequestStatus &, class TDes8 &) const + ?NotifyCurrentNetworkChange@RMobilePhone@@QBEXAAVTRequestStatus@@AAVTDes8@@AAVTMobilePhoneLocationAreaV1@1@@Z @ 167 NONAME ; void RMobilePhone::NotifyCurrentNetworkChange(class TRequestStatus &, class TDes8 &, class RMobilePhone::TMobilePhoneLocationAreaV1 &) const + ?NotifyDTMFCapsChange@RMobilePhone@@QBEXAAVTRequestStatus@@AAK@Z @ 168 NONAME ; void RMobilePhone::NotifyDTMFCapsChange(class TRequestStatus &, unsigned long &) const + ?NotifyDefaultPrivacyChange@RMobilePhone@@QBEXAAVTRequestStatus@@AAW4TMobilePhonePrivacy@1@@Z @ 169 NONAME ; void RMobilePhone::NotifyDefaultPrivacyChange(class TRequestStatus &, enum RMobilePhone::TMobilePhonePrivacy &) const + ?NotifyEventL@RConnectionMonitor@@QAEHAAVMConnectionMonitorObserver@@@Z @ 170 NONAME ; int RConnectionMonitor::NotifyEventL(class MConnectionMonitorObserver &) + ?NotifyFdnStatusChange@RMobilePhone@@QBEXAAVTRequestStatus@@AAW4TMobilePhoneFdnStatus@1@@Z @ 171 NONAME ; void RMobilePhone::NotifyFdnStatusChange(class TRequestStatus &, enum RMobilePhone::TMobilePhoneFdnStatus &) const + ?NotifyIccAccessCapsChange@RMobilePhone@@QBEXAAVTRequestStatus@@AAK@Z @ 172 NONAME ; void RMobilePhone::NotifyIccAccessCapsChange(class TRequestStatus &, unsigned long &) const + ?NotifyIccMessageWaitingIndicatorsChange@RMobilePhone@@QBEXAAVTRequestStatus@@AAVTDes8@@@Z @ 173 NONAME ; void RMobilePhone::NotifyIccMessageWaitingIndicatorsChange(class TRequestStatus &, class TDes8 &) const + ?NotifyIncomingCallTypeChange@RMobilePhone@@QBEXAAVTRequestStatus@@AAW4TMobilePhoneIncomingCallType@1@AAVTDes8@@@Z @ 174 NONAME ; void RMobilePhone::NotifyIncomingCallTypeChange(class TRequestStatus &, enum RMobilePhone::TMobilePhoneIncomingCallType &, class TDes8 &) const + ?NotifyIndicatorChange@RMobilePhone@@QBEXAAVTRequestStatus@@AAK@Z @ 175 NONAME ; void RMobilePhone::NotifyIndicatorChange(class TRequestStatus &, unsigned long &) const + ?NotifyLockInfoChange@RMobilePhone@@QBEXAAVTRequestStatus@@AAW4TMobilePhoneLock@1@AAVTDes8@@@Z @ 176 NONAME ; void RMobilePhone::NotifyLockInfoChange(class TRequestStatus &, enum RMobilePhone::TMobilePhoneLock &, class TDes8 &) const + ?NotifyMessageWaiting@RMobilePhone@@QBEXAAVTRequestStatus@@AAH@Z @ 177 NONAME ; void RMobilePhone::NotifyMessageWaiting(class TRequestStatus &, int &) const + ?NotifyModeChange@RMobilePhone@@QBEXAAVTRequestStatus@@AAW4TMobilePhoneNetworkMode@1@@Z @ 178 NONAME ; void RMobilePhone::NotifyModeChange(class TRequestStatus &, enum RMobilePhone::TMobilePhoneNetworkMode &) const + ?NotifyMulticallParamsChange@RMobilePhone@@QBEXAAVTRequestStatus@@AAVTDes8@@@Z @ 179 NONAME ; void RMobilePhone::NotifyMulticallParamsChange(class TRequestStatus &, class TDes8 &) const + ?NotifyNITZInfoChange@RMobilePhone@@QBEXAAVTRequestStatus@@AAVTMobilePhoneNITZ@1@@Z @ 180 NONAME ; void RMobilePhone::NotifyNITZInfoChange(class TRequestStatus &, class RMobilePhone::TMobilePhoneNITZ &) const + ?NotifyNetworkRegistrationStatusChange@RMobilePhone@@QBEXAAVTRequestStatus@@AAW4TMobilePhoneRegistrationStatus@1@@Z @ 181 NONAME ; void RMobilePhone::NotifyNetworkRegistrationStatusChange(class TRequestStatus &, enum RMobilePhone::TMobilePhoneRegistrationStatus &) const + ?NotifyNetworkSelectionSettingChange@RMobilePhone@@QBEXAAVTRequestStatus@@AAVTDes8@@@Z @ 182 NONAME ; void RMobilePhone::NotifyNetworkSelectionSettingChange(class TRequestStatus &, class TDes8 &) const + ?NotifySecurityCapsChange@RMobilePhone@@QBEXAAVTRequestStatus@@AAK@Z @ 183 NONAME ; void RMobilePhone::NotifySecurityCapsChange(class TRequestStatus &, unsigned long &) const + ?NotifySecurityEvent@RMobilePhone@@QBEXAAVTRequestStatus@@AAW4TMobilePhoneSecurityEvent@1@@Z @ 184 NONAME ; void RMobilePhone::NotifySecurityEvent(class TRequestStatus &, enum RMobilePhone::TMobilePhoneSecurityEvent &) const + ?NotifySignalStrengthChange@RMobilePhone@@QBEXAAVTRequestStatus@@AAJAAC@Z @ 185 NONAME ; void RMobilePhone::NotifySignalStrengthChange(class TRequestStatus &, long &, signed char &) const + ?NotifyStopInDTMFString@RMobilePhone@@QBEXAAVTRequestStatus@@@Z @ 186 NONAME ; void RMobilePhone::NotifyStopInDTMFString(class TRequestStatus &) const + ?NotifyUUSSettingChange@RMobilePhone@@QBEXAAVTRequestStatus@@AAW4TMobilePhoneUUSSetting@1@@Z @ 187 NONAME ; void RMobilePhone::NotifyUUSSettingChange(class TRequestStatus &, enum RMobilePhone::TMobilePhoneUUSSetting &) const + ?ProfileL@CSIPProfileRegistryBase@@QAEPAVCSIPProfile@@K@Z @ 188 NONAME ; class CSIPProfile * CSIPProfileRegistryBase::ProfileL(unsigned long) + ?ProfilesL@CSIPProfileRegistryBase@@QAEXAAV?$RPointerArray@VCSIPProfile@@@@@Z @ 189 NONAME ; void CSIPProfileRegistryBase::ProfilesL(class RPointerArray &) + ?ProfilesL@CSIPProfileRegistryBase@@QAEXABVTDesC8@@AAV?$RPointerArray@VCSIPProfile@@@@@Z @ 190 NONAME ; void CSIPProfileRegistryBase::ProfilesL(class TDesC8 const &, class RPointerArray &) + ?ProfilesL@CSIPProfileRegistryBase@@QAEXABVTSIPProfileTypeInfo@@AAV?$RPointerArray@VCSIPProfile@@@@@Z @ 191 NONAME ; void CSIPProfileRegistryBase::ProfilesL(class TSIPProfileTypeInfo const &, class RPointerArray &) + ?ProgramFeatureCode@RMobilePhone@@QBEXAAVTRequestStatus@@ABVTDesC16@@W4TMobilePhoneNetworkService@1@W4TMobilePhoneServiceAction@1@@Z @ 192 NONAME ; void RMobilePhone::ProgramFeatureCode(class TRequestStatus &, class TDesC16 const &, enum RMobilePhone::TMobilePhoneNetworkService, enum RMobilePhone::TMobilePhoneServiceAction) const + ?ReasonPhrase@CSIPResponseElements@@QBE?AVRStringF@@XZ @ 193 NONAME ; class RStringF CSIPResponseElements::ReasonPhrase(void) const + ?RegistrationStatus@CConnMonNetworkRegistrationChange@@QBEHXZ @ 194 NONAME ; int CConnMonNetworkRegistrationChange::RegistrationStatus(void) const + ?RemoteUri@CSIPRequestElements@@QBEABVCUri8@@XZ @ 195 NONAME ; class CUri8 const & CSIPRequestElements::RemoteUri(void) const + ?RequestElements@CSIPServerTransaction@@QBEPBVCSIPRequestElements@@XZ @ 196 NONAME ; class CSIPRequestElements const * CSIPServerTransaction::RequestElements(void) const + ?ResponseAllowed@CSIPServerTransaction@@QBEHXZ @ 197 NONAME ; int CSIPServerTransaction::ResponseAllowed(void) const + ?ResponseElements@CSIPClientTransaction@@QBEPBVCSIPResponseElements@@XZ @ 198 NONAME ; class CSIPResponseElements const * CSIPClientTransaction::ResponseElements(void) const + ?SIP@CSIPConnection@@QAEPAVCSIP@@XZ @ 199 NONAME ; class CSIP * CSIPConnection::SIP(void) + ?SIP@CSIPConnection@@QBEPBVCSIP@@XZ @ 200 NONAME ; class CSIP const * CSIPConnection::SIP(void) const + ?SIP@CSIPProfileRegistry@@QBEAAVCSIP@@XZ @ 201 NONAME ; class CSIP & CSIPProfileRegistry::SIP(void) const + ?SaveL@CSIPManagedProfileRegistry@@QAEXAAVCSIPProfile@@@Z @ 202 NONAME ; void CSIPManagedProfileRegistry::SaveL(class CSIPProfile &) + ?SelectNetwork@RMobilePhone@@QBEXAAVTRequestStatus@@HABUTMobilePhoneNetworkManualSelection@1@@Z @ 203 NONAME ; void RMobilePhone::SelectNetwork(class TRequestStatus &, int, struct RMobilePhone::TMobilePhoneNetworkManualSelection const &) const + ?SendDTMFTones@RMobilePhone@@QBEXAAVTRequestStatus@@ABVTDesC16@@@Z @ 204 NONAME ; void RMobilePhone::SendDTMFTones(class TRequestStatus &, class TDesC16 const &) const + ?SendNetworkServiceRequest@RMobilePhone@@QBEXAAVTRequestStatus@@ABVTDesC16@@@Z @ 205 NONAME ; void RMobilePhone::SendNetworkServiceRequest(class TRequestStatus &, class TDesC16 const &) const + ?SendResponseL@CSIPServerTransaction@@QAEXPAVCSIPResponseElements@@@Z @ 206 NONAME ; void CSIPServerTransaction::SendResponseL(class CSIPResponseElements *) + ?SetALSLine@RMobilePhone@@QBEXAAVTRequestStatus@@W4TMobilePhoneALSLine@1@@Z @ 207 NONAME ; void RMobilePhone::SetALSLine(class TRequestStatus &, enum RMobilePhone::TMobilePhoneALSLine) const + ?SetAlternatingCallMode@RMobilePhone@@QBEXAAVTRequestStatus@@W4TMobilePhoneAlternatingCallMode@1@W4TMobileService@1@@Z @ 208 NONAME ; void RMobilePhone::SetAlternatingCallMode(class TRequestStatus &, enum RMobilePhone::TMobilePhoneAlternatingCallMode, enum RMobilePhone::TMobileService) const + ?SetBoolAttribute@RConnectionMonitor@@QBEHIIIH@Z @ 209 NONAME ; int RConnectionMonitor::SetBoolAttribute(unsigned int, unsigned int, unsigned int, int) const + ?SetCallBarringPassword@RMobilePhone@@QBEXAAVTRequestStatus@@ABVTMobilePhonePasswordChangeV1@1@@Z @ 210 NONAME ; void RMobilePhone::SetCallBarringPassword(class TRequestStatus &, class RMobilePhone::TMobilePhonePasswordChangeV1 const &) const + ?SetCallBarringStatus@RMobilePhone@@QBEXAAVTRequestStatus@@W4TMobilePhoneCBCondition@1@ABVTMobilePhoneCBChangeV1@1@@Z @ 211 NONAME ; void RMobilePhone::SetCallBarringStatus(class TRequestStatus &, enum RMobilePhone::TMobilePhoneCBCondition, class RMobilePhone::TMobilePhoneCBChangeV1 const &) const + ?SetCallForwardingStatus@RMobilePhone@@QBEXAAVTRequestStatus@@W4TMobilePhoneCFCondition@1@ABVTMobilePhoneCFChangeV1@1@@Z @ 212 NONAME ; void RMobilePhone::SetCallForwardingStatus(class TRequestStatus &, enum RMobilePhone::TMobilePhoneCFCondition, class RMobilePhone::TMobilePhoneCFChangeV1 const &) const + ?SetCallWaitingStatus@RMobilePhone@@QBEXAAVTRequestStatus@@W4TMobileService@1@W4TMobilePhoneServiceAction@1@@Z @ 213 NONAME ; void RMobilePhone::SetCallWaitingStatus(class TRequestStatus &, enum RMobilePhone::TMobileService, enum RMobilePhone::TMobilePhoneServiceAction) const + ?SetContentL@CSIPMessageElements@@QAEXPAVHBufC8@@PAVCSIPContentTypeHeader@@@Z @ 214 NONAME ; void CSIPMessageElements::SetContentL(class HBufC8 *, class CSIPContentTypeHeader *) + ?SetDefaultPrivacy@RMobilePhone@@QBEXAAVTRequestStatus@@W4TMobilePhonePrivacy@1@@Z @ 215 NONAME ; void RMobilePhone::SetDefaultPrivacy(class TRequestStatus &, enum RMobilePhone::TMobilePhonePrivacy) const + ?SetFdnSetting@RMobilePhone@@QBEXAAVTRequestStatus@@W4TMobilePhoneFdnSetting@1@@Z @ 216 NONAME ; void RMobilePhone::SetFdnSetting(class TRequestStatus &, enum RMobilePhone::TMobilePhoneFdnSetting) const + ?SetFromHeaderL@CSIPRequestElements@@QAEXPAVCSIPFromHeader@@@Z @ 217 NONAME ; void CSIPRequestElements::SetFromHeaderL(class CSIPFromHeader *) + ?SetIccMessageWaitingIndicators@RMobilePhone@@QBEXAAVTRequestStatus@@ABVTDesC8@@@Z @ 218 NONAME ; void RMobilePhone::SetIccMessageWaitingIndicators(class TRequestStatus &, class TDesC8 const &) const + ?SetIncomingCallType@RMobilePhone@@QBEXAAVTRequestStatus@@W4TMobilePhoneIncomingCallType@1@AAVTDes8@@@Z @ 219 NONAME ; void RMobilePhone::SetIncomingCallType(class TRequestStatus &, enum RMobilePhone::TMobilePhoneIncomingCallType, class TDes8 &) const + ?SetIntAttribute@RConnectionMonitor@@QBEHIIIH@Z @ 220 NONAME ; int RConnectionMonitor::SetIntAttribute(unsigned int, unsigned int, unsigned int, int) const + ?SetLockSetting@RMobilePhone@@QBEXAAVTRequestStatus@@W4TMobilePhoneLock@1@W4TMobilePhoneLockSetting@1@@Z @ 221 NONAME ; void RMobilePhone::SetLockSetting(class TRequestStatus &, enum RMobilePhone::TMobilePhoneLock, enum RMobilePhone::TMobilePhoneLockSetting) const + ?SetMaxCostMeter@RMobilePhone@@QBEXAAVTRequestStatus@@I@Z @ 222 NONAME ; void RMobilePhone::SetMaxCostMeter(class TRequestStatus &, unsigned int) const + ?SetMethodL@CSIPRequestElements@@QAEXVRStringF@@@Z @ 223 NONAME ; void CSIPRequestElements::SetMethodL(class RStringF) + ?SetMulticallParams@RMobilePhone@@QBEXAAVTRequestStatus@@H@Z @ 224 NONAME ; void RMobilePhone::SetMulticallParams(class TRequestStatus &, int) const + ?SetNetworkSelectionSetting@RMobilePhone@@QBEXAAVTRequestStatus@@ABVTDes8@@@Z @ 225 NONAME ; void RMobilePhone::SetNetworkSelectionSetting(class TRequestStatus &, class TDes8 const &) const + ?SetParameter@CSIPManagedProfile@@QAEHKABVMDesC8Array@@@Z @ 226 NONAME ; int CSIPManagedProfile::SetParameter(unsigned long, class MDesC8Array const &) + ?SetPckgAttribute@RConnectionMonitor@@QBEHIIIABVTDes8@@@Z @ 227 NONAME ; int RConnectionMonitor::SetPckgAttribute(unsigned int, unsigned int, unsigned int, class TDes8 const &) const + ?SetPuct@RMobilePhone@@QBEXAAVTRequestStatus@@ABVTDesC8@@@Z @ 228 NONAME ; void RMobilePhone::SetPuct(class TRequestStatus &, class TDesC8 const &) const + ?SetReasonPhraseL@CSIPResponseElements@@QAEXVRStringF@@@Z @ 229 NONAME ; void CSIPResponseElements::SetReasonPhraseL(class RStringF) + ?SetRemoteUriL@CSIPRequestElements@@QAEXPAVCUri8@@@Z @ 230 NONAME ; void CSIPRequestElements::SetRemoteUriL(class CUri8 *) + ?SetRequestElements@CSIPServerTransaction@@QAEXPAVCSIPRequestElements@@@Z @ 231 NONAME ; void CSIPServerTransaction::SetRequestElements(class CSIPRequestElements *) + ?SetResponseElements@CSIPClientTransaction@@QAEXPAVCSIPResponseElements@@@Z @ 232 NONAME ; void CSIPClientTransaction::SetResponseElements(class CSIPResponseElements *) + ?SetState@CSIPConnection@@QAEXW4TState@1@@Z @ 233 NONAME ; void CSIPConnection::SetState(enum CSIPConnection::TState) + ?SetStatusCodeL@CSIPResponseElements@@QAEXI@Z @ 234 NONAME ; void CSIPResponseElements::SetStatusCodeL(unsigned int) + ?SetStringAttribute@RConnectionMonitor@@QBEHIIIABVTDes16@@@Z @ 235 NONAME ; int RConnectionMonitor::SetStringAttribute(unsigned int, unsigned int, unsigned int, class TDes16 const &) const + ?SetToHeaderL@CSIPRequestElements@@QAEXPAVCSIPToHeader@@@Z @ 236 NONAME ; void CSIPRequestElements::SetToHeaderL(class CSIPToHeader *) + ?SetUUSSetting@RMobilePhone@@QBEXAAVTRequestStatus@@W4TMobilePhoneUUSSetting@1@@Z @ 237 NONAME ; void RMobilePhone::SetUUSSetting(class TRequestStatus &, enum RMobilePhone::TMobilePhoneUUSSetting) const + ?SetUintAttribute@RConnectionMonitor@@QBEHIIII@Z @ 238 NONAME ; int RConnectionMonitor::SetUintAttribute(unsigned int, unsigned int, unsigned int, unsigned int) const + ?SetUserHeadersL@CSIPMessageElements@@QAEXAAV?$RPointerArray@VCSIPHeaderBase@@@@@Z @ 239 NONAME ; void CSIPMessageElements::SetUserHeadersL(class RPointerArray &) + ?SignalStrength@CConnMonSignalStrengthChange@@QBEHXZ @ 240 NONAME ; int CConnMonSignalStrengthChange::SignalStrength(void) const + ?StartDTMFTone@RMobilePhone@@QBEHVTChar@@@Z @ 241 NONAME ; int RMobilePhone::StartDTMFTone(class TChar) const + ?State@CSIPConnection@@QBE?AW4TState@1@XZ @ 242 NONAME ; enum CSIPConnection::TState CSIPConnection::State(void) const + ?StateL@CSIPTransactionBase@@QAE?AW4TState@1@XZ @ 243 NONAME ; enum CSIPTransactionBase::TState CSIPTransactionBase::StateL(void) + ?StatusCode@CSIPResponseElements@@QBEIXZ @ 244 NONAME ; unsigned int CSIPResponseElements::StatusCode(void) const + ?StopDTMFTone@RMobilePhone@@QBEHXZ @ 245 NONAME ; int RMobilePhone::StopDTMFTone(void) const + ?SubConnectionId@CConnMonConnectionActivityChange@@QBEIXZ @ 246 NONAME ; unsigned int CConnMonConnectionActivityChange::SubConnectionId(void) const + ?SubConnectionId@CConnMonConnectionStatusChange@@QBEIXZ @ 247 NONAME ; unsigned int CConnMonConnectionStatusChange::SubConnectionId(void) const + ?SubConnectionId@CConnMonCreateSubConnection@@QBEIXZ @ 248 NONAME ; unsigned int CConnMonCreateSubConnection::SubConnectionId(void) const + ?SubConnectionId@CConnMonDeleteSubConnection@@QBEIXZ @ 249 NONAME ; unsigned int CConnMonDeleteSubConnection::SubConnectionId(void) const + ?SubConnectionId@CConnMonDownlinkDataThreshold@@QBEIXZ @ 250 NONAME ; unsigned int CConnMonDownlinkDataThreshold::SubConnectionId(void) const + ?SubConnectionId@CConnMonUplinkDataThreshold@@QBEIXZ @ 251 NONAME ; unsigned int CConnMonUplinkDataThreshold::SubConnectionId(void) const + ?SupportedProfileTypesL@CSIPProfileRegistryBase@@QAEXAAV?$RArray@VTSIPProfileTypeInfo@@@@@Z @ 252 NONAME ; void CSIPProfileRegistryBase::SupportedProfileTypesL(class RArray &) + ?SupportedSecurityMechanismsL@CSIP@@QBEPAVCDesC8Array@@XZ @ 253 NONAME ; class CDesC8Array * CSIP::SupportedSecurityMechanismsL(void) const + ?ToHeader@CSIPRequestElements@@QBEPBVCSIPToHeader@@XZ @ 254 NONAME ; class CSIPToHeader const * CSIPRequestElements::ToHeader(void) const + ?ToHeader@CSIPResponseElements@@QBEPBVCSIPToHeader@@XZ @ 255 NONAME ; class CSIPToHeader const * CSIPResponseElements::ToHeader(void) const + ?TransmitPower@CConnMonTransmitPowerChange@@QBEIXZ @ 256 NONAME ; unsigned int CConnMonTransmitPowerChange::TransmitPower(void) const + ?Type@CSIPProfile@@QBEABVTSIPProfileTypeInfo@@XZ @ 257 NONAME ; class TSIPProfileTypeInfo const & CSIPProfile::Type(void) const + ?Type@CSIPTransactionBase@@QBE?AVRStringF@@XZ @ 258 NONAME ; class RStringF CSIPTransactionBase::Type(void) const + ?UplinkData@CConnMonDeleteConnection@@QBEIXZ @ 259 NONAME ; unsigned int CConnMonDeleteConnection::UplinkData(void) const + ?UplinkData@CConnMonDeleteSubConnection@@QBEIXZ @ 260 NONAME ; unsigned int CConnMonDeleteSubConnection::UplinkData(void) const + ?UplinkData@CConnMonUplinkDataThreshold@@QBEIXZ @ 261 NONAME ; unsigned int CConnMonUplinkDataThreshold::UplinkData(void) const + ?UserHeaders@CSIPMessageElements@@QBEABV?$RPointerArray@VCSIPHeaderBase@@@@XZ @ 262 NONAME ; class RPointerArray const & CSIPMessageElements::UserHeaders(void) const + ?VerifySecurityCode@RMobilePhone@@QBEXAAVTRequestStatus@@W4TMobilePhoneSecurityCode@1@ABV?$TBuf@$09@@2@Z @ 263 NONAME ; void RMobilePhone::VerifySecurityCode(class TRequestStatus &, enum RMobilePhone::TMobilePhoneSecurityCode, class TBuf<10> const &, class TBuf<10> const &) const + ??1CSIPManagedProfile@@UAE@XZ @ 264 NONAME ; CSIPManagedProfile::~CSIPManagedProfile(void) + ?GetLocalAddrL@CSIPConnection@@QBEXAAVTInetAddr@@@Z @ 265 NONAME ; void CSIPConnection::GetLocalAddrL(class TInetAddr &) const + ?SendRequestL@CSIPConnection@@QAEPAVCSIPClientTransaction@@PAVCSIPRequestElements@@ABVMSIPRegistrationContext@@@Z @ 266 NONAME ; class CSIPClientTransaction * CSIPConnection::SendRequestL(class CSIPRequestElements *, class MSIPRegistrationContext const &) + ??1CRepository@@UAE@XZ @ 267 NONAME ; CRepository::~CRepository(void) + ?CommitTransaction@CRepository@@QAEHAAK@Z @ 268 NONAME ; int CRepository::CommitTransaction(unsigned long &) + ?Get@CRepository@@QAEHKAAH@Z @ 269 NONAME ; int CRepository::Get(unsigned long, int &) + ?NewL@CRepository@@SAPAV1@VTUid@@@Z @ 270 NONAME ; class CRepository * CRepository::NewL(class TUid) + ?Set@CRepository@@QAEHKH@Z @ 271 NONAME ; int CRepository::Set(unsigned long, int) + ?Set@CRepository@@QAEHKABVTDesC16@@@Z @ 272 NONAME ; int CRepository::Set(unsigned long, class TDesC16 const &) + ?Create@CRepository@@QAEHKABVTDesC8@@@Z @ 273 NONAME ; int CRepository::Create(unsigned long, class TDesC8 const &) + ?StartTransaction@CRepository@@QAEHW4TTransactionMode@1@@Z @ 274 NONAME ; int CRepository::StartTransaction(enum CRepository::TTransactionMode) + ?NewLC@CRepository@@SAPAV1@VTUid@@@Z @ 275 NONAME ; class CRepository * CRepository::NewLC(class TUid) + ?Create@CRepository@@QAEHKH@Z @ 276 NONAME ; int CRepository::Create(unsigned long, int) + ?Get@CRepository@@QAEHKAAVTDes16@@@Z @ 277 NONAME ; int CRepository::Get(unsigned long, class TDes16 &) + ?Delete@CRepository@@QAEHKKAAK@Z @ 278 NONAME ; int CRepository::Delete(unsigned long, unsigned long, unsigned long &) + ?FindL@CRepository@@QAEHKKAAV?$RArray@K@@@Z @ 279 NONAME ; int CRepository::FindL(unsigned long, unsigned long, class RArray &) + ?FindEqL@CRepository@@QAEHKKABVTDesC8@@AAV?$RArray@K@@@Z @ 280 NONAME ; int CRepository::FindEqL(unsigned long, unsigned long, class TDesC8 const &, class RArray &) + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/EABI/ut_availabilityu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/EABI/ut_availabilityu.def Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,2 @@ +EXPORTS + _Z16CreateTestSuiteLv @ 1 NONAME diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/Group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/Group/bld.inf Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,28 @@ +/* +* 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: project specification +* +*/ + + + +PRJ_PLATFORMS +DEFAULT + + +PRJ_EXPORTS + + +PRJ_MMPFILES +ut_availability.mmp diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/Group/ut_availability.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/Group/ut_availability.mmp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,209 @@ +/* +* 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: +* +*/ + +#include +#include + +TARGET ut_availability.dll +TARGETTYPE dll +EPOCALLOWDLLDATA +TARGETPATH /DigiaEUnit/Tests +UID 0x1000af5a 0x01700000 + +MACRO UNIT_TESTING +//epocallowdlldata + + +CAPABILITY EUNIT_CAPS +VENDORID VID_DEFAULT + +// Test sources + +SOURCEPATH ../src +SOURCE UT_availabilityDllMain.cpp +SOURCE UT_CMusAvaDefaultImp.cpp +SOURCE UT_CMusAvaContactAvailability.cpp +SOURCE UT_CMusAvaConnectionMonitor.cpp +SOURCE UT_CMusAvaSip.cpp +SOURCE UT_CMusAvaSipObserver.cpp +SOURCE UT_CMusAvaSipConnectionObserver.cpp +SOURCE UT_CMusAvaRegisterAvailability.cpp +SOURCE UT_CMusAvaInviteResponder.cpp +SOURCE UT_CMusAvaSharedObject.cpp +SOURCE UT_CMusAvaConnectionAvailability.cpp +SOURCE UT_CMusAvaNetworkRegistrationStatus.cpp +SOURCE UT_CMusAvaNetworkModeStatus.cpp +SOURCE UT_CMusAvaInviteHandler.cpp +SOURCE UT_CMusAvaOptionHandler.cpp +SOURCE UT_CMusAvaSettingsImp.cpp +SOURCE UT_CMusAvaCapabilityExchange.cpp +SOURCE UT_CMusAvaCapability.cpp +SOURCE UT_CMusAvaTerminal.cpp +SOURCE UT_CMusAvaCapabilitySipAgent.cpp +SOURCE UT_CMusAvaCapabilityQuery.cpp +SOURCE UT_CMusAvaDefaultOptionHandler.cpp +SOURCE UT_CMusAvaSipprofileAvailability.cpp +SOURCE UT_CMusAvaSipProfileRegistryObserver.cpp +SOURCE UT_CMusAvaNetworkAvailability.cpp +SOURCE UT_CMusAvaSettingAvailability.cpp +SOURCE UT_CMusAvaCallEventMonitor.cpp +SOURCE UT_CMusAvaSipheaderUtil.cpp +SOURCE ut_cmusavaclientresolverutil.cpp +SOURCE musavacapabilitytesthelper.cpp + + +// Tested sources + +SOURCEPATH ../../../src +SOURCE musavaconnectionmonitor.cpp +SOURCE musavacontactavailability.cpp +SOURCE musavainvitehandler.cpp +SOURCE musavaoptionhandler.cpp +SOURCE musavainviteresponder.cpp +SOURCE musavanetworkavailability.cpp +SOURCE musavaproxy.cpp +SOURCE musavaregisteravailability.cpp +SOURCE musavadefaultimp.cpp +SOURCE musavasettingsimp.cpp +SOURCE musavasharedobject.cpp +SOURCE musavasip.cpp +SOURCE musavasipconnectionobserver.cpp +SOURCE musavasipobserver.cpp +SOURCE musavasipprofileregistryobserver.cpp +SOURCE musavaconnectionavailability.cpp +SOURCE musavatelephonystatusbase.cpp +SOURCE musavanetworkregistrationstatus.cpp +SOURCE musavanetworkmodestatus.cpp +SOURCE musavamain.cpp +SOURCE musavacapabilityexchange.cpp +SOURCE musavacapability.cpp +SOURCE musavacapabilitysipagent.cpp +SOURCE musavaterminal.cpp +SOURCE musavacapabilitycontext.cpp +SOURCE musavacalleventmonitor.cpp +SOURCE musavacapabilitytimer.cpp +SOURCE musavacapabilityquery.cpp +SOURCE musavacapabilityquerybase.cpp +SOURCE musavadefaultoptionhandler.cpp +SOURCE musavasipprofileavailability.cpp +SOURCE musavasettingavailability.cpp +SOURCE musavasipheaderutil.cpp +SOURCE musavaclientresolverutil.cpp + + +// Stubs + +SOURCEPATH ../Stubs/src +SOURCE Csipconnection.cpp +SOURCE CSipSseTestTls.cpp +SOURCE musavaobserverimp.cpp +SOURCE RConnMon.cpp +SOURCE musavatimer.cpp +SOURCE musavaconnectionMonitorobserverimp.cpp +SOURCE musavatelephonystatusobserverimp.cpp +SOURCE mm_phone.cpp +SOURCE musavasettingsobserverimp.cpp +SOURCE musavaInviteresponderobserverimp.cpp +SOURCE csipclienttransaction.cpp +SOURCE Csipservertransaction.cpp +SOURCE CMusAvaAvailabilityObserverImp.cpp +SOURCE musavacapabilityqueryobserverimp.cpp +SOURCE musavasipadapterimp.cpp +SOURCE musavaprofileregistryadapterstub.cpp +SOURCE centralrepositorystub.cpp +SOURCE sipprofileregistrystub.cpp +SOURCE sipprofilestub.cpp +SOURCE csipcontactheaderstub.cpp +SOURCE musavacallmonitorobserver.cpp +SOURCE muscallmonitorstub.cpp + +SOURCEPATH ../../../../../tsrc/sipprofilestub/src +SOURCE sipstub.cpp +SOURCE sipprofileregistrybasestub.cpp +SOURCE sipmanagedprofileregistrystub.cpp +SOURCE sipmanagedprofilestub.cpp + +SOURCEPATH ../../../../../tsrc/sipclientstub/src +SOURCE CSIPResponseElements.cpp +SOURCE CSIPRequestElements.cpp +SOURCE Csiptransactionbase.cpp +SOURCE CSIPMessageElements.cpp + +SOURCEPATH ../../../../../tsrc/musavaailabilitystub/src +SOURCE musavaailabilitystub.cpp + +SOURCEPATH ../../../../../mmshplugins/mmshaoplugin/src +SOURCE muscalleventmonitor.cpp +SOURCE muscallmonitor.cpp + +//SOURCE musconferencecallmonitor.cpp +// Using RProperty Stubs +SOURCEPATH ../../../../../tsrc/propertystub/src +SOURCE e32property.cpp + +MACRO CAPABILITY_UNIT_TESTING + +// INCLUDE PATHS + +USERINCLUDE ../inc +USERINCLUDE ../Stubs/inc +USERINCLUDE ../../../inc +USERINCLUDE ../../../../mmshshared/inc +USERINCLUDE ../../../../inc +USERINCLUDE ../../../../../inc +USERINCLUDE ../../../../cenrep +USERINCLUDE ../../../../../mmshplugins/mmshaoplugin/inc +USERINCLUDE ../../../../../tsrc/propertystub/inc +USERINCLUDE ../../../../../tsrc/sipclientstub/inc +USERINCLUDE ../../../../../tsrc/musavaailabilitystub/inc +USERINCLUDE ../../../../../tsrc/centralrepositorystub/inc +USERINCLUDE ../../../../../tsrc/sipprofilestub/inc + +SYSTEMINCLUDE ../../../../../tsrc/sipprofilestub/inc +SYSTEMINCLUDE ../../../../../tsrc/sipclientstub/inc +SYSTEMINCLUDE ../../../../../tsrc/musavaailabilitystub/inc +SYSTEMINCLUDE ../../../../../tsrc/centralrepositorystub/inc +SYSTEMINCLUDE ../../../../../tsrc/propertystub/inc +SYSTEMINCLUDE /epoc32/include/platform/digia/eunit + +APP_LAYER_SYSTEMINCLUDE + +// LIBRARIES + +LIBRARY EUnit.lib +LIBRARY euser.lib +LIBRARY ECom.lib +LIBRARY inetprotutil.lib +LIBRARY apgrfx.lib +LIBRARY apparc.lib +LIBRARY bafl.lib +LIBRARY charconv.lib +LIBRARY commdb.lib +LIBRARY cntmodel.lib +LIBRARY etel3rdparty.lib +LIBRARY esock.lib +LIBRARY insock.lib +LIBRARY sdpcodec.lib +LIBRARY sipcodec.lib +LIBRARY connmon.lib +LIBRARY etelmm.lib +LIBRARY etel.lib +LIBRARY estor.lib +DEBUGLIBRARY flogger.lib + +//EXPORTUNFROZEN +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/CSipSseTestTls.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/CSipSseTestTls.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,195 @@ +/* +* Copyright (c) 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: +* +*/ + + + +#ifndef CSIPSSETESTTLS_H +#define CSIPSSETESTTLS_H + +#include "musavaobserver.h" +#include +#include +#include +#include + +#include +#include + +class CSIPMessageElements; +class CSIPResponseElements; +class RStringF; +class CSdpDocument; +class CSsfInvitation; +class TRequestStatus; +class CConnMonEventBase; +class CSIPRequestElements; + +//class CTelephony; +//class MSIPProfileRegistryObserver; + +// STUB stuff + +typedef TInt TSIPProfileBehavior; +const TSIPProfileBehavior KRegistryLeaveAtConstruct = 1; +const TSIPProfileBehavior KSIPProfileIdFetchFails = 2; +const TSIPProfileBehavior KSIPIapIdFetchFails = 3; +const TSIPProfileBehavior KSIPConnectionLeaveAtConstruct = 4; + +class CSipSseTestTls : public CBase + { + +public: + + static void OpenL(); + + static void Close(); + + static CSipSseTestTls* Storage(); + + ~CSipSseTestTls(); + + void Reset(); + + TInt Set(TUint32 aKey, TInt aValue); + + TInt Get(TUint32 aKey, TInt& aValue); + + void SetError( TInt aError ); + + TInt Error() const; + + void Clear(); + + void SetRequestStatus( TRequestStatus& iStatus ); + + TBool RegisterStatus(); + + void SetRegisterStatus( TBool aStatus ); + + TBool RegisterSent(); + + void StoreRegistry( MSIPProfileRegistryObserver& aRegistry ); + + void ProfileRegistryEventOccurred( TUint32 aProfileId, + MSIPProfileRegistryObserver::TEvent aEvent ); + /* + void AvailabilityState( MMusAvaObserver::TAvailabilityState aState, + MMusAvaObserver::TAvailabilityStatus aStatus, + MMusAvaObserver::TAvailabilityName aName ); + + */ + + void SetState( MMusAvaObserver::TAvailabilityStatus aStatus ); + + //RCommMon + TInt ConnectionCount(); + + void SetConnectionCount( TInt aCount ); + + void ConnectionInfo( const TUint& aIndex, + TUint& aConnectionId, + TUint& aSubConnectionCount ); + + void SetConnectionInfo( TUint aConnectionId, + TUint aSubConnectionCount ); + + void GetUintAttribute( const TUint aConnectionId, + const TUint aSubConnectionId, + const TUint aAttribute, + TUint& aValue, + TRequestStatus& aStatus ); + + void SetUintAttribute( const TUint aConnectionId, + const TUint aSubConnectionId, + const TUint aAttribute, + TUint aValue, + TRequestStatus& aStatus ); + + void GetIntAttribute( const TUint aConnectionId, + const TUint aSubConnectionId, + const TUint aAttribute, + TInt& aValue, + TRequestStatus& aStatus ); + + void SetIntAttribute( const TUint aConnectionId, + const TUint aSubConnectionId, + const TUint aAttribute, + TInt aValue, + TRequestStatus& aStatus ); + + void SetEvent(const CConnMonEventBase& aConnMonEvent ); + + + const CConnMonEventBase& Event(); + + + void SetRegistrationStatus( RMobilePhone::TMobilePhoneRegistrationStatus aRegStatus ); + void SetRegistrationStatus( RMobilePhone::TMobilePhoneRegistrationStatus* aRegStatus ); + + void RegistrationStatus( RMobilePhone::TMobilePhoneRegistrationStatus& aReqStatus ); + + void SetPhoneNetworkModeStatus( RMobilePhone::TMobilePhoneNetworkMode aStatus ); + + RMobilePhone::TMobilePhoneNetworkMode& PhoneNetworkModeStatus(); + + void ClientRequest( CSIPRequestElements* aRequest ); + void ClientResponse( RStringF aMethod, CSIPResponseElements* aResponse ); + +private: + + CSipSseTestTls(); + +public://data + + // Stubs leave/return this error + TInt iError; + static TBool iSipRegisterStatus; + MSIPProfileRegistryObserver* iRegistry; + //MMusAvaObserver::TAvailabilityState iState; + MMusAvaObserver::TAvailabilityStatus iStatus; + MMusAvaObserver::TAvailabilityName iName; + //RCommMon + TInt iConnectionCount; + //ConnectionInfo + TUint iConnectionId; + TUint iSubConnectionCount; + //UintAttribute + TUint iUintAttributeValue; + //UintAttribute + TUint iIntAttributeValue; + TRequestStatus iRequestStatus; + CConnMonEventBase* iConnMonEventBase; + + RMobilePhone::TMobilePhoneRegistrationStatus iPhoneRegistrationStatus; + RMobilePhone::TMobilePhoneRegistrationStatus* iPhoneRegistrationStatusPointer; + RMobilePhone::TMobilePhoneNetworkMode iPhoneNetworkMode; + + CSIPRequestElements* iClientRequest; + RStringF iResponseToRequest; + CSIPResponseElements* iClientResponse; + RArray iKeys; + RArray iValues; + TSIPProfileBehavior iRegistryBehavior; + TSIPProfileBehavior iProfileBehavior; + TSIPProfileBehavior iConnectionBehavior; + }; + + + +#endif + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/centralrepository.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/centralrepository.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,293 @@ +/* +* 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: +* +*/ + + +#ifndef __CENTRALREPOSITORY_H__ +#define __CENTRALREPOSITORY_H__ + +#include "mussettingskeys.h" + +#include + + +namespace NCentralRepositoryConstants +/** Namespace encapsulating the CentralRepository constants. +@publishedAll +@released +*/ +{ + +/** The maximum number of unicode characters that can be stored in a setting +@publishedAll +@released +*/ +const TInt KMaxUnicodeStringLength = 1024; + +/** The maximum number of bytes that can be stored in a setting +@publishedAll +@released +*/ +const TInt KMaxBinaryLength = KMaxUnicodeStringLength*2; + +/** Error key returned by CommitTransaction in case of an error that cannot be +attributed to any single or partial key. Also notify value for spurious +notifications (eg when a notification is cancelled or several values change at once ) +@internalAll +@released +*/ +const TUint32 KUnspecifiedKey = 0xffffffffUL; + +/** Initial buffer size for Find~ API. Initial buffer is used to cut on the number +of IPC calls required for each Find~ API call. If the number of settings found is +less than or equal to KCentRepFindBufSize then all the settings can be retrieved with +a single IPC. +@internalAll +*/ +const TInt KCentRepFindBufSize = 16; + +/** Use KUnspecifiedKey instead of this value. +@publishedAll +@deprecated +*/ +const TUint32 KInvalidNotificationId = KUnspecifiedKey; + +/** The 8 most significant bits of a setting's meta-data are reserved for internal use. +Clients should not make use of the reserved bits (unless it is specifically stated +otherwise in Symbian developer documentation). Clients should not rely on the value +of the reserved bits. Reserved bits are not guaranteed to be 0 or 1 and are not +guaranteed to stay constant from one GetMeta call to the next. +@publishedPartner +@released +@see CRepository::GetMeta +@see KMetaUnreserved +*/ +const TUint32 KMetaSymbianReserved = 0xFF000000; + +/** The 24 least significant bits of a setting's meta-data are available for use. Clients +should make use of KMetaUnreserved to mask out the reserved bits following a call +to GetMeta. Clients should not rely on the value of the reserved bits. Reserved bits +are not guaranteed to be 0 or 1 and are not guaranteed to stay constant from one +GetMeta call to the next. +@publishedPartner +@released +@see CRepository::GetMeta +@see KMetaSymbianReserved +*/ +const TUint32 KMetaUnreserved = 0x00FFFFFF; + +} // namespace NCentralRepositoryConstants + +/* +class CCRepositoryBehaviorTls : public CBase + { +public: + static void OpenL(); + static void Close(); + + static CCRepositoryBehaviorTls* Storage(); + + void Reset(); + TInt Set(TUint32 aKey, TInt aValue); + TInt Get(TUint32 aKey, TInt& aValue); + +private: + + CCRepositoryBehaviorTls(); + ~CCRepositoryBehaviorTls(); + +public: + RArray iKeys; + RArray iValues; + + }; + +*/ +/** Provides access to a repository. + +There are potentially 2^32 repositories, each identified by a UID. Within each +repository up to 2^32 settings can be stored. Settings within a repository are +identified by a 32-bit key and may be of the types integer, real or descriptor. +@publishedAll +@released +*/ +class CRepository : public CBase + { +public: + + /** Transaction mode chosen with StartTransaction. + @publishedPartner + @released */ + enum TTransactionMode + { + /** Standard optimistic non-serialised transaction. Can be started at any time + Commit fails with KErrLocked if another client interrupts it by first committing + changes: transaction should be repeated until KErrLocked is not returned. */ + EConcurrentReadWriteTransaction = 2, + /** Pessimistic locking transaction intended for reading consistent values. + Can only be started if EReadWriteTransaction is not in progress. + Automatically promoted to EReadWriteTransaction on first write operation + if no other read transaction is in progress (or fails if not attainable). + Use ONLY if all clients can agree not to use EConcurrentReadWriteTransaction, + and only make changes in an EReadWriteTransaction. */ + EReadTransaction = 1, + /** Pessimistic locking transaction intended for writing values. Can only be + started if no EReadTransaction or EReadWriteTransactions are in progress. + Use ONLY if all clients can agree not to use EConcurrentReadWriteTransaction, + and only make changes in an EReadWriteTransaction. */ + EReadWriteTransaction = 3 + }; + + /** Buffer type for aKeyInfo parameter to asynchronous CommitTransaction. + @see CRepository::CommitTransaction(TDes8& aKeyInfo, TRequestStatus& aStatus) + @publishedPartner + @released + */ + typedef TPckgBuf TTransactionKeyInfoBuf; + //static void OpenL(); + IMPORT_C static CRepository* NewL(TUid aRepositoryUid); + IMPORT_C static CRepository* NewLC(TUid aRepositoryUid); + + IMPORT_C virtual ~CRepository(); + + + IMPORT_C TInt Create(TUint32 aKey, TInt aValue); + //IMPORT_C TInt Create(TUint32 aKey, const TReal& aValue); + IMPORT_C TInt Create(TUint32 aKey, const TDesC8& aValue); + //IMPORT_C TInt Create(TUint32 aKey, const TDesC16& aValue); + //IMPORT_C TInt Delete(TUint32 aKey); + IMPORT_C TInt Delete(TUint32 aPartialKey, TUint32 aMask, TUint32 &aErrorKey) ; + + + IMPORT_C TInt Get(TUint32 aKey, TInt& aValue); + IMPORT_C TInt Set(TUint32 aKey, TInt aValue); + +/* + IMPORT_C TInt Get(TUint32 aKey, TReal& aValue); + IMPORT_C TInt Set(TUint32 aKey, const TReal& aValue); +*/ + IMPORT_C TInt Get(TUint32 aKey, TDes8& aValue); + //IMPORT_C TInt Get(TUint32 aId, TDes8& aValue, TInt& aActualLength); + IMPORT_C TInt Set(TUint32 aKey, const TDesC8& aValue); + + IMPORT_C TInt Get(TUint32 aKey, TDes16& aValue); + IMPORT_C TInt Get(TUint32 aId, TDes16& aValue, TInt& aActualLength); + IMPORT_C TInt Set(TUint32 aKey, const TDesC16& aValue); +/* + IMPORT_C TInt GetMeta(TUint32 aKey, TUint32& aMeta); + + IMPORT_C TInt Move (TUint32 aSourcePartialKey, TUint32 aTargetPartialKey, + TUint32 aMask, TUint32 &aErrorKey) ; +*/ + IMPORT_C TInt FindL(TUint32 aPartialKey, TUint32 aMask, + RArray& aFoundKeys); +/* + IMPORT_C TInt FindEqL(TUint32 aPartialKey, TUint32 aMask, + TInt aValue, RArray& aFoundKeys); + IMPORT_C TInt FindEqL(TUint32 aPartialKey, TUint32 aMask, + const TReal& aValue, RArray& aFoundKeys); +*/ + IMPORT_C TInt FindEqL(TUint32 aPartialKey, TUint32 aMask, + const TDesC8& aValue, RArray& aFoundKeys); +/* + IMPORT_C TInt FindEqL(TUint32 aPartialKey, TUint32 aMask, + const TDesC16& aValue, RArray& aFoundKeys); + + IMPORT_C TInt FindNeqL(TUint32 aPartialKey, TUint32 aMask, + TInt aValue, RArray& aFoundKeys); + IMPORT_C TInt FindNeqL(TUint32 aPartialKey, TUint32 aMask, + const TReal& aValue, RArray& aFoundKeys); + IMPORT_C TInt FindNeqL(TUint32 aPartialKey, TUint32 aMask, + const TDesC8& aValue, RArray& aFoundKeys); + IMPORT_C TInt FindNeqL(TUint32 aPartialKey, TUint32 aMask, + const TDesC16& aValue, RArray& aFoundKeys); + + IMPORT_C TInt NotifyRequest(TUint32 aKey, TRequestStatus& aStatus); + IMPORT_C TInt NotifyRequest(TUint32 aPartialKey, TUint32 aMask, + TRequestStatus& aStatus); + + IMPORT_C TInt NotifyCancel(TUint32 aKey); + IMPORT_C TInt NotifyCancel(TUint32 aPartialKey, TUint32 aMask); + IMPORT_C TInt NotifyCancelAll(); + + IMPORT_C TInt Reset(); + IMPORT_C TInt Reset(TUint32 aKey); +*/ + + IMPORT_C TInt StartTransaction(TTransactionMode aMode); + //IMPORT_C void StartTransaction(TTransactionMode aMode, TRequestStatus& aStatus); + IMPORT_C TInt CommitTransaction(TUint32& aKeyInfo); + //IMPORT_C void CommitTransaction(TDes8& aKeyInfo, TRequestStatus& aStatus); + //IMPORT_C void CancelTransaction(); + //IMPORT_C void CleanupCancelTransactionPushL(); + //IMPORT_C void FailTransaction(); + //IMPORT_C void CleanupFailTransactionPushL(); + + /** Same as CancelTransaction. + @publishedPartner + @released + @see CancelTransaction */ +/* + inline void RollbackTransaction() + { + CancelTransaction(); + } +*/ + /** Same as CleanupCancelTransactionPushL. + @publishedPartner + @released + @see CleanupCancelTransactionPushL */ +/* + inline void CleanupRollbackTransactionPushL() + { + CleanupCancelTransactionPushL(); + } +*/ +// IMPORT_C TInt TransactionState(); + + /** This API is for internal use only and for testing purposes. + @internalAll + */ +// IMPORT_C static TInt SetGetParameters(const TIpcArgs& aArgs); + + + + +private: // Stub functions + + CRepository( TUid aRepositoryUid ); + static CRepository* Instance(); + +public: // Stub functios + + void ResetKeysAndValues(); + static void Close(); + + +public: // Stub data + + static MusSettingsKeys::TOperatorVariant iOperatorVariant; + + // If the following value is ETrue, CenRep UID KCRUidSIPClientResolverConfig + // exists and respository is possible to create with this value. Otherwise + // CenRep instantiation leaves with KErrNone. + static TBool iEmulateSawfishRepository; + + TUid iRepositoryUid; + + }; + +#endif // __CENTRALREPOSITORY_H__ diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/csipserverstub.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/csipserverstub.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,56 @@ +/* +* Copyright (c) 2005-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: SIP Server Stub +* +*/ + + +#ifndef CSIPSERVERSTUB_H +#define CSIPSERVERSTUB_H + +#include // CBase +#include + +class CSIPRequestElements; +class CSIPResponseElements; + + +class CSIPServerStub : public CBase + + { +public: + + static void OpenL(); + static void Close(); + static CSIPServerStub* Server(); + + ~CSIPServerStub(); + + void Reset(); + + void ClientRequest( CSIPRequestElements* aRequest ); + void ClientResponse( RStringF aMethod, CSIPResponseElements* aResponse ); + +public: //data + + + CSIPRequestElements* iClientRequest; + RStringF iResponseToRequest; + CSIPResponseElements* iClientResponse; + + + }; + + +#endif //CSIPSERVERSTUB_H \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/etelmm.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/etelmm.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,12666 @@ +/* +* Copyright (c) 2000-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: +* +*/ + + +/** +@file + +Multimode ETel API header file. + +Describes the MM ETel API - classes, methods and types. + +@publishedPartner +@released +*/ + +#ifndef __ETELMM_H__ +#define __ETELMM_H__ + +#include +#include +#include +#include + + +/** +Internal API/TSY delimiter used to pass the phonebook type +*/ +#define PHBOOK_DELIMITER _L("//") +/** The size of the phone book delimiter string. +@internalComponent + */ +const TInt KSizeOfPhbookDelimiter=2; + +/** +Names for Multimode ETel sub-sessions +*/ +_LIT(KETelMeAdnPhoneBook,"S1"); +_LIT(KETelMeDialledPhoneBook,"S2"); +_LIT(KETelMeMissedPhoneBook,"S3"); +_LIT(KETelMeReceivedPhoneBook,"S4"); +_LIT(KETelCombinedAdnPhoneBook,"S5"); +_LIT(KETelTaAdnPhoneBook,"S6"); +_LIT(KETelIccAdnPhoneBook,"S7"); +_LIT(KETelIccFdnPhoneBook,"S8"); +_LIT(KETelIccSdnPhoneBook,"S9"); +_LIT(KETelIccBdnPhoneBook,"S10"); +_LIT(KETelIccLndPhoneBook,"S11"); +_LIT(KETelIccVoiceMailBox,"S12"); + +_LIT(KETelMeSmsStore,"S13"); +_LIT(KETelIccSmsStore,"S14"); +_LIT(KETelCombinedSmsStore,"S15"); + +_LIT(KETelNamStore,"S16"); +_LIT(KETelOwnNumberStore,"S17"); +_LIT(KETelEmergencyNumberStore,"S18"); + +_LIT(KETelSmsMessaging,"S19"); +_LIT(KETelBroadcastMessaging,"S20"); +_LIT(KETelUssdMessaging,"S21"); + +_LIT(KETelConferenceCall,"S22"); + +_LIT(KETelIccMbdnPhoneBook, "S23"); +_LIT(KETelIccMsisdnPhoneBook, "S24"); +_LIT(KETelIccOciPhoneBook, "S25"); +_LIT(KETelIccIciPhoneBook, "S26"); +_LIT(KETelIccNamStore ,"S27"); +_LIT(KETelIccInfoPhoneBook, "S28"); + +_LIT(KETelLocationServices,"S29"); + +// Types for Multimode ETel sub-sessions + +_LIT(KEtelCdmaPhoneBookType,"T1"); +_LIT(KEtelGsmPhoneBookType,"T2"); +_LIT(KEtelUSimPhoneBookType,"T3"); + +// Types for SmartCardEap sub-sessions + +/** +The prefix to all RMobileSmartCardEap sub-session names. +*/ +_LIT(KETelSmartCardEapSession, "ScEap"); +/** +The length of KETelSmartCardEapSession. Used to obtain a const value +for this length at compile-time. +*/ +#define SCEAP_SSN_LENGTH 5 + +/** +EAP-MD5 type identifier. Value taken from section 5 of RFC 3748 Jun 2004. +This should be used as the EAP type identifier value of +RMobileSmartCardEap::Open() if standard EAP-MD5 challenges are to be used. + +This value corresponds to one of the possible values returned in the type +list of TUiccApplicationEapInfoV6. + +(Decimal value = 4) + +@see RMobileSmartCardEap::Open() +@see RMobilePhone::TUiccApplicationEapInfoV6 +*/ +_LIT8(KETelSmartCardEapTypeMD5, "04"); + +/** +EAP-TLS type identifier. Value taken from section 4.1 of RFC 2716 Oct 1999. +This should be used as the EAP type identifier value of +RMobileSmartCardEap::Open() if standard EAP-TLS is to be used. + +This value corresponds to one of the possible values returned in the type +list of TUiccApplicationEapInfoV6. + +(Decimal value = 13) + +@see RMobileSmartCardEap::Open() +@see RMobilePhone::TUiccApplicationEapInfoV6 +*/ +_LIT8(KETelSmartCardEapTypeTLS, "0D"); + +/** +EAP-SIM type identifier. +This should be used as the EAP type identifier value of +RMobileSmartCardEap::Open() if standard EAP-SIM is to be used. + +This value corresponds to one of the possible values returned in the type +list of TUiccApplicationEapInfoV6. + +(Decimal value = 18) + +@see RMobileSmartCardEap::Open() +@see RMobilePhone::TUiccApplicationEapInfoV6 +*/ +_LIT8(KETelSmartCardEapTypeSIM, "12"); + +/** +EAP-AKA type identifier. +This should be used as the EAP type identifier value of +RMobileSmartCardEap::Open() if standard EAP-AKA is to be used. + +This value corresponds to one of the possible values returned in the type +list of TUiccApplicationEapInfoV6. + +(Decimal value = 23) + +@see RMobileSmartCardEap::Open() +@see RMobilePhone::TUiccApplicationEapInfoV6 +*/ +_LIT8(KETelSmartCardEapTypeAKA, "17"); + +/** +EAP-TTLS type identifier. +This should be used as the EAP type identifier value of +RMobileSmartCardEap::Open() if standard EAP-TTLS is to be used. + +This value corresponds to one of the possible values returned in the type +list of TUiccApplicationEapInfoV6. + +(Decimal value = 21) + +@see RMobileSmartCardEap::Open() +@see RMobilePhone::TUiccApplicationEapInfoV6 +*/ +_LIT8(KETelSmartCardEapTypeTTLS, "15"); + +/***********************************************************************************/ +// +// Global Multimode constants and types +// +/***********************************************************************************/ + +/** +Unique API identifier and Functional Unit constants +Modes: Common +*/ +enum TMultimodeETelV1Api + { + /** TSY supports the Multimode ETel v1.0 API. + + Modes: Common */ + KETelExtMultimodeV1=3000, // 3000 is unique reference for Multimode Etel v1.0 API + /** TSY supports the MobileSimAccess functional unit. + + Modes: Common */ + KETelFuncMobileIccAccess, + /** TSY supports the MobileNetwork functional unit. + + Modes: Common */ + KETelFuncMobileNetwork, + /** TSY supports the MobileIdentity functional unit. + + Modes: Common */ + KETelFuncMobileIdentity, + /** TSY supports the MobilePower functional unit. + + Modes: Common */ + KETelFuncMobilePower, + /** TSY supports the MobileSignal functional unit. + + Modes: GSM/WCDMA */ + KETelFuncMobileSignal, + /** TSY supports the MobileIndicator functional unit. + + Modes: Common */ + KETelFuncMobileIndicator, + /** TSY supports the MobileDTMF functional unit. + + Modes: Common */ + KETelFuncMobileDTMF, + /** TSY supports the MobileUserNetworkAccess functional unit. + + Modes: Common */ + KETelFuncMobileUserNetworkAccess, + /** TSY supports the MobileIdentityService functional unit. + + Modes: Common */ + KETelFuncMobileIdentityService, + /** TSY supports the MobileCallForwarding functional unit. + + Modes: Common */ + KETelFuncMobileCallForwarding, + /** TSY supports the MobileCallBarring functional unit. + + Modes: GSM/WCDMA */ + KETelFuncMobileCallBarring, + /** TSY supports the MobileCallWaiting functional unit. + + Modes: Common */ + KETelFuncMobileCallWaiting, + /** TSY supports the MobileCallCompletion functional unit. */ + KETelFuncMobileCallCompletion, + /** TSY supports the MobileAlternatingCall functional unit. + + Modes: GSM/WCDMA */ + KETelFuncMobileAlternatingCall, + /** TSY supports the MobileCost functional unit. + + Modes: GSM/WCDMA */ + KETelFuncMobileCost, + /** TSY supports the MobileSecurity functional unit. + + Modes: Common */ + KETelFuncMobileSecurity, + /** TSY supports the MobileAlternateLineService functional unit. + + Modes: GSM/WCDMA */ + KETelFuncMobileAlternateLineService, + /** TSY supports the MobileMessageWaiting functional unit. + + Modes: Common */ + KETelFuncMobileMessageWaiting, + /** TSY supports the MobileFixedDiallingNumbers functional unit. + + Modes: GSM/WCDMA */ + KETelFuncMobileFixedDiallingNumbers, + /** TSY supports the MobileDataCall functional unit. + + Modes: Common */ + KETelFuncMobileDataCall, + /** TSY supports the MobilePrivacy functional unit. + + Modes: CDMA */ + KETelFuncMobilePrivacy, + /** TSY supports the MobileEmergencyCall functional unit. + + Modes: Common */ + KETelFuncMobileEmergencyCall, + /** TSY supports the MobileSmsMessaging functional unit. + + Modes: Common */ + KETelFuncMobileSmsMessaging, + /** TSY supports the MobileBroadcastMessaging functional unit. + + Modes: Common */ + KETelFuncMobileBroadcastMessaging, + /** TSY supports the MobileUssdMessaging functional unit. + + Modes: GSM/WCDMA */ + KETelFuncMobileUssdMessaging, + /** TSY supports the MobileConferenceCall functional unit. + + Modes: Common */ + KETelFuncMobileConferenceCall, + /** TSY supports the MobilePhonebookStore functional unit. + + Modes: Common */ + KETelFuncMobilePhonebook, + /** TSY supports the MobileSmsStore functional unit. + + Modes: Common */ + KETelFuncMobileSmsStore, + /** TSY supports the MobileNamStore functional unit. + + Modes: CDMA */ + KETelFuncMobileNamStore, + /** TSY supports the MobileONStore functional unit. + + Modes: Common */ + KETelFuncMobileOwnNumberStore, + /** TSY supports the MobileENStore functional unit. + + Modes: Common */ + KETelFuncMobileEmergencyNumberStore, + /** TSY supports the MobileMultimedia functional unit. + + Modes: GSM/WCDMA */ + KETelFuncMobileMulticall, + /** TSY supports the MobileNextIncomingCall functional unit. + + Modes: GSM/WCDMA */ + KETelFuncMobileNextIncomingCall, + /** TSY supports the MobileMultimediaCall functional unit. + + Modes: GSM/WCDMA */ + KETelFuncMobileMultimediaCall, + /** TSY supports the MobileUserSignalling functional unit. + + Modes: GSM/WCDMA */ + KETelFuncMobileUserSignalling + }; + +/** Unique API identifier and Functional Unit constants. +Modes: WCDMA + +*/ +enum TMultimodeETelV2Api + { + /** TSY supports the Multimode ETel v2.0 API. + + Modes: WCDMA */ + KETelExtMultimodeV2=7000, // 7000 is unique reference for Multimode Etel v2.0 API + /** TSY supports the MobileMultimediaCallSettings functional unit. + + Modes: WCDMA */ + KEtelFuncMobileMultimediaCallSettings, + /** TSY supports the MobileNetworkSecurity functional unit. + + Modes: WCDMA */ + KEtelFuncMobileNetworkSecurity, + KEtelFuncMobileUSIMApplications + }; + +/** +Enum to define the v3.0 API additions + +*/ +enum TMultimodeETelV3Api + { + /** + Indicator that the TSY supports the Multimode ETel v3.0 API. + */ + KETelExtMultimodeV3 = 10000, + /** + TSY supports the MobileMMSInformation functional unit. + */ + KEtelFuncMobileMMSInformation, // 10001 + /** + TSY supports the KEtelFuncMobileAirTime functional unit. + */ + KEtelFuncMobileAirTime, // 10002 + /** + TSY supports the KEtelFuncMobileAutoRedial functional unit. + */ + KEtelFuncMobileAutoRedial, // 10003 + /** + TSY supports the KEtelFuncMobilePersonalisation functional unit. + */ + KEtelFuncMobilePersonalisation, // 10004 + /** + TSY supports the KEtelMobileMailboxNumbers functional unit. + */ + KEtelFuncMobileMailboxNumbers, // 10005 + /** + TSY supports the Mobile APN Control List functional unit. + */ + KEtelFuncMobileAPNControlList // 10006 + }; + +/** +Enum to define the v4.0 API additions + +*/ +enum TMultimodeETelV4Api + { + /** + Indicator that the TSY supports the Multimode ETel v4.0 API. + */ + KETelExtMultimodeV4 = 15000 + }; + + +/** Enum to define Release 5 enabling API and data structures +*/ +enum TMultimodeEtelV5Api + { + /** + Indicator that the TSY supports the Multimode ETel v5.0 API. + */ + KEtelExtMultimodeV5=20000, + /** + Indicator that the TSY supports the IMS functional unit. + */ + KEtelFuncMobileIMS, // 20001 + /** + TSY supports the KEtelFuncMobileSmartCardApplications functional unit. + */ + KEtelFuncMobileSmartCardApplications // 20002 + }; + + +/** +Enum to define the v6.0 API additions. +*/ +enum TMultimodeEtelV6Api + { + /** + Indicator that the TSY supports the Multimode ETel v6.0 API. + */ + KEtelExtMultimodeV6=25000, + /** + Indicator that the TSY supports the EAP supporting functional unit. + */ + KEtelSmartCardEap // 25001 + }; +/** +Enum to define the v7.0 API additions. +*/ +enum TMultimodeEtelV7Api + { + /** + Indicator that the TSY supports the Multimode ETel v7.0 API. + */ + KEtelExtMultimodeV7=30000, + /** + Indicator that the TSY supports the LocationServices supporting functional unit. + */ + KEtelLocationControlServices // 30001 + }; +/** +Enum to define the Etel 3rdParty V1 API additions + +*/ +enum TMultimodeETel3rdPartyV1Api + { + /** + Indicator that the TSY supports the Etel 3rd Party v1.0 API + */ + KETelExt3rdPartyV1 = 40000 + }; + +/*********************************************************/ +// +// Phone based functionality (RMobilePhone) +// +/*********************************************************/ + + +class CMobilePhonePtrHolder; +class CMobilePhoneStoredNetworkList; +class RMobileSmartCardEap; + +class RMobilePhone : public RPhone +/** +Provides client access to mobile phone functionality provided by TSY. + +Encapsulates access to a mobile phone. The functionality of RMobilePhone +is divided into a number of functional units, for the purpose of easier documentation +and navigation and selectable support by TSY. + +Note: Some RMobilePhone function members must be supported by the TSY while +others are part of optional "functional unit" and only need to be supported +if the TSY supports that functional unit. When a functional unit is mandatory +then the unit should at least support the Get...Caps() member function to +indicate the member functions that are supported for this unit. + +*/ + { +public: + friend class CAsyncRetrievePhoneList; + IMPORT_C RMobilePhone(); + + // Global multimode types + + + class TMultimodeType + /** + Base class for all the V1 parameter types defined within the API. + + @publishedPartner + @released + */ + { + public: + IMPORT_C TInt ExtensionId() const; + protected: + TMultimodeType(); + void InternalizeL(RReadStream& aStream); + void ExternalizeL(RWriteStream& aStream) const; + protected: + TInt iExtensionId; + }; + + /** A typedef'd packaged TMultimodeType for passing through a generic API + function member. */ + typedef TPckg TMultimodeTypePckg; + + // Types used in RMobilePhone::TMobileAddress + +/** Address types. + +Modes: Common */ + enum TMobileTON + { + /** User or the network has no knowledge of the type of number. + + Modes: Common */ + EUnknownNumber, // 0 + /** International number. + + Modes: Common */ + EInternationalNumber, // 1 + /** National number. + + Modes: Common */ + ENationalNumber, // 2 + /** Administration/service number specific to the serving network, e.g. used to + access an operator. + + Modes: Common */ + ENetworkSpecificNumber, // 3 + /** Subscriber number. + + Modes: Common */ + ESubscriberNumber, // 4 - Also defined as "dedicated, short code" in GSM 04.08 + /** Alphanumeric number coded according to 3GPP TS 123 038 GSM 7-bit default alphabet. + + Modes: GSM/WCDMA */ + EAlphanumericNumber, // 5 + /** Abbreviated number. + + Modes: Common */ + EAbbreviatedNumber // 6 + }; + +/** Number Plan Indicator. + +Modes: Common */ + enum TMobileNPI + { + /** User or the network has no knowledge of the numbering plan. + + Modes: Common */ + EUnknownNumberingPlan =0, + /** ISDN/telephony numbering plan. + + Modes: Common */ + EIsdnNumberPlan=1, + /** Data numbering plan. + + Modes: Common */ + EDataNumberPlan=3, + /** Telex numbering plan. + + Modes: Common */ + ETelexNumberPlan=4, + /** Service centre specific plan used to indicate a numbering plan specific to external + Short Message entities attached to the SMSC. */ + EServiceCentreSpecificPlan1=5, + /** Service centre specific plan used to indicate a numbering plan specific to external + Short Message entities attached to the SMSC. + + Modes: GSM/WCDMA */ + EServiceCentreSpecificPlan2=6, + /** National numbering plan. + + Modes: GSM/WCDMA */ + ENationalNumberPlan=8, + /** Private numbering plan. + + Modes: Common */ + EPrivateNumberPlan=9, + /** ERMES numbering plan. + + Modes: GSM/WCDMA */ + EERMESNumberPlan=10 + }; + + enum + { + KMaxMobilePasswordSize=10, + KMaxMobileNameSize=32, + KMaxMobileTelNumberSize=100 + }; + + struct TMMTableSettings + { + TUint32 iLocId; + }; + + typedef TPckg TMMTableSettingsPckg; + + + + class TMobileAddress + /** + Defines API abstraction of a mobile telephone number. + + @publishedPartner + @released + */ + { + public: + IMPORT_C TMobileAddress(); + + void InternalizeL(RReadStream& aStream); + void ExternalizeL(RWriteStream& aStream) const; + + public: + /** Type of number. + + @see TMobileTON */ + TMobileTON iTypeOfNumber; + /** Number plan. + + @see TMobileNPI */ + TMobileNPI iNumberPlan; + /** Telephone number. */ + TBuf iTelNumber; + }; + + // Mobile information location type + + /** Defines Location of service information. + + Modes: Common */ + enum TMobileInfoLocation + { + /** Retrieve the service information ONLY from the cache on the phone. Return KErrNotFound + if the cache does not exist or it is empty. */ + EInfoLocationCache, + /** Retrieve the service information from the cache, but if this is empty or does + not exist then interrogate the network. */ + EInfoLocationCachePreferred, + /** Retrieve the service information from the network (and refresh the cache if + there is one). */ + EInfoLocationNetwork + }; + + // Mobile call service type + + /** Applicability of request to a mobile service group. + + Modes: Common */ + enum TMobileService + { + /** The call service has not been specified. + + Modes: Common */ + EServiceUnspecified, + /** The API request applies to voice call services. + + Modes: Common */ + EVoiceService, + /** The API request applies to auxiliary voice call services. + + Modes: GSM/WCDMA */ + EAuxVoiceService, + /** The API request applies to circuit switched data call services. + + Modes: Common */ + ECircuitDataService, + /** The API request applies to packet data services. + + Modes: Common */ + EPacketDataService, + /** The API request applies to fax call services. + + Modes: Common */ + EFaxService, + /** The API request applies to short message services. + + Modes: Common */ + EShortMessageService, + /** The API request applies to all mobile services. + + Modes: Common */ + EAllServices, + /** All teleservices + + Modes: Common */ + EAllTele, + /** Telephony + + Modes: Common */ + ETelephony, + /** All data teleservices + + Modes: Common */ + EAllDataTele, + /** Voice Broadcast Service (VBS) Bearer Service + + Modes: Common */ + EAllDataExSms, + /** All teleservices except SMS + + Modes: Common */ + EAllTeleExcSms, + /** All PLMN specific teleservices + + Modes: Common */ + EAllPlmnTele, + /** PLMN specific teleservice 1 + + Modes: Common */ + EPlmnTele1, + /** PLMN specific teleservice 2 + + Modes: Common */ + EPlmnTele2, + /** PLMN specific teleservice 3 + + Modes: Common */ + EPlmnTele3, + /** PLMN specific teleservice 4 + + Modes: Common */ + EPlmnTele4, + /** PLMN specific teleservice 5 + + Modes: Common */ + EPlmnTele5, + /** PLMN specific teleservice 6 + + Modes: Common */ + EPlmnTele6, + /** PLMN specific teleservice 7 + + Modes: Common */ + EPlmnTele7, + /** PLMN specific teleservice 8 + + Modes: Common */ + EPlmnTele8, + /** PLMN specific teleservice 9 + + Modes: Common */ + EPlmnTele9, + /** PLMN specific teleservice 10 + + Modes: Common */ + EPlmnTeleA, + /** PLMN specific teleservice 11 + + Modes: Common */ + EPlmnTeleB, + /** PLMN specific teleservice 12 + + Modes: Common */ + EPlmnTeleC, + /** PLMN specific teleservice 13 + + Modes: Common */ + EPlmnTeleD, + /** PLMN specific teleservice 14 + + Modes: Common */ + EPlmnTeleE, + /** PLMN specific teleservice 15 + + Modes: Common */ + EPlmnTeleF, + /** All bearer services + + Modes: Common */ + EAllBearer, + /** All async services + + Modes: Common */ + EAllAsync, + /** All sync services + + Modes: Common */ + EAllSync, + /** All data circuit sync + + Modes: Common */ + ESyncData, + /** All data circuit async + + Modes: Common */ + EAsyncData, + /** All packet data services + + Modes: Common */ + EPacketData, + /** All pad access services + + Modes: Common */ + EPadAccess, + /** All PLMN specific bearer services + + Modes: Common */ + EAllPlmnBearer, + /** PLMN specific bearer service 1 + + Modes: Common */ + EPlmnBearerServ1, + /** PLMN specific bearer service 2 + + Modes: Common */ + EPlmnBearerServ2, + /** PLMN specific bearer service 3 + + Modes: Common */ + EPlmnBearerServ3, + /** PLMN specific bearer service 4 + + Modes: Common */ + EPlmnBearerServ4, + /** PLMN specific bearer service 5 + + Modes: Common */ + EPlmnBearerServ5, + /** PLMN specific bearer service 6 + + Modes: Common */ + EPlmnBearerServ6, + /** PLMN specific bearer service 7 + + Modes: Common */ + EPlmnBearerServ7, + /** PLMN specific bearer service 8 + + Modes: Common */ + EPlmnBearerServ8, + /** PLMN specific bearer service 9 + + Modes: Common */ + EPlmnBearerServ9, + /** PLMN specific bearer service 10 + + Modes: Common */ + EPlmnBearerServA, + /** PLMN specific bearer service 11 + + Modes: Common */ + EPlmnBearerServB, + /** PLMN specific bearer service 12 + + Modes: Common */ + EPlmnBearerServC, + /** PLMN specific bearer service 13 + + Modes: Common */ + EPlmnBearerServD, + /** PLMN specific bearer service 14 + + Modes: Common */ + EPlmnBearerServE, + /** PLMN specific bearer service 15 + + Modes: Common */ + EPlmnBearerServF, + /** Alternative tele services + + Modes: Common */ + EAltTele, + EVoiceGroupCall, + EVoiceBroadcast, + EAllGprsBearer + }; + + // Mobile name type + + /** A typedef to hold the names of API sub-sessions. The names are coded as ASCII + characters. */ + typedef TBuf TMobileName; + + // Mobile password type + + /** A typedef for the standard password used by mobile phones for secure access + to services (phone lock, SIM lock, call barring password). The password is + coded as Unicode characters. */ + typedef TBuf TMobilePassword; + + // for use by client-side API code and TSY only + + struct TClientId + /** This type is used within the 2-phase list retrieval classes. During both phases, + the client-side API code will pass down the TClientId so that TSY can use + this information to match the first phase of the request to the second phase. */ + { + /** The handle to the underlying RTelServer session. */ + TInt iSessionHandle; + /** The handle to the sub-session to which this API request relates. */ + TInt iSubSessionHandle; + }; + + /** Phone air interface capabilities. */ + enum TMobilePhoneModeCaps + { + /** Phone can operate in GSM mode on 900/1800/1900 MHz bands. */ + KCapsGsmSupported=0x00000001, + /** Phone can operate in GPRS mode on 900/1800/1900 MHz bands. */ + KCapsGprsSupported=0x00000002, + /** Phone can operate in AMPS mode on 800MHz band. */ + KCapsAmpsSupported=0x00000004, + /** Phone can operate in CDMA (IS-95) mode on 800/1900 MHz bands. */ + KCapsCdma95Supported=0x00000008, + /** Phone can operate in CDMA (cdma2000) mode on 800/1900 MHz bands. */ + KCapsCdma2000Supported=0x00000010, + /** Phone can operate in W-CDMA (UTRA Frequency Division Duplex (FDD)) mode. */ + KCapsWcdmaSupported=0x00000020, + /** Phone can operate in TDMA/CDMA (UTRA Time Division Duplex (TDD)) mode. */ + KCapsTdcdmaSupported=0x00000040, + /** + Phone can access Smart Card functionality required for an EAP. + @deprecated 9.3 + */ + KCapsEapSupported=0x00000080 + }; + + /** Version number of the multimode ETel API. */ + enum TMultimodeEtelAPIVersion + { + /** Multimode Etel API version 1. */ + TMultimodeETelApiV1 + }; + + // + // API/TSY internal type + // + + struct TPhoneStoreNameAndIccType + /** Structure that holds the phone store name and ICC type. + + Mode: Common */ + { + /** This parameter is used to set the name of the storage. */ + TName iStoreName; + /** This parameter is used to set the type of the ICC card. */ + TName iMode; + }; + + IMPORT_C TInt GetMultimodeAPIVersion(TInt& aVersion) const; + + IMPORT_C TInt GetMultimodeCaps(TUint32& aCaps) const; + + IMPORT_C void GetPhoneStoreInfo(TRequestStatus& aReqStatus, TDes8& aInfo, const TDesC& aStoreName) const; + + IMPORT_C void GetPhoneStoreInfo(TRequestStatus& aStatus, TDes8& aInfo, const TDesC& aStoreName, const TDesC& aMode) const; + + // explicit phone initialisation + IMPORT_C void InitialiseMM(TRequestStatus& aReqStatus, TDes8& aTableSettings) const; + + /***********************************************************************************/ + // + // MobilePhoneIccAccess functional unit + // + /***********************************************************************************/ + +/** ICC access capabilities. + +Modes: GSM */ + enum TMobilePhoneIccCaps + { + /** Phone has a SIM and it currently supports SIM access by clients. + + Modes: GSM */ + KCapsSimAccessSupported=0x00000001, + /** Phone has a R-UIM and it currently supports R-UIM access by clients. + + Modes: CDMA */ + KCapsRUimAccessSupported=0x00000002, + /** Phone has a USIM and it currently supports USIM access by clients. + + Modes: WCDMA */ + KCapsUSimAccessSupported=0x00000004 + }; + + + enum + { + /** + Maximum size of an ICC identity. + + NOTE: TS102.221 defines the maximum size of the ICC Identity as held in EF_ICCID as 10 bytes, however + TS 51.011 mentions that network operators may issue a SIM with an identification number of 20 bytes. + Therefore to cover this possibility the higher figure of 20 bytes has been chosen as the maximum size of the ICC identity. + */ + KMaxSizeIccIdentity = 20 + }; + + /** A typedef to hold the ICC identity.*/ + typedef TBuf8 TIccIdentity; + + IMPORT_C TInt GetIccAccessCaps(TUint32& aCaps) const; + IMPORT_C void NotifyIccAccessCapsChange(TRequestStatus& aReqStatus, TUint32& aCaps) const; + IMPORT_C void GetIccIdentity(TRequestStatus& aReqStatus, TIccIdentity& aIdentity) const; + +/** The Call Transfer/Call Forward options that are supported by the CSP. + +Modes: WCDMA/GSM */ + enum TCspCallOffering + { + /** Indicates that "Call Transfer" is supported by the CSP. */ + KCspCT=0x08, + /** Indicates that "Call Forwarding on Not Reachable" is supported by the CSP. */ + KCspCFNRc=0x10, + /** Indicates that "Call Forwarding on No Reply" is supported by the CSP. */ + KCspCFNRy=0x20, + /** Indicates that "Call Forwarding on Busy" is supported by the CSP. */ + KCspCFB=0x40, + /** Indicates that "Call Forwarding Unconditional" is supported by the CSP. */ + KCspCFU=0x80 + }; + +/** The call restrictions supported by the CSP. + +Modes: GSM/WCDMA */ + enum TCspCallRestriction + { + /** Indicates that "Barring of Incoming Calls when roaming outside the home PLMN + country" is supported by CSP. */ + KCspBICRoam=0x08, + /** Indicates that "Barring of All Incoming Calls" is supported by CSP. */ + KCspBAIC=0x10, + /** Indicates that "Barring of Outgoing International Calls except those directed + to the home PLMN country" is supported by CSP. */ + KCspBOICexHC=0x20, + /** Indicates that "Barring of Outgoing International Calls" is supported by CSP. */ + KCspBOIC=0x40, + /** Indicates that "Barring of All Outgoing Calls" is supported by CSP. */ + KCspBOAC=0x80 + }; + +/** Other services supported by the CSP. + +Modes: GSM/WCDMA */ + enum TCspOtherSuppServices + { + /** Indicates that the Outgoing Access option of the Closed User Group service is + supported by the CSP. */ + KCspCUGOA=0x08, + /** Indicates that the Preferential CUG option of the Closed User Group service + is supported by the CSP. */ + KCspPrefCUG=0x10, + /** Indicates that the Advice of Charge service is supported by the CSP. */ + KCspAoC=0x20, + /** Indicates that the Closed User Group service is supported by the CSP. */ + KCspCUG=0x40, + /** Indicates that the Multiparty call service is supported by the CSP */ + KCspMPTY=0x80, + }; + +/** Call completion modes supported by this CSP. + +Modes: GSM/WCDMA */ + enum TCspCallCompletion + { + /** Indicates that the Call Completion to Busy Subscriber service is supported by + the CSP. */ + KCspCCBS=0x20, + /** Indicates that the Call Waiting service is supported by the CSP. */ + KCspCW=0x40, + /** Indicates that the Call Hold service is supported by the CSP. */ + KCspHOLD=0x80, + }; + +/** SMS Teleservices supported by the CSP. + +Modes: GSM/WCDMA */ + enum TCspTeleservices + { + /** Indicates that display of Validity Period menu options for SMS is supported + by the CSP. */ + KCspValidityPeriod=0x02, + /** Indicates that display of Protocol ID menu options for SMS is supported by the + CSP. */ + KCspProtocolID=0x04, + /** Indicates that SMS Delivery Confirmation is supported by the CSP. */ + KCspDelConf=0x08, + /** Indicates that display of Reply Path menu options for outgoing SMS is supported + by the CSP. */ + KCspReplyPath=0x10, + /** Indicates that the Cell Broadcast service is supported by the CSP. */ + KCspSMCB=0x20, + /** Indicates mobile originated Short Messages are supported by CSP. */ + KCspSMMO=0x40, + /** Indicates mobile terminated Short Messages are supported by CSP. */ + KCspSMMT=0x80, + }; + +/** Alternate Line Services */ + enum TCspCPHSTeleservices + { + /** Indicates that Alternate Line Service is supported by the CSP. */ + KCspALS=0x80 + }; + +/** Currently not used. */ + enum TCspCPHSFeatures + { + /** This bit value is reserved for SST in Phase 1 CPHS. */ + KCspReservedSST=0x80 + }; + +/** Number Identification option supported by the CSP. + +Modes: GSM/WCDMA */ + enum TCspNumberIdentification + { + /** Indicates that Calling Line Identity Presentation blocking per call (CLI sent + by default) is supported by the CSP. */ + KCspCLIBlock=0x01, + /** Indicates that Calling Line Identity Presentation per call (CLI blocked by default) + is supported by the CSP. */ + KCspCLISend=0x02, + /** Indicates that Connected Line Identification Presentation is supported by the + CSP. */ + KCspCOLP=0x10, + /** Indicates that Connected Line Identification Restriction is supported by the + CSP. */ + KCspCOLR=0x20, + /** Indicates that Calling Line Identification Presentation is supported by the CSP. */ + KCspCLIP=0x80, + }; + +/** Phase 2+ services supported by the CSP. + +Modes: GSM/WCDMA */ + enum TCspPhase2PlusServices + { + /** Indicates that Multiple Band roaming is supported by CSP. */ + KCspMultipleband=0x04, + /** Indicates that Multiple Subscriber Profile is supported by CSP. + + v1.0 of Multimode ETel API does not support this feature */ + KCspMSP=0x08, + /** Indicates that Voice Broadcast is supported by CSP. + + v1.0 of Multimode ETel API does not support this feature. */ + KCspVoiceBroadcast=0x10, + /** Indicates that Voice Group Call is supported by CSP. + + v1.0 of Multimode ETel API does not support this feature. */ + KCspVoiceGroupCall=0x20, + /** Indicates that High Speed Circuit Switched Data is supported by CSP. */ + KCspHscsd=0x40, + /** Indicates that General Packet Radio Service is supported by CSP. */ + KCspGprs=0x80 + }; + +/** Value added services supported by this CSP. + +Modes: GSM/WCDMA */ + enum TCspValueAdded + { + /** Indicates that display of language selection menus is supported by the CSP. + + v1.0 of Multimode ETel API does not support this feature. */ + KCspLanguage=0x01, + /** Indicates that display of data call option menu is supported by the CSP. */ + KCspData=0x04, + /** Indicates that display of fax call option menu is supported by the CSP. */ + KCspFax=0x08, + /** Indicates that display of the menu option to send a Short Message of type Email + is supported by the CSP. */ + KCspSMMOEmail=0x10, + /** Indicates that display of the menu option to send a Short Message of type Paging + is supported by the CSP. */ + KCspSMMOPaging=0x20, + /** Indicates that display of the menu option for manual PLMN selection is supported + by the CSP. */ + KCspPLMNMode=0x80, + }; + + + + class TMobilePhoneCspFileV1 : public TMultimodeType + /** Defines contents of the CSP (Customer Service Profile) on the SIM. The profile + consists of the sum of the respective enums. + + @see GetCustomerServiceProfile() + @publishedPartner + @released*/ + { + public: + /** Constructor. */ + IMPORT_C TMobilePhoneCspFileV1(); + + /** Sum of the TCspCallOffering. */ + TUint8 iCallOfferingServices; + /** Sum of the TCspCallRestriction. */ + TUint8 iCallRestrictionServices; + /** Sum of the TCspOtherSuppServices. */ + TUint8 iOtherSuppServices; + /** Sum of the TCspCallCompletion. */ + TUint8 iCallCompletionServices; + /** Sum of the TCspTeleservices. */ + TUint8 iTeleservices; + /** Sum of the TCspCPHSTeleservices. */ + TUint8 iCphsTeleservices; + /** Sum of the TCspCPHSFeatures. */ + TUint8 iCphsFeatures; + /** Sum of the TCspNumberIdentification. */ + TUint8 iNumberIdentServices; + /** Sum of the TCspPhase2PlusServices. */ + TUint8 iPhase2PlusServices; + /** Sum of the TCspValueAdded. */ + TUint8 iValueAddedServices; + }; + +/** A typedef'd packaged TMobilePhoneCspFileV1 for passing through a generic API +function member. */ + typedef TPckg TMobilePhoneCspFileV1Pckg; + + IMPORT_C void GetCustomerServiceProfile(TRequestStatus& aReqStatus, TDes8& aCsp) const; + +/** SIM/USIM/CDMA Service Table. + +Modes: Common */ + enum TSSTServices1To8 + { + /** Indicates that disabling PIN1 is supported by the ICC. */ + KSstPin1Disable=0x01, + /** Indicates that storage of Abbreviated Dialling Numbers within this ICC is supported. */ + KSstADN=0x02, + /** Indicates that the Fixed Dialling Numbers service and the storage of FDN numbers + within this ICC is supported. */ + KSstFDN=0x04, + /** Indicates that the Short Message Service and the storage of short messages within + this ICC is supported. + + Modes: Common */ + KSstSMS=0x08, + /** Indicates that the Advice of Charge service is supported by this ICC. + + Modes: GSM/WCDMA */ + KSstAoC=0x10, + /** Indicates that the storage of Configuration Capability Parameters associated + with an AND, FDN, MSISDN, LND or SDN is supported by this ICC. + + Modes: GSM/WCDMA */ + KSstCCP=0x20, + /** Indicates that storage of a preferred network list is supported by this ICC. + + v1.0 of Multimode ETel API does not support this feature + + Modes: GSM/WCDMA */ + KSstPLMNSelector=0x40 + }; + +/** SIM/USIM/CDMA Service Table (continued). + +Modes: GSM/WCDMA */ + enum TSSTServices9To16 + { + /** Indicates that storage of MSISDN (own numbers) numbers within this ICC is supported. + + Modes: GSM/WCDMA */ + KSstMSISDN=0x01, + /** Indicates that storage of extended (greater than 20 digits) ADN, LND and MSISDN + numbers within this ICC is supported. + + Modes: Common */ + KSstExt1=0x02, + /** Indicates that storage of extended (greater than 20 digits) FDN numbers within + this ICC is supported. + + Modes: Common */ + KSstExt2=0x04, + /** Indicates that storage of SMS parameter records within this ICC is supported. + + Modes: Common */ + KSstSMSP=0x08, + /** Indicates that storage of Last Numbers Dialled within this ICC is supported. + + Modes: Common */ + KSstLND=0x10, + /** Indicates that the storage of Cell Broadcast message identifiers is supported + within this ICC. + + Modes: GSM/WCDMA */ + KSstCBMI=0x20, + /** Indicates that access to the GID1 file is supported within this ICC. + + v1.0 of Multimode ETel API does not support this feature + + Modes: GSM/WCDMA */ + KSstGID1=0x40, + /** Indicates that access to the GID2 file is supported within this ICC. + + v1.0 of Multimode ETel API does not support this feature + + Modes: GSM/WCDMA */ + KSstGID2=0x80 + }; + +/** SIM/USIM/CDMA Service Table (continued). + +v1.0 of Multimode ETel API does not support this feature + +Modes: Common */ + enum TSSTServices17To24 + { + /** Indicates that access to the Service Provider Name within ICC is supported. + + v1.0 of Multimode ETel API does not support this feature + + Modes: Common */ + KSstSPName=0x01, + /** Indicates that storage of Service Dialling Numbers within ICC is supported. + + Modes: Common */ + KSstSDN=0x02, + /** Indicates that storage of extended (greater than 20 digits) SDN numbers within + this ICC/RUIM is supported. + + Modes: Common */ + KSstExt3=0x04, + /** Indicates that access to the VGCS group identifier list within ICC is supported. + + v1.0 of Multimode ETel API does not support this feature + + Modes: GSM/WCDMA */ + KSstVGCSList=0x10, + /** Indicates that access to the VBS group identifier list within ICC is supported. + + v1.0 of Multimode ETel API does not support this feature + + Modes: GSM/WCDMA */ + KSstVBSList=0x20, + /** Indicates that the enhanced Multi-Level Precedence and Pre-emption service is + supported by ICC + + v1.0 of Multimode ETel API does not support this feature + + Modes: GSM/WCDMA */ + KSsteMLPP=0x40, + /** Indicates that automatic answer for eMLPP is supported by ICC + + v1.0 of Multimode ETel API does not support this feature + + Modes: GSM/WCDMA */ + KSstAnswereMLPP=0x80 + }; + +/** SIM/USIM/CDMA Service Table (continued). + +Modes: GSM/WCDMA */ + enum TSSTServices25To32 + { + /** Indicates that SAT SMS-CB data download is supported by ICC. */ + KSstSmsCbDataDownload=0x01, + /** Indicates that SAT SMS-PP data download is supported by ICC. */ + KSstSmsPpDataDownload=0x02, + /** Indicates that SAT menu selection is supported by ICC. + + SAT ETel API provides this feature. */ + KSstMenuSelection=0x04, + /** Indicates that SAT call control is supported by ICC. + + SAT ETel API provides this feature. */ + KSstCallControl=0x08, + /** Indicates that SAT pro-active SIM is supported by ICC. + + SAT ETel API provides this feature. */ + KSstProactiveSim=0x10, + /** Indicates ICC storage of ranges of Cell Broadcast Message Identifiers is supported. */ + KSstCBMIRanges=0x20, + /** Indicates ICC storage of Barred Dialling Numbers is supported. */ + KSstBDN=0x40, + /** Indicates ICC storage of extended (greater than 20 digits) BDN numbers is supported. */ + KSstExt4=0x80 + }; + +/** SIM/USIM/CDMA Service Table (continued). + +Modes: GSM/WCDMA */ + enum TSSTServices33To40 + { + /** Indicates depersonalisation control keys are supported by ICC. + + v1.0 of Multimode ETel API does not support this feature. */ + KSstDepersonalisationKeys=0x01, + /** Indicates co-operative network list are supported by this ICC. + + v1.0 of Multimode ETel API does not support this feature. */ + KSstCooperativeNetworks=0x02, + /** Indicates Short Message Status Reports are supported by ICC. */ + KSstSMStatusReports=0x04, + /** Indicates network's indication of alerting is supported by ICC. + + v1.0 of Multimode ETel API does not support this feature. */ + KSstNetworkIndAlerting=0x08, + /** Indicates outgoing SM control by SAT is supported by ICC. + + SAT ETel API provides this feature. */ + KSstMoSmControlBySim=0x10, + /** Indicates that GPRS is supported by this ICC. + + GPRS ETel API provides GPRS functionality. */ + KSstGprs=0x20, + /** Indicates that Image files are supported by this ICC. + + SAT ETel API provides this feature. */ + KSstImage=0x40, + /** Indicates that SoLSA in supported by this ICC. + + v1.0 of Multimode ETel API does not support this feature */ + KSstSoLSA=0x80 + }; + +/** SIM/USIM/CDMA Service Table (continued). + +Modes: GSM/WCDMA */ + enum TSSTServices41To48 + { + /** Indicates that USSD string data is supported in SAT Call Control by this ICC. + + SAT ETel API provides this feature. */ + KSstUssdStringInCallControl=0x01, + /** Indicates that RUN AT COMMAND is supported in SAT by this ICC. + + v1.0 of Multimode ETel API does not support this feature */ + KSstRunATCommand=0x02, + /** Indicates that PLMN selector list with access technology is supported by this + ICC. + + v1.0 of Multimode ETel API does not support this feature. */ + KSstPlmnSelectorListWithAccessTechnology=0x04, + /** Indicates that OPLMN selector list with access technology is supported by this + ICC. + + v1.0 of Multimode ETel API does not support this feature. */ + KSstOplmnSelectorListWithAccessTechnology=0x08, + /** Indicates that HPLMN access technology is supported by this ICC. + + v1.0 of Multimode ETel API does not support this feature. */ + KSstHplmnAccessTechnology=0x10, + /** Indicates that CPBCCH information is supported by this ICC. + + v1.0 of Multimode ETel API does not support this feature. */ + KSstCpbcchInformation=0x20, + /** Indicates that Investigation Scan is supported by this ICC. + + v1.0 of Multimode ETel API does not support this feature. */ + KSstInvestigationScan=0x40, + /** Indicates that extended capability configuration parameters are supported by + this ICC. + + v1.0 of Multimode ETel API does not support this feature. */ + KSstExtendedCcp=0x80 + }; + +/** SIM/USIM/CDMA Service Table (continued). + +Modes: GSM/WCDMA */ + enum TSSTServices49To56 + { + /** Indicates Mobile Execution Environment services are supported by this ICC */ + KSstMExE=0x01, + /** Indicates that RPLMN last used access technology is supported by this ICC. + + v1.0 of Multimode ETel API does not support this feature. */ + KSstRplmnLastUsedAccessTechnology=0x02 + }; + +/** USIM service table. */ + enum TUSTServices1To8 + { + /** Indicates that the local phonebook is supported by the USIM. Local phonebook + means a phonebook that is specific to a USIM Application, as opposed to the + global phonebook which is located at the DF Telecom level on the UICC and + not attached to a USIM Application. */ + KUstLocalPhBk=0x01, + /** Indicates that the Fixed Dialling Numbers (FDN) service and the storage of + FDN numbers within this USIM is supported. */ + KUstFDN=0x02, + /** Indicates that the Extension 2 is supported by the USIM. Extension 2 provides + extension data for Fixed Dialling Numbers. */ + KUstExt2=0x04, + /** Indicates that the Service Dialling Numbers are supported by the USIM. */ + KUstSDN=0x08, + /** Indicates that the Extension 3 is supported by the USIM. Extension 3 provides + extension data for Service Dialling Numbers. */ + KUstExt3=0x10, + /** Indicates that the Barred Dialling Numbers are supported by the USIM. */ + KUstBDN=0x20, + /** Indicates that the Extension 4 is supported by the USIM. Extension 4 provides + extension data for Barred Dialling Numbers. */ + KUstExt4=0x40, + /** Indicates that the outgoing call information (OCI and OCT) are supported by + the USIM. + + Note: v2.0 of Multimode ETel API does not support this feature. */ + KUstOugoingCallInfo=0x80 + }; + +/** USIM service table (continued). */ + enum TUSTServices9To16 + { + /** Indicates that the incoming call information (ICI and ICT) are supported by + the USIM + + Note: v2.0 of Multimode ETel API does not support this feature. */ + KUstIncomingCallInfo=0x01, + /** Indicates that Short Message Storage is supported by the USIM. */ + KUstSMS=0x02, + /** Indicates that Short Message Status Reports are supported by the USIM. */ + KUstSMSR=0x04, + /** Indicates that Short Message Service Parameters are supported by the USIM. */ + KUstSMSP=0x08, + /** Indicates that Advice Of Charge is supported by the USIM. */ + KUstAoC=0x10, + /** Indicates that Capability Configuration Parameters are supported by the USIM. */ + KUstCCP=0x20, + /** Indicates that Cell Broadcast Message Identifier is supported by the USIM. */ + KUstCBMI=0x40, + /** Indicates that Cell Broadcast Message Identifier Ranges are supported by the + USIM. */ + KUstCBMIRanges=0x80 + }; + +/** USIM service table (continued). */ + enum TUSTServices17To24 + { + /** Indicates that Group Identifier Level 1 is supported by the USIM. + + Note: v2.0 of Multimode ETel API does not support this feature. */ + KUstGID1=0x01, + /** Indicates that Group Identifier Level 2 is supported by the USIM. + + Note: v2.0 of Multimode ETel API does not support this feature. */ + KUstGID2=0x02, + /** Indicates that Service Provider Name is supported by the USIM. */ + KUstSPN=0x04, + /** Indicates that user controlled PLMN selector with Access Technology is supported + by the USIM. + + Note: v2.0 of Multimode ETel API does not support this feature. */ + KUstPLMNSelAccessTech=0x08, + /** Indicates that MSISDN is supported by the USIM. */ + KUstMSISDN=0x10, + /** Indicates that Image is supported by the USIM. + + Note: (U)SAT ETel API provides this feature. This enum value is reserved for + future API use. */ + KUstIMG=0x20, + //0x40 is a reserved value + /** Indicates that enhanced Multi Level Precedence and Pre-emption Service is supported + by the USIM. + + Note: v2.0 of Multimode ETel API does not support this feature. */ + KUsteMLPP=0x80 + }; + +/** USIM service table (continued). */ + enum TUSTServices25To32 + { + /** Indicates that Automatic Answer for eMLPP is supported by the USIM. + + Note: v1.0 and v2.0 of Multimode ETel API do not support this feature. */ + KUstAnswereMLPP=0x01, + //0x02 is a reserved value + /** Indicates that GSM Access is supported by the USIM */ + KUstGSMAccess=0x04, + /** Indicates that Data download via SMS-PP is supported by the USIM. + + Note: (U)SAT ETel API provides this feature. */ + KUstSMSPpDataDownload=0x08, + /** Indicates that Data download via SMS-CB is supported by the USIM. + + Note: (U)SAT ETel API provides this feature. */ + KUstSMSCbDataDownload=0x10, + /** Indicates that Call Control by USIM is supported by the USIM. + + Note: (U)SAT ETel API provides this feature. */ + KUstCallControl=0x20, + /** Indicates that MO-SMS Control by USIM is supported by the USIM. + + Note: (U)SAT ETel API provides this feature. */ + KUstMoSmControl=0x40, + /** Indicates that the proactive command RUN AT COMMAND is supported by the USIM. + + Note: (U)SAT ETel API provides this feature. */ + KUstPCmdRunAtCommand=0x80 + }; + +/** USIM service table (continued). */ + enum TUSTServices33To40 + { + /** Should always be present as specified by 3 GPP spec. */ + KUstAlways=0x10, + /** Indicates that the Enabled Service Table is supported by the USIM. */ + KUstEST=0x02, + /** Indicates that APN Control List is supported by the USIM. + + Note: v2.0 of Multimode ETel API does not support this feature. */ + KUstACL=0x04, + /** Indicates that the Depersonalisation Control Keys are supported by the USIM. + + Note: v2.0 of Multimode ETel API does not support this feature. */ + KIstDepersonalisationKeys =0x08, + /** Indicates that the Co-operative Network List is supported by the USIM. + + Note: v2.0 of Multimode ETel API does not support this feature. */ + KUstCooperativeNetwork=0x10, + /** Indicates that GSM Security Context is supported by the USIM. */ + KUstGSMSecurityContext=0x20, + /** Indicates that CPBCCH Information is supported by the USIM. + + Note: v2.0 of Multimode ETel API do not support this feature. */ + KUstCPBCCHInfo=0x40, + /** Indicates that Investigation Scan is supported by the USIM. + + Note:v2.0 of Multimode ETel API do not support this feature. */ + KUstInvestigationScan=0x80 + }; + +/** USIM service table (continued). */ + enum TUSTServices41To48 + { + /** Indicates that MExE is supported by the USIM. + + Note: v2.0 of Multimode ETel API do not support this feature. */ + KUstMExE=0x01, + /** Indicates that Operator controlled PLMN selector with Access Technology is + supported by the USIM. + + N.B .v2.0 of Multimode ETel API do not support this feature. */ + KUstOperatorPLMNSelector=0x02, + /** Indicates that HPLMN selector with Access Technology is supported by the USIM. + + Note: v2.0 of Multimode ETel API do not support this feature. */ + KUstHPLMNSelAccessTech=0x04, + /** Indicates that Extension 5 is supported by the USIM. Provides support for extension + data for MSISDN. */ + KUstExt5=0x08, + /** Indicates that PLMN Network Name is supported by the USIM. + + Note: v2.0 of Multimode ETel API do not support this feature. */ + KUstPLMNNetworkName=0x10, + /** Indicates that Operator PLMN List is supported by the USIM. + + Note: v2.0 of Multimode ETel API do not support this feature. */ + KUstOperatorPLMNList=0x20, + /** Indicates that Mailbox Dialling Numbers are supported by the USIM. */ + KUstMDN=0x40, + /** Indicates that Message Waiting Indication Status is supported by the USIM. */ + KUstMWISo=0x80 + }; + +/** USIM service table (continued). */ + enum TUSTServices49To56 + { + /** Indicates that Call forwarding indication status is supported by the USIM. + + Note: v2.0 of Multimode ETel API do not support this feature. */ + KUstCFIS=0x01, + /** Indicates that RPLMN last-used access technology is supported by the USIM. + + Note: v2.0 of Multimode ETel API do not support this feature. */ + KUstRPLMN=0x02, + /** Indicates that Service provider display information is supported by the USIM. + + Note: v2.0 of Multimode ETel API do not support this feature. */ + KUstSPDI=0x04, + KUstMMS=0x08, + KUstExt8=0x10, + KUstCConGPRS=0x20, + KUstMMSUCP=0x40 + }; + +/** Enabled Services Table. */ + enum TESTServices1To8 + { + /** Indicates that FDN service is activated. */ + KEstFDN=0x01, + /** Indicates that BDN service is activated. */ + KEstBDN=0x02, + /** Indicates that the APN Control List service is activated. + + Note: v2.0 of Multimode ETel API do not support this feature. */ + KEstACL=0x04 + }; + +/** Get Service Table. + +Modes: GSM/WCDMA */ + enum TMobilePhoneServiceTable + { + /** Retrieve SIM service table on SIM (or from GSM application on UICC). + + Modes: GSM/WCDMA */ + ESIMServiceTable, + /** Retrieve USIM service table from active USIM application on UICC. + + Modes: WCDMA */ + EUSIMServiceTable, + /** Retrieve CDMA service table on R-UIM. + + Modes: CDMA */ + ECDMAServiceTable, + /** USIM Enabled Services Table to be used in conjunction with the USIM Service + Table. + + Modes: WCDMA */ + EUSIMEnabledServiceTable + }; + + + class TMobilePhoneServiceTableV1 : public TMultimodeType + /** Defines contents of the specified Service Table on the ICC. + + @see GetServiceTable() + @publishedPartner + @released + */ + { + public: + IMPORT_C TMobilePhoneServiceTableV1(); + + /** Sum of the TSSTServices1To8 capability constants. */ + TUint8 iServices1To8; + /** Sum of the TSSTServices9To16 capability constants. */ + TUint8 iServices9To16; + /** Sum of the TSSTServices17To24 capability constants. */ + TUint8 iServices17To24; + /** Sum of the TSSTServices25To32 capability constants. */ + TUint8 iServices25To32; + /** Sum of the TSSTServices33To40 capability constants. */ + TUint8 iServices33To40; + /** Sum of the TSSTServices41To48 capability constants. */ + TUint8 iServices41To48; + /** Sum of the TSSTServices49To56 capability constants. */ + TUint8 iServices49To56; + }; + +/** A typedef'd packaged TMobilePhoneServiceTableV1 passing through a generic API +function member. */ + typedef TPckg TMobilePhoneServiceTableV1Pckg; + + enum { KAIDSize=16 }; + +/** A typedef'd buffer to hold the application identifier (AID) that identifies +the USIM application in a UICC. The AID consists of a Registered application +provider IDentifier (RID) of 5 bytes and a Proprietary application Identifier +eXtension (PIX) of up to 11 bytes. */ + typedef TBuf8 TAID; + + class TMobilePhoneServiceTableV2 : public TMobilePhoneServiceTableV1 +/** Defines contents of the specified Service Table on the ICC for the v2.0 version +of the API. +*/ + { + public: + IMPORT_C TMobilePhoneServiceTableV2(); + public: + /** The application identifier. */ + TAID iAID; + }; + +/** A typedef'd packaged TMobilePhoneServiceTableV2 passing through a generic API +function member. */ + typedef TPckg TMobilePhoneServiceTableV2Pckg; + + IMPORT_C void GetServiceTable(TRequestStatus& aReqStatus, TMobilePhoneServiceTable aTable, TDes8& aTableData) const; + + + /***********************************************************************************/ + // + // MobilePhonePower functional unit + // + /***********************************************************************************/ + +/** Phone supported battery information. + +Modes: Common */ + enum TMobilePhoneBatteryCaps + { + /** Phone supports requests to get the current battery information. */ + KCapsGetBatteryInfo=0x00000001, + /** Phone supports requests for notification of change in battery information. */ + KCapsNotifyBatteryInfoChange=0x00000002 + }; + + IMPORT_C TInt GetBatteryCaps(TUint32& aCaps) const; + +/** The mobile phone battery status. + +Modes: Common */ + enum TMobilePhoneBatteryStatus + { + /** The TSY can not determine the phone's current power status. */ + EPowerStatusUnknown, + /** The phone is currently powered by a battery. */ + EPoweredByBattery, + /** A battery is connected, but the phone is externally powered. */ + EBatteryConnectedButExternallyPowered, + /** No battery is connected. */ + ENoBatteryConnected, + /** Power fault. */ + EPowerFault + }; + + class TMobilePhoneBatteryInfoV1 : public TMultimodeType +/** Defines contents of the battery status of the phone. + +@see GetBatteryInfo() +@see NotifyBatteryInfoChange() +*/ + { + public: + IMPORT_C TMobilePhoneBatteryInfoV1(); + public: + /** The power and battery status. + + @see TMobilePhoneBatteryStatus */ + TMobilePhoneBatteryStatus iStatus; + /** The percentage battery charge level. */ + TUint iChargeLevel; + }; + + IMPORT_C void GetBatteryInfo(TRequestStatus& aReqStatus, TMobilePhoneBatteryInfoV1& aInfo) const; + IMPORT_C void NotifyBatteryInfoChange(TRequestStatus& aReqStatus, TMobilePhoneBatteryInfoV1& aInfo) const; + + + /***********************************************************************************/ + // + // MobilePhoneSignal functional unit + // + /***********************************************************************************/ + +/** The mobile phone signal strength capabilities. + +Modes: Common */ + enum TMobilePhoneSignalCaps + { + /** Phone supports requests to get the current signal strength. */ + KCapsGetSignalStrength=0x00000001, + /** Phone supports requests for notification of change in signal strength. */ + KCapsNotifySignalStrengthChange=0x00000002 + }; + + IMPORT_C TInt GetSignalCaps(TUint32& aCaps) const; + IMPORT_C void GetSignalStrength(TRequestStatus& aReqStatus, TInt32& aSignalStrength, TInt8& aBar) const; + IMPORT_C void NotifySignalStrengthChange(TRequestStatus& aReqStatus, TInt32& aSignalStrength, TInt8& aBar) const; + + /***********************************************************************************/ + // + // MobilePhoneIndicator functional unit + // + /***********************************************************************************/ + +/** The mobile phone indicator capabilities supported. + +Modes: Common */ + enum TMobilePhoneIndicatorCaps + { + /** Phone supports requests to get the current value of all supported indicators. */ + KCapsGetIndicator=0x00000001, + /** Phone supports requests for notification of change in the supported indicators. */ + KCapsNotifyIndicatorChange=0x00000002 + }; + +/** The mobile phone indicators. + +Modes Common */ + enum TMobilePhoneIndicators + { + /** If bit-flag is set to '1' indicates that the battery charger is connected to + the phone. If bit-flag is set to '0' indicates that the battery charger is + disconnected. */ + KIndChargerConnected=0x00000001, + /** If bit-flag is set to '1' indicates that network service is available. If bit-flag + is set to '0' indicates that network service is unavailable. */ + KIndNetworkAvailable=0x00000002, + /** If bit-flag is set to '1' indicates that a call is in progress. If set to '0' + indicates that a call is not in progress. */ + KIndCallInProgress=0x00000004 + }; + + IMPORT_C TInt GetIndicatorCaps(TUint32& aActionCaps, TUint32& aIndCaps) const; + IMPORT_C void GetIndicator(TRequestStatus& aReqStatus, TUint32& aIndicator) const; + IMPORT_C void NotifyIndicatorChange(TRequestStatus& aReqStatus, TUint32& aIndicator) const; + + + /***********************************************************************************/ + // + // MobilePhoneIdentity functional unit + // + /***********************************************************************************/ + +/** Defines Identity Capabilities. + +Modes: Common */ + enum TMobilePhoneIdentityCaps + { + /** Phone can return the identity of its manufacturer. */ + KCapsGetManufacturer=0x00000001, + /** Phone can return the identity of its model. */ + KCapsGetModel=0x00000002, + /** Phone can return the identity of its revision. */ + KCapsGetRevision=0x00000004, + /** Phone can return the identity of its serial number. */ + KCapsGetSerialNumber=0x00000008, + /** Phone can return the identity of its subscriber. */ + KCapsGetSubscriberId=0x00000010 + }; + + IMPORT_C TInt GetIdentityCaps(TUint32& aCaps) const; + + enum { KPhoneManufacturerIdSize=50 }; + enum { KPhoneModelIdSize=50 }; + enum { KPhoneRevisionIdSize=50 }; + enum { KPhoneSerialNumberSize=50 }; + + class TMobilePhoneIdentityV1 : public TMultimodeType +/** Defines the mobile phone identity. + +@see GetPhoneId() */ + { + public: + IMPORT_C TMobilePhoneIdentityV1(); + public: + /** Phone manufacturer identification, in character string format. */ + TBuf iManufacturer; + /** Phone model identification, in character string format. */ + TBuf iModel; + /** Phone revision identification, in character string format. */ + TBuf iRevision; + /** Phone serial number (IMEI or ESN), in character string format. */ + TBuf iSerialNumber; + }; + + IMPORT_C void GetPhoneId(TRequestStatus& aReqStatus, TMobilePhoneIdentityV1& aId) const; + + enum { KIMSISize = 15 }; + +/** A typedef'd buffer to hold the mobile phone subscriber id. */ + typedef TBuf TMobilePhoneSubscriberId; + + IMPORT_C void GetSubscriberId(TRequestStatus& aReqStatus, TMobilePhoneSubscriberId& aId) const; + + /***********************************************************************************/ + // + // MobilePhoneDTMF functional unit + // + /***********************************************************************************/ + +/** DTMF Capabilities. + +Modes: Common */ + enum TMobilePhoneDTMFCaps + { + /** Capability to send a string of DTMF tones, containing one or more tone(s). */ + KCapsSendDTMFString=0x00000001, + /** Capability to send one DTMF tone, using start and stop DTMF tone function member. */ + KCapsSendDTMFSingleTone=0x00000002, + }; + + /** + DTMF tone operation event. + */ + enum TMobilePhoneDTMFEvent + { + /** + Start sending of a Dtmf tone operation has been acknowledged from the MSC. + */ + EStartDtmfTone, + /** + Stop sending of a Dtmf tone operation has been acknowledged from the MSC. + */ + EStopDtmfTone, + }; + + + IMPORT_C TInt GetDTMFCaps(TUint32& aCaps) const; + IMPORT_C void NotifyDTMFCapsChange(TRequestStatus& aReqStatus, TUint32& aCaps) const; + + IMPORT_C void SendDTMFTones(TRequestStatus& aReqStatus, const TDesC& aTones) const; + IMPORT_C void ReadDTMFTones(TRequestStatus& aReqStatus, TDes& aTones) const; + IMPORT_C TInt StartDTMFTone(TChar aTone) const; + IMPORT_C TInt StopDTMFTone() const; + + IMPORT_C void NotifyStopInDTMFString(TRequestStatus& aRequestStatus) const; + IMPORT_C TInt ContinueDTMFStringSending(TBool aContinue) const; + IMPORT_C void NotifyDTMFEvent(TRequestStatus& aReqStatus, TMobilePhoneDTMFEvent& aEvent) const; + + /***********************************************************************************/ + // + // MobilePhoneNetwork functional unit + // + /***********************************************************************************/ + +/** Defines Network Capabilities. + +Modes: Common */ + enum TMobilePhoneNetworkCaps + { + /** The phone supports retrieval of current registration status. */ + KCapsGetRegistrationStatus=0x00000001, + /** The phone supports notifications of change in registration status. */ + KCapsNotifyRegistrationStatus=0x00000002, + /** The phone supports retrieval of current mode. */ + KCapsGetCurrentMode=0x00000004, + /** The phone supports notification of change in mode. */ + KCapsNotifyMode=0x00000008, + /** The phone supports retrieval of current network information. */ + KCapsGetCurrentNetwork=0x00000010, + /** The phone supports notification of change of current network. */ + KCapsNotifyCurrentNetwork=0x00000020, + /** The phone supports retrieval of home network information. */ + KCapsGetHomeNetwork=0x00000040, + /** The phone supports retrieval of a list of detected networks. */ + KCapsGetDetectedNetworks=0x00000080, + /** The phone supports manual network selection mode. */ + KCapsManualNetworkSelection=0x00000100, + /** The phone supports retrieval of time and date information (NITZ) received from + the network. */ + KCapsGetNITZInfo=0x00000200, + /** The phone supports notification of new updates of time & date information (NITZ) + received from the network. */ + KCapsNotifyNITZInfo=0x00000400 + }; + + IMPORT_C TInt GetNetworkCaps(TUint32& aCaps) const; + +/** Defines Current Network Modes. + +Modes: Common */ + enum TMobilePhoneNetworkMode + { + /** Network mode is unknown. + + Modes: Common */ + ENetworkModeUnknown, + /** ME is not registered. + + Modes: Common */ + ENetworkModeUnregistered, + /** GSM/GPRS or DCS1800 network. */ + ENetworkModeGsm, + /** AMPS network. + + Modes: CDMA */ + ENetworkModeAmps, + /** CDMA (IS-95) network. + + Modes: CDMA */ + ENetworkModeCdma95, + /** CDMA (cdma2000) network. + + Modes: CDMA */ + ENetworkModeCdma2000, + /** WCDMA (UTRA Frequency Division Duplex (FDD)) network. + + Modes: WCDMA */ + ENetworkModeWcdma, + /** TD-CDMA (UTRA Time Division Duplex (TDD)) network. + + Modes: WCDMA */ + ENetworkModeTdcdma + }; + + IMPORT_C TInt GetCurrentMode(TMobilePhoneNetworkMode& aNetworkMode) const; + IMPORT_C void NotifyModeChange(TRequestStatus& aReqStatus, TMobilePhoneNetworkMode& aNetworkMode) const; + + void DoNotifyModeChange( TMobilePhoneNetworkMode aNetworkMode, TInt aErrorCode ); + void CancelAsyncRequest(TInt aReqToCancel) const; + + mutable TMobilePhoneNetworkMode* iNetworkMode; + mutable TRequestStatus* iReqStatus; + + +/** Phone network status. + +Modes: Common */ + enum TMobilePhoneNetworkStatus + { + /** Status is unknown. */ + ENetworkStatusUnknown, + /** A network that the ME is allowed to register to. */ + ENetworkStatusAvailable, + /** The currently registered network. */ + ENetworkStatusCurrent, + /** A network that the ME is not allowed to register to. */ + ENetworkStatusForbidden + }; + +/** Mobile phone network band information. + +Modes: CDMA */ + enum TMobilePhoneNetworkBandInfo + { + /** The current band and band class is unknown. */ + EBandUnknown, + /** The network operates at 800MHz on Band A. */ + E800BandA, + /** The network operates at 800MHz on Band B. */ + E800BandB, + /** The network operates at 800MHz on Band C. */ + E800BandC, + /** The network operates at 1900MHz on Band A. */ + E1900BandA, + /** The network operates at 1900MHz on Band B. */ + E1900BandB, + /** The network operates at 1900MHz on Band C. */ + E1900BandC, + /** The network operates at 1900MHz on Band D. */ + E1900BandD, + /** The network operates at 1900MHz on Band E. */ + E1900BandE, + /** The network operates at 1900MHz on Band F. */ + E1900BandF + }; + +/** A typedef'd buffer to hold the network display tag */ + typedef TBuf<30> TMobilePhoneNetworkDisplayTag; +/** A typedef'd buffer to hold the network long name. */ + typedef TBuf<20> TMobilePhoneNetworkLongName; +/** A typedef'd buffer to hold the network short name. */ + typedef TBuf<10> TMobilePhoneNetworkShortName; + +/** A typedef'd buffer to hold the network country code. */ + typedef TBuf<4> TMobilePhoneNetworkCountryCode; // MCC in GSM and CDMA +/** A typedef'd buffer to hold the network identity. */ + typedef TBuf<8> TMobilePhoneNetworkIdentity; // MNC in GSM and SID or NID in CDMA + + + + class TMobilePhoneNetworkInfoV1 : public TMultimodeType + /** Defines information related to a mobile phone network. + + @see GetCurrentNetwork() + @see NotifyCurrentNetworkChange() + @see GetHomeNetwork() + @publishedPartner + @released */ + { + public: + IMPORT_C TMobilePhoneNetworkInfoV1(); + public: + void InternalizeL(RReadStream& aStream); + void ExternalizeL(RWriteStream& aStream) const; + public: + /** Mode of the network. + + Modes: Common + + @see TMobilePhoneNetworkMode */ + TMobilePhoneNetworkMode iMode; + /** Status of the network + + Modes: Common + + @see TMobilePhoneNetworkStatus */ + TMobilePhoneNetworkStatus iStatus; + /** The band and band class of the CDMA network operator. + + Modes: CDMA + + @see TMobilePhoneNetworkBandInfo */ + TMobilePhoneNetworkBandInfo iBandInfo; + /** The MCC of the network. + + Modes: Common + + @see TMobilePhoneNetworkCountryCode */ + TMobilePhoneNetworkCountryCode iCountryCode; + /** The system identity (SID) of the CDMA network. + + Modes: CDMA + + @see TMobilePhoneNetworkIdentity */ + TMobilePhoneNetworkIdentity iCdmaSID; + /** The system identity (SID) of the AMPS network. + + Modes: CDMA + + @see TMobilePhoneNetworkIdentity */ + TMobilePhoneNetworkIdentity iAnalogSID; + /** The network identity (NID in CDMA and MNC in GSM). + + Modes: Common + + @see TMobilePhoneNetworkIdentity */ + TMobilePhoneNetworkIdentity iNetworkId; + /** The alpha-tag displayed when this is the serving network. + + Modes: Common + + @see TMobilePhoneNetworkDisplayTag */ + TMobilePhoneNetworkDisplayTag iDisplayTag; + /** The short name (up to 10 characters) of the network operator. + + Modes: GSM/WCDMA + + @see TMobilePhoneNetworkShortName */ + TMobilePhoneNetworkShortName iShortName; + /** The long name (up to 20 characters) of the network operator. + + Modes: GSM/WCDMA + + @see TMobilePhoneNetworkLongName */ + TMobilePhoneNetworkLongName iLongName; + }; + +/** A typedef'd packaged TMobilePhoneNetworkInfoV1 for passing through a generic +API function member. */ + typedef TPckg TMobilePhoneNetworkInfoV1Pckg; + +/** The access technology that the network is based on. + +Modes: Common */ + enum TMobilePhoneNetworkAccess + { + /** This is used when there is no network activity and therefore no RAT active. + + Modes: Common */ + ENetworkAccessUnknown, + /** The access technology is GSM. + + Modes: GSM */ + ENetworkAccessGsm, + /** The access technology is GSM COMPACT. However GSM COMPACT systems which use + GSM frequency bands but with the CBPCCH broadcast channel are considered as + a separate access technology from GSM. + + Modes: GSM */ + ENetworkAccessGsmCompact, + /** The access technology is UTRAN (UMTS Network). + + Modes: WCDMA */ + ENetworkAccessUtran, + /** Analogue Cellular + + Modes: CDMA */ + ENetworkAccessAmpsCellular, + /** CDMA Cellular - Standard channels + + Modes: CDMA */ + ENetworkAccessCdmaCellularStdChannel, + /** CDMA Cellular - Custom channels + + Modes: CDMA */ + ENetworkAccessCdmaCellularCustomChannel, + /** CDMA/Analogue Cellular (cdma first then analogue) + + Modes: CDMA */ + ENetworkAccessCdmaAmpsCellular, + /** CDMA PCS - Using blocks + + Modes: CDMA */ + ENetworkAccessCdmaPcsUsingBlocks, + /** CDMA PCS - Using channels + + Modes: CDMA */ + ENetworkAccessCdmaPcsUsingNetworkAccessChannels, + /** CDMA JTACS - Standard channels + + Modes: CDMA */ + ENetworkAccessJTacsStdChannels, + /** CDMA JTACS - Custom channels + + Modes: CDMA */ + ENetworkAccessJTacsCustomChannels, + /** CDMA 2GHz band - Using channels + + Modes: CDMA */ + ENetworkAccess2GHzBandUsingChannels, + /** Generic Acquisition Record for IS-2000 and IS-95 + + Modes: CDMA */ + ENetworkAccessGenericAcqRecord2000and95, + /** Generic Acquisition Record for IS-856 + + Modes: CDMA */ + ENetworkAccessGenericAcqRecord856 + }; + + + + class TMobilePhoneNetworkInfoV2 : public TMobilePhoneNetworkInfoV1 + /** The access technology that the network is based on in version v2.0 of the API. + @publishedPartner + @released*/ + { + public: + /** Default constructor. Network access is set to ENetworkAccessUnknown and iExtensionId + is set to KETelExtMultimodeV2. */ + IMPORT_C TMobilePhoneNetworkInfoV2(); + + public: + void InternalizeL(RReadStream& aStream); + void ExternalizeL(RWriteStream& aStream) const; + + public: + /** The type of network access. + + @see TMobilePhoneNetworkAccess */ + TMobilePhoneNetworkAccess iAccess; + }; + +/** A typedef'd packaged TMobilePhoneNetworkInfoV2 for passing through a generic +API function member. */ + typedef TPckg TMobilePhoneNetworkInfoV2Pckg; + + + class TMobilePhoneNetworkInfoV5 : public TMobilePhoneNetworkInfoV2 + /** The access technology that the network is based on in version v2.0 of the API. + @publishedPartner + @released*/ + { + public: + IMPORT_C TMobilePhoneNetworkInfoV5(); + + public: + void InternalizeL(RReadStream& aStream); + void ExternalizeL(RWriteStream& aStream) const; + + public: + /** HSDPA availability indicator. This information is for display + indication only and shall not be used for any other purpose. + + Modes: WCDMA */ + TBool iHsdpaAvailableIndicator; + + /** EGPRS availability indicator. This information is for display + indication only and shall not be used for any other purpose. + + Modes: GPRS */ + TBool iEgprsAvailableIndicator; + }; + +/** A typedef'd packaged TMobilePhoneNetworkInfoV5 for passing through a generic +API function member. */ + typedef TPckg TMobilePhoneNetworkInfoV5Pckg; + + class TMobilePhoneLocationAreaV1 : public TMultimodeType +/** Defines the mobile phone location area. + +@see GetCurrentNetwork() +@see NotifyCurrentNetworkChange() */ + { + public: + /** Constructor. */ + IMPORT_C TMobilePhoneLocationAreaV1(); + public: + /** Boolean indicating whether the location area is known. + + Modes: Common */ + TBool iAreaKnown; + /** Location area code. + + Modes: GSM/WCDMA */ + TUint iLocationAreaCode; + /** Cell identity code. + + Modes: GSM/WCDMA */ + TUint iCellId; + }; + + IMPORT_C void GetCurrentNetwork(TRequestStatus& aReqStatus, TDes8& aNetworkInfo, TMobilePhoneLocationAreaV1& aArea) const; + IMPORT_C void NotifyCurrentNetworkChange(TRequestStatus& aReqStatus, TDes8& aNetworkInfo, TMobilePhoneLocationAreaV1& aArea) const; + IMPORT_C void GetCurrentNetwork(TRequestStatus& aReqStatus, TDes8& aNetworkInfo) const; + IMPORT_C void NotifyCurrentNetworkChange(TRequestStatus& aReqStatus, TDes8& aNetworkInfo) const; + + IMPORT_C void GetHomeNetwork(TRequestStatus& aReqStatus, TDes8& aNetworkInfo) const; + IMPORT_C void GetHomeNetworkSearchPeriod(TRequestStatus& aReqStatus, TInt& aSearchIntv) const; + IMPORT_C void GetLastUsedAccessTechnology(TRequestStatus& aReqStatus, TMobilePhoneNetworkAccess& aAccessTech) const; + +/** The registration status of the mobile phone. + +Modes: WCDMA */ + enum TMobilePhoneRegistrationStatus + { + /** Registration status is unknown. */ + ERegistrationUnknown, + /** Not registered. The ME can not detect any other networks and is not currently + searching a new operator to register to. */ + ENotRegisteredNoService, + /** Not registered. The ME can detect other networks on which it is possible to + make emergency calls only. */ + ENotRegisteredEmergencyOnly, + /** Not registered, but the ME is currently searching a new operator to register to. */ + ENotRegisteredSearching, + /** Registered, network busy. + + Modes: WCDMA */ + ERegisteredBusy, + /** Registered on home network. */ + ERegisteredOnHomeNetwork, + /** Registration denied. */ + ERegistrationDenied, + /** Registered, roaming. */ + ERegisteredRoaming + }; + + IMPORT_C void GetNetworkRegistrationStatus(TRequestStatus& aReqStatus, TMobilePhoneRegistrationStatus& aStatus) const; + IMPORT_C void NotifyNetworkRegistrationStatusChange(TRequestStatus& aReqStatus, TMobilePhoneRegistrationStatus& aStatus) const; + +/** The network selection function member. + +Modes: Common */ + enum TMobilePhoneSelectionMethod + { + /** Network selection function member is unknown. + + Modes: Common */ + ENetworkSelectionUnknown, + /** Network is selected automatically by phone. + + Modes: Common */ + ENetworkSelectionAutomatic, + /** Network is selected manually by user. + + Modes: GSM/WCDMA */ + ENetworkSelectionManual, + /** Network selection is restricted to home network only + + Modes: CDMA */ + ENetworkSelectionHomeOnly + }; + +/** The mobile phone band class preferences. + +Modes: CDMA */ + enum TMobilePhoneBandClass + { + /** Band class selection is unknown. */ + ENetworkBandClassUnknown, + /** Phone will select band class A only. */ + ENetworkBandClassAOnly, + /** Phone will select band class B only. */ + ENetworkBandClassBOnly, + /** Phone will prefer to select band class A. */ + ENetworkBandClassAPreferred, + /** Phone will prefer to select band class B. */ + ENetworkBandClassBPreferred + }; + +/** The mobile phone network operation mode preferences. + +Modes: CDMA */ + enum TMobilePhoneOperation + { + /** Network operation mode is unknown. */ + ENetworkOperationUnknown, + /** Phone will select analog operation only. */ + ENetworkOperationAnalogOnly, + /** Phone will select digital/CDMA operation only. */ + ENetworkOperationDigitalOnly, + /** Phone will prefer to select analog operation. */ + ENetworkOperationAnalogPreferred, + /** Phone will prefer to select digital/CDMA operation. */ + ENetworkOperationDigitalPreferred + }; + + class TMobilePhoneNetworkSelectionV1 : public TMultimodeType +/** The mobile phone network selection preferences. + +@see GetNetworkSelectionSetting() +@see SetNetworkSelectionSetting() +@see NotifyNetworkSelectionSettingChange() +@publishedPartner +@released */ + { + public: + IMPORT_C TMobilePhoneNetworkSelectionV1(); + public: + /** Phone's network selection function member. + + Modes: Common + + @see TMobilePhoneSelectionMethod */ + TMobilePhoneSelectionMethod iMethod; + /** Phone's band class setting. + + Modes: CDMA + + @see TMobilePhoneBandClass */ + TMobilePhoneBandClass iBandClass; + /** Phone's CDMA operation mode. + + Modes: CDMA + + @see TMobilePhoneOperation */ + TMobilePhoneOperation iOperationMode; + }; + +/** A typedef'd packaged TMobilePhoneNetworkSelectionV1 for passing through a generic +API function member. */ + typedef TPckg TMobilePhoneNetworkSelectionV1Pckg; + + IMPORT_C TInt GetNetworkSelectionSetting(TDes8& aSetting) const; + IMPORT_C void SetNetworkSelectionSetting(TRequestStatus& aReqStatus, const TDes8& aSetting) const; + IMPORT_C void NotifyNetworkSelectionSettingChange(TRequestStatus& aReqStatus, TDes8& aSetting) const; + + struct TMobilePhoneNetworkManualSelection +/** The mobile phone manual network selection parameters. + +Modes: GSM/WCDMA + +@see TMobilePhoneNetworkCountryCode */ + { + /** The MCC of the network + + @see TMobilePhoneNetworkCountryCode */ + TMobilePhoneNetworkCountryCode iCountry; + /** The MNC of the network + + @see TMobilePhoneNetworkIdentity */ + TMobilePhoneNetworkIdentity iNetwork; + }; + + IMPORT_C void SelectNetwork(TRequestStatus& aReqStatus, TBool aIsManual, const TMobilePhoneNetworkManualSelection& aManualSelection) const; + + + + // Used to indicate which TMobilePhoneNITZ fields are currently available +/** The Phone Network Time Zone Capabilities. */ + enum TMobilePhoneNITZCaps + { + /** Universal Time is available in the current network mode. */ + KCapsTimeAvailable = 0x00000001, + /** Local time zone is available in the current network mode. */ + KCapsTimezoneAvailable = 0x00000002, + /** DST is available in the current network mode. */ + KCapsDSTAvailable = 0x00000004, + /** Short name is available in the current network mode. */ + KCapsShortNameAvailable = 0x00000008, + /** Long name is available in the current network mode. */ + KCapsLongNameAvailable = 0x00000010 + }; + + class TMobilePhoneNITZ : public TDateTime +/** Defines time and date information received from a mobile phone network. + +@see GetNITZInfo() +@see NotifyNITZInfoChange() +@publishedPartner +@released */ + { + public: + IMPORT_C TMobilePhoneNITZ(); + IMPORT_C TMobilePhoneNITZ(TInt aYear, TMonth aMonth, TInt aDay, TInt aHour, TInt aMinute, TInt aSecond, TInt aMicroSecond); + public: + /** Bitwise sum of TMobilePhoneNITZCaps constants used to indicate which NITZ fields + are available. + + Modes: Common */ + TInt32 iNitzFieldsUsed; + /** Time zone, expressed in +/- 15 minute offsets from GMT. + + Modes: Common */ + TInt iTimeZone; + /** Daylight Saving Time adjustment for summer time. The adjustment for DST + can be +1h or +2h. + + Modes: GSM/WCDMA */ + TInt iDST; + /** Network name in "short" representation. + + Modes: GSM/WCDMA + + @see TMobilePhoneNetworkShortName */ + TMobilePhoneNetworkShortName iShortNetworkId; + /** Network name in "long" representation. + + Modes: GSM/WCDMA + + @see TMobilePhoneNetworkLongName */ + TMobilePhoneNetworkLongName iLongNetworkId; + }; + + IMPORT_C TInt GetNITZInfo(TMobilePhoneNITZ& aNITZInfo) const; + IMPORT_C void NotifyNITZInfoChange(TRequestStatus& aReqStatus, TMobilePhoneNITZ& aNITZInfo) const; + + enum { KMaxSPNameSize=16 }; + enum { KMaxPLMNFieldSize=251 }; + + enum TDisplayRequirements + { + KDisplayPLMNNotRequired = 0x00000001, + KDisplayPLMNRequired = 0x00000002, + KDisplaySPNRequired = 0x00000004, + KDisplaySPNNotRequired = 0x00000008 + }; + + typedef TUint32 TDisplayRequirementsFlags; + + class TMobilePhoneServiceProviderNameV2 : public TMultimodeType +/** Used to retrieve the Service Provider Name from the ICC. The +SP is actually the entity that provides the service. The SP could have contractual +agreements with several home PLMN that the ME can register to. The display +preference of the registered PLMN and/or the SPN on the ME can be defined +on the UICC. +@publishedPartner +@released */ + { + public: + IMPORT_C TMobilePhoneServiceProviderNameV2(); + public: + /** This parameter specifies if the display of the registered PLMN is required. + Can contain a number of flags from RMobilePhone::TDisplayRequirements. + */ + TDisplayRequirementsFlags iDisplayReq; + /** The name of the service provider. */ + TBuf iSPName; + TBuf iPLMNField; + }; + +/** A typedef'd packaged TMobilePhoneServiceProviderNameV2 for passing through +a generic API function member. */ + typedef TPckg TMobilePhoneServiceProviderNameV2Pckg; + + IMPORT_C void GetServiceProviderName(TRequestStatus& aReqStatus, TDes8& aName) const; + + /** + Network investigation scan settings. + */ + enum TMobilePhoneInvestigationScan + { + /** + Network investigation setting in limited service mode. + */ + KNetworkInvLimited = 0x01, + /** + Network investigation setting after successful PLMN selection. + */ + KNetworkInvAfterPlmnSelection=0x02 + }; + + /** + Network investigation scan events. + */ + enum TMobilePhoneInvestigationScanEvent + { + /** + No investigation scan events available. + */ + ENetworkInvestigationNoEvent, + /** + A higher priority network has been detected, but it does not offer CS Voice. + */ + ENetworkInvestigationHighPriorityPlmn + }; + + IMPORT_C TInt GetNetworkInvScanSetting(TMobilePhoneInvestigationScan & aSetting) const; + IMPORT_C void NotifyNetworkInvScanChange(TRequestStatus& aReqStatus, TMobilePhoneInvestigationScan& aSetting) const; + IMPORT_C void NotifyNetworkInvScanEvent(TRequestStatus& aReqStatus, TMobilePhoneInvestigationScanEvent& aEvent) const; + + + /** 251 bytes is the maximum number of octets in an L3 message as defined in3GPP TS 44.006. */ + enum { KMaxNetworkNameFieldSize = 251 }; + + class TMobilePhoneNetworkNameV3 : public TMultimodeType + /** + Class containing short, long network names and location information for a PLMN. + */ + { + public: + IMPORT_C TMobilePhoneNetworkNameV3(); + public: + /** + The long name (up to 20 characters) of the network operator. + */ + TMobilePhoneNetworkLongName iLongName; + /** + The short name (up to 10 characters) of the network operator. + */ + TMobilePhoneNetworkShortName iShortName; + /** + This buffer contains other long and short names for the registered PLMN coded as TLV objects. + */ + TBuf iOtherNames; + }; + + /** + Packaging typedef for TMobilePhoneNetworkNameV3 class. + */ + typedef TPckg TMobilePhoneNetworkNameV3Pckg; + + + class TMobilePhoneOPlmnV3 : public TMultimodeType + /** + Class containing network name information. + */ + { + public: + IMPORT_C TMobilePhoneOPlmnV3(); + public: + /** + The MCC of the registered PLMN, with "wild" values specified for the particular digits of the code. + */ + TMobilePhoneNetworkCountryCode iCountryCode; + /** + The MNC of the registered PLMN, with "wild" values specified for the particular digits of the code. + */ + TMobilePhoneNetworkIdentity iNetworkId; + /** + The id of the Network Name to be displayed for the (following) location area codes. + */ + TUint32 iPNNid; + /** + First Location area code for defining the entire range of LACs for the registered PLMN. + */ + TUint iFirstLocationAreaCode; + /** + Last Location area code defining the entire range of LACs for the registered PLMN. + */ + TUint iLastLocationAreaCode; + + }; + + /** + Packaging typedef for TMobilePhoneOPlmnV3 class. + */ + typedef TPckg TMobilePhoneOPlmnV3Pckg; + + IMPORT_C void GetCurrentNetworkName(TRequestStatus& aReqStatus, TDes8& aNetworkName, TDes8& aLocInfo) const; + + /** + Identifiers for different access technologies. + */ + enum TMobilePhoneNetworkAccessCaps + { + /** + No network activity. + */ + KNetworkAccessUnknown=0x0000, + /** + Access technology is GSM. + */ + KNetworkAccessGsm=0x8000, + /** + Access technology is GSM COMPACT. + */ + KNetworkAccessGsmCompact=0x4000, + /** + Access technology is UTRAN (UMTS only). + */ + KNetworkAccessUtran=0x0080 + }; + + typedef TUint32 TMobilePhoneNetworkAccessCapsFlags; + + class TMobilePreferredNetworkEntryV3 : public TMultimodeType + /** + Defines information for a preferred network. + */ + { + public: + IMPORT_C TMobilePreferredNetworkEntryV3(); + public: + void InternalizeL(RReadStream& aStream); + void ExternalizeL(RWriteStream& aStream) const; + public: + /** + Access Technology supported. + Can contain a number of flags from RMobilePhone::TMobilePhoneNetworkAccessCaps. + */ + TMobilePhoneNetworkAccessCapsFlags iAccess; + /** + Editable preferences in the User-controlled Networks List with Access Technology. + */ + TBool iUserDefined; + /** + The MCC of the network. + */ + TMobilePhoneNetworkCountryCode iCountryCode; + /** + The MNC of the network. + */ + TMobilePhoneNetworkIdentity iNetworkId; + }; + + IMPORT_C void StorePreferredNetworksListL(TRequestStatus& aReqStatus, CMobilePhoneStoredNetworkList* aList) const; + IMPORT_C void NotifyPreferredNetworksListChange(TRequestStatus& aReqStatus) const; + + /***********************************************************************************/ + // + // Mobile Multimedia Call Settings functional unit + // + /***********************************************************************************/ + +/** An enumerated list of settings for multimedia calls. */ + enum TMobilePhoneMultimediaSettings + { + /** Accept all incoming multimedia calls with the fallback option enabled. (default). */ + EAcceptMMCallsVoiceFallback, + /** Accept all incoming multimedia calls, but do not accept voice fallback. */ + EAcceptMMCallsNoFallback, + /** Reject all incoming multimedia calls. */ + ERejectMMCalls, + /** Reject all incoming multimedia calls, but drop to voice instead. */ + EAnswerMMCallsAsVoice + }; + + IMPORT_C void SetMultimediaCallPreference(TRequestStatus& aReqStatus, TMobilePhoneMultimediaSettings aMmSettings) const; + IMPORT_C TInt GetMultimediaCallPreference(TMobilePhoneMultimediaSettings& aMmSettings) const; + IMPORT_C void NotifyMultimediaCallPreferenceChange(TRequestStatus& aReqStatus, TMobilePhoneMultimediaSettings& aMmSettings); + + /***********************************************************************************/ + // + // MobilePrivacy functional unit + // + /***********************************************************************************/ + +/** The mobile phone privacy settings. + +Modes: CDMA */ + enum TMobilePhonePrivacy + { + /** The privacy setting is unspecified. */ + EPrivacyUnspecified, + /** The privacy setting is set to ON. */ + EPrivacyOn, + /** The privacy setting is set to OFF. */ + EPrivacyOff + }; + + IMPORT_C TInt GetDefaultPrivacy(TMobilePhonePrivacy& aSetting) const; + IMPORT_C void SetDefaultPrivacy(TRequestStatus& aReqStatus, TMobilePhonePrivacy aSetting) const; + IMPORT_C void NotifyDefaultPrivacyChange(TRequestStatus& aReqStatus, TMobilePhonePrivacy& aSetting) const; + + /***********************************************************************************/ + // + // TSY Capabilities for supplementary call services + // + /***********************************************************************************/ + +/** The call services. + +Modes: GSM/WCDMA */ + enum TMobilePhoneCallServiceCaps + { + /** Phone supports retrieval of call forwarding status from a cache on the phone. + + Modes: GSM/WCDMA */ + KCapsGetCFStatusCache =0x00000001, + /** Phone supports retrieval of call forwarding status from the network. + + Modes: GSM/WCDMA */ + KCapsGetCFStatusNetwork =0x00000002, + /** Phone supports setting of call forwarding status (and registered information) + in the network. */ + KCapsSetCFStatus =0x00000004, + /** Phone supports notification of change in status of any call forwarding service. + + Modes: GSM/WCDMA */ + KCapsNotifyCFStatus =0x00000008, + /** Phone supports retrieval of CLIP status from either a cache or the network. + + Modes: GSM/WCDMA */ + KCapsGetClipStatus =0x00000010, + /** Phone supports retrieval of CLIR status from either a cache or the network. + + Modes: GSM/WCDMA */ + KCapsGetClirStatus =0x00000020, + /** Phone supports retrieval of COLP status from either a cache or the network. + + Modes: GSM/WCDMA */ + KCapsGetColpStatus =0x00000040, + /** Phone supports retrieval of COLR status from either a cache or the network. + + Modes: GSM/WCDMA */ + KCapsGetColrStatus =0x00000080, + /** Phone supports retrieval of CNAP status from either a cache or the network. + + Modes: GSM/WCDMA */ + KCapsGetCnapStatus =0x00000100, + /** Phone supports retrieval of call barring status from a cache on the phone. + + Modes: Common */ + KCapsGetCBStatusCache =0x00000200, + /** Phone supports retrieval of call barring status from the network. + + Modes: GSM/WCDMA */ + KCapsGetCBStatusNetwork =0x00000400, + /** Phone supports setting of call barring status in the network. + + Modes: Common */ + KCapsSetCBStatus =0x00000800, + /** Phone supports notification of change in call barring status for any service. + + Modes: Common */ + KCapsNotifyCBStatus =0x00001000, + /** Phone supports setting of a password for call barring service. + + Modes: Common */ + KCapsChangeCBPassword =0x00002000, + /** Phone supports BAIC call barring service. + + Modes: Common */ + KCapsBarAllIncoming =0x00004000, + /** Phone supports BIC-Roam call barring service. + + Modes: Common */ + KCapsBarIncomingRoaming =0x00008000, + /** Phone supports BAOC call barring service. + + Modes: Common */ + KCapsBarAllOutgoing =0x00010000, + /** Phone supports BOIC call barring service. + + Modes: Common */ + KCapsBarOutgoingInternational =0x00020000, + /** Phone supports BOIC-ExHC call barring service. + + Modes: Common */ + KCapsBarOutgoingInternationalExHC =0x00040000, + /** Phone supports barring all cases at once. + + Modes: Common */ + KCapsBarAllCases =0x00080000, + /** Phone supports retrieval of call waiting status from a cache on the phone. + + Modes: GSM/WCDMA */ + KCapsGetCWStatusCache =0x00100000, + /** Phone supports retrieval of call waiting status from the network. + + Modes: GSM/WCDMA */ + KCapsGetCWStatusNetwork =0x00200000, + /** Phone supports setting of call waiting status in the network. + + Modes: Common */ + KCapsSetCWStatus =0x00400000, + /** Phone supports notification of change in call waiting status for any service. + + Modes: GSM/WCDMA */ + KCapsNotifyCWStatus =0x00800000, + /** Phone supports retrieval of call completion (CCBS) status from a cache on the + phone. + + Modes: GSM/WCDMA */ + KCapsGetCCBSStatusCache =0x01000000, + /** Phone supports retrieval of call completion (CCBS) status from the network. + + Modes: GSM/WCDMA */ + KCapsGetCCBSStatusNetwork =0x02000000, + /** Phone supports deactivation of all CCBS requests at once. + + Modes: GSM/WCDMA */ + KCapsDeactivateAllCCBS =0x04000000, + KCapsDeactivateCCBS =0x08000000, + /** Phone supports retrieval of a list of active CCBS requests. + + Modes: GSM/WCDMA */ + KCapsRetrieveActiveCCBS =0x10000000, + /** The phone supports programming and retrieval of feature code against a CDMA + network service. + + Modes: CDMA */ + KCapsFeatureCode =0x20000000, + /** The phone supports sending of generic network service request strings. + + Modes: Common */ + KCapsNetworkServiceRequest =0x40000000, + /** The phone supports retrieval of called line identification status. + + Modes: GSM/WCDMA */ + KCapsGetCdipStatus =0x80000000 + }; + + IMPORT_C TInt GetCallServiceCaps(TUint32& aCaps) const; + IMPORT_C void NotifyCallServiceCapsChange(TRequestStatus& aReqStatus, TUint32& aCaps) const; + + /***********************************************************************************/ + // + // MobilePhoneUserNetworkAccess functional unit + // + /***********************************************************************************/ + +/** Mobile Phone network services. + +Modes: CDMA */ + enum TMobilePhoneNetworkService + { + /** Network service is unspecified. */ + ENetworkServiceUnspecified, + /** Feature code applies to call forwarding unconditional service. */ + ECFUService, + /** Feature code applies to call forwarding on busy service. */ + ECFBService, + /** Feature code applies to call forwarding on no reply service. */ + ECFNRyService, + /** Feature code applies to call forwarding on not reachable service. */ + ECFNRcService, + /** Feature code applies to user selective call forwarding service - when the + user wishes to forward incoming call to voicemail. */ + EDeflectToVoicemail, + /** Feature code applies to user selective call forwarding service - when the + user wishes to forward incoming call to a number supplied within the deflect + request. */ + EDeflectToNumber, + /** Feature code applies to user selective call forwarding service - when the + user wishes to forward incoming call to a number pre-registered within the + network. */ + EDeflectToRegisteredNumber, + /** Feature code applies to call waiting service. */ + ECWService, + ENextCallShowCLI, + /** Feature code applies to caller ID restriction service - when user wishes to + hide their ID for the next call they make. */ + ENextCallHideCLI + }; + +/** Mobile phone service actions. + +Modes: Common */ + enum TMobilePhoneServiceAction + { + /** The action is unspecified. */ + EServiceActionUnspecified, + /** The client is registering new service information. If the service was not active + then this action also activates the service. */ + EServiceActionRegister, + /** The client is activating the service. */ + EServiceActionActivate, + /** The client is invoking the service. */ + EServiceActionInvoke, + /** The client is deactivating the service. */ + EServiceActionDeactivate, + /** The client is erasing the currently registered service information. If the service + was active then this action also deactivates the service. */ + EServiceActionErase + }; + + /** + Defines the type of SS operation + */ + enum TMobilePhoneNotifySendSSOperation + { + /** + SS Invoke operation. + */ + ESendSSInvoke, + /** + SS ReturnResult operation. + */ + ESendSSReturnResult, + /** + SS ReturnError operation. + */ + ESendSSReturnError, + /** + SS Reject operation. + */ + ESendSSReject + }; + + /** Size of additional info buffer. */ + enum{ KAdditionalInfoSize = 244 }; + + class TMobilePhoneSendSSRequestV3 : public TMultimodeType + /** + Contains the operation code and buffer to hold any additional information when receiving a notification + about a network service request. + */ + { + public: + IMPORT_C TMobilePhoneSendSSRequestV3(); + public: + /** + This is the Operation Code for a Send SS Invoke or Return result events. + This is the Error or Problem Code for a Send SS Return Error or Reject events. + */ + TUint8 iOpCode; + /** + The additional information (parameters) for a Send SS Invoke or Return result or Return Error events. + This is not used for a Send SS Reject event + */ + TBuf iAdditionalInfo; + }; + + /** + Packaging typedef for TMobilePhoneSendSSRequestV3 class. + */ + typedef TPckg TMobilePhoneSendSSRequestV3Pckg; + + // API/TSY internal type + + struct TNetworkServiceAndAction + { + TMobilePhoneNetworkService iService; + TMobilePhoneServiceAction iAction; + }; + + IMPORT_C void ProgramFeatureCode(TRequestStatus& aReqStatus, const TDesC& aFCString, TMobilePhoneNetworkService aService, TMobilePhoneServiceAction aAction) const; + IMPORT_C void GetFeatureCode(TRequestStatus& aReqStatus, TDes& aFCString, TMobilePhoneNetworkService aService, TMobilePhoneServiceAction aAction) const; + + IMPORT_C void SendNetworkServiceRequest(TRequestStatus& aReqStatus, const TDesC& aServiceString) const; + IMPORT_C void SendNetworkServiceRequestNoFdnCheck(TRequestStatus& aReqStatus, const TDesC& aServiceString) const; + IMPORT_C void NotifySendNetworkServiceRequest(TRequestStatus& aReqStatus, const TMobilePhoneNotifySendSSOperation aOperation, TDes8& aRequestComplete) const; + + /***********************************************************************************/ + // + // MobilePhoneCallForwarding functional unit + // + /***********************************************************************************/ + +/** The Call Forwarding flavours. + +Modes: GSM/WCDMA */ + enum TMobilePhoneCFCondition + { + /** The call forwarding service is unspecified. */ + ECallForwardingUnspecified, + /** All calls to this subscriber are forwarded. */ + ECallForwardingUnconditional, + /** Calls are forwarded when this subscriber is busy. */ + ECallForwardingBusy, + /** Calls are forwarded when this subscriber does not reply within a time-out period. */ + ECallForwardingNoReply, + /** Calls are forwarded when this subscriber is unreachable. */ + ECallForwardingNotReachable, + /** All of above CF services. Can be used to check all 4 call forwarding Fs + at once. */ + ECallForwardingAllCases, // combination of all four above cases + /** All the conditional (busy, no reply, not reachable) CF services. Can be used + to check all 3 conditional call forwarding conditions at once. */ + ECallForwardingAllConditionalCases // combination of CFB, CFNRy and CFNRc + }; + +/** The Call Forwarding status + +Modes: GSM/WCDMA */ + enum TMobilePhoneCFStatus + { + /** The CF service is currently active and operative. */ + ECallForwardingStatusActive, + /** The CF service is currently deactivated. */ + ECallForwardingStatusNotActive, + /** The CF service is not registered. */ + ECallForwardingStatusNotRegistered, + /** The CF service is not provisioned. */ + ECallForwardingStatusNotProvisioned, + /** The CF service is not available in the serving network. */ + ECallForwardingStatusNotAvailable, + /** The phone can not determine CF service status. */ + ECallForwardingStatusUnknown, + /** The Call Forwarding service is active and the presentation indicator is set + to allowed */ + ECallForwardingStatusActivePIAllowed, + /** The Call Forwarding service is active and the presentation indicator is set + to not available */ + ECallForwardingStatusActivePINotAvailable, + /** The Call Forwarding service is active and the presentation indicator is set + to restricted + + The Call Forwarding service is active and the presentation indicator is set + to restricted and screening returns "User provided, verified and passed". */ + ECallForwardingStatusActivePIClir, + /** The Call Forwarding service is active and the presentation indicator is set + to restricted and screening returns "User provided, not screened". */ + ECallForwardingStatusActivePIClirSIVerified, + /** The Call Forwarding service is active and the presentation indicator is set + to "restricted" and screening returns "Network provided". */ + ECallForwardingStatusActivePIClirSINotScreened, + /** The Call Forwarding service is active and the presentation indicator is set + to "restricted" and screening returns "Network provided". */ + ECallForwardingStatusActivePIClirSINetwork, + /** The CF service is currently in the quiescent state. */ + ECallForwardingStatusQuiescent + }; + + + + class TMobilePhoneCFInfoEntryV1 : public TMultimodeType +/** Defines information about the call forwarding service. + +Modes: GSM/WCDMA + +@see CMobilePhoneCFList +@publishedPartner +@released +*/ + { + public: + IMPORT_C TMobilePhoneCFInfoEntryV1(); + public: + void InternalizeL(RReadStream& aStream); + void ExternalizeL(RWriteStream& aStream) const; + public: + /** The CF service of this list entry. + + @see TMobilePhoneCFCondition */ + TMobilePhoneCFCondition iCondition; + /** The basic service group associated to this CF service list entry. + + @see TMobileService */ + TMobileService iServiceGroup; + /** The current status of the call forwarding condition. + + @see TMobilePhoneCFStatus */ + TMobilePhoneCFStatus iStatus; + /** The "forward-to" telephone number registered for the call forwarding condition. + An empty string if CF service is not registered, not provisioned or not available. + + @see TMobileAddress */ + TMobileAddress iNumber; + /** The "No Reply" time-out (in seconds) registered for the call forwarding no reply + condition. + + Equals to -1 if this value is not applicable. In GSM mode, will be between + 5 and 30 and in steps of 5 if this value is applicable. */ + TInt iTimeout; // valid for CFRNy only + }; + + IMPORT_C void NotifyCallForwardingStatusChange(TRequestStatus& aReqStatus, TMobilePhoneCFCondition& aCondition) const; + + class TMobilePhoneCFChangeV1 : public TMultimodeType +/** Defines the call forward information. + +@see SetCallForwardingStatus() +@publishedPartner +@released +*/ + { + public: + IMPORT_C TMobilePhoneCFChangeV1(); + public: + /** The basic service group(s) to apply the CF status change to. + + @see TMobileService */ + TMobileService iServiceGroup; + /** The service action for call forwarding. + + @see TMobilePhoneServiceAction */ + TMobilePhoneServiceAction iAction; + /** A new "forward-to" number to be registered against the CF condition. This is + applicable if iAction=EServiceActionRegister. In other cases, it is set to + an empty string. + + @see TMobileAddress */ + TMobileAddress iNumber; + /** The new "No Reply" time-out in seconds to be registered. This is applicable + if the CF condition is CFNRy and iAction=EServiceActionRegister. Equals -1 + if this value is not applicable. If applicable, in GSM mode will be between + 5 and 30 and in steps of 5. */ + TInt iTimeout; + }; + + IMPORT_C void SetCallForwardingStatus(TRequestStatus& aReqStatus, TMobilePhoneCFCondition aCondition, const TMobilePhoneCFChangeV1& aInfo) const; + +/** Call Forwarding Active Notification + +Modes: Common */ + enum TMobilePhoneCFActive + { + /** CF Unconditional is currently active. */ + ECFUnconditionalActive, + /** CF Busy, CF No Reply or CF Not Reachable is currently active. */ + ECFConditionalActive + }; + + IMPORT_C void NotifyCallForwardingActive(TRequestStatus& aReqStatus, TMobileService& aServiceGroup, TMobilePhoneCFActive& aActiveType) const; + + /** + Current status indicators for unconditional call forwarding. + */ + enum TCFUIndicatorStatus + { + /** + CFU Indicator status unknown. + */ + KCFUIndicatorUnknown = 0x0, + /** + CFU Indicator status for Voice (TMobileServiceGroup EVoice). + */ + KCFUIndicatorVoice=0x01, + /** + CFU Indicator status for Fax (TMobileServiceGroup EFax). + */ + KCFUIndicatorFax=0x02, + /** + CFU Indicator status for Data Teleservices(TMobileServiceGroup EData). + */ + KCFUIndicatorData=0x04, + /** + CFU Indicator status for Sms (TMobileServiceGroup ESms). + */ + KCFUIndicatorSms=0x08, + /** + CFU Indicator status for Data Bearer Services(TMobileServiceGroup EDataBearer). + */ + KCFUIndicatorDataBearer=0x10 + }; + + typedef TUint32 TCFUIndicatorStatusFlags; + + class TMobilePhoneCFUIndicatorV3 : public TMultimodeType + /** + Contains indicator parameters for unconditional call forwarding. + */ + { + public: + IMPORT_C TMobilePhoneCFUIndicatorV3(); + public: + /** + Current setting for indicator status. + Can contain a number of flags from RMobilePhone::TCFUIndicatorStatus. + */ + TCFUIndicatorStatusFlags iIndicator; + }; + + typedef TPckg TMobilePhoneCFUIndicatorV3Pckg; + + /** + The MSP number contains the Profile Identity of the subscriber profile. + The Profile Identity shall be any of the following enlisted. + @see 3GPP TS 31.102 v7.4.1 section 4.2.64 + @see 3GPP TS 23.097 [36] + */ + enum TMultipleSubscriberProfileID + { + /** + Profile Identity Unknown + */ + KProfileIdentityUnknown = 0x0, + /** + Profile Identity 1 + */ + KProfileIdentityOne = 0x01, + /** + Profile Identity 2 + */ + KProfileIdentityTwo = 0x02, + /** + Profile Identity 3 + */ + KProfileIdentityThree = 0x04, + /** + Profile Identity 4 + */ + KProfileIdentityFour = 0x08 + }; + + class TMobilePhoneCFUIndicatorV6 : public TMobilePhoneCFUIndicatorV3 + /** + Contains the indicator parameters for unconditional call forwarding. + The TMobilePhoneCFUIndicatorV6 supports MSP number(Multiple Subscriber Profile) and Call Forwarding Number. + Upto four different profiles can be provisioned against a subscriber using the MSP feature. + @see 3GPP TS 31.102 v7.4.1 section 4.2.64 + */ + { + public: + IMPORT_C TMobilePhoneCFUIndicatorV6(); + public: + /** + @see RMoblie::TMobileAddress + */ + TMobileAddress iCFNumber; + /** + The profile IDs allow unambiguous identification of each profile. + This will allow the subscriber to select the preferred profile for outgoing calls and for subscriber actions. + For terminating calls the profile ID shall be part of the notification of the profile. + */ + TMultipleSubscriberProfileID iMultipleSubscriberProfileID; + }; + + typedef TPckg TMobilePhoneCFUIndicatorV6Pckg; + + IMPORT_C void GetCallForwardingIndicator(TRequestStatus& aReqStatus, TDes8& aIndicator) const; + + /***********************************************************************************/ + // + // Mobile Identity Service functional unit + // + /***********************************************************************************/ + +/** Phone ID services (CLIP/CNIP/CLIR). + +Modes: GSM/WCDMA */ + enum TMobilePhoneIdService + { + /** The identity service is unspecified */ + EIdServiceUnspecified, + /** The caller's ID is presented to the called party. */ + EIdServiceCallerPresentation, + /** The caller's ID is restricted to the called party. */ + EIdServiceCallerRestriction, + /** The connected party's ID is presented to the calling party. */ + EIdServiceConnectedPresentation, + /** The connected party's ID is restricted to the calling party. */ + EIdServiceConnectedRestriction, + /** The caller's name is presented to the called party. */ + EIdServiceCallerName, + /** The called party is presented with the caller's ID. This command enables a + called subscriber to get the called line identification of the called party + when receiving a mobile terminated call. - maps to +CDIP. */ + EIdServiceCalledPresentation + }; + +/** Service status of the Phone ID services (CLIP/CLIR/CNIP). + +Modes: GSM/WCDMA */ + enum TMobilePhoneIdServiceStatus + { + /** The interrogated Identity service is provisioned and active. This status is + used for all identity services and in the case of the CLIR service means that + it is permanently active with no subscription option set. */ + EIdServiceActivePermanent, + /** This status is used for the CLIR service only and means that the service is + provisioned and active. + + The CLIR subscription option is set to "Temporary, default restricted", therefore + identity is always restricted unless over-ridden by the user during a call + set-up. */ + EIdServiceActiveDefaultRestricted, + /** This status is used for the CLIR service only and means that the service is + provisioned and active. + + The CLIR subscription option is set to "Temporary, default allowed", therefore + identity is always allowed unless over-ridden by the user during a call set-up. */ + EIdServiceActiveDefaultAllowed, + /** The interrogated Identity service is not provisioned. */ + EIdServiceNotProvisioned, + /** The status of the interrogated Identity service is unknown. */ + EIdServiceUnknown + }; + + // for use by client-side API code and TSY only + + struct TIdServiceAndLocation + { + TMobilePhoneIdService iService; + TMobileInfoLocation iLocation; + }; + + /** This function member retrieves the current status of the identity service specified. + + The phone will retrieve this service status information from the location + specified by the client. + + If the client has requested EInfoLocationCache but there is no valid status + information in the cache then the request will return KErrNotFound. + + If the client has requested EInfoLocationCachePreferred, the network will + be interrogated if the cache is empty. Whenever the network is interrogated, + the cache will be refreshed with the information from the network. + + Use RTelSubSessionBase::CancelAsyncRequest(EMobilePhoneGetIdentityServiceStatus) + to cancel a previously placed asynchronous GetIdentityServiceStatus() request. + + @param aReqStatus On return, KErrNone if successful. + @param aService The identity service to be queried. + @param aStatus On return, the service status. + @param aLocation The location to use. */ + IMPORT_C void GetIdentityServiceStatus(TRequestStatus& aReqStatus, TMobilePhoneIdService aService, TMobilePhoneIdServiceStatus& aStatus, TMobileInfoLocation aLocation = EInfoLocationCachePreferred) const; + + /** + Identifies default service status for provisioned identity services. + */ + enum TMobilePhoneIdServiceSetting + { + /** Sets the default setting to network default (unknown). */ + EIdServiceNetworkDefault, + /** Sets the default setting to presentation restricted. */ + EIdServicePresentationRestricted, + /** Sets the default setting to presentation allowed. */ + EIdServicePresentationAllowed + }; + + IMPORT_C void SetIdentityServiceStatus(TRequestStatus& aReqStatus, const TMobilePhoneIdService aService, const TMobilePhoneIdServiceSetting aSetting) const; + IMPORT_C void NotifyIdentityServiceStatus(TRequestStatus& aReqStatus, const TMobilePhoneIdService aService, TMobilePhoneIdServiceStatus& aStatus) const; + IMPORT_C void NotifyIdentitySuppressionRejected(TRequestStatus& aReqStatus) const; + + /***********************************************************************************/ + // + // Mobile Call Barring Functional Unit + // + /***********************************************************************************/ + +/** Mobile Phone Call Baring Conditions. + +Modes: Common */ + enum TMobilePhoneCBCondition + { + /** The barring program is unspecified */ + EBarUnspecified, + /** All incoming calls to this subscriber are barred (BAIC). */ + EBarAllIncoming, + /** All incoming calls to this subscriber are barred when roaming outside the home + PLMN country (BIC-roam). */ + EBarIncomingRoaming, + /** All outgoing calls by this subscriber are barred (BAOC). */ + EBarAllOutgoing, + /** All outgoing international calls by this subscriber are barred (BOIC). */ + EBarOutgoingInternational, + /** All outgoing international calls except those directed to the home PLMN country + by this subscriber are barred (BOIC-ExHC). */ + EBarOutgoingInternationalExHC, + /** All of above CB services. */ + EBarAllCases, + EBarAllOutgoingServices, + EBarAllIncomingServices + }; + +/** Mobile Phone Call Barring Status and Information. + +Modes: Common */ + enum TMobilePhoneCBStatus + { + /** The CB service is currently active and operative. */ + ECallBarringStatusActive, + /** The CB service is currently deactivated or quiescent. */ + ECallBarringStatusNotActive, + /** In GSM/WCDMA mode, the CB service is not provisioned. In CDMA mode, this value + has no meaning. */ + ECallBarringStatusNotProvisioned, + /** In GSM/WCDMA mode, the CB service is not available in serving network. In CDMA + mode, the CB service is not available in the phone. */ + ECallBarringStatusNotAvailable, + /** The phone can not determine CB service status. */ + ECallBarringStatusUnknown + }; + + + + class TMobilePhoneCBInfoEntryV1 : public TMultimodeType +/** Defines information about the call barring service. + +@see CMobilePhoneCBList +@publishedPartner +@released +*/ + { + public: + void InternalizeL(RReadStream& aStream); + void ExternalizeL(RWriteStream& aStream) const; + public: + IMPORT_C TMobilePhoneCBInfoEntryV1(); + public: + /** The CB service of this list entry. + + Modes: Common + + @see TMobilePhoneCBCondition */ + TMobilePhoneCBCondition iCondition; + /** The service group associated to this list entry. + + Modes: Common + + @see TMobileService */ + TMobileService iServiceGroup; + /** The CB service status of this list entry. + + Modes: Common + + @see TMobilePhoneCBStatus */ + TMobilePhoneCBStatus iStatus; + }; + + class TMobilePhoneCBInfoEntryV3 : public TMobilePhoneCBInfoEntryV1 + /** + V3 class extending TMobilePhoneCBInfoEntryV1 to add a comparison method parameter. + */ + { + public: + void InternalizeL(RReadStream& aStream); + void ExternalizeL(RWriteStream& aStream) const; + public: + IMPORT_C TMobilePhoneCBInfoEntryV3(); + public: + /** + The comparison method associated with this CB entry. + */ + TUint8 iCompMethod; + }; + + class TMobilePhoneCBChangeV1 : public TMultimodeType +/** Mobile Phone Call Barring Change. + +@see SetCallBarringStatus() +*/ + { + public: + IMPORT_C TMobilePhoneCBChangeV1(); + public: + /** The basic service group(s) to apply the CB status change to. + + @see TMobileService */ + TMobileService iServiceGroup; + /** The service action for call barring. + + @see TMobilePhoneServiceAction */ + TMobilePhoneServiceAction iAction; + /** Password required to perform the call barring service action. + + @see TMobilePassword */ + TMobilePassword iPassword; + }; + + IMPORT_C void SetCallBarringStatus(TRequestStatus& aReqStatus, TMobilePhoneCBCondition aCondition, const TMobilePhoneCBChangeV1& aInfo) const; + IMPORT_C void NotifyCallBarringStatusChange(TRequestStatus& aReqStatus, TMobilePhoneCBCondition& aCondition) const; + + class TMobilePhonePasswordChangeV1 : public TMultimodeType +/** Mobile phone password change. + +@see SetCallBarringPassword() +@see ChangeSecurityCode() +@publishedPartner +@released +*/ + { + public: + IMPORT_C TMobilePhonePasswordChangeV1(); + public: + /** Old password. + + Modes: Common + + @see TMobilePassword */ + TMobilePassword iOldPassword; + /** New password. + + Modes: Common + + @see TMobilePassword */ + TMobilePassword iNewPassword; + }; + + IMPORT_C void SetCallBarringPassword(TRequestStatus& aReqStatus, const TMobilePhonePasswordChangeV1& aPassword) const; + + class TMobilePhonePasswordChangeV2 : public TMobilePhonePasswordChangeV1 +/** Mobile phone password change version 2. +*/ + { + public: + IMPORT_C TMobilePhonePasswordChangeV2(); + public: + /** Verified password. + + Modes: Common + + @see TMobilePassword */ + TMobilePassword iVerifiedPassword; + }; + +/** A typedef'd packaged TMobilePhonePasswordChangeV2 passing through a generic +API function member. */ + typedef TPckg TMobilePhonePasswordChangeV2Pckg; + + IMPORT_C void SetSSPassword(TRequestStatus& aReqStatus, const TDesC8& aPassword, const TInt aService) const; + + IMPORT_C void GetCompMethodName(TRequestStatus& aReqStatus, TDes& aAlphaTag, const TUint8 aCmi) const; + + /***********************************************************************************/ + // + // Mobile Call Waiting Functional Unit + // + /***********************************************************************************/ + +/** The mobile phone call waiting status. + +Modes: GSM/WCDMA */ + enum TMobilePhoneCWStatus + { + /** The CW service is currently active and operative. */ + ECallWaitingStatusActive, + /** The CW service is currently deactivated or quiescent. */ + ECallWaitingStatusNotActive, + /** The CW service is not provisioned. */ + ECallWaitingStatusNotProvisioned, + /** The CW service is not available in the serving network. */ + ECallWaitingStatusNotAvailable, + /** The phone can not determine CW service status. */ + ECallWaitingStatusUnknown + }; + + + + class TMobilePhoneCWInfoEntryV1 : public TMultimodeType +/** Defines information about the call waiting service. + +@see CMobilePhoneCWList +*/ + { + public: + void InternalizeL(RReadStream& aStream); + void ExternalizeL(RWriteStream& aStream) const; + public: + IMPORT_C TMobilePhoneCWInfoEntryV1(); + public: + /** The service group associated to this CW service list entry. + + Modes: GSM/WCDMA + + @see TMobileService */ + TMobileService iServiceGroup; + /** The CW service status of this list entry. + + Modes: GSM/WCDMA + + @see TMobilePhoneCWStatus */ + TMobilePhoneCWStatus iStatus; + }; + +/** A typedef'd packaged TMobilePhoneCWInfoEntryV1 for passing through a generic +API function member. */ + typedef TPckg TMobilePhoneCWInfoEntryV1Pckg; + + IMPORT_C void SetCallWaitingStatus(TRequestStatus& aReqStatus, TMobileService aServiceGroup, TMobilePhoneServiceAction aAction) const; + IMPORT_C void NotifyCallWaitingStatusChange(TRequestStatus& aReqStatus, TDes8& aCWStatus) const; + + /***********************************************************************************/ + // + // Mobile Call Completion Unit + // + /***********************************************************************************/ + +/** The Call Completion Busy Subscriber status of the phone. + +Modes: GSM/WCDMA */ + enum TMobilePhoneCCBSStatus + { + /** User has CCBS provisioned and there is at least 1 (and up to 5) active CCBS + requests. */ + ECcbsActive, + /** User has CCBS provisioned but there are currently no active CCBS requests. */ + ECcbsNotActive, + /** User has not subscribed to the CCBS service. */ + ECcbsNotProvisioned, + /** The CCBS service is not available in the serving network. */ + ECcbsNotAvailable, + /** MS is unable to determine status of the CCBS service. */ + ECcbsUnknown + }; + +/** CCBS recall events. + +@see RMobilePhone::TMobilePhoneCCBSEntryV2 */ + enum TCCBSRecallEvent + { + /** Recall received. */ + ECcbsRecallReceived, + /** Recall accepted. */ + ECcbsRecallAccepted, + /** Recall refused. */ + ECcbsRecallRefused, + /** Recall reason unspecified. */ + ECcbsRecallUnspecified + }; + + + + class TMobilePhoneCCBSEntryV1 : public TMultimodeType +/** Defines information about the call completion (CCBS) service. + +@see CMobilePhoneCcbsList +@publishedPartner +@released +*/ + { + public: + void InternalizeL(RReadStream& aStream); + void ExternalizeL(RWriteStream& aStream) const; + public: + IMPORT_C TMobilePhoneCCBSEntryV1(); + public: + /** The CCBS index - a number allocated by the network. + + Modes: GSM/WCDMA */ + TInt iCcbsIndex; + /** The basic service group (voice/data/fax) this CCBS request is applicable to. + + Modes: GSM/WCDMA + + @see TMobileService */ + TMobileService iServiceGroup; + /** The phone number of the remote party to whom the CCBS request is aimed. + + Modes: GSM/WCDMA + + @see TMobileAddress */ + TMobileAddress iDestination; + + }; + +/** A typedef'd packaged TMobilePhoneCCBSEntryV1 for passing through a generic API +function member. */ + typedef TPckg TMobilePhoneCCBSEntryV1Pckg; + + + class TMobilePhoneCCBSEntryV2 : public TMobilePhoneCCBSEntryV1 +/** Defines information about the call completion (CCBS) service version 2. +*/ + { + public: + IMPORT_C TMobilePhoneCCBSEntryV2(); + public: + TCCBSRecallEvent iEvent; + }; + +/** A typedef'd packaged TMobilePhoneCCBSEntryV2 for passing through a generic API +function member. */ + typedef TPckg TMobilePhoneCCBSEntryV2Pckg; + + IMPORT_C void GetCCBSStatus(TRequestStatus& aReqStatus, TMobilePhoneCCBSStatus& aCcbsStatus, TMobileInfoLocation aLocation = EInfoLocationCachePreferred) const; + IMPORT_C void NotifyCCBSStatusChange(TRequestStatus& aReqStatus, TMobilePhoneCCBSStatus& aCcbsStatus) const; + IMPORT_C void DeactivateCCBS(TRequestStatus& aReqStatus, TInt aIndex) const; + IMPORT_C void NotifyCCBSRecall(TRequestStatus& aReqStatus, TDes8& aCCBSEntry) const; + IMPORT_C void AcceptCCBSRecall(TRequestStatus& aReqStatus, TInt aIndex, TName& aCallName) const; + IMPORT_C TInt RefuseCCBSRecall(TInt aIndex) const; + + /***********************************************************************************/ + // + // Mobile Alternating Call Function Unit + // + /***********************************************************************************/ + +/** Alternating Call Capabilities + +Modes: GSM */ + enum TMobilePhoneAlternatingCallCaps + { + /** Phone supports outgoing Voice/Data calls + + Modes: GSM */ + KCapsMOVoiceData = 0x00000001, + /** Phone supports outgoing Voice Then Data calls. + + Modes: GSM */ + KCapsMOVoiceThenData = 0x00000002, + /** Phone supports outgoing Voice/Fax calls. + + Modes: GSM/WCDMA */ + KCapsMOVoiceFax = 0x00000004, + /** Phone supports incoming Voice/Data calls. + + Modes: GSM */ + KCapsMTVoiceData = 0x00000008, + /** Phone supports incoming Voice Then Data calls. + + Modes: GSM */ + KCapsMTVoiceThenData = 0x00000010, + /** Phone supports incoming Voice/Fax calls + + Modes: GSM/WCDMA */ + KCapsMTVoiceFax = 0x00000020 + }; + + IMPORT_C TInt GetAlternatingCallCaps(TUint32& aCaps) const; + IMPORT_C void NotifyAlternatingCallCapsChange(TRequestStatus& aReqStatus, TUint32& aCaps) const; + +/** Alternating Call Mode. + +Modes: Common */ + enum TMobilePhoneAlternatingCallMode + { + /** The alternating call mode is unspecified + + Modes: Common */ + EAlternatingModeUnspecified, + /** Next call will use a single bearer service - default setting + + Modes: Common */ + EAlternatingModeSingle, + /** Next call will use voice/data alternating bearer service. + + Modes: GSM */ + EAlternatingModeVoiceData, + /** Next call will use voice then data alternating bearer service. + + Modes: GSM */ + EAlternatingModeVoiceThenData, + /** Next call will use voice/fax alternating bearer service. + + Modes: GSM/WCDMA */ + EAlternatingModeVoiceFax + }; + + IMPORT_C TInt GetAlternatingCallMode(TMobilePhoneAlternatingCallMode& aMode, TMobileService& aFirstService) const; + IMPORT_C void SetAlternatingCallMode(TRequestStatus& aReqStatus, TMobilePhoneAlternatingCallMode aMode, TMobileService aFirstService) const; + IMPORT_C void NotifyAlternatingCallModeChange(TRequestStatus& aReqStatus, TMobilePhoneAlternatingCallMode& aMode,TMobileService& aFirstService) const; + + /***********************************************************************************/ + // + // Mobile Alternate Line Service Functional Unit + // + /***********************************************************************************/ + +/** Alternate Line Primary settings. + +Modes: GSM */ + enum TMobilePhoneALSLine + { + /** Current ALS line selection is the "Primary" voice line. */ + EAlternateLinePrimary, + /** Current ALS line selection is the "Auxiliary" voice line. */ + EAlternateLineAuxiliary, + /** ALS is supported by ME and SIM, but the TSY can not determine which line is + currently selected. */ + EAlternateLineUnknown, + /** The ME, SIM or serving network does not support ALS. */ + EAlternateLineNotAvailable + }; + + IMPORT_C TInt GetALSLine(TMobilePhoneALSLine& aALSLine) const; + IMPORT_C void SetALSLine(TRequestStatus& aReqStatus, TMobilePhoneALSLine aALSLine) const; + IMPORT_C void NotifyALSLineChange(TRequestStatus& aReqStatus, TMobilePhoneALSLine& aALSLine) const; + + /***********************************************************************************/ + // + // Mobile Network Security Functional Unit + // + /***********************************************************************************/ + +/** Enumerated network security types. + +Mode: Common */ + enum TMobilePhoneNetworkSecurity + { + /** The encryption level is NONE. + + Mode: Common */ + ECipheringOff, + /** The encryption level is GSM.(standard encryption algorithms for 2nd Generation + Mobile networks). + + Mode: GSM */ + ECipheringGSM, + /** The encryption level is WCDMA.(standard encryption algorithms for 3rd Generation + Mobile networks). + + Mode: WCDMA */ + ECipheringWCDMA, + /** The encryption level is CDMA.(standard encryption algorithms for 3rd Generation + Mobile networks). + + Mode: CDMA */ + ECipheringCDMA + }; + + IMPORT_C void GetNetworkSecurityLevel(TRequestStatus& aReqStatus, TMobilePhoneNetworkSecurity& aSecurity) const; + IMPORT_C void NotifyNetworkSecurityLevelChange(TRequestStatus& aReqStatus, TMobilePhoneNetworkSecurity& aSecurity) const; + + /** + Indicators for whether encryption status of the current call should be displayed. + */ + enum TMobileCallCipheringIndicator + { + /** + The ME indication displaying the encryption status of the current call should be off. + */ + ECipheringDisplayOff, + /** + The ME indication displaying the encryption status of the current call should be on. + */ + ECipheringDisplayOn + }; + + IMPORT_C void GetCipheringIndicatorStatus(TRequestStatus& aReqStatus, TMobileCallCipheringIndicator& aIndicatorStatus) const; + IMPORT_C void NotifyCipheringIndicatorStatus(TRequestStatus& aReqStatus, TMobileCallCipheringIndicator& aIndicatorStatus) const; + + /***********************************************************************************/ + // + // Mobile Cost Functional Unit + // + /***********************************************************************************/ + +/** Call Cost Capabilities. + +Modes: GSM/WCDMA */ + enum TMobilePhoneCostCaps + { + /** Indicates that the phone supports calculation and display of current and accumulated + call cost on an information-only basis. (The AoCI service in GSM) + + Modes: GSM/WCDMA */ + KCapsCostInformation = 0x00000001, + /** Indicates that the phone supports calculation and display of current and accumulated + call cost in order to support the charging service. (The AoCC service in GSM). + + + Modes: Common */ + KCapsCostCharging = 0x00000002, + /** Indicates that the phone supports clearing of cost meters (ACM or CCM) to zero. + + Modes: Common */ + KCapsClearCost = 0x00000004, + /** Indicates that the phone supports setting the maximum allowed cost (ACMmax) + to a non-zero value. + + Modes: Common */ + KCapsSetMaxCost = 0x00000008, + /** Indicates that the phone supports setting the currency and price per unit. + + Modes: GSM/WCDMA */ + KCapsSetPuct = 0x00000010, + /** Indicates that the phone currently has call cost information available that + the client can retrieve. + + Modes: Common */ + KCapsGetCost = 0x00000020, + /** Indicates that the phone can notify the client when the call cost information + changes. + + Modes: Common */ + KCapsNotifyCostChange = 0x00000040 + }; + + IMPORT_C TInt GetCostCaps(TUint32& aCaps) const; + IMPORT_C void NotifyCostCapsChange(TRequestStatus& aReqStatus, TUint32& aCaps) const; + +/** Clear Cost Meter. + +Modes: Common */ + enum TMobilePhoneCostMeters + { + /** Clear the Current Call Meter. */ + EClearCCM, + /** Clear the Accumulated Charge Meter. */ + EClearACM, + /** Clear all cost meters */ + EClearAll + }; + + IMPORT_C void ClearCostMeter(TRequestStatus& aReqStatus, TMobilePhoneCostMeters aMeter) const; + IMPORT_C void SetMaxCostMeter(TRequestStatus& aReqStatus, TUint aUnits) const; + + + + class TMobilePhonePuctV1 : public TMultimodeType +/** Defines the contents of the price/unit and currency table (PUCT) on the SIM. + +@see TMobilePhoneCostInfoV1 +@see SetPuct() +*/ + { + public: + IMPORT_C TMobilePhonePuctV1(); + public: + /** The Price per Unit. This floating point value is used to adjust the pricing + units supplied by the network into real currency values. + + Modes: GSM/WCDMA */ + TReal iPricePerUnit; + /** The three character currency indicator. + + Modes: GSM/WCDMA */ + TBuf<4> iCurrencyName; + }; + +/** A typedef'd packaged TMobilePhonePuctV1 for passing through a generic API function +member. */ + typedef TPckg TMobilePhonePuctV1Pckg; + + IMPORT_C void SetPuct(TRequestStatus& aReqStatus, const TDesC8& aPuct) const; + +/** Cost Information + +Modes: GSM/WCDMA */ + enum TMobilePhoneCostService + { + /** Phone supports call cost service but no calls are currently in progress so the + network support and user subscription is unknown. */ + ECostServiceUnknown, + /** The network or the phone does not support any of the call cost services. The + call can be either in progress or not. If the user is subscribed to AoCI they + will be able to continue to make calls but will not see any charging information. + If the user is subscribed to AoCC then they will be prevented from making + chargeable calls. */ + ECostServiceNotAvailable, + /** Call is in progress and a call cost service is active but the phone is unable + to determine whether it is an AoCI or AoCC service. */ + ECostServiceAvailable, + /** Call is in progress and the call cost information (AoCI) service is currently + operating. + + Modes: GSM/WCDMA */ + ECostServiceInformation, + /** Call is in progress and the call cost charging (AoCC) service is currently operating. + + Modes: GSM/WCDMA */ + ECostServiceCharging + }; + + + + class TMobilePhoneCostInfoV1 : public TMultimodeType +/** Defines the information related to current billing costs. + +@see GetCostInfo() +@see NotifyCostInfoChange() +*/ + { + public: + IMPORT_C TMobilePhoneCostInfoV1(); + public: + /** The current status and type of call cost service. + + @see TMobilePhoneCostService */ + TMobilePhoneCostService iService; + /** The current number of charging units in the Current Call Meter. This is set + to zero if reset by the user or at the start of call set-up attempt. */ + TUint iCCM; + /** The current number of charging units in the Accumulated Call Meter. This equals + the accumulation of previous and current calls. */ + TUint iACM; + /** The maximum number of charging units that the ACM can rise to before chargeable + calls are stopped. Equals zero if Service != ECostServiceCharging. */ + TUint iACMmax; + /** The Price per Unit and Currency Table. + + @see TMobilePhonePuctV1 */ + TMobilePhonePuctV1 iPuct; + }; + +/** A typedef'd packaged TMobilePhoneCostInfoV1 for passing through a generic API +function member. */ + typedef TPckg TMobilePhoneCostInfoV1Pckg; + + IMPORT_C void GetCostInfo(TRequestStatus& aReqStatus, TDes8& aCostInfo) const; + IMPORT_C void NotifyCostInfoChange(TRequestStatus& aReqStatus, TDes8& aCostInfo) const; + + /***********************************************************************************/ + // + // Mobile Security Functional Unit + // + /***********************************************************************************/ + +/** Security Capabilities. + +Modes: Common */ + enum TMobilePhoneSecurityCaps + { + /** The phone supports an overall "phone device lock" which can be enabled or disabled. + If enabled, user must enter phone password before the phone can be used. When + this capability is set the phone will support get lock info, notify lock info + change and set lock setting for phone device lock. + + Modes: Common */ + KCapsLockPhone = 0x0000001, + /** The phone supports locking the ICC (using the PIN1 security code), which can + be enabled or disabled. If enabled, the user must enter PIN1 code before the + ICC can be used. When this capability is set the phone will support get lock + info, notify lock info change and set lock setting for ICC lock. + + Modes: Common */ + KCapsLockICC = 0x00000002, + /** The phone supports the "phone to ICC lock" which can be enabled or disabled. + If enabled, at power-up the phone will check whether current ICC is the one + the phone is locked to or not. If not, then the user must enter the phone + password before phone can be used with this ICC. When this capability is set + the phone will support get lock info, notify lock info change and set lock + setting for Phone-ICC lock. + + Modes: Common */ + KCapsLockPhoneToICC = 0x00000004, + /** The phone supports the "phone to first ICC lock" which can be enabled or disabled. + If enabled, at power-up the phone will check whether current ICC is the one + the phone is first locked to or not. If not, then user must enter the phone + password before the phone can be used with this ICC. When this capability + is set the phone will support get lock info, notify lock info change and set + lock setting for Phone-First ICC lock. + + Modes: Common */ + KCapsLockPhoneToFirstICC = 0x00000008, + /** The phone supports the "Over The Air" programming lock which can be enabled + or disabled. If enabled, the phone will prevent OTA programming by the network. + If disabled, the phone will allow OTA programming by the network. When this + capability is set the phone will support get lock info, notify lock info change + and set lock setting for OTA lock. + + Modes: CDMA */ + KCapsLockOTA = 0x00000010, + /** The phone supports access to the PIN 1 security code. When this capability is + set the phone will support verification of PIN1, unblocking PIN1, changing + PIN1 and notification of PIN1 required. + + Modes: Common */ + KCapsAccessPin1 = 0x00000020, + /** The phone supports access to the PIN 2 security code. When this capability is + set the phone will support verification of PIN2, unblocking PIN2, changing + PIN2 and notification of PIN2 required. + + Modes: GSM/WCDMA */ + KCapsAccessPin2 = 0x00000040, + /** The phone supports access to the phone password security code. When this capability + is set the phone will support verification of the phone password, changing + the phone password and notification if the phone password is required. + + Modes: Common */ + KCapsAccessPhonePassword = 0x00000080, + /** The phone supports access to the SPC (Service Programming Code) security code. + This code may need to be verified before OTA can commence. + + Modes: CDMA */ + KCapsAccessSPC = 0x00000100, + /** The phone supports access to the hidden key. When this capability is set the + phone will support verification of HiddenKey. + + Modes: WCDMA */ + KCapsAccessHiddenKey=0x00000200, + /** The phone supports access to the USIM Application PIN. An Application PIN allows + access to any file on the UICC where it is referenced in the access rules. + + Modes: WCDMA */ + KCapsAccessUSIMAppPin=0x00000400, + /** The phone supports access to the second USIM Application PIN. The second Application + PIN allows access to files (where it is referenced in the access rules) within + one USIM Application on the UICC. This is a local PIN. + + Modes: WCDMA */ + KCapsAccessUSIMAppSecondPin =0x00000800, + /** The phone supports access to the Universal PIN. A Universal PIN is a PIN that + is used in a multi-application UICC environment to allow several USIM applications + to share one common PIN. + + Modes: WCDMA */ + KCapsAccessUniversalPin =0x00001000 + }; + + IMPORT_C TInt GetSecurityCaps(TUint32& aCaps) const; + IMPORT_C void NotifySecurityCapsChange(TRequestStatus& aReqStatus, TUint32& aCaps) const; + +/** Lock Information. + +Modes: Common */ + enum TMobilePhoneLock + { + /** Lock the whole device. Phone lock password is required to unlock when this lock + is enabled. + + Modes: Common */ + ELockPhoneDevice, + /** Lock PIN1 on the ICC. PIN1 security code is required to unlock when this lock + is enabled. + + Modes: Common */ + ELockICC, + /** Lock the phone to the current ICC inserted in the phone Phone lock password + is required to unlock when this lock is enabled. + + Modes: Common */ + ELockPhoneToICC, + /** Lock the phone to the first ICC inserted in the phone. Phone lock password is + required to unlock when this lock is enabled. + + Modes: Common */ + ELockPhoneToFirstICC, + /** Lock the OTA facility on the phone. SPC security code may be required to unlock + when this lock is enabled. + + Modes: CDMA */ + ELockOTA, + /** Lock PIN2 on the ICC. PIN2 security code is required to unlock when this lock + is enabled. + + Modes: Common */ + ELockPin2, + /** Lock the phonebook hidden entries on the phone. Hidden key security code may + be required to unlock when this lock is enabled. + + Modes: WCDMA */ + ELockHiddenKey, + /** Lock the associated USIM Application. USIM Application PIN is required to unlock + when this lock is enabled. + + Modes: WCDMA */ + ELockUSimApp, + /** Lock the associated USIM Application. The second USIM Application PIN is required + to unlock when this lock is enabled. + + Modes: WCDMA */ + ELockSecondUSimApp, + /** Lock the associated USIM Application(s) that share this common lock. Universal + Pin is required to unlock when this lock is enabled. + + Modes: WCDMA */ + ELockUniversalPin, + /** Lock for the NAM. The SPC is required to unlock. + + Modes: CDMA */ + ELockNam + }; + +/** Phone lock status. + +Modes: Common */ + enum TMobilePhoneLockStatus + { + /** The status of the lock is unknown. */ + EStatusLockUnknown, + /** Lock is closed - user can not access functionality governed by this lock until + user correctly enters associated security code. */ + EStatusLocked, + /** Lock is open - user can access functionality governed by this lock */ + EStatusUnlocked, + EStatusBlocked + }; + +/** The phone lock setting. + +Modes: Common */ + enum TMobilePhoneLockSetting + { + /** The setting of the lock is unknown + + Modes: Common */ + ELockSetUnknown, + /** Lock is enabled - associated security code will be required to unlock the + lock, the next time the lock's status is EStatusLocked. + + Modes: Common */ + ELockSetEnabled, + /** Lock is disabled - so its status is always EStatusUnlocked. + + Modes: Common */ + ELockSetDisabled, + /** Lock of the current Application is replaced by the Universal PIN. Only the + Universal PIN is allowed as a replacement. + + Modes: WCDMA */ + ELockReplaced + }; + + + + class TMobilePhoneLockInfoV1 : public TMultimodeType +/** Defines the status of a phone lock. + +@see GetLockInfo() +@see NotifyLockInfoChange() +@publishedPartner +@released +*/ + { + public: + IMPORT_C TMobilePhoneLockInfoV1(); + public: + /** The current status of the lock. + + Modes: Common + + @see TMobilePhoneLockStatus */ + TMobilePhoneLockStatus iStatus; + /** The current setting of the lock. + + Modes: Common + + @see TMobilePhoneLockSetting */ + TMobilePhoneLockSetting iSetting; + }; + +/** A typedef'd packaged TMobilePhoneLockInfoV1 for passing through a generic API +function member. */ + typedef TPckg TMobilePhoneLockInfoV1Pckg; + + IMPORT_C void GetLockInfo(TRequestStatus& aReqStatus, TMobilePhoneLock aLock, TDes8& aLockInfo) const; + IMPORT_C void NotifyLockInfoChange(TRequestStatus& aReqStatus, TMobilePhoneLock& aLock, TDes8& aLockInfo) const; + IMPORT_C void SetLockSetting(TRequestStatus& aReqStatus, TMobilePhoneLock aLock, TMobilePhoneLockSetting aSetting) const; + +/** Change Security Code. + +Modes: Common */ + enum TMobilePhoneSecurityCode + { + /** PIN 1 code (between 4-8 digits). + + Modes: Common */ + ESecurityCodePin1, + /** PIN 2 code (between 4-8 digits) + + Modes: GSM/WCDMA */ + ESecurityCodePin2, + /** PIN 1 unblocking code (always 8 digits). + + Modes: Common */ + ESecurityCodePuk1, + /** PIN 2 unblocking code (always 8 digits) + + Modes: GSM/WCDMA */ + ESecurityCodePuk2, + /** Password used for Phone-SIM Lock and Phone Device Lock (up to 8 digits) + + Modes: Common */ + ESecurityCodePhonePassword, + /** Service Programming Code (SPC) + + Modes: CDMA */ + ESecurityCodeSPC, + /** Phonebook key to display the hidden entries. + + Modes: WCDMA */ + ESecurityHiddenKey, + /** USIM Application PIN. + + Modes: WCDMA */ + ESecurityUSIMAppPin, + /** Second USIM Application PIN. + + Modes: WCDMA */ + ESecuritySecondUSIMAppPin, + /** Universal PIN. + + Modes: WCDMA */ + ESecurityUniversalPin, + /** Universal PIN unblocking code (always 8 digits). + + Modes: Common */ + ESecurityUniversalPuk + }; + + IMPORT_C void ChangeSecurityCode(TRequestStatus& aReqStatus, TMobilePhoneSecurityCode aType, const TMobilePhonePasswordChangeV1& aChange) const; + + /** Defines the status of a security code. + + @see GetSecurityCodeInfo() + @see NotifySecurityCodeInfoChange() + @publishedPartner + @released + */ + class TMobilePhoneSecurityCodeInfoV5 : public TMultimodeType + { + public: + IMPORT_C TMobilePhoneSecurityCodeInfoV5(); + public: + /** Number of remaining security code entry attempts before the corresponding lock gets blocked + + Modes: Common + */ + TInt iRemainingEntryAttempts; + }; + + /** A typedef'd packaged TMobilePhoneSecurityCodeInfoV5 for passing through a generic API + function member. */ + typedef TPckg TMobilePhoneSecurityCodeInfoV5Pckg; + + IMPORT_C void GetSecurityCodeInfo(TRequestStatus& aReqStatus, TMobilePhoneSecurityCode aSecurityCode, TDes8& aSecurityCodeInfo) const; + IMPORT_C void NotifySecurityCodeInfoChange(TRequestStatus& aReqStatus, TMobilePhoneSecurityCode& aSecurityCode, TDes8& aSecurityCodeInfo) const; + +/** Notify Security Events. + +Modes: Common */ + enum TMobilePhoneSecurityEvent + { + /** The phone has detected that there is no ICC present. + + Modes: Common */ + ENoICCFound, + /** The phone has detected that the ICC is unusable. + + Modes: Common */ + EICCTerminated, + /** The phone requires PIN1 to be entered. + + Modes: Common */ + EPin1Required, + /** The phone requires PUK1 to be entered. + + Modes: Common */ + EPuk1Required, + /** The phone requires PIN2 to be entered. + + Modes: GSM/WCDMA */ + EPin2Required, + /** The phone requires PUK2 to be entered. + + Modes: GSM/WCDMA */ + EPuk2Required, + /** The phone requires the Phone Password to be entered. + + Modes: Common */ + EPhonePasswordRequired, + /** The phone requires the SPC to be entered. + + Modes: CDMA */ + ESPCRequired, + /** The PIN1 verification procedure has passed. + + Modes: Common */ + EPin1Verified, + /** The PIN2 verification procedure has passed. + + Modes: GSM/WCDMA */ + EPin2Verified, + /** The PUK1 unblocking procedure has passed. + + Modes: Common */ + EPuk1Verified, + /** The PUK2 unblocking procedure has passed. + + Modes: GSM/WCDMA */ + EPuk2Verified, + /** The Phone Password has been verified. + + Modes: Common */ + EPhonePasswordVerified, + /** The SPC verification procedure has passed. + + Modes: CDMA */ + ESPCVerified, + /** The phone requires the phonebook hidden key to be entered. + + Modes: WCDMA */ + EHiddenKeyRequired, + /** The phonebook hidden key procedure has passed. + + Modes: WCDMA */ + EHiddenKeyVerified, + /** The phone requires the currently active USIM Application PIN to be entered. + + Modes: WCDMA */ + EUSIMAppPinRequired, + /** The currently active USIM Application PIN procedure has passed. + + Modes: WCDMA */ + EUSIMAppPinVerified, + /** The phone requires the currently active USIM Application second PIN to be entered. + + Modes: WCDMA */ + ESecondUSIMAppPinRequired, + /** The currently active USIM Application second PIN procedure has passed. + + Modes: WCDMA */ + ESecondUSIMAppPinVerified, + /** The phone requires the Universal PIN to be entered. + + Modes: WCDMA */ + EUniversalPinRequired, + /** The currently active Universal PIN procedure has passed. + + Modes: WCDMA */ + EUniversalPinVerified, + /** The Service Programming Code has been changed. + + Modes: CDMA */ + ESPCChanged, + /** The phone requires Universal PUK to be entered. + + Modes: WCDMA */ + EUniversalPukRequired, + /** The Universal PUK unblocking procedure has passed. + + Modes: WCDMA */ + EUniversalPukVerified + }; + + IMPORT_C void NotifySecurityEvent(TRequestStatus& aReqStatus, TMobilePhoneSecurityEvent& aEvent) const; + + // for use by client-side API code and TSY only + + struct TCodeAndUnblockCode + { + TMobilePassword iCode; + TMobilePassword iUnblockCode; + }; + + IMPORT_C void VerifySecurityCode(TRequestStatus& aReqStatus, TMobilePhoneSecurityCode aType, + const TMobilePassword& aCode, const TMobilePassword& aUnblockCode) const; + IMPORT_C TInt AbortSecurityCode(TMobilePhoneSecurityCode aType) const; + + /***********************************************************************************/ + // + // MobileMessageWaiting + // + /***********************************************************************************/ + +/** Display indicators. */ + enum TMobilePhoneIndicatorDisplay + { + /** Display voicemail active. */ + KDisplayVoicemailActive = 0x01, + /** Display fax active. */ + KDisplayFaxActive = 0x02, + /** Display E-mail active. */ + KDisplayEmailActive = 0x04, + /** Display other active. */ + KDisplayOtherActive = 0x08, + /** Display Aux voicemail active. */ + KDisplayAuxVoicemailActive = 0x10, + /** Display data active. */ + KDisplayDataActive = 0x20 + }; + + class TMobilePhoneMessageWaitingV1 : public TMultimodeType +/** Message Waiting Indicators. See 3GPP TS 31 102. + +@see GetIccMessageWaitingIndicators() +@see SetIccMessageWaitingIndicators() +@see NotifyIccMessageWaitingIndicatorsChange() +*/ + { + public: + IMPORT_C TMobilePhoneMessageWaitingV1(); + public: + /** The flags for each indicator from TMobilePhoneIndicatorDisplay to specify whether + the indicator should be displayed or not. E.g. Messages of the specified type are waiting. + + Modes: Common */ + TUint8 iDisplayStatus; + /** The number of voicemail messages waiting for the "main" voice line. + + Modes: Common */ + TUint8 iVoiceMsgs; + /** The number of voicemail messages waiting for the "auxiliary" voice line. + + Modes: GSM */ + TUint8 iAuxVoiceMsgs; + /** The number of messages waiting for the data line. + + Modes: Common */ + TUint8 iDataMsgs; + /** The number of messages waiting for the fax line. + + Modes: Common */ + TUint8 iFaxMsgs; + /** The number of email messages waiting. + + Modes: WCDMA */ + TUint8 iEmailMsgs; + /** Contains the number of "unspecified" messages waiting. + + Modes: WCDMA */ + TUint8 iOtherMsgs; + }; + +/** A typedef'd packaged TMobilePhoneMessageWaitingV1 for passing through a generic +API function member. */ + typedef TPckg TMobilePhoneMessageWaitingV1Pckg; + + IMPORT_C void GetIccMessageWaitingIndicators(TRequestStatus& aReqStatus, TDes8& aMsgIndicators) const; + IMPORT_C void SetIccMessageWaitingIndicators(TRequestStatus& aReqStatus, const TDesC8& aMsgIndicators) const; + IMPORT_C void NotifyIccMessageWaitingIndicatorsChange(TRequestStatus& aReqStatus, TDes8& aMsgIndicators) const; + + IMPORT_C void NotifyMessageWaiting(TRequestStatus& aReqStatus, TInt& aCount) const; + + /***********************************************************************************/ + // + // Mobile Fixed Dialling Numbers Functional Unit + // + /***********************************************************************************/ + +/** Fixed Dialling Numbers Status. + +Modes: Common */ + enum TMobilePhoneFdnStatus + { + /** Fixed Dialling Number mode is supported but is not currently active. */ + EFdnNotActive, + /** Fixed Dialling Number mode is supported and is currently active. Deactivating + FDN mode is supported. */ + EFdnActive, + /** Fixed Dialling Number mode is supported and is permanently active. Deactivating + FDN mode is NOT supported with this SIM. */ + EFdnPermanentlyActive, + /** Fixed Dialling Number mode is not supported by ME and/or SIM. */ + EFdnNotSupported, + /** ME is currently unable to determine the status of FDN mode. */ + EFdnUnknown + }; + + IMPORT_C TInt GetFdnStatus(TMobilePhoneFdnStatus& aFdnStatus) const; + IMPORT_C void GetFdnStatus(TRequestStatus& aReqStatus, TMobilePhoneFdnStatus& aFdnStatus) const; + +/** Fixed Dialling Numbers Setting + +Modes: Common */ + enum TMobilePhoneFdnSetting + { + /** Activate the FDN service. */ + EFdnSetOn, + /** Deactivate the FDN service. */ + EFdnSetOff + }; + + IMPORT_C void SetFdnSetting(TRequestStatus& aReqStatus, TMobilePhoneFdnSetting aFdnSetting) const; + IMPORT_C void NotifyFdnStatusChange(TRequestStatus& aReqStatus, TMobilePhoneFdnStatus& aFdnStatus) const; + + /***********************************************************************************/ + // + // Multicall bearer settings + // + /***********************************************************************************/ + + class TMobilePhoneMulticallSettingsV1 : public TMultimodeType +/** Multi call settings for version v1.0. + +@see GetMulticallParams() +@see NotifyMulticallParamsChange() +@publishedPartner +@released*/ + { + public: + IMPORT_C TMobilePhoneMulticallSettingsV1(); + public: + /** Maximum number of simultaneous CS bearers allowed - defined by the user. + + Modes: WCDMA */ + TInt iUserMaxBearers; + /** Maximum number of simultaneous bearers allowed - defined by the service provider. + + Modes: WCDMA */ + TInt iServiceProviderMaxBearers; + /** Maximum number of simultaneous CS bearers supported by the network. + + Modes: WCDMA */ + TInt iNetworkSupportedMaxBearers; + /** Maximum number of simultaneous CS bearers supported by the UE. + + Modes: WCDMA */ + TInt iUESupportedMaxBearers; + }; + +/** A typedef'd packaged TMobilePhoneMulticallSettingsV1 for passing through a generic +API function member. */ + typedef TPckg TMobilePhoneMulticallSettingsV1Pckg; + + IMPORT_C void GetMulticallParams(TRequestStatus& aReqStatus, TDes8& aMulticallParams) const; + IMPORT_C void SetMulticallParams(TRequestStatus& aReqStatus, TInt aUserMaxBearers) const; + IMPORT_C void NotifyMulticallParamsChange(TRequestStatus& aReqStatus, TDes8& aMulticallParams) const; + + enum TMobilePhoneMulticallIndicator + /** + Indicators for exceeding allowed multiple active bearers. + */ + { + /** The maximum number of multiple active bearers allowed by the service provider has been exceeded. */ + EBearerNetworProviderExceeded, + /** The maximum number of multiple active bearers allowed by the mobile user has been exceeded. */ + EBearerUserExceeded + }; + + IMPORT_C void NotifyMulticallIndicatorChange(TRequestStatus& aReqStatus, TMobilePhoneMulticallIndicator& aMulticallIndicator) const; + + /***********************************************************************************/ + // + // MobileNextIncomingCall Functional Unit + // + /***********************************************************************************/ + +/** Incoming Call Types. + +Modes: Common */ + enum TMobilePhoneIncomingCallType + { + /** MS will receive any type of incoming call. + + Modes: Common */ + EIncomingTypeNotSpecified, + /** MS will request voice bearer for incoming calls. + + Modes: Common */ + EIncomingVoice, + /** MS will request fax bearer for incoming calls + + Modes: Common */ + EIncomingFax, + /** MS will request data bearer for incoming calls + + Modes: Common */ + EIncomingData, + /** MS will request a data bearer for use by a Multimedia CS call (voice fall back + is acceptable) for incoming calls. + + Modes: GSM/WCDMA */ + EIncomingMultimediaVoiceFallback, + /** MS will request a data bearer for use by a Multimedia CS call (voice fall back + NOT acceptable) for incoming calls + + Modes: GSM/WCDMA */ + EIncomingMultimediaNoFallback, + /** The single numbering scheme call mode is alternating voice to fax. + + Modes: GSM/WCDMA */ + EIncomingAlternatingVoiceFax, + /** The single numbering scheme call mode is alternating voice to data. + + Modes: GSM */ + EIncomingAlternatingVoiceData, + /** The single numbering scheme call mode is alternating fax to voice. + + Modes: GSM */ + EIncomingAlternatingFaxVoice, + /** The single numbering scheme call mode is alternating data to voice. + + Modes: GSM */ + EIncomingAlternatingDataVoice, + /** The single numbering scheme call mode is alternating voice then data. + + Modes: GSM */ + EIncomingAlternatingVoiceThenData + }; + + IMPORT_C void GetIncomingCallType(TRequestStatus& aReqStatus, TMobilePhoneIncomingCallType& aCallType, TDes8& aDataParams) const; + IMPORT_C void SetIncomingCallType(TRequestStatus& aReqStatus, TMobilePhoneIncomingCallType aCallType, TDes8& aDataParams) const; + IMPORT_C void NotifyIncomingCallTypeChange(TRequestStatus& aReqStatus, TMobilePhoneIncomingCallType& aCallType, TDes8& aDataParams) const; + + /***********************************************************************************/ + // + // User-To-User Signalling Functional Unit + // + /***********************************************************************************/ + +/** UUS Settings Requests. + +Modes: GSM/WCDMA */ + enum TMobilePhoneUUSSetting // UUS settings of the phone + { + /** UUS is not specified. */ + EIncomingUUSNotSpecified, + /** MS will accept incoming UUS activation request. */ + EIncomingUUSAccepted, + /** MS will reject incoming UUS activation request. */ + EIncomingUUSRejected + }; + + IMPORT_C void GetUUSSetting(TRequestStatus& aReqStatus, TMobilePhoneUUSSetting& aSetting) const; + IMPORT_C void SetUUSSetting(TRequestStatus& aReqStatus, TMobilePhoneUUSSetting aSetting) const; + IMPORT_C void NotifyUUSSettingChange(TRequestStatus& aReqStatus, TMobilePhoneUUSSetting& aSetting) const; + + /***********************************************************************************/ + // + // Mobile Smart Card Applications Functional Unit + // + /***********************************************************************************/ + + + enum { KSmartCardApplicationLabelMaxSize=32 }; + + /** Smart card application info version v5.0. + Modes: Common + + @see GetSmartCardApplicationInfo() + @publishedPartner + @released + */ + class TSmartCardApplicationInfoV5 : public TMultimodeType + { + public: + IMPORT_C TSmartCardApplicationInfoV5(); + public: + /** + Smart card application identifier. + */ + TAID iAID; + /** + Smart card application label. 16 bit USC2 characters string provided by the application + provider to be shown to the user for information, e.g. operator name. It is + recommended by ETSI/3GPP spec that the application label does not exceed 32 + bytes. + + The application label is optional. If no label is provided, the buffer should + be NULL. + */ + TBuf8 iLabel; + }; + + /** + A typedef'd packaged TSmartCardApplicationInfoV5 for passing through a generic API + function member. + */ + typedef TPckg TSmartCardApplicationInfoV5Pckg; + + /** + Specifies the max length of the buffer used to retrieve the smart + card application's supported EAP method list. Value 255 since EAP + type list length fits into one byte (see table 5.1 of ETSI TS + 102.310 v6.2.0). + + @see RMobilePhone::GetSmartCardApplicationInfo() + @see RMobilePhone::TUiccApplicationEapInfoV6::iEapTypeList + */ + enum { KEapSupportedTypeListSize = 255 }; + + /** + UICC application info version v6.0. Is a + TSmartCardApplicationInfoV5 object, but has an additional buffer + (iEapTypeList) for retrieving a list supported EAP methods on the + application. + + Modes: GSM/WCDMA + + @see RMobilePhone::GetSmartCardApplicationInfo() + @publishedPartner + @released + */ + class TUiccApplicationEapInfoV6 : public TSmartCardApplicationInfoV5 + { + public: + IMPORT_C TUiccApplicationEapInfoV6(); + + public: + /** + Application EAP support type list, defining the EAP methods + supported by the UICC application (see RFC 3748 and + http://www.iana.org/assignments/eap-numbers). + + As reference, also worth seeing section 5.2 of ETSI TS 102.310 + v6.2.0 and section 6.2 of RFC3748. + + @see KETelSmartCardEapTypeMD5 + @see KETelSmartCardEapTypeTLS + @see KETelSmartCardEapTypeSIM + @see KETelSmartCardEapTypeAKA + @see KETelSmartCardEapTypeTTLS + */ + TBuf8 iEapTypeList; + }; + + /** + A typedef'd packaged TEapUiccApplicationInfoV6 for passing through + a generic API function member. + + @see RMobilePhone::GetSmartCardApplicationInfo() + */ + typedef TPckg TUiccApplicationEapInfoV6Pckg; + + /** + Smart card application notification events + + Modes: Common + */ + enum TSmartCardApplicationEvent + { + /** + Smart card application has been installed. + */ + EScApplicationInstalled, + /** + Smart card application has been removed. + */ + EScApplicationRemoved, + /** + Smart card application has been activated. + */ + EScApplicationActivated, + /** + Smart card application has been terminated. + */ + EScApplicationTerminated + }; + + /** + Smart card application status. + + Modes: Common + */ + enum TSmartCardApplicationAction + { + /** + Smart card application will be activated. + */ + EScApplicationActivate, + /** + Smart card application will be terminated. + */ + EScTerminate + }; + + /** + Smart card application file types. For definitions see TS 102.221. + + Modes: Common + */ + enum TScFileType + { + /** + Smart card file type is unknown. + */ + EUnknown, + /** + Smart card file type is linear fixed. + + This is a record-based file. + */ + ELinearFixed, + /** + Smart card file type is cyclic. + + This is a record-based file. + */ + ECyclic, + /** + Smart card file type is transparent. + + This is a binary file. + */ + ETransparent + }; + + /** + Typedef to hold a 2-byte file identifier. + */ + typedef TUint16 TScFileID; + + /** Smart card application file info version v5.0. + Modes: Common + + @see GetScFileInfo() + @publishedPartner + @released + */ + class TScFileInfoV5 : public TMultimodeType + { + public: + IMPORT_C TScFileInfoV5(); + public: + /** + Smart card file identifier. + */ + TScFileID iFileID; + /** + The type of the smart card file. Options are + Linear Fixed, Cyclic or Transparent. + */ + TScFileType iType; + /** + Total length of the file. As specified in TS 102.221 the maximum length of an EF is 0xFFF bytes. + */ + TInt iTotalLength; + /** + If the file is a record based file (e.g. file type is ELinearFixed or ECyclic) then this gives the fixed length of a record in the file. + If file type is ETransparent then this value is unused and will be set to 0. + + From TS 102.221 the maximum length of a record in an EF is 255 bytes. + */ + TInt iRecordLength; + /** + If the file is a record based file (e.g. file type is ELinearFixed or ECyclic) then this gives the number of records in the file. + If file type is ETransparent then this value is unused and will be set to 0. + + From TS 102.221 the maximum number of records in an EF is 254. + */ + TInt iNumberRecords; + }; + + + /** A typedef'd packaged TScFileInfoV5 for passing through a generic API + function member. + */ + typedef TPckg TScFileInfoV5Pckg; + + /** + This based on the maximum number of bytes in a command PDU + as defined in TS 102.221 however the actual path string is very unlikely to ever be this big. + + Modes: Common + */ + enum{ KMaxScFilePathLength = 256}; + + /** + A typedef'd buffer to hold the path to an EF file. + */ + typedef TBuf8 TScFilePathReference; + + + /** + Class that holds a smart card applications AID and associated file path string. + + Modes: Common + + @see GetScFileInfo() + @publishedPartner + @released + */ + class TScFilePath + { + public: + IMPORT_C TScFilePath(); + public: + /** + AID of application. This may be empty implying the iPath is a path reference starting at the master file (MF). + */ + TAID iAID; + /** + Full path reference to file. + + The iPath must define the file path using full path referencing. This is because the client does not know + what is the currently selected EF or DF and it is therefore necessary to select the file by full + path referencing from the master file. + + If iAID value is empty then the iPath reference starts from the MF file but should not include the file ID of the MF (3F00) itself. + E.g. To reference the EF_DIR - iAID would be empty and iPath would be set to "2F00". + E.g. To refefence the EF_SMS under DF_TELECOM on a 2G SIM ICC - iAID would be empty and iPath would be set to "7F106F3C". + + If iAID is non-empty then it refers to the AID of the application and iPath is a path reference to a file in that application, + In this situation the path reference may start with the implicit FID of the application DF (7FFF). + E.g. The path to reference to the EF_SMS file in a USIM application using implicit ADF FID would + be "7FFF6F3C". + + See TS102.221 section 8.4.2 for more information. + */ + TScFilePathReference iPath; + }; + + /** Smart card application file identifier and access offsets. This class is used to identify a file and the + location in a file to either read or write. Inherits attributes from TScFilePath which provide the + parent AID and full path reference. + + Modes: Common + + @see TScFilePath + @see ReadScFile() + @see UpdateScFile() + @publishedPartner + @released + */ + class TScFilePathWithAccessOffsets : public TScFilePath + { + public: + IMPORT_C TScFilePathWithAccessOffsets(); + public: + /** + The type of the smart card file. Options are + Linear Fixed, Cyclic or Transparent. + */ + TScFileType iType; + /** + If file type is ELinearFixed or ECyclic then this is the starting record index to read or update. + This must be less than the number of records in the file. + + If file type is ETransparent then this is the offset (in bytes) from the start of the transparent file to read or update. + This must be less than the total file size. + */ + TUint iStartOffset; + /** + If the file type is ELinearFixed or ECyclic then this is unused. + NOTE: A call to ReadScFile or UpdateScFile for a record based file type will only read or update + one record as described in TS 102.221 READ RECORD and UPDATE RECORD. + + If file type is ETransparent then this is the number of bytes to read or update. + */ + TUint iCount; + }; + + IMPORT_C void EnumerateSmartCardApplications(TRequestStatus& aReqStatus, TUint& aCount) const; + IMPORT_C void GetSmartCardApplicationInfo(TRequestStatus& aReqStatus, TUint aAppIndex, TDes8& aInfo) const; + IMPORT_C void NotifySmartCardApplicationInfoChange(TRequestStatus& aReqStatus, TAID& aAID, TSmartCardApplicationEvent& aEvent) const; + IMPORT_C void SetSmartCardApplicationStatus(TRequestStatus& aReqStatus, const TAID& aAID, TSmartCardApplicationAction aAppAction) const; + IMPORT_C void GetScFileInfo(TRequestStatus& aReqStatus, const TScFilePath& aFilePathId, TDes8& aInfo) const; + IMPORT_C void ReadScFile(TRequestStatus& aReqStatus, const TScFilePathWithAccessOffsets& aFilePathOffsets, TDes8& aReadBuffer) const; + IMPORT_C void UpdateScFile(TRequestStatus& aReqStatus, const TScFilePathWithAccessOffsets& aFilePathOffsets, TDes8& aUpdateBuffer) const; + + /***********************************************************************************/ + // + // Mobile USIM Applications Functional Unit + // + /***********************************************************************************/ + + enum { KUSimApplicationLabelMaxSize=32 }; + + IMPORT_C void EnumerateUSimApplications(TRequestStatus& aReqStatus, TInt& aCount, TAID& aActiveAID) const; //deprecated 9.1 + + class TUSimApplicationInfoV2 : public TMultimodeType + /** USIM application information for version v2.0. + + @deprecated 9.1 Use @see TSmartCardApplicationInfoV5 instead. + */ + { + public: + IMPORT_C TUSimApplicationInfoV2(); + public: + /** USIM Application identifier. + + Modes: WCDMA */ + TAID iAID; + /** USIM Application label. 16 bit USC2 characters string provided by the application + provider to be shown to the user for information, e.g. operator name. It is + recommended by ETSI/3GPP spec that the application label does not exceed 32 + bytes. + + The application label is optional. If no label is provided, the buffer should + be NULL. + + Modes: WCDMA */ + TBuf8 iLabel; + }; + + /** A typedef'd packaged TUSimApplicationInfoV2 for passing through a generic API + function member. + + @deprecated 9.1 Use @see TSmartCardApplicationInfoV5 instead. + */ + typedef TPckg TUSimApplicationInfoV2Pckg; + + IMPORT_C void GetUSimApplicationInfo(TRequestStatus& aReqStatus, TInt aUSimAppIndex, TDes8& aInfo) const; //deprecated 9.1 + IMPORT_C void NotifyUSimApplicationsInfoChange(TRequestStatus& aReqStatus, TInt& aCount, TAID& aActiveAID) const; //deprecated 9.1 + + /** USIM Application Status. + + Modes: WCDMA + + @deprecated 9.1 Use @see TSmartCardApplicationAction instead. + */ + enum TUSimAppAction + { + /** USIM application will be activated. + + Modes: WCDMA */ + EUSimActivate, + /** USIM application will be terminated. + + Modes: WCDMA */ + EUSimTerminate + }; + + IMPORT_C void SetUSimApplicationStatus(TRequestStatus& aReqStatus, const TAID aAID, TUSimAppAction aUsimAppAction) const; //deprecated 9.1 + + /** USIM Application selection mode. + + Mode: WCDMA */ + enum TUSimSelectionMode + { + /** USIM application is selected automatically by phone. + + Mode: WCDMA */ + EUSimSelectionAutomatic, + /** USIM application is selected manually by user. + + Mode: WCDMA */ + EUSimSelectionManual + }; + + IMPORT_C TInt SetUSimAppsSelectionMode(TUSimSelectionMode aUSimSelectionMode) const; + IMPORT_C TInt GetUSimAppsSelectionMode(TUSimSelectionMode& aUSimSelectionMode) const; + IMPORT_C void NotifyUSimAppsSelectionModeChange(TRequestStatus& aReqStatus, TUSimSelectionMode& aUSimSelectionMode) const; + IMPORT_C void GetCurrentActiveUSimApplication(TRequestStatus& aReqStatus, TAID& aAID) const; + + /***********************************************************************************/ + // + // Mobile MMS Functional Unit + // + /***********************************************************************************/ + + /** max size of MMS notification buffer. */ + enum{KMaxMmsNotification = 253}; + + /** + Identifies current status of MMS. + */ + enum TMmsStatus + { + /** + The MMS has not been retrieved. + */ + EMmsNotRetrieved, + /** + The MMS has been retrieved. + */ + EMmsRetrieved, + /** + The MMS has been rejected. + */ + EMmsRejected, + /** + The MMS has been forwarded. + */ + EMmsforwarded + }; + + /** + MMS Implementation. + */ + enum TMmsImplementation + { + /** + Unknown implementation for MMS. + */ + KMmsImplUnknwown=0x00, + /** + Wap implementation for MMS. + */ + KWapImplementation=0x01 + }; + + /** + MMS Connectivity settings. + */ + enum TMmsConnParams + { + /** + MMS User Preferences. + */ + EUserPreferences, + /** + MMS Issuer Connectivity Parameters. + */ + EIssuerConnParams, + /** + MMS User Connectivity Parameters. + */ + EUserConnParams + }; + + /** + MMS field Id tags. + */ + enum TMobileMMSFieldTags + { + /** + Tag id for MMS connectivity parameters. + */ + ETagMmsConnParams=0xAB, + /** + Tag id for MMS Implementation. + */ + ETagMmsImpl=0x80, + /** + Tag id for MMS Relay/Server. + */ + ETagMmsServer=0x81, + /** + Tag id for Interface to Core Network and Bearer. + */ + ETagMmsBearerIE=0x82, + /** + Tag id for Gateway. + */ + ETagMmsGateway=0x83 + }; + + class TMmsNotificationV3 : public TMultimodeType + /** + Class containing MMS notification paramters. + */ + { + public : + IMPORT_C TMmsNotificationV3(); + public : + /** + Free/Used space. + */ + TBool iSpace; + /** + Notification read/not read. + */ + TBool iNotification; + /** + MMS status. + */ + TMmsStatus iMmsStatus; + /** + MMS implementation. + */ + TMmsImplementation iImplementation; + /** + MMS notification buffer. + */ + TBuf8 iNotify; + }; + + typedef TPckg TMmsNotificationV3Pckg; + + // MMS notification + IMPORT_C void NotifyMmsUpdate(TRequestStatus& aReqStatus, TDes8& aNotification) const; + IMPORT_C void SetMmsUserConnParams(TRequestStatus& aReqStatus, TDes8& aConnectivity) const; + IMPORT_C void SetMmsUserPreferences(TRequestStatus& aReqStatus, TDes8& aPreferences) const; + IMPORT_C void GetMmsConfig(TRequestStatus& aReqStatus, const TMmsConnParams aType, TDes8& aConnectivity) const; + IMPORT_C void NotifyMmsConfig(TRequestStatus& aReqStatus, const TMmsConnParams aType, TDes8& aConnectivity) const; + + /***********************************************************************************/ + // + // Mobile MailBox Numbers Functional Unit + // + /***********************************************************************************/ + + class TMobilePhoneVoicemailIdsV3 : public TMultimodeType + /** + Contains mailbox numbers. + */ + { + public : + IMPORT_C TMobilePhoneVoicemailIdsV3(); + public : + /** + Phonebook entry for "voicemail" mailbox number. + */ + TUint8 iVoice; + /** + Phonebook entry for "data" mailbox number. + */ + TUint8 iData; + /** + Phonebook entry for "fax" mailbox number. + */ + TUint8 iFax; + /** + Phonebook entry for "other" mailbox number. + */ + TUint8 iOther; + }; + + typedef TPckg TMobilePhoneVoicemailIdsV3Pckg; + + IMPORT_C void GetMailboxNumbers(TRequestStatus& aReqStatus, TDes8& aMailBox) const; + IMPORT_C void NotifyMailboxNumbersChange(TRequestStatus& aReqStatus, TDes8& aMailBox) const; + + /***********************************************************************************/ + // + // Mobile APN Control List Functional Unit + // + /***********************************************************************************/ + + enum { KMaxApnName = 100 }; + + class TAPNEntryV3 : public TMultimodeType + /** + Contains parameters for an Access Point Name (APN) entry contained + within the Access Control List EFacl file in the UICC. + */ + { + public: + IMPORT_C TAPNEntryV3(); + public: + /** + GGSN DNS name. + */ + TBuf8 iApn; + }; + + typedef TPckg TAPNEntryV3Pckg; + + IMPORT_C void EnumerateAPNEntries(TRequestStatus& aReqStatus, TUint32 &aIndex) const; + IMPORT_C void GetAPNname(TRequestStatus& aReqStatus, const TUint32 aIndex, TDes8& aAPN) const; + IMPORT_C void AppendAPNName(TRequestStatus& aReqStatus, const TDes8& aAPN) const; + IMPORT_C void DeleteAPNName(TRequestStatus& aReqStatus, TUint32 aIndex) const; + IMPORT_C void NotifyAPNListChanged(TRequestStatus& aReqStatus) const; + + enum TAPNControlListServiceStatus { + /** + The APN control list service is disabled. + */ + EAPNControlListServiceDisabled, + /** + The APN control list service is enabled. + */ + EAPNControlListServiceEnabled + }; + + IMPORT_C void SetAPNControlListServiceStatus(TRequestStatus& aReqStatus, TAPNControlListServiceStatus aAPNControlListServiceStatus) const; + IMPORT_C void GetAPNControlListServiceStatus(TRequestStatus& aReqStatus, TAPNControlListServiceStatus& aAPNControlListServiceStatus) const; + IMPORT_C void NotifyAPNControlListServiceStatusChange(TRequestStatus& aReqStatus, TAPNControlListServiceStatus& aAPNControlListServiceStatus) const; + + /***********************************************************************************/ + // + // Retrieve Total Air Time Duration Functional Unit + // + /***********************************************************************************/ + IMPORT_C TInt GetAirTimeDuration(TTimeIntervalSeconds& aTime) const; + IMPORT_C void NotifyAirTimeDurationChange(TRequestStatus& aReqStatus,TTimeIntervalSeconds& aTime) const; + /***********************************************************************************/ + // + // Terminate All Calls + // + /***********************************************************************************/ + IMPORT_C void TerminateAllCalls(TRequestStatus& aReqStatus) const; + + /***********************************************************************************/ + // + // Auto Redial Functional Unit + // + /***********************************************************************************/ + IMPORT_C void ClearBlacklist(TRequestStatus& aReqStatus) const; + + /***********************************************************************************/ + // + // Mobile Personalisation Functional Unit + // + /***********************************************************************************/ + + /** + Indentifies the personalisation scheme capabilities of the UICC/ME. + */ + enum TMobilePhonePersonalisationCaps + { + /** + UICC/ME personalisation based on network (MCC, MNC) information is possible. + */ + KCapsPersonalisedNetwork=0x01, + /** + UICC/ME personalisation based on network (MCC, MNC, IMSI network code group) information is possible. + */ + KCapsPersonalisedNetworkSub=0x02, + /** + UICC/ME personalisation based on network (MCC, MNC, EFGID1, EFCNL) information is possible. + */ + KCapsPersonalisedServiceProvider=0x04, + /** + UICC/ME personalisation based on network (MCC, MNC, EFGID1, EFGID2, EFCNL) information is possible. + */ + KCapsPersonalisedCorporate=0x08, + /** + UICC/ME personalisation based on (IMSI SIM/USIM code group) information is possible. + */ + KCapsPersonalisedUSim=0x10 + }; + + /** + Identifies the current personalisation schemes that are active. + */ + enum TMobilePhonePersonalisationScheme + { + /** + The ME is personalised under the network scheme. + */ + KPersonalisedNetwork=0x01, + /** + The ME is personalised under the network sub scheme. + */ + KPersonalisedNetworkSub=0x02, + /** + The ME is personalised under the service provider scheme. + */ + KPersonalisedServiceProvider=0x04, + /** + The ME is personalised under the corprorate scheme. + */ + KPersonalisedCorporate=0x08, + /** + The ME is personalised under the SIM/USIM scheme. + */ + KPersonalisedUSim=0x10 + }; + + /** + Identifies the personalisation scheme to be set. + */ + enum TMobilePhonePersonalisation + { + /** + Personalise the ME using the network scheme. + */ + EPersonaliseNetwork, + /** + Personalise the ME using the network sub scheme. + */ + EPersonaliseNetworkSub, + /** + Personalise the ME using the service provider scheme. + */ + EPersonaliseServiceProvider, + /** + Personalise the ME using the corporate scheme. + */ + EPersonaliseCorporate, + /** + Personalise the ME using the SIM/USIM scheme. + */ + EPersonaliseUsim + }; + + IMPORT_C TInt GetPersonalisationCaps(TUint32& aCaps) const; + IMPORT_C void GetPersonalisationStatus(TRequestStatus& aReqStatus, TUint32& aPersSchemes) const; + IMPORT_C void SetPersonalisationStatus(TRequestStatus& aReqStatus, const TMobilePhonePersonalisation aPersSchemes, const TDes& aPersCode) const; + + /***********************************************************************************/ + // + // Etel 3rd Party v1.0 Parameter classes + // + /***********************************************************************************/ + + class TEtel3rdPartyMobileNetworkInfoV1 : public TMultimodeType + /** + Defines the parameters used to set-up of a call originated from an ETel 3rd Party client. + + TEtel3rdPartyMobileNetworkInfoV1 was used to give an indication to the TSY of where the + request was originating from; i.e. if the request is from an application using the ISV + API or ETel API, which allowed the TSY to make a decision based on the origin. This + data type also provided further protection by not including any location information + parameters. With PlatSec being introduced in v9.0, there was no need to use this data + structure, as each API is policed with the adequate PlatSec capabilities. Therefore, + in v9.0 TEtel3rdPartyMobileNetworkInfoV1 was deprecated and removed from the ETel ISV + (ETel3rdParty) implementation. + + TEtel3rdPartyMobileNetworkInfoV1 was only used internally by the ETel ISV API when calls + are made to RMobilePhone::GetCurrentNetwork or RMobilePhone::NotifyCurrentNetworkChange. + The TSY no longer needs to support this as ETel ISV now uses the TMobilePhoneNetworkInfoV2 + data structure and no distinction is required for ISV Apps. + + @publishedPartner + @deprecated 9.0 This class has been deprecated from 9.0 and should no longer be used. + */ + { + public: + IMPORT_C TEtel3rdPartyMobileNetworkInfoV1(); + public: + /** Mode of the network. + Modes: Common + + @see TMobilePhoneNetworkMode */ + TMobilePhoneNetworkMode iMode; + /** Status of the network + + Modes: Common + + @see TMobilePhoneNetworkStatus */ + TMobilePhoneNetworkStatus iStatus; + /** The band and band class of the CDMA network operator. + + Modes: CDMA + + @see TMobilePhoneNetworkBandInfo */ + TMobilePhoneNetworkBandInfo iBandInfo; + /** The MCC of the network. + + Modes: Common + + @see TMobilePhoneNetworkCountryCode */ + TMobilePhoneNetworkCountryCode iCountryCode; + /** The system identity (SID) of the CDMA network or the system identity (SID) of the AMPS network. + + Modes: CDMA + + @see TMobilePhoneNetworkIdentity */ + TMobilePhoneNetworkIdentity iCdmaSID; + /** The network identity (NID in CDMA and MNC in GSM). + + Modes: Common + + @see TMobilePhoneNetworkIdentity */ + TMobilePhoneNetworkIdentity iNetworkId; + /** The alpha-tag displayed when this is the serving network. + + Modes: Common + + @see TMobilePhoneNetworkDisplayTag */ + TMobilePhoneNetworkDisplayTag iDisplayTag; + /** The short name (up to 10 characters) of the network operator. + + Modes: GSM/WCDMA + + @see TMobilePhoneNetworkShortName */ + TMobilePhoneNetworkShortName iShortName; + /** The long name (up to 20 characters) of the network operator. + + Modes: GSM/WCDMA + + @see TMobilePhoneNetworkLongName */ + TMobilePhoneNetworkLongName iLongName; + /** The type of network access. + + @see TMobilePhoneNetworkAccess */ + TMobilePhoneNetworkAccess iAccess; + }; + +/** A typedef'd packaged TEtel3rdPartyMobileNetworkInfoV1 for passing through a generic +API function member. + +@deprecated 9.0 +*/ + typedef TPckg TEtel3rdPartyMobileNetworkInfoV1Pckg; + + /** IMS Authenticate constants,in accordance to 3GPP TS 33.102, + section 6.3.7, and RFC 3310*/ + enum TMobilePhoneAuthenticate + { + /** length of autn is 128bits - 16octets*/ + KAutnLength=16, + /** length of RAND is 16 octets */ + KRandLength=16, + /** length of RES is 16 octets*/ + KResLength=16, + /** length of IK is 16 octets*/ + KIkLength=16, + /** length of CK is 16 octets*/ + KCkLength=16, + /** length of Kc (GSM cipher key) is 8 octets*/ + KKcLength=8, + /** length of is 112 bits - 14 octets */ + KAutsLength=14, + }; + + /** Maximum size of the record in an EF is 0xff( 255 bytes) according to TS 102.221, section 8.2.2.2 + */ + enum TMobilePhoneRelease5EFMaxSize + { + KRelease5EFMaxSize=255, + }; + + /** typedefs for encapsulation of the buffers that hold authorization data stored on the ISIM/USIM*/ + /** typedef for Internet Multimedia Public Identity*/ + typedef TBuf8 TIMPU; + /** typedef for Internet Multimedia Private Identity*/ + typedef TBuf8 TIMPI; + /** typedef for Home Network Domain Name*/ + typedef TBuf8 THNDN; + + + /** IMS Authenticate API*/ + /** Class encapsulates data needed as an input/output for + ISIM/USIM AUTHENTICATE command + + @publishedPartner + @released + */ + class TImsAuthenticateDataV5: public TMultimodeType + { + public: + IMPORT_C TImsAuthenticateDataV5(); + /** holds value of network challenge AUTN */ + TBuf8 iAUTN; + /** holds value of network challenge RAND */ + TBuf8 iRAND; + /** holds result RES of AUTHENTICATE command when it's successfull*/ + TBuf8 iRES; + /** holds value of session key Integrity Key */ + TBuf8 iIK; + /** holds value of session key Cipher Key */ + TBuf8 iCK; + /** holds value of Authentication Token when AUTHENTICATE fails*/ + TBuf8 iAUTS; + }; + + /** packaged version of TImsAuthenticateDataV5, used when this structure has to be passeed via IPC*/ + typedef TPckg TImsAuthenticateDataV5Pckg; + friend class CAsyncRetrieveAuthorizationInfo; + + /** API that execute ISIM/USIM AUTHENTICATE command*/ + IMPORT_C void ImsAuthenticate (TRequestStatus& aReqStatus,TDes8& authenticateDataPckgd) const; + + IMPORT_C void NotifyImsAuthorizationInfoChange(TRequestStatus& aReqStatus) const; + + /** + Source location of IMS Authorization data. + */ + enum TAuthorizationDataSource + { + /** Authorization data source is USIM. */ + EFromUSIM, + /** Authorization data source is ISIM. */ + EFromISIM + }; + + /** + Class encapsulates IMS authorization data stored in the ISIM or USIM + + @publishedPartner + @released + */ + class CImsAuthorizationInfoV5 : public CBase + { + public: + IMPORT_C ~CImsAuthorizationInfoV5(); + IMPORT_C static CImsAuthorizationInfoV5* NewL(); + IMPORT_C virtual void ExternalizeL(HBufC8*& aBuffer); + IMPORT_C virtual void InternalizeL(const TDesC8& aBuffer); + IMPORT_C TUint ExtensionId() const; + public: + /**Internet Multimedia Private Identity stored on the ISIM/USIM*/ + RMobilePhone::TIMPI iIMPI; + /**Internet Multimedia Public Identity(ies) stored on the ISIM/USIM*/ + RArray iIMPUArray; + /**Home Network Domain Name stored on the ISIM/USIM*/ + RMobilePhone::THNDN iHomeNetworkDomainName; + /**indicates whether authorization data has been retrieved from the ISIM*/ + TAuthorizationDataSource iAuthenticationDataSource; + protected: + CImsAuthorizationInfoV5(); + /** version of the data supported*/ + TUint iExtensionId; + }; + + /** + Defines the input as well as the ouput parameters used when performing the + (U)ICC AUTHENTICATE command. + + @publishedPartner + @released + */ + class TSmartCardAuthenticateDataV6 : public TImsAuthenticateDataV5 + { + public: + IMPORT_C TSmartCardAuthenticateDataV6(); + + public: + TBuf8 iKc; + }; + + /** + Packaged version of TSmartCardAuthenticateDataV6, used when this + structure has to be passeed via IPC. + */ + typedef TPckg TSmartCardAuthenticateDataV6Pckg; + + IMPORT_C void SmartCardAuthenticate(TRequestStatus& aReqStatus, TDes8& aAuthDataPckgd) const; + IMPORT_C void SmartCardAuthenticate(TRequestStatus& aReqStatus, const TAID& aAID, TDes8& aAuthDataPckgd) const; + +private: + CMobilePhonePtrHolder* iMmPtrHolder; + RMobilePhone(const RMobilePhone& aPhone); + +protected: + IMPORT_C void ConstructL(); + IMPORT_C void Destruct(); + }; + + +/*********************************************************/ +// +// Phone Storage functionality (RMobilePhoneStore) +// +/*********************************************************/ + + + +class CMobilePhoneStorePtrHolder; +class RMobilePhoneStore : public RTelSubSessionBase +/** +Abstract class used to define common phone storage actions and types + +Clients open one of the specialised phone store classes that are derived from RMobilePhoneStore +*/ + { +public: + friend class CAsyncRetrieveStoreList; + +/** Types of store. + +Modes: Common */ + enum TMobilePhoneStoreType + { + /** Store type is unknown. + + Modes: Common */ + EPhoneStoreTypeUnknown, + /** Store contains SMS messages. + + Modes: Common */ + EShortMessageStore, + /** Store contains NAM entries. + + Modes: CDMA */ + ENamStore, + /** Store contains PhoneBook entries. + + Modes: Common */ + EPhoneBookStore, + /** Store contains emergency number entries. + + Modes: Common */ + EEmergencyNumberStore, + /** Store contains own number entries. + + Modes: Common */ + EOwnNumberStore + }; + +/** Store capabilities. */ + enum TMobilePhoneStoreCaps + { + /** The store can be accessed as a whole using the ReadAll() and StoreAll() member + functions. */ + KCapsWholeStore = 0x80000000, + /** The store can be accessed one entry at a time using the RMobilePhoneStore::Read(), + RMobilePhoneStore::Write() and RMobilePhoneStore::Delete() member functions. */ + KCapsIndividualEntry = 0x40000000, + /** The store can be accessed in order to read entries. */ + KCapsReadAccess = 0x20000000, + /** The store can be accessed in order to write or delete entries. */ + KCapsWriteAccess = 0x10000000, + /** The TSY supports deleting all the store entries at once. */ + KCapsDeleteAll = 0x08000000, + /** The TSY supports notification of store events such as entries added, deleted + or store becoming full. */ + KCapsNotifyEvent = 0x04000000 + }; + +/** The type of store information. As defined in TMobilePhoneStoreInfoV1::iExtensionId + +Modes: Common + +@see TMobilePhoneStoreInfoV1 +@see RMobilePhone::TMultimodeType */ + enum TMobilePhoneStoreInfoExtId + { + /** The iExtensionId contents indicate that the packaged class is a RMobilePhoneStore::TMobilePhoneStoreInfoV1. + Modes: Common */ + KETelMobilePhoneStoreV1=KETelExtMultimodeV1, + /** The iExtensionId contents indicate that the packaged class is a RMobilePhoneBookStore::TMobilePhoneBookInfoV1. + Modes: Common */ + KETelMobilePhonebookStoreV1, + /** Reserved for SMS store specific information class. + Modes: Common */ + KETelMobileSmsStoreV1, + /** The iExtensionId contents indicate that the packaged class is a RMobileNamStore::TMobileNamStoreInfoV1. + Modes: CDMA */ + KETelMobileNamStoreV1, + /** The iExtensionId contents indicate that the packaged class is a RMobileONStore::TMobileONStoreInfoV1. + Modes: Common */ + KETelMobileONStoreV1, + /** Reserved for Emergency Number store specific infoprmation class. + Modes: Common */ + KETelMobileENStoreV1, + /** The iExtensionId contents indicate that the packaged class is a TMobilePhoneBookInfoV2. + Modes: Common */ + KETelMobilePhonebookStoreV2=KETelExtMultimodeV2, + + /** The iExtensionId contents indicate that the packaged class is a TMobilePhoneBookInfoV2. + Modes: Common */ + KETelMobilePhonebookStoreV5=KEtelExtMultimodeV5 + }; + + + + class TMobilePhoneStoreInfoV1 : public RMobilePhone::TMultimodeType +/** Defines information and capabilities of a phone-side store. +@publishedPartner +@released */ + { + public: + IMPORT_C TMobilePhoneStoreInfoV1(); + + /** The type of entry in the phone-side store. + + Modes: Common + + @see TMobilePhoneStoreType */ + TMobilePhoneStoreType iType; + /** Indicates the total number of entries that may be held in this store. */ + TInt iTotalEntries; + /** Indicates the current number of entries held in this store. + + Is equal to KIndexNotUsed if the TSY is unable to determine current number + of entries. + + Modes: Common */ + TInt iUsedEntries; + /** Indicates the capabilities of the store. It is the sum of caps constants defined + in TMobilePhoneStoreCaps and those defined for a specialised phone store. + + Modes: Common */ + TUint32 iCaps; + /** The name of the phone-side store. A valid list of names is given in the description + of each specialised store. + + Modes: Common + + @see RMobilePhone::TMobileName */ + RMobilePhone::TMobileName iName; + }; + +/** A typedef'd packaged TMobilePhoneStoreInfoV1 for passing through a generic +API member function. */ + typedef TPckg TMobilePhoneStoreInfoV1Pckg; + + + + class TMobilePhoneStoreEntryV1 : public RMobilePhone::TMultimodeType +/** Defines common contents of an entry in a phone-side store. +*/ + { + public: + + enum + { + KIndexNotUsed = -1 + }; + + protected: + TMobilePhoneStoreEntryV1(); + public: + void InternalizeL(RReadStream& aStream); + void ExternalizeL(RWriteStream& aStream) const; + public: + /** The slot location of the entry within phone-side storage. + + Modes: Common */ + TInt iIndex; + }; + + IMPORT_C void GetInfo(TRequestStatus& aReqStatus, TDes8& aInfo) const; + + IMPORT_C void Read(TRequestStatus& aReqStatus, TDes8& aEntry) const; + IMPORT_C void Write(TRequestStatus& aReqStatus, TDes8& aEntry) const; + + IMPORT_C void Delete(TRequestStatus& aReqStatus, TInt aIndex) const; + IMPORT_C void DeleteAll(TRequestStatus& aReqStatus) const; + +/** The store events. It is possible for more than one event to occur at the same +time, therefore the events are a bitmask and should be tested as a bitmask. + +Modes: Common + +@see NotifyStoreEvent() */ + enum TMobileStoreEvent + { + /** The store has become full. This event will trigger after the last possible + entry in a store has been written. */ + KStoreFull =0x00000001, + /** The store was full but now has some space. This event will trigger after one + or more entries have been deleted from a full store. */ + KStoreHasSpace =0x00000002, + /** The store is empty. This event will trigger after the last entry in a store + has been deleted or if all entries are deleted at once. */ + KStoreEmpty =0x00000004, + /** The store has a new entry, placed in the slot indicated by the aIndex parameter. */ + KStoreEntryAdded =0x00000008, + /** The store has deleted the entry that was in the slot indicated by the aIndex + parameter. */ + KStoreEntryDeleted =0x00000010, + /** The store has changed the entry that was in the slot indicated by the aIndex + parameter. */ + KStoreEntryChanged =0x00000020, + /** The store contents have substantially changed and the TSY is recommending that + the client performs a refresh by reading all the contents again. */ + KStoreDoRefresh =0x00000040 + }; + + IMPORT_C void NotifyStoreEvent(TRequestStatus& aReqStatus, TUint32& aEvent, TInt& aIndex) const; + +protected: + CMobilePhoneStorePtrHolder* iStorePtrHolder; + +protected: + RMobilePhoneStore(); + IMPORT_C void BaseConstruct(CMobilePhoneStorePtrHolder* aPtrHolder); + IMPORT_C void Destruct(); + }; + + +/*********************************************************/ +// +// Call based functionality (RMobileCall) +// +/*********************************************************/ + + + +class CMobileCallPtrHolder; + +class RMobileCall : public RCall +/** Provides access to the functionality associated with a specific mobile call. + +RMobileCall encapsulates access to a mobile phone. The functionality of RMobileCall +is divided into a number of functional units, for the purpose of easier documentation +and navigation and selectable support by TSY. + +Note: Some RMobileCall function members must be supported by the TSY while +others are part of optional "functional unit" and only need to be supported +if the TSY supports that functional unit. When a functional unit is mandatory +then the TSY should at least support the Get...Caps() member function to indicate +the member functions that are supported for this unit. + */ + { +public: + IMPORT_C RMobileCall(); + /***********************************************************************************/ + // + // Mobile call parameters - used within Dial/Answer API + // + /***********************************************************************************/ + + // used to set iExtensionId in RCall::TCallParams +/** The mobile call parameter extension IDs. + +Modes: Common */ + enum TMobileCallParamsExtensionId + { + /** The iExtensionId contents indicate that the packaged class is a TMobileCallParamsV1. */ + KETelMobileCallParamsV1=KETelExtMultimodeV1, + /** The iExtensionId contents indicate that the packaged class is a TMobileDataCallParamsV1. + + Modes: Common */ + KETelMobileDataCallParamsV1, + /** The iExtensionId contents indicate that the packaged class is a TMobileHscsdCallParamsV1. + + Modes: GSM/WCDMA */ + KETelMobileHscsdCallParamsV1, + /** The iExtensionId contents indicate that the packaged class is a TMobileCallParamsV2. + + Modes: Common */ + KETelMobileCallParamsV2=KETelExtMultimodeV2, + /** The iExtensionId contents indicate that the packaged class is a TMobileDataCallParamsV2. + + Modes: Common */ + KETelMobileDataCallParamsV2, + /** The iExtensionId contents indicate that the packaged class is a TMobileHscsdCallParamsV2. + + Modes: GSM/WCDMA */ + KETelMobileHscsdCallParamsV2, + /** The iExtensionId contents indicate that the packaged class is a TEtel3rdPartyMobileCallParamsV1. + + Modes: Common */ + KETel3rdPartyCallParamsV1=KETelExt3rdPartyV1 + }; + +/** Caller Id restriction settings. + +Modes: Common + +@see TMobileCallParamsV1 */ + enum TMobileCallIdRestriction + { + /** The default setting should be used if the user has not explicitly requested + their identity to be restricted/allowed. */ + EIdRestrictDefault, + /** The user has explicitly requested their identity to be sent for this call. */ + ESendMyId, + /** The user has explicitly requested their identity not to be sent for this call. */ + EDontSendMyId + }; + + class TMobileCallCugV1 : public RMobilePhone::TMultimodeType +/** This class is used to set up a CUG (Closed User Group) call. + +TMobileCallCugV1() is valid in GSM/WCDMA mode only. The client application +should set the CUG settings for the call depending on the user's choice. If +the user has not explicitly requested a CUG call then this parameter should +indicate that explicit CUG invoke is false. The TSY ignores this parameter +if in CDMA mode. +*/ + { + public: + IMPORT_C TMobileCallCugV1(); + public: + /** A boolean indicating whether Closed User Group is being explicitly invoked by + the client or not. If this parameter is false, the other entries in this structure + will be ignored. */ + TBool iExplicitInvoke; + /** The Closed User Group index that the user has specified for this call (if no + index has been specified then this element will equal -1). */ + TInt iCugIndex; + /** A boolean indicating whether the user has suppressed their Outgoing Access option + or not. */ + TBool iSuppressOA; + /** A boolean indicating whether the user has suppressed the use of their preferential + Closed User Group or not. */ + TBool iSuppressPrefCug; + }; + +/** Multicall Operation set-up. + +Mode: WCDMA */ + enum TMobileCallMulticallBearerMode + { + /** Multicall is not supported. */ + EMulticallNotSupported, + /** MS will accept incoming call and establish a connection using an existing bearer. */ + EMulticallShareBearer, + /** MS will accept incoming call and establish a connection by creating a new bearer. */ + EMulticallNewBearer + }; + + + + class TMobileCallParamsV1 : public RCall::TCallParams +/** Defines the parameters used for set-up of a call of any type. +*/ + { + public: + IMPORT_C TMobileCallParamsV1(); + public: + /** Call Id restriction setting to be used for this call. + + @see TMobileCallIdRestriction */ + TMobileCallIdRestriction iIdRestrict; + /** Closed User Group setting to be used for this call. + + @see TMobileCallCugV1 */ + TMobileCallCugV1 iCug; + /** Specifies whether this call attempt is user initiated (EFalse) or a client initiated + redial (ETrue). */ + TBool iAutoRedial; + }; + +/** A typedef'd packaged TMobileCallParamsV1 for passing through a generic API function +member. */ + typedef TPckg TMobileCallParamsV1Pckg; + + + + class TMobileCallParamsV2 : public TMobileCallParamsV1 +/** Defines the parameters used for set-up of a call of any type +for version v2.0 of the API. +A new parameter (iBearerMode) is required to support Multicall. +@publishedPartner +@released +*/ + { + public: + IMPORT_C TMobileCallParamsV2(); + public: + /** The bearer mode. */ + TMobileCallMulticallBearerMode iBearerMode; + }; + +/** A typedef'd packaged TMobileCallParamsV1 for passing through a generic API +function member. */ + typedef TPckg TMobileCallParamsV2Pckg; + + /***********************************************************************************/ + // + // Mobile Call Data Functional Unit + // + /***********************************************************************************/ + +/** In GSM mode, maps to list of supported speeds returned in response to AT+CBST=?. +In CDMA mode, maps to data rates supported by supported service options. + +@see TMobileCallDataCapsV1 */ + enum TMobileCallDataSpeedCaps + { + /** Call can support autobauding. */ + KCapsSpeedAutobauding = 0x00000001, + /** Call can support a speed of 2400bps. */ + KCapsSpeed2400 = 0x00000002, + /** Call can support a speed of 4800bps. */ + KCapsSpeed4800 = 0x00000004, + /** Call can support a speed of 9600bps. */ + KCapsSpeed9600 = 0x00000008, + /** Call can support a speed of 14400bps. */ + KCapsSpeed14400 = 0x00000010, + /** Call can support a speed of 19200bps. */ + KCapsSpeed19200 = 0x00000020, + /** Call can support a speed of 28800bps. */ + KCapsSpeed28800 = 0x00000040, + /** Call can support a speed of 32000bps. */ + KCapsSpeed32000 = 0x00000080, + /** Call can support a speed of 33600bps. */ + KCapsSpeed33600 = 0x00000100, + /** Call can support a speed of 38400bps. */ + KCapsSpeed38400 = 0x00000200, + /** Call can support a speed of 43200bps. */ + KCapsSpeed43200 = 0x00000400, + /** Call can support a speed of 48000bps. */ + KCapsSpeed48000 = 0x00000800, + /** Call can support a speed of 56000bps. */ + KCapsSpeed56000 = 0x00001000, + /** Call can support a speed of 57600bps. */ + KCapsSpeed57600 = 0x00002000, + /** Call can support a speed of 64000bps. */ + KCapsSpeed64000 = 0x00004000, + /** Call can support extended data speed capabilities. This flag is reserved for + future expansion of API and should always be set to zero. */ + KCapsSpeedExtended = 0x80000000 + }; + +/** List of supported values of the parameter returned in response to AT+CBST=? + +Not applicable to CDMA mode + +@see TMobileDataCallParamsV1 */ + enum TMobileCallDataProtocolCaps + { + /** Call can support V.22bis standard + + Modes: COMMON */ + KCapsProtocolV22bis = 0x00000001, + /** Call can support V.32 standard. + + Modes: COMMON */ + KCapsProtocolV32 = 0x00000002, + /** Call can support V.34 standard. + + Modes: COMMON */ + KCapsProtocolV34 = 0x00000004, + /** Call can support V.110 standard. + + Modes: GSM/WCDMA */ + KCapsProtocolV110 = 0x00000008, + /** Call can support V.120 standard. + + Modes: GSM/WCDMA */ + KCapsProtocolV120 = 0x00000010, + /** Call can support bit transparent service. + + Modes: GSM/WCDMA */ + KCapsProtocolBitTransparent = 0x00000020, + /** Call can support X31 flag stuffing standard. + + Modes: GSM/WCDMA */ + KCapsProtocolX31FlagStuffing = 0x00000040, + /** Call can support both PIAF standards (32000bps and 64000bps). + + Modes: GSM/WCDMA */ + KCapsProtocolPIAFS = 0x00000080, + /** Call can support request for Multimedia protocol (3G-324M) over a call to PSTN + with voice fallback. + + Modes: WCDMA */ + KCapsPstnMultimediaVoiceFallback = 0x00000100, + /** Call can support request for Multimedia protocol (3G-324M) over a call to PSTN + without voice fallback + + Modes: WCDMA */ + KCapsPstnMultimedia = 0x00000200, + /** Call can support request for Multimedia protocol (3G-324M) over a call to ISDN + (voice fallback not possible). + + Modes: WCDMA */ + KCapsIsdnMultimedia = 0x00000400, + /** Call can support extended data carrier capabilities. This flag is reserved for + future expansion and should always be set to zero for v1.0 of this API. + + Modes: COMMON */ + KCapsProtocolExtended = 0x80000000 + }; + +/** In GSM mode, maps to list of supported returned in response to AT+CBST=? +In CDMA mode, maps to supported service options. + +Modes: COMMON + +@see TMobileCallDataCapsV1 */ + enum TMobileCallDataServiceCaps + { + KCapsDataCircuitAsynchronous = 0x00000001, + KCapsDataCircuitAsynchronousRDI = 0x00000002, + KCapsDataCircuitSynchronous = 0x00000004, + KCapsDataCircuitSynchronousRDI = 0x00000008, + /** Call can support "PAD Access (asynchronous) (UDI)". + + Modes: GSM/WCDMA */ + KCapsPADAsyncUDI = 0x00000010, + /** Call can support "PAD Access (asynchronous) (RDI)" + + Modes: GSM/WCDMA */ + KCapsPADAsyncRDI = 0x00000020, + /** Call can support "Packet Access (synchronous) (UDI)" + + Modes: GSM/WCDMA */ + KCapsPacketAccessSyncUDI = 0x00000040, + /** Call can support "Packet Access (synchronous) (RDI)". + + Modes: GSM/WCDMA */ + KCapsPacketAccessSyncRDI = 0x00000080, + /** Call can support extended data service capabilities. This flag is reserved for + future expansion of this API and should always be set to zero for v1.0 of + this API. + + Modes: COMMON */ + KCapsServiceExtended = 0x80000000 + }; + +/** Maps to list of supported returned in response to AT+CBST=? + +Not applicable to CDMA mode. + +@see TMobileCallDataCapsV1 */ + enum TMobileCallDataQoSCaps + { + /** Call can support a request for "transparent only" connection. */ + KCapsTransparent = 0x00000001, + /** Call can support a request for "non-transparent only" connection. */ + KCapsNonTransparent = 0x00000002, + /** Call can support a request for "transparent preferred" connection. */ + KCapsTransparentPreferred = 0x00000004, + /** Call can support a request for "non-transparent preferred" connection. */ + KCapsNonTransparentPreferred = 0x00000008 + }; + +/** Supported Air Interface User Rates. */ + enum TMobileCallAiurCodingCaps + { + /** Air interface user rate of 4.8k is supported. */ + KCapsAiurCoding48 = 0x01, + /** Air interface user rate of 9.6k is supported. */ + KCapsAiurCoding96 = 0x04, + /** Air interface user rate of 14.4k is supported. */ + KCapsAiurCoding144 = 0x08 + }; + +/** HSCSD coding capabilities. + +Modes: GSM/WCDMA */ + enum TMobileCallTchCodingsCaps + { + /** Call supports HSCSD coding on 4.8K full rate data traffic channel. */ + KCapsTchCoding48 = 0x00000001, + /** Call supports HSCSD coding on 9.6K full rate data traffic channel. */ + KCapsTchCoding96 = 0x00000004, + /** Call supports HSCSD coding on 14.4K full rate data traffic channel. */ + KCapsTchCoding144 = 0x00000008, + /** Call supports HSCSD coding on 28.8K full rate data traffic channel (only possible + when 14.4K is supported). */ + KCapsTchCoding288 = 0x00000010, + /** Call supports HSCSD coding on 32.0K full rate data traffic channel (only possible + in a two-timeslot configuration). */ + KCapsTchCoding320 = 0x00000020, + /** Call supports HSCSD coding on 43.2K full rate data traffic channel (only possible + when 14.4K is supported). */ + KCapsTchCoding432 = 0x00000040 + }; + +/** The call asymmetry capabilities. + +Modes: GSM/WCDMA + +@see TMobileCallDataCapsV1 */ + enum TMobileCallAsymmetryCaps + { + /** Call supports "No Preference" option for asymmetry bias of a Non-Transparent + ECSD call. */ + KCapsAsymmetryNoPreference= 0x00000001, + /** Call supports "Downlink bias" option for asymmetry bias of a Non-Transparent + ECSD call. + + This means 8-PSK modulation is preferred downlink and GMSK modulation uplink. */ + KCapsAsymmetryDownlink = 0x00000002, + /** Call supports "Uplink bias" option for asymmetry bias of a Non-Transparent ECSD + call. + + This means 8-PSK modulation is preferred uplink and GMSK modulation downlink. */ + KCapsAsymmetryUplink = 0x00000004 + }; + +/** The supported Call RLP versions. + +Modes: GSM/WCDMA + +@see TMobileCallDataCapsV1 */ + enum TMobileCallRLPVersionCaps + { + /** Call supports the single link, basic RLP version 0. */ + KCapsRLPSingleLinkVersion0 = 0x00000001, + /** Call supports the single link, extended RLP version 1. */ + KCapsRLPSingleLinkVersion1 = 0x00000002, + /** Call supports the multi link, RLP version 2. */ + KCapsRLPMultiLinkVersion2 = 0x00000004 + }; + +/** The supported V42bis options. + +Modes: GSM/WCDMA + +@see TMobileCallDataCapsV1 */ + enum TMobileCallV42bisCaps + { + /** Call supports V42bis compression in initiator-responder direction. */ + KCapsV42bisTxDirection = 0x00000001, + /** Call supports V42bis compression in responder-initiator direction. */ + KCapsV42bisRxDirection = 0x00000002, + /** Call supports V42bis compression in both directions. */ + KCapsV42bisBothDirections = 0x00000004 + }; + + + + class TMobileCallDataCapsV1 : public RMobilePhone::TMultimodeType + /** Defines the capabilities of a circuit switched data call. + @publishedPartner + @released + */ + { + public: + IMPORT_C TMobileCallDataCapsV1(); + public: + /** Data speed capabilities - a bit wise sum of the caps defined in TMobileCallDataSpeedCaps. */ + TUint32 iSpeedCaps; + /** Data protocol capabilities - a bit wise sum of the caps defined in TMobileCallDataProtocolCaps. */ + TUint32 iProtocolCaps; + /** Data service capabilities - a bit wise sum of the caps defined in TMobileCallDataServiceCaps. */ + TUint32 iServiceCaps; + /** Data QoS capabilities - a bit wise sum of the caps defined in TMobileCallDataQoSCaps. + + Note: Only available in GSM/WCDMA mode. */ + TUint32 iQoSCaps; + /** A boolean indicating whether or not the MS supports HSCSD for this call. If + this attribute equals EFalse all the following attributes are invalid. + + Note: Only available in GSM/WCDMA mode. */ + TBool iHscsdSupport; + /** For HSCSD: The multi-slot class supported. */ + TInt iMClass; + /** For HSCSD: The maximum supported number of time-slots in the receive (down-link) + direction. */ + TInt iMaxRxTimeSlots; + /** For HSCSD: The maximum supported number of time-slots in the transmit (up-link) + direction. */ + TInt iMaxTxTimeSlots; + /** For HSCSD: The maximum supported total number of receive and transmit time-slots + that can be used at same time. */ + TInt iTotalRxTxTimeSlots; + /** For HSCSD: A bit-wise sum of the supported air interface channel codings defined + in TMobileCallAiurCodingCaps. */ + TUint32 iCodingCaps; + /** For HSCSD: A bit-wise sum of the supported asymmetry bias defined in TMobileCallAsymmetryCaps. */ + TUint32 iAsymmetryCaps; + /** For HSCSD: A boolean indicating whether or not the MS supports automatic user + initiated service level upgrading. */ + TBool iUserInitUpgrade; + /** For HSCSD and CSD: A bit-wise sum of the supported Radio Link Protocol versions + defined in TMobileCallRLPVersionCaps. */ + TUint32 iRLPVersionCaps; + /** For HSCSD and CSD: A bit-wise sum of the supported V42bis compression capabilities + defined in TMobileCallV42bisCaps . */ + TUint32 iV42bisCaps; + }; + +/** A typedef'd packaged TMobileCallDataCapsV1 for passing through a generic API +function member. */ + typedef TPckg TMobileCallDataCapsV1Pckg; + + IMPORT_C TInt GetMobileDataCallCaps(TDes8& aCaps) const; + IMPORT_C void NotifyMobileDataCallCapsChange(TRequestStatus& aReqStatus, TDes8& aCaps) const; + +/** The call setup requested data speed. + +@see TMobileDataCallParamsV1 */ + enum TMobileCallDataSpeed + { + /** Call set-up will request speed depending on data carrier chosen. */ + ESpeedUnspecified, + /** Call set-up will request autobauding. */ + ESpeedAutobauding, + /** Call set-up will request 2400bps. */ + ESpeed2400, + /** Call set-up will request 4800bps. */ + ESpeed4800, + /** Call set-up will request 9600bps. */ + ESpeed9600, + /** Call set-up will request 14400bps. */ + ESpeed14400, + /** Call set-up will request 19200bps. */ + ESpeed19200, + /** Call set-up will request 28800bps. */ + ESpeed28800, + /** Call set-up will request 32000bps. */ + ESpeed32000, + /** Call set-up will request 33600bps. */ + ESpeed33600, + /** Call set-up will request 38400bps. */ + ESpeed38400, + /** Call set-up will request 43200bps. */ + ESpeed43200, + /** Call set-up will request 48000bps. */ + ESpeed48000, + /** Call set-up will request 56000bps. */ + ESpeed56000, + /** Call set-up will request 57600bps. */ + ESpeed57600, + /** Call set-up will request 64000bps. */ + ESpeed64000 + }; + +/** The call set-up requested data protocol. + +Modes: GSM/WCDMA */ + enum TMobileCallDataProtocol + { + /** Call set-up will request carrier depending on data speed chosen. */ + EProtocolUnspecified, + /** Call set-up will request the V.22bis standard. */ + EProtocolV22bis, + /** Call set-up will request the V.32 standard. */ + EProtocolV32, + /** Call set-up will request the V.34 standard. */ + EProtocolV34, + /** Call set-up will request the V.110 standard. */ + EProtocolV110, + /** Call set-up will request the V.120 standard. */ + EProtocolV120, + /** Call set-up will request the X31FlagStuffing standard. */ + EProtocolX31FlagStuffing, + /** Call set-up will request the PIAFS standard. */ + EProtocolPIAFS, + /** Call set-up will request the bit transparent service. */ + EProtocolBitTransparent, + /** Call set-up will request a PSTN multimedia call with voice fallback if multimedia + fails. + + WCDMA mode only. */ + EProtocolPstnMultimediaVoiceFallback, + /** Call set-up will request a PSTN multimedia call. + + WCDMA mode only. */ + EProtocolPstnMultimedia, + /** Call set-up will request a ISDN multimedia call. + + WCDMA mode only. */ + EProtocolIsdnMultimedia + }; + +/** The call setup requested data services. + +Modes: Common + +@see TMobileDataCallParamsV1 */ + enum TMobileCallDataService + { + /** Call set-up will request its default service type. + + Modes: Common */ + EServiceUnspecified, + /** Call set-up will request: + + GSM mode - Data circuit asynchronous (UDI or 3.1 KHz, ex PLMN) service + + In CDMA mode - Async Data service + + Modes: Common */ + EServiceDataCircuitAsync, + /** Call set-up will request Data circuit asynchronous (RDI) service. + + Modes: GSM/WCDMA */ + EServiceDataCircuitAsyncRdi, + /** Call set-up will request Data circuit synchronous (UDI or 3.1 KHz, ex PLMN) + service. + + Modes: GSM/WCDMA */ + EServiceDataCircuitSync, + /** Call set-up will request Data circuit synchronous (RDI) service. + + Modes: GSM/WCDMA */ + EServiceDataCircuitSyncRdi, + /** Call set-up will request PAD asynchronous (UDI) service. + + Modes: GSM/WCDMA */ + EServicePADAsyncUDI, + /** Call set-up will request PAD asynchronous (RDI) service. + + Modes: GSM/WCDMA */ + EServicePADAsyncRDI, + /** Call set-up will request Packet Access synchronous (UDI) service. + + Modes: GSM/WCDMA */ + EServicePacketAccessSyncUDI, + /** Call set-up will request Packet Access synchronous (RDI) service. + + Modes: GSM/WCDMA */ + EServicePacketAccessSyncRDI + }; + +/** The call set-up requested quality of service (QoS). + +Modes: GSM/WCDMA + +@see TMobileDataCallParamsV1 */ + enum TMobileCallDataQoS + { + /** Call set-up will request its default connection. */ + EQoSUnspecified, + /** Call set-up will request a transparent connection. */ + EQoSTransparent, + /** Call set-up will request a non-transparent connection. */ + EQoSNonTransparent, + /** Call set-up will prefer a transparent connection. */ + EQosTransparentPreferred, + /** Call set-up will prefer a non-transparent connection. */ + EQosNonTransparentPreferred + }; + +/** The call set-up requested RLP version. + +@see TMobileDataCallParamsV1 */ + enum TMobileCallDataRLPVersion + { + /** Call set-up will request no RLP version. */ + ERLPNotRequested, + /** Call set-up will request single link basic RLP (version 0). */ + ERLPSingleLinkVersion0, + /** Call set-up will request single link extended RLP (version 1). */ + ERLPSingleLinkVersion1, + /** Call set-up will prefer multi link RLP (version 2). */ + ERLPMultiLinkVersion2 + }; + +/** The V.42bis parameters used in the call set-up of a V.42bis data call. + +@see TMobileDataCallParamsV1 */ + enum TMobileCallDataV42bis + { + /** Call set-up will not request V.42bis compression. */ + EV42bisNeitherDirection, + /** Call set-up will request V.42bis compression in initiator-responder direction + only. */ + EV42bisTxDirection, + /** Call set-up will request V.42bis compression in responder-initiator direction + only. */ + EV42bisRxDirection, + /** Call set-up will request V.42bis compression in both directions. */ + EV42bisBothDirections + }; + + + + + class TMobileDataCallParamsV1 : public TMobileCallParamsV1 +/** Defines the parameters used for setup of a circuit switched data call. +*/ + { + public: + IMPORT_C TMobileDataCallParamsV1(); + public: + /** The type of data service. + + @see TMobileCallDataService */ + TMobileCallDataService iService; + /** The data transfer rate. + + @see TMobileCallDataSpeed */ + TMobileCallDataSpeed iSpeed; + /** The ITU-T standard modulation protocol or higher application protocol. */ + TMobileCallDataProtocol iProtocol; + /** The quality of data service. + + @see TMobileCallDataQoS */ + TMobileCallDataQoS iQoS; + /** The version of Radio Link Protocol. + + Modes: GSM/WCDMA + + @see TMobileCallDataRLPVersion */ + TMobileCallDataRLPVersion iRLPVersion; + /** The IWF to MS windows size. + + Modes: GSM/WCDMA */ + TInt iModemToMSWindowSize; + /** The MS window to IWF size. + + Modes: GSM/WCDMA */ + TInt iMSToModemWindowSize; + /** The acknowledgement timer. + + Modes: GSM/WCDMA */ + TInt iAckTimer; + /** The number of retransmission attempts. + + Modes: GSM/WCDMA */ + TInt iRetransmissionAttempts; + /** The resequencing period in integer format. + + Modes: GSM/WCDMA */ + TInt iResequencingPeriod; + /** The V42bis compression request parameter. + + @see TMobileCallDataV42bis */ + TMobileCallDataV42bis iV42bisReq; + /** The number of codewords in the algorithm. */ + TInt iV42bisCodewordsNum; + /** The maximum encodable data string length. */ + TInt iV42bisMaxStringLength; + TBool iUseEdge; // True for ECSD + }; + +/** A typedef'd packaged TMobileDataCallParamsV1 for passing through a generic API +function member. */ + typedef TPckg TMobileDataCallParamsV1Pckg; + + + + + class TMobileDataCallParamsV2 : public TMobileDataCallParamsV1 +/** Defines the parameters used for setup of a circuit switched data call for version +v2.0 of the API. +*/ + { + public: + IMPORT_C TMobileDataCallParamsV2(); + public: + /** The bearer mode. */ + TMobileCallMulticallBearerMode iBearerMode; + }; + +/** A typedef'd packaged TMobileDataCallParamsV2 for passing through a generic +API function member. */ + typedef TPckg TMobileDataCallParamsV2Pckg; + +/** The Air interface user rate. + +Modes: GSM/WCDMA. */ + enum TMobileCallAiur + { + /** Air interface user rate is not set. */ + EAiurBpsUnspecified, + /** Air interface user rate of 9.6Kbps. */ + EAiurBps9600, + /** Air interface user rate of 14.4Kbps. */ + EAiurBps14400, + /** Air interface user rate of 19.2Kbps. */ + EAiurBps19200, + /** Air interface user rate of 28.8Kbps. */ + EAiurBps28800, + /** Air interface user rate of 38.4Kbps. */ + EAiurBps38400, + /** Air interface user rate of 43.2Kbps. */ + EAiurBps43200, + /** Air interface user rate of 57.6Kbps. */ + EAiurBps57600 + }; + +/** Call Asymmetry preferences. + +Modes: GSM/WCDMA + +@see TMobileHscsdCallParamsV1 */ + enum TMobileCallAsymmetry + { + /** There is no preference for Asymmetry Bias. */ + EAsymmetryNoPreference, + /** Downlink Bias is preferred. */ + EAsymmetryDownlink, + /** Uplink Bias is preferred. */ + EAsymmetryUplink + }; + +/** The call channel coding used. + +Modes: GSM/WCDMA */ + enum TMobileCallTchCoding + { + /** Channel coding is unspecified. */ + ETchCodingUnspecified, + /** 4.8K full rate data traffic channel is used. */ + ETchCoding48, + /** 9.6K full rate data traffic channel is used. */ + ETchCoding96, + /** 14.4K full rate data traffic channel is used. */ + ETchCoding144, + /** 28.8K full rate data traffic channel is used. */ + ETchCoding288, + /** 32.0K full rate data traffic channel is used. */ + ETchCoding320, + /** 43.2K full rate data traffic channel is used. */ + ETchCoding432 + }; + + + + class TMobileDataRLPRangesV1 : public RMobilePhone::TMultimodeType +/** Defines the parameters for minimum and maximum RLP parameter ranges. + +Modes: GSM/WCDMA + +*/ + { + public: + IMPORT_C TMobileDataRLPRangesV1(); + public: + /** Maximum modem to MS window size value. */ + TInt iIWSMax; + /** Minimum modem to MS window size value. */ + TInt iIWSMin; + /** Maximum MS to modem window size value. */ + TInt iMWSMax; + /** Minimum MS to modem window size value. */ + TInt iMWSMin; + /** Maximum acknowledgement timer value. */ + TInt iT1Max; + /** Minimum acknowledgement timer value. */ + TInt iT1Min; + /** Maximum retransmission attempts value. */ + TInt iN2Max; + /** Minimum retransmission attempts value. */ + TInt iN2Min; + /** Maximum resequencing period value. */ + TInt iT4Max; + /** Minimum resequencing period value. */ + TInt iT4Min; + }; + +/** A typedef'd packaged TMobileDataRLPRangesV1 for passing through a generic API +function member. */ + typedef TPckg TMobileDataRLPRangesV1Pckg; + + IMPORT_C void GetMobileDataCallRLPRange(TRequestStatus& aReqStatus, TInt aRLPVersion, TDes8& aRLPRange) const; + + class TMobileHscsdCallParamsV1 : public TMobileDataCallParamsV1 +/** The High Speed Circuit Switched Data parameters. +*/ + { + public: + IMPORT_C TMobileHscsdCallParamsV1(); + public: + /** The wanted Air Interface Rate for the HSCSD call being set-up. + + Modes: GSM/WCDMA + + @see TMobileCallAiur */ + TMobileCallAiur iWantedAiur; + /** The wanted number of receive timeslots for the HSCSD call being set-up. + + Modes: GSM/WCDMA */ + TInt iWantedRxTimeSlots; + TInt iMaxTimeSlots; + /** Bit-wise sum of acceptable air interface channel codings TMobileCallAiurCodingCaps + for the HSCSD call being set-up. + + Modes: GSM/WCDMA */ + TUint iCodings; + /** The wanted asymmetry bias for the HSCSD call being set-up. + + Modes: GSM/WCDMA + + @see TMobileCallAsymmetry */ + TMobileCallAsymmetry iAsymmetry; + /** A boolean indicating whether or not automatic user initiated service level upgrading + is active for the HSCSD call being set-up. ETrue means enabled, EFalse means + disabled. + + Modes: GSM/WCDMA */ + TBool iUserInitUpgrade; + }; + +/** A typedef'd packaged TMobileHscsdCallParamsV1 for passing through a generic +API function member. */ + typedef TPckg TMobileHscsdCallParamsV1Pckg; + + class TMobileHscsdCallParamsV2 : public TMobileHscsdCallParamsV1 +/** Call parameters for High Speed Circuit Switched Data (HSCSD) for version v2.0 +of the API. + +*/ + { + public: + IMPORT_C TMobileHscsdCallParamsV2(); + public: + /** The bearer mode. */ + TMobileCallMulticallBearerMode iBearerMode; + }; + +/** A typedef'd packaged TMobileHscsdCallParamsV2 for passing through a generic +API function member. */ + typedef TPckg TMobileHscsdCallParamsV2Pckg; + + IMPORT_C void SetDynamicHscsdParams(TRequestStatus& aReqStatus, TMobileCallAiur aAiur, TInt aRxTimeslots) const; + + class TMobileCallHscsdInfoV1 : public RMobilePhone::TMultimodeType +/** The HSCSD settings. + +Modes: GSM/WCDMA + +*/ + { + public: + IMPORT_C TMobileCallHscsdInfoV1(); + public: + /** Current AIUR for the HSCSD call. + + @see TMobileCallAiur */ + TMobileCallAiur iAiur; + /** Current number of receive timeslots for the HSCSD call. */ + TInt iRxTimeSlots; + /** Current number of transmit time slots for the HSCSD call. */ + TInt iTxTimeSlots; + /** Current channel coding for the HSCSD call. */ + TMobileCallTchCoding iCodings; + }; + +/** A typedef'd packaged TMobileCallHscsdInfoV1 for passing through a generic API +function member. */ + typedef TPckg TMobileCallHscsdInfoV1Pckg; + + IMPORT_C TInt GetCurrentHscsdInfo(TDes8& aHSCSDInfo) const; + IMPORT_C void NotifyHscsdInfoChange(TRequestStatus& aReqStatus, TDes8& aHSCSDInfo) const; + + /***********************************************************************************/ + // + // Multimedia Calls + // + /***********************************************************************************/ + + IMPORT_C void AnswerMultimediaCallAsVoice(TRequestStatus& aReqStatus, const TDesC8& aCallParams, TName& aCallName) const; + IMPORT_C void NotifyVoiceFallback(TRequestStatus& aReqStatus, TName& aCallName) const; + + // + // Mobile Alternating Call Functional Unit + // + + IMPORT_C void SwitchAlternatingCall(TRequestStatus& aReqStatus) const; + IMPORT_C void NotifyAlternatingCallSwitch(TRequestStatus& aReqStatus) const; + + /***********************************************************************************/ + // + // MobileCallControl functional unit + // + /***********************************************************************************/ + +/** Mobile call control capabilites. + +Modes: Common */ + enum TMobileCallControlCaps + { + //KCapsData=0x00000001, // taken from etel.h + //KCapsFax=0x00000002, + //KCapsVoice=0x00000004, + //KCapsDial=0x00000008, + //KCapsConnect=0x00000010, + //KCapsHangUp=0x00000020, + //KCapsAnswer=0x00000040, + //KCapsLoanDataPort=0x00000080, + //KCapsRecoverDataPort=0x00000100 + /** Indicates that this call can be put on hold. This implies that the call is currently + active and that there is no other held call. */ + KCapsHold = 0x00000200, + /** Indicates that this call can be resumed. This implies that the call is currently + on hold and that there is no other active call. + + Modes: Common */ + KCapsResume = 0x00000400, + /** Indicates that this call's state can be swapped to the opposite state. This + implies that this call is either active or held. There may be another call + in the opposite state and if this is the case then both calls will be simultaneously + swapped to their opposite state. + + Modes: Common */ + KCapsSwap = 0x00000800, + /** Indicates that this incoming call can be deflected to another destination. + + Modes: GSM/WCDMA */ + KCapsDeflect = 0x00001000, + /** Indicates that this call can be transferred to the remote party of another call. + For this capability to be set there must be one active call and one held or + dialing call. + + Modes: GSM/WCDMA */ + KCapsTransfer = 0x00002000, + /** Indicates that this call can be joined either to another single call to form + a conference call or to an existing conference call. + + Modes: Common */ + KCapsJoin = 0x00004000, + /** Indicates that this call (within a conference call) can go into One to One mode. + This action would put the rest of the conference call on hold. + + Modes: GSM/WCDMA */ + KCapsOneToOne = 0x00008000, + /** Indicates that the user can activate a CCBS request on this failed call set-up. + + Modes: GSM/WCDMA */ + KCapsActivateCCBS = 0x00010000, + /** Indicates that this call is part of an alternating call and the client can call + SwitchAlternatingCall() on this call in order to switch it to its other mode. + + Modes: GSM/WCDMA */ + KCapsSwitchAlternatingCall = 0x00020000, + /** Indicates that this call can use/create a new bearer. This means that multiple + calls (multicall) can be active at the same time using no more that 7 bearers + simultaneously. The other option is to swap with an active call, therefore + it becomes held and shares the same bearer. + + Modes: WCDMA */ + KCapsMulticall = 0x00040000 + }; + + +/** Mobile call events capabilities. + +Modes: Common */ + enum TMobileCallEventCaps + { + /** Indicates that local hold notifications are supported. + + Modes: Common */ + KCapsLocalHold = 0x00000001, + /** Indicates that local resume notifications are supported. + + Modes: Common */ + KCapsLocalResume = 0x00000002, + /** Indicates that local deflect transfer notifications are supported. + + Modes: GSM/WCDMA */ + KCapsLocalDeflectCall = 0x00000004, + /** Indicates that local explicit transfer notifications are supported. + + Modes: GSM/WCDMA */ + KCapsLocalTransfer = 0x00000008, + /** Indicates that remote hold notifications are supported. + + Modes: GSM/WCDMA */ + KCapsRemoteHold = 0x00000010, + /** Indicates that remote resume notifications are supported. + + Modes: GSM/WCDMA */ + KCapsRemoteResume = 0x00000020, + /** Indicates that remote termination notifications are supported. + + Modes: Common */ + KCapsRemoteTerminate = 0x00000040, + /** Indicates that remote conference invocation notifications are supported. + + Modes: GSM/WCDMA */ + KCapsRemoteConferenceCreate = 0x00000080 + }; + + + + class TMobileCallCapsV1 : public RMobilePhone::TMultimodeType +/** Defines the dynamic capabilities of a mobile call. +*/ + { + public: + IMPORT_C TMobileCallCapsV1(); + public: + /** Call control capability information - a bit wise sum of TMobileCallControlCaps + constants */ + TUint32 iCallControlCaps; + /** Call event capability information - a bit wise sum of TMobileCallEventCaps constants. */ + TUint32 iCallEventCaps; + }; + +/** A typedef'd packaged TMobileCallCapsV1 for passing through a generic API function +member. */ + typedef TPckg TMobileCallCapsV1Pckg; + + IMPORT_C TInt GetMobileCallCaps(TDes8& aCaps) const; + IMPORT_C void NotifyMobileCallCapsChange(TRequestStatus& aReqStatus, TDes8& aCaps) const; + + IMPORT_C void Hold(TRequestStatus& aReqStatus) const; + IMPORT_C void Resume(TRequestStatus& aReqStatus) const; + IMPORT_C void Swap(TRequestStatus& aReqStatus) const; + IMPORT_C void DialISV(TRequestStatus& aStatus,const TDesC8& aCallParams,const TTelNumberC& aTelNumber); + IMPORT_C void AnswerIncomingCallISV(TRequestStatus& aStatus,const TDesC8& aCallParams); + +/** The type of call deflection requested. + +@see Deflect() */ + enum TMobileCallDeflect + { + /** Destination is not specified. */ + EDeflectUnspecified, + /** Call will be deflected to voicemail. */ + EDeflectVoicemail, + /** Call will be deflected to the pre-registered number for the call forwarding + service. */ + EDeflectRegisteredNumber, + /** Call will be deflected to the number supplied in the aDestination parameter. */ + EDeflectSuppliedNumber + }; + + IMPORT_C void Deflect(TRequestStatus& aReqStatus, TMobileCallDeflect aDeflectType, const RMobilePhone::TMobileAddress& aDestination) const; + IMPORT_C void Transfer(TRequestStatus& aReqStatus) const; + IMPORT_C void GoOneToOne(TRequestStatus& aReqStatus) const; + +/** The mobile call events. + +Modes: Common */ + enum TMobileCallEvent + { + /** The call has been placed on hold as a result of a local action. + + Modes: Common */ + ELocalHold, + /** The call has been resumed as a result of a local action. + + Modes: Common */ + ELocalResume, + /** The call has been deflected to another remote party as a result of a local action. + + + Modes: GSM/WCDMA */ + ELocalDeflectCall, + /** The call has been transferred to another remote party as a result of a local + action. + + Modes: Common */ + ELocalTransfer, + /** The call has been placed on hold by the remote connected party. + + Modes: GSM/WCDMA */ + ERemoteHold, + /** The call has been resumed by the remote connected party. + + Modes: GSM/WCDMA */ + ERemoteResume, + /** The call has been terminated by the remote party. + + Modes: Common */ + ERemoteTerminated, + /** The call has been joined by the remote connected party to other call(s) to create/add + to a conference call. + + Modes: GSM/WCDMA */ + ERemoteConferenceCreate, + ERemoteTransferring, + ERemoteTransferAlerting, + /** The outgoing call has been barred by the remote party. + + Modes: GSM/WCDMA */ + ERemoteBarred, + /** The call is being forwarded by the remote party. + + Modes: GSM/WCDMA */ + ERemoteForwarding, + /** The call is waiting at the remote end. + + Modes: GSM/WCDMA */ + ERemoteWaiting, + /** The outgoing call has been barred by the local party. + + Modes: GSM/WCDMA */ + ELocalBarred + }; + + IMPORT_C void NotifyCallEvent(TRequestStatus& aReqStatus, TMobileCallEvent& aEvent) const; + +/** Describes the possible call states. */ + enum TMobileCallStatus + { + /** Indicates that the call status is unknown. */ + EStatusUnknown, // same as RCall::EStatusUnknown + /** Indicates that the call is idle. */ + EStatusIdle, // same as RCall::EStatusIdle + EStatusDialling, // same as RCall::EStatusDialling + /** Indicates that the MT call is ringing but not answered yet by the local user. */ + EStatusRinging, // same as RCall::EStatusRinging + /** Indicates that the local user has answered the MT call but the network has not + acknowledged the call connection yet. */ + EStatusAnswering, // same as RCall::EStatusAnswering + /** MO Call: the network notifies to the MS that the remote party is now ringing. */ + EStatusConnecting, // same as RCall::EStatusConnecting + /** Indicates that call is connected and active. */ + EStatusConnected, // same as RCall::EStatusConnected + /** Indicates that call is disconnecting. */ + EStatusDisconnecting, // same as RCall::EStatusHangingUp + /** Indicates that the call is disconnecting with inband data (to enable the network + to send an audio tone), signifying that the call is not to be released until + the user terminates the call. */ + EStatusDisconnectingWithInband, + /** Indicates that call is undergoing temporary channel loss and it may or may not + be reconnected. */ + EStatusReconnectPending, + /** Indicates that the call is connected but on hold. */ + EStatusHold, + /** Indicates that the call is the non-active half of an alternating call. This + call is waiting for its active half or the remote end to switch alternating + call mode. */ + EStatusWaitingAlternatingCallSwitch, + EStatusTransferring, + EStatusTransferAlerting + }; + + IMPORT_C TInt GetMobileCallStatus(TMobileCallStatus& aStatus) const; + IMPORT_C void NotifyMobileCallStatusChange(TRequestStatus& aReqStatus, TMobileCallStatus& aStatus) const; + + IMPORT_C void DialNoFdnCheck(TRequestStatus& aStatus,const TDesC& aTelNumber) const; + IMPORT_C void DialNoFdnCheck(TRequestStatus& aStatus,const TDesC8& aCallParams,const TDesC& aTelNumber) const; + + /** + Contains audio tone events. + */ + enum TMobileCallAudioToneEvent + { + /** + Stop audio tone. + */ + EAudioStop, + /** + Start audio tone. + */ + EAudioStart + }; + + /** + List of 3GPP defined supervisory audio tones taken from technical specification 3GPP TS 22.001 v4.0.0 Annex F. + + This enumeration is based on the signal information element specified in Table 10.5.130/3GPP TS 24.008 v5.15.0 + */ + enum TMobileCallAudioTones + { + /** + No tone. Not defined in specification used for initialisation of + iTone class member variable during TAudioToneV3 construction. + */ + ENoTone, + /** + Dial tone. + */ + EDialTone, + /** + Subscriber busy tone. + */ + ESubscriberBusyTone, + /** + Congestion tone. + */ + ECongestionTone, + /** + Radio path acknowledgement tone. + */ + ERadioPathAcknowledgement, + /** + Radio path not available tone. + */ + ERadioPathNotAvailable, + /** + Call dropped (Mobile Originated only). + */ + EMOCallDropped, + /** + Error special information. + */ + EErrorSpecialInformation, + /** + Number unobtainable. + */ + ENumberUnobtainable, + /** + Authentication failure. + */ + EAuthenticationFailure, + /** + Call waiting. + */ + ECallWaiting, + /** + Ringback tone. + */ + ERingback + }; + + class TAudioToneV3 : public RMobilePhone::TMultimodeType + /** + Audio tone version 1 class. Contains information relating to the call control playing of audio tones. + Tones maybe generated by the network (in-band) or signalled to be played locally by the ME. + @publishedPartner + @released + */ + { + public: + IMPORT_C TAudioToneV3(); + + public: + /** + Indicates whether the tone is starting or stopping playing. + */ + TMobileCallAudioToneEvent iEvent; + /** + Indicates which tone is to be played. + */ + TMobileCallAudioTones iTone; + /** + Indicates whether the tone is played by the network or is to be played locally by the ME. + */ + TBool iPlayedLocally; + }; + + /** + Packaging typedef for TAudioToneV3 class. + */ + typedef TPckg TAudioToneV3Pckg; + + IMPORT_C void NotifyAudioToneEvent(TRequestStatus& aReqStatus, TDes8& aToneInfo) const; + + /***********************************************************************************/ + // + // MobilePrivacy functional unit + // + /***********************************************************************************/ + + IMPORT_C TInt SetPrivacy(RMobilePhone::TMobilePhonePrivacy aPrivacySetting) const; + IMPORT_C void NotifyPrivacyConfirmation(TRequestStatus& aReqStatus, RMobilePhone::TMobilePhonePrivacy& aPrivacySetting) const; + + /***********************************************************************************/ + // + // MobileTrafficChannel function unit + // + /***********************************************************************************/ + +/** Call traffic channels. + +Modes: CDMA */ + enum TMobileCallTch + { + /** The traffic channel of the call is unknown. */ + ETchUnknown, + /** The call has a digital traffic channel */ + ETchDigital, + /** The call has an analog traffic channel */ + ETchAnalog + }; + + IMPORT_C TInt SetTrafficChannel(TMobileCallTch aTchRequest) const; + IMPORT_C void NotifyTrafficChannelConfirmation(TRequestStatus& aReqStatus, TMobileCallTch& aTchType) const; + + /***********************************************************************************/ + // + // MobileCallInformation functional unit + // + /***********************************************************************************/ + + /** + Remote party Identity status. + + Modes: Common + + @see TMobileCallRemotePartyInfoV1 + */ + enum TMobileCallRemoteIdentityStatus + { + /** + The remote party's identity can not be determined. Calling + party's Binary Coded Decimal (BCD) number is not available. + Cause of No CLI is "unavailable". + */ + ERemoteIdentityUnknown, + + /** + The remote party's identity, or BCD number, is available. + However, cause of No CLI has not been set. + */ + ERemoteIdentityAvailable, + + /** + The remote party has suppressed the transmission of its + identity; i.e. their BCD number is not available. Cause of No + CLI is "reject by user". + */ + ERemoteIdentitySuppressed, + /** + The remote party's identity, or BCD number, is available. The + cause of No CLI is "reject by user". + + To be used where the network has specified that displaying of + CLI information of the remote party has been rejected by the + caller but the TMobileCallRemotePartyInfoV1::iRemoteNumber + parameter has been populated with some other string which may + be of use to the client. + */ + ERemoteIdentityAvailableNoCliRejectedByUser, + + /** + The remote party's identity is available; a BCD number is + available. The cause of No CLI is "Interaction with other + service". + + To be used where the network has specified that CLI information + of the remote party is not available due to ineraction with + another service. However, the + TMobileCallRemotePartyInfoV1::iRemoteNumber parameter has been + populated with some other string which may be of use to the + client. + */ + ERemoteIdentityAvailableNoCliInteractionWithOtherService, + /** + The remote party's identity, or BCD number, is unavailable. + Cause of No CLI is "interaction with other service". + */ + ERemoteIdentityUnavailableNoCliInteractionWithOtherService, + + /** + The remote party's identity, or BCD number, is available. + Cause of No CLI is "Coin Line/ Payphone". + + To be used where the network has specified that CLI information + of the remote party is not available as the caller is calling + from a coin/ payphone. However, the + TMobileCallRemotePartyInfoV1::iRemoteNumber parameter has been + populated with some other string which may be of use to the + client. + */ + ERemoteIdentityAvailableNoCliCoinOrPayphone, + /** + The remote party's identity, or BCD number, is not available. + Cause of No CLI is "Coin Line/ Payphone". + */ + ERemoteIdentityUnavailableNoCliCoinOrPayphone, + + /** + The remote party's identity, or BCD number, is available. + Cause of No CLI is "unavailable". + + To be used where the network has specified that the CLI + information of the remote party is not available but the + TMobileCallRemotePartyInfoV1::iRemoteNumber parameter has been + populated with some other string which may be of use to the + client. + */ + ERemoteIdentityAvailableNoCliUnavailable + }; + + + /** + The direction of the mobile call. + + Modes: Common + + @see TMobileCallRemotePartyInfoV1 + */ + enum TMobileCallDirection + { + /** The direction of the call is unknown. */ + EDirectionUnknown, + /** The call was originated by this phone, i.e. it is an outgoing call. */ + EMobileOriginated, + /** The call was terminated by this phone, i.e. it is an incoming call. */ + EMobileTerminated + }; + + enum { KCallingNameSize=80 }; + + + + class TMobileCallRemotePartyInfoV1 : public RMobilePhone::TMultimodeType +/** Defines information about the remote party of a mobile call. +*/ + { + public: + IMPORT_C TMobileCallRemotePartyInfoV1(); + public: + /** Indicates whether the remote party information in the rest of this structure + is valid or not. + + Modes: Common + + @see TMobileCallRemoteIdentityStatus */ + TMobileCallRemoteIdentityStatus iRemoteIdStatus; + /** The direction of the call and hence the role of the remote party, i.e. if the + call is mobile originated then the remote party is the called party whereas + if the call is mobile terminated then the remote party is the calling party. + + Modes: Common + + @see TMobileCallDirection */ + static TMobileCallDirection iDirection; + /** The phone number of the remote party if available. + + Modes: Common + + @see RMobilePhone::TMobileAddress */ + RMobilePhone::TMobileAddress iRemoteNumber; + /** Calling party name available through the CNAP supplementary service (if provisioned). + + + Modes: Common */ + TBuf iCallingName; + }; + +/** A typedef'd packaged TMobileCallRemotePartyInfoV1 for passing through a generic +API function member. */ + typedef TPckg TMobileCallRemotePartyInfoV1Pckg; + + IMPORT_C void NotifyRemotePartyInfoChange(TRequestStatus& aReqStatus, TDes8& aRemotePartyInfo) const; + +/** Determines which fields in the class are valid. + +@see TMobileCallInfoV1 */ + enum TMobileCallInfoFlags + { + /** The iStartTime field is valid in the call info class. + + Modes: COMMON */ + KCallStartTime = 0x00000001, + /** The iDuration field is valid in the call info class. + + Modes: COMMON */ + KCallDuration = 0x00000002, + /** The iCallId field is valid in the call info class. + + Modes: COMMON */ + KCallId = 0x00000004, + /** The iRemoteParty field is valid in the call info class. + + Modes: COMMON */ + KCallRemoteParty = 0x00000008, + /** The iDialledParty field is valid in the call info class. + + Modes: COMMON */ + KCallDialledParty = 0x00000010, + /** The iExitCode field is valid in the call info class. + + Modes: COMMON */ + KCallExitCode = 0x00000020, + /** The iEmergency field is valid in the call info class. + + Modes: COMMON */ + KCallEmergency = 0x00000040, + /** The iForwarded field is valid in the call info class. + + Modes: COMMON */ + KCallForwarded = 0x00000080, + /** The iPrivacy field is valid in the call info class. + + Modes: CDMA */ + KCallPrivacy = 0x00000100, + /** The iTch field is valid in the call info class. + + Modes: CDMA */ + KCallTch = 0x00000200, + /** The iAlternatingCall field is valid in the call info class. + + Modes: GSM/WCDMA */ + KCallAlternating = 0x00000400, + KCallSecurity = 0x00000800 + }; + + + + class TMobileCallInfoV1 : public RMobilePhone::TMultimodeType +/** Defines general information about a mobile call. +*/ + { + public: + IMPORT_C TMobileCallInfoV1(); + public: + /** A bit-wise sum of TMobileCallInfoFlags indicating which of the following optional + fields contain valid data. */ + TUint32 iValid; + /** The call service (voice, data, fax, aux. voice) that this call provides. + + @see RMobilePhone::TMobileService */ + RMobilePhone::TMobileService iService; + /** The mobile call status. + + @see TMobileCallStatus */ + static TMobileCallStatus iStatus; + /** The call ID number assigned to an ongoing call. Will equal -1 if the call does + not have an allocated ID. */ + TInt iCallId; + /** The reason for termination of a finished call. Will equal KErrNone if the call + ended normally and KErrNotFound if the call has not ended. */ + TInt iExitCode; + /** ETrue if the call is an emergency call or EFalse if it is not. */ + static TBool iEmergency; + /** For a MT call, this attribute equals ETrue if the call has been forwarded to + this phone or EFalse if it has not. For a MO call, this attribute equals ETrue + if the call has been forwarded to another destination or EFalse if it has + not. If the phone can not determine whether the call has been forwarded or + not then the attribute will return EFalse. */ + TBool iForwarded; + /** This attribute indicates whether privacy is on or off for this call. + + @see RMobilePhone::TMobilePhonePrivacy */ + RMobilePhone::TMobilePhonePrivacy iPrivacy; + /** This attribute indicates whether this call is an alternating call or not. + + @see RMobilePhone::TMobilePhoneAlternatingCallMode */ + RMobilePhone::TMobilePhoneAlternatingCallMode iAlternatingCall; + /** The current duration of the call. + + @see TTimeIntervalSeconds */ + TTimeIntervalSeconds iDuration; + /** This attribute indicates whether a digital or analog traffic channel is being + used for this call. + + @see TMobileCallTch */ + TMobileCallTch iTch; + /** Information about remote party of a connected call. + + @see TMobileCallRemotePartyInfoV1 */ + TMobileCallRemotePartyInfoV1 iRemoteParty; + /** The original number (including DTMF) dialled for an outgoing call. + + @see RMobilePhone::TMobileAddress */ + RMobilePhone::TMobileAddress iDialledParty; + /** The time and date the call started. + + @see TDateTime */ + TDateTime iStartTime; + /** The name of the call. + + @see TName */ + TName iCallName; + /** The name of the line on which the call is open. + + @see TName */ + TName iLineName; + }; + +/** A typedef'd packaged TMobileCallInfoV1 for passing through a generic API function +member. */ + typedef TPckg TMobileCallInfoV1Pckg; + + class TMobileCallInfoV3 : public TMobileCallInfoV1 + /** + Extends the TMobileCallInfoV1 claass to include extra call info parameter relating to network security. + @publishedPartner + @released + */ + { + public: + IMPORT_C TMobileCallInfoV3(); + public: + /** + Indicates whether Ciphering Status of a call is enabled or disabled. + */ + RMobilePhone::TMobilePhoneNetworkSecurity iSecurity; + }; + + typedef TPckg TMobileCallInfoV3Pckg; + + IMPORT_C TInt GetMobileCallInfo(TDes8& aCallInfo) const; + + /***********************************************************************************/ + // + // MobileCallEmergency functional unit + // + /***********************************************************************************/ + + IMPORT_C void DialEmergencyCall(TRequestStatus& aReqStatus, const TDesC& aNumber) const; + + /***********************************************************************************/ + // + // MobileCallCompletion + // + /***********************************************************************************/ + + IMPORT_C void ActivateCCBS(TRequestStatus& aReqStatus, TInt& aIndex) const; + IMPORT_C TInt RejectCCBS() const; + // + // User-To-User Signalling Functional Unit + // + /***********************************************************************************/ + +/** The UUS capabilities of the call. + +Modes: GSM/WCDMA. */ + enum TMobileCallUUSCaps // UUS capabilities of the call + { + /** Indicates that MS supports UUS1 implicit request. */ + KCapsSetupUUS1Implicit=0x00000001, + /** Indicates that MS supports UUS1 explicit request. */ + KCapsSetupUUS1Explicit=0x00000002, + /** Indicates that MS supports UUS2 request. */ + KCapsSetupUUS2=0x00000004, + /** Indicates that MS supports UUS3 request. */ + KCapsSetupUUS3=0x00000008, + /** Indicates that MS supports activating more than one UUS request at a time. */ + KCapsSetupMultipleUUS=0x00000010, + /** Indicates that UUS1 is active for this call. */ + KCapsActiveUUS1=0x00000020, + /** Indicates that UUS2 is active for this call. */ + KCapsActiveUUS2=0x00000040, + /** Indicates that UUS3 is active for this call. */ + KCapsActiveUUS3=0x00000080 + }; + + IMPORT_C TInt GetUUSCaps(TUint32& aCaps) const; + IMPORT_C void NotifyUUSCapsChange(TRequestStatus& aReqStatus, TUint32& aCaps) const; + +/** UUS Service requests. + +Modes: GSM/WCDMA */ + enum TMobileCallUUSReqs // UUS Service requests + { + /** UUS1 is implicitly requested. */ + KUUS1Implicit=0x00000001, + /** UUS1 is explicitly requested, but it is not mandatory for this call to proceed. */ + KUUS1ExplicitRequested=0x00000002, + /** UUS1 is explicitly requested and it is mandatory for this call to proceed. */ + KUUS1ExplicitRequired=0x00000004, + /** UUS2 is (explicitly) requested, but it is not mandatory for this call to proceed. */ + KUUS2Requested=0x00000008, + /** UUS2 is (explicitly) requested and it is mandatory for this call to proceed. */ + KUUS2Required=0x00000010, + /** UUS3 is (explicitly) requested, but it is not mandatory for this call to proceed. */ + KUUS3Requested=0x00000020, + /** UUS3 is (explicitly) requested and it is mandatory for this call to proceed. */ + KUUS3Required=0x00000040 + }; + + enum + { + KMaxUUISize = 129, + }; + +/** Buffer for the UUI element. */ + typedef TBuf TMobileCallUUI; + + class TMobileCallUUSRequestV1 : public RMobilePhone::TMultimodeType +/** The mobile Call User-to-User Signaling request. +*/ + { + public: + IMPORT_C TMobileCallUUSRequestV1(); + public: + /** This field indicates whether the specified service is requested or required + for the call. */ + TUint iServiceReq; + /** The UUI element. This field only contains data if iServiceReq indicates UUS1. + + @see TMobileCallUUI */ + TMobileCallUUI iUUI; + }; + +/** A typedef'd packaged TMobileCallUUSRequestV1 for passing through a generic API +function member. */ + typedef TPckg TMobileCallUUSRequestV1Pckg; + + IMPORT_C void ActivateUUS(TRequestStatus& aReqStatus, const TDesC8& aUUSRequest) const; + IMPORT_C void SendUUI(TRequestStatus& aReqStatus, TBool aMore, const TMobileCallUUI& aUUI) const; + IMPORT_C void ReceiveUUI(TRequestStatus& aReqStatus, TMobileCallUUI& aUUI) const; + IMPORT_C void HangupWithUUI(TRequestStatus& aReqStatus, const TMobileCallUUI& aUUI) const; + IMPORT_C void AnswerIncomingCallWithUUI(TRequestStatus& aReqStatus, const TDesC8& aCallParams, const TMobileCallUUI& aUUI) const; + + /***********************************************************************************/ + // + // Etel 3rd Party v1.0 Parameter classes + // + /***********************************************************************************/ + + class TEtel3rdPartyMobileCallParamsV1 : public RCall::TCallParams +/** Defines the parameters used to set-up of a call originated from an ETel 3rd Party client. +@publishedPartner +@released +*/ + { + public: + IMPORT_C TEtel3rdPartyMobileCallParamsV1(); + public: + /** Call Id restriction setting to be used for this call. + + @see TMobileCallIdRestriction */ + TMobileCallIdRestriction iIdRestrict; + /** Specifies whether this call attempt is user initiated (EFalse) or a client initiated + redial (ETrue). */ + TBool iAutoRedial; + }; + +/** A typedef'd packaged TEtel3rdPartyMobileCallParamsV1 for passing through a generic API +function member. */ + typedef TPckgTEtel3rdPartyMobileCallParamsV1Pckg; + + +private: + RMobileCall(const RMobileCall& aCall); + CMobileCallPtrHolder* iMmPtrHolder; +protected: + IMPORT_C void ConstructL(); + IMPORT_C void Destruct(); + }; + + +/*********************************************************/ +// +// Line based functionality (RMobileLine) +// +/*********************************************************/ + + + +class CMobileLinePtrHolder; + +class RMobileLine : public RLine +/** Provides access to the functionality associated with a specific mobile line. +*/ + { +public: + IMPORT_C RMobileLine(); + + /***********************************************************************************/ + // + // MobileLineStatus functional unit + // + /***********************************************************************************/ + + IMPORT_C TInt GetMobileLineStatus(RMobileCall::TMobileCallStatus& aStatus) const; + IMPORT_C void NotifyMobileLineStatusChange(TRequestStatus& aReqStatus, RMobileCall::TMobileCallStatus& aStatus) const; + + // + // Additional Caps + // +/** Enumerated auxiliary capabilities. */ + enum TMobileLineAdditionalCaps + { + /** Indicates whether the line is a Primary or Auxiliary voice line offset added + so that core Etel and additional line caps can be returned in one TUint. */ + KCapsAuxVoice=0x00000008 + }; + +private: + RMobileLine(const RMobileLine& aLine); + CMobileLinePtrHolder* iMmPtrHolder; +protected: + IMPORT_C void ConstructL(); + IMPORT_C void Destruct(); + }; + + +/*********************************************************/ +// +// SMS Messaging (RMobileSmsMessaging) +// +/*********************************************************/ + + + +class CMobilePhoneSmspList; +class CSmsMessagingPtrHolder; + +class RMobileSmsMessaging : public RTelSubSessionBase +/** Provides client access to SMS messaging functionality provided by TSY. +@publishedPartner +@released +*/ + { +public: + + friend class CRetrieveMobilePhoneSmspList; + + IMPORT_C RMobileSmsMessaging(); + + IMPORT_C TInt Open(RMobilePhone& aPhone); + IMPORT_C void Close(); + +/** Defines capabilities of SMS messaging. + +Modes: GSM/WCDMA */ + enum TMobileSmsModeCaps + { + /** SMS is supported in GSM and WCDMA modes. SMS are sent across MM ETel API in + a GSM 03.40 TPDU format. + + Modes: GSM/WCDMA */ + KCapsGsmSms=0x00000001, + /** SMS is supported in CDMA mode. SMS are sent across MM ETel API in a IS-637 + Teleservice message PDU format. + + Modes: CDMA */ + KCapsCdmaSms=0x00000002 + }; + +/** Defines SMS control capabilities. + +Modes: Common */ + enum TMobileSmsControlCaps + { + /** TSY supports receiving incoming SMS that have been stored and acknowledged + by the phone prior to forwarding to the TSY. If this flag is set then KCapsReceiveEither + will not be set and the client can receive stored messages only while the + TSY-phone link is in "receive stored" mode. + + Modes: Common */ + KCapsReceiveStored=0x00000001, + /** TSY supports receiving incoming SMS that have been acknowledged by the phone + but have NOT already been stored. It is the client's responsibility to do + the storage. If this flag is set then KCapsReceiveEither will not be set and + the client can receive unstored messages only while the TSY-phone link is + in "receive unstored with phone ack" mode. + + Modes: Common */ + KCapsReceiveUnstoredPhoneAck=0x00000002, + /** TSY supports receiving incoming SMS that have NOT already been stored and acknowledged + by the phone. It is the client's responsibility to do both the storage and + the acknowledgment or rejection. If this flag is set then KCapsReceiveEither + will not be set and the client can receive unstored messages only while the + TSY-phone link is in "receive unstored with client ack" mode. + + Modes: Common */ + KCapsReceiveUnstoredClientAck=0x00000004, + /** TSY supports receiving either stored or unstored incoming SMS at any time. + If this flag is set then any other KCapsReceive... flags will not be set and + the client can receive stored or unstored messages while the TSY-phone link + is in "receive either" mode. + + Modes: Common */ + KCapsReceiveEither=0x00000008, + /** TSY supports creating a default acknowledgment or rejection TPDU using only + a "cause code" supplied by the client. If this flag is not set then the client + must supply the full ack or nack TPDU if it calls RMobileSmsMessaging::AckSmsStored() + or RMobileSmsMessaging::NackSmsStored(). + + Modes: Common */ + KCapsCreateAck=0x00000010, + /** TSY supports sending SMS messages but does not support returning the service + centre's acknowledgment of the submitted message to the client. + + Modes: Common */ + KCapsSendNoAck=0x00000020, + /** TSY supports sending SMS messages and also supports returning the service centre's + acknowledgment of the submitted message to the client. + + Modes: GSM/WCDMA */ + KCapsSendWithAck=0x00000040, + /** TSY supports retrieval of the SMS parameter list. + + Modes: GSM/WCDMA */ + KCapsGetSmspList=0x00000080, + /** TSY supports storage of the SMS parameter list + + Modes: GSM/WCDMA */ + KCapsSetSmspList=0x00000100 + }; + + class TMobileSmsCapsV1 : public RMobilePhone::TMultimodeType +/** Defines capabilities of SMS messaging. +*/ + { + public: + IMPORT_C TMobileSmsCapsV1(); + + /** Sum of TMobileSmsModeCaps constants. + + Modes: Common */ + TUint32 iSmsMode; + /** Sum of TMobileSmsControlCaps constants. + + Modes: Common */ + TUint32 iSmsControl; + }; + +/** A typedef'd packaged TMobileSmsCapsV1 for passing through a generic API member +function. */ + typedef TPckg TMobileSmsCapsV1Pckg; + + IMPORT_C TInt GetCaps(TDes8& aCaps) const; + + // Definitions for sizes of TPDU and User Data fields + enum + { + KGsmTpduSize = 165, // 140 bytes user data + 25 bytes TPDU header + KCdmaTpduSize = 256 // Max size of Bearer Data in Transport Layer message + }; + +/** A typedef'd buffer for GSM or WCDMA message data. */ + typedef TBuf8 TMobileSmsGsmTpdu; +/** A typedef'd buffer for CDMA message data. */ + typedef TBuf8 TMobileSmsCdmaTpdu; + + /***********************************************************************************/ + // + // Enum used by TSY to distinguish which SMS attribute class is used by client + // + /***********************************************************************************/ + +/** Used by TSY to distinguish which SMS attribute class is used by client. + +Modes: Common + +@see RMobileSmsMessaging::TMobileSmsSendAttributesV1 */ + enum TMobileSmsAttributeExtensionId + { + /** The iExtensionId contents indicate that the packaged class is a TMobileSmsAttributesV1. */ + KETelMobileSmsAttributesV1=KETelExtMultimodeV1, + /** The iExtensionId contents indicate that the packaged class is a TMobileSmsReceiveAttributesV1. */ + KETelMobileSmsReceiveAttributesV1, + /** The iExtensionId contents indicate that the packaged class is a TMobileSmsSendAttributesV1. */ + KETelMobileSmsSendAttributesV1, + /** The iExtensionId contents indicate that the packaged class is a TMobileSmsCdmaSendAttributesV4. */ + KETelMobileSmsCdmaSendAttributesV4=KETelExtMultimodeV4 + }; + +/** Defines common attributes of all SMS messages. + +Modes: CDMA + +@see TMobileSmsAttributesV1 */ + enum TMobileSmsAttributeFlags + { + /** The iCdmaTeleservice field is valid in the attribute class. + + Modes: CDMA */ + KCdmaTeleservice = 0x00000001, + /** The iCdmaServiceCategory field is valid in the attribute class. + + Modes: CDMA */ + KCdmaServiceCategory = 0x00000002, + /** The iGsmServiceCentre field is valid in the attribute class. + + Modes: GSM/WCDMA */ + KGsmServiceCentre = 0x00000004, + /** The iDataFormat field is valid in the attribute class. + + Modes: Common */ + KSmsDataFormat = 0x00000008, + /** The iOriginator or iDestination field is valid in the attribute class. + + Modes: Common */ + KRemotePartyInfo = 0x00000010, + /** The iStatus field is valid in the attribute class. + + Modes: Common */ + KIncomingStatus = 0x00000020, + /** The iStore and iStoreIndex fields are valid in the attribute class. + + Modes: Common */ + KStorageLocation = 0x00000040, + /** The iMsgRef field is valid in the attribute class. + + Modes: Common */ + KMessageReference = 0x00000080, + /** The iSubmitReport field is valid in the attribute class. + + Modes: GSM/WCDMA */ + KGsmSubmitReport = 0x00000100, + /** The iMore field is valid in the attribute class. + + Modes: Common */ + KMoreToSend = 0x00000200, + /** Indicates to the TSY that it should keep the traffic channel open since there is + another message ready to be sent immediately after this one (typically used when + sending messages to multiple recipients). TSY should then keep the channel open + until a message is sent with this bit cleared. + + Modes: CDMA */ + KCdmaKeepChannelOpen = 0x00000400, + /** Indicates to the TSY that it must wait for the Transport Layer Acknowledgement from the network + + Modes: CDMA */ + KCdmaTLAckRequired = 0x00000800, + /** The iAddressAuthentication field is valid in the attribute class. + + Modes: CDMA */ + KCdmaAddressAuthentication = 0x00001000 + }; + +/** Defines the SMS data format. + +Modes: Common */ + enum TMobileSmsDataFormat + { + /** The format is not specified. + + Modes: Common */ + EFormatUnspecified, + /** The message data format complies to a SMS TPDU coded as octets according to + GSM 03.40. + + Modes: GSM/WCDMA */ + EFormatGsmTpdu, + /** The message data format complies to a SMS Teleservice PDU coded as octets according + to IS-637. + + Modes: CDMA */ + EFormatCdmaTpdu + }; + + class TMobileSmsAttributesV1 : public RMobilePhone::TMultimodeType + /** Defines common attributes of all SMS messages. + @publishedPartner + @released + */ + { + protected: + TMobileSmsAttributesV1(); + public: + /** The bit-mask flags from TMobileSmsAttributeFlags indicating which attributes + are present in this instance. + + Modes: Common */ + TUint32 iFlags; + /** The format of the message data buffer . + + Modes: Common + + @see TMobileSmsDataFormat */ + TMobileSmsDataFormat iDataFormat; + /** The teleservice this message belongs to, coded according to SMS teleservice + identifier values table in TIA/EIA-41-D. + + Modes: CDMA */ + TInt iCdmaTeleservice; + /** The service category this message belongs to. + + Modes: CDMA */ + TInt iCdmaServiceCategory; + /** The GSM service centre used for this SMS. + + Modes: GSM/WCDMA + + @see RMobilePhone::TMobileAddress */ + RMobilePhone::TMobileAddress iGsmServiceCentre; + }; + +/** A typedef'd packaged TMobileSmsAttributesV1 for passing through a generic +API member function. */ + typedef TPckg TMobileSmsAttributesV1Pckg; + +/** Defines attributes of incoming SMS messages. + +Modes: Common */ + enum TMobileSmsIncomingStatus + { + /** The status of the incoming SMS is unknown. */ + EMtMessageUnknownStatus, + /** The incoming SMS is not stored phone-side but has already been acknowledged + by the phone. */ + EMtMessageUnstoredPhoneAck, + /** The incoming SMS is not stored phone-side and needs to be acknowledged by the + client. */ + EMtMessageUnstoredClientAck, + /** The incoming SMS is stored phone-side. */ + EMtMessageStored + }; + + class TMobileSmsReceiveAttributesV1 : public TMobileSmsAttributesV1 + /** Defines attributes of incoming SMS messages. + @publishedPartner + @released + */ + { + public: + IMPORT_C TMobileSmsReceiveAttributesV1(); + public: + /** Indicates the status of the incoming message -whether it is stored phone-side + or has been acknowledged by the phone. + + Modes: Common + + @see TMobileSmsIncomingStatus */ + TMobileSmsIncomingStatus iStatus; // indicates if MT message is stored phone-side + /** If the message is stored phone-side, indicates the index (within the phone-side + store) where the message is stored. + + Modes: Common */ + TInt iStoreIndex;// used if MT message is stored phone-side + /** If the message is stored phone-side, indicates the name of the appropriate + phone-side store. + + Modes: Common + + @see RMobilePhone::TMobileName */ + RMobilePhone::TMobileName iStore; // used if MT message is stored phone-side + /** The address of the originator of the SMS. + + Modes: Common + + @see RMobilePhone::TMobileAddress */ + RMobilePhone::TMobileAddress iOriginator; + }; + +/** A typedef'd packaged TMobileSmsReceiveAttributesV1 for passing through a generic +API member function. */ + typedef TPckg TMobileSmsReceiveAttributesV1Pckg; + + + + class TMobileSmsSendAttributesV1 : public TMobileSmsAttributesV1 + /** Defines attributes of sent SMS messages. + @publishedPartner + @released */ + { + public: + IMPORT_C TMobileSmsSendAttributesV1(); + public: + /** The message reference assigned to a sent message. + + Modes: Common */ + TUint16 iMsgRef; + /** A boolean indicating whether the client is going to send another SMS immediately + after this one. Equals ETrue if this is the case, EFalse if it is not. + + Modes: Common */ + TBool iMore; + /** The SMS-SUBMIT-REPORT TPDU received from network in response to a sent message. + + Modes: GSM/WCDMA + + @see TMobileSmsGsmTpdu */ + TMobileSmsGsmTpdu iSubmitReport; + /** The address of the destination of the SMS. + + Modes: Common + + @see RMobilePhone::TMobileAddress */ + RMobilePhone::TMobileAddress iDestination; + }; + +/** A typedef'd packaged TMobileSmsSendAttributesV1 for passing through a generic +API member function. */ + typedef TPckg TMobileSmsSendAttributesV1Pckg; + + class TMobileSmsCdmaSendAttributesV4 : public TMobileSmsAttributesV1 + /** + Defines attributes of sent SMS messages (CDMA only). + + @publishedPartner + @released + */ + { + public: + IMPORT_C TMobileSmsCdmaSendAttributesV4(); + public: + /** + The message id allocated by the SMS stack. The TSY should + retrieve the value from iCdmaTeleserviceId to determine + which teleservice this message id corresponds to. + */ + TUint16 iMsgRef; + /** Indicates whether the client is going to send another + PDU immediately after this one (typically used when sending + messages of more than one PDU). Equals ETrue if at least + one more PDU is needed to complete the message and EFalse + otherwise. + */ + TBool iMore; + /** TPDU received from network in response to a sent message */ + TMobileSmsCdmaTpdu iTLAck; + /** The address of the destination of the SMS. */ + RMobilePhone::TMobileAddress iDestination; + /** Transport layer authentication parameter */ + TUint32 iAddressAuthentication; + }; + +/** A typedef'd packaged TMobileSmsCdmaSendAttributesV4 for passing through a generic +API member function. */ + typedef TPckg TMobileSmsCdmaSendAttributesV4Pckg; + + // + // Setting up the storage & acknowledgement mode + // + +/** Defines the SMS receive modes. + +Modes: Common */ + enum TMobileSmsReceiveMode + { + /** Receive mode is unspecified and phone will use its default. */ + EReceiveModeUnspecified, + /** Phone will store and acknowledge all incoming messages before passing them + onto TSY. */ + EReceiveUnstoredPhoneAck, // client stores but phone acknowledges message + /** Phone will acknowledge but NOT store all incoming messages before passing them + onto TSY. It is client's responsibility to store the message. */ + EReceiveUnstoredClientAck, // client acknowledges and stores message + /** Phone will NOT acknowledge or store any incoming messages before passing them + onto TSY. It is client's responsibility to attempt storage and then either + acknowledge or reject the message. */ + EReceiveStored, // phone acknowledges and store message + /** Phone may pass on either stored or unstored messages to TSY. It is client's + responsibility to check RMobileSmsMessaging::TMobileSmsReceiveAttributesV1::iStatus + to determine what action(s) the client needs to take for a message. */ + EReceiveEither // client deals with stored & unstored messages + }; + + IMPORT_C void SetReceiveMode(TRequestStatus& aReqStatus, TMobileSmsReceiveMode aReceiveMode) const; + IMPORT_C TInt GetReceiveMode(TMobileSmsReceiveMode& aReceiveMode) const; + IMPORT_C void NotifyReceiveModeChange(TRequestStatus& aStatus, TMobileSmsReceiveMode& aReceiveMode); + + /***********************************************************************************/ + // + // Incoming SMS + // + /***********************************************************************************/ + + IMPORT_C void ReceiveMessage(TRequestStatus& aReqStatus, TDes8& aMsgData, TDes8& aMsgAttributes) const; + + /***********************************************************************************/ + // + // Responding to incoming SMS + // + /***********************************************************************************/ + + IMPORT_C void AckSmsStored(TRequestStatus& aReqStatus, const TDesC8& aMsgData, TBool aFull=EFalse) const; + IMPORT_C void NackSmsStored(TRequestStatus& aReqStatus, const TDesC8& aMsgData, TInt aRpCause) const; + IMPORT_C void ResumeSmsReception(TRequestStatus& aReqStatus) const; + + /***********************************************************************************/ + // + // Outgoing SMS + // + /***********************************************************************************/ + + IMPORT_C void SendMessage(TRequestStatus& aReqStatus, const TDesC8& aMsgData, TDes8& aMsgAttributes) const; + IMPORT_C void SendMessageNoFdnCheck(TRequestStatus& aReqStatus, const TDesC8& aMsgData, TDes8& aMsgAttributes) const; + +/** Defines the SMS bearer. + +Modes: GSM */ + enum TMobileSmsBearer + { + /** SMS messages will only be sent over a packet-switched (GPRS) network. */ + ESmsBearerPacketOnly, + /** SMS messages will only be sent over a circuit-switched (GSM) network. */ + ESmsBearerCircuitOnly, + /** SMS messages will be sent over the packet-switched (GPRS) network if possible, + otherwise over circuit-switched (GSM) network. */ + ESmsBearerPacketPreferred, + /** SMS messages will be sent over the circuit-switched (GSM) network if possible, + otherwise over packet-switched (GPRS) network. */ + ESmsBearerCircuitPreferred + }; + + IMPORT_C void SetMoSmsBearer(TRequestStatus& aReqStatus, TMobileSmsBearer aBearer) const; + IMPORT_C TInt GetMoSmsBearer(TMobileSmsBearer& aBearer) const; + IMPORT_C void NotifyMoSmsBearerChange(TRequestStatus& aReqStatus, TMobileSmsBearer& aBearer); + + /***********************************************************************************/ + // + // Get information on phone-side SMS storage + // + /***********************************************************************************/ + + IMPORT_C TInt EnumerateMessageStores(TInt& aCount) const; + IMPORT_C void GetMessageStoreInfo(TRequestStatus& aReqStatus, TInt aIndex, TDes8& aInfo) const; + + /***********************************************************************************/ + // + // Read/Write SMS parameters to phone-side storage + // + /***********************************************************************************/ + + enum { KMaxSmspTextSize=30 }; + +/** Defines the valid SMS parameters store. + +Modes: GSM/WCDMA + +@see TMobileSmspEntryV1 */ + enum TMobileSmspStoreValidParams + { + /** The entry includes a valid iDestination field. */ + KDestinationIncluded=0x00000001, + /** The entry includes a valid iServiceCentre field. */ + KSCAIncluded=0x00000002, + /** The entry includes a valid iProtocolId field. */ + KProtocolIdIncluded=0x00000004, + /** The entry includes a valid iDcs field. */ + KDcsIncluded=0x00000008, + /** The entry includes a valid iValidityPeriod field. */ + KValidityPeriodIncluded=0x00000010 + }; + + class TMobileSmspEntryV1 : public RMobilePhone::TMultimodeType + + /** Defines a set of SMS parameters. + @publishedPartner + @released + */ + { + public: + IMPORT_C TMobileSmspEntryV1(); + public: + void InternalizeL(RReadStream& aStream); + void ExternalizeL(RWriteStream& aStream) const; + public: + /** The slot index where this SMSP entry is stored in the SIM's SMSP file. */ + TInt iIndex; + /** A bit-wise sum of the constants defined in TMobileSmspStoreValidParams, that + specifies which parameters are valid within this entry. */ + TUint32 iValidParams; + /** Default protocol ID. Coded according to GSM 03.40. */ + TUint8 iProtocolId; + /** Default data coding scheme. Coded according to GSM 03.40. */ + TUint8 iDcs; + /** Default validity period, in relative format and coded on 8 bits as defined + by GSM 03.40. */ + TUint8 iValidityPeriod; + /** Reserved for future use. */ + TUint8 iReservedFiller; + /** Default destination for outgoing SMS. + + @see RMobilePhone::TMobileAddress */ + RMobilePhone::TMobileAddress iDestination; + /** Default service centre for outgoing SMS. + + @see RMobilePhone::TMobileAddress */ + RMobilePhone::TMobileAddress iServiceCentre; + /** The alpha-tag associated with this SMSP entry, expressed as Unicode characters. */ + TBuf iText; + }; + +/** A typedef'd packaged TMobileSmspEntryV1 for passing through a generic API member +function. */ + typedef TPckg TMobileSmspEntryV1Pckg; + IMPORT_C void StoreSmspListL(TRequestStatus& aReqStatus, CMobilePhoneSmspList* aSmspList) const; + IMPORT_C void NotifySmspListChange(TRequestStatus& aReqStatus) const; + +private: + RMobileSmsMessaging(const RMobileSmsMessaging&); + CSmsMessagingPtrHolder* iSmsMessagingPtrHolder; +protected: + IMPORT_C void ConstructL(); + IMPORT_C void Destruct(); + }; + + +/*********************************************************/ +// +// Broadcast Messaging (RMobileBroadcastMessaging) +// +/*********************************************************/ + + + +class CMobilePhoneBroadcastIdList; + +class CCbsMessagingPtrHolder; +class RMobileBroadcastMessaging : public RTelSubSessionBase +/** This sub-session provides access to the broadcast message services provided +by GSM/WCDMA and CDMA networks. + +Clients will open a RMobileBroadcastMessaging sub-session and then wait for +incoming broadcast messages. The broadcast messages received can depend upon +a "message filter" which defines the languages and/or identifiers of acceptable +(or unacceptable) messages. This sub-session and the function members within +this section must be supported if the TSY indicates that it supports the MobileBroadcastMessaging +functional unit. + +@publishedPartner +@released*/ + { +public: + + friend class CRetrieveMobilePhoneBroadcastIdList; + + IMPORT_C RMobileBroadcastMessaging(); + + IMPORT_C TInt Open(RMobilePhone& aPhone); + IMPORT_C void Close(); + + /***********************************************************************************/ + // + // Broadcast messaging capabilities + // + /***********************************************************************************/ + +/** Broadcast capabilities. + +Modes:GSM/WCDMA */ + enum TMobileBroadcastModeCaps + { + /** GSM 03.41 cell broadcast messages are supported. + + Modes:GSM/WCDMA */ + KCapsGsmTpduFormat = 0x00000001, + /** IS-637-A broadcast messages are supported. + + Modes:CDMA */ + KCapsCdmaTpduFormat = 0x00000002, + /** 3GPP 25.324 Release 4 cell broadcast messages are supported. + + Modes: WCDMA */ + KCapsWcdmaTpduFormat = 0x00000004 + }; + +/** Broadcast message filter capabilities. + +Modes: Common + +@see RMobileBroadcastMessaging::GetLanguageFilter() */ + enum TBroadcastMessagingFilterCaps + { + /** Phone supports switching broadcast messages on or off. This means the EbroadcastAcceptNone + and EBroadcastAcceptAll settings of TMobilePhoneBroadcastFilter are supported. + + Modes: Common */ + KCapsSimpleFilter = 0x00000001, + /** Phone supports filtering of broadcast messages depending upon their language. + The language filter is a list of languages used only for broadcast filtering. + + Modes: Common + + @see RMobileBroadcastMessaging::GetLanguageFilter() */ + KCapsLangFilter = 0x00000002, + /** Phone supports filtering of broadcast messages depending upon their subject. + The subject of a message is identified in GSM/WCDMA mode by the Cell Broadcast + Message Identifier (CBMI) and in CDMA mode by the Service Category. + + Modes: Common */ + KCapsIdFilter = 0x00000004 + }; + + + + class TMobileBroadcastCapsV1 : public RMobilePhone::TMultimodeType + /** Defines capabilities of Broadcast messaging. + @publishedPartner + @released + */ + { + public: + IMPORT_C TMobileBroadcastCapsV1(); + public: + /** Sum of TMobileBroadcastModeCaps constants. + + Modes: GSM/WCDMA */ + TUint32 iModeCaps; + /** Sum of TBroadcastMessagingFilterCaps constants. + + Modes: GSM/WCDMA */ + TUint32 iFilterCaps; + }; + +/** A typedef'd packaged TMobileBroadcastCapsV1 for passing through a generic API +function member. */ + typedef TPckg TMobileBroadcastCapsV1Pckg; + + IMPORT_C TInt GetCaps(TDes8& aCaps) const; + +/** Defines the broadcast attributes. + +Modes: Common */ + enum TMobileBroadcastAttributeFlags + { + /** The iFormat field is valid in the attribute class. + + Modes: Common */ + KBroadcastDataFormat = 0x00000001, + /** The iServiceCategory field is valid in the attribute class. + + Modes: CDMA */ + KCdmaServiceCategory = 0x00000002 + }; + +/** The mobile broadcast data format, used byTMobileBroadcastAttributesV1. + +Modes: Common */ + enum TMobileBroadcastDataFormat + { + /** The message data format is not specified. + + Modes: Common */ + EFormatUnspecified, + /** The message data format complies to a Cell Broadcast TPDU coded as 88 octets + (6 for header and 82 for message data) according to GSM 03.41. + + Modes: GSM/WCDMA */ + EFormatGsmTpdu, + /** The message data format complies to IS-637-A encoding of the Bearer Data parameter + within the Transport Layer's SMS-Broadcast message. + + Modes: CDMA */ + EFormatCdmaTpdu, + /** The message data format complies to a Cell Broadcast TPDU coded as 1252 octets + (6 for header and a maximum of 1246 for message data) according to 3GPP 25.324. + + Modes: WCDMA */ + EFormatWcdmaTpdu + }; + + + + class TMobileBroadcastAttributesV1 : public RMobilePhone::TMultimodeType + /** Defines attributes of a Broadcast message. + @publishedPartner + @released + */ + { + public: + IMPORT_C TMobileBroadcastAttributesV1(); + public: + /** The bit-mask flags indicating which attributes are present in this instance. + + Modes: Common + + @see TMobileBroadcastAttributeFlags */ + TUint32 iFlags; + /** Format of the message data buffer. + + Modes: Common + + @see TMobileBroadcastDataFormat */ + TMobileBroadcastDataFormat iFormat; + /** Service category of the message. + + Modes: CDMA */ + TInt iServiceCategory; + }; + +/** A typedef'd packaged TMobileBroadcastAttributesV1 for passing through a generic +API function member. */ + typedef TPckg TMobileBroadcastAttributesV1Pckg; + + + + + class TMobileBroadcastAttributesV2 : public TMobileBroadcastAttributesV1 + /** Defines attributes of a UMTS Broadcast message for version v2.0 of the API. + @publishedPartner + @released + */ + { + public: + IMPORT_C TMobileBroadcastAttributesV2(); + public: + /** The number of pages that the current broadcast message consists of. The maximum + number of pages for WCDMA Broadcast messages is 15. */ + TInt iNumberOfPages; + /** This parameter is used to store the message type for this broadcast message. */ + TUint8 iMessageType; + /** This parameter is used to store the message id for this broadcast message. + + This parameter is used to store the serial number for this broadcast message. + + This parameter is used to store the data coding scheme for this broadcast + message. */ + TUint16 iMessageId; + /** This parameter is used to store the serial number for this broadcast message. */ + TUint16 iSerialNum; + /** This parameter is used to store the data coding scheme for this broadcast message. */ + TUint8 iDCS; + }; + +/** A typedef'd packaged TMobileBroadcastAttributesV1 for passing through a generic +API function member. */ + typedef TPckg TMobileBroadcastAttributesV2Pckg; + + /***********************************************************************************/ + // + // Receiving broadcast messages + // + /***********************************************************************************/ + + /** A constant which defines the length of the buffer to be passed to ReceiveMessage. + + This constant should be used for all message types: GSM, CDMA and WCDMA.*/ + enum + { + KBroadcastPageSize = 88 + }; + + /** Buffer for received messages. + + This buffer should be used for all message types: GSM, CDMA and WCDMA.*/ + typedef TBuf8 TBroadcastPageData; + + /** Old buffer sizes. KBroadcastPageSize should be used instead. */ + enum + { + KGsmBroadcastDataSize = KBroadcastPageSize, + KCdmaBroadcastDataSize = KBroadcastPageSize, + KWCdmaBroadcastPageSize = KBroadcastPageSize + }; + + /** Buffer for GSM messages. TBroadcastPageData should be used instead. */ + typedef TBuf8 TGsmBroadcastMessageData; + /** Buffer for CDMA messages. TBroadcastPageData should be used instead. */ + typedef TBuf8 TCdmaBroadcastMessageData; + /** Buffer for WCDMA messages. TBroadcastPageData should be used instead. */ + typedef TBuf8 TWCdmaBroadcastPageData; + + IMPORT_C void ReceiveMessage(TRequestStatus& aReqStatus, TDes8& aMsgData, TDes8& aMsgAttributes) const; + + /***********************************************************************************/ + // + // Filters + // + /***********************************************************************************/ + +/** The filter settings of the mobile phone. + +Modes: Common */ + enum TMobilePhoneBroadcastFilter + { + /** The phone does not have a filter setting. */ + EBroadcastFilterUnspecified, + /** The phone is not accepting any broadcast messages. */ + EBroadcastAcceptNone, + /** The phone is accepting all broadcast messages. */ + EBroadcastAcceptAll, + /** The phone is accepting those broadcast messages included within the language + and identifier filters. */ + EBroadcastAcceptFilter, + /** The phone is rejecting those broadcast messages included within the language + or identifier filters. */ + EBroadcastRejectFilter + }; + + IMPORT_C TInt GetFilterSetting(TMobilePhoneBroadcastFilter& aSetting) const; + IMPORT_C void SetFilterSetting(TRequestStatus& aReqStatus, TMobilePhoneBroadcastFilter aSetting) const; + IMPORT_C void NotifyFilterSettingChange(TRequestStatus& aReqStatus, TMobilePhoneBroadcastFilter& aSetting) const; + + IMPORT_C void GetLanguageFilter(TRequestStatus& aReqStatus, TDes16& aLangFilter) const; + IMPORT_C void SetLanguageFilter(TRequestStatus& aReqStatus, const TDesC16& aLangFilter) const; + IMPORT_C void NotifyLanguageFilterChange(TRequestStatus& aReqStatus, TDes16& aLangFilter) const; + + class TMobileBroadcastIdEntryV1 : public RMobilePhone::TMultimodeType + /** In GSM - defines a Cell Broadcast Message Identifier (CBMI) list entry. In + CDMA - defines a Service Category list entry. + @publishedPartner + @released + */ + { + public: + void InternalizeL(RReadStream& aStream); + void ExternalizeL(RWriteStream& aStream) const; + IMPORT_C TMobileBroadcastIdEntryV1(); + public: + /** The value of the message identifier. */ + TUint16 iId; + }; + +/** Defines the broadcast types. */ + enum TMobileBroadcastIdType + { + /** GSM broadcast. */ + EGsmBroadcastId, + /** CDMA broadcast. */ + ECdmaBroadcastId + }; + + IMPORT_C void StoreBroadcastIdListL(TRequestStatus& aReqStatus, CMobilePhoneBroadcastIdList* aIdList, TMobileBroadcastIdType aIdType); + IMPORT_C void NotifyBroadcastIdListChange(TRequestStatus& aReqStatus) const; + +private: + RMobileBroadcastMessaging(const RMobileBroadcastMessaging&); + CCbsMessagingPtrHolder* iCbsMessagingPtrHolder; +protected: + IMPORT_C void ConstructL(); + IMPORT_C void Destruct(); + }; + +/*********************************************************/ +// +// USSD Messaging (RMobileUssdMessaging) +// +/*********************************************************/ + + + +class CUssdMessagingPtrHolder; +class RMobileUssdMessaging : public RTelSubSessionBase +/** Provides client access to USSD functionality provided by TSY. +*/ + { +public: + IMPORT_C RMobileUssdMessaging(); + + IMPORT_C TInt Open(RMobilePhone& aPhone); + IMPORT_C void Close(); + +/** Defines the USSD Messaging Format Capabilities. + +Modes: GSM/WCDMA */ + enum TMobileUssdFormatCaps + { + /** USSD messages coded as a packed string within 160 octets, as defined for a + ussd-String within GSM 04.80 and GSM 03.38. + + Modes: GSM/WCDMA */ + KCapsPackedString=0x00000001 + }; + +/** Defines the USSD Messaging Type Capabilities. + +Modes: GSM/WCDMA */ + enum TMobileUssdTypeCaps + { + /** Outgoing USSD messages are supported. + + Modes: GSM/WCDMA */ + KCapsMOUssd=0x00000001, + /** Incoming USSD messages are supported. + + Modes: GSM/WCDMA */ + KCapsMTUssd=0x00000002 + }; + + + + class TMobileUssdCapsV1 : public RMobilePhone::TMultimodeType + /** Defines capabilities of USSD messaging. + @publishedPartner + @released + */ + { + public: + IMPORT_C TMobileUssdCapsV1(); + /** Sum of TMobileUssdFormatCaps constants. + + Modes: GSM/WCDMA + + @see TMobileUssdFormatCaps */ + TUint32 iUssdFormat; + /** Sum of TMobileUssdTypeCaps constants. + + Modes: GSM/WCDMA + + @see TMobileUssdTypeCaps */ + TUint32 iUssdTypes; + }; + +/** A typedef'd packaged TMobileUssdCapsV1 for passing through a generic API member +function. */ + typedef TPckg TMobileUssdCapsV1Pckg; + + IMPORT_C TInt GetCaps(TDes8& aCaps) const; + +/** Defines the USSD Messaging Attributes. + +Modes: GSM/WCDMA + +@see TMobileUssdAttributesV1 */ + enum TMobileUssdAttributeFlags + { + /** The iFormat field is valid in the attribute class. */ + KUssdDataFormat = 0x00000001, + /** The iType field is valid in the attribute class. */ + KUssdMessageType = 0x00000002, + /** The iDcs field is valid in the attribute class. */ + KUssdMessageDcs = 0x00000004 + }; + +/** Defines the USSD Data Formats. + +Modes: Common */ + enum TMobileUssdDataFormat + { + /** The message data format is unspecified. + + Modes: Common */ + EFormatUnspecified, + /** The message data format complies to a USSD coded as 160 octets as defined for + a ussd-String within GSM 04.80 and GSM 03.38. + + Modes: GSM/WCDMA */ + EFormatPackedString + }; + +/** Defines the USSD Message Types. + +Modes: GSM/WCDMA */ + enum TMobileUssdMessageType + { + /** Message is an unknown type. */ + EUssdUnknown, + /** Message is a mobile originated USSD request. The MS expects the network to + send a USSD MT reply. */ + EUssdMORequest, + /** Message is a reply to a previously received network initiated USSD request. + It is a USSD MO reply. */ + EUssdMOReply, + /** Message is a one-off network initiated USSD notification. The network expects the MS to + send a USSD MO acknowledgement with empty message content. */ + EUssdMTNotify, + /** Message is a network initiated USSD request. The network expects + the MS to send a USSD MO reply. */ + EUssdMTRequest, + /** Message is a network initiated reply to a previously sent MO USSD request. */ + EUssdMTReply, + /** For acknowledging MT USSD notifications (empty message content). */ + EUssdMOAcknowledgement + }; + + + + class TMobileUssdAttributesV1 : public RMobilePhone::TMultimodeType + /** Defines attributes of a USSD message. + @publishedPartner + @released + */ + { + public: + IMPORT_C TMobileUssdAttributesV1(); + public: + /** The TMobileUssdAttributeFlags bit-mask flags indicating which attributes are + present in this instance. + + Modes: GSM/WCDMA + + @see TMobileUssdAttributeFlags */ + TUint32 iFlags; + /** Format of the message data buffer. + + Modes: GSM/WCDMA + + @see TMobileUssdDataFormat */ + TMobileUssdDataFormat iFormat; + /** The type of USSD message. + + Modes: GSM/WCDMA + + @see TMobileUssdMessageType */ + TMobileUssdMessageType iType; + /** The Data Coding Scheme of the USSD message. + + Modes: GSM/WCDMA */ + TUint8 iDcs; + }; + +/** A typedef'd packaged TMobileUssdAttributesV1 for passing through a generic +API member function. */ + typedef TPckg TMobileUssdAttributesV1Pckg; + + /***********************************************************************************/ + // + // Receiving USSD messages + // + /***********************************************************************************/ + + enum + { + KGsmUssdDataSize = 160 + }; + +/** A typedef'd buffer to hold the message data. */ + typedef TBuf8 TGsmUssdMessageData; + + IMPORT_C void ReceiveMessage(TRequestStatus& aReqStatus, TDes8& aMsgData, TDes8& aMsgAttributes) const; + + /***********************************************************************************/ + // + // Sending USSD messages + // + /***********************************************************************************/ + + IMPORT_C void SendMessage(TRequestStatus& aReqStatus, const TDesC8& aMsgData, const TDesC8& aMsgAttributes) const; + IMPORT_C void SendMessageNoFdnCheck(TRequestStatus& aReqStatus, const TDesC8& aMsgData, const TDesC8& aMsgAttributes) const; + + IMPORT_C void SendRelease(TRequestStatus& aReqStatus, TDes8& aReturnResult) const; + IMPORT_C void NotifyNetworkRelease(TRequestStatus& aReqStatus, TDes8& aReturnResult) const; + IMPORT_C void NotifyNetworkRelease(TRequestStatus& aReqStatus, TDes8& aMsgData, TDes8& aMsgAttributes) const; + +private: + RMobileUssdMessaging(const RMobileUssdMessaging&); + CUssdMessagingPtrHolder* iUssdMessagingPtrHolder; +protected: + IMPORT_C void ConstructL(); + IMPORT_C void Destruct(); + }; + + + +/*********************************************************/ +// +// SMS Message Storage (RMobileSmsStore) +// +/*********************************************************/ + + + +class CSmsStorePtrHolder; +class CMobilePhoneSmsList; +class RMobileSmsStore : public RMobilePhoneStore +/** Provides client access to SMS storage functionality provided by TSY. +@publishedPartner +@released +*/ + { +public: + + IMPORT_C RMobileSmsStore(); + IMPORT_C TInt Open(RMobileSmsMessaging& aMessaging, const TDesC& aStoreName); + IMPORT_C void Close(); + +/** Defines the SMS Store Capabilities. + +Modes: Common */ + enum TMobileSmsStoreCaps + { + /** The store contains unread, incoming SMS entries. + + Modes: Common */ + KCapsUnreadMessages = 0x00000001, + /** The store contains read, incoming SMS entries. + + Modes: Common */ + KCapsReadMessages = 0x00000002, + /** The store contains sent SMS entries. + + Modes: Common */ + KCapsSentMessages = 0x00000004, + /** The store contains un sent SMS entries. */ + KCapsUnsentMessages = 0x00000008, + /** The store contains GSM SMS message entries – so TMobileGsmSmsEntryV1 class + should be used. + + Modes: GSM/WCDMA */ + KCapsGsmMessages = 0x00000010, + /** The store contains CDMA SMS message entries – so TMobileCdmaSmsEntryV1 class + should be used. + + Modes: CDMA */ + KCapsCdmaMessages = 0x00000020 + }; + +/** Defines contents of a fixed-size, stored SMS entry. + +Modes: Common */ + enum TMobileSmsStoreStatus + { + /** The status of the SMS is unknown. */ + EStoredMessageUnknownStatus, + /** The SMS is stored phone-side. It is an incoming message that has not been read + yet. */ + EStoredMessageUnread, + /** The SMS is stored phone-side. It is an incoming message that has already been + read. */ + EStoredMessageRead, + /** The SMS is stored phone-side. It is an outgoing message that has not been sent + yet. */ + EStoredMessageUnsent, + /** The SMS is stored phone-side. It is an outgoing message that has already been + sent but a delivery/status report has either not been received yet or was + not requested in the first place. */ + EStoredMessageSent, + /** The SMS is stored phone-side. It is an outgoing message that has already been + sent and a delivery/status report has been received */ + EStoredMessageDelivered + }; + + // + // Enum used by TSY to distinguish which SMS entry class is used by client + // + +/** Used by TSY to distinguish which SMS entry class is used by client. */ + enum TMobileSmsEntryExtensionId + { + /** Type is unknown. */ + KETelMobileSmsEntryV1=KETelExtMultimodeV1, + /** The iExtensionId contents indicate that the packaged class is a TMobileGsmSmsEntryV1. + + Also used to indicate that GSM SMS entries will be retrieved by CRetrieveMobilePhoneSmsList. */ + KETelMobileGsmSmsEntryV1, + /** The iExtensionId contents indicate that the packaged class is a TMobileCdmaSmsEntryV1. + + Also used to indicate that CDMA SMS entries will be retrieved by CRetrieveMobilePhoneSmsList. */ + KETelMobileCdmaSmsEntryV1 + }; + + class TMobileSmsEntryV1 : public RMobilePhoneStore::TMobilePhoneStoreEntryV1 + /** Defines contents of a fixed-size, stored SMS entry. + @publishedPartner + @released + */ + { + public: + void InternalizeL(RReadStream& aStream); + void ExternalizeL(RWriteStream& aStream) const; + protected: + TMobileSmsEntryV1(); + public: + /** The status of the stored message. + + Modes: Common + + @see TMobileSmsStoreStatus */ + TMobileSmsStoreStatus iMsgStatus; + }; + +/** A typedef'd packaged TMobileSmsEntryV1 for passing through a generic API +member function. */ + typedef TPckg TMobileSmsEntryV1Pckg; + + class TMobileGsmSmsEntryV1 : public TMobileSmsEntryV1 +/** Defines contents of a fixed-size, stored GSM SMS entry. +@publishedPartner +@released */ + { + public: + void InternalizeL(RReadStream& aStream); + void ExternalizeL(RWriteStream& aStream) const; + public: + IMPORT_C TMobileGsmSmsEntryV1(); + public: + /** The service centre to use (or used) for the message. + + Modes: GSM/WCDMA + + @see RMobilePhone::TMobileAddress */ + RMobilePhone::TMobileAddress iServiceCentre; + /** The GSM 03.40 TPDU. + + Modes: GSM/WCDMA + + @see RMobileSmsMessaging::TMobileSmsGsmTpdu */ + RMobileSmsMessaging::TMobileSmsGsmTpdu iMsgData; + }; + +/** A typedef'd packaged TMobileGsmSmsEntryV1 for passing through a generic API +member function. */ + typedef TPckg TMobileGsmSmsEntryV1Pckg; + + class TMobileCdmaSmsEntryV1 : public TMobileSmsEntryV1 + /** Defines contents of a fixed-size, stored CDMA SMS entry. + @publishedPartner + @released + */ + { + public: + void InternalizeL(RReadStream& aStream); + void ExternalizeL(RWriteStream& aStream) const; + public: + IMPORT_C TMobileCdmaSmsEntryV1(); + public: + /** The teleservice identifier of the stored message. + + Modes: CDMA */ + TInt iTeleservice; + /** The service category of the stored message. + + Modes: CDMA */ + TInt iServiceCategory; + /** The remote party (destination or originator) of the stored message. + + Modes: CDMA + + @see RMobilePhone::TMobileAddress */ + RMobilePhone::TMobileAddress iRemoteParty; + /** The teleservice layer bearer data of the stored message. + + Modes: CDMA + + @see RMobileSmsMessaging::TMobileSmsCdmaTpdu */ + RMobileSmsMessaging::TMobileSmsCdmaTpdu iMsgData; + }; + +/** A typedef'd packaged TMobileCdmaSmsEntryV1 for passing through a generic API +member function. */ + typedef TPckg TMobileCdmaSmsEntryV1Pckg; + +protected: + IMPORT_C void ConstructL(); +private: + RMobileSmsStore(const RMobileSmsStore&); + }; + +/*********************************************************/ +// +// NAM Storage (RMobileNamStore) +// +/*********************************************************/ + + + +class CNamStorePtrHolder; +class CMobilePhoneNamList; +class CMobilePhoneNamListV4; + +class RMobileNamStore : public RMobilePhoneStore +/** +Provides client access to NAM storage functionality provided by TSY + +*/ + { +public: + IMPORT_C RMobileNamStore(); + IMPORT_C TInt Open(RMobilePhone& aPhone); + IMPORT_C void Close(); + + + + class TMobileNamStoreInfoV1 : public RMobilePhoneStore::TMobilePhoneStoreInfoV1 + /** + Defines information about a NAM store + + @publishedPartner + @released + */ + { + public: + IMPORT_C TMobileNamStoreInfoV1(); + public: + /** The number of enabled NAMs within the NAM store. + + Modes: CDMA */ + TInt iNamCount; + /** The index of the NAM that is currently the active NAM, will be between 0 and + iNamCount-1. + + Modes: CDMA */ + TInt iActiveNam; + }; + +/** A typedef'd packaged TMobileNamStoreInfoV1 for passing through a generic API +member function. */ + typedef TPckg TMobileNamStoreInfoV1Pckg; + + IMPORT_C void SetActiveNam(TRequestStatus& aReqStatus, TInt aNamId) const; + + enum + { + /* The original maximum NAM parameter size for a TMobileNamEntryV1 */ + KMaxNamParamSize = 64, + /* Updated maximum NAM parameter size for TMobileNamEntryV4 */ + KMaxNamParamSizeV4 = 256 + }; + + class TMobileNamEntryV1 : public RMobilePhoneStore::TMobilePhoneStoreEntryV1 + /** + Defines contents of a NAM store entry + + @publishedPartner + @released + */ + { + public: + IMPORT_C TMobileNamEntryV1(); + public: + void InternalizeL(RReadStream& aStream); + void ExternalizeL(RWriteStream& aStream) const; + public: + /** The NAM that is to be accessed, will be between 0 and TMobileNamStoreInfoV1::iNamCount-1. + + Modes: CDMA */ + TInt iNamId; + /** The identifier of the NAM parameter to be accessed. + + TSY must define values of parameter identifiers. + + Modes: CDMA */ + TInt iParamIdentifier; + /** The data contents of the selected parameter. + + Modes: CDMA + + @see KMaxNamParamSize */ + TBuf8 iData; + }; + + /** A typedef'd packaged TMobileNamEntryV1 for passing through a generic API member + function. */ + typedef TPckg TMobileNamEntryV1Pckg; + + /** Enumeration for the standard NAM parameters (see 3GPP2 C.S0005-A appendix F.3) + Modes: CDMA */ + enum TStandardNamParameters + { + /** The 64-bit pattern stored in the Mobile Station and + Home Location Register/Authentication Centre used to generate/update the + mobile station’s Shared Secret Data + Corresponds to NAM Indicator 'A_KEY' */ + EAKey, + /** 64-bit key used for authentication + Corresponds to NAM Indicator 'SSD_A(s-p)' */ + ESharedSecretDataA, + /** 64-bit key used as input to generate encryption mask and long code + Corresponds to NAM Indicator 'SSD_B(s-p)' */ + ESharedSecretDataB, + /** Modulo-64 event counter maintained by the mobile station and Authentication Center + used for clone detection + Corresponds to NAM Indicator 'COUNT(s-p)' */ + EParameterUpdateReceivedCount, + /** Class of the International Mobile Station Identity (IMSI) containing a MIN as + the lower 10 digits + Corresponds to NAM Indicator 'IMSI_M_CLASS(p)' */ + EMinBasedImsiClass, + /** The class of the International Mobile Station Identity (IMSI) not containing a MIN as + the lower 10 digits + Corresponds to NAM Indicator 'IMSI_T_CLASS(p)' */ + ETrueImsiClass, + /** 34-bit number derived from the IMSI M used as input for authentication + Corresponds to NAM Indicator 'IMSI_M_S(p)' */ + EMinBasedImsiS, + /** 34-bit number derived from the IMSI T used as input for authentication + Corresponds to NAM Indicator 'IMSI_T_S(p)' */ + ETrueImsiS, + /** Number of digits in the IMSI M minus 4 + Corresponds to NAM Indicator 'IMSI_M_ADDR_NUM(p)' */ + EMinBasedImsiAddressNum, + /** The number of digits in the IMSI T minus 4 + Corresponds to NAM Indicator 'IMSI_T_ADDR_NUM(p)' */ + ETrueImsiAddressNum, + /** The 11th and 12th digits in the IMSI M + Corresponds to NAM Indicator 'IMSI_M_11_12(p)' */ + EMinBasedImsiDigits11and12, + /** The 11th and 12th digits in the IMSI T + Corresponds to NAM Indicator 'IMSI_T_11_12(p)' */ + ETrueImsiDigits11and12, + /** The country code for the IMSI M + Corresponds to NAM Indicator 'MCC_M(p)' */ + EMinBasedMobileCountryCode, + /** The country code for the IMSI T + Corresponds to NAM Indicator 'MCC_T(p)' */ + ETrueMobileCountryCode, + /** Up to 15 digit dialable number associated with the mobile station through a service + subscription + Corresponds to NAM Indicator 'MDN(p)' */ + EMobileDirectoryNumber, + /** 4-bit number giving the length of the assigning Temporary Mobile Station Identity (TMSI) zone + (can range from 1 to 8 octets) + Corresponds to NAM Indicator 'ASSIGNING_TMSI_ZONE_LEN(s-p)' */ + EAssigningTmsiZoneLen, + /** Temporary Mobile Station Identity (TMSI) zone is an arbitrary set of base stations + for the administrative assignment of TMSI + Corresponds to NAM Indicator 'ASSIGNING_TMSI_ZONE(s-p)' */ + EAssigningTmsiZone, + /** The uniquely assigned number to a mobile station inside a TMSI zone + Corresponds to NAM Indicator 'TMSI_CODE(s-p)' */ + ETmsiCode, + /** The expiration time used to automatically delete the assigned TMSI + Corresponds to NAM Indicator 'TMSI_EXP_TIME(s-p)' */ + ETmsiExpTime, + /** Mobile station's home System Id for 800MHz analog operation + Corresponds to NAM Indicator 'HOME_SID(p)' */ + EHomeSystemIdAnalog, + /** Mobile station's home System Id + Corresponds to NAM Indicator 'SID(p)' */ + EHomeSystemId, + /** Mobile station's home Network Id + Corresponds to NAM Indicator 'NID(p)' */ + EHomeNetworkId, + /** Mobile station is configured to receive mobile station terminated calls when + using a home (SID, NID) pair + Corresponds to NAM Indicator 'MOB_TERM_HOME(p)' */ + EReceiveCallsHome, + /** The mobile station is configured to receive mobile station terminated calls when + it is a foreign SID roamer + Corresponds to NAM Indicator 'MOB_TERM_FOR_SID(p)' */ + EReceiveCallsForeignSystem, + /** The mobile station is configured to receive mobile station terminated calls when + it is a foreign NID roamer + Corresponds to NAM Indicator 'MOB_TERM_FOR_NID(p)' */ + EReceiveCallsForeignNetwork, + /** A TSY may use this as the first TSY-defined non-standard NAM parameter */ + ENumStandardNamParameters + }; + + class TMobileNamEntryV4 : public RMobilePhoneStore::TMobilePhoneStoreEntryV1 + /** + Defines contents of a NAM store entry + + The differences between the original TMobileNamEntryV1, and updated TMobileNamEntryV4 are: + - the maximum mobile NAM parameter size is KMaxNamParamSize(64) for TMobileNamEntryV1 + and KMaxNamParamSizeV4(256) for TMobileNamEntryV4 + - TMobileNamEntryV4 defines a set of standard NAM parameters for the iParamIdentifier as + described in 3GPP2 C.S0005-A appendix F.3 + + @publishedPartner + @released + */ + { + public: + IMPORT_C TMobileNamEntryV4(); + public: + void InternalizeL(RReadStream& aStream); + void ExternalizeL(RWriteStream& aStream) const; + public: + /** The NAM that is to be accessed, will be between 0 and TMobileNamStoreInfo::iNamCount-1. + + Modes: CDMA */ + TInt iNamId; + + /** The identifier of the NAM parameter to be accessed. + iParamIdentifier will be a TStandardNamParameters value if a standard NAM parameter is being accessed, + however a TSY may support and define NAM parameters in addition to those given by TStandardNamParameters + Modes: CDMA */ + TInt iParamIdentifier; + + /** The data contents of the selected parameter. + + Modes: CDMA + + @see KMaxNamParamSizeV4 */ + TBuf8 iData; + }; + + /** A typedef'd packaged TMobileNamEntryV4 for passing through a generic API member + function. */ + typedef TPckg TMobileNamEntryV4Pckg; + + IMPORT_C void StoreAllL(TRequestStatus& aReqStatus, TInt aNamId, CMobilePhoneNamList* aNamList) const; + IMPORT_C void StoreAllL(TRequestStatus& aReqStatus, TInt aNamId, CMobilePhoneNamListV4* aNamList) const; + +protected: + IMPORT_C void ConstructL(); +private: + RMobileNamStore(const RMobileNamStore&); + }; + + +/*********************************************************/ +// +// Own Number Storage (RMobileONStore) +// +/*********************************************************/ + + + +class CONStorePtrHolder; +class CMobilePhoneONList; + +class RMobileONStore : public RMobilePhoneStore +/** +Provides client access to Own Number storage functionality provided by TSY + +*/ + { +public: + IMPORT_C RMobileONStore(); + IMPORT_C TInt Open(RMobilePhone& aPhone); + IMPORT_C void Close(); + + + + class TMobileONStoreInfoV1 : public RMobilePhoneStore::TMobilePhoneStoreInfoV1 + /** + Defines information about an Own Number store + + @publishedPartner + @released + */ + { + public: + IMPORT_C TMobileONStoreInfoV1(); + public: + /** The maximum length of the own phone number can be. */ + TInt iNumberLen; + /** The maximum length the text field can be. */ + TInt iTextLen; + }; + +/** A typedef'd packaged TMobileONStoreInfoV1 for passing through a generic API +member function. */ + typedef TPckg TMobileONStoreInfoV1Pckg; + + enum + { + KOwnNumberTextSize = 20 + }; + + + + class TMobileONEntryV1 : public RMobilePhoneStore::TMobilePhoneStoreEntryV1 + /** + Defines contents of a Own Number store entry + + @publishedPartner + @released + */ + { + public: + IMPORT_C TMobileONEntryV1(); + public: + void InternalizeL(RReadStream& aStream); + void ExternalizeL(RWriteStream& aStream) const; + public: + /** Network mode. */ + RMobilePhone::TMobilePhoneNetworkMode iMode; + /** Mobile call service type. + + @see RMobilePhone::TMobileService */ + RMobilePhone::TMobileService iService; + /** Own number. + + @see RMobilePhone::TMobileAddress */ + RMobilePhone::TMobileAddress iNumber; + /** The name-tag associated with own number (e.g. "Voice Number"). */ + TBuf iText; + }; + +/** A typedef'd packaged TMobileONEntryV1 for passing through a generic API member +function. */ + typedef TPckg TMobileONEntryV1Pckg; + + IMPORT_C void StoreAllL(TRequestStatus& aReqStatus, CMobilePhoneONList* aONList) const; + +protected: + IMPORT_C void ConstructL(); +private: + RMobileONStore(const RMobileONStore&); + }; + +/*********************************************************/ +// +// Emergency Number Storage (RMobileENStore) +// +/*********************************************************/ + + + +class CMobilePhoneENList; + +class RMobileENStore : public RMobilePhoneStore +/** +Provides client access to Emergency Number storage functionality provided by TSY + +*/ + { +public: + IMPORT_C RMobileENStore(); + IMPORT_C TInt Open(RMobilePhone& aPhone); + IMPORT_C void Close(); + + enum + { + KEmergencyNumberSize = 6, + KEmergencyAlphaTagSize = 20 + }; + +/** Enumerated list of Emergency Number entries. + +Mode: WCDMA */ + enum TMobilePhoneENServiceCategory + { + /** This number provides emergency care by the police department. */ + KServiceCatPolice =0x0001, + /** This number provides emergency care by the ambulance department. */ + KServiceCatAmbulance =0x0002, + /** This number provides emergency care by the fire brigade department. */ + KServiceCatFireBrigade =0x0004, + /** This number provides emergency care by the marine guard department. */ + KServiceCatMarineGuard =0x0008, + /** This number provides emergency care by the mountain rescue department. */ + KServiceCatMountainRescue =0x0010 + // Reserved types: 0x0020,0x0040, + }; + + + +/** Buffer to hold the emergency number in. */ + typedef TBuf TEmergencyNumber; + + class TMobileENEntryV1 : public RMobilePhoneStore::TMobilePhoneStoreEntryV1 + /** + Defines contents of a Emergency Number store entry + @publishedPartner + @released + */ + { + public: + IMPORT_C TMobileENEntryV1(); + public: + void InternalizeL(RReadStream& aStream); + void ExternalizeL(RWriteStream& aStream) const; + public: + /** Indicates whether the emergency number is applicable in all situations (=EFalse) + or only when the MS is registered to a specific GSM or CDMA network (=ETrue). */ + TBool iNetworkSpecific; + /** The network mode. Only applicable if iNetworkSpecific equals ETrue. + + Modes: Common + + @see RMobilePhone::TMobilePhoneNetworkMode */ + RMobilePhone::TMobilePhoneNetworkMode iMode; + /** Country code. Only applicable if iNetworkSpecific equals ETrue. + + Modes: Common + + @see RMobilePhone::TMobilePhoneNetworkCountryCode */ + RMobilePhone::TMobilePhoneNetworkCountryCode iCountryCode; + /** Network identity. Only applicable if iNetworkSpecific equals ETrue. + + Modes: Common + + @see RMobilePhone::TMobilePhoneNetworkIdentity */ + RMobilePhone::TMobilePhoneNetworkIdentity iIdentity; + /** Emergency number. + + Modes: Common + + @see TEmergencyNumber */ + TEmergencyNumber iNumber; + /** Emergency call number type. It is used to display information about the dialed + emergency number (e.g. "Police", "Ambulance", "Fire brigade", etc.) + + Modes: WCDMA */ + TBuf iAlphaId; + //TInt should map to TMobilePhoneENServiceCategory. + //It was not changed to maintain source compatibility + + /** Emergency call type indicator, which contains information to be sent to the + network indicating the type of emergency call. + + The field is for future reference only and it is set to RFU (Reserved for + Future Use) as it is currently not being used, as specified in section 4.2.21 + TS 31.102 v3.3.0 Rel 99. + + Modes: WCDMA */ + TInt iCallType; + }; + + typedef TPckg TMobileENEntryV1Pckg; + +protected: + IMPORT_C void ConstructL(); +private: + RMobileENStore(const RMobileENStore&); + }; + + +/*********************************************************/ +// +// RMobilePhoneBookStore +// +/*********************************************************/ + + + +class CPhoneBookStorePtrHolder; +class CMobilePhoneBookList; + +class RMobilePhoneBookStore : public RMobilePhoneStore +/** Provides member functions for clients to access phone +books that are stored in ICC memory or in non-volatile memory on the phone +itself. This sub-session and the member functions within this section must +be supported if the TSY indicates that it supports the MobilePhonebookStore +functional unit. +@publishedPartner +@released +*/ + { +public: + IMPORT_C RMobilePhoneBookStore(); + IMPORT_C TInt Open(RMobilePhone& aPhone, const TDesC& aStore); + IMPORT_C TInt Open(RMobilePhone& aPhone, const TDesC& aStore, const TDesC& aMode); + IMPORT_C void Close(); + +/** Describes the specialized phone book capabilities. + +Modes: Common */ + enum TMobilePhoneBookCaps + { + /** New entries can only be written to (or deleted from) the phone book with the + PIN2 password or equivalent. + + Modes: Common */ + KCapsRestrictedWriteAccess = 0x00000001, + /** The phonebook supports the second name field. + + Modes: WCDMA */ + KCapsSecondNameUsed = 0x00000002, + /** The phonebook supports the additional number (with optional Text, TON, NPI + and Bearer Capability) field. + + Modes: WCDMA */ + KCapsAdditionalNumUsed = 0x00000004, + /** The phonebook supports the group name field. + + Modes: WCDMA */ + KCapsGroupingUsed = 0x00000008, + /** The phonebook supports entry control and hidden flag fields. + + Modes: WCDMA */ + KCapsEntryControlUsed = 0x00000010, + /** The phonebook supports the email address field. + + Modes: WCDMA */ + KCapsEmailAddressUsed = 0x00000020, + /** The phonebook supports the bearer capability IE field. + + Modes: WCDMA */ + KCapsBearerCapUsed = 0x00000040, + /** The phonebook supports retrieval of the phonebook's PBID and Change Counter + - and for each entry its UID field. + + Modes: WCDMA */ + KCapsSynchronisationUsed = 0x00000080 + }; + +/** Described the location of the phone book. + +Modes: Common for all */ + enum TMobilePhoneBookLocation + { + /** The phonebook's location is unknown. */ + ELocationUnknown, + /** The phonebook is located in ICC (SIM/R-UIM) memory. */ + ELocationIccMemory, + /** The phonebook is located in Phone (ME) memory. */ + ELocationPhoneMemory, + /** The phonebook is located in an external memory. */ + ELocationExternalMemory, + /** The phonebook entries are dispersed over a combination of memory locations. */ + ELocationCombinedMemory + }; + + enum + { + KMaxPBIDSize=15 + }; + +/** Defines a modifiable buffer descriptor to contain the phone book identity. +Used in TMobilePhoneBookInfoV1. */ + typedef TBuf8 TMobilePhoneBookIdentity; + + + + class TMobilePhoneBookInfoV1 : public RMobilePhoneStore::TMobilePhoneStoreInfoV1 + /** + Defines information about a Phonebook store. + @publishedPartner + @released + */ + { + public: + /** Trivial constructor. Initializes iMaxNumLength=-1; iMaxTextLength=-1; iLocation=ELocationUnknown; + iChangeCounter=0; iExtensionId=KETelMobilePhonebookStoreV1; */ + IMPORT_C TMobilePhoneBookInfoV1(); + public: + /** The maximum number of characters for the number in a phonebook entry. + + Modes: Common */ + TInt iMaxNumLength; + /** The maximum number of characters for the text tag in a phonebook entry. + + Modes: Common */ + TInt iMaxTextLength; + /** The memory location of this phonebook. + + Modes: Common + + @see TMobilePhoneBookLocation */ + TMobilePhoneBookLocation iLocation; + /** The contents of the Change Counter file in a USIM phonebook. + + Modes: WCDMA */ + TUint16 iChangeCounter; + /** A unique identity for this type of phonebook. + + If this is a SIM or R-UIM phonebook then it will equal the ICCID of the card. + + If this is a USIM phonebook then it will equal the PBID of the phonebook. + + Modes: Common + + @see TMobilePhoneBookIdentity */ + TMobilePhoneBookIdentity iIdentity; + }; + +/** Packages the TMobilePhoneBookInfoV1 into a TMobilePhoneBookInfoV1Pckg. */ + typedef TPckg TMobilePhoneBookInfoV1Pckg; + + + class TMobilePhoneBookInfoV2 : public TMobilePhoneBookInfoV1 +/** Defines information about a Phonebook store for version v2.0 of the API. +@publishedPartner +@released */ + { + public: + IMPORT_C TMobilePhoneBookInfoV2(); + public: + /** The type of the phonebook which relates to its location (ICC/UICC/CDMA). + + Mode: Common */ + TName iPhBkMode; + }; + +/** Packages the TMobilePhoneBookInfoV2 into a TMobilePhoneBookInfoV1Pckg. */ + typedef TPckg TMobilePhoneBookInfoV2Pckg; + + + /** Defines information about a Phonebook store for version v5.0 of the API. + + Extends the v2.0 API to allow additional information about the phonebook + (Maximum number of second name fields, Maximum number of additional number fields, + Maximum number of additional group name fields, Maximum number of email address fields) + to be retieved where available. + + @publishedPartner + @released*/ + class TMobilePhoneBookInfoV5 : public TMobilePhoneBookInfoV2 + { + public: + IMPORT_C TMobilePhoneBookInfoV5(); + public: + /** The maximum number of Second Name fields that can be used. */ + TInt iMaxSecondNames; + + /** The maximum text length for Second Name fields. */ + TInt iMaxTextLengthSecondName; + + /** The maximum number of additional number fields that can be used. */ + TInt iMaxAdditionalNumbers; + + /** The maximum number length for Additional Number fields. */ + TInt iMaxNumLengthAdditionalNumber; + + /** The maximum text length for Additonal Number fields. */ + TInt iMaxTextLengthAdditionalNumber; + + /** The maximum number of additional Group Name fields that can be used. */ + TInt iMaxGroupNames; + + /** The maximum text length for Group Name fields. */ + TInt iMaxTextLengthGroupName; + + /** The maximum number of additional E-Mail address fields that can be used. */ + TInt iMaxEmailAddr; + + /** The maximum text length for Email Address fields. */ + TInt iMaxTextLengthEmailAddr; + }; + + /** Packages the TMobilePhoneBookInfoV5 into a TMobilePhoneBookInfoV5Pckg. */ + typedef TPckg TMobilePhoneBookInfoV5Pckg; + + + // check these fields - not sure all are correct +/** The following Tag IDs are used to encode/decode the phonebook entries to/from +the TLV format. Each field will have a unique identifier and will be followed +by the field length. The type of data associated with the field is also specified +below. + +Some fields do not have any data and just serve as separators within the buffer +- in these cases the Data Type column is set to not applicable (n/a). + +Modes: Common */ + enum TMobilePBFieldTags + { + /** Tag id for the beginning of a new phonebook entry. + + Data type: n/a. + + Modes: Common */ + ETagPBNewEntry =0xA0, + /** Tag id for the Unique ID field. + + Data type: TUint16 + + Modes: WCDMA */ + ETagPBUniqueId =0xB0, + /** Tag id for the Index within the ADN record. + + Data type: TUint16 + + Modes: Common */ + ETagPBAdnIndex =0xC0, + /** Tag id for a Text field within the ADN/ANR record. + + Data type: TDes16 + + Modes: Common */ + ETagPBText =0xC1, + /** Tag id for a Number field within the ADN/ANR record. + + Data type: TDes16 + + Modes: Common */ + ETagPBNumber =0xC2, + /** Tag id for a TON/NPI byte within the ADN/ANR record. + + Data type: TUint8 + + Modes: Common */ + ETagPBTonNpi =0xC3, + /** Tag id for a Bearer Capability IE associated to the ADN/ANR record. + + Data type: TDes8 + + Modes: GSM/WCDMA */ + ETagPBBearerCap =0xC4, + /** Tag id for the beginning of an Additional Number entry within the phonebook + entry. + + Data type: n/a + + Modes: WCDMA */ + ETagPBAnrStart =0xC5, + /** Tag id for the Second Name associated to the ADN record. + + Data type: TDes16 + + Modes: WCDMA */ + ETagPBSecondName =0xC6, + /** Tag id for a Group Name associated to the ADN record. + + Data type:TDes16 + + Modes: WCDMA */ + ETagPBGroupName =0xC7, + /** Tag id for an Email Address associated to the ADN record. + + Data type: TDes16 + + Modes: WCDMA */ + ETagPBEmailAddress =0xC8, + /** Tag id for the Entry Control byte associated to the ADN record. + + Data type: TUint8 + + Modes: WCDMA */ + ETagPBEntryControl =0xC9, + /** Tag id for the Hidden Information byte associated to the ADN record. + + Data type: TUint8 + + Modes: WCDMA */ + ETagPBHiddenInfo =0xCA, + ETagPBDateTime =0xCB, + ETagPBDuration =0xCC, + ETagPBCallStatus =0xCD, + ETagPBEntryStatus =0xCE + }; + + + // API/TSY internal type + struct TPBIndexAndNumEntries +/** A structure to hold the phone book index and number of entries. */ + { + /** Index for the phone book. */ + TInt iIndex; + TInt iNumSlots; + }; + + IMPORT_C void Read(TRequestStatus& aReqStatus, TInt aIndex, TInt aNumSlots, TDes8& aPBData) const; + IMPORT_C void Write(TRequestStatus& aReqStatus, const TDesC8& aPBData, TInt& aIndex) const; + +protected: + IMPORT_C void ConstructL(); +private: + RMobilePhoneBookStore(const RMobilePhoneBookStore&); + }; + +/*********************************************************/ +// +// RMobileConferenceCall +// +/*********************************************************/ + + + +class CMobileConferenceCallPtrHolder; + +class RMobileConferenceCall : public RTelSubSessionBase +/** Provides access to conference call functionality provided by TSY. + +Conference calls allow users to conduct multi-connection voice calls, for example +simultaneous communication to more than one remote party. All participants +within a conference call can hear and speak to each other. There is a controlling +party that initiates and manages the conference. + +Conference calling is possible in both GSM and CDMA mode and the actions to +initiate a 3-way conference are the same in either mode. However, GSM conference +calls offer more functionality and the number of remote parties is limited +in CDMA mode to 2 and in GSM mode to 5. + +The Multimode ETel API uses a new sub-session called RMobileConferenceCall +as a model for a conference call. The conference call object will be an aggregation +of all the RMobileCall objects that are part of the conference call. It will +be possible for clients to manipulate both the conference call as a whole +and individual calls within a conference call depending on the dynamic capabilities +of each of these objects. + +Please note that RMobileConferenceCall is replacing the RCallGroup abstraction +used in the GSM API. This was an optimisation decision. The call group abstraction +placed a large burden on a TSY to create call groups, monitor the calls in +each group and trigger notification when calls were added or moved, probably +even when a conference call was not ongoing. Clients will probably only open +a RMobileConferenceCall when the user has decided to make a conference call +and by having just one object replace three call groups it will also reduce +the number of notifications that would trigger in response to conference call +events. With a view to the future, without call groups there are also no longer +any restrictions to the allowed types of active calls (simultaneous, separate +voice and data calls are possible). + +The methods within this section must be supported if the TSY supports MobileConferenceCall +functional unit. + +*/ + { +public: + IMPORT_C RMobileConferenceCall(); + IMPORT_C TInt Open(RMobilePhone& aPhone); + IMPORT_C void Close(); + +/** Conference call capabilities. */ + enum TMobileConferenceCallCaps + { + /** Indicates that a conference call can be created. */ + KCapsCreate = 0x00000001, + /** Indicates that a conference call can be terminated. */ + KCapsHangUp = 0x00000002, + /** Indicates that a conference call exists and can be swapped to the opposite + state (active or hold). */ + KCapsSwap = 0x00000004 + }; + + IMPORT_C TInt GetCaps(TUint32& aCaps) const; + IMPORT_C void NotifyCapsChange(TRequestStatus& aReqStatus, TUint32& aCaps) const; + + IMPORT_C void CreateConference(TRequestStatus& aReqStatus) const; + IMPORT_C void AddCall(TRequestStatus& aReqStatus, const TName& aCallName) const; + IMPORT_C void Swap(TRequestStatus& aReqStatus) const; + IMPORT_C void HangUp(TRequestStatus& aReqStatus) const; + IMPORT_C TInt EnumerateCalls(TInt& aCount) const; + IMPORT_C TInt GetMobileCallInfo(TInt aIndex, TDes8& aCallInfo) const; + +/** Conference call status. */ + enum TMobileConferenceStatus + { + /** The conference call is in the idle state. */ + EConferenceIdle, + /** The conference call is in the active, connected state. */ + EConferenceActive, + /** The conference call is in the held, connected state. */ + EConferenceHold + }; + + IMPORT_C TInt GetConferenceStatus(TMobileConferenceStatus& aStatus) const; + IMPORT_C void NotifyConferenceStatusChange(TRequestStatus& aReqStatus, TMobileConferenceStatus& aStatus) const; + +/** Conference events. */ + enum TMobileConferenceEvent + { + /** A call has been added to the conference. */ + EConferenceCallAdded, // Name of the call added returned in aCallName + /** A call has been removed from the conference. */ + EConferenceCallRemoved, // Name of the call terminated returned in aCallName + /** Names of the two calls used to build the conference call returned in aCallName. */ + EConferenceBuilt, // Names of the two calls used to build the conference call returned in aCallName + /** No name provided */ + EConferenceTerminated, // No name provided + /** No name provided. */ + EConferenceSwapped, // No name provided + /** Name of the call being seperated. */ + EConferenceSplit // Name of the call being seperated + }; + + IMPORT_C void NotifyConferenceEvent(TRequestStatus& aReqStatus, TMobileConferenceEvent& aEvent, TName& aCallName) const; + +private: + CMobileConferenceCallPtrHolder* iMmPtrHolder; + RMobileConferenceCall(const RMobileConferenceCall&); +protected: + IMPORT_C void ConstructL(); + IMPORT_C void Destruct(); + }; + + +///////////////////////////////////////////////////////////////////////////////////// +// +// EAP-SIM Authentication functional unit +// +///////////////////////////////////////////////////////////////////////////////////// + +class CMobileSmartCardEapPtrHolder; + +/** +This sub-session opens under RMobilePhone. + +RMobileSmartCardEap provides the client with access to a Smart Card +Application's EAP-capability (if one exists). + +(See ETSI TS 102.310 v6.2.0 and RFC3748) + +To submit authentication challenges or requests, a client must use +CAsyncSmartCardEapAuthentication in conjunction with this sub-session. + +@see CAsyncSmartCardEapAuthentication +@publishedPartner +@prototype +*/ +class RMobileSmartCardEap : public RTelSubSessionBase + { + friend class CAsyncSmartCardEapAuthentication; + +public: + /** + Class encapsulates EAP request packet data for authentication. + + @see CAsyncSmartCardEapAuthentication + + @publishedPartner + @prototype + */ + class CEapAuthenticateRequestDataV6 : public CBase + { + public: + IMPORT_C static CEapAuthenticateRequestDataV6* NewL(); + IMPORT_C virtual void ExternalizeL(TPtr8& aBuffer); + IMPORT_C virtual void InternalizeL(const TDesC8& aBuffer); + IMPORT_C TUint VersionId() const; + IMPORT_C TPtr8 GetEapReqPacket() const; + IMPORT_C void SetEapReqPacketL(const TDesC8& aData); + IMPORT_C ~CEapAuthenticateRequestDataV6(); + + private: + CEapAuthenticateRequestDataV6(); + void ConstructL(); + + protected: + /** + ETelMM's supported version. + */ + TUint iVersionId; + + public: + /** + EAP-request packet in a flat buffer. + */ + CBufFlat* iEapReqPacket; + }; + + IMPORT_C RMobileSmartCardEap(); + + /** + EAP types are represented by one byte for standard EAP methods, and + eight bytes for extended methods. Each byte specified in the + TEapType buffer should represent one semi-octet. Therefore, a + maximum of 16-chars are needed for representing any possible EAP + type. (See section 5.2 of ETSI TS 102.310 v6.2.0.) + + @see RMobileSmartCardEap::TEapType + + @publishedPartner + @prototype + */ + enum { KEapTypeSize = 16 }; + + /** + A typedef'd buffer to hold the EAP type for the subsequent + authentication that will be carried out on the Smart Card + Application. + + The value specified must correspond to the pre-allocated type + identifiers for various EAPs (see + http://www.iana.org/assignments/eap-numbers). Some known values + are given in etelmm.h. + + The type must be specified in hexadecimal format, where each + character represents one semi-octet. + + @see KETelSmartCardEapTypeMD5 + @see KETelSmartCardEapTypeTLS + @see KETelSmartCardEapTypeSIM + @see KETelSmartCardEapTypeAKA + @see KETelSmartCardEapTypeTTLS + @see RMobileSmartCardEap::Open() + + @publishedPartner + @prototype + */ + typedef TBuf8 TEapType; + + IMPORT_C TInt Open(RMobilePhone& aPhone, const RMobilePhone::TAID& aAID, const TEapType& aEapType); + IMPORT_C void InitialiseEapMethod(TRequestStatus& aReqStatus); + IMPORT_C void Close(); + + /** + Authentication status of the EAP supporting UICC application (See + section 7.2 of ETSI TS 102.310 v6.2.0). One of these values is + returned on completion of an + RMobileSmartCardEap::GetAuthenticationStatus() request. + + @see RMobileSmartCardEap::GetAuthenticationStatus() + + @publishedPartner + @prototype + */ + enum TEapAuthStatus + { + /** + No authentication started + */ + ENoAuthStarted, // 0 + /** + Authenticating + */ + EAuthenticating, // 1 + /** + Authentication complete + */ + EAuthenticated, // 2 + /** + Held (authentication failure) + */ + EHeld // 3 + }; + + IMPORT_C void GetAuthenticationStatus(TRequestStatus& aReqStatus, TEapAuthStatus& aAuthStatus); + + /** + TEapUserIdType should be used to request an identity from EF_PUId + or EF_Ps, when making an RMobileSmartCardEap::GetUserIdentity() + request. + (See sections 7.3 and 7.4, respectively, of ETSI TS 102.310 v6.2.0, + and RFC2486 - The Network Access Identifier). + + @see RMobileSmartCardEap::GetUserIdentity() + @see RMobileSmartCardEap::TEapUserIdentityV6 + + @publishedPartner + @prototype + */ + enum TEapUserIdType + { + /** Identity is permanent type */ + EPermanentIdentity, // 0 + /** Identity is pseudonym type */ + EPseudonymIdentity // 1 + }; + + /** + Maximum permitted size of identity data. + */ + enum { KEapIdentityMaxSize = 255 }; + + /** + EAP User Identity data. Ids are stored in EF_PUId or EF_Ps + (specified in sections 7.3 and 7.4, respectively, of ETSI TS + 102.310 v6.2.0). + + @see RMobileSmartCardEap::GetUserIdentity() + + @publishedPartner + @prototype + */ + class TEapUserIdentityV6 : public RMobilePhone::TMultimodeType + { + public: + IMPORT_C TEapUserIdentityV6(); + public: + /** + EAP-IDENTITY Data. + */ + TBuf8 iEapId; + }; + + /** + A typedef'd packaged TEapUserIdentityV6 for passing through a + generic API method. + + @publishedPartner + @prototype + */ + typedef TPckg TEapUserIdentityV6Pckg; + + IMPORT_C void GetUserIdentity(TRequestStatus& aReqStatus, + TEapUserIdType aRequestedIdType, + TDes8& aUserId); + + /** + TEapKeyV6 should be used to request one of (currently) two keys + available on the EF_EAPKEYS of the UICC application (see section + 7.1 of ETSI TS 102.310 v6.2.0). This enumeration type should be + used in RMobileSmartCardEap::GetEapKey() to specify the key to be + retrieved. + + @see RMobileSmartCardEap::TEapKeyV6 + @see RMobileSmartCardEap::GetEapKey() + + @publishedPartner + @prototype + */ + enum TEapKeyTag + { + /** + Used to request Master Session Key. + */ + EEapKeyMSK = 0x80, + /** + Used to request Extended Master Session Key. + */ + EEapKeyEMSK = 0x81 + }; + + /** + Maximum size of an EAP Key stored on the DF_EAP's EF_EAPKEYS. + 255 as each key has a length that can be specified by exactly one + byte (see section 7.1 of ETSI TS 102.310 v6.2.0). + + @publishedPartner + @prototype + */ + enum { KEapKeyMaxSize = 255 }; + + /** + EAP authentication key data. + + @see RMobileSmartCardEap::GetEapKey() + + @publishedPartner + @prototype + */ + class TEapKeyV6 : public RMobilePhone::TMultimodeType + { + public: + IMPORT_C TEapKeyV6(); + public: + /** + EAP-KEY Data. + */ + TBuf8 iEapKey; + }; + + /** + A typedef'd packaged TEapKeyV6 for passing through a generic API + method. + + @publishedPartner + @prototype + */ + typedef TPckg TEapKeyV6Pckg; + + IMPORT_C void GetEapKey(TRequestStatus& aReqStatus, const TEapKeyTag aRequestedKey, TDes8& aKey); + + /** + Status of the DF_EAP this subsession refers to. The status is + basically an indication of whether the DF is in use by another sub- + session client instance. + + NotifyEapMethodAccessStatusChange() will give a notification when + the status changes. + + Status will change when the first client calls + InitialiseEapMethod() on this sub-session. When the same client + calls ReleaseEapMethod() (or Close()), the status will change + again. This allows mutually exclusive access to the DF_EAP. All + other RMobileSmartCardEap hanles will get an error if they attempt + to make requests that access the same DF_EAP. + + @see RMobileSmartCardEap::NotifyEapMethodAccessStatusChange() + @see RMobileSmartCardEap::ReleaseEapMethod() + @see RMobileSmartCardEap::InitialiseEapMethod() + + @publishedPartner + @prototype + */ + enum TEapMethodAccessStatus + { + /** + AID/DF_EAP has been reset, and the DF_EAP has not been + initialised by any other instance of RMobileSmartCardEap. + */ + EEapMethodAvailable, + /** + Another instance of RMobileSmartCardEap has initialised first + and taken ownership of the DF_EAP. The DF_EAP is currently + active and EAP requests can be made. + */ + EEapMethodInUseApplicationActive, + /** + This instance of RMobileSmartCardEap still owns the lock on the + DF_EAP, but the application has been deactivated elsewhere. + The client should re-initialise before making further EAP + requests. + + @see RMobileSmartCardEap::InitialiseEapMethod() + */ + EEapMethodInUseApplicationInactive, + /** + Lock on the DF_EAP has been released, but another DF_EAP method + is in use under the same AID, thus, cannot reset/initialise + this subsessions EAP method. Client can only post a + notification and wait till status changes to + EEapMethodAvailable. + + @see RMobileSmartCardEap::NotifyEapMethodAccessStatusChange() + */ + EEapMethodUnableToInitialise + }; + + IMPORT_C TInt ReleaseEapMethod(); + IMPORT_C TInt GetEapMethodAccessStatus(TEapMethodAccessStatus& aEapMethodStatus); + IMPORT_C void NotifyEapMethodAccessStatusChange(TRequestStatus& aReqStatus, TEapMethodAccessStatus& aEapMethodStatus); + IMPORT_C TBool IsEapMethodOwner() const; + +protected: + IMPORT_C void ConstructL(); + IMPORT_C void Destruct(); + +private: + RMobileSmartCardEap(const RMobileSmartCardEap&); + + TChar SeptChar(TInt aDigit); + void ConvertBinToText(const TDesC8& aBinData, TDes& aText); + +private: + /** + Pointer Holder for the RMobileSmartCardEap sub-session requests. + */ + CMobileSmartCardEapPtrHolder* iMmPtrHolder; + /** + True if this object is the first to request InitialiseEapMethod() + on its when the status is EEapMethodAvailable. + I.e. True only for the instance of RMobileSmartCardEap that + successfully passes the Wait() on iSemaphore. + */ + TBool iOwnsEapMethodLock; + /** + Semaphore is actually owned by TSY, and used by all instances of + RMobileSmartCardEap to stop multiple access to the same EAP method + on any one application. + */ + RSemaphore iSemaphore; + + }; // RMobileSmartCardEap + +///////////////////////////////////////////////////////////////////////////////////// +// +// LCS-MO-LR AND LCS-MT-LR +// +///////////////////////////////////////////////////////////////////////////////////// +class CMobileLocationServicesPtrHolder; + +/** +This sub-session opens under RMobilePhone. + +A new RMobileLocationServices class is used to add the ETelMM Support for Mobile Terminating Location Request, +Mobile Originating Location Requests, A-Gps assistance data for the LBS Framework. + +RMobileLocationServices is derived from RTelSubSessionBase.RMobileLocationServices lists the +APIs,which provided the support for Mtlr, Molr, A-Gps assistance data requests. +*/ +class RMobileLocationServices : public RTelSubSessionBase + { +public: + + IMPORT_C RMobileLocationServices(); + IMPORT_C TInt Open(RMobilePhone& aPhone); + IMPORT_C void Close(); + /** + Maximum length of the array used for TLcsRequestorIdString. + */ + enum { KLcsMaxRequestorIdStringSize = 256 }; + /** + Maximum length of the array used for TLcsClientBufferName. + */ + enum { KLcsMaxClientNameBufferSize = 256 }; + /** + Maximum length of the array used for TLcsClientExternalID. + */ + enum { KLcsMaxClientExternalIdSize = 64 }; + /** + Maximum length of the array used for TLcsLocationEstimate. + */ + enum { KLcsMaxLocationEstimateSize = 64 }; + /** + Maximum length of the array used for TLcsVelocityEstimate. + */ + enum { KLcsMaxVelocityEstimateSize = 64 }; + /** + Maximum length of the array used for TLcsGpsAssistanceData. + */ + enum { KLcsMaxGpsAssistanceDataSize = 64 }; + /** + A typedef'd buffer which holds the External ClientName Buffer. + @see KLcsMaxClientNameBufferSize + */ + typedef TBuf8 TLcsClientNameBuffer; + /** + A typedef'd buffer which holds the RequestorId String. + @see KLcsMaxRequestorIdStringSize + */ + typedef TBuf8 TLcsRequestorIdString; + /** + A typedef'd buffer which holds the Gps Assistance Data. + @see KLcsMaxGpsAssistanceDataSize + */ + typedef TBuf8 TGpsAssistanceData; + /** + A typedef'd buffer which holds the External ClientId. + @see KLcsMaxClientExternalIdSize + */ + typedef TBuf8 TLcsClientExternalID; + /** + A typedef'd TUint8 which holds the Data Coding Scheme information. + */ + typedef TUint8 TLcsDataCodingScheme; + /** + A typedef'd buffer which holds the Location Estimate. + @see KLcsMaxLocationEstimateSize + */ + typedef TBuf8 TLcsLocationEstimate; + /** + A typedef'd buffer which holds the Velocity Estimate. + @see KLcsMaxVelocityEstimateSize + */ + typedef TBuf8 TLcsVelocityEstimate; + /** + A typedef'd buffer which holds the GpsAssistanceData type. + @see KLcsMaxGpsAssistanceDataSize + */ + typedef TBuf8 TGpsAssistanceData; + typedef TUint8 TTransactionIdentifier; + typedef TUint8 TGPSI; + /** + Note:Refer to 3GPP TS 23.271(Functional stage 2 description of Location Services (LCS)), + 3GPP TS 24.030(Location Services (LCS); Supplementary service operations - Stage 3) and + 3GPP TS 24.080(Mobile radio interface layer 3 supplementary services specification; Formats and coding) + for further details of MTLR and MOLR member data. + */ + /*********************************************************************/ + // MTLR // + /*********************************************************************/ + /** + TNotificationType lists the various types of Notification + that can be expected from any MTLR-Location Notification coming from the Network, + These types depend on the Subscription Profile of the UE. + + One of the TNotificationType is expected to be retrieved from the Network, + when a UE places a RMobileLocationServices::NotifyMtlr() request on the TSY. + @internalAll + */ + enum TNotificationType + { + /** + Notification Type Unknown + */ + ENotificationTypeUnknown, + /** + The Location Request is accepted by default + */ + ENotifyLocationAllowed, + /** + This enum is used to indicate to the client, that the user should be notified of the incoming MTLR request, + and that the user is expected to respond by granting/denying the request. By defualt, if the user + does not provide a response, the request is granted + */ + ENotifyAndVerify_LocationAllowedIfNoResponse, + /** + This enum is used to indicate to the client, that the user should be notified of the incoming MTLR request, + and that the user is expected to respond by granting/denying the request. By defualt, if the + user does not provide a response, the request is denied. + */ + ENotifyAndVerify_LocationNotAllowedIfNoResponse, + /** + The network sends the information to the UE that the external client has privacy overide capability, + This indicator is received when an authenticated or emergency client had sent the request. + */ + ELocationPrivacyOverride, + /** + This enum is used to notify the UE that an incoming MTLR request was denied by the network for any of various + reasons. + */ + ELocationNotAllowed + }; + + + /** + TLocationEstimateType lists the various types of LocationEstimate + that can be expected from any MTLR-Location Notification request coming from the Network, + These types depend on the Subscription Profile of the UE. + + One of the TLocationEstimateType is expected to be retrieved from the Network, + when a UE places a RMobileLocationServices::NotifyMtlr() request on the TSY. + @internalAll + */ + enum TLocationEstimateType + { + /** + Location Estimate Type Unknown. + */ + ELocationEstimateTypeUnknown, + /** + The External Client has requested for the Current Location of + the UE. + */ + ECurrentLocation, + /** + The External Client has requested for the Current Location of + the UE.Incase,if the request is accepted,But still it fails to + generate the Location report because of Measurement Control Failure. + The Client receives the Last Known Location. + */ + ECurrentOrLastKnownLocation, + /** + The External Client has requested for the initial location of the UE. The current + location of the UE may or may not be the initial location. + */ + EInitialLocation + }; + + /** + TLcsClientNameV1 holds the details of the name of the External client, + who is making the request via Network. + TLcsClientNameV1 is used by RMobileLocationServices::NotifyMtlr() request. + @see TLcsDataCodingScheme + @see TLcsClientNameBuffer + @internalAll + */ + class TLcsClientNameV1 + { + public: + /** + TLcsDataCodingScheme holds the Data Coding Scheme information which is used + to extract the ExternalClient name. + */ + TLcsDataCodingScheme iLcsDataCodingScheme; + /** + TLcsClientNameBuffer holds the Client name + */ + TLcsClientNameBuffer iLcsClientNameBuffer; + }; + + /** + TLcsRequestorIDV1 holds the details of the RequestorId i.e the details of the + Network,Which is carrying the request of External Client to UE + TLcsRequestorIDV1 is used by RMobileLocationServices::NotifyMtlr() request. + @see TLcsDataCodingScheme + @see TLcsRequestorIdString + @internalAll + */ + class TLcsRequestorIDV1 + { + public: + /** + TLcsDataCodingScheme holds the Data Coding Scheme information which is used + to extract the RequestorId String. + */ + TLcsDataCodingScheme iLcsDataCodingScheme; + /** + TLcsRequestorIdString holds the RequestorId String + */ + TLcsRequestorIdString iLcsRequestorIdString; + }; + + /** + TLocationExternalInfoV1 holds the details of the External client and the Requestor + TLocationExternalInfoV1 is used by RMobileLocationServices::NotifyMtlr() request + @see TLcsClientExternalID + @see TLcsClientNameV1 + @see TLcsRequestorIDV1 + @internalAll + */ + class TLocationExternalInfoV1 + { + public: + /** + TLcsClientExternalID gives the id of the External client. + */ + TLcsClientExternalID iLcsClientID; + /** + TLcsClientNameV1 holds the name of the External Client. + */ + TLcsClientNameV1 iLcsClientName; + /** + TLcsRequestorIDV1 gives the details of requestor id + */ + TLcsRequestorIDV1 iLcsRequestorID; + }; + + /** + TNotifyMtlrV7 holds the details of the MTLR request made by the External client. + TNotifyMtlrV7 is used by RMobileLocationServices::NotifyMtlr() request + @see TNotificationType + @see TLocationEstimateType + @see TLocationExternalInfoV1 + @internalAll + */ + class TNotifyMtlrV7: public RMobilePhone::TMultimodeType + { + public: + IMPORT_C TNotifyMtlrV7(); + public: + /** + TNotificationType holds the type of notification request being made + */ + TNotificationType iNotificationType; + /** + TLocationEstimateType holds the type of LocationEstimate is requested + */ + TLocationEstimateType iMtlrLocationEstimateType; + /** + TLocationExternalInfoV7 holds the details of the External client. + */ + TLocationExternalInfoV1 iLocationInfo; + }; + + /** + A typedef'd packaged TNotifyMtlrV7 for passing through a + generic API method. + + @internalAll + */ + typedef TPckg TNotifyMtlrV7Pckg; + + //MTLR-RESPONSE + /** + TMtlrResponse is used by the OverLoaded RMobileLocationServices::SendMtlrResponse() API + It holds the type of response being sent back for the MTLR request made. + @internalAll + */ + + enum TMtlrResponse + { + /** + Mtlr Response Unknown. + */ + EMtlrResponseUnknown, + /** + The UE has denied the Location Request of the External client. + @see RMobileLocationServices::SendMtlrResponse() + */ + EPermissionDenied , + /** + The UE has granted the Location Request of the External client. + @see RMobileLocationServices::SendMtlrResponse() + */ + EPermissionGranted + }; + + /** + TMtlrError is used by the Overloaded RMobileLocationServices::SendMtlrResponse() API + It holds the type of Error response being sent back for the MTLR request made. + @internalAll + */ + enum TMtlrError + { + /** + Mtlr Error Unknown. + */ + EMtlrErrorUnknown, + /** + This response is sent back to the network when System has failed to + do the privacy check due to some Miscellaneous reasons + */ + ESystemFailure , + /** + The response is sent when the privacy verification has failed because of Unexpected data + values retrieved from the Location Notification request generated by the Network. + This generates an Error-Prone response from UE + */ + EUnexpectedDataValue + }; + + /** + TMtlrReject is used by the Overloaded RMobileLocationServices::SendMtlrResponse() API + It holds the details of the Response being rejected due to one of the problems reported to the UE + for the MTLR request being made. + @internalAll + */ + enum TMtlrReject + { + /** + Mtlr Reject Unknown. + */ + EMtlrRejectUnknown, + /** + This indication is given under a scenario where the UE wants to reject a request, + It is done by invoking Duplicate ID's. + */ + EDuplicateInvokeID, + /** + This indication is given under a scenario where the UE wants to reject a request, + It is done by saying the operation is not recognized + */ + EUnrecognizedOperation, + /** + This invokes a problem indicating Resource Limitation. + */ + EResourceLimitation, + /** + This Invokes a problem initiating release. + */ + EInitiatingRelease, + /** + This invokes a problem indicating that the ID linked with the Client information + is unrecognized + */ + EUnrecognizedLinkedID, + /** + This invokes a problem of Linked Response Unexpected + */ + ELinkedResponseUnexpected, + /** + This invokes a problem of Unexpected Linked Operation + */ + EUnexpectedLinkedOperation, + /** + This invokes a problem of Mistyped Parameter. + */ + EMistypedParameter + }; + + /**************************************************************/ + // MOLR // + /**************************************************************/ + + /** + TMolrType is used by the SendMolr() API. + This gives an indication of type of Molr request the UE wants to invoke + @internalAll + */ + enum TMolrType + { + /** + MolrType UnKnown + */ + EMolrTypeUnknown, + /** + UE is requesting the Network for its Location Estimate + */ + ELocationEstimate, + /** + UE is requesting the Network for GPS Assistance data + */ + EAssistanceData, + /** + UE is requesting the Network for DecipheringKeys + */ + EDecipheringKeys + }; + + /** + TResponseTime is used by SendMolr() API + This enum holds the various types of delay that an UE is expecting. + @internalAll + */ + enum TResponseTime + { + /** + Response Time Unknown. + */ + EResponseTimeunknown, + /** + This enum value indicates that the UE expects a Less Time Delay + from Network in responding to its request + */ + ELowDelay, + /** + This enum value indicates that the UE expects a Long Time Delay + from Network in responding to its request and is tolerant to it. + */ + EDelayTolerant + }; + + /** + TLocationMethod is used by SendMolr() API + This is an enum which lists out all different types of Location methods that an UE can request + @internalAll + */ + enum TLocationMethod + { + /** + Location Method Unknown + */ + ELocationMethodunknown, + /** + This indication is given under a scenario where the UE wants a MS (Mobile Station) Based Location Fix. + This can be termed as UE Assisted Location Fix(EOTD-Enhanced observed time difference). + */ + EMSBasedEOTD, + /** + This indication is given under a scenario where the UE wants a MS (Mobile Station) Assisted Location Fix. + This can be termed out as UE based location fix. + */ + EMSAssistedEOTD, + /** + This indication is given under a scenario where the UE wants a MS (Mobile Station) Assisted GPS data. + */ + EMSAssistedGPS, + /** + This indication is given under a scenario where the UE wants a MS (Mobile Station) based location fix + (OTDOA-Observed time difference of arrival). + */ + EMSBasedOTDOA + }; + + /** + TQosV1 is used by SendMolr() API + This is a class with details of accuracy of Position information, Response Time, + expected to be received from the network. + @see TResponseTime + @internalAll + */ + class TQosV1 + { + public: + /** + This gives an information of the amount of Horizontal accuracy that the UE is expecting. + */ + TUint8 iHorizontalAccuracy; + /** + This gives an information of the amount of Vertical accuracy that the UE is expecting. + */ + TUint8 iVerticalAccuracy; + /** + This enum indicates the Response Time expected by the UE to receive a response for its MOlr request. + */ + TResponseTime iResponseTime; + }; + + /** + TMolrErrors is used by SendMolr() API + This is an enum which lists out all the possible errors that can be + reported to UE by an External Client or the Network. + @internalAll + */ + enum TMolrErrors + { + /** + Molr Error Unknown + */ + EMolrErrorUnknown, + /** + This indication is given to the UE when the Location Report is unable to reach the + External Client due to some failure in the Network Connections. + */ + EMolrSystemFailure, + /** + This indication is given back to the UE by the Network to the UE or by the + External Client to the UE,where the UE generated MOLR has some unexpected values. + */ + EMolrUnexpectedDataValue, + /** + This indication is given back to the UE by the Network to the UE or by the + External Client to the UE,where the UE generated MOLR had a data discrepancy + */ + EMolrDataMissing, + /** + This indication is given by the Network to the UE, + when the UE is not given a facility to make a MOLR request + */ + EMolrFacilityNotSupported, + /** + This indication is given by the Network to the UE, + when the subscription profile of the UE doesn't match with the requests made by it. + */ + EMolrSS_SubscriptionViolation, + /** + This indication is given by the Network to the UE, + when the UE or the Network failed to generate the Location estimate + */ + EMolrPositionMethodFailure + }; + + /** + TStartMolrV7 is used by SendMolr() API + This class lists the details send by UE to Network when a Molr request is being made. + @see TMolrType + @see TQosV1 + @see TLocationEstimateType + @see TLcsClientExternalID + @see TGpsAssistanceData + @see TLocationMethod + @internalAll + */ + class TStartMolrV7: public RMobilePhone::TMultimodeType + { + public: + IMPORT_C TStartMolrV7(); + public: + /** + TMolrType holds the type of Molr request being made + */ + TMolrType iMolrType; + /** + TQosV1 lists out the Quality of Service expected by UE + */ + TQosV1 iQos; + /** + Type of Location Estimate requested + */ + TLocationEstimateType iMolrLocationEstimateType; + /** + Id of the External client + */ + TLcsClientExternalID iLcsClientExternalID; + /** + Type of GpsAssistanceData + */ + TGpsAssistanceData iGpsAssistanceData; + /** + Type of Location method requested + */ + TLocationMethod iLocationMethod ; + /** + Type of Service requested + */ + TUint8 iLcsServiceTypeID; + }; + /** + A typedef'd packaged TStartMolrV7 for passing through a + generic API method. + + @internalAll + */ + typedef TPckg TStartMolrV7Pckg; + + /** + TMolrReturnResultV7 is used by SendMolr() API + This class lists all the Molr return results that can be expected for the Molr request + being made. + @see TLcsLocationEstimate + @see TLcsVelocityEstimate + @see TMolrErrors + @internalAll + */ + class TMolrReturnResultV7: public RMobilePhone::TMultimodeType + { + public: + IMPORT_C TMolrReturnResultV7(); + public: + /** + This gives the Location Estimate of the UE + */ + TLcsLocationEstimate iLocationEstimate; + /** + This gives the Velocity Estimate of the UE + */ + TLcsVelocityEstimate iVelocityEstimate; + /** + This gives the indication of the type of error occured + */ + TMolrErrors iMolrErrors; + }; + + /** + A typedef'd packaged TMolrReturnResultV7 for passing through a + generic API method. + + @internalAll + */ + typedef TPckg TMolrReturnResultV7Pckg; + + //**************************************// + // Measurement Control Data structures // + //**************************************// + + enum + { + /**Maximum number of monitored cells RACH*/ + KMaxMonitoredCells = 8, + /**Maximum number of satellites*/ + KMaxSat = 16, + /**GlobalHealth size. 364 bits =46 bytes (Rounded) */ + KGlobalHealthSize = 46 + }; + + /**This enum contains the possible types of measurement commands.*/ + enum TMeasurementCmd + { + /**Measurement Command Unknown*/ + EMeasCommandUnknown, + /**Setup a new measurement*/ + ESetup, + /**Modify a previously defined measurement, e.g. to change the reporting criteria*/ + EModify, + /**Indicates to stop a measurement and clear all information in the UE that are related to that measurement */ + ERelease, + }; + + /**This enum contains the possible positioning method types*/ + enum TUePosMethodType + { + /**Positioning Method Type unknown*/ + EPosMethodTypeUnknown, + /**UE Assisted : The network computes the location of the UE.*/ + EUeAssisted, + /**UE Based : The UE computes the location of itself*/ + EUeBased, + }; + + /**This enum contains the possible positioning methods*/ + enum TPosMethod + { + /**Positioning Method unknown*/ + EPosMethodUnknown, + /**OTDOA may be selected by the SRNC as the method to be used on receipt of an LCS positioning request from the CN */ + EOtdoa, + /**These methods make use of UEs, which are equipped with radio receivers capable of receiving GPS signals*/ + EGps, + /**Use either OTDOA or GPS positioning method.*/ + EOtdoaOrGps, + /** + In the cell ID based (i.e. cell coverage) method, the position of an UE is + estimated with the knowledge of its serving Node B. The information about the serving + Node B and cell may be obtained by paging,locating area update, cell update, URA update, or routing area update. + */ + ECellID + }; + + /** + This class contains the information which is part of the Navigation Model. + This can be requested by the UE as part of additional request. + */ + class TSatDataV1 + { + public: + /**Satellite identity*/ + TUint8 iSatID; + /**Issue of Data Ephemeris for SatID*/ + TUint8 iIode; + }; + + /** + This class contains the additional information that can be requested by the UE. + */ + class TNavModelAddlDataReqV1 + { + public: + /**GPS time in weeks*/ + TUint16 iGpsWeek; + /**GPS time of ephemeris in hours of the latest ephemeris set contained by the UE.*/ + TUint8 iGpsToe; + /**Ephemeris age tolerance of the UE to UTRAN in hours.*/ + TUint8 iTToeLimit; + /**Satellite Identities + @see TSatDataV1*/ + TSatDataV1 iSatData[KMaxSat]; + }; + + /**This class contains the indicators to request for additional assistance data from the network.*/ + class TGpsAddlAssistDataReqV1 + { + public: + /**ETrue indicates Almanac Data is requested + @see TAlmanacV1*/ + TBool iAlmanacRequest; + /**ETrue indicates UTC model Data is requested + @see TUtcModelV1*/ + TBool iUtcModelRequest; + /**ETrue indicates Ionospheric Model Data is requested + @see TUtcModelV1*/ + TBool iIonosphericModelRequest; + /**ETrue indicates Navigation model Data is requested + @see TIonosphericModelV1*/ + TBool iNavigationModelRequest; + /**ETrue indicates DGPS corrections Data is requested + @see TNavigationModelSatInfoV1*/ + TBool iDgpsCorrectionsRequest; + /**ETrue indicates Reference location Data is requested + @see TDgpsCorrectionsV1*/ + TBool iReferenceLocationRequest; + /**ETrue indicates Reference time Data is requested + @see TReferenceLocationV1*/ + TBool iReferenceTimeRequest; + /**ETrue indicates Acquisition assistance Data is requested + @see TReferenceTimeV1*/ + TBool iAcquisitionAssistanceReq; + /**ETrue indicates Realtime integrity Data is requested + @see TAcquisitionAssistanceV1*/ + TBool iRealTimeIntegrityRequest; + /**This member is included only if Navigagion Model Data is requested (iNavigationModelRequest is ETrue). + @see TNavModelAddlDataReqV1*/ + TNavModelAddlDataReqV1 iNavModelAddlDataReq; + }; + + /**This class contains the UE positioning reporting quantity*/ + class TUePosReportingQuantityV1 + { + public: + /**Holds the positioning method type*/ + TUePosMethodType iUePosMethodType; + /**Holds the positioning method*/ + TPosMethod iPosMethod; + /**Holds the horizontal accuracy*/ + TInt8 iHorzAccuracy; + /**Holds the vertical accuracy*/ + TInt8 iVertAccuracy; + /**If true the SRNC wants the UE to report the SFN-GPS timing of the reference cell.*/ + TBool iGpsTimingOfCellWanted; + /**ETrue indicates that the UE is requested to send the IE "Additional assistance Data Request" + when the IE "UE positioning Error" is present in the UE positioning measured results. + EFalse indicates that the UE shall use the assistance data available. + */ + TBool iAddlAssistanceDataReq; + }; + + /**This enum contains the states in which measurements are valid*/ + enum TMeasurementValidity + { + /**Measurement Validity Unknown*/ + EMeasValidityUnknown, + /**Indicates measurement is valid in CellDCH state*/ + ECellDCH, + /**Indicates measurement is valid except in CellDCH state*/ + EAllButCellDCH, + /**Indicates measurement is valid in all state*/ + EAllStates + }; + + /**This enum list the SfnTow uncertainity*/ + enum TSfnTowUncertainity + { + /**Sfn Tow Uncertainity unknown*/ + ESfnTowUncertainityUnknown, + /**SfnTowUncertainity < 10*/ + ELessThan10, + /**SfnTowUncertainity > 10*/ + EMoreThan10 + }; + + /**This enum lists the different GPS drift rates*/ + enum TUtranGpsDriftRate + { + /**GPS Drift rate unknown*/ + EDriftRateUnknown, + /**Drift = 0*/ + EUtranGpsDrift0, + /**Drift = 1*/ + EUtranGpsDrift1, + /**Drift = 2*/ + EUtranGpsDrift2, + /**Drift = 5*/ + EUtranGpsDrift5, + /**Drift = 10*/ + EUtranGpsDrift10, + /**Drift = 15*/ + EUtranGpsDrift15, + /**Drift = 25*/ + EUtranGpsDrift25, + /**Drift = 50*/ + EUtranGpsDrift50, + /**Drift = -1*/ + EUtranGpsDriftMinus1, + /**Drift = -2*/ + EUtranGpsDriftMinus2, + /**Drift = -5*/ + EUtranGpsDriftMinus5, + /**Drift = -10*/ + EUtranGpsDriftMinus10, + /**Drift = -15*/ + EUtranGpsDriftMinus15, + /**Drift = -25*/ + EUtranGpsDriftMinus25, + /**Drift = -50*/ + EUtranGpsDriftMinus50, + }; + + /**This enum lists the different Udre values*/ + enum TDiffCorrectionsStatus + { + /**Diff Corrections Status unknown*/ + ECorrectionStatusUnknown, + /**UDRE 1.0 */ + EUdre1Point0, + /**UDRE 0.75 */ + EUdre0Point75, + /**UDRE 0.5 */ + EUdre0Point5, + /**UDRE 0.3 */ + EUdre0Point3, + /**UDRE 0.2 */ + EUdre0Point2, + /**UDRE 0.1 */ + EUdre0Point1, + /**UDRE No Data */ + ENoData, + /**UDRE Invalid Data */ + EInvalidData + }; + + /**This class reserves members for future use*/ + class TSubFrame1ReservedV1 + { + public: + /**Reserve member 1*/ + TUint iReserved1; + /**Reserve member 2*/ + TUint iReserved2; + /**Reserve member 3*/ + TUint iReserved3; + /**Reserve member 4*/ + TUint iReserved4; + }; + + /**This class contains information for GPS ephemeris and clock correction.*/ + class TEphemerisParameterV1 + { + public: + /**Code(s) on L2 Channel */ + TUint8 iCodeOnL2; + /**User Range Accuracy */ + TUint8 iUraIndex; + /**Health of Satellite*/ + TUint8 iSatHealth; + /**Issue of Data, Clock */ + TUint16 iIodc; + /**L2 channel flag*/ + TUint8 iL2Flag; + TSubFrame1ReservedV1 iSubFrame1Reserved; + /**Estimated group delay differential */ + TUint8 iTGd; + /**Apparent clock correction*/ + TUint16 iTOc; + /**Apparent clock correction*/ + TUint8 iAf2; + /**Apparent clock correction*/ + TUint16 iAf1; + /**Apparent clock correction*/ + TUint iAf0; + /**Amplitude of the Sine Harmonic Correction Term to the Orbit Radius (meters)*/ + TUint16 iCRs; + /**Mean Motion Difference From Computed Value (semi-circles/sec)*/ + TUint16 iDeltaN; + /**Mean Anomaly at Reference Time (semi-circles)*/ + TUint iM0; + /**Amplitude of the Cosine Harmonic Correction Term To The Argument Of Latitude (radians)*/ + TUint16 iCUc; + /**Eccentricity*/ + TUint iE; + /**Amplitude of the Sine Harmonic Correction Term To The Argument Of Latitude (radians)*/ + TUint16 iCUs; + /**Semi-Major Axis in squareroot(meters) */ + TUint iASqrt; + /**Reference Time Ephemeris */ + TUint16 iTOe; + /** + Fit interval flag + @see ICD-GPS-200 + */ + TUint8 iFitInterval; + /**Age Of Data Offset */ + TUint8 iAodo; + /**Amplitude of the Cosine Harmonic Correction Term To The Angle Of Inclination (radians)*/ + TUint16 iCIc; + /**Longitude of Ascending Node of Orbit Plane at Weekly Epoch (semi-circles) */ + TUint iOmega0; + /**Amplitude of the Sine Harmonic Correction Term To The Angle Of Inclination (radians) */ + TUint16 iCIs; + /**Inclination Angle at Reference Time (semi-circles) */ + TUint i0; + /**Amplitude of the Cosine Harmonic Correction Term to the Orbit Radius (meters) */ + TUint16 iCRc; + /**Argument of Perigee (semi-circles) */ + TUint iOmega; + /**Longitude of Ascending Node of Orbit Plane at Weekly Epoch (semi-circles/sec) */ + TUint iOmegaDot; + /**Rate of Inclination Angle (semi-circles/sec) */ + TUint16 iDot; + }; + + /**This enum specifies the possible status of a satellite*/ + enum TSatelliteStatus + { + /**Satellite Status unknown*/ + ESatStatusUnknown, + /**New satellite, new Navigation Model*/ + ENsNnU, + /**Existing satellite, same Navigation Model*/ + EEsSn, + /**Existing satellite, new Navigation Model*/ + EEsNnU, + /**Reserved*/ + ERev2, + /**Reserved*/ + ERev + }; + + /**This class contains the navigation model satellite information*/ + class TNavigationModelSatInfoV1 + { + public: + /**Satellite identification*/ + TUint8 iSatID; + /**Status of the satellite*/ + TSatelliteStatus iSatelliteStatus; + /**Contains information for GPS ephemeris and clock correction.*/ + TEphemerisParameterV1 iEphemerisParameter; + }; + + /** + This class contains the ionospheric model information needed to model + the propagation delays of the GPS signals through the ionosphere + */ + class TIonosphericModelV1 + { + public: + /** + The parameters *n are the coefficients of a cubic equation + representing the amplitude of the vertical delay. + @see ICD-GPS-200 + */ + /**Alfa = 0*/ + TUint8 iAlfa0; + /**Alfa = 1*/ + TUint8 iAlfa1; + /**Alfa = 2*/ + TUint8 iAlfa2; + /**Alfa = 3*/ + TUint8 iAlfa3; + /** + The parameters *n are the coefficients of a cubic equation + representing the period of the ionospheric model + @see ICD-GPS-200 + */ + /**Beta = 0*/ + TUint8 iBeta0; + /**Beta = 1*/ + TUint8 iBeta1; + /**Beta = 2*/ + TUint8 iBeta2; + /**Beta = 3*/ + TUint8 iBeta3; + }; + + /** + This class contains the UTC model information needed to relate GPS time to Universal Time Coordinate (UTC) + @see ICD-GPS-200 + */ + class TUtcModelV1 + { + public: + /** + Time in seconds. + @see ICD-GPS-200. + */ + TUint iA1; + /** + Time in seconds. + @see ICD-GPS-200. + */ + TUint iA2; + /**Time in seconds + @see ICD-GPS-200 + */ + TUint8 iTOt; + /**weeks + @see ICD-GPS-200 + */ + TUint8 iWnT; + /**Time in seconds + @see ICD-GPS-200 + */ + TUint8 iDeltaTLs; + /**Weeks + @see ICD-GPS-200 + */ + TUint8 iWnLsf; + /**Days + @see ICD-GPS-200 + */ + TUint8 iDn; + /**Seconds + @see ICD-GPS-200 + */ + TUint8 iDeltaTLsf; + }; + + /**This class contains a reduced-precision subset of the ephemeris and clock correction parameters.*/ + class TAlmanacSatInfoV1 + { + public: + /**Data identification*/ + TUint8 iDataID; + /**Eccentricity*/ + TUint16 iE; + /**Reference Time of Almanac */ + TUint8 iTOa; + /**@see ICD-GPS-200*/ + TUint16 iDeltaI; + /**Longitude of Ascending Node of Orbit Plane at Weekly Epoch (semi-circles/sec) */ + TUint16 iOmegaDot; + /**Satellite health*/ + TUint8 iSatHealth; + /**Semi-Major Axis in squareroot(meters)*/ + TUint iASqrt; + /**Longitude of Ascending Node of Orbit Plane at Weekly Epoch (semi-circles) */ + TUint iOmega0; + /**Mean Anomaly at Reference Time (semi-circles) */ + TUint iM0; + /**Argument of Perigee (semi-circles) */ + TUint iOmega; + /**Apparent clock correction */ + TUint16 iAf0; + /**Apparent clock correction */ + TUint16 iAf1; + }; + + /**This class holds the coarse, long-term model of the satellite positions and clocks.*/ + class TAlmanacV1 + { + public: + /**Almanac Reference Week */ + TUint8 iWnA; + TAlmanacSatInfoV1 iAlmanacSatInfoList[KMaxSat]; + /**This enables GPS time recovery and possibly extended GPS correlation intervals.*/ + TUint16 iSvGlobalHealth[KGlobalHealthSize]; + }; + + /**This union contains the information specific to mode - FDD/TDD*/ + union TModeSpecificInfoV1 + { + /**Used in FDD mode*/ + TUint16 iPrimaryScramblingCode; + /**Used in TDD mode*/ + TUint16 iCellParametersID; + }; + + /**This class contains parameters that enable fast acquisition of the GPS + signals in UE-assisted GPS positioning.*/ + class TAcquisitionAssistanceV1 + { + public: + /**Specifies GPS reference time*/ + TUint iGpsReferenceTime; + /**Specifies GPS reference time specific to mode - FDD/TDD*/ + TModeSpecificInfoV1 iUtranGpsReferenceTime; + /**ETrue indicates iUtranGpsReferenceTime is iPrimaryScramblingCode. + EFalse indicates iUtranGpsReferenceTime is iCellParametersID*/ + TBool iUtranGpsRefTimeStatus; + }; + + /** + The UDRE provides an estimate of the uncertainty (1-*) in the corrections for + the particular satellite. The value in this field shall be multiplied by the + UDRE Scale Factor in the common Corrections Status/Health field to determine the + final UDRE estimate for the particular satellite. + @see 3GPP TS 25.305 + */ + enum TUdre + { + /**Udre unknown*/ + EUdreUnknown, + /** UDRE < 1*/ + ELessThan1, + /** 1> UDRE < 4*/ + EBtw1And4, + /** 1> UDRE < 8*/ + EBtw1And8, + /** UDRE > 8*/ + EOver8 + }; + + /**This class contains DGPS corrections to be used by the UE*/ + class TDgpsCorrectionSatInfoV1 + { + public: + /**Satellite identification*/ + TUint8 iSatID; + /**Issue of Data Ephemeris for SatID.*/ + TUint8 iIode; + /** + The UDRE provides an estimate of the uncertainty (1-*) in the corrections for + the particular satellite. The value in this field shall be multiplied by the + UDRE Scale Factor in the common Corrections Status/Health field to determine the + final UDRE estimate for the particular satellite. + @see 3GPP TS 25.305 + */ + TUdre iUdre; + /**The PRC indicates the correction to the pseudorange for the particular satellite at the GPS Reference Time*/ + TInt16 iPrc; + /** + This information indicates the rate-of-change of the pseudorange correction for the particular satellite, + using the satellite ephemeris identified by the IODE IE + */ + TInt8 iRrc; + /**For future use*/ + TInt8 iDummy1; + /**For future use*/ + TInt8 iDummy2; + }; + + /**This class contains the DGPS corrections information*/ + class TDgpsCorrectionsV1 + { + public: + /**GPS time of week*/ + TUint16 iGpsTow; + /**This information indicates the status of the differential corrections contained in the message.*/ + TDiffCorrectionsStatus iStatusHealth; + /**This member data contains DGPS corrections of the satellites to be used by the UE*/ + TDgpsCorrectionSatInfoV1 iDgpsCorrectionSatInfoList[KMaxSat]; + }; + + /**This enum containst the possible signs of latitude*/ + enum TLatitudeSign + { + /**Latitude Sign Unknown*/ + ELatitudeSignUnknown, + /**Latitude sign is north*/ + ENorth, + /**Latitude sign is south*/ + ESouth + }; + + /**This enum contains the possible directions of altitudes for reference location*/ + enum TAltDirection + { + /**Altitude Direction Unknown*/ + EAltDirectionUnknown, + /**Indicates Altitude direction is height-wise*/ + EHeight, + /**Indicates Altitude direction is depth-wise*/ + EDepth + }; + + /**This class contains a 3-D location (with uncertainty)*/ + class TReferenceLocationV1 + { + public: + /**Specifies the sign - North/South*/ + TLatitudeSign iLatitudeSign; + /**Degree of latitude*/ + TUint16 iLatitude; + /**Degree of longitude*/ + TInt16 iLongitude; + /**Direction of altitude*/ + TAltDirection iAltDirection; + /**Degree of altitude*/ + TUint16 iAltitude; + /**Uncertainty semi major axis*/ + TUint8 iUncertainitySemiMajor; + /**Uncertainty semi minor axis*/ + TUint8 iUncertainitySemiMinor; + /**Orientation of major axis*/ + TUint8 iOrientationMajorAxis; + /**The uncertainty in altitude, h, expressed in metres*/ + TUint8 iUncertainityAltitude; + /**The confidence by which the position of a target entity is known to be within the shape description*/ + TUint8 iConfidence; + }; + + /** + Contains several fields in the Telemetry (TLM) Word and Handover Word (HOW) + that are currently being broadcast by the respective GPS satellites. Combining this information + with GPS TOW helps the UE with time-recovery needed to predict satellite signal. + */ + class TGpsTowAssistV1 + { + public: + /**Satellite identification*/ + TUint8 iSatID; + /** + Contains a 14-bit value representing the Telemetry Message (TLM) + being broadcast by the GPS satellite identified by the particular SatID, + with the MSB occurring first in the satellite transmission. + */ + TUint16 iTlmMsg; + /** + Contains the two reserved bits in the TLM Word + being broadcast by the GPS satellite identified by SatID, + with the MSB occurring first in the satellite transmission. + */ + TUint8 iTlmReserved; + /**Contain the Alert flags that are being broadcast by the GPS satellite identified by SatID.*/ + TBool iAlert; + /**Contain the Anti-Spoof that are being broadcast by the GPS satellite identified by SatID.*/ + TBool iAntiSpoof; + }; + + /**This class contains information that may be used to provide a mapping between UTRAN and GPS time*/ + class TUtranGpsRefTimeV1 + { + public: + /**UE-GPS timing of cell ms-part*/ + TUint16 iMsPart; + /**UE-GPS timing of cell ls-part*/ + TUint16 iLsPart; + /**System frame number*/ + TUint16 iSfn; + /**Specifies GPS reference time specific to mode - FDD/TDD*/ + TModeSpecificInfoV1 iModeSpecificInfo; + /**ETrue indicates iUtranGpsReferenceTime is iPrimaryScramblingCode. + EFalse indicates iUtranGpsReferenceTime is iCellParametersID*/ + TBool iModeSpecificInfoStatus; + }; + + /** + This class contains several fields in the Telemetry (TLM) Word and Handover Word (HOW) + that are currently being broadcast by the respective GPS satellites. Combining this information + with GPS TOW helps the UE with time-recovery needed to predict satellite signal. + */ + class TReferenceTimeV1 + { + public: + /**GPS time in weeks*/ + TUint16 iGpsWeek; + /**GPS Time of Week in milliseconds */ + TUint16 iGpsTowOneMsec; + /**GPS reference time may be used to provide a mapping between UTRAN and GPS time*/ + TUtranGpsRefTimeV1 iUtranGpsRefTime; + /** + This field indicates the uncertainty of the relation GPS TOW/SFN. + ELessThan10 means the relation is accurate to at least 10 ms. + */ + TSfnTowUncertainity iSfnTowUncertainity; + /**Drift rate of the NODE B clock relative to GPS time.*/ + TUtranGpsDriftRate iUtranGpsDriftRate; + /** + Contains several fields in the Telemetry (TLM) Word and Handover Word (HOW) + that are currently being broadcast by the respective GPS satellites. Combining this information + with GPS TOW helps the UE with time-recovery needed to predict satellite signal. + */ + TGpsTowAssistV1 iGpsTowAssistList[KMaxSat]; + }; + + /**This class contains the GPS Assistance Data received from network*/ + class TUePosGpsAssistanceDataV1 + { + public: + /**GPS reference time may be used to provide a mapping between UTRAN and GPS time.*/ + TReferenceTimeV1 iReferencTime; + /**The Reference Location contains a 3-D location (with uncertainty)*/ + TReferenceLocationV1 iReferenceLocation; + /** + Holds information to allow a UE to estimate its position more accurate, + biases in the pseudorange measurements may be provided to the UE. + */ + TDgpsCorrectionsV1 iDgpsCorrections; + /**Holds navigation model satellite information*/ + TNavigationModelSatInfoV1 iNavigationModel; + /** + The Ionospheric Model contains information needed to model + the propagation delays of the GPS signals through the ionosphere. + */ + TIonosphericModelV1 iIonosphericModel; + /**UTC parameters may be used to provide Coordinated Universal Time to the UE.*/ + TUtcModelV1 iUtcModel; + /**Holds the coarse, long-term model of the satellite positions and clocks.*/ + TAlmanacV1 iAlmanac; + /**Holds the acquistions assistance information of the UE*/ + TAcquisitionAssistanceV1 iAcquisitionAssistance; + /**Holds the list of bad satellites*/ + TUint8 iBadSatList[KMaxSat]; + /** + This member specifies which of the above additional data structures are populated. + */ + TGpsAddlAssistDataReqV1 iGpsAddlDataStatus; + }; + + /**This class contains the GPS assistance data required to compute the UE Postioning information*/ + class TUePosMeasurementV1 + { + public: + /** + The purpose of the element is to express the allowed/required location method(s), + and to provide information desired QoS. + */ + TUePosReportingQuantityV1 iUePosReportingQuantity; + /**This member data defines in which UE states the measurement is valid.*/ + TMeasurementValidity iMeasurementValidity; + /**This member data holds the GPS Assistance Data sent by the network*/ + TUePosGpsAssistanceDataV1 iUePosGpsAssistanceData; + }; + + /**This holds the possible types of measurement commands that can be specified*/ + union TMeasurementCommandV1 + { + /**Setup a new measurement*/ + TUePosMeasurementV1 iSetup; + /**Modify a previously defined measurement*/ + TUePosMeasurementV1 iModify; + /**Stop the measurement and clear all information in the UE that are related to that measurement.*/ + TBool iRelease; + }; + + /**This enum specifies the mode the UE shall use to transmit the measurement report*/ + enum TMeasReportTransferMode + { + /**Transfer mode unknown*/ + ETransferModeUnknown, + /**The UE shall transmit the measurement report using Acknowledged RLC mode*/ + EAckModeRlc, + /**The UE shall transmit the measurement report using Unacknowledged RLC mode*/ + EUnAckModeRlc + }; + + /** + This class contains the GPS assistance data needed by the UE to compute the location + of the UE. The UE computes the location once it receives all required information. + */ + class TMeasurementControlV7 : public RMobilePhone::TMultimodeType + { + public: + IMPORT_C TMeasurementControlV7(); + public: + /** + A reference number that should be used by the UTRAN when setting up, + modifying or releasing the measurement and by the UE in the measurement report. + */ + TUint8 iMeasurementIdentity; + /**Specifies the Measurement Setup / Modify / Release*/ + TMeasurementCommandV1 iMeasurementCommand; + /**This specifies whether the UE shall transmit the measurement report using AM or UM RLC.*/ + TMeasReportTransferMode iMeasReportTransferMode; + /**ETrue indicates velocity estimate is requested. EFalse indicates velocity estimate is not requested*/ + TBool iVelocityRequested; + /**Holds the type of measurement command being used*/ + TMeasurementCmd iMeasurementCmdStatus; + }; + /** + A typedef'd packaged TMeasurementControlV7 for passing through a + generic API method. + + @internalAll + */ + typedef TPckg TMeasurementControlV7Pckg; + + //**************************************// + // Measurement Report Data structures // + //**************************************// + + + /** + This enum contains the indicators thta specify which + union members of TMeasurementQuantityV1 are included + */ + enum TMeasQnty + { + /**Measurement Quantity unknown*/ + EMeasQntyUnknown, + /**Indicates that CpichEcN0 is present*/ + EMeasQntyCpichEcN0Present, + /**Indicates that CpichRscp is present*/ + EMeasQntyCpichRscpPresent, + /**Indicates that path loss is present*/ + EMeasQntyPathLossPresent, + }; + + /** + This enum contains the indicators that specify which + union members of TPosEstimateRefTime and TPositionEstimateV1 are included + */ + enum TPosEstimateInfo + { + /**Position Estimate Info Unknown*/ + EPosEstimateInfoUnknown, + /** + NOTE: The following states correspond to TUePosPositionEstimateInfoV1/TPosEstimateRefTime + Indicates that UE positioning estimate reference time is populated + */ + EUtranGpsRefTimeResultPresent, + /**Indicates that GPS reference time is populated*/ + EGpsRefTimeOnlyPresent, + /**Indicates that cell timing is populated*/ + ECellTimingPresent, + /** + NOTE: The following states correspond to TUePosPositionEstimateInfoV1/TPositionEstimateV1. + Indicates EllipsoidPoint is populated + */ + EEllipsoidPointPresent, + /**Indicates EllipsoidPoint with uncertainty circle is populated*/ + EEllipsoidPointUncertCirclePresent, + /**Indicates EllipsoidPoint with uncertainty ellipse is populated*/ + EEllipsoidPointUncertEllipsePresent, + /**Indicates EllipsoidPoint with altitude is populated*/ + EEllipsoidPointAltitudePresent, + /**Indicates EllipsoidPoint with altitude and ellipse is populated*/ + EEllipsoidPointAltEllipsePresent, + }; + + /**This enum contains the possible types of velocity estimates*/ + enum TVelEstimate + { + /**Velocity Estimate Unknown*/ + EVelEstimateUnknown, + /**Velocity Estimate is not present*/ + EVelEstimateNotPresent, + /**Horizontal velocity is included*/ + EHorzVelPresent, + /**Horizontal and vertical velocity is included*/ + EHorzWithVertVelPresent, + /**Horizontal velocity with uncertainty is included*/ + EHorzVelWithUncertPresent, + /**Horizontal and vertical velocity with uncertainty is included*/ + EHorzWithVertVelAndUncertPresent, + }; + + /**This contains the measurement quantities of the UE*/ + union TMeasurementQuantityV1 + { + public: + /** + @see 3GPP TS 25.133. + @see 3GPP TS 25.123. + */ + TUint8 iCpichEcN0; + /** + @see 3GPP TS 25.133. + @see 3GPP TS 25.123. + */ + TUint8 iCpichRscp; + /**Measurement path loss in dB.*/ + TUint8 iPathLoss; + /**Extra for future use*/ + TBool iSpare; + }; + + /**This class contains the current cell informations in TDD mode*/ + class TTddV1 + { + public: + /** + Time slot Interference on Signal Code Power + @see 3GPP TS 25.123 + */ + TUint8 iTimeSlotIscp; + /**Primary Common Control Physical CHannel received signal code power*/ + TUint8 iPrimaryCcpchRscp; + }; + + /**This class contains the information in FDD mode*/ + class TFddV1 + { + public: + /**Holds the measurement quantities of the UE*/ + TMeasurementQuantityV1 iMeasurementQuantity; + /**Holds the field that would be populated in iMeasurementQuantity*/ + TMeasQnty iMeasQntyStatus; + }; + + /**This contains the current cell information in specific modes - FDD/TDD*/ + union TCurrentCellV1 + { + /**Current cell information in FDD mode*/ + TFddV1 iFdd; + /**Current cell information in TDD mode*/ + TTddV1 iTdd; + }; + + /**This contains the type of sfn-sfn observed time difference*/ + union TSfnSfnObsTimeDifferenceV1 + { + /**Sfn-Sfn observed time difference -type1*/ + TUint16 iSfnSfnObsTimeDiff1; + /**Sfn-Sfn observed time difference -type2*/ + TUint16 iSfnSfnObsTimeDiff2; + }; + + /**This class contains the FDD mode information of monitored cells*/ + class TMonitoredCellFddV1 + { + public: + /**Primary Common Control Physical CHannel information*/ + TUint16 iPrimaryCpichInfo; + /**Holds the measurement quantities of the UE*/ + TMeasurementQuantityV1 iMeasurementQuantity; + /**Holds the field that would be populated in iMeasurementQuantity*/ + TMeasQnty iMeasQntyStatus; + }; + + /**This class contains the TDD mode information of monitored cells*/ + class TMonitoredCellTddV1 + { + public: + /**Cell identification*/ + TUint8 iCellParametersID; + /**Primary Common Control Physical CHannel received signal code power*/ + TUint8 iPrimaryCcpchRscp; + }; + + /**This contains the monitored cells information in specific mode - FDD/TDD*/ + union TMonitoredCellModeSpecificInfoV1 + { + /**Monitored Cell information in FDD mode*/ + TMonitoredCellFddV1 iMonitoredCellFdd; + /**Monitored Cell information in TDD mode*/ + TMonitoredCellTddV1 iMonitoredCellTdd; + }; + + /**This class contains the measured results for monitored cells on Random Access Channel*/ + class TMonitoredCellRachResultV1 + { + public: + /**Holds the sfn-sfn observed time difference*/ + TSfnSfnObsTimeDifferenceV1 iSfnSfnObsTimeDiff; + /**Holds the monitored cells specific info mode - FDD/TDD*/ + TMonitoredCellModeSpecificInfoV1 iMonitoredCellModeSpecificInfo; + /**ETrue indicates iMonitoredCellModeSpecificInfo is iMonitoredCellFdd. + EFalse indicates iMonitoredCellModeSpecificInfo is iMonitoredCellTdd*/ + TBool iSfnSfnObsTimeDiffStatus; + }; + /** + Horizontal velocity is characterised by the horizontal speed and bearing. + The horizontal speed gives the magnitude of the horizontal component of the velocity of a UE. + The bearing provides the direction of the horizontal component of velocity taken clockwise from North. + @see 3GPP TS 23.032 + */ + class THorzVelocityV1 + { + public: + /**The direction of movement is given in degrees where '0' represents North, '90' represents East, etc.*/ + TUint16 iBearing; + /**The horizontal speed gives the magnitude of the horizontal component of the velocity of a UE*/ + TUint16 iHorzSpeed; + }; + + /**This enum holds vertical speed direction*/ + enum TVertSpeedDirection + { + /**Speed direction unknown*/ + ESpeedDirectionUnknown, + /**Upward direction*/ + EUpward, + /**Downward direction*/ + EDownward + }; + + /** + Horizontal velocity is characterised by the horizontal speed and bearing. + The horizontal speed gives the magnitude of the horizontal component of the velocity of a UE. + The vertical speed and direction provides the component of velocity of a UE in a vertical direction. + The bearing provides the direction of the horizontal component of velocity taken clockwise from North. + @see 3GPP TS 23.032 + */ + class THorzWithVertVelocityV1 + { + public: + /**Direction of vertical speed*/ + TVertSpeedDirection iVertSpeedDirection; + /**The direction of movement is given in degrees where '0' represents North, '90' represents East, etc.*/ + TUint16 iBearing; + /**The horizontal speed gives the magnitude of the horizontal component of the velocity of a UE*/ + TUint16 iHorzSpeed; + /**The vertical speed and direction provides the component of velocity of a UE in a vertical direction.*/ + TUint8 iVertSpeed; + }; + + /** + Horizontal velocity with uncertainty is characterised by a horizontal speed and bearing, + giving a horizontal velocity vector V, and an uncertainty speed s. + @see 3GPP TS 23.032 + */ + class THorzVelocityWithUncertaintyV1 + { + public: + /** The direction of movement is given in degrees where '0' represents North, '90' represents East, etc.*/ + TUint16 iBearing; + /**The horizontal speed gives the magnitude of the horizontal component of the velocity of a UE*/ + TUint16 iHorzSpeed; + /** + Horizontal speed uncertainty. + */ + TUint8 iHorzSpeedUncertainty; + }; + + /** + Horizontal and vertical velocity with uncertainty is characterised by a horizontal speed and bearing, + giving a horizontal velocity vector Vx,y, a vertical speed and direction giving a vertical velocity component Vz, + and uncertainty speeds s1 and s2. + @see 3GPP TS 23.032 + */ + class THorzWithVertVelocityAndUncertaintyV1 + { + public: + /** + The direction of movement is given in degrees where '0' represents North, '90' represents East, etc. + */ + TUint16 iBearing; + /**The horizontal speed gives the magnitude of the horizontal component of the velocity of a UE*/ + TUint16 iHorzSpeed; + /**The vertical speed and direction provides the component of velocity of a UE in a vertical direction.*/ + TUint8 iVertSpeed; + /**Horizontal speed uncertainty.*/ + TUint8 iHorzSpeedUncertainty; + }; + + /** + This class contains the possible ways of velocity estimates + @see 3GPP TS 23.032 + */ + union TVelocityEstimateV1 + { + /**Horizontal velocity*/ + THorzVelocityV1 iHorzVelocity; + /**Horizontal velockity and vertical velocity*/ + THorzWithVertVelocityV1 iHorzWithVertVelocity; + /**Horizontal velocity with uncertainty*/ + THorzVelocityWithUncertaintyV1 iHorzVelocityWithUncertainty; + /**Horizontal and vertical velocity with uncertainty*/ + THorzWithVertVelocityAndUncertaintyV1 iHorzWithVertVelocityAndUncertainty; + }; + + /**This class contains the measured results on Random Access Channel*/ + class TMeasuredResultsOnRachV1 + { + public: + /**Current cell information*/ + TCurrentCellV1 iCurrentCell; + /**Monitored Cell information*/ + TMonitoredCellRachResultV1 iMonitoredCellsRachList[KMaxMonitoredCells]; + /**ETrue indicates iCurrentCell is iFdd. + EFalse indicates iCurrentCell is iTdd*/ + TBool iCurrentCellStatus; + }; + + /** + Identifies the channel in combination with the Midamble shift and slot number. + It is not used in 1.28 Mcps TDD and may be set to either value and should be ignored by the receiver. + */ + enum TBurstType + { + /**Burst type 1*/ + EType1, + /**Burst type 2*/ + EType2 + }; + + /**This class contains UE positioning estimates specific to TDD*/ + class TPosEstimateTddV1 + { + public: + /**Identifies the channel in combination with the Midamble shift and slot number.*/ + TBurstType iBurstType; + /**Midamble shift*/ + TUint8 iMidambleShift; + /** + This member data is present only if no IPDL scheme is configured in the reference cell. + Otherwise the slot is defined by the IPDL configuration. + */ + TUint8 iTimeSlotNumber; + /** + Cell identification + */ + TUint8 iCellParametersID; + }; + + /**This class contains UE positioning estimates specific to FDD/TDD*/ + union TPosEstimateModeSpecificInfoV1 + { + /**Identifies the reference cell for the GPS TOW-SFN relationship.*/ + TUint16 iPrimaryCpichInfo; + /**Holds the cell and channel identification*/ + TPosEstimateTddV1 iCellAndChannelID; + }; + + /**This class contains the cell timing information*/ + class TCellTimingV1 + { + public: + /** + SFN during which the position was calculated. + */ + TUint16 iSfn; + /**Holds the UE positioning estimates specific to mode - FDD or TDD*/ + TPosEstimateModeSpecificInfoV1 iPosEstimateModeSpecificInfo; + /**ETrue indicates iPosEstimateModeSpecificInfo is iPrimaryCpichInfo. + EFalse indicates iPosEstimateModeSpecificInfo is iCellAndChannelID.*/ + TBool iPosEstimateModeStatus; + }; + + /**This class captures the GPS measurement specific to FDD or TDD*/ + union TGpsMeasModeSpecificInfoV1 + { + /**Frequency Division Duplex identification*/ + TUint16 iFddRefID; + /**Time Division Duplex identification*/ + TUint8 iTddRefID; + }; + + /**This class contains results of the GPS reference time*/ + class TUtranGpsRefTimeResultV1 + { + public: + /**UE-GPS timing of cell ms-part*/ + TUint16 iMsPart; + /**UE-GPS timing of cell ls-part*/ + TUint16 iLsPart; + /**Holds the GPS measurement specific to FDD or TDD*/ + TGpsMeasModeSpecificInfoV1 iGpsMeasModeSpecificInfo; + /**Cell System Frame Number*/ + TUint16 iSfn; + /**ETrue indicates iGpsMeasModeSpecificInfo is iFddRefID. + EFalse indicates iGpsMeasModeSpecificInfo is iTddRefID*/ + TBool iGpsMeasModeStatus; + }; + + /**This union contains the UE positioning reference time*/ + union TPosReferenceTimeV1 + { + /**Contains the results of GPS reference time*/ + TUtranGpsRefTimeResultV1 iUtranGpsRefTimeResult; + /**Contains the GPS reference time*/ + TUint16 iGpsRefTimeOnly; + }; + + /** + This class contains the information of ellipsoid. + It consists of a latitude and a longitude. + @see 3GPP TS 23.032 + */ + class TEllipsoidPointV1 + { + public: + /**Specifies the sign - North/South*/ + TLatitudeSign iLatitudeSign; + /** + A north/south angular measurement of position relative to the equator, + in the meridian plane which contains the earth's rotation axis + */ + TUint16 iLatitude; + /** + An east/west angular measurement of position in relation to the Prime Meridian. + The angle between the two great circles, one being the Prime (or Greenwich) Meridian + and the other a meridian passing through the point of interest. + */ + TInt16 iLongitude; + }; + + /** + It is characterised by the co-ordinates of an ellipsoid point (the origin) and a distance r + @see 3GPP TS 23.032 + */ + class TEllipsoidPointUncertCircleV1 + { + public: + /**Specifies the sign - North/South*/ + TLatitudeSign iLatitudeSign; + /** + A north/south angular measurement of position relative to the equator, + in the meridian plane which contains the earth's rotation axis + */ + TUint16 iLatitude; + /** + An east/west angular measurement of position in relation to the Prime Meridian. + The angle between the two great circles, one being the Prime (or Greenwich) Meridian + and the other a meridian passing through the point of interest. + */ + TInt16 iLongitude; + /**Uncertainty code*/ + TUint8 iUncertaintyCode; + }; + + /** + It is characterised by the co-ordinates of an ellipsoid point (the origin), + distances r1 and r2 and an angle of orientation A + @see 3GPP TS 23.032 + */ + class TEllipsoidPointUncertEllipseV1 + { + public: + /**Specifies the sign - North/South*/ + TLatitudeSign iLatitudeSign; + /** + A north/south angular measurement of position relative to the equator, + in the meridian plane which contains the earth's rotation axis + */ + TUint16 iLatitude; + /** + An east/west angular measurement of position in relation to the Prime Meridian. + The angle between the two great circles, one being the Prime (or Greenwich) Meridian + and the other a meridian passing through the point of interest. + */ + TInt16 iLongitude; + /**Uncertainty semi major axis*/ + TUint8 iUncertaintySemiMajor; + /**Uncertainty semi minor axis*/ + TUint8 iUncertaintySemiMinor; + /**Orientation of major axis*/ + TUint8 iOrientationMajorAxis; + /**The confidence by which the position of a target entity is known to be within the shape description*/ + TUint8 iConfidence; + }; + + /** + The description of an ellipsoid point with altitude is that of a point at a specified distance + above or below a point on the earth's surface. This is defined by an ellipsoid point + with the given longitude and latitude and the altitude above or below the ellipsoid point. + @see 3GPP TS 23.032 + */ + class TEllipsoidPointAltitudeV1 + { + public: + /**Specifies the sign - North/South*/ + TLatitudeSign iLatitudeSign; + /** + A north/south angular measurement of position relative to the equator, + in the meridian plane which contains the earth's rotation axis + */ + TUint16 iLatitude; + /** + An east/west angular measurement of position in relation to the Prime Meridian. + The angle between the two great circles, one being the Prime (or Greenwich) Meridian + and the other a meridian passing through the point of interest. + */ + TInt16 iLongitude; + /**Direction of altitude*/ + TAltDirection iAltDirection; + /**Degree of altitude*/ + TUint16 iAltitude; + }; + + /** + characterised by the co-ordinates of an ellipsoid point with altitude, distances r1 (the "semi-major uncertainty"), + r2 (the "semi-minor uncertainty") and r3 (the "vertical uncertainty") and an angle of orientation A + (the "angle of the major axis") + @see 3GPP TS 23.032 + */ + class TEllipsoidPointAltitudeEllipseV1 + { + public: + /**Specifies the sign - North/South*/ + TLatitudeSign iLatitudeSign; + /** + A north/south angular measurement of position relative to the equator, + in the meridian plane which contains the earth's rotation axis + */ + TUint16 iLatitude; + /** + An east/west angular measurement of position in relation to the Prime Meridian. + The angle between the two great circles, one being the Prime (or Greenwich) Meridian + and the other a meridian passing through the point of interest. + */ + TInt16 iLongitude; + /**Direction of altitude*/ + TAltDirection iAltDirection; + /**Degree of latitude*/ + TUint16 iAltitude; + /**Uncertainty semi major axis*/ + TUint8 iUncertaintySemiMajor; + /**Uncertainty semi minor axis*/ + TUint8 iUncertaintySemiMinor; + /**Orientation of major axis*/ + TUint8 iOrientationMajorAxis; + /**The confidence by which the position of a target entity is known to be within the shape description*/ + TUint8 iConfidence; + }; + + /**This union holds the possible forms of position estimate of the UE that can be captured.*/ + union TPositionEstimateV1 + { + /** + The description of an ellipsoid point is that of a point + on the surface of the ellipsoid, and consists of a latitude and a longitude. + @see 3GPP TS 23.032 + */ + TEllipsoidPointV1 iEllipsoidPoint; + /** + It is characterised by the co-ordinates of an ellipsoid point (the origin) and a distance r + @see 3GPP TS 23.032 + */ + TEllipsoidPointUncertCircleV1 iEllipsoidPointUncertCircle; + /** + It is characterised by the co-ordinates of an ellipsoid point (the origin), + distances r1 and r2 and an angle of orientation A + @see 3GPP TS 23.032 + */ + TEllipsoidPointUncertEllipseV1 iEllipsoidPointUncertEllipse; + /** + The description of an ellipsoid point with altitude is that of a point at a specified distance + above or below a point on the earth's surface. This is defined by an ellipsoid point + with the given longitude and latitude and the altitude above or below the ellipsoid point. + @see 3GPP TS 23.032 + */ + TEllipsoidPointAltitudeV1 iEllipsoidPointAltitude; + /** + characterised by the co-ordinates of an ellipsoid point with altitude, distances r1 (the "semi-major uncertainty"), + r2 (the "semi-minor uncertainty") and r3 (the "vertical uncertainty") and an angle of orientation A + (the "angle of the major axis") + @see 3GPP TS 23.032 + */ + TEllipsoidPointAltitudeEllipseV1 iEllipsoidPointAltitudeEllipsoide; + }; + + /**This contains the positioning estimate reference time*/ + union TPosEstimateRefTime + { + /**Contains results of the GPS reference time*/ + TUtranGpsRefTimeResultV1 iUtranGpsRefTimeResult; + /**Contains the GPS reference time */ + TUint16 iGpsRefTimeOnly; + /**Contains the cell timing*/ + TCellTimingV1 iCellTiming; + }; + + /** + Provides the position estimate from the UE to the network, + if the UE is capable of determining its own position. + */ + class TUePosPositionEstimateInfoV1 + { + public: + /**UE positioning estimate reference time*/ + TPosEstimateRefTime iPosEstimateRefTime; + /**Holds the UE's position estimate + @see TPositionEstimateV1 + */ + TPositionEstimateV1 iPostionEstimate; + /**Holds the field that would be populated in iPosEstimateRefTime*/ + TPosEstimateInfo iPosEstimateRefTimeStatus; + /**Holds the field that would be populated in iPosEstimate*/ + TPosEstimateInfo iPosEstimateStatus; + }; + + /**This enum contains the multipath indicators*/ + enum TMultipathIndicator + { + /** + Multipath indicator unknown + This is an invalid indicator. + */ + EMPUnknown, + /**Not measured*/ + ENm, + /**MP error < 5m*/ + ELow, + /**5m < MP error < 43m*/ + EMedium, + /**MP error > 43m*/ + EHigh + }; + + /**This class contains the GPS measurement parameters of the UE*/ + class TGpsMeasMeasurementParamV1 + { + public: + /**Satellite Identification*/ + TUint8 iSatID; + /** + The estimate of the carrier-to-noise ratio of the received signal from the particular + satellite used in the measurement. It is given in units of dB-Hz (typical levels will + be in the range of 20 - 50 dB-Hz). + */ + TUint8 iCN0; + /** + It is the instantaneous frequency difference between the receiver's internal oscillator + and the received carrier from the satellite. Hz, scale factor 0.2. + */ + TInt16 iDoppler; + /** + Unit in GPS chips. + Whole value of the UE GPS code-phase measurement, where increasing binary values of the field + signify increasing measured pseudoranges. + */ + TUint16 iWholeGpsChips; + /** + The UE GPS code-phase measurement is divided into the fields "Whole GPS Chips" and "Fractional GPS Chips". + Scale factor 2-10 Fractional value of the UE GPS code-phase measurement. + */ + TUint16 iFractionalGpsChips; + /** + Contains the possible multipath indicators. Multipath error is usually caused by one path being bounced or + reflected. The impact on a pseudo-range measurement may be up to a few metres. In the case of carrier phase, + this is of the order of a few centimetres. + */ + TMultipathIndicator iMultipathIndicator; + /** + A distance measurement based on the correlation of a satellite's transmitted code (may be the C/A-Code or + the encrypted P-Code) and the local receiver's reference code (for that PRN satellite number), + that has not been corrected for errors in synchronisation between the transmitter's clock and the receiver's clock. + Hence a pseudo-range measurement is a time-error biased distance measurement. + */ + TUint8 iPseudorangeRmsError; + }; + + /**This class contains the GPS measurement parameters and the positioning reference time*/ + class TUePosGpsMeasurementResultsV1 + { + public: + /**UE positioning reference time*/ + TPosReferenceTimeV1 iPosGpsMeasRefTime; + /**Holds the GPS measurement parameters from all the active satellites*/ + TGpsMeasMeasurementParamV1 iGpsMeasurementParamList[KMaxSat]; + /**ETrue indicates TPosReferenceTimeV1::iUtranGpsRefTimeResult is populated. + EFalse indicates TPosReferenceTimeV1::iGpsRefTimeOnly is populated*/ + TBool iPosGpsMeasRefTimeStatus; + }; + + /** + This enum lists all the possible errors that UE can report to the network + */ + enum TPosErrorCause + { + /** + Error Cause Unknown. This is an invalid error cause and is set if the UE does not set with + any of the underlying valid error causes + */ + EErrorCauseUnknown, + /**Indicates that enought number of GPS satellites are healthy and active.*/ + ENotEnoughGpsSatellites, + /**Assistance data required to compute location of the UE is missing in the measurement control. + If the Additional data request flag is true in the measurement control only then additional assistance + data can be requested otherwise measurements need to be done using the existing assistance data + @see TGpsAddlAssistDataReqV1 + @see TUePosReportingQuantityV1 + */ + EAssistanceDataMissing, + /** + Cell Frames Timings are not accomplished + */ + ENotAccomplishedGpsTimingOfCellFrames, + /** + UE can set this error in case other than the above mentioned is encountered + */ + EUndefinedError, + /** + UE denies Location information + */ + ERequestDeniedByUser, + }; + + /** + This class contains the positioning errors that might have encountered during + measurement of location of the UE. + */ + class TUePosError + { + public: + /**Indicates the error cause encountered while computing GPS Assistance data*/ + TPosErrorCause iPosErrorCause; + /**If error cause is "Assistance Data Missing" and iAddlAssistanceDataReq is set to ETrue then + then this member shall indicate what additional assistance data is needed. + If iAddlAssistanceDataReq is set to EFalse then existing assistance data is used to compute location + information of the UE. + @see TUePosReportingQuantityV1::iAddlAssistanceDataReq*/ + TGpsAddlAssistDataReqV1 iGpsAddlAssistDataReq; + }; + + /** + This class contains the measurement results computed by the UE. + */ + class TUePosMeasuredResultsV1 + { + public: + /**The purpose of this is to provide the position estimate from the UE to the network, + if the UE is capable of determining its own position.*/ + TUePosPositionEstimateInfoV1 iUePosPositionEstimateInfo; + /**Contains the GPS measurement parameters and the positioning reference time*/ + TUePosGpsMeasurementResultsV1 iUePosGpsMeasurement; + /**Indicates the error cause and/or additional assistance data is required*/ + TUePosError iUePosError; + /** + ETrue indicates some error has encountered. iUePosError will be populated. + EFalse indicates Gps Assistance Data is received and no error has encountered while processing. + Hence iUePosPositionEstimateInfo and iUePosGpsMeasurement will be populated + */ + TBool iPosErrorStatus; + }; + + /**Contains the measured location information of the UE*/ + union TMeasuredResultsV1 + { + /** + This member either contains the measurement results or the error that might have + encountered during measurements. + */ + TUePosMeasuredResultsV1 iTUePosMeasuredResults; + /** + A spare member for future use. + */ + TBool iSpare; + }; + + /** + This class contains the measurement report expected as response to the measurement control sent by the + network. Veloctiy estimates are included if requested in measurement control. + */ + class TMeasurementReportV7 : public RMobilePhone::TMultimodeType + { + public: + IMPORT_C TMeasurementReportV7(); + public: + /**A reference number that should be used by the UTRAN when setting up, + modifying or releasing the measurement and by the UE in the measurement report. + */ + TUint8 iMeasurementIdentity; + /**Contains the measured location information of the UE*/ + TMeasuredResultsV1 iMeasuredResults; + /**Contains the measured results on Random Access Channel*/ + TMeasuredResultsOnRachV1 iMeasuredResultsOnRach; + /**Contains the velocity estimates of the UE*/ + TVelocityEstimateV1 iVelocityEstimate; + /** + Indicates the populated member in iVelocityEstimate if velocity estimate is computed. + Otherwise indicates that velocity estimate is not computed. + */ + TVelEstimate iVelEstimateStatus; + }; + /** + A typedef'd packaged TMeasurementReportV7 for passing through a + generic API method. + + @internalAll + */ + typedef TPckg TMeasurementReportV7Pckg; + + //*********************************************// + // Measurement Control Failure data structure // + //*********************************************// + + /** + This enum contains the list of errors that the UE can specify. + The Measurement control failure is caused only when the the UE + cannot initiate a measurement as instructed by the network. + */ + enum TMeasurementControlFailure + { + /** + Unknown Measurement Control Failure. + This is an invalid failure state whic will be set if the UE does not set with the + underlying valid error reasons. + */ + EControlFailureUnknown, + /**Indicates ASN1.0 encoding is incorrect*/ + EAsn1ViolationOrEncoding, + /**Messsgae type specified is not existent*/ + EMsgTypeNonExistent, + /**Message is not compatible*/ + EMsgNotCompatibleWithReceiverState, + /**Information sent cannot be understood*/ + EIeValueNotComprehend, + /**Information expected is not present*/ + EInformationElementMissing, + /*Message extension cannot be understood*/ + EMsgExtnNotComprehend + }; + + /** + This enum contains the possible domains used by MOLR + */ + enum TDomain + { + /**Packet switch domain is the default domain that will be used by Molr*/ + EPacketSwitchedDomain, + /**UE shall set the domain to Circuit switch whenever Molr is intended to use it*/ + ECircuitSwitchedDomain + }; + + IMPORT_C void NotifyMtlr(TRequestStatus& aReqStatus,TDes8& aNotifyMtlr); + IMPORT_C void SendMtlrResponse(TRequestStatus& aReqStatus,const TMtlrResponse aMtlrResponse); + IMPORT_C void SendMtlrResponse(TRequestStatus& aReqStatus,const TMtlrError aMtlrResponse); + IMPORT_C void SendMtlrResponse(TRequestStatus& aReqStatus,const TMtlrReject aMtlrResponse); + IMPORT_C void SendMolr(TRequestStatus& aReqStatus,const TDesC8& aStartMolr,TDes8& aMolrReturnResult); + IMPORT_C void NotifyMeasurementControl(TRequestStatus& aReqStatus,TDes8& aMeasurementControl); + IMPORT_C void SendMeasurementReport(TRequestStatus& aReqStatus,const TDesC8& aMeasurementReport); + IMPORT_C void SendMeasurementReport(TRequestStatus& aReqStatus,const TMeasurementControlFailure aMeasurementControlFailure); + IMPORT_C TInt SetLcsDomain(const TDomain aDomain); +private: + void ConstructL(); + void Destruct(); +private: + /** + Pointer Holder for the RMobileLocationServices sub-session requests. + */ + CMobileLocationServicesPtrHolder* iMmPtrHolder; + }; + +#endif // __ETELMM_H__ + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/musavaInviteresponderobserverimp.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/musavaInviteresponderobserverimp.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,105 @@ +/* +* 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: This is implementation class of availability setting class. +* +*/ + + +#ifndef __MUSAVAINVITERESPONDEROBSERVERIMP_H__ +#define __MUSAVAINVITERESPONDEROBSERVERIMP_H__ + +// INCLUDES +#include "musavainviteresponderobserver.h" +#include "musavaobserver.h" + +#include +#include + +//class MMusAvaObserver; + +/** + * This class Implements mandatory setting baste behavior which is + * need for availability report. + * + * CMusAvaAvailabilityObserverImps is implementation class for madatory + * setting which are needed for availability report. + * class represent the interface of application. + * + * @lib musavailabilityplugin.lib + * @since S60 v3.2 + */ + +class CMusAvaInviteResponderObserverImp : public CBase, + public MMusAvaInviteResponderObserver + { +public: + + /** + * Two-phased constructor + * + * @since S60 v3.2 + * @param aDefaultImp Pointer to observer interface + * @return Returns pointer to CMusAvaInviteResponderObserverImp object + */ + + static CMusAvaInviteResponderObserverImp* NewL(); + + /** + * Destructor + * + * @since S60 v3.2 + * @param + * @return + */ + + ~CMusAvaInviteResponderObserverImp(); + +protected: + /** + * Constructor + * + * @since S60 v3.2 + * @param aDefaultImp Pointer to observer interface + * @return + */ + + CMusAvaInviteResponderObserverImp( ); + + /** + * Perform the second phase construction of a + * CMusAvaInviteResponderObserverImp object + * + * @since S60 v3.2 + * @param + * @return + */ + + void ConstructL(); + + +// from base class MMusAvaInviteResponderObserver + +public: + + MMusAvaSettingsObserver::TApplicationState ApplicationState(); + + void InvitationAnsweredLD(); + +public: + + MMusAvaSettingsObserver::TApplicationState iApplicationState; + }; + +#endif + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/musavaavailabilityobserverimp.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/musavaavailabilityobserverimp.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,140 @@ +/* +* 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: This is implementation class of availability setting class. +* +*/ + + +#ifndef __MUSAVAAVAILABILITYOBSERVERIMP_H__ +#define __MUSAVAAVAILABILITYOBSERVERIMP_H__ + +// INCLUDES +#include "musavaavailabilityobserver.h" + +#include +#include + +class MMusAvaObserver; + +/** + * This class Implements mandatory setting baste behavior which is + * need for availability report. + * + * CMusAvaAvailabilityObserverImps is implementation class for madatory + * setting which are needed for availability report. + * class represent the interface of application. + * + * @lib musavailabilityplugin.lib + * @since S60 v3.2 + */ + +class CMusAvaAvailabilityObserverImp : public CBase, + public MMusAvaAvailabilityObserver + { +public: + + /** + * Two-phased constructor + * + * @since S60 v3.2 + * @param aDefaultImp Pointer to observer interface + * @return Returns pointer to CMusAvaAvailabilityObserverImp object + */ + + static CMusAvaAvailabilityObserverImp* NewL(); + + /** + * Destructor + * + * @since S60 v3.2 + * @param + * @return + */ + + ~CMusAvaAvailabilityObserverImp(); + +protected: + /** + * Constructor + * + * @since S60 v3.2 + * @param aDefaultImp Pointer to observer interface + * @return + */ + + CMusAvaAvailabilityObserverImp( ); + + /** + * Perform the second phase construction of a + * CMusAvaAvailabilityObserverImp object + * + * @since S60 v3.2 + * @param + * @return + */ + + void ConstructL(); + + +// from base class MMusAvaAvailabilitySettingObserver + +public: + + /** + * Availability report + * + * @since S60 v3.2 + * @param aName Availability name + * @param aStatus New status for availability. + */ + virtual void AvailabilityChanged( + MMusAvaObserver::TAvailabilityName aName, + MMusAvaObserver::TAvailabilityStatus aStatus ); + + /** + * Availability report + * + * @since S60 v3.2 + * @param aName Availability name + * @param aStatus New status for availability. + */ + virtual void AvailabilityError( + MMusAvaObserver::TAvailabilityName aName, + MMusAvaObserver::TAvailabilityStatus aStatus ); + + virtual TBool Available( + MMusAvaObserver::TAvailabilityName aAvailability ); + + + virtual MMusAvaObserver::TAvailabilityStatus AvailabilityPluginState(); + + + /** + * Clear atributes + * + * @since S60 v3.2 + * @param + * @param + * @return + */ + void Clear(); + + + MMusAvaObserver::TAvailabilityStatus iStatus; + MMusAvaObserver::TAvailabilityName iName; + TInt iError; + }; + +#endif + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/musavaavailabilitysettingobserverimp.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/musavaavailabilitysettingobserverimp.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,135 @@ +/* +* 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: This is implementation class of availability setting class. +* +*/ + + +#ifndef __UT_MUSAVAAVAILABILITYSETTINGSOBSERVERIMP_H__ +#define __UT_MUSAVAAVAILABILITYSETTINGSOBSERVERIMP_H__ + +// INCLUDES +#include "musavaavailabilitysettingobserver.h" +#include "musavaobserver.h" + +#include +#include + +//class MMusAvaObserver; + +/** + * This class Implements mandatory setting baste behavior which is + * need for availability report. + * + * CMusAvaAvailabilitySettingObserverImps is implementation class for madatory + * setting which are needed for availability report. + * class represent the interface of application. + * + * @lib musavailabilityplugin.lib + * @since S60 v3.2 + */ + +class CMusAvaAvailabilitySettingObserverImp : public CBase, + public MMusAvaAvailabilitySettingObserver + { +public: + + /** + * Two-phased constructor + * + * @since S60 v3.2 + * @param aDefaultImp Pointer to observer interface + * @return Returns pointer to CMusAvaAvailabilitySettingObserverImp object + */ + + static CMusAvaAvailabilitySettingObserverImp* NewL(); + + /** + * Destructor + * + * @since S60 v3.2 + * @param + * @return + */ + + ~CMusAvaAvailabilitySettingObserverImp(); + +protected: + /** + * Constructor + * + * @since S60 v3.2 + * @param aDefaultImp Pointer to observer interface + * @return + */ + + CMusAvaAvailabilitySettingObserverImp( ); + + /** + * Perform the second phase construction of a + * CMusAvaAvailabilitySettingObserverImp object + * + * @since S60 v3.2 + * @param + * @return + */ + + void ConstructL(); + + +// from base class MMusAvaAvailabilitySettingObserver + +public: + + /** + * Availability report + * + * @since S60 v3.2 + * @param aState Current availability State + * @param aStatus Current availability Status + * @param aName Availability name + * @param aSystemError system wide error + * @return + */ + void AvailabilityReport( + MMusAvaObserver::TAvailabilityState aState, + MMusAvaObserver::TAvailabilityStatus aStatus, + MMusAvaObserver::TAvailabilityName aName, + TInt aSystemError ); + + + /** + * MusAvailability shutdown is completed + * + * @since S60 v3.2 + * @param aState Current availability State + * @param aName Availability name + * @param aSystemError system wide error + * @return + */ + void StopComplete( MMusAvaObserver::TAvailabilityState aState, + MMusAvaObserver::TAvailabilityName aName, + TInt aSystemError ); + + MMusAvaObserver::TAvailabilityState iState; + MMusAvaObserver::TAvailabilityStatus iStatus; + MMusAvaObserver::TAvailabilityName iName; + TInt iSystemError; + TBool iAvailabilityReport; + TBool iStopComplete; + }; + +#endif //__UT_MUSAVAAVAILABILITYSETTINGSOBSERVERIMP_H__ + + \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/musavacallmonitorobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/musavacallmonitorobserver.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,81 @@ +/* +* 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: Unit test stub of MMusCallMonitorObserver +* +*/ + + +#ifndef __MUSAVACALLMONITOROBSERVER_H__ +#define __MUSAVACALLMONITOROBSERVER_H__ + +#include "musavaavailabilityobserver.h" +#include "muscallmonitorobserver.h" +#include + +/** + * Test stub of MMusCallMonitorObserver + */ +class CMusAvaCallMonitorObserverStub : + public CBase, + public MMusCallMonitorObserver + { +public: + + /** + * Two-phased constructor + * + * @return New CMusAvaCallMonitorObserverStub instance + */ + static CMusAvaCallMonitorObserverStub* NewL(); + + /** + * Destructor + */ + ~CMusAvaCallMonitorObserverStub(); + +public: // From MMusCallMonitorObserver + + void CallConnectedL( const TDesC& aTelNumber, TBool aIsSipUri ); + + void CallHoldL( const TDesC& aTelNumber, TBool aIsSipUri ); + + void ConferenceCallL(); + + void NoActiveCallL(); + +private: + /** + * Constructor + */ + CMusAvaCallMonitorObserverStub(); + + /** + * Perform the second phase construction + */ + void ConstructL(); + + void CopyDescriptorL( const TDesC& aSource ); + +public: + + // Most recently received tel number. Owned. + HBufC* iTelNumber; + + // Contains the most recent value a of aIsSipUri parameter, from + // CallConnectedL or CallHoldL. + TBool iIsSipUri; + }; + + +#endif // __MUSAVACALLMONITOROBSERVER_H__ diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/musavacapabilityqueryobserverimp.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/musavacapabilityqueryobserverimp.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,56 @@ +/* +* Copyright (c) 2005-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: Capability query observer +* +*/ + + +#ifndef __MUSAVACAPABQUERYOBSERVERIMP_H__ +#define __MUSAVACAPABQUERYOBSERVERIMP_H__ + +#include +#include +#include "mmusavacapabilityqueryobserver.h" + +class CMusAvaCapabilityQueryObserverImp : public CBase, + public MMusAvaCapabilityQueryObserver + + { +public: + + CMusAvaCapabilityQueryObserverImp(); + + //from MMusAvaCapabilityQueryObserver + void CapabilitiesResolved( const CMusAvaCapabilityQueryBase& aSentQuery ); + + void CapabilitiesResolvedL( const TDesC& aUri ); + + void SetCapabilitiesResolvedForCingular(); + + TBool CapabilitiesResolvedForCingular(); + + TBool iCapabilitiesResolvedForCingular; + + void SipHeadersL(const MDesCArray& aHeaders,SipStrConsts::TStrings aHeaderType); + + void VideoCodecsResolvedL( const MDesCArray& aVideoCodecs ); + + TBool CapabilityQueryAnswered( TBool aAnswered = EFalse ); + + void FastModeResolved( MusSettingsKeys::TFastMode aMode ); + }; + + +#endif // __MUSAVACAPABQUERYOBSERVERIMP_H__ + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/musavaconnectionMonitorobserverimp.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/musavaconnectionMonitorobserverimp.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,106 @@ +/* +* 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: This is implementation class of availability setting class. +* +*/ + + +#ifndef __MUSAVACONNECTIONMONITOROBSERVERIMP_H__ +#define __MUSAVACONNECTIONMONITOROBSERVERIMP_H__ + +// INCLUDES +#include "musavaconnectionmonitorobserver.h" + +#include +#include + +class CConnMonEventBase; + +/** + * This class Implements mandatory setting baste behavior which is + * need for availability report. + * + * CMMusAvaConnectionMonitorObserverImps is implementation class for madatory + * setting which are needed for availability report. + * class represent the interface of application. + * + * @lib musavailabilityplugin.lib + * @since S60 v3.2 + */ + +class CMMusAvaConnectionMonitorObserverImp : public CBase, + public MMusAvaConnectionMonitorObserver + { +public: + + /** + * Two-phased constructor + * + * @since S60 v3.2 + * @param aDefaultImp Pointer to observer interface + * @return Returns pointer to CMMusAvaConnectionMonitorObserverImp object + */ + + static CMMusAvaConnectionMonitorObserverImp* NewL(); + + /** + * Destructor + * + * @since S60 v3.2 + * @param + * @return + */ + + ~CMMusAvaConnectionMonitorObserverImp(); + +protected: + /** + * Constructor + * + * @since S60 v3.2 + * @param aDefaultImp Pointer to observer interface + * @return + */ + + CMMusAvaConnectionMonitorObserverImp( ); + + /** + * Perform the second phase construction of a + * CMMusAvaConnectionMonitorObserverImp object + * + * @since S60 v3.2 + * @param + * @return + */ + + void ConstructL(); + + +// from base class MMusAvaConnectionMonitorObserver + +public: + + /** + * Event from connection monitor server + * + */ + virtual void EventL(const CConnMonEventBase& aConnMonEvent); + +public: //Data + + CConnMonEventBase* iConnMonEventBase; + }; + +#endif + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/musavaobserverimp.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/musavaobserverimp.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,121 @@ +/* +* 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: This observer is used by +* ECOM clients to get function call from the availability Plug-in +* +*/ + + + +#ifndef __MUSAVAOBSERVERIMP_H__ +#define __MUSAVAOBSERVERIMP_H__ + +#include "musavaavailabilityobserver.h" +//#include "musavaobserver.h" +#include "musunittesting.h" +#include +#include + +#ifdef MUS_UNITTEST +#undef IMPORT_C +#define IMPORT_C +#endif + +class CMusAvaController; +class MMusAvaObserver; +/** + * MusAvailability Observer base class + * + * Observer interface for ECOM clients. + * + * @lib musavailabilityplugin.lib + * @since S60 v3.2 + */ + +class CMusAvaObserverImp : public CBase, + public MMusAvaObserver + + { +public: + + /** + * Two-phased constructor + * + * @since S60 v3.2 + * @param + * @return Returns pointer to CMusAvaController object + */ + + static CMusAvaObserverImp* NewL( ); + + /** + * Destructor + * + * @since S60 v3.2 + * @param + * @return + */ + + ~CMusAvaObserverImp(); + + protected: + + /** + * Constructor + * + * @since S60 v3.2 + * @return + */ + + CMusAvaObserverImp( ); + + /** + * Perform the second phase construction of a + * CMusAvaController object + * + * @since S60 v3.2 + * @param + * @return + */ + + void ConstructL(); + +// from base class MMusAvaAvailabilityObserver + +public: + + /** + * Availability report + * + * @since S60 v3.2 + * @param aStatus New status for availability. + */ + virtual void AvailabilityChanged( + MMusAvaObserver::TAvailabilityName aName, + MMusAvaObserver::TAvailabilityStatus aStatus ); + + virtual void AvailabilityError( + MMusAvaObserver::TAvailabilityName aName, + MMusAvaObserver::TAvailabilityStatus aStatus ); + +public: + + MMusAvaObserver::TAvailabilityStatus iStatus; + MMusAvaObserver::TAvailabilityName iName; + MUS_UNITTEST ( UT_CMusAvaDefaultImp ) + }; + + +#endif // __MUSAVAOBSERVERIMP_H__ + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/musavaprofileregistryadapterstub.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/musavaprofileregistryadapterstub.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,110 @@ +/* +* Copyright (c) 2005-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: Provide interface for the client requestin register availability. +* +*/ + + + +#ifndef __MUSAVAPROFILEREGISTRYADAPTERSTUB_H__ +#define __MUSAVAPROFILEREGISTRYADAPTERSTUB_H__ + + +#include "musunittesting.h" +#include "musavasipprofileregistryadapter.h" +#include + + +class MSIPProfileRegistryObserver; + +/** + * Implemets register vailability. + * + * Provide interface for the client to availability class. + * + * @lib musavailabilityplugin.lib + * @since S60 v3.2 + */ +class CMusAvaProfileRegistryAdapterStub : public MMusAvaSipProfileRegistryAdapter + { +public: + + /** + * Two-phased constructor + * + * @since S60 v3.2 + * @return Returns pointer to MMusAvaSipProfileRegistryAdapter object + */ + static CMusAvaProfileRegistryAdapterStub* NewL(); + + + static CMusAvaProfileRegistryAdapterStub* NewLC(); + + /** + * Destructor + */ + + ~CMusAvaProfileRegistryAdapterStub(); + + protected: + + /** + * Constructor + * + * @since S60 v3.2 + * @param aObserver Pointer to observer intercase + * @param aName availability name + * @param aModules is data container + * @return + */ + CMusAvaProfileRegistryAdapterStub(); + + void ConstructL(); + +// from base class CMusAvaAvailability + +public: + + /** + * An event related to SIP Profile has accorred + * @param aProfileId a profile Id + * @param aEvent an occurred event + **/ + virtual void ProfileRegistryEventOccurred( + TUint32 aProfileId, + MSIPProfileRegistryObserver::TEvent aEvent ); + + /** + * An asynchronous error has occurred related to SIP profile + * Event is send to those observers, who have the + * corresponding profile instantiated. + * @param aProfileId the id of failed profile + * @param aError an occurred error + */ + virtual void ProfileRegistryErrorOccurred( + TUint32 aProfileId, + TInt aError ); + + +private: // Data + + TUint32 iProfileId; + MSIPProfileRegistryObserver::TEvent iEvent; + TInt iError; + + MUS_UNITTEST( UT_CMusAvaSipProfileRegistryObserver ) + }; + + +#endif // __MUSAVAPROFILEREGISTRYADAPTERSTUB_H__ \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/musavasettingsobserverimp.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/musavasettingsobserverimp.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,110 @@ +/* +* 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: This is implementation class of availability setting class. +* +*/ + + +#ifndef __UT_MUSAVASETTINGSOBSERVERIMP_H__ +#define __UT_MUSAVASETTINGSOBSERVERIMP_H__ + +// INCLUDES +#include "musavasettingsobserver.h" +#include "musavaobserver.h" + +#include +#include + +//class MMusAvaObserver; + +/** + * This class Implements mandatory setting baste behavior which is + * need for availability report. + * + * CMusAvaSettingsObserverImps is implementation class for madatory + * setting which are needed for availability report. + * class represent the interface of application. + * + * @lib musavailabilityplugin.lib + * @since S60 v3.2 + */ + +class CMusAvaSettingsObserverImp : public CBase, + public MMusAvaSettingsObserver + { +public: + + /** + * Two-phased constructor + * + * @since S60 v3.2 + * @param aDefaultImp Pointer to observer interface + * @return Returns pointer to CMusAvaSettingsObserverImp object + */ + + static CMusAvaSettingsObserverImp* NewL(); + + /** + * Destructor + * + * @since S60 v3.2 + * @param + * @return + */ + + ~CMusAvaSettingsObserverImp(); + +protected: + /** + * Constructor + * + * @since S60 v3.2 + * @param aDefaultImp Pointer to observer interface + * @return + */ + + CMusAvaSettingsObserverImp( ); + + /** + * Perform the second phase construction of a + * CMusAvaSettingsObserverImp object + * + * @since S60 v3.2 + * @param + * @return + */ + + void ConstructL(); + + +// from base class MMusAvaSettingsObserver + +public: + + TApplicationState ApplicationState(); + + TBool OptionAllowed(); + + void StartApplicationL( MultimediaSharing::TMusUseCase aUseCase ); + +public: //data + + TBool iOptionAllowed; + + TBool iApplicationStarted; + + }; + +#endif //__UT_MUSAVASETTINGSOBSERVERIMP_H__ + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/musavasipadapterimp.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/musavasipadapterimp.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,174 @@ +/* +* 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: This observer is used by +* ECOM clients to get function call from the availability Plug-in +* +*/ + + + +#ifndef __MUSAVASIPOBSERVERIMP_H__ +#define __MUSAVASIPOBSERVERIMP_H__ + +#include "musavasipadapter.h" +#include "musavasipconnectionadapter.h" +#include "musunittesting.h" +#include +#include +#include + +#ifdef MUS_UNITTEST +#undef IMPORT_C +#define IMPORT_C +#endif + +/** + * MusAvailability Observer base class + * + * Observer interface for ECOM clients. + * + * @lib musavailabilityplugin.lib + * @since S60 v3.2 + */ + +class CMusAvaSipAdapterImp : public CBase, + public MMusAvaSipAdapter, + public MMusAvaSipConnectionAdapter + + { +public: + + enum + { + }; + + /** + * Two-phased constructor + * + * @since S60 v3.2 + * @param + * @return Returns pointer to CMusAvaController object + */ + + static CMusAvaSipAdapterImp* NewL( ); + + /** + * Destructor + * + * @since S60 v3.2 + * @param + * @return + */ + + ~CMusAvaSipAdapterImp(); + + protected: + + /** + * Constructor + * + * @since S60 v3.2 + * @return + */ + + CMusAvaSipAdapterImp( ); + + /** + * Perform the second phase construction of a + * CMusAvaController object + * + * @since S60 v3.2 + * @param + * @return + */ + + void ConstructL(); + +public: // from base class MMusAvaSipAdapter + + TInt IncomingRequest( TUint32 aIapId, + CSIPServerTransaction* aTransaction ); + + TInt TimedOut( CSIPServerTransaction& aTransaction ); + +public: // from base class MMusAvaSipConnectionAdapter + + TInt IncomingRequest( CSIPServerTransaction* aTransaction ); + + TInt IncomingRequest( CSIPServerTransaction* aTransaction, + CSIPDialog& aDialog ); + + TInt IncomingResponse( CSIPClientTransaction& aTransaction ); + + TInt IncomingResponse ( + CSIPClientTransaction& aTransaction, + CSIPDialogAssocBase& aDialogAssoc ); + + TInt IncomingResponse( + CSIPClientTransaction& aTransaction, + CSIPInviteDialogAssoc* aDialogAssoc ); + + TInt IncomingResponse( CSIPClientTransaction& aTransaction, + CSIPRegistrationBinding& aRegistration ); + + TInt ErrorOccured( TInt aError, + CSIPTransactionBase& aTransaction ); + + TInt ErrorOccured( TInt aError, + CSIPClientTransaction& aTransaction, + CSIPRegistrationBinding& aRegistration ); + TInt ErrorOccured( TInt aError, + CSIPTransactionBase& aTransaction, + CSIPDialogAssocBase& aDialogAssoc ); + + TInt ErrorOccured( TInt aError, CSIPRefresh& aSIPRefresh ); + + TInt ErrorOccured( TInt aError, CSIPRegistrationBinding& aRegistration ); + + TInt ErrorOccured( TInt aError, + CSIPDialogAssocBase& aDialogAssoc ) ; + + TInt InviteCompleted( CSIPClientTransaction& aTransaction ); + + TInt InviteCanceled( CSIPServerTransaction& aTransaction ); + + TInt ConnectionStateChanged( CSIPConnection::TState aState ); + +public: + + void Reset(); + void CleanServerTransaction(); + void SetServerTransaction( CSIPServerTransaction& aTransaction ); + void SetServerTransaction( CSIPServerTransaction* aTransaction ); + +public: + + CSIPClientTransaction* iClientTransaction; + CSIPServerTransaction* iServerTransaction; + CSIPConnection::TState iState; + TInt iError; + CSIPRegistrationBinding* iRegBinding; + CSIPRefresh* iRefresh; + CSIPDialogAssocBase* iDialogAssoc; + CSIPDialog* iDialog; + TUint32 iIapId; + CSIPInviteDialogAssoc* iInviteAssoc; + CSIPTransactionBase* iTransaction; + TBool iServerTransctionOwned; + TInt iReturnCode; + }; + + +#endif // __MUSAVASIPOBSERVERIMP_H__ + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/musavasipstub.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/musavasipstub.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,148 @@ +/* +* 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: This is client interface class for SIP-server +* +*/ + + +#ifndef __MUSAVASIPSTUB_H__ +#define __MUSAVASIPSTUB_H__ + +// INCLUDES +#include +#include + +class CMusAvaSharedObject; +class CSIP; +class CMusAvaSipObserver; +class MSIPObserver; +class MSIPConnectionObserver; +class CMusAvaSipConnectionObserver; + +/** + * CMusAvaSIPStub class represent the interface for module fetcher. + * + * This interface class encapsulates module selection for availability Plug-in. + * + * @lib musavailabilityplugin.lib + * @since S60 v3.2 + */ + +class CMusAvaSIPStub : public CBase + { +public: + + + /** + * Two-phased constructor + * + * @since S60 v3.2 + * @param aCMusAvaSharedObj Pointer to CMusAvaSharedObject + * @return Returns pointer to CMusAvaSIPStub object + */ + static CMusAvaSIPStub* NewL( CMusAvaSharedObject& aMusAvaSharedObject ); + + /** + * Destructor + * + * @since S60 v3.2 + * @param + * @return + */ + + virtual ~CMusAvaSIPStub(); + + protected: + + /** + * Constructor + * + * @since S60 v3.2 + * @param aCMusAvaSharedObj Pointer to CMusAvaSharedObject + * @return + */ + + CMusAvaSIPStub( CMusAvaSharedObject& aMusAvaSharedObject ); + + /** + * Perform the second phase construction of a + * CMusAvaSIPStub object + * + * @since S60 v3.2 + * @param + * @return + */ + + void ConstructL(); + + public: + + /** + * Returns MSIPConnectionObserver object + * + * @since S60 v3.2 + * @param + * @return referense to MSIPConnectionObserver + */ + MSIPConnectionObserver& SIPConnection(); + + /** + * Returns CSip object + * + * @since S60 v3.2 + * @param + * @return referense to Sip Object + */ + CSIP& Sip(); + + /** + * Returns MSIPObserver object + * + * @since S60 v3.2 + * @param + * @return rreference to MSIPObserver object + */ + MSIPObserver& SIPObserver(); + + private: + + /** + * Pointer to CMusAvaSharedObject object + */ + CMusAvaSharedObject* iMusAvaSharedObject; + + /** + * Pointer to CSIP object + */ + CSIP* iSip; + + /** + * SIP reference counter + */ + TInt iSipRefCounter; + + /** + * Pointer to CMusAvaSipObserver object + */ + CMusAvaSipObserver* iSipObserver; + + /** + * Pointer to CMusAvaSipConnectionObserver object + */ + CMusAvaSipConnectionObserver* iSipConnectionObserver; + + }; + +#endif + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/musavatelephonystatusobserverimp.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/musavatelephonystatusobserverimp.h Thu Jul 22 16:32:26 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: This is implementation class of availability setting class. +* +*/ + + +#ifndef __MUSAVATELEPHONYSTATUSOBSERVERIMP_H__ +#define __MUSAVATELEPHONYSTATUSOBSERVERIMP_H__ + +// INCLUDES +#include "musavatelephonystatusobserver.h" + +#include +#include +#include + + +/** + * This class Implements MMusAvaTelephonyStatusObserver. + * + * MMusAvaTelephonyStatusObserver is implementation class + * + * @lib musavailabilityplugin.lib + * @since S60 v3.2 + */ + +class CMusAvaTelephonyStatusObserverImp : public CBase, + public MMusAvaTelephonyStatusObserver + { +public: + + /** + * Two-phased constructor + * + * @since S60 v3.2 + * @param aDefaultImp Pointer to observer interface + * @return Returns pointer to CMusAvaTelephonyStatusObserverImp object + */ + + static CMusAvaTelephonyStatusObserverImp* NewL(); + + /** + * Destructor + * + * @since S60 v3.2 + * @param + * @return + */ + + ~CMusAvaTelephonyStatusObserverImp(); + +protected: + /** + * Constructor + * + * @since S60 v3.2 + * @param aDefaultImp Pointer to observer interface + * @return + */ + + CMusAvaTelephonyStatusObserverImp( ); + + /** + * Perform the second phase construction of a + * CMusAvaTelephonyStatusObserverImp object + * + * @since S60 v3.2 + * @param + * @return + */ + + void ConstructL(); + + +// from base class MMusAvaTelephonyStatusObserver + +public: + + /** + * Current Network Mode Status + * + * @since S60 v3.2 + * @return + */ + void PhoneNetworkModeStatus( + RMobilePhone::TMobilePhoneNetworkMode aStatus ); + + /** + * Current Network Registration Status + * + * @since S60 v3.2 + * @return + */ + void NetworkRegistrationStatus( + RMobilePhone::TMobilePhoneRegistrationStatus aRegStatus ); + + public: //Data + + RMobilePhone::TMobilePhoneRegistrationStatus iPhoneRegistrationStatus; + RMobilePhone::TMobilePhoneRegistrationStatus* iPhoneRegistrationStatusPointer; + RMobilePhone::TMobilePhoneNetworkMode iPhoneNetworkMode; + + + }; + +#endif + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/musavatimer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/musavatimer.h Thu Jul 22 16:32:26 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: ?Description +* +*/ + + +#ifndef MUSMAVATIMER_H +#define MUSMAVATIMER_H + +// INCLUDES +#include + +/** + * This class contains + * + * @since S60 v3.2 + */ +class CMusAvaTimer : public CActive + { +public: + + static CMusAvaTimer* NewL(); + + static CMusAvaTimer* NewLC(); + + ~CMusAvaTimer(); + + void StopActiveSchedulerAfter( TInt aMilliSeconds, + TRequestStatus* aStatus ); + void RunL(); + void DoCancel(); + +private: + + CMusAvaTimer(); + void ConstructL(); + +private: + //Data + RTimer iTimer; + //Request status + TRequestStatus* iRequestStatus; + }; + +#endif // MUSMAVATIMER_H + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/rconnmon.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/rconnmon.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,1644 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* RConnectionMonitor provides an interface for an application +* to get information about active data connection. It also provides +* a way to close any connection or all the connections. +* +*/ + + +#ifndef __CONNECTIONMONITOR_H +#define __CONNECTIONMONITOR_H + +// INCLUDES +#include "musunittesting.h" + +#include + +// CONSTANTS + +// TInt Attributes +// Used by GetIntAttribute +const TUint KBearer =1; // TConnMonBearerType +const TUint KNetworkStatus =2; // TConnMonNetworkStatus +const TUint KConnectionStatus =3; // progress constants from nifvar.h +const TUint KProtocolType =4; // TConnMonProtocolType +const TUint KNetworkRegistration =5; // TConnMonNetworkRegistration +const TUint KSignalStrength =6; // dBm +const TUint KNetworkMode =7; // TConnMonNetworkMode +const TUint KSecurityMode =8; // TConnMonSecurityMode +const TUint KTrafficClass =30; // Qos - Not supported +const TUint KDeliveryOrder =31; // Qos - Not supported +const TUint KErroneousSDUDelivery =32; // Qos - Not supported +const TUint KResidualBitErrorRatio =33; // Qos - Not supported +const TUint KSDUErrorRatio =34; // Qos - Not supported + +// TUInt Attributes +// Used by GetUintAttribute, SetUintAttribute +const TUint KDownlinkData =100; // in bytes +const TUint KUplinkData =101; // in bytes +const TUint KIAPId =102; +const TUint KNetworkIdentifier =103; +const TUint KTransmitPower =104; // mW +const TUint KMobilePhoneNetworkMode =105; // TConnMonMobilePhoneNetworkMode +const TUint KMaximumBitrateDownlink =130; // Qos - Not supported +const TUint KMaximumBitrateUplink =131; // Qos - Not supported +const TUint KMaximumSDUSize =132; // Qos - Not supported +const TUint KTransferDelay =133; // Qos - Not supported +const TUint KGuaranteedBitrateDownlink =134; // Qos - Not supported +const TUint KGuaranteedBitrateUplink =135; // Qos - Not supported +const TUint KTrafficHandlingPriority =136; // Qos - Not supported +const TUint KActivityTimeThreshold =150; // in seconds, minimum allowed is 5 +const TUint KDownlinkDataThreshold =151; // in bytes, minimum allowed is 4096 +const TUint KUplinkDataThreshold =152; // in bytes, minimum allowed is 4096 +const TUint KBearerAvailabilityThreshold =153; // 1 means that events are 'ON', 0 means 'OFF' +const TUint KSignalStrengthThreshold =154; // 1 means that events are 'ON', 0 means 'OFF' + +// TBool Attributes +// Used by GetBoolAttribute, SetBoolAttribute +const TUint KConnectionActive =200; +const TUint KBearerAvailability =201; +const TUint KConnectionStop =250; +const TUint KConnectionStopAll =251; + +// TDes Attributes +// Used by GetStringAttribute +const TUint KIAPName =300; +const TUint KAccessPointName =301; +const TUint KTelNumber =302; +const TUint KNetworkName =303; + +// TPckgBuf Attributes +// Used by GetPckgAttribute +const TUint KStartTime =400; // TTime +const TUint KClientInfo =401; // TConnMonClientEnum (connections only) +const TUint KNetworkNames =402; // TConnMonNetworkNames +const TUint KIapAvailability =403; // TConnMonIapInfo +const TUint KWLANNetworks =404; // TConnMonWLANNetworksPckg +const TUint KSNAPsAvailability =405; // returns SNAPs ids in old iap-like way (see KIapAvailability) +const TUint KAvailableSNAPsIds =406; // returns SNAPs ids in TConnMonIdsArrayPckg + +// Base value for plug-in specific attribute ids +const TUint KConnMonPluginAttributeBase =3000000; + +// DATA TYPES + +// Bearer type +enum TConnMonBearerType +{ + EBearerUnknown = 0, + EBearerCSD = 1, // CSD (GSM) + EBearerWCDMA = 2, // PSD (WCDMA) + EBearerLAN = 3, + EBearerCDMA2000 = 4, + EBearerGPRS = 5, + EBearerHSCSD = 6, // HSCSD (GSM) + EBearerEdgeGPRS = 7, + EBearerWLAN = 8, + EBearerBluetooth = 9, + EBearerVirtual = 10, + EBearerVirtualVPN = 11, + EBearerWcdmaCSD = 12, // CSD (WCDMA) + + EBearerExternalCSD = 30, // ext CSD (GSM) + EBearerExternalWCDMA = 31, // ext PSD (WCDMA) + EBearerExternalLAN = 32, + EBearerExternalCDMA2000 = 33, + EBearerExternalGPRS = 34, + EBearerExternalHSCSD = 35, // ext HSCSD (GSM) + EBearerExternalEdgeGPRS = 36, + EBearerExternalWLAN = 37, + EBearerExternalBluetooth = 38, + EBearerExternalWcdmaCSD = 39 // ext CSD (WCDMA) +}; + +// Bearer specific general connection id +enum TConnMonBearerId +{ + EBearerIdAll = 0, + EBearerIdGPRS = 2000000, // covers internal and external GPRS and EdgeGPRS + EBearerIdWCDMA = 2000001, // covers internal and external PSD (WCDMA) + EBearerIdCSD = 2000002, // covers internal and external CSD and HSCSD (GSM) + EBearerIdGSM = 2000003, // union of EBearerIdGPRS and EBearerIdCSD + EBearerIdWLAN = 2000004, + EBearerIdLAN = 2000005, + EBearerIdWcdmaCSD = 2000006, // covers internal and external CSD (WCDMA) + EBearerIdCDMA2000 = 2000007, + EBearerIdVirtualVPN = 2000008 +}; + +// Network status +enum TConnMonNetworkStatus + { + EConnMonStatusNotAvailable = 0, + EConnMonStatusUnattached, + EConnMonStatusAttached, + EConnMonStatusActive, + EConnMonStatusSuspended + }; + +// Protocol Type (type of PDP) +// It may not be available for some bearers (returns EProtocolTypeUnknown). +enum TConnMonProtocolType +{ + EProtocolTypeUnknown = 0, + EProtocolTypeIPv4, + EProtocolTypeIPv6, + EProtocolTypeX25, + EProtocolTypePPP, + EProtocolTypeCDPD, + EProtocolTypeIP // connection uses both IPv4 and IPv6 +}; + +// Asyncronous request codes +enum TConnMonAsyncRequest + { + EConnMonGetConnectionCount = 1, + EConnMonGetIntAttribute, + EConnMonGetUintAttribute, + EConnMonGetBoolAttribute, + EConnMonGetStringAttribute, + EConnMonGetPckgAttribute + }; + +// Events sent by Connection Monitor +enum TConnMonEvent + { + EConnMonCreateConnection = 1, + EConnMonDeleteConnection = 2, + EConnMonCreateSubConnection = 3, + EConnMonDeleteSubConnection = 4, + EConnMonDownlinkDataThreshold = 5, + EConnMonUplinkDataThreshold = 6, + EConnMonNetworkStatusChange = 7, + EConnMonConnectionStatusChange = 8, + EConnMonConnectionActivityChange = 9, + EConnMonNetworkRegistrationChange = 10, + EConnMonBearerChange = 11, + EConnMonSignalStrengthChange = 12, + EConnMonBearerAvailabilityChange = 13, + EConnMonIapAvailabilityChange = 14, + EConnMonTransmitPowerChange = 15, + EConnMonSNAPsAvailabilityChange = 16, + EConnMonNewWLANNetworkDetected = 17, + EConnMonOldWLANNetworkLost = 18, + EConnMonPacketDataAvailable = 19, + EConnMonPacketDataUnavailable = 20, + EConnMonBearerInfoChange = 21, + + EConnMonPluginEventBase = 4000000 + }; + +// Network registration status. Valid for CSD, GPRS and WCDMA. +enum TConnMonNetworkRegistration + { + ENetworkRegistrationNotAvailable = 0, + ENetworkRegistrationUnknown, + ENetworkRegistrationNoService, + ENetworkRegistrationEmergencyOnly, + ENetworkRegistrationSearching, + ENetworkRegistrationBusy, + ENetworkRegistrationHomeNetwork, + ENetworkRegistrationDenied, + ENetworkRegistrationRoaming + }; + +// Traffic class +enum TQosTrafficClass + { + EQosTrafficClassConversational = 1, + EQosTrafficClassStreaming, + EQosTrafficClassInteractive, + EQosTrafficClassBackground + }; + +// Delivery order +enum TQosDeliveryOrder + { + EQosDeliveryOrderYes = 1, + EQosDeliveryOrderNo + }; + +// Delivery of erroneous SDUs +enum TQosErroneousSDUDelivery + { + EQosErroneousSDUDeliveryYes = 1, + EQosErroneousSDUDeliveryNo, + EQosErroneousSDUDeliveryUnspecified + }; + +// Residual bit error ratio +enum TQosBitErrorRatio + { + EQosBERFivePerHundred = 1, + EQosBEROnePerHundred, + EQosBERFivePerThousand, + EQosBEROnePerThousand, + EQosBEROnePerTenThousand, + EQosBEROnePerMillion + }; + +// SDU error ratio +enum TQosSDUErrorRatio + { + EQosSDUErrorRatioOnePerHundred = 1, + EQosSDUErrorRatioSevenPerThousand, + EQosSDUErrorRatioOnePerThousand, + EQosSDUErrorRatioOnePerTenThousand, + EQosSDUErrorRatioOnePerHundredThousand + }; + +// Client-server requests +enum TConnMonRequests + { + EReqGetConnectionCount = 0, + EReqGetConnectionInfo = 1, + EReqGetSubConnectionInfo = 2, + EReqGetIntAttribute = 3, + EReqGetUintAttribute = 4, + EReqGetBoolAttribute = 5, + EReqGetStringAttribute = 6, + EReqGetPckgAttribute = 7, + EReqSetIntAttribute = 8, + EReqSetUintAttribute = 9, + EReqSetBoolAttribute = 10, + EReqSetStringAttribute = 11, + EReqSetPckgAttribute = 12, + EReqCancelAsyncRequest = 13, + EReqReceiveEvent = 14, + EReqCancelReceiveEvent = 15, + + EReqPluginCreateSubSession = 500, + EReqPluginCloseSubSession = 501, + EReqPluginRegisterAttribute = 502, + EReqPluginCancelRegisterAttribute = 503, + EReqPluginEvent = 504, + EReqPluginGetQuery = 505, + EReqPluginCancelGetQuery = 506, + EReqPluginAttribute = 507, + + EReqInternalSetThreshold = 600, + EReqInternalResetThreshold = 601 + }; + +// WLAN connection modes +enum TConnMonNetworkMode + { + EConnMonInfraStructure = 0, + EConnMonAdHoc = 1, + EConnMonSecureInfra = 2 + }; + +// WLAN connection security modes +enum TConnMonSecurityMode + { + EConnMonSecurityOpen = 0, + EConnMonSecurityWep = 1, + EConnMonSecurity802d1x = 2, + EConnMonSecurityWpa = 3, + EConnMonSecurityWpaPsk = 4 + }; + +/** Defines Current Network Modes. + +Modes: Common */ + enum TConnMonMobilePhoneNetworkMode + { + /** Network mode is unknown. + + Modes: Common */ + EConnMonNetworkModeUnknown = 0, + /** ME is not registered. + + Modes: Common */ + EConnMonNetworkModeUnregistered, + /** GSM/GPRS or DCS1800 network. */ + EConnMonNetworkModeGsm, + /** AMPS network. + + Modes: CDMA */ + EConnMonNetworkModeAmps, + /** CDMA (IS-95) network. + + Modes: CDMA */ + EConnMonNetworkModeCdma95, + /** CDMA (cdma2000) network. + + Modes: CDMA */ + EConnMonNetworkModeCdma2000, + /** WCDMA (UTRA Frequency Division Duplex (FDD)) network. + + Modes: WCDMA */ + EConnMonNetworkModeWcdma, + /** TD-CDMA (UTRA Time Division Duplex (TDD)) network. + + Modes: WCDMA */ + EConnMonNetworkModeTdcdma + }; + + +// Maximum size of a plug-in's attribute or event data +const TUint KConnMonMaxPluginDataSize = 512; +const TUint KConnMonMaxStringAttributeLength = 64; + + +// Package class definition for getting the TTime +typedef TPckgBuf< TTime > TConnMonTimeBuf; + +// Package class definition for getting the client information +const TUint KConnMonMaxClientUids = 10; + +class TConnMonClientEnum + { + public: + inline TConnMonClientEnum():iCount(0){} + public: + TUint iCount; + TUid iUid[ KConnMonMaxClientUids ]; + }; +typedef TPckgBuf< TConnMonClientEnum > TConnMonClientEnumBuf; + +// Package class definition for getting network names +const TUint KConnMonMaxNetworkCount = 10; + +class TConnMonNetwork + { + public: + inline TConnMonNetwork():iType(0), iSignalStrength(0){} + public: + TBuf8< 32 > iName; + TInt8 iType; // see TConnMonNetworkMode + TUint8 iSignalStrength; + }; + +class TConnMonNetworkNames + { + public: + inline TConnMonNetworkNames():iCount(0){} + inline TUint Count() {return iCount;} + public: + TUint iCount; + TConnMonNetwork iNetwork[ KConnMonMaxNetworkCount ]; + }; + +typedef TPckgBuf< TConnMonNetworkNames > TConnMonNetworkNamesBuf; + +// Package class definiton for getting available IAPs +const TUint KConnMonMaxIAPCount = 25; + +class TConnMonIap + { + public: + inline TConnMonIap():iIapId(0){} + public: + TUint iIapId; + }; + +class TConnMonIapInfo + { + public: + inline TConnMonIapInfo():iCount(0){} + inline TUint Count() {return iCount;} + public: + TUint iCount; + TConnMonIap iIap[ KConnMonMaxIAPCount ]; + }; + +typedef TPckgBuf< TConnMonIapInfo > TConnMonIapInfoBuf; + +// Package class definiton for receiving event of SNAPs' availability change +const TUint KConnMonMaxSNAPsCount = 25; + +class TConnMonSNAPId + { + public: + inline TConnMonSNAPId():iSNAPId(0){} + public: + TUint iSNAPId; + }; + +class TConnMonSNAPInfo + { + public: + inline TConnMonSNAPInfo():iCount(0){} + inline TUint Count() {return iCount;} + public: + TUint iCount; // amount of items in iSNAP + TConnMonSNAPId iSNAP[ KConnMonMaxSNAPsCount ]; // array of ids of available SNAPs + }; + +typedef TPckgBuf< TConnMonSNAPInfo > TConnMonSNAPInfoBuf; + +/** + * Interface template for the class T serialization to/from HBuf/TPtr + * Class T could be any type of class (T, C, etc) + * + * @since S60 v3.1 + */ +template +class MDesSerializer + { + public: + + /** + * Have to pack the object of class T to HBufC + * Ownership of newly cleated pointer is transferred to caller + * @since S60 v3.1 + * @return pointer to heap descriptor + */ + virtual const HBufC* ToBuf() const = 0; + + /** + * Have to unpack object of class T from aPtrC + * @since S60 v3.1 + * @return const pointer to heap descriptor + */ + static T FromPtrC(const TPtrC& aPtrC); + + }; + +/** + * TConnMonWLANNetwork is a class, incapsulated WLAN network abstraction + * Implements MDesSerializer interface to be able to be transferred through processes (client/server) + * in object's size-independent manner, to meet backward/forward compatibility + * + * @since S60 v3.1 + */ + +class TConnMonWLANNetwork: public MDesSerializer + { + public: + + // Length of the WLAN network name + static const TUint KMaxNameLength = 32; + + // amount of additional fields in the buffer + static const TUint KNumberOfExtraFields = 0; + + // defines max size of the object in TChar's + static const TUint KMaxSize = ( + sizeof(TUint) // length of name + +sizeof(TBuf) // iName + +sizeof(TUint) // iConnectionMode + +sizeof(TUint) // iSignalStrength + +sizeof(TUint) // iSecurityMode + +sizeof(TUint) // length of buffer + +sizeof(TInt)*KNumberOfExtraFields + +sizeof(RArray) // Array of extra fields + )/ sizeof(TChar) + 1; // +1 is for rounding to bigger integer + + // defines shifts of fields inside the object, packed to a descriptor + enum FieldsShifts + { + ENameLength = 0, + EName = 1, + // relatively to iName's end + EConnectionMode = 1, + ESignalStrength = 2, + ESecurityMode = 3, + EBufCounter = 4, + EBufBase = 4/*, + EBufParam0 = 5 */ + }; + + /** + * Default constructor + * @param aName name of the network + * @param aConectionMode ConnectionMode of the network + * @param aSignalStrength Signal strength of the network + * @param aSecurityMode Security mode of the network + * @param aBuf Buffer of the additional fields + * @since S60 v3.1 + */ + IMPORT_C TConnMonWLANNetwork(const TBuf& aName, TUint aConnectionMode, + TUint aSignalStrength, TUint aSecurityMode, const RArray& aBuf); + + /** + * Destructor + * + */ + IMPORT_C virtual ~TConnMonWLANNetwork(); + + /** + * Compares two networks by iSignalStrength; + * + * @param aFirst to be compared with aSecond + * @return 1 if aFirst less than aSecond; 0 if they are equal; -1 otherwise + */ + IMPORT_C static TInt LessBySignal(const TConnMonWLANNetwork& aFirst, const TConnMonWLANNetwork& aSecond); + + /** + * Getters Name(), ConnectionMode(), SignalStrength(), SecurityMode(), Buf() + * + * @return copy of the fields + */ + inline TBuf Name() + { + return iName; + }; + inline TUint ConnectionMode() + { + return iConnectionMode; + }; + inline TUint SignalStrength() + { + return iSignalStrength; + }; + inline TUint SecurityMode() + { + return iSecurityMode; + }; + inline RArray Buf() + { + return iBuf; + }; + + // From MDesSerializer + + /** + * See MDesSerializer + */ + IMPORT_C const HBufC* ToBuf() const; + + /** + * See MDesSerializer + */ + IMPORT_C static TConnMonWLANNetwork FromPtrC(const TPtrC& aPtrC); + + // data + private: + + TBuf iName; // Network name + TUint iConnectionMode; // See TConnMonNetworkMode + TUint iSignalStrength; // Signal strength + TUint iSecurityMode; // See TConnMonSecurityMode + RArray iBuf; // For additional fields +}; + +// Array of the WLAN networks +typedef RArray RConnMonWLANNetworksArray; + +/** + * Template for the package of array of items of class TConnMonWLANNetwork + * + * @since S60 v3.1 + */ + +class ConnMonWLANNetworksArrayPckg + { +public: + + /** + * Constructs the package of array of objects TConnMonWLANNetwork on the heap + * + * @param aRef Array of objects of class TConnMonWLANNetwork + * @param aBufSize Size of the buffer, intended to contain the package + */ + ConnMonWLANNetworksArrayPckg(const RArray& aRef, TUint aBufSize); + + /** + * Constructs empty package on the heap + * + * @param aBufSize Size of the buffer, intended to contain the package + */ + IMPORT_C ConnMonWLANNetworksArrayPckg(TUint aBufSize); + + /** + * Destruction + */ + IMPORT_C virtual ~ConnMonWLANNetworksArrayPckg(); + + /** + * Unpacks package to an array of objects of class TConnMonWLANNetwork + * + * @param aRef Array, intended to containing the unpacked objects + */ + IMPORT_C void UnpackToL(RArray& aRef) const; + + /** + * Gets iBuf + * + * @return iBuf + */ + IMPORT_C HBufC* Buf() const; + + // data + private: + + /** + * Buffer on the heap, containing the package + */ + HBufC* iBuf; + + }; + +/** + * Id + * MDesSerializer - abstract interface for class serialization + * ConnMonTId class declaration + * + * @since S60 v3.1 + */ +class TConnMonId : public MDesSerializer + { + +public: + + // defines max size of the object in TChar's + static const TUint KMaxSize = ( + sizeof(TUid) // iId + )/ sizeof(TChar) + 1; // +1 is for rounding to bigger integer + + // defines shifts of fields inside the object + enum FieldsShifts + { + EId = 0 + }; + + /** + * Constructor. + * @param aId ID + */ + IMPORT_C TConnMonId(TUint aId); + + /** + * + * iId getter + * + * @return iId + */ + IMPORT_C TUint Id() const; + + // From MDesSerializer + + /** + * See MDesSerializer + */ + IMPORT_C const HBufC* ToBuf() const; + + /** + * See MDesSerializer + */ + IMPORT_C static TConnMonId FromPtrC(const TPtrC& aPtrC); + +protected: + +private: + +protected: // data + + /** + * ID + */ + const TUint iId; + +private: // data + + }; + +// Array of the ids +typedef RArray RConnMonIdsArray; + +/** + * Package of array of items of class TConnMonId + * + * @since S60 v3.1 + */ + +class ConnMonIdsArrayPckg + { +public: + + /** + * Constructs the package of array + * + * @param aRef Array to be packed + * @param aBufSize Length of the buffer, intended to contain the package + */ + ConnMonIdsArrayPckg(const RArray& aRef, TUint aBufSize); + + /** + * Constructs an empty package + * + * @param aBufSize Length of the buffer, intended to contain the package + */ + IMPORT_C ConnMonIdsArrayPckg(TUint aBufSize); + + /** + * Destruction + */ + IMPORT_C virtual ~ConnMonIdsArrayPckg(); + + /** + * Unpacks package to the array + * + * @param aRef Array, intended to containing the unpacked objects + */ + IMPORT_C void UnpackToL(RArray& aRef) const; + + /** + * Gets iBuf + * gettet returns not const + * @return iBuf + */ + IMPORT_C HBufC* Buf() const; + + // data + protected: + + /** + * Buffer, containing the package + */ + HBufC* iBuf; + + }; + +// FORWARD DECLARATIONS +class CConnMonEventBase; +class CConnMonEventHandler; +class CMusAvaTimer; + +// CLASS DECLARATION +/** +* MConnectionMonitorObserver +* Client application must implement the MConnectionMonitorObserver interface +* in order to receive notifications. MConnectionMonitorObserver::EventL() method +* will be called every time an event arrives. +* +* @lib CONNMON.LIB +* @since +*/ +class MConnectionMonitorObserver + { + public: + /** + * Event method is called every time an event occures. + * @since + * @param aConnMonEvent The event information. + * @return void + */ + virtual void EventL( const CConnMonEventBase &aConnMonEvent ) =0; + }; + +/** +* RConnectionMonitor +* @lib CONNMON.LIB +* @since +*/ +class RConnectionMonitor : public RSessionBase + { + public: // Constructor + inline RConnectionMonitor() : RSessionBase(), iHandler( 0 ), iPtrArray(), iIndex( 0 ) {}; + + public: // New methods + /** + * Connects the client to the Connection Monitor Server. It must be called + * before any of other methods during the Connection Monitor session. + * @since + * @return KErrNone if succesfull, a system-wide error code if not. + */ + IMPORT_C TInt ConnectL(); + + /** + * Closes the Connection Monitor session. An opened RConnectionMonitor must + * be closed explicitily to prevent a resource (memory) leak. + * @since + * @return void + */ + IMPORT_C void Close(); + + /** + * Gathers information on currently active connections. + * @since + * @param aConnectionCount On completion, contains the number of active connections. + * @param aStatus KErrNone if successful, a system-wide error code if not. + * @return void + */ + IMPORT_C void GetConnectionCount( TUint& aConnectionCount, TRequestStatus& aStatus ); + + /** + * Gets the connection id and the count of the subconnections for the given index. + * GetConnectionCount() must be called to gather the information on active + * connections before calling this method. + * @param aIndex Must be between 1 and the count returned by GetConnectionCount(). + * @param aConnectionId On return, contains the connection id. + * @param aSubConnectionCount On return, contains the number of subconnections. + * @return void + */ + IMPORT_C TInt GetConnectionInfo( const TUint aIndex, + TUint& aConnectionId, + TUint& aSubConnectionCount ) const; + + /** + * Gets the subconnection id for the given index. + * @param aConnectionId Connection id. + * @param aIndex Must be between 1 and the count returned by GetConnectionInfo(). + * @param aSubConnectionId On return, contains the subconnection id. + * @return KErrNone if successful, a system-wide error code if not. + */ + IMPORT_C TInt GetSubConnectionInfo( const TUint aConnectionId, + const TUint aIndex, + TUint& aSubConnectionId ) const; + + /** + * Gets the value for a TInt attribute. + * @param aConnectionId Connection id. + * @param aSubConnectionId Subconnection id. If set to 0, method applies to connection. + * @param aAttribute Identifies the attribute to be retrived. + * @param aValue On completion, contains the requested TInt attribute. + * @param aStatus KErrNone if successful, a system-wide error code if not. + * @return void. + */ + IMPORT_C void GetIntAttribute( const TUint aConnectionId, + const TUint aSubConnectionId, + const TUint aAttribute, + TInt& aValue, + TRequestStatus& aStatus ); + + /** + * Gets the value for a TUint attribute. + * @param aConnectionId Connection id. + * @param aSubConnectionId Subconnection id. If set to 0, method applies to connection. + * @param aAttribute Identifies the attribute to be retrived. + * @param aValue On completion, contains the requested TUint attribute. + * @param aStatus KErrNone if successful, a system-wide error code if not. + * @return void. + */ + IMPORT_C void GetUintAttribute( const TUint aConnectionId, + const TUint aSubConnectionId, + const TUint aAttribute, + TUint& aValue, + TRequestStatus& aStatus ); + + /** + * Gets the value for a TBool attribute. + * @param aConnectionId Connection id. + * @param aSubConnectionId Subconnection id. If set to 0, method applies to connection. + * @param aAttribute Identifies the attribute to be retrived. + * @param aValue On completion, contains the requested TBool attribute. + * @param aStatus KErrNone if successful, a system-wide error code if not. + * @return void. + */ + IMPORT_C void GetBoolAttribute( const TUint aConnectionId, + const TUint aSubConnectionId, + const TUint aAttribute, + TBool& aValue, + TRequestStatus& aStatus ); + + /** + * Gets the value for a string attribute. + * @param aConnectionId Connection id. + * @param aSubConnectionId Subconnection id. If set to 0, method applies to connection. + * @param aAttribute Identifies the attribute to be retrived. + * @param aValue On completion, contains the requested string. Use a 16-bit descriptor! + * @param aStatus KErrNone if successful, a system-wide error code if not. + * @return void. + */ + IMPORT_C void GetStringAttribute( const TUint aConnectionId, + const TUint aSubConnectionId, + const TUint aAttribute, + TDes& aValue, + TRequestStatus& aStatus ) const; + + /** + * Gets the value for a packaged attribute (TConnMonTimeBuf, TConnMonClientEnumBuf). + * @param aConnectionId Connection id. + * @param aSubConnectionId Subconnection id. If set to 0, method applies to connection. + * @param aAttribute Identifies the attribute to be retrived. + * @param aValue On completion, contains the requested packaged attribute. + * @param aStatus KErrNone if successful, a system-wide error code if not. + * @return void. + */ + IMPORT_C void GetPckgAttribute( const TUint aConnectionId, + const TUint aSubConnectionId, + const TUint aAttribute, + TDes8& aValue, + TRequestStatus& aStatus ) const; + + /** + * Gets the value for a packaged attribute (TConnMonTimeBuf, TConnMonClientEnumBuf). + * @param aConnectionId Connection id. + * @param aSubConnectionId Subconnection id. If set to 0, method applies to connection. + * @param aAttribute Identifies the attribute to be retrived. + * @param aValue On completion, contains the requested packaged attribute. + * @param aStatus KErrNone if successful, a system-wide error code if not. + * @return void. + */ + IMPORT_C void GetPckgAttribute( const TUint aConnectionId, + const TUint aSubConnectionId, + const TUint aAttribute, + TDes16& aValue, + TRequestStatus& aStatus ) const; + + /** + * Sets the value for a TInt attribute. + * @param aConnectionId Connection id. + * @param aSubConnectionId Subconnection id. If set to 0, method applies to connection. + * @param aAttribute Identifies the attribute to be set. + * @param aValue The value to be set. + * @return KErrNone if successful, a system-wide error code if not. + */ + IMPORT_C TInt SetIntAttribute( const TUint aConnectionId, + const TUint aSubConnectionId, + const TUint aAttribute, + const TInt aValue ) const; + + /** + * Sets the value for a TUint attribute. + * @param aConnectionId Connection id. + * @param aSubConnectionId Subconnection id. If set to 0, method applies to connection. + * @param aAttribute Identifies the attribute to be set. + * @param aValue The value to be set. + * @return KErrNone if successful, a system-wide error code if not. + */ + IMPORT_C TInt SetUintAttribute( const TUint aConnectionId, + const TUint aSubConnectionId, + const TUint aAttribute, + const TUint aValue ) const; + + /** + * Sets the value for a TBool attribute. + * This method can be used to stop a connection (KConnectionStop). + * @param aConnectionId Connection id. + * @param aSubConnectionId Subconnection id. If set to 0, method applies to connection. + * @param aAttribute Identifies the attribute to be set. + * @param aValue The value to be set. + * @return KErrNone if successful, a system-wide error code if not. + */ + IMPORT_C TInt SetBoolAttribute( const TUint aConnectionId, + const TUint aSubConnectionId, + const TUint aAttribute, + const TBool aValue ) const; + + /** + * Sets the value for a string attribute. + * @param aConnectionId Connection id. + * @param aSubConnectionId Subconnection id. If set to 0, method applies to connection. + * @param aAttribute Identifies the attribute to be set. + * @param aValue The string value to be set. Must be a 16-bit descriptor!. + * @return KErrNone if successful, a system-wide error code if not. + */ + IMPORT_C TInt SetStringAttribute( const TUint aConnectionId, + const TUint aSubConnectionId, + const TUint aAttribute, + const TDes& aValue ) const; + + /** + * Sets the value for a packaged attribute. + * @param aConnectionId Connection id. + * @param aSubConnectionId Subconnection id. If set to 0, method applies to connection. + * @param aAttribute Identifies the attribute to be set. + * @param aValue The value to be set. + * @return KErrNone if successful, a system-wide error code if not. + */ + IMPORT_C TInt SetPckgAttribute( const TUint aConnectionId, + const TUint aSubConnectionId, + const TUint aAttribute, + const TDes8& aValue ) const; + + /** + * Cancels an asyncronous request. + * @param aReqToCancel Identifies the request to be cancelled. + * Values are defined in TConnMonAsyncRequest. + * @return void. + */ + IMPORT_C void CancelAsyncRequest( TInt aReqToCancel ); + + /** + * Registers an event observer to catch connection monitor events. + * @param aObserver The event observer. + * @return KErrNone if successful, a system-wide error code if not. + */ + IMPORT_C TInt NotifyEventL( MConnectionMonitorObserver& aObserver ); + + /** + * Cancels the notifications. + * @return void. + */ + IMPORT_C void CancelNotifications(); + + private: // New methods + void ReceiveEvent( TDes8& aBuffer, TDes8& aExtraBuf, TRequestStatus& aStatus ); + void CancelReceiveEvent(); + TBool IsConnected() const; + TPtr8& NextPtr(); + + public: //Data + TUint iConnectionCounter; + TUint iConnectionId; + TUint iSubConnectionCount; + TUint iUintAttributeValue; + TRequestStatus iStatus; + TInt iConnectionInfoError; + private: + CConnMonEventHandler* iHandler; + RArray< TPtr8 > iPtrArray; + TInt iIndex; + HBufC8* iEmptyHbufC; + CMusAvaTimer* iMusAvaTimer; + + private: // Friend classes + friend class CConnMonEventHandler; + }; + +/** +* CConnMonEventBase +* Base class for all event types. +* @lib CONNMON.LIB +* @since +*/ +NONSHARABLE_CLASS( CConnMonEventBase ) : public CBase + { + public: // constructors and destructor + CConnMonEventBase( const TInt aEventType, const TUint iConnectionId ); + ~CConnMonEventBase(); + + public: // new methods + /** + * Gets the type of the event. + * @return Type of the event. Values are defined in TConnMonEventType. + */ + IMPORT_C TInt EventType() const; + + /** + * Gets the connection id of the connection. + * @return Connection id. + */ + IMPORT_C TUint ConnectionId() const; + + private: // Data + TInt iEventType; + TUint iConnectionId; + }; + +/** +* CConnMonCreateConnection +* Event is triggered when a new connection has been been created. +* @lib CONNMON.LIB +* @since +*/ +NONSHARABLE_CLASS( CConnMonCreateConnection ) : public CConnMonEventBase + { + public: // constructors and destructor + CConnMonCreateConnection( const TUint aConnectionId ); + ~CConnMonCreateConnection(); + }; + +/** +* CConnMonDeleteConnection +* Event is triggered when a connection has been been deleted. +* @lib CONNMON.LIB +* @since +*/ +NONSHARABLE_CLASS( CConnMonDeleteConnection ) : public CConnMonEventBase + { + public: // constructors and destructor + CConnMonDeleteConnection( const TUint aConnectionId, + const TUint aDownlinkData, + const TUint aUplinkData, + const TBool aAuthDelete ); + ~CConnMonDeleteConnection(); + + public: // new methods + /** + * Gets the downlink data volume. + * @return Downlink data volume in bytes. + */ + IMPORT_C TUint DownlinkData() const; + + /** + * Gets the uplink data volume. + * @return Uplink data volume in bytes. + */ + IMPORT_C TUint UplinkData() const; + + /** + * Returns ETrue if the user has deactivated the connection + * by using Connection Monitor or if some application has issued + * RConnection::Stop( RConnection::EStopAuthoritative ). + * @return ETrue if connection has been deactivated in an + * authoritative way otherwise returns EFalse. + */ + IMPORT_C TBool AuthoritativeDelete() const; + + private: // Data + TUint iDownlinkData; + TUint iUplinkData; + TBool iAuthDelete; + }; + +/** +* CConnMonCreateSubConnection +* Event is triggered when a new subconnection has been been created. +* @lib CONNMON.LIB +* @since +*/ +NONSHARABLE_CLASS( CConnMonCreateSubConnection ) : public CConnMonEventBase + { + public: // constructors and destructor + CConnMonCreateSubConnection( const TUint aConnectionId, + const TUint aSubConnectionId ); + ~CConnMonCreateSubConnection(); + + public: // new methods + /** + * Gets the new subconnection id. + * @return Subconnection id. + */ + IMPORT_C TUint SubConnectionId() const; + + private: // Data + TUint iSubConnectionId; + }; + +/** +* CConnMonDeleteSubConnection +* Event is triggered when a subconnection has been been deleted. +* @lib CONNMON.LIB +* @since +*/ +NONSHARABLE_CLASS( CConnMonDeleteSubConnection ) : public CConnMonEventBase + { + public: // constructors and destructor + CConnMonDeleteSubConnection( const TUint aConnectionId, + const TUint aSubConnectionId, + const TUint aDownlinkData, + const TUint aUplinkData, + const TBool aAuthDelete ); + ~CConnMonDeleteSubConnection(); + + public: // new methods + /** + * Gets the subconnection id of the deleted subconnection. + * @return Subconnection id. + */ + IMPORT_C TUint SubConnectionId() const; + + /** + * Gets the downlink data volume. + * @return Downlink data volume in bytes. + */ + IMPORT_C TUint DownlinkData() const; + + /** + * Gets the uplink data volume. + * @return Uplink data volume in bytes. + */ + IMPORT_C TUint UplinkData() const; + + /** + * Returns ETrue if the user has deactivated the connection + * by using Connection Monitor or if some application has issued + * RConnection::Stop( RConnection::EStopAuthoritative ). + * @return ETrue if connection has been deactivated in an + * authoritative way otherwise returns EFalse. + */ + IMPORT_C TBool AuthoritativeDelete() const; + + private: // Data + TUint iSubConnectionId; + TUint iDownlinkData; + TUint iUplinkData; + TBool iAuthDelete; + }; + +/** +* CConnMonDownlinkDataThreshold +* Event is triggered when there is a change in the volume of downlink data +* for some connection. The notification will only complete when the change in +* volume increases by a client specified amount (KDownlinkDataThreshold). +* If KDownlinkDataThreshold=0 (=default) events will not be sent for that connection. +* @lib CONNMON.LIB +* @since +*/ +NONSHARABLE_CLASS( CConnMonDownlinkDataThreshold ) : public CConnMonEventBase + { + public: // constructors and destructor + CConnMonDownlinkDataThreshold( const TUint aConnectionId, + const TUint aSubConnectionId, + const TUint aDownlinkData ); + ~CConnMonDownlinkDataThreshold(); + + public: // new methods + /** + * Gets the subconnection id. + * @return Subconnection id. + */ + IMPORT_C TUint SubConnectionId() const; + + /** + * Gets the downlink data volume. + * @return Downlink data volume in bytes. + */ + IMPORT_C TUint DownlinkData() const; + + private: // Data + TUint iSubConnectionId; + TUint iDownlinkData; + }; + +/** +* CConnMonUplinkDataThreshold +* Event is triggered when there is a change in the volume of uplink data +* for some connection. The notification will only complete when the change +* in volume increases by a client specified amount (KUplinkDataThreshold). +* If KUplinkDataThreshold=0 (=default) events will not be sent for that connection. +* @lib CONNMON.LIB +* @since +*/ +NONSHARABLE_CLASS( CConnMonUplinkDataThreshold ) : public CConnMonEventBase + { + public: // constructors and destructor + CConnMonUplinkDataThreshold( const TUint aConnectionId, + const TUint aSubConnectionId, + const TUint aUplinkData ); + ~CConnMonUplinkDataThreshold(); + + public: // new methods + /** + * Gets the subconnection id. + * @return Subconnection id. + */ + IMPORT_C TUint SubConnectionId() const; + + /** + * Gets the uplink data volume. + * @return Uplink data volume in bytes. + */ + IMPORT_C TUint UplinkData() const; + + private: // Data + TUint iSubConnectionId; + TUint iUplinkData; + }; + +/** +* CConnMonNetworkStatusChange +* Event is triggered when network status changes for some connection. +* Connection id passed in the event is a bearer specific connection id (TConnMonBearerId). +* @lib CONNMON.LIB +* @since +*/ +NONSHARABLE_CLASS( CConnMonNetworkStatusChange ) : public CConnMonEventBase + { + public: // constructors and destructor + CConnMonNetworkStatusChange( const TUint aConnectionId, + const TInt aNetworkStatus ); + ~CConnMonNetworkStatusChange(); + + public: // new methods + /** + * Gets the network status. + * @return Network status. Values are defined in TConnMonNetworkStatus. + */ + IMPORT_C TInt NetworkStatus() const; + + private: // Data + TInt iNetworkStatus; + }; + +/** +* CConnMonConnectionStatusChange +* Event is triggered when the status of some connection changes. +* @lib CONNMON.LIB +* @since +*/ +NONSHARABLE_CLASS( CConnMonConnectionStatusChange ) : public CConnMonEventBase + { + public: // constructors and destructor + CConnMonConnectionStatusChange( const TUint aConnectionId, + const TUint aSubConnectionId, + const TInt aConnectionStatus ); + ~CConnMonConnectionStatusChange(); + + public: // new methods + /** + * Gets the subconnection id. + * @return Subconnection id. + */ + IMPORT_C TUint SubConnectionId() const; + + /** + * Gets the connection status. + * @return Connection status. Values are defined in nifvar.h. + */ + IMPORT_C TInt ConnectionStatus() const; + + private: // Data + TUint iSubConnectionId; + TInt iConnectionStatus; + }; + +/** +* CConnMonConnectionActivityChange +* Event is triggered when some connection changes from active to idle or vice versa. +* If KActivityTimeThreshold=0 (=default) events will not be sent for that connection. +* KActivityTimeThreshold defines the period (in seconds) for checking whether the +* connection is active or not. +* @lib CONNMON.LIB +* @since +*/ +NONSHARABLE_CLASS( CConnMonConnectionActivityChange ) : public CConnMonEventBase + { + public: // constructors and destructor + CConnMonConnectionActivityChange( const TUint aConnectionId, + const TUint aSubConnectionId, + const TBool aActivity ); + ~CConnMonConnectionActivityChange(); + + public: // new methods + /** + * Gets the subconnection id. + * @return Subconnection id. + */ + IMPORT_C TUint SubConnectionId() const; + + /** + * Gets the connection activity. + * @return ETrue if the connection is active, EFalse if not. + */ + IMPORT_C TBool ConnectionActivity() const; + + private: // Data + TUint iSubConnectionId; + TBool iActivity; + }; + +/** +* CConnMonNetworkRegistrationChange +* Event is triggered when network registration status (GSM/GPRS/WCDMA) changes. +* Connection id passed in the event is generic (TConnMonBearerId) and the event +* applies to all (GSM/GPRS/WCDMA) connections. +* @lib CONNMON.LIB +* @since 2.5 +*/ +NONSHARABLE_CLASS( CConnMonNetworkRegistrationChange ) : public CConnMonEventBase + { + public: // constructors and destructor + CConnMonNetworkRegistrationChange( const TUint aConnectionId, + const TInt aRegistrationStatus ); + ~CConnMonNetworkRegistrationChange(); + + public: // new methods + /** + * Gets the network registration status. + * @return Registration status. Values are defined in TConnMonNetworkRegistration. + */ + IMPORT_C TInt RegistrationStatus() const; + + private: // Data + TInt iRegistrationStatus; + }; + +/** +* CConnMonBearerChange +* Event is triggered when bearer type (GPRS / Edge GPRS / WCDMA) changes. +* Connection id passed in the event is generic (see. TConnMonBearerId) and the event +* applies to all GPRS connections (including also external GPRS connections). +* @lib CONNMON.LIB +* @since 2.1 +*/ +NONSHARABLE_CLASS( CConnMonBearerChange ) : public CConnMonEventBase + { + public: // constructors and destructor + CConnMonBearerChange( const TUint aConnectionId, const TInt aBearer ); + ~CConnMonBearerChange(); + + public: // new methods + /** + * Gets the new bearer. Values are defined in TConnMonBearerType. + * @return + */ + IMPORT_C TInt Bearer() const; + + private: // Data + TInt iBearer; + }; + +/** +* CConnMonSignalStrengthChange +* Event is triggered when signal strength (dB) changes (GSM or WLAN). +* Connection id passed in the event is generic (see. TConnMonBearerId) and the event +* applies to all GSM or WLAN connections. +* Client must set KSignalStrengthThreshold to 1 to receive these events. +* @lib CONNMON.LIB +* @since +*/ +NONSHARABLE_CLASS( CConnMonSignalStrengthChange ) : public CConnMonEventBase + { + public: // constructors and destructor + CConnMonSignalStrengthChange( const TUint aConnectionId, const TInt aSignalStrength ); + ~CConnMonSignalStrengthChange(); + + public: // new methods + /** + * Gets the signal strength. + * @return + */ + IMPORT_C TInt SignalStrength() const; + + private: // Data + TInt iSignalStrength; + }; + +/** +* CConnMonBearerAvailabilityChange +* Event is triggered when the availability of some bearer changes. +* Connection id passed in the event is generic (see. TConnMonBearerId). +* Client must set KBearerAvailabilityThreshold to 1 to receive these events. +* @lib CONNMON.LIB +* @since +*/ +NONSHARABLE_CLASS( CConnMonBearerAvailabilityChange ) : public CConnMonEventBase + { + public: // constructors and destructor + CConnMonBearerAvailabilityChange( const TUint aConnectionId, + const TBool aAvailability ); + ~CConnMonBearerAvailabilityChange(); + + public: // new methods + /** + * Gets the availability of a bearer . + * @return ETrue if the bearer is available, EFalse if not. + */ + IMPORT_C TBool Availability() const; + + private: // Data + TBool iAvailability; + }; + +/** +* CConnMonGenericEvent +* Event is triggered when a plug-in engine sends a bearer specific event +* that is unknown to the Connection Monitor server. +* Connection id passed in the event is generic (see. TConnMonBearerId). +* @lib CONNMON.LIB +* @since +*/ +NONSHARABLE_CLASS( CConnMonGenericEvent ) : public CConnMonEventBase + { + public: // constructors and destructor + CConnMonGenericEvent( const TUint aType, + const TUint aConnectionId, + TAny* aData ); + ~CConnMonGenericEvent(); + + public: // new methods + /** + * Gets a pointer to the event data. + * Note that the pointer is valid only inside EventL(). + * @return A pointer to the event data. + */ + IMPORT_C TAny* Data() const; + + private: // Data + TAny* iData; + }; + +/** +* CConnMonIapAvailabilityChange +* Event is triggered when when IAP Availability changes. +* Connection id passed in the event is generic (see. TConnMonBearerId). +* @lib CONNMON.LIB +* @since +*/ +NONSHARABLE_CLASS( CConnMonIapAvailabilityChange ) : public CConnMonEventBase + { + public: // constructors and destructor + CConnMonIapAvailabilityChange( const TUint aConnectionId, + const TConnMonIapInfo* aIapInfoPtr ); + ~CConnMonIapAvailabilityChange(); + + public: // new methods + /** + * Gets the IAP availability information. + * @return TConnMonIapInfo. + */ + IMPORT_C TConnMonIapInfo IapAvailability() const; + + private: // Data + TConnMonIapInfo iIapInfo; + }; + +/** +* CConnMonTransmitPowerChange +* Event is triggered when the used transmit power (mW) changes (WLAN). +* Connection id passed in the event is EBearerIdWLAN. +* @lib CONNMON.LIB +* @since +*/ +NONSHARABLE_CLASS( CConnMonTransmitPowerChange ) : public CConnMonEventBase + { + public: // constructors and destructor + CConnMonTransmitPowerChange( const TUint aConnectionId, const TUint aTransmitPower ); + ~CConnMonTransmitPowerChange(); + + public: // new methods + /** + * Gets the transmit power. + * @return + */ + IMPORT_C TUint TransmitPower() const; + + private: // Data + TUint iTransmitPower; + }; + +/** +* CConnMonSNAPsAvailabilityChange +* Event is triggered when when SNAPs Availability changes. +* Connection id passed in the event is generic (see. TConnMonBearerId). +* @lib CONNMON.LIB +* @since +*/ +NONSHARABLE_CLASS( CConnMonSNAPsAvailabilityChange ) : public CConnMonEventBase + { + public: // constructors and destructor + CConnMonSNAPsAvailabilityChange( const TUint aConnectionId, + const TUint aSNAPsAvailable, + const TConnMonSNAPInfo* aSNAPInfoPtr ); + ~CConnMonSNAPsAvailabilityChange(); + + public: // new methods + /** + * Gets the SNAP availability information. + * @return TConnMonSNAPInfo. + */ + IMPORT_C TConnMonSNAPInfo SNAPAvailability() const; + + /** + * Gets amount of available SNAPs. + * @return iSNAPsAvailable + */ + IMPORT_C TUint SNAPsAvailabile() const; + + private: // Data + TConnMonSNAPInfo iSNAPInfo; + TUint iSNAPsAvailable; + }; + +/** +* CConnNewWLANNetworkDetected +* Event is triggered when new WLAN network is detected. +* Connection id passed in the event is generic (TConnMonBearerWLAN). +* iDetected is TRUE, if new network is detected +* @lib CONNMON.LIB +* @since +*/ +NONSHARABLE_CLASS( CConnMonNewWLANNetworkDetected ) : public CConnMonEventBase + { + public: // constructors and destructor + CConnMonNewWLANNetworkDetected( const TUint aConnectionId/*, + const TBool aDetected*/ ); + ~CConnMonNewWLANNetworkDetected(); + + public: // new methods + /** + * New WLAN network is in visibility range + * @return ETrue if the new WLAN network detected, EFalse if not. + */ + // IMPORT_C TBool Detected() const; + + // private: // Data + // TBool iDetected; + }; + +/** +* CConnOldWLANNetworkLost +* Event is triggered when old WLAN network is lost. +* Connection id passed in the event is generic (TConnMonBearerWLAN). +* iLost is TRUE, if old network is lost +* @lib CONNMON.LIB +* @since +*/ +NONSHARABLE_CLASS( CConnMonOldWLANNetworkLost ) : public CConnMonEventBase + { + public: // constructors and destructor + CConnMonOldWLANNetworkLost( const TUint aConnectionId/*, + const TBool aLost */); + ~CConnMonOldWLANNetworkLost(); + + public: // new methods + /** + * New WLAN network is lost from visibility range + * @return ETrue if the old WLAN network lost, EFalse if not. + */ + // IMPORT_C TBool Lost() const; + + private: // Data + // TBool iLost; + }; +#endif //__CONNECTIONMONITOR_H +// end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/sipclienttransaction.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/sipclienttransaction.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,187 @@ +/* +* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 CSIPCLIENTTRANSACTION_H +#define CSIPCLIENTTRANSACTION_H + + +// INCLUDES +#include "siptransactionbase.h" + +// FORWARD DECLARATIONS +class CSIPRefresh; + + +#ifdef CPPUNIT_TEST +#undef IMPORT_C +#define IMPORT_C +#endif + + +/** +* +* Class for managing SIP client transactions. +* It provides services for ending and getting the SIP client transaction +* parameters. Some client transactions can also be canceled. +* +* The user of the class cannot instante this class. +* @lib sipclient +*/ +class CSIPClientTransaction: public CSIPTransactionBase + { + public: + + /** + * Destructor + */ + + IMPORT_C ~CSIPClientTransaction(); + + public: + + /** + * Gets response elements of the most recent response. + * @return Response elements. Ownership isn't transferred. + */ + + IMPORT_C const CSIPResponseElements* ResponseElements() const; + + + /** + * Cancels client transaction i.e. creates a CANCEL request + * and sends to the remote UA; + * leaves on failure. + * @pre State()==EProceeding + * @pre CancelAllowed()==ETrue + * @pre Connection().State()==EActive + * @return SIP CANCEL transaction, ownership is transferred. + * @leave KErrSIPInvalidTransactionState if canceling is not possible + * at all, or because the transaction is not in a proper state or the + * transaction is not related to a dialog. + * @leave KErrSIPResourceNotAvailable if a required SIP Client API + * object has been deleted + */ + + IMPORT_C CSIPClientTransaction* CancelL(); + + + /** + * Gets the associated refresh with the transaction. + * If the refresh is associated with the transaction, + * transaction will be refreshed at defined interval. + * @return associated refresh or 0-pointer if there's no + * associated refresh. Ownership isn't transferred. + */ + + IMPORT_C const CSIPRefresh* Refresh() const; + + + /** + * Checks if the client transaction is such that it can be cancelled. + * This does no check whether the transaction is currently in such a + * state that the canceling can be done now. + * + * @return ETrue if client transaction can be cancelled; + * EFalse otherwise + */ + + IMPORT_C TBool CancelAllowed() const; + + /** + * Gets the associated refresh with the transaction and allows + * modification fo the refresh. This method is for internal use only. + * + * @return associated refresh or 0-pointer if there's no + * associated refresh. Ownership isn't transferred. + */ + + CSIPRefresh* Refresh(); + + + /** + * Clears the association from ClientTransaction to CSIPRefresh + */ + + void RemoveRefresh(); + + public: // Not in real SIP API + + IMPORT_C static CSIPClientTransaction* NewL( RStringF aType ); + + IMPORT_C void SetResponseElements(CSIPResponseElements* aE); + + + public: + + /** + * Instantiates a CSIPClientTransaction object, leaves on failure. + * + * @param aType Identifies the transaction type + * @param aRequestId RequestId obtained from SIP client + * @param aAssociation Object to which the transaction is associated + * with. + * @param aRefresh If transaction is refreshed, this points to a + * CSIPRefresh, otherwise this is NULL. Ownership is not transferred. + * @return SIP client transaction, ownership is transferred. + */ + + static CSIPClientTransaction* + NewL(RStringF aType, + TUint32 aRequestId, + MTransactionAssociation& aAssociation, + CSIPRefresh* aRefresh=0); + + /** + * Instantiates a CSIPClientTransaction object and pushes it into + * CleanupStack, leaves on failure. + * + * @param aType Identifies the transaction type + * @param aRequestId RequestId obtained from SIP client + * @param aAssociation Object to which the transaction is associated + * with. + * @param aRefresh If transaction is refreshed, this points to a + * CSIPRefresh, otherwise this is NULL. Ownership is not transferred. + * @return SIP client transaction, ownership is transferred. + */ + + static CSIPClientTransaction* + NewLC(RStringF aType, + TUint32 aRequestId, + MTransactionAssociation& aAssociation, + CSIPRefresh* aRefresh=0); + + protected: + CSIPClientTransaction( RStringF aType ); + + private: + //NULL if this transaction is not refreshed. + //CSIPClientTransaction does not own the refresh object. + CSIPRefresh* iRefresh; + + CSIPResponseElements* iE; + + TBool iIsCancelAllowed; + + +#ifdef CPPUNIT_TEST + friend class CSIP_Test; +#endif + }; + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/sipconnection.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/sipconnection.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,586 @@ +/* +* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 CSIPCONNECTION_H +#define CSIPCONNECTION_H + +#include "musunittesting.h" +// INCLUDES +#include +#include + +// FORWARD DECLARATIONS +class CSIP; +class MSIPConnectionObserver; +class CSIPTransactionBase; +class CSIPClientTransaction; +class CSIPServerTransaction; +class MSIPRegistrationContext; +class CSIPRegistrationBinding; +class CRegistrationState; +class CSIPDialog; +class CDialogState; +class CSIPRefresh; +class CSIPMessageElements; +class CSIPRequestElements; +class CSIPResponseElements; +class CSIPClientConnectionObserver; +class CConnectionCallback; +class CSIPClientConnection; + + +//CONSTANTS +/** SIP minimum value for the expiration in seconds*/ +//const TUint KSIPMinExpirationValue=60; + + +// CLASS DECLARATION + +/** +* Class for monitoring connection's state and sending SIP requests outside +* the dialog associations.Class must not be used +* -for sending requests to which received non-failure response creates a dialog +* -for sending requests that must be sent within SIP dialog +* Note that the user can have only one instance of the class per same IAP-id +*/ +class CSIPConnection : + public CBase + { + public: + + /** Connection states */ + enum TState + { + /** Connection initializing */ + EInit=1, + /** Connection active */ + EActive, + /** Connection suspended */ + ESuspended, + /** Connection is inactive */ + EInactive, + /** Connection is permanently unavailable */ + EUnavailable + }; + + public: // Constructors and destructor + + /** + * Two-phased constructor. + * @param aSip a handle to the SIP server + * @param aIapId IAP-id + * @param aObserver a observer for receiving asynchonous events on this + * connection + * @return New object, ownership is transferred + */ + + IMPORT_C static CSIPConnection* + NewL(CSIP& aSIP, + TUint32 aIapId, + MSIPConnectionObserver& aObserver); + + + /** + * Two-phased constructor. + * Constructs an object and adds the pointer to the cleanup stack; + * @param aSip a handle to the SIP server + * @param aIapId IAP-id + * @param aObserver a observer for receiving asynchonous events on this + * connection + * @return New object, ownership is transferred + */ + + IMPORT_C static CSIPConnection* + NewLC(CSIP& aSIP, + TUint32 aIapId, + MSIPConnectionObserver& aObserver); + + + /** + * Destructor + */ + + IMPORT_C ~CSIPConnection(); + + public: // New functions + + /** + * Gets current state of the connection + * @return current state of the connection + */ + + IMPORT_C TState State() const; + + /** + * Creates SIP request and sends it to the given destination. + * The function must not be used with SIP requests that creates + * SIP dialog associations or must be sent within SIP dialog + * association. + * This provokes the Non-invite state machine. + * This function must be used if the user has created the + * registration binding. + * @pre State() == EActive. + * @pre aContext.IsContextActive()==ETrue + * @param aElements contains local and remote addresses, + * optional SIP message headers and body. + * The ownership is transferred. + * @param aContext defines outbound proxy to be used. If the user + * does not provide from-address it will be constucted using + * user's AOR used during the registration. + * @return SIP client transaction, ownership is transferred + */ + + IMPORT_C CSIPClientTransaction* + SendRequestL(CSIPRequestElements* aElements, + const MSIPRegistrationContext& aContext); + + + /** + * Creates SIP request and sends it to the given destination. + * The function must not be used with SIP request that creates + * SIP dialog associations or must be sent within SIP diallog + * association. + * This provokes the Non-invite state machine. + * This function must be used if the user has created the + * registration binding. + * @pre State() == EActive. + * @pre aContext.IsContextActive()==ETrue + * @param aElements contains local and remote addresses, + * optional SIP message headers and body. + * The ownership is transferred. + * @param aContext defines outbound proxy to be used. If the user + * does not provide from-address it will + * be constucted using user's AOR used during the registration. + * @param aRefresh defines the refresh interval for this transaction. + * @return SIP client transaction, ownership is transferred + */ + + IMPORT_C CSIPClientTransaction* + SendRequestL(CSIPRequestElements* aElements, + const MSIPRegistrationContext& aContext, + CSIPRefresh& aRefresh); + + + /** + * Creates SIP request and sends it to the given destination. + * The function must not be used with SIP request that creates SIP + * diallog associations or must be sent within SIP dialog association. + * This invokes the Non-invite state machine. + * @pre State() == EActive. + * @pre aElements.FromHeader() != 0 + * @param aElements contains local and remote addresses, + * optional SIP message headers and body. + * The ownership is transferred. + * @return SIP client transaction, ownership is transferred + */ + + IMPORT_C CSIPClientTransaction* + SendRequestL(CSIPRequestElements* aElements); + + + /** + * Creates SIP request and sends it to the given destination. + * The function must not be used with SIP request that creates SIP + * dialog associations or must be sent within SIP dialog association. + * This invokes the Non-invite state machine. + * @pre State() == EActive. + * @pre aElements.FromHeader() != 0 + * @param aElements contains local and remote addresses, + * optional SIP message headers and body. + * The ownership is transferred. + * @param aRefresh indicates that transaction will be refreshed + * @return SIP client transaction, ownership is transferred + */ + + IMPORT_C CSIPClientTransaction* + SendRequestL(CSIPRequestElements* aElements, + CSIPRefresh& aRefresh); + + + /** + * Creates SIP REGISTER request and sends it to the given destination. + * User must no define any Contact or Expires-headers + * in the provided elements. + * @pre State() == EActive + * @pre aElements != 0 + * @pre aElements->Method().DesC().Length()==0 + * @param aElements contains local and remote addresses, optional SIP + * message headers and body. User must not set any expires values + * to aElements. The ownership is transferred. + * @return SIP REGISTER client transaction, ownership is transferred + */ + + IMPORT_C CSIPClientTransaction* + FetchRegistrationsL(CSIPRequestElements* aElements); + + // Not in real SIP API: + IMPORT_C void SetState(TState aState); + + //TODO:SHOULD THIS NEW FUNCTION BE INCLUDED INTO STUB??? + /** + * Gets Iap-id used for this connection + * @return Iap-id + */ + + IMPORT_C TUint32 IapId() const; + + /** + * Gets the local IP address of this CSIPConnection + * that is used by the SIP implementation. + * The user should re-new the call whenever the connection state changes + * to the CSIPConnection::EActive in order to verify the correctness of + * the previously retrieved local IP address. The local IP address might + * be different as a result of the connection state change. + * @pre State() == CSIPConnection::EActive + * @param aAddr on return filled with local IP address + * @leave a system-wide error code + */ + IMPORT_C void GetLocalAddrL(TInetAddr& aAddr) const; + + + /** + * Gets SIP server handle + * @return handle to SIP server, or 0-pointer if SIP server does not + * exist any more + */ + IMPORT_C CSIP* SIP(); + + /** + * Gets SIP server handle + * @return handle to SIP server, or 0-pointer if SIP server does not + * exist any more + */ + + IMPORT_C const CSIP* SIP() const; + //TODO:ENDS + + /** + * Incoming request outside dialog has been received. + * + * @param aTransaction Server transaction. Ownership is transferred. + */ + + void IncomingRequestL(CSIPServerTransaction* aTransaction) const; + + + /** + * Incoming request within dialog has been received. + * + * @param aTransaction Server transaction. Ownership is transferred. + * @param aDialogId Identifies the dialog to which the transaction + * belongs to. + */ + + void IncomingDialogRequestL(CSIPServerTransaction* aTransaction, + TUint32 aDialogId); + + void IncomingResponseL(CSIPResponseElements* aElements, + TUint32 aRequestId) const; + + void IncomingRegistrationResponseL(CSIPResponseElements* aElements, + TUint32 aRequestId, + TUint32 aRegistrationId) const; + + void IncomingRefreshResponseL(CSIPResponseElements* aElements, + TUint32 aRequestId, + TUint32 aRefreshId); + + + void ErrorOccured(TInt aError, TUint32 aRequestId) const; + + void RefreshErrorOccured(TInt aError, TUint32 aRefreshId) const; + + void RegistrationErrorOccured(TInt aError, + TUint32 aRegistrationId, + TUint32 aRequestId) const; + + void DialogErrorOccured(TInt aError, + TUint32 aDialogId, + TUint32 aRequestId) const; + + void DialogErrorOccured(TInt aError, + TUint32 aDialogId, + TUint32 aRefreshId, + TUint32 aRequestId) const; + + void ConnectionStateChanged(CSIPConnection::TState aState); + + void InviteCompleted(TUint32 aRequestId) const; + + + /** + * Searches for a transaction with the matching aRequestId. + * @param aRequestId RequestId associated with the transaction + * @return Found transaction or NULL if not found. Ownership is not + * transferred. + */ + + CSIPTransactionBase* FindTransaction(TUint32 aRequestId) const; + + + TInt AddRegistration(CSIPRegistrationBinding* aRegistration); + void RemoveRegistration(const CSIPRegistrationBinding* aRegistration); + + + /** + * Searches for a registration binding, using aRegistrationId and + * aRequestId as keys. Registration might not yet have received + * RegistrationId from SIP client, so the aRequestId may be needed to + * locate the registration binding. + * @param aRegistrationId RegistrationId of the registration binding + * @param aRequestId RequestId of a transaction associated with the + * registration + * @return Found registration binding or NULL if not found. + * Ownership is not transferred. + */ + + CSIPRegistrationBinding* FindRegistration(TUint32 aRegistrationId, + TUint32 aRequestId) const; + + + TInt AddDialog(CSIPDialog* aDialog); + void RemoveDialog(const CSIPDialog* aDialog); + + + /** + * Searches for a dialog, using aRequestId as a key. + * @param aRequestId RequestId of a transaction associated with the + * dialog + * @return Found dialog or NULL if not found. Ownership is not + * transferred. + */ + + CSIPDialog* FindDialogByRequestId(TUint32 aRequestId) const; + + + /** + * Informs CSIPConnection that the associated CSIP instance has been + * deleted. After this the CSIPConnection object can't be used anymore. + */ + + void CSIPDeleted(); + + + /** + * Obtains the initial state for registration state machine. + * + * @return Initial registration state, ownership is not transferred + */ + + CRegistrationState* InitialRegisterStateL() const; + + + /** + * Obtains the initial state for dialog state machine. + * + * @return Initial dialog state, ownership is not transferred + */ + + CDialogState* InitialDialogStateL() const; + + + /** + * Response related to a dialog has been received. + * + * @param aElements SIP response elements. Ownership is transferred. + * @param aRequestId Identifies the transaction + * @param aDialogId DialogId + * @param aRefreshId NULL if the response is not related to a refresh, + * otherwise the RefreshId. Ownership is not transferred. + */ + + void IncomingResponseToDialogL(CSIPResponseElements* aElements, + TUint32 aRequestId, + TUint32 aDialogId, + TUint32* aRefreshId); + + private: + CSIPConnection(CSIP& aSIP, + TUint32 aIapId, + MSIPConnectionObserver& aObserver); + + void ConstructL(); + + + /** + * Send a SIP request. + * + * @param aElements SIP headers. Ownership is transferred. + * @param aRegistrationId If non-NULL, request will use the outbound + * proxy and some SIP headers from the registration identified by + * aRegistrationId. Ownership is not transferred. + * @param aRefresh If non-NULL, the request will be refreshed. Otherwise + * NULL. Ownership is not transferred. + * @return New transaction. Ownership is transferred. + */ + + CSIPClientTransaction* + SendRequestL(CSIPRequestElements* aElements, + TUint32* aRegistrationId, + CSIPRefresh* aRefresh); + + + /** + * Searches for a refresh and transaction, using aRequestId and + * aRefreshId as keys. + * @param aRequestId RequestId associated with the refreshed transaction + * @param aRefreshId RefreshId associated with the refresh instance + * @param aRefresh OUT: if refresh was found, this pointer is set to the + * refresh instance. Ownership is not transferred. + * @param aTransaction OUT: if transaction was found, this pointer is + * set to the refreshed client transaction. Ownership is not + * transferred. + * @return ETrue if found, EFalse otherwise + */ + + TBool FindRefresh(TUint32 aRequestId, + TUint32 aRefreshId, + CSIPRefresh** aRefresh, + CSIPClientTransaction** aTransaction) const; + + /** + * Searches for a registration binding, using aRequestId as a key. + * @param aRequestId RequestId of a transaction associated with the + * registration binding + * @return Found registration binding or NULL if not found. + * Ownership is not transferred. + */ + + CSIPRegistrationBinding* FindRegistration(TUint32 aRequestId) const; + + + /** + * Searches for a dialog, using aDialogId as a key. + * @param aDialogId DialogId of the dialog. + * @return Found dialog or NULL if not found. Ownership is not + * transferred. + */ + + CSIPDialog* FindDialog(TUint32 aDialogId) const; + + + /** + * A request has been received with a dialogId, but no matching dialog + * exists. + * If the request is NOTIFY, it is stored until a response with the same + * dialogId is received. Then the response is passed to dialog and after + * that all the stored NOTIFY are passed to the same dialog. + * This is needed since NOTIFY can be received before a sent SUBSCRIBE + * receives a response with dialogId. + * + * @param aTransaction Server transaction, ownership is transferred + * @param aDialogId DialogId + */ + + void IncomingRequestBeforeDialogExistsL( + CSIPServerTransaction* aTransaction, + TUint32 aDialogId); + + + /** + * Extracts the oldest stored transaction for the dialog identified by + * aDialogId. + * @param aDialogId DialogId + * @return Server transaction or NULL if no transaction is stored for + * the dialog. Ownership is transferred. + */ + + CSIPServerTransaction* GetStoredTransaction(TUint32 aDialogId); + + + /** + * Checks that CSIP is available for use (not NULL). If iSIP is NULL, + * it means user has deleted a resource needed by CSIPConnection, and + * this function leaves. + */ + + void CheckCSipL() const; + + + /** + * Connection is no longer available. All registrations, dialogs, + * transactions and refreshes using this connection are terminated, but + * not deleted. + */ + + void ConnectionLost(); + + + //The used CSIP instance. CSIPConnection doesn't own the CSIP. + //If this pointer is NULL; it means application has deleted the + //CSIP instance before deleting the CSIPConnection, and this + //CSIPConnection is now useless. + CSIP* iSIP; + + //IAP-id of this connection + TUint32 iIapId; + + //Callback to upper layer + MSIPConnectionObserver& iObserver; + + //Callback receiving events from client + CSIPClientConnectionObserver* iClientConnectionObserver; + + //Connection used by this CSIPConnection instance + CSIPClientConnection* iClientConnection; + + //CSIPConnection doesn't own CSIPRegistrationBindings + RPointerArray iRegistrations; + + //CSIPConnection doesn't delete the CSIPDialog objects. CSIPDialog + //deletes itself when its last dialog association is deleted. + //NOTE: When CSIPDialog has just been created and has no dialog + //associations yet, it must be stored in CleanupStack, otherwise it + //won't be freed if leave occurs! + RPointerArray iDialogs; + + //CSIPConnection has to know which transactions are attached to it, but + //it doesn't own the transactions. Transaction's ownership is passed + //to application. + RPointerArray iTransactions; + + //Standalone refreshes, application owns these + RPointerArray iRefreshes; + + //To avoid using callbacks to MSIPConnectionObserver from within + //CSIPRegistrationBinding and CSIPDialog, CConnectionCallback is passed to + //the methods which would need to use MSIPConnectionObserver calls. + //CSIPRegistrationBinding and CSIPDialog will fill CConnectionCallback with + //the selected callback method and its parameters, and by returning + //ETrue they tell to CSIPConnection that a callback has to be done. + CConnectionCallback* iCallbackInfo; + + + // Not in real SIP API + TState iState; + + __DECLARE_TEST; + +#ifdef CPPUNIT_TEST + friend class CSIP_Test; + friend class CSIPConnection_Test; + friend class CSIPSubscribeDialogAssoc_Test; + friend class CSIPInviteDialogAssoc_Test; + friend class CSIPReferDialogAssoc_Test; + friend class CSIPDialogTrying_Test; + friend class CSIPRegistrationBinding_Test; +#endif + }; + +#endif + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/sipmessageelements.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/sipmessageelements.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,173 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef CSIPMESSAGEELEMENTS_H +#define CSIPMESSAGEELEMENTS_H + +// INCLUDES +#include +#include +#include +#include "_sipcodecdefs.h" + +#ifdef SWIS_UNIT_TEST +#undef IMPORT_C +#define IMPORT_C +#endif + +// FORWARD DECLARATIONS +class CSIPHeaderBase; +class CSIPContentTypeHeader; +class CSIPFromHeader; +class CSIPToHeader; +class CSIPCSeqHeader; +class CSIPExtensionHeader; + +// CLASS DECLARATION + +/** +* @publishedAll +* +* Class for creation and manipulation optional elements in a SIP message. +* +* Class provides functions for setting and getting optional elements in a +* SIP message. Optional elements include user SIP message headers, +* content and content type. +* Following headers are not considered to be user SIP message headers and +* cannot be set or retrieved using functions of this class: +* "Authentication-Info", "Call-Id", "CSeq", "From" +* "Max-Forwards", "Min-Expires", "Record-Route", +* "Security-Verify", "Service-Route", "To", "Via", "Security-Server", +* "Proxy-Authorization", "Proxy-Authenticate" and "WWW-Authenticate". +* +* @lib sipclient.lib +*/ +class CSIPMessageElements : public CBase + { + public: // Constructors and destructor + /** + * Two-phased constructor. + */ + IMPORT_C static CSIPMessageElements* NewL(); + + /** + * Two-phased constructor. + */ + IMPORT_C static CSIPMessageElements* NewLC(); + + /** + * Destructor. + */ + IMPORT_C ~CSIPMessageElements(); + + public: //new functions + /** + * Sets an array of user headers i.e. headers that user is allowed + * manipulate to a SIP message. An empty array resets the user headers. + * Note that the Content-Type header must be set using SetContentL. + * + * @param aHeaders an array of SIP headers. + * The ownership of objects in the array is transferred. + */ + IMPORT_C void SetUserHeadersL(RPointerArray& aHeaders); + + /** + * Gets all user SIP headers this class contains + * @return SIP headers. Ownership is not transferred. + */ + IMPORT_C const RPointerArray& UserHeaders() const; + + /** + * Sets the SIP message content and its type. + * A zero length content can be set by providing a pointer + * to a zero length HBufC8 instance (the ownership is transferred). + * @pre aContent != 0 && aContentType != 0 + * @param aContent the content of a SIP message, + * the ownership is transferred + * @param aContentType the SIP message content type, + * the ownership is transferred + * @leave KErrArgument if aContent == 0 or + * aContentType == 0 + */ + IMPORT_C void SetContentL(HBufC8* aContent, + CSIPContentTypeHeader* aContentType); + + /** + * Gets the SIP message content + * @return SIP message content. If content does not exist, an empty + * descriptor is returned. + */ + IMPORT_C const TDesC8& Content() const; + + /** + * Gets the content type + * @return Content-Type-header or a 0-pointer if not present; the ownership + * is not transferred. + */ + IMPORT_C const CSIPContentTypeHeader* ContentType() const; + + /* + * Removes the SIP message content and destroys + * Content-Type header as well. + * @return SIP message content; the ownership is transferred. + */ + IMPORT_C HBufC8* ExtractContent(); + + public: // New functions, for internal use + + static CSIPMessageElements* InternalizeL(RReadStream& aReadStream); + void ExternalizeL(RWriteStream& aWriteStream) const; + TInt UserHeaderCount(RStringF aName) const; + const RPointerArray UserHeadersL(RStringF aName) const; + TInt RemoveHeaders(RStringF aName); + void DetachUserHeader(CSIPHeaderBase* aHeader); + void AddHeaderL(CSIPHeaderBase* aHeader); + void SetToL(CSIPToHeader* aTo); + const CSIPToHeader* To() const; + void SetFromL (CSIPFromHeader* aFrom); + const CSIPFromHeader* From() const; + const CSIPCSeqHeader* CSeq() const; + void SetContent(HBufC8* aContent); + void DetachContent(); + + private: + + CSIPMessageElements(); + void ConstructL(); + void DoInternalizeL(RReadStream& aReadStream); + void CheckUserHeaderL(const CSIPHeaderBase* aHeader) const; + void ExternalizeUserHeadersL(RWriteStream& aWriteStream) const; + void ExternalizeL(const CSIPExtensionHeader* aHeader, + RWriteStream& aWriteStream) const; + + private: // Data + + RPointerArray iUserHeaders; + HBufC8* iContent; + CSIPFromHeader* iFromHeader; + CSIPToHeader* iToHeader; + CSIPCSeqHeader* iCSeqHeader; + CSIPContentTypeHeader* iContentTypeHeader; + TBool iHeaderLookupOpen; + + private: // For testing purposes + + UNIT_TEST(CSIPMessageElementsTest) + }; + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/sipprofile.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/sipprofile.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,351 @@ +/* +* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 class providing profile data of SIP service provider +* +*/ + +#ifndef CSIPPROFILE_H +#define CSIPPROFILE_H + +// INCLUDES +#include +#include +#include +#include "sipregistrationcontext.h" +#include "sipprofiletypeinfo.h" + +// FORWARD DECLARATIONS +class CSIPConcreteProfile; +class CSIPProfileRegistry; +class CSIPProfileRegistryBase; + +/** +* SIP Profile ID which value is type of TUint32 +*/ +const TUint32 KSIPProfileId = 1; + +/** +* SIP Provider Name which value is type of TDesC8 +*/ +const TUint32 KSIPProviderName = 2; + +/** +* Access Point ID which value is type of TUint32 +*/ +const TUint32 KSIPAccessPointId = 3; + +/** +* Signaling compression (SigComp) which value is type of TBool. +* ETrue indicates that SigComp is enabled +*/ +const TUint32 KSIPSigComp = 4; + +/** +* Security Negotiation which value is type of TBool. ETrue indicates that +* Security Negotiation is enabled +*/ +const TUint32 KSIPSecurityNegotiation = 5; + +/** +* Auto Registration which value is type of TBool. ETrue indicates that +* profile is enabled for auto registration +*/ +const TUint32 KSIPAutoRegistration = 6; + +/** +* Defined user's address-of-record which value is type of TDesC8 +*/ +const TUint32 KSIPUserAor = 7; + +/** +* Registration which value is type of TBool. ETrue indicates that +* profile is registered +*/ +const TUint32 KSIPProfileRegistered = 8; + +/** +* Uers's registered address-of-records which value is of type MDesC8Array. +* Note that array will contain AORs only in case the profile is registered. +*/ +const TUint32 KSIPRegisteredAors = 9; + +/** +* Negotiated security mechanism during registration procedure which value +* is of type TDesC8. +* Note that descriptor will contain value only in case the profile is +* registered. +*/ +const TUint32 KSIPNegotiatedSecurityMechanism = 10; + +/** +* Default profile which value is type of TBool. +* ETrue indicates that profile is default +*/ +const TUint32 KSIPDefaultProfile = 11; + +/** +* "Contact" header parameters used during registration which value +*is of type MDesC8Array. Array element contains one "Contact" header +* parameter. +*/ +const TUint32 KSIPContactHeaderParams = 12; + +/** +* The user's registered "Contact"-header including the whole value of the header +* except for the header's name ("Contact:"). +* The value is of type TDesC8. +* Note that the value is available only in case the profile is registered. +*/ +const TUint32 KSIPRegisteredContact = 13; + +/** +* SIP Registrar +*/ +const TUint32 KSIPRegistrar = 130; + +/** +* SIP Outbound Proxy +*/ +const TUint32 KSIPOutboundProxy = 131; + +/** +* HTTP Digest user name which value is type of TDesC8 +*/ +const TUint32 KSIPDigestUserName = 150; + +/** +* HTTP Digest realm which value is type of TDesC8 +*/ +const TUint32 KSIPDigestRealm = 151; + +/** +* SIP server's address which value is of type TDesC8 +*/ +const TUint32 KSIPServerAddress = 152; + +// CLASS DECLARATION +/** +* @publishedAll +* @released +* +* Class contains profile information of particular SIP service +* provider. Class provides functions for quering profile parameter +* values. +* @lib sipprofilecli.lib +*/ +class CSIPProfile: public CBase, public MSIPRegistrationContext + { + public: // Constructors and destructor + /** + * Destructor. + * @capability NetworkServices + */ + IMPORT_C ~CSIPProfile(); + + public: // New functions + /** + * Gets profile type information + * @return profile type information + */ + IMPORT_C const TSIPProfileTypeInfo& Type() const; + + /** + * Gets profile parameter + * @param aParam a parameter to get + * @param aVal on return will contain parameter value + * @return KErrNotFound if parameter was not found, KErrNone otherwise + */ + IMPORT_C TInt GetParameter(TUint32 aParam, TDesC8 const *& aVal) const; + + /** + * Gets profile parameter + * @param aParam a parameter to get + * @param aVal on return will contain parameter value + * @return KErrNotFound if parameter was not found, KErrNone otherwise + */ + IMPORT_C TInt GetParameter(TUint32 aParam, TUint32& aVal) const; + + /** + * Gets profile parameter + * @param aParam a parameter to get + * @param aVal on return will contain parameter value + * @return KErrNotFound if parameter was not found, KErrNone otherwise + */ + IMPORT_C TInt GetParameter(TUint32 aParam, TBool& aVal) const; + + /** + * Gets profile parameter + * @param aParam a parameter to get + * @param aVal on return will contain parameter value + * @return KErrNotFound if parameter was not found, KErrNone otherwise + */ + IMPORT_C TInt GetParameter(TUint32 aParam, MDesC8Array const *& aVal) const; + + /** + * Gets profile parameter that is defined for a particular SIP server + * @param aServer a SIP server type + * @param aParam a parameter to get + * @param aVal on return will contain parameter value + * @return KErrNotFound if parameter was not found, KErrNone otherwise + */ + IMPORT_C TInt GetParameter(TUint32 aServerType, TUint32 aParam, TDesC8 const *& aVal) const; + + public: //Functions from base class + /** + * Tests if the registration context can be + * used for creating SIP messages/dialogs + * Profile can be used, when CSIPProfileRegistry::IsEnabled() == ETrue + * and Status() == ERegistered. + * @return ETrue if can be used, EFalse otherwise + */ + TBool IsContextActive() const; + + /** + * + * For internal use only + * @return context id + */ + TUint32 ContextId() const; + + + public: //New functions + + /** + * Two-phased constructor. + * @param aSIPRegistry a SIP profile client providing connection to SIP + * profile server. + */ + + static CSIPProfile* NewL(CSIPProfileRegistry* aSIPRegistry); + + /** + * Two-phased constructor. + * @param aSIPRegistry a SIP profile client providing connection to SIP + * profile server. + * Constructs an object and adds the pointer to the cleanup stack; + */ + + static CSIPProfile* NewLC(CSIPProfileRegistry* aSIPRegistry); + + /** + * Sets profiles enabled state + * @param aEnabled ETrue if enabled + */ + + void SetEnabled(TBool aEnabled); + + /** + * Sets concrete profile that holds actual data + * @param aProfile profile instance containing data + */ + + void SetConcreteProfile(CSIPConcreteProfile* aProfile); + + /** + * Clears concrete profile that holds actual data + */ + + void ClearConcreteProfile(); + + /** + * Gets concrete profile that holds actual data + * @return concrete profile holding data + */ + + CSIPConcreteProfile& ConcreteProfile(); + + /** + * Gets concrete profile that holds actual data + * @return concrete profile holding data + */ + + const CSIPConcreteProfile& ConcreteProfile() const; + + /** + * Checks if the profile is enabled + * @return ETrue if enabled, EFalse otherwise + */ + + TBool IsEnabled() const; + + /** + * Gets last occurred error during registration + * @return last occurred error code, KErrNone if no error + */ + TInt LastRegistrationError() const; + + /** + * Checks if two profiles are equal + * @return ETrue if equal + */ + TBool operator==(const CSIPProfile& + aProfile) const; + + /** + * sets pointer to registry for profile + */ + void SetRegistry(CSIPProfileRegistryBase* aRegistry); + + /** + * Clears pointer to registry from profile + */ + void ClearRegistry(); + + protected: + + /** + * Constructor. + */ + CSIPProfile(CSIPProfileRegistryBase* aRegistry); + + /** + * 2nd phase constructor. + */ + void ConstructL(); + + protected: + + CSIPConcreteProfile* iSIPProfile; + CSIPProfileRegistryBase* iSIPProfileRegistry; + + // Stub data + + public: + + TBool iEnabled; + TBool iIsDefaultProfile; + + TSIPProfileTypeInfo iTypeInfo; + + // Value iTUint32Value is set to aVal when calling + // GetParameter(TUint32 aParam, TUint32& aVal) + // if iTUint32ValueError == KErrNone. + // iTUint32ValueError is returned in any case + TUint32 iTUint32Value; + TInt iTUint32ValueError; + + // Value iTBoolValue is set to aVal when calling + // GetParameter(TUint32 aParam, TBool& aVal) + // if iTBoolValueError == KErrNone. + // iTBoolValueError is returned in any case + TBool iTBoolValue; + TInt iTBoolValueError; + + CDesC8Array* iArray; + + //store value of KSIPRegisteredContact + HBufC8* iRegisteredContact; + }; + +#endif // CSIPPROFILE_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/sipprofileregistry.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/inc/sipprofileregistry.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,154 @@ +/* +* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 class for using SIP profiles +* +*/ + + +#ifndef CSIPPROFILEREGISTRY_H +#define CSIPPROFILEREGISTRY_H + +// INCLUDES +#include +#include +#include +#include "sipprofileregistrybase.h" + +// FORWARD DECLARATIONS +class CSIP; +class CSIPConnection; +class CSIPProfile; +class MSIPProfileRegistryObserver; +class MSIPConnectionObserver; + + +// CLASS DECLARATION +/** +* @publishedAll +* @released +* +* The class for retrieving SIP profiles from permanent storage. +* This class provides services for retreiving SIP profiles +* and enabling/disabling them for the usage. +* +* The user can create only one instance of this class (a singleton class). +* +* @lib sipprofilecli.lib +*/ +class CSIPProfileRegistry: public CSIPProfileRegistryBase + { + public: // Constructors and destructor + /** + * Two-phased constructor. + * This constructor should be used if the client intends + * to use SIP services with profiles. + * @param aSip a SIP client providing connection to SIP stack. + * @param aObserver a observer for SIP profile change events. + */ + IMPORT_C static CSIPProfileRegistry* NewL( + CSIP& aSip, + MSIPProfileRegistryObserver& aObserver); + + /** + * Two-phased constructor. + * This constructor should be used if the client intends + * to use SIP services with profiles. + * Constructs an object and adds the pointer to the cleanup stack; + * @param aSip a SIP client providing connection to SIP stack. + * @param aObserver a observer for SIP profile change events. + */ + IMPORT_C static CSIPProfileRegistry* NewLC( + CSIP& aSip, + MSIPProfileRegistryObserver& aObserver); + + /** + * Destructor + */ + IMPORT_C ~CSIPProfileRegistry(); + + public: // New functions + /** + * Gets handle to the SIP server + * @return handle to the SIP server + */ + IMPORT_C CSIP& SIP() const; + + /** + * Gets the SIP connection to be used with this SIP profile. + * @pre IsEnabled() == ETrue + * @param aProfile a sip profile + * @return a SIP connection to be used; the owneship is transfered + * @leave KErrNoMemory if out of memory + * @capability NetworkServices + */ + IMPORT_C CSIPConnection* ConnectionL( + CSIPProfile& aProfile); + + /** + * Enables the SIP profile for use. + * Enabling the SIP profile will cause the SIP profile to + * be registered if its status was unregistered. + * The user must check the profile status after calling this + * function. In case the profile is not registered the user must + * wait until the it is notified about profile registration + * on MSIPProfileRegistryObserver-callback interface. + * @param aProfile a sip profile to enable + * @param aObserver a observer for SIP connection events + * @leave KErrNotFound if non-existing profile is provided + * @capability NetworkServices + */ + IMPORT_C void EnableL( + CSIPProfile& aProfile, + MSIPConnectionObserver &aObserver); + + /** + * Disables the usage of SIP profile + * @param aProfile a sip profile to disable + * @return KErrNone if SIP profile was successfully disabled; + * system wide error otherwise + * @capability NetworkServices + */ + IMPORT_C TInt Disable(CSIPProfile& aProfile); + + /** + * Tests is the SIP profile enabled for the use + * @param aProfile a SIP profile to be checked + * @return ETrue if SIP profile is enabled; EFalse otherwise + */ + IMPORT_C TBool IsEnabled(const CSIPProfile& aProfile) const; + + public: + + CSIPProfile* NewInstanceL(); + + private: + + CSIPProfileRegistry(); + CSIPProfileRegistry(CSIP& aSip, MSIPProfileRegistryObserver& aObserver); + + void ConstructL(); + + public: + + TBool iProfileDisabled; + mutable TBool iProfileEnabled; + + private: + + CSIP& iSip; + MSIPConnectionObserver* iConnectionObserver; + + }; + +#endif // CSIPPROFILEREGISTRY_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/CMusAvaAvailabilityObserverImp.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/CMusAvaAvailabilityObserverImp.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,115 @@ +/* +* 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: This observer is used by +* ECOM clients to get function call from the availability Plug-in +* +*/ + + +#include "musavaavailabilityobserverimp.h" +#include "musavaavailabilityobserver.h" +#include "musavaobserver.h" +#include "muslogger.h" + + +// ------------------------------------------------------------------------- +// Two-phased constructor. +// ------------------------------------------------------------------------- +// +CMusAvaAvailabilityObserverImp* CMusAvaAvailabilityObserverImp::NewL() + { + MUS_LOG( " [MUSAVA ] -> CMusAvaAvailabilityObserverImp::NewL" ); + CMusAvaAvailabilityObserverImp* self = new (ELeave) CMusAvaAvailabilityObserverImp(); + CleanupStack::PushL (self); + self->ConstructL(); + CleanupStack::Pop(); + MUS_LOG( " [MUSAVA ] <- CMusAvaAvailabilityObserverImp::NewL" ); + return self; + } + +// ------------------------------------------------------------------------- +// C++ destructor. +// ------------------------------------------------------------------------- +// +CMusAvaAvailabilityObserverImp::~CMusAvaAvailabilityObserverImp() + { + MUS_LOG( " [MUSAVA ] -> CMusAvaAvailabilityObserverImp::~CMusAvaAvailabilityObserverImp" ); + + MUS_LOG( " [MUSAVA ] <- CMusAvaAvailabilityObserverImp::~CMusAvaAvailabilityObserverImp" ); + } + +// ------------------------------------------------------------------------- +// Symbian second-phase constructor. +// ------------------------------------------------------------------------- +// +void CMusAvaAvailabilityObserverImp::ConstructL() + { + MUS_LOG( " [MUSAVA ] -> CMusAvaAvailabilityObserverImp::ConstructL" ); + + MUS_LOG( " [MUSAVA ] <- CMusAvaAvailabilityObserverImp::ConstructL" ); + } + +// ------------------------------------------------------------------------- +// C++ constructor. +// ------------------------------------------------------------------------- +// +CMusAvaAvailabilityObserverImp::CMusAvaAvailabilityObserverImp() + { + + } +// ----------------------------------------------------------------------------- +// Availability report. +// ----------------------------------------------------------------------------- +// +void CMusAvaAvailabilityObserverImp::AvailabilityChanged( + MMusAvaObserver::TAvailabilityName aName, + MMusAvaObserver::TAvailabilityStatus aStatus ) + { + iStatus= aStatus; + iName = aName; + } + +// ----------------------------------------------------------------------------- +// Availability error report. +// ----------------------------------------------------------------------------- +// +void CMusAvaAvailabilityObserverImp::AvailabilityError( + MMusAvaObserver::TAvailabilityName aName, + MMusAvaObserver::TAvailabilityStatus aStatus ) + { + iStatus= aStatus; + iName = aName; + } + +// ----------------------------------------------------------------------------- +// Current availability status +// ----------------------------------------------------------------------------- +// +MMusAvaObserver::TAvailabilityStatus CMusAvaAvailabilityObserverImp::AvailabilityPluginState() + { + return iStatus; + } +// ----------------------------------------------------------------------------- +// Checks if the current availability is at least the same as given as +// parameter +// ----------------------------------------------------------------------------- +// +TBool CMusAvaAvailabilityObserverImp::Available( + MMusAvaObserver::TAvailabilityName aAvailability ) + { + return iName > aAvailability + || ( iName == aAvailability + && MMusAvaObserver::EMusAvaStatusAvailable == iStatus ); + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/CSIPMessageElements.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/CSIPMessageElements.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,418 @@ +/* +* 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: +* +*/ + + +#include "SipMessageElements.h" +#include "SipHeaderBase.h" +#include "SipFromHeader.h" +#include "SipContactHeader.h" +#include "SipToHeader.h" +#include "SipCSeqHeader.h" +#include "SipContentTypeHeader.h" +#include "SipExtensionHeader.h" +#include "sipstrings.h" +#include "SipStrConsts.h" + + + +// ----------------------------------------------------------------------------- +// CSIPMessageElements::NewL +// ----------------------------------------------------------------------------- +// +EXPORT_C CSIPMessageElements* CSIPMessageElements::NewL() + { + CSIPMessageElements* self = CSIPMessageElements::NewLC(); + CleanupStack::Pop (self); + return self; + } + +// ----------------------------------------------------------------------------- +// CSIPMessageElements::NewLC +// ----------------------------------------------------------------------------- +// +EXPORT_C CSIPMessageElements* CSIPMessageElements::NewLC () + { + CSIPMessageElements* self = new(ELeave)CSIPMessageElements; + CleanupStack::PushL (self); + self->ConstructL (); + return self; + } + +// ----------------------------------------------------------------------------- +// CSIPMessageElements::CSIPMessageElements +// ----------------------------------------------------------------------------- +// +CSIPMessageElements::CSIPMessageElements () + : iHeaderLookupOpen(EFalse) + { + } + +// ----------------------------------------------------------------------------- +// CSIPMessageElements::ConstructL +// ----------------------------------------------------------------------------- +// +void CSIPMessageElements::ConstructL() + { +// SIPHeaderLookup::OpenL(); + iHeaderLookupOpen = ETrue; + iCSeqHeader = CSIPCSeqHeader::DecodeL( _L8("1 INVITE") ); + + } + +// ----------------------------------------------------------------------------- +// CSIPMessageElements::~CSIPMessageElements +// ----------------------------------------------------------------------------- +// +EXPORT_C CSIPMessageElements::~CSIPMessageElements () + { + /*if (iHeaderLookupOpen) + { + SIPHeaderLookup::Close(); + }*/ + delete iContent; + iUserHeaders.ResetAndDestroy(); + delete iFromHeader; + delete iToHeader; + delete iCSeqHeader; + delete iContentTypeHeader; + } + +// ----------------------------------------------------------------------------- +// CSIPMessageElements::SetUserHeadersL +// ----------------------------------------------------------------------------- +// +EXPORT_C void +CSIPMessageElements::SetUserHeadersL (RPointerArray& aHeaders) + { + RPointerArray tmpHeaders; + CleanupClosePushL(tmpHeaders); + for (TInt i=0; i& +CSIPMessageElements::UserHeaders() const + { + return iUserHeaders; + } + +// ----------------------------------------------------------------------------- +// CSIPMessageElements::SetContentL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CSIPMessageElements::SetContentL (HBufC8* aContent, + CSIPContentTypeHeader* aType) + { + __ASSERT_ALWAYS (aContent != 0, User::Leave(KErrArgument)); + __ASSERT_ALWAYS (aContent->Length() > 0, User::Leave(KErrArgument)); + __ASSERT_ALWAYS (aType != 0, User::Leave(KErrArgument)); + + delete iContentTypeHeader; + iContentTypeHeader = aType; + delete iContent; + iContent = aContent; + } + +// ----------------------------------------------------------------------------- +// CSIPMessageElements::Content +// ----------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CSIPMessageElements::Content () const + { + if (iContent) + { + return *iContent; + } + return KNullDesC8; + } + +// ----------------------------------------------------------------------------- +// CSIPMessageElements::Content +// ----------------------------------------------------------------------------- +// +EXPORT_C const CSIPContentTypeHeader* CSIPMessageElements::ContentType() const + { + return iContentTypeHeader; + } + +// ----------------------------------------------------------------------------- +// CSIPMessageElements::ExtractContent +// ----------------------------------------------------------------------------- +// +EXPORT_C HBufC8* CSIPMessageElements::ExtractContent () + { + HBufC8* tmp = iContent; + iContent = 0; + delete iContentTypeHeader; + iContentTypeHeader = 0; + return tmp; + } + +// ----------------------------------------------------------------------------- +// CSIPMessageElements::InternalizeL +// ----------------------------------------------------------------------------- +// +CSIPMessageElements* +CSIPMessageElements::InternalizeL (RReadStream& aReadStream) + { + CSIPMessageElements* self = CSIPMessageElements::NewLC(); + self->DoInternalizeL(aReadStream); + CleanupStack::Pop(); // self + return self; + } + +// ----------------------------------------------------------------------------- +// CSIPMessageElements::DoInternalizeL +// ----------------------------------------------------------------------------- +// +void CSIPMessageElements::DoInternalizeL (RReadStream& /*aReadStream*/) + { + + } + +// ----------------------------------------------------------------------------- +// CSIPMessageElements::ExternalizeL +// ----------------------------------------------------------------------------- +// +void +CSIPMessageElements::ExternalizeL (RWriteStream& /*aWriteStream*/) const + { + + } + +// ----------------------------------------------------------------------------- +// CSIPMessageElements::UserHeaderCount +// ----------------------------------------------------------------------------- +// +TInt CSIPMessageElements::UserHeaderCount (RStringF aName) const + { + TInt headerCount = 0; + for (TInt i=0; i < iUserHeaders.Count(); i++) + { + if (iUserHeaders[i]->Name() == aName) + { + headerCount++; + } + } + return headerCount; + } + +// ----------------------------------------------------------------------------- +// CSIPMessageElements::UserHeadersL +// ----------------------------------------------------------------------------- +// +const RPointerArray +CSIPMessageElements::UserHeadersL (RStringF aName) const + { + RPointerArray headers; + CleanupClosePushL(headers); + for (TInt i=0; i < iUserHeaders.Count(); i++) + { + if (iUserHeaders[i]->Name() == aName) + { + User::LeaveIfError(headers.Append(iUserHeaders[i])); + } + } + CleanupStack::Pop(1); // headers + return headers; + } + +// ----------------------------------------------------------------------------- +// CSIPMessageElements::RemoveHeaders +// ----------------------------------------------------------------------------- +// +TInt CSIPMessageElements::RemoveHeaders (RStringF aName) + { + TInt err = KErrNotFound; + for (TInt i=iUserHeaders.Count()-1; i>=0; i--) + { + if (iUserHeaders[i]->Name() == aName) + { + CSIPHeaderBase* header = iUserHeaders[i]; + iUserHeaders.Remove(i); + delete header; + err = KErrNone; + } + } + return err; + } + +// ----------------------------------------------------------------------------- +// CSIPMessageElements::DetachUserHeader +// ----------------------------------------------------------------------------- +// +void CSIPMessageElements::DetachUserHeader (CSIPHeaderBase* aHeader) + { + for (TInt i=0; i < iUserHeaders.Count(); i++) + { + if (iUserHeaders[i] == aHeader) + { + iUserHeaders.Remove(i); + } + } + } + +// ----------------------------------------------------------------------------- +// CSIPMessageElements::AddHeaderL +// ----------------------------------------------------------------------------- +// +void CSIPMessageElements::AddHeaderL (CSIPHeaderBase* aHeader) + { + __ASSERT_ALWAYS (aHeader != 0, User::Leave(KErrArgument)); + + if (aHeader->Name() == SIPStrings::StringF(SipStrConsts::EFromHeader)) + { + delete iFromHeader; + iFromHeader = static_cast(aHeader); + } + else if (aHeader->Name() == SIPStrings::StringF(SipStrConsts::EToHeader)) + { + delete iToHeader; + iToHeader = static_cast(aHeader); + } + else if (aHeader->Name() == SIPStrings::StringF(SipStrConsts::ECSeqHeader)) + { + delete iCSeqHeader; + iCSeqHeader = static_cast(aHeader); + } + else if (aHeader->Name() == + SIPStrings::StringF(SipStrConsts::EContentTypeHeader)) + { + delete iContentTypeHeader; + iContentTypeHeader = static_cast(aHeader); + } + else + { + User::LeaveIfError(iUserHeaders.Append(aHeader)); + } + } + +// ----------------------------------------------------------------------------- +// CSIPMessageElements::SetToL +// ----------------------------------------------------------------------------- +// +void CSIPMessageElements::SetToL (CSIPToHeader* aTo) + { + __ASSERT_ALWAYS (aTo != 0, User::Leave(KErrArgument)); + __ASSERT_ALWAYS (!aTo->HasParam(SIPStrings::StringF(SipStrConsts::ETag)), + User::Leave(KErrArgument)); + + delete iToHeader; + iToHeader = aTo; + } + +// ----------------------------------------------------------------------------- +// CSIPMessageElements::To +// ----------------------------------------------------------------------------- +// +const CSIPToHeader* CSIPMessageElements::To() const + { + return iToHeader; + } + +// ----------------------------------------------------------------------------- +// CSIPMessageElements::SetFromL +// ----------------------------------------------------------------------------- +// +void CSIPMessageElements::SetFromL (CSIPFromHeader* aFrom) + { + __ASSERT_ALWAYS (aFrom != 0, User::Leave(KErrArgument)); + __ASSERT_ALWAYS (!aFrom->HasParam(SIPStrings::StringF(SipStrConsts::ETag)), + User::Leave(KErrArgument)); + + delete iFromHeader; + iFromHeader = aFrom; + } + +// ----------------------------------------------------------------------------- +// CSIPMessageElements::From +// ----------------------------------------------------------------------------- +// +const CSIPFromHeader* CSIPMessageElements::From() const + { + return iFromHeader; + } + +// ----------------------------------------------------------------------------- +// CSIPMessageElements::CSeq +// ----------------------------------------------------------------------------- +// +const CSIPCSeqHeader* CSIPMessageElements::CSeq() const + { + return iCSeqHeader; + } + +// ----------------------------------------------------------------------------- +// CSIPMessageElements::SetContent +// ----------------------------------------------------------------------------- +// +void CSIPMessageElements::SetContent (HBufC8* aContent) + { + delete iContent; + iContent = aContent; + } + +// ----------------------------------------------------------------------------- +// CSIPMessageElements::DetachContent +// ----------------------------------------------------------------------------- +// +void CSIPMessageElements::DetachContent () + { + iContent = 0; + } + +// ----------------------------------------------------------------------------- +// CSIPMessageElements::CheckUserHeaderL +// ----------------------------------------------------------------------------- +// +void CSIPMessageElements::CheckUserHeaderL (const CSIPHeaderBase* /*aHeader*/) const + { + + } + +// ----------------------------------------------------------------------------- +// CSIPMessageElements::ExternalizeUserHeadersL +// ----------------------------------------------------------------------------- +// +void +CSIPMessageElements::ExternalizeUserHeadersL (RWriteStream& /*aWriteStream*/) const + { + + } + +// ----------------------------------------------------------------------------- +// CSIPMessageElements::ExternalizeL +// ----------------------------------------------------------------------------- +// +void CSIPMessageElements::ExternalizeL (const CSIPExtensionHeader* /*aHeader*/, + RWriteStream& /*aWriteStream*/) const + { + + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/CSIPResponseElements.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/CSIPResponseElements.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,218 @@ +/* +* 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: +* +*/ + +#include "SipResponseElements.h" +#include "SipMessageElements.h" +#include "sipstrings.h" +#include "SipStrConsts.h" + +#include "musunittesting.h" + +// ----------------------------------------------------------------------------- +// CSIPResponseElements::NewL +// ----------------------------------------------------------------------------- +// +EXPORT_C CSIPResponseElements* +CSIPResponseElements::NewL (TUint aStatusCode, RStringF aReasonPhrase) + { + CSIPResponseElements* self = + CSIPResponseElements::NewLC(aStatusCode,aReasonPhrase); + CleanupStack::Pop (self); + return self; + } + +// ----------------------------------------------------------------------------- +// CSIPResponseElements::NewLC +// ----------------------------------------------------------------------------- +// +EXPORT_C CSIPResponseElements* +CSIPResponseElements::NewLC (TUint aStatusCode, RStringF aReasonPhrase) + { + CSIPResponseElements* self = new(ELeave)CSIPResponseElements; + CleanupStack::PushL (self); + self->ConstructL (aStatusCode,aReasonPhrase); + return self; + } + +// ----------------------------------------------------------------------------- +// CSIPResponseElements::CSIPResponseElements +// ----------------------------------------------------------------------------- +// +CSIPResponseElements::CSIPResponseElements () + { + } + +// ----------------------------------------------------------------------------- +// CSIPResponseElements::ConstructL +// ----------------------------------------------------------------------------- +// +void CSIPResponseElements::ConstructL (TUint aStatusCode, + RStringF aReasonPhrase) + { + SetStatusCodeL (aStatusCode); + iReasonPhrase = aReasonPhrase.Copy(); + iMessageElements = CSIPMessageElements::NewL(); + } + +// ----------------------------------------------------------------------------- +// CSIPResponseElements::~CSIPResponseElements +// ----------------------------------------------------------------------------- +// +EXPORT_C CSIPResponseElements::~CSIPResponseElements () + { + delete iMessageElements; + iReasonPhrase.Close(); + } + +// ----------------------------------------------------------------------------- +// CSIPResponseElements::SetStatusCodeL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CSIPResponseElements::SetStatusCodeL (TUint aStatusCode) + { + iStatusCode = aStatusCode; + } + +// ----------------------------------------------------------------------------- +// CSIPResponseElements::StatusCode +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint CSIPResponseElements::StatusCode() const + { + return iStatusCode; + } + +// ----------------------------------------------------------------------------- +// CSIPResponseElements::SetReasonPhraseL +// ----------------------------------------------------------------------------- +// +EXPORT_C void +CSIPResponseElements::SetReasonPhraseL (RStringF aReasonPhrase) + { + iReasonPhrase.Close(); + iReasonPhrase = aReasonPhrase.Copy(); + } + +// ----------------------------------------------------------------------------- +// CSIPResponseElements::ReasonPhrase +// ----------------------------------------------------------------------------- +// +EXPORT_C RStringF CSIPResponseElements::ReasonPhrase () const + { + return iReasonPhrase; + } + +// ----------------------------------------------------------------------------- +// CSIPResponseElements::FromHeader +// ----------------------------------------------------------------------------- +// +EXPORT_C const CSIPFromHeader* CSIPResponseElements::FromHeader () const + { + return iMessageElements->From(); + } + +// ----------------------------------------------------------------------------- +// CSIPResponseElements::ToHeader +// ----------------------------------------------------------------------------- +// +EXPORT_C const CSIPToHeader* CSIPResponseElements::ToHeader () const + { + return iMessageElements->To(); + } + +// ----------------------------------------------------------------------------- +// CSIPResponseElements::CSeqHeader +// ----------------------------------------------------------------------------- +// +EXPORT_C const CSIPCSeqHeader* CSIPResponseElements::CSeqHeader() const + { + return iMessageElements->CSeq(); + } + +// ----------------------------------------------------------------------------- +// CSIPResponseElements::MessageElements +// ----------------------------------------------------------------------------- +// +EXPORT_C const CSIPMessageElements& +CSIPResponseElements::MessageElements () const + { + return *iMessageElements; + } + +// ----------------------------------------------------------------------------- +// CSIPResponseElements::MessageElements +// ----------------------------------------------------------------------------- +// +EXPORT_C CSIPMessageElements& CSIPResponseElements::MessageElements () + { + return *iMessageElements; + } + +// ----------------------------------------------------------------------------- +// CSIPResponseElements::InternalizeL +// ----------------------------------------------------------------------------- +// +CSIPResponseElements* +CSIPResponseElements::InternalizeL (RReadStream& aReadStream) + { + CSIPResponseElements* self = + CSIPResponseElements::InternalizeLC(aReadStream); + CleanupStack::Pop(); // self + return self; + } + +// ----------------------------------------------------------------------------- +// CSIPResponseElements::InternalizeLC +// ----------------------------------------------------------------------------- +// +CSIPResponseElements* +CSIPResponseElements::InternalizeLC (RReadStream& aReadStream) + { + CSIPResponseElements* self = new(ELeave)CSIPResponseElements; + CleanupStack::PushL (self); + self->DoInternalizeL(aReadStream); + return self; + } + +// ----------------------------------------------------------------------------- +// CSIPResponseElements::DoInternalizeL +// ----------------------------------------------------------------------------- +// +void CSIPResponseElements::DoInternalizeL (RReadStream& aReadStream) + { + iStatusCode = aReadStream.ReadUint16L(); + TUint32 reasonPhraseLength = aReadStream.ReadUint32L(); + HBufC8* reasonPhraseBuf = HBufC8::NewLC(reasonPhraseLength); + TPtr8 reasonPhrasePtr(reasonPhraseBuf->Des()); + aReadStream.ReadL(reasonPhrasePtr,reasonPhraseLength); + iReasonPhrase = SIPStrings::Pool().OpenFStringL(reasonPhrasePtr); + CleanupStack::PopAndDestroy(reasonPhraseBuf); + iMessageElements = CSIPMessageElements::InternalizeL(aReadStream); + } + +// ----------------------------------------------------------------------------- +// CSIPResponseElements::ExternalizeL +// ----------------------------------------------------------------------------- +// +void CSIPResponseElements::ExternalizeL (RWriteStream& aWriteStream) const + { + aWriteStream.WriteUint16L(iStatusCode); + TPtrC8 reasonPhrase(iReasonPhrase.DesC()); + aWriteStream.WriteUint32L(reasonPhrase.Length()); + aWriteStream.WriteL(reasonPhrase); + iMessageElements->ExternalizeL(aWriteStream); + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/CSipSseTestTls.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/CSipSseTestTls.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,346 @@ +/* +* 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: +* +*/ + + +#include "CSipSseTestTls.h" +#include "musavaobserver.h" +#include +#include +#include +#include +#include "SipResponseElements.h" +#include "siprequestelements.h" +#include "mussettingskeys.h" + + +TBool CSipSseTestTls::iSipRegisterStatus = EFalse; + + +void CSipSseTestTls::OpenL () + { + CSipSseTestTls* self = new (ELeave) CSipSseTestTls(); + self->ClientRequest( NULL ); + self->ClientResponse( SIPStrings::StringF( SipStrConsts::EEmpty ), NULL ); + Dll::SetTls( self ); + + User::LeaveIfError( self->Set ( MusSettingsKeys::KActivation, + MusSettingsKeys::EAlwaysActive ) ); + User::LeaveIfError( self->Set ( MusSettingsKeys::KAuditoryNotification, + MusSettingsKeys::EAuditoryNotificationOff ) ); + User::LeaveIfError( self->Set ( MusSettingsKeys::KPopupNotification, + MusSettingsKeys::EPopupNotificationOff ) ); + User::LeaveIfError( self->Set ( MusSettingsKeys::KPopupNotificationType, + MusSettingsKeys::ENotificationTypeQueryUser ) ); + User::LeaveIfError( self->Set ( MusSettingsKeys::KEdgeDtmSupport, + MusSettingsKeys::EDtmModeNotAllowed ) ); + User::LeaveIfError( self->Set ( MusSettingsKeys::KForceInternetSignaling, + MusSettingsKeys::EFollowProfileConfiguration ) ); + User::LeaveIfError( self->Set ( MusSettingsKeys::KAutoRecord, + MusSettingsKeys::EAutoRecordOn ) ); + User::LeaveIfError( self->Set ( MusSettingsKeys::KSipProfileId, + 0 ) ); //default profile + User::LeaveIfError( self->Set ( MusSettingsKeys::KUiOrientation, + MusSettingsKeys::EPortrait ) ); + User::LeaveIfError( self->Set ( MusSettingsKeys::KCapabilityQuery, + MusSettingsKeys::ENoOptions ) ); + User::LeaveIfError( self->Set ( MusSettingsKeys::KAllowOnlyIn3GNetwork, + MusSettingsKeys::EAllowedAllBearers ) ); + + } + +void CSipSseTestTls::Close () + { + CSipSseTestTls* self = Storage(); + delete self; + Dll::SetTls( NULL ); + } + + +CSipSseTestTls* CSipSseTestTls::Storage() + { + return static_cast(Dll::Tls()); + } + +CSipSseTestTls::CSipSseTestTls() + : iError( KErrNone ) + { + } + +CSipSseTestTls::~CSipSseTestTls() + { + delete iClientRequest; + delete iClientResponse; + iKeys.Reset(); + iValues.Reset(); + } + +void CSipSseTestTls::Reset() + { + Storage()->Set ( MusSettingsKeys::KActivation, + MusSettingsKeys::EAlwaysActive ); + Storage()->Set ( MusSettingsKeys::KAuditoryNotification, + MusSettingsKeys::EAuditoryNotificationOff ); + Storage()->Set ( MusSettingsKeys::KPopupNotification, + MusSettingsKeys::EPopupNotificationOff ); + Storage()->Set ( MusSettingsKeys::KPopupNotificationType, + MusSettingsKeys::ENotificationTypeQueryUser ); + Storage()->Set ( MusSettingsKeys::KEdgeDtmSupport, + MusSettingsKeys::EDtmModeNotAllowed ); + Storage()->Set ( MusSettingsKeys::KForceInternetSignaling, + MusSettingsKeys::EFollowProfileConfiguration ); + Storage()->Set ( MusSettingsKeys::KAutoRecord, + MusSettingsKeys::EAutoRecordOn ); + Storage()->Set ( MusSettingsKeys::KSipProfileId, + 0 ); //default profile + Storage()->Set ( MusSettingsKeys::KUiOrientation, + MusSettingsKeys::EPortrait ); + Storage()->Set ( MusSettingsKeys::KCapabilityQuery, + MusSettingsKeys::ENoOptions ); + + Storage()->Set ( MusSettingsKeys::KAllowOnlyIn3GNetwork, + MusSettingsKeys::EAllowedAllBearers ); + + iRegistryBehavior = 0; + iProfileBehavior = 0; + iConnectionBehavior = 0; + } + +TInt CSipSseTestTls::Set(TUint32 aKey, TInt aValue) + { + // Setting of any other value + for ( TInt i = 0; i < iKeys.Count(); ++i ) + { + if ( iKeys[i] == aKey ) + { + iValues[i] = aValue; + return KErrNone; + } + } + + // No wise error handling implemented + TInt error = iKeys.Append( aKey ); + if ( error == KErrNone ) + { + error = iValues.Append( aValue ); + } + + return error; + } + +TInt CSipSseTestTls::Get(TUint32 aKey, TInt& aValue) + { + for ( TInt i = 0; i < iKeys.Count(); ++i ) + { + if ( iKeys[i] == aKey ) + { + aValue = iValues[i]; + return KErrNone; + } + } + + return KErrNotFound; + } + +void CSipSseTestTls::SetError( TInt aError ) + { + iError = aError; + } + +TInt CSipSseTestTls::Error() const + { + return iError; + } + + +void CSipSseTestTls::Clear() + { + iError = KErrNone; + //iState = MMusAvaObserver::EMusAvaNotStateDefined; + iStatus = MMusAvaObserver::EMusAvaStatusNotExecuted; + iName = MMusAvaObserver::EMusAvaNameNotDefined; + iConnectionCount = 0; + iSubConnectionCount = 0; + iUintAttributeValue = 0; + iConnectionId = 0; + iIntAttributeValue = 0; + iRequestStatus = KErrNone; + iPhoneRegistrationStatus = RMobilePhone::ERegistrationUnknown; + iPhoneRegistrationStatusPointer = NULL; + iPhoneNetworkMode = RMobilePhone::ENetworkModeUnknown; + ClientRequest( NULL ); + //iResponseToRequest = SIPStrings::StringF( SipStrConsts::EEmpty ); + } + +void CSipSseTestTls::SetRequestStatus( TRequestStatus& aStatus ) + { + iRequestStatus = aStatus; + } + + +TBool CSipSseTestTls::RegisterStatus() + { + + return iSipRegisterStatus; + } +void CSipSseTestTls::SetRegisterStatus( TBool aStatus ) + { + iSipRegisterStatus = aStatus; + } +TBool CSipSseTestTls::RegisterSent() + { + if ( !iSipRegisterStatus ) + { + iSipRegisterStatus = ETrue; + } + return iSipRegisterStatus; + } + +void CSipSseTestTls::StoreRegistry( MSIPProfileRegistryObserver& aRegistry ) + { + iRegistry = &aRegistry; + } + +void CSipSseTestTls::ProfileRegistryEventOccurred(TUint32 aProfileId, MSIPProfileRegistryObserver::TEvent aEvent ) + { + iRegistry->ProfileRegistryEventOccurred( aProfileId,aEvent ); + } +/* +void CSipSseTestTls::AvailabilityState( MMusAvaObserver::TAvailabilityState aState, + MMusAvaObserver::TAvailabilityStatus aStatus, + MMusAvaObserver::TAvailabilityName aName ) + { + iState = aState; + iStatus = aStatus; + iName = aName; + } + */ +void CSipSseTestTls::SetState( MMusAvaObserver::TAvailabilityStatus aStatus ) + { + iStatus = aStatus; + } + +TInt CSipSseTestTls::ConnectionCount() + { + return iConnectionCount; + } +void CSipSseTestTls::SetConnectionCount( TInt aCount ) + { + iConnectionCount = aCount; + } + +void CSipSseTestTls::ConnectionInfo( const TUint& aIndex, + TUint& aConnectionId, + TUint& aSubConnectionCount ) + { + aConnectionId = iConnectionId; + aSubConnectionCount = iSubConnectionCount; + } + +void CSipSseTestTls::SetConnectionInfo( TUint aConnectionId, + TUint aSubConnectionCount ) + { + iConnectionId = aConnectionId; + iSubConnectionCount = aSubConnectionCount; + } + +void CSipSseTestTls::GetUintAttribute( const TUint aConnectionId, + const TUint aSubConnectionId, + const TUint aAttribute, + TUint& aValue, + TRequestStatus& aStatus ) + { + aValue = iUintAttributeValue; + aStatus = iRequestStatus; + } +void CSipSseTestTls::SetUintAttribute( TUint aConnectionId, + TUint aSubConnectionId, + TUint aAttribute, + TUint aValue, + TRequestStatus& aStatus ) + { + iUintAttributeValue = aValue; + iRequestStatus = aStatus; + } + +void CSipSseTestTls::GetIntAttribute( const TUint aConnectionId, + const TUint aSubConnectionId, + const TUint aAttribute, + TInt& aValue, + TRequestStatus& aStatus ) + { + aValue = iIntAttributeValue; + aStatus = iRequestStatus; + } +void CSipSseTestTls::SetIntAttribute( TUint aConnectionId, + TUint aSubConnectionId, + TUint aAttribute, + TInt aValue, + TRequestStatus& aStatus ) + { + iIntAttributeValue = aValue; + iRequestStatus = aStatus; + } + +void CSipSseTestTls::SetEvent(const CConnMonEventBase& aConnMonEvent) + { + iConnMonEventBase = const_cast( &aConnMonEvent ); + } + +const CConnMonEventBase& CSipSseTestTls::Event() + { + return *iConnMonEventBase; + } + +void CSipSseTestTls::SetRegistrationStatus( RMobilePhone::TMobilePhoneRegistrationStatus aRegStatus ) + { + iPhoneRegistrationStatus = aRegStatus; + } + +void CSipSseTestTls::SetRegistrationStatus( RMobilePhone::TMobilePhoneRegistrationStatus* aRegStatus ) + { + iPhoneRegistrationStatusPointer = aRegStatus; + } + +void CSipSseTestTls::RegistrationStatus( RMobilePhone::TMobilePhoneRegistrationStatus& aReqStatus ) + { + aReqStatus = iPhoneRegistrationStatus; + } + +void CSipSseTestTls::SetPhoneNetworkModeStatus( RMobilePhone::TMobilePhoneNetworkMode aStatus ) + { + iPhoneNetworkMode = aStatus; + } + +RMobilePhone::TMobilePhoneNetworkMode& CSipSseTestTls::PhoneNetworkModeStatus() + { + return iPhoneNetworkMode; + } + + void CSipSseTestTls::ClientRequest( CSIPRequestElements* aRequest ) + { + delete iClientRequest; + iClientRequest = aRequest; + } + +void CSipSseTestTls::ClientResponse( RStringF aMethod, CSIPResponseElements* aResponse ) + { + iResponseToRequest = aMethod; + delete iClientResponse; + iClientResponse = aResponse; + } + +//end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/Csip.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/Csip.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,66 @@ +/* +* 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 "sip.h" +#include "sipobserver.h" +#include "sipstrings.h" +#include "musunittesting.h" + +EXPORT_C CSIP* CSIP::NewL(const TUid& aUid,MSIPObserver& aSIPObserver) + { + CSIP* self = new(ELeave) CSIP(aSIPObserver); + CleanupStack::PushL(self); + self->ConstructL(aUid); + CleanupStack::Pop(); + return self; + } + + +void CSIP::ConstructL(const TUid& /*aUid*/) + { + SIPStrings::OpenL(); + } + + +CSIP::CSIP(MSIPObserver& aSIPObserver): iObserver(aSIPObserver) + { + } + + +EXPORT_C CSIP::~CSIP() + { + SIPStrings::Close(); + } + + +EXPORT_C CDesC8Array* CSIP::SupportedSecurityMechanismsL() const + { + _LIT8(Ksipsec3gpp , "ipsec-3gpp"); + _LIT8(Ksipdigest, "digest"); + + CDesC8ArraySeg* mechanisms = new(ELeave)CDesC8ArraySeg(1); + CleanupStack::PushL(mechanisms); + + mechanisms->AppendL(Ksipsec3gpp); + mechanisms->AppendL(Ksipdigest); + + CleanupStack::Pop(mechanisms); + + return mechanisms; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/Csipclienttransaction.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/Csipclienttransaction.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,64 @@ +/* +* 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 "sipclienttransaction.h" +#include "sipresponseelements.h" +#include "sipstrings.h" +#include "SipStrConsts.h" + + +EXPORT_C CSIPClientTransaction::~CSIPClientTransaction() + { + delete iE; + } + + +CSIPClientTransaction::CSIPClientTransaction( RStringF aType ) + :CSIPTransactionBase( aType, ETrue ) + { + iIsCancelAllowed = ETrue; + } + + +EXPORT_C CSIPClientTransaction* CSIPClientTransaction::NewL( RStringF aType ) + { + return new (ELeave) CSIPClientTransaction( aType ); + } + +EXPORT_C void CSIPClientTransaction::SetResponseElements(CSIPResponseElements* aE) + { + if (iE) + delete iE; + iE = aE; + + } + +EXPORT_C const CSIPResponseElements* CSIPClientTransaction::ResponseElements() const + { + return iE; + } + +EXPORT_C TBool CSIPClientTransaction::CancelAllowed() const + { + return iIsCancelAllowed; + } + + +EXPORT_C CSIPClientTransaction* CSIPClientTransaction::CancelL() + { + return CSIPClientTransaction::NewL( SIPStrings::StringF( SipStrConsts::ECancel ) ); + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/Csipconnection.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/Csipconnection.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,116 @@ +/* +* 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 "sipconnection.h" +#include "sip.h" +#include "siperr.h" +#include "musunittesting.h" +#include "SIPRequestElements.h" +#include "SIPClientTransaction.h" +#include "CSipSseTestTls.h" + +CSIPConnection::CSIPConnection(CSIP& aSIP, + TUint32 aIapId, + MSIPConnectionObserver& aObserver) + : iIapId(aIapId), iObserver(aObserver), iState(EActive) + { + iSIP = &aSIP; + } + +void CSIPConnection::ConstructL() + { + } + + +EXPORT_C CSIPConnection* CSIPConnection::NewL(CSIP& aSIP, + TUint32 aIapId, + MSIPConnectionObserver& aSIPConnectionObserver) + { + + CSIPConnection* self = new(ELeave) CSIPConnection(aSIP, aIapId, aSIPConnectionObserver); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(); + return self; + + } + + +EXPORT_C CSIPConnection::~CSIPConnection() + { + } + +EXPORT_C TUint32 CSIPConnection::IapId() const + { + return iIapId; + } + +EXPORT_C CSIPConnection::TState CSIPConnection::State() const + { + return iState; + } + +EXPORT_C CSIPClientTransaction* CSIPConnection::SendRequestL( + CSIPRequestElements* aElements, + const MSIPRegistrationContext& /*aContext*/ ) + { + CSIPClientTransaction* trx = CSIPClientTransaction::NewL( aElements->Method() ); + + CSipSseTestTls* tls = CSipSseTestTls::Storage(); + if ( tls ) + { + tls->ClientRequest( aElements ); + } + else + { + delete aElements; + } + + return trx; + } + +EXPORT_C void CSIPConnection::GetLocalAddrL(TInetAddr& aAddr)const + { + _LIT(add,"0.0.0.0"); + aAddr.Input(add); + } + + +EXPORT_C void CSIPConnection::SetState(TState aState) + { + iState = aState; + } + +//TODO:Check if these new functions are needed in sip_stub + +// ----------------------------------------------------------------------------- +// CSIPConnection::SIP +// ----------------------------------------------------------------------------- +// +EXPORT_C CSIP* CSIPConnection::SIP() + { + return iSIP; + } + +// ----------------------------------------------------------------------------- +// CSIPConnection::SIP +// ----------------------------------------------------------------------------- +// +EXPORT_C const CSIP* CSIPConnection::SIP() const + { + return iSIP; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/Csipservertransaction.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/Csipservertransaction.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,95 @@ +/* +* 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 "sipservertransaction.h" +#include "siprequestelements.h" +#include "sipresponseelements.h" +#include +#include +#include "CSipSseTestTls.h" +#include "musunittesting.h" + +#include "CSipSseTestTls.h" + +EXPORT_C CSIPServerTransaction::~CSIPServerTransaction() + { + delete iRequestElements; + } + + +CSIPServerTransaction::CSIPServerTransaction( RStringF aType ) + : CSIPTransactionBase( aType, EFalse ) + { + } + + +EXPORT_C CSIPServerTransaction* CSIPServerTransaction::NewL( RStringF aType ) + { + return new(ELeave)CSIPServerTransaction( aType ); + } + + +EXPORT_C void CSIPServerTransaction::SetRequestElements( + CSIPRequestElements* aElements) + { + if( iRequestElements ) + { + delete iRequestElements; + } + + iRequestElements = aElements; + } + + +EXPORT_C void CSIPServerTransaction::SendResponseL( + CSIPResponseElements *aElements) + { + CSipSseTestTls* tls = CSipSseTestTls::Storage(); + if ( tls ) + { + User::LeaveIfError( tls->Error() ); + tls->ClientResponse( iRequestElements->Method(), aElements ); + // tls->SIPSends( Type(), aElements ); + } + else + { + if( iResponseElements) + { + delete iResponseElements; + iResponseElements = NULL; + } + iResponseElements = aElements; + } + } + + +EXPORT_C const CSIPRequestElements* CSIPServerTransaction::RequestElements() const + { + return iRequestElements; + } + +EXPORT_C TBool CSIPServerTransaction::ResponseAllowed() const + { + if ( Type() == SIPStrings::StringF( SipStrConsts::EAck ) ) + { + return EFalse; + } + else + { + return ETrue; + } + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/Csiptransactionbase.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/Csiptransactionbase.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,69 @@ +/* +* 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 "siptransactionbase.h" +#include "sipresponseelements.h" +#include "sipstrings.h" +#include "SipStrConsts.h" +#include "musunittesting.h" + +CSIPTransactionBase::~CSIPTransactionBase() + { + delete iResponseElements; + } + +CSIPTransactionBase::CSIPTransactionBase( RStringF aType, TBool aIsCliTrx ) + : iType(aType), + iIsClientTransaction(aIsCliTrx), + iState(ETrying) + { + + if ( iIsClientTransaction && iType == SIPStrings::StringF( SipStrConsts::EInvite ) ) + { + iState = ECalling; + } + } + +EXPORT_C TBool CSIPTransactionBase::operator==(const CSIPTransactionBase& aTransactionBase) const + { + return (this == &aTransactionBase); + } + +EXPORT_C CSIPTransactionBase::TState CSIPTransactionBase::StateL() + { + return iState; + } + +EXPORT_C RStringF CSIPTransactionBase::Type() const + { + return iType; + } + +EXPORT_C TBool CSIPTransactionBase::IsSIPClientTransaction() const + { + return iIsClientTransaction; + } + +void CSIPTransactionBase::ChangeState( CSIPTransactionBase::TState aNextState ) + { + iState = aNextState; + } + +void CSIPTransactionBase::Detach(const MTransactionAssociation& /*aAssociation*/) + { + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/RConnMon.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/RConnMon.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,877 @@ +/* +* Copyright (c) 2002-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: +* +*/ + + +// INCLUDE FILES +#include "rconnmon.h" +/*#include "ConnMonDef.h" +#include "ConnMonCli.h" +#include "ConnMonServ.h"*/ +#include "CSipSseTestTls.h" +#include "musavatimer.h" + +#include "musunittesting.h" + +#include + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// RConnectionMonitor::ConnectL +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt RConnectionMonitor::ConnectL() + { + + iMusAvaTimer = CMusAvaTimer::NewL(); + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// RConnectionMonitor::Close +// ----------------------------------------------------------------------------- +// +EXPORT_C void RConnectionMonitor::Close() + { + delete iEmptyHbufC; + iEmptyHbufC = NULL; + delete iMusAvaTimer; + iMusAvaTimer = NULL; + iPtrArray.Close(); + } + +// ----------------------------------------------------------------------------- +// RConnectionMonitor::GetConnectionCount +// ----------------------------------------------------------------------------- +// +EXPORT_C void RConnectionMonitor::GetConnectionCount( TUint& aConnectionCount, + TRequestStatus& aStatus ) + { + aConnectionCount = iConnectionCounter; + aStatus = KErrNone; + } + +// ----------------------------------------------------------------------------- +// RConnectionMonitor::GetConnectionInfo +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt RConnectionMonitor::GetConnectionInfo( const TUint aIndex, + TUint& aConnectionId, + TUint& iConnectionCounterer ) const + { + aConnectionId = iConnectionId; + iConnectionCounterer = iSubConnectionCount; + return iConnectionInfoError; + } + +// ----------------------------------------------------------------------------- +// RConnectionMonitor::GetSubConnectionInfo +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt RConnectionMonitor::GetSubConnectionInfo( const TUint aConnectionId, + const TUint aIndex, + TUint& aSubConnectionId ) const + { + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// RConnectionMonitor::GetIntAttribute +// ----------------------------------------------------------------------------- +// +EXPORT_C void RConnectionMonitor::GetIntAttribute( const TUint aConnectionId, + const TUint aSubConnectionId, + const TUint aAttribute, + TInt& aValue, + TRequestStatus& aStatus ) + { + CSipSseTestTls* tls = CSipSseTestTls::Storage(); + if ( tls ) + { + tls->GetIntAttribute( aConnectionId, + aSubConnectionId, + aAttribute, + aValue, + aStatus ); + //iMusAvaTimer->StopActiveSchedulerAfter( 10, &aStatus); + } + } + +// ----------------------------------------------------------------------------- +// RConnectionMonitor::GetUintAttribute +// ----------------------------------------------------------------------------- +// +EXPORT_C void RConnectionMonitor::GetUintAttribute( const TUint aConnectionId, + const TUint aSubConnectionId, + const TUint aAttribute, + TUint& aValue, + TRequestStatus& aStatus ) + { + aValue = iUintAttributeValue; + aStatus = iStatus; + } + +// ----------------------------------------------------------------------------- +// RConnectionMonitor::GetBoolAttribute +// ----------------------------------------------------------------------------- +// +EXPORT_C void RConnectionMonitor::GetBoolAttribute( const TUint aConnectionId, + const TUint aSubConnectionId, + const TUint aAttribute, + TBool& aValue, + TRequestStatus& aStatus ) + { + ; + } + +// ----------------------------------------------------------------------------- +// RConnectionMonitor::GetStringAttribute +// ----------------------------------------------------------------------------- +// +EXPORT_C void RConnectionMonitor::GetStringAttribute( const TUint aConnectionId, + const TUint aSubConnectionId, + const TUint aAttribute, + TDes& aValue, + TRequestStatus& aStatus ) const + { + + } + +// ----------------------------------------------------------------------------- +// RConnectionMonitor::GetPckgAttribute +// ----------------------------------------------------------------------------- +// +EXPORT_C void RConnectionMonitor::GetPckgAttribute( const TUint aConnectionId, + const TUint aSubConnectionId, + const TUint aAttribute, + TDes8& aValue, + TRequestStatus& aStatus ) const + { + + } + +// ----------------------------------------------------------------------------- +// RConnectionMonitor::GetPckgAttribute +// ----------------------------------------------------------------------------- +// +EXPORT_C void RConnectionMonitor::GetPckgAttribute( const TUint aConnectionId, + const TUint aSubConnectionId, + const TUint aAttribute, + TDes16& aValue, + TRequestStatus& aStatus ) const + { + + } + +// ----------------------------------------------------------------------------- +// RConnectionMonitor::SetIntAttribute +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt RConnectionMonitor::SetIntAttribute( const TUint aConnectionId, + const TUint aSubConnectionId, + const TUint aAttribute, + const TInt aValue ) const + { + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// RConnectionMonitor::SetUintAttribute +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt RConnectionMonitor::SetUintAttribute( const TUint aConnectionId, + const TUint aSubConnectionId, + const TUint aAttribute, + const TUint aValue ) const + { + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// RConnectionMonitor::SetBoolAttribute +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt RConnectionMonitor::SetBoolAttribute( const TUint aConnectionId, + const TUint aSubConnectionId, + const TUint aAttribute, + const TBool aValue ) const + { + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// RConnectionMonitor::SetStringAttribute +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt RConnectionMonitor::SetStringAttribute( const TUint aConnectionId, + const TUint aSubConnectionId, + const TUint aAttribute, + const TDes& aValue ) const + { + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// RConnectionMonitor::SetPckgAttribute +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt RConnectionMonitor::SetPckgAttribute( const TUint aConnectionId, + const TUint aSubConnectionId, + const TUint aAttribute, + const TDes8& aValue ) const + { + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// RConnectionMonitor::CancelAsyncRequest +// ----------------------------------------------------------------------------- +// +EXPORT_C void RConnectionMonitor::CancelAsyncRequest( TInt aReqToCancel ) + { + + } + +// ----------------------------------------------------------------------------- +// RConnectionMonitor::NotifyEventL +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt RConnectionMonitor::NotifyEventL( MConnectionMonitorObserver& aObserver ) + { + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// RConnectionMonitor::CancelNotifications +// ----------------------------------------------------------------------------- +// +EXPORT_C void RConnectionMonitor::CancelNotifications() + { + + } + + +// private methods in conjunction with CConnMonEventHandler + +// ----------------------------------------------------------------------------- +// RConnectionMonitor::ReceiveEvent +// ----------------------------------------------------------------------------- +// +void RConnectionMonitor::ReceiveEvent( TDes8& aBuffer, + TDes8& aExtraBuf, + TRequestStatus& aStatus ) + { + + } + +// ----------------------------------------------------------------------------- +// RConnectionMonitor::CancelReceiveEvent +// ----------------------------------------------------------------------------- +// +void RConnectionMonitor::CancelReceiveEvent() + { + + } + +// private internal methods + +// ----------------------------------------------------------------------------- +// RConnectionMonitor::IsConnected +// ----------------------------------------------------------------------------- +// +TBool RConnectionMonitor::IsConnected() const + { + return ETrue; + } + +// ----------------------------------------------------------------------------- +// RConnectionMonitor::NextPtr +// ----------------------------------------------------------------------------- +// +TPtr8& RConnectionMonitor::NextPtr() + { + iEmptyHbufC = HBufC8::NewL( 0 ); + TPtr8 ptr = iEmptyHbufC->Des(); + iPtrArray.Append( ptr ); + return iPtrArray[0]; + + } + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CConnMonEventBase::CConnMonEventBase +// ----------------------------------------------------------------------------- +// +CConnMonEventBase::CConnMonEventBase( const TInt aEventType, const TUint aConnectionId ) + { + iEventType = aEventType ; + iConnectionId = aConnectionId ; + } + +// Destructor +CConnMonEventBase::~CConnMonEventBase() + { + } + +// ----------------------------------------------------------------------------- +// CConnMonEventBase::EventType +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CConnMonEventBase::EventType() const + { + return iEventType; + } + +// ----------------------------------------------------------------------------- +// CConnMonEventBase::ConnectionId +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint CConnMonEventBase::ConnectionId() const + { + return iConnectionId; + } + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CConnMonCreateConnection::CConnMonCreateConnection +// ----------------------------------------------------------------------------- +// +CConnMonCreateConnection::CConnMonCreateConnection( const TUint aConnectionId ) + :CConnMonEventBase( EConnMonCreateConnection, aConnectionId ) + { + } + +// Destructor +CConnMonCreateConnection::~CConnMonCreateConnection() + { + + } + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CConnMonDeleteConnection::CConnMonDeleteConnection +// ----------------------------------------------------------------------------- +// +CConnMonDeleteConnection::CConnMonDeleteConnection( const TUint aConnectionId, + const TUint aDownlinkData, + const TUint aUplinkData, + const TBool aAuthDelete ) + :CConnMonEventBase( EConnMonDeleteConnection, aConnectionId ) + { + iDownlinkData = aDownlinkData ; + iUplinkData = aUplinkData ; + iAuthDelete = aAuthDelete ; + } + +// Destructor +CConnMonDeleteConnection::~CConnMonDeleteConnection() + { + } + +// ----------------------------------------------------------------------------- +// CConnMonDeleteConnection::DownlinkData +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint CConnMonDeleteConnection::DownlinkData() const + { + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CConnMonDeleteConnection::UplinkData +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint CConnMonDeleteConnection::UplinkData() const + { + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CConnMonDeleteConnection::AuthoritativeDelete +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool CConnMonDeleteConnection::AuthoritativeDelete() const + { + return KErrNone; + } + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CConnMonCreateSubConnection::CConnMonCreateSubConnection +// ----------------------------------------------------------------------------- +// +CConnMonCreateSubConnection::CConnMonCreateSubConnection( const TUint aConnectionId, + const TUint aSubConnectionId ) + :CConnMonEventBase( EConnMonCreateSubConnection, aConnectionId ) + { + + } + +// Destructor +CConnMonCreateSubConnection::~CConnMonCreateSubConnection() + { + } + +// ----------------------------------------------------------------------------- +// CConnMonCreateSubConnection::SubConnectionId +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint CConnMonCreateSubConnection::SubConnectionId() const + { + return KErrNone; + } + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CConnMonDeleteSubConnection::CConnMonDeleteSubConnection +// ----------------------------------------------------------------------------- +// +CConnMonDeleteSubConnection::CConnMonDeleteSubConnection( const TUint aConnectionId, + const TUint aSubConnectionId, + const TUint aDownlinkData, + const TUint aUplinkData, + const TBool aAuthDelete ) + :CConnMonEventBase( EConnMonDeleteSubConnection, aConnectionId ) + { + iSubConnectionId = aSubConnectionId ; + iDownlinkData = aDownlinkData ; + iUplinkData = aUplinkData ; + iAuthDelete = aAuthDelete ; + } + +// Destructor +CConnMonDeleteSubConnection::~CConnMonDeleteSubConnection() + { + } + +// ----------------------------------------------------------------------------- +// CConnMonDeleteSubConnection::SubConnectionId +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint CConnMonDeleteSubConnection::SubConnectionId() const + { + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CConnMonDeleteSubConnection::DownlinkData +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint CConnMonDeleteSubConnection::DownlinkData() const + { + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CConnMonDeleteSubConnection::UplinkData +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint CConnMonDeleteSubConnection::UplinkData() const + { + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CConnMonDeleteSubConnection::AuthoritativeDelete +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool CConnMonDeleteSubConnection::AuthoritativeDelete() const + { + return ETrue; + } + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CConnMonDownlinkDataThreshold::CConnMonDownlinkDataThreshold +// ----------------------------------------------------------------------------- +// +CConnMonDownlinkDataThreshold::CConnMonDownlinkDataThreshold( const TUint aConnectionId, + const TUint aSubConnectionId, + const TUint aDownlinkData ) + :CConnMonEventBase( EConnMonDownlinkDataThreshold, aConnectionId ) + { + iSubConnectionId = aSubConnectionId ; + iDownlinkData = aDownlinkData ; + } + +// Destructor +CConnMonDownlinkDataThreshold::~CConnMonDownlinkDataThreshold() + { + } + +// ----------------------------------------------------------------------------- +// CConnMonDownlinkDataThreshold::SubConnectionId +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint CConnMonDownlinkDataThreshold::SubConnectionId() const + { + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CConnMonDownlinkDataThreshold::DownlinkData +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint CConnMonDownlinkDataThreshold::DownlinkData() const + { + return KErrNone; + } + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CConnMonUplinkDataThreshold::CConnMonUplinkDataThreshold +// ----------------------------------------------------------------------------- +// +CConnMonUplinkDataThreshold::CConnMonUplinkDataThreshold( const TUint aConnectionId, + const TUint aSubConnectionId, + const TUint aUplinkData ) + :CConnMonEventBase( EConnMonUplinkDataThreshold, aConnectionId ) + { + iSubConnectionId = aSubConnectionId ; + iUplinkData = aUplinkData ; + } + +// Destructor +CConnMonUplinkDataThreshold::~CConnMonUplinkDataThreshold() + { + } + +// ----------------------------------------------------------------------------- +// CConnMonUplinkDataThreshold::SubConnectionId +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint CConnMonUplinkDataThreshold::SubConnectionId() const + { + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CConnMonUplinkDataThreshold::UplinkData +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint CConnMonUplinkDataThreshold::UplinkData() const + { + return KErrNone; + } + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CConnMonNetworkStatusChange::CConnMonNetworkStatusChange +// ----------------------------------------------------------------------------- +// +CConnMonNetworkStatusChange::CConnMonNetworkStatusChange( const TUint aConnectionId, + const TInt aNetworkStatus ) + :CConnMonEventBase( EConnMonNetworkStatusChange, aConnectionId ) + { + iNetworkStatus = aNetworkStatus; + } + +// Destructor +CConnMonNetworkStatusChange::~CConnMonNetworkStatusChange() + { + } + +// ----------------------------------------------------------------------------- +// CConnMonNetworkStatusChange::NetworkStatus +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CConnMonNetworkStatusChange::NetworkStatus() const + { + return iNetworkStatus; + } + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CConnMonConnectionStatusChange::CConnMonConnectionStatusChange +// ----------------------------------------------------------------------------- +// +CConnMonConnectionStatusChange::CConnMonConnectionStatusChange( const TUint aConnectionId, + const TUint aSubConnectionId, + const TInt aConnectionStatus ) + :CConnMonEventBase( EConnMonConnectionStatusChange, aConnectionId ) + { + iSubConnectionId = aSubConnectionId; + iConnectionStatus = aConnectionStatus; + } + +// Destructor +CConnMonConnectionStatusChange::~CConnMonConnectionStatusChange() + { + } + +// ----------------------------------------------------------------------------- +// CConnMonConnectionStatusChange::SubConnectionId +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint CConnMonConnectionStatusChange::SubConnectionId() const + { + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CConnMonConnectionStatusChange::ConnectionStatus +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CConnMonConnectionStatusChange::ConnectionStatus() const + { + return iConnectionStatus; + } + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CConnMonConnectionActivityChange::CConnMonConnectionActivityChange +// ----------------------------------------------------------------------------- +// +CConnMonConnectionActivityChange::CConnMonConnectionActivityChange( const TUint aConnectionId, + const TUint aSubConnectionId, + const TBool aActivity ) + :CConnMonEventBase( EConnMonConnectionActivityChange, aConnectionId ) + { + iSubConnectionId = aSubConnectionId; + iActivity = aActivity; + } + +// Destructor +CConnMonConnectionActivityChange::~CConnMonConnectionActivityChange() + { + } + +// ----------------------------------------------------------------------------- +// CConnMonConnectionActivityChange::SubConnectionId +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint CConnMonConnectionActivityChange::SubConnectionId() const + { + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CConnMonConnectionActivityChange::ConnectionActivity +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool CConnMonConnectionActivityChange::ConnectionActivity() const + { + return ETrue ; + } + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CConnMonNetworkRegistrationChange::CConnMonNetworkRegistrationChange +// ----------------------------------------------------------------------------- +// +CConnMonNetworkRegistrationChange::CConnMonNetworkRegistrationChange + ( const TUint aConnectionId, + const TInt aRegistrationStatus ) + :CConnMonEventBase( EConnMonNetworkRegistrationChange, aConnectionId ) + { + iRegistrationStatus = aRegistrationStatus; + } + +// Destructor +CConnMonNetworkRegistrationChange::~CConnMonNetworkRegistrationChange() + { + } + +// ----------------------------------------------------------------------------- +// CConnMonNetworkRegistrationChange::RegistrationStatus +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CConnMonNetworkRegistrationChange::RegistrationStatus() const + { + return iRegistrationStatus; + } + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CConnMonBearerChange::CConnMonBearerChange +// ----------------------------------------------------------------------------- +// +CConnMonBearerChange::CConnMonBearerChange( const TUint aConnectionId, const TInt aBearer ) + :CConnMonEventBase( EConnMonBearerChange, aConnectionId ) + { + iBearer = aBearer; + } + +// Destructor +CConnMonBearerChange::~CConnMonBearerChange() + { + } + +// ----------------------------------------------------------------------------- +// CConnMonBearerChange::RegistrationStatus +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CConnMonBearerChange::Bearer() const + { + return iBearer; + } + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CConnMonSignalStrengthChange::CConnMonSignalStrengthChange +// ----------------------------------------------------------------------------- +// +CConnMonSignalStrengthChange::CConnMonSignalStrengthChange( const TUint aConnectionId, + const TInt aSignalStrength ) + :CConnMonEventBase( EConnMonSignalStrengthChange, aConnectionId ) + { + iSignalStrength = aSignalStrength; + } + +// Destructor +CConnMonSignalStrengthChange::~CConnMonSignalStrengthChange() + { + } + +// ----------------------------------------------------------------------------- +// CConnMonSignalStrengthChange::SignalStrength +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CConnMonSignalStrengthChange::SignalStrength() const + { + return KErrNone; + } + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CConnMonBearerAvailabilityChange::CConnMonBearerAvailabilityChange +// ----------------------------------------------------------------------------- +// +CConnMonBearerAvailabilityChange::CConnMonBearerAvailabilityChange( const TUint aConnectionId, + const TBool aAvailability ) + :CConnMonEventBase( EConnMonBearerAvailabilityChange, aConnectionId ) + { + iAvailability = aAvailability; + } + +// Destructor +CConnMonBearerAvailabilityChange::~CConnMonBearerAvailabilityChange() + { + } + +// ----------------------------------------------------------------------------- +// CConnMonBearerAvailabilityChange::Availability +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool CConnMonBearerAvailabilityChange::Availability() const + { + return iAvailability; + } + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CConnMonGenericEvent::CConnMonGenericEvent +// ----------------------------------------------------------------------------- +// +CConnMonGenericEvent::CConnMonGenericEvent( const TUint aType, + const TUint aConnectionId, + TAny* aData ) + :CConnMonEventBase( aType, aConnectionId ) + { + iData = aData; + } + +// Destructor +CConnMonGenericEvent::~CConnMonGenericEvent() + { + iData = 0; + } + +// ----------------------------------------------------------------------------- +// CConnMonGenericEvent::Data +// ----------------------------------------------------------------------------- +// +EXPORT_C TAny* CConnMonGenericEvent::Data() const + { + return iData; + } + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CConnMonIapAvailabilityChange::CConnMonIapAvailabilityChange +// ----------------------------------------------------------------------------- +// +CConnMonIapAvailabilityChange::CConnMonIapAvailabilityChange( const TUint aConnectionId, + const TConnMonIapInfo* aIapInfoPtr ) + :CConnMonEventBase( EConnMonIapAvailabilityChange, aConnectionId ) + { + iIapInfo.iCount = 0; + + if ( aIapInfoPtr != NULL ) + { + iIapInfo = *aIapInfoPtr; + } + } + +// Destructor +CConnMonIapAvailabilityChange::~CConnMonIapAvailabilityChange() + { + } + +// ----------------------------------------------------------------------------- +// CConnMonIapAvailabilityChange::IapAvailability +// ----------------------------------------------------------------------------- +// +EXPORT_C TConnMonIapInfo CConnMonIapAvailabilityChange::IapAvailability() const + { + return iIapInfo; + } + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CConnMonTransmitPowerChange::CConnMonTransmitPowerChange +// ----------------------------------------------------------------------------- +// +CConnMonTransmitPowerChange::CConnMonTransmitPowerChange( const TUint aConnectionId, + const TUint aTransmitPower ) + :CConnMonEventBase( EConnMonTransmitPowerChange, aConnectionId ) + { + iTransmitPower = aTransmitPower; + } + +// Destructor +CConnMonTransmitPowerChange::~CConnMonTransmitPowerChange() + { + } + +// ----------------------------------------------------------------------------- +// CConnMonTransmitPowerChange::TransmitPower +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint CConnMonTransmitPowerChange::TransmitPower() const + { + return iTransmitPower; + } + +// End-of-file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/centralrepositorystub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/centralrepositorystub.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,456 @@ +/* +* Copyright (c) 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: +* +*/ + + +#include "centralrepository.h" +#include "mussettingskeys.h" +#include "CSipSseTestTls.h" + + +/// CenRep UIDs and keys +const TUid KCRUidSIPClientResolverConfig = { 0x10282EE7 }; + +const TUid KCRUidInCallVolume = {0x102828B1}; +const TUint32 KTelIncallEarVolume = 0x00000001; +const TUint32 KTelIncallLoudspeakerVolume = 0x00000002; + + +// Values for static variables +MusSettingsKeys::TOperatorVariant CRepository::iOperatorVariant = + MusSettingsKeys::EStandard; +TBool CRepository::iEmulateSawfishRepository = EFalse; + +// STUB stuff +/* +void CCRepositoryBehaviorTls::OpenL() + { + CCRepositoryBehaviorTls* self = new (ELeave) CCRepositoryBehaviorTls(); + Dll::SetTls( self ); + + User::LeaveIfError( self->Set ( MusSettingsKeys::KActivation, + MusSettingsKeys::EAlwaysActive ) ); + User::LeaveIfError( self->Set ( MusSettingsKeys::KAuditoryNotification, + MusSettingsKeys::EAuditoryNotificationOff ) ); + User::LeaveIfError( self->Set ( MusSettingsKeys::KPopupNotification, + MusSettingsKeys::EPopupNotificationOff ) ); + User::LeaveIfError( self->Set ( MusSettingsKeys::KPopupNotificationType, + MusSettingsKeys::ENotificationTypeQueryUser ) ); + User::LeaveIfError( self->Set ( MusSettingsKeys::KEdgeDtmSupport, + MusSettingsKeys::EDtmModeNotAllowed ) ); + User::LeaveIfError( self->Set ( MusSettingsKeys::KForceInternetSignaling, + MusSettingsKeys::EFollowProfileConfiguration ) ); + User::LeaveIfError( self->Set ( MusSettingsKeys::KAutoRecord, + MusSettingsKeys::EAutoRecordOn ) ); + User::LeaveIfError( self->Set ( MusSettingsKeys::KSipProfileId, + 0 ) ); //default profile + User::LeaveIfError( self->Set ( MusSettingsKeys::KUiOrientation, + MusSettingsKeys::EPortrait ) ); + User::LeaveIfError( self->Set ( MusSettingsKeys::KCapabilityQuery, + MusSettingsKeys::ENoOptions ) ); + } + +void CCRepositoryBehaviorTls::Close () + { + CCRepositoryBehaviorTls* self = Storage(); + delete self; + Dll::SetTls( NULL ); + } + + +CCRepositoryBehaviorTls* CCRepositoryBehaviorTls::Storage() + { + return static_cast(Dll::Tls()); + } + +void CCRepositoryBehaviorTls::Reset() + { + User::LeaveIfError( Storage()->Set ( MusSettingsKeys::KActivation, + MusSettingsKeys::EAlwaysActive ) ); + User::LeaveIfError( Storage()->Set ( MusSettingsKeys::KAuditoryNotification, + MusSettingsKeys::EAuditoryNotificationOff ) ); + User::LeaveIfError( Storage()->Set ( MusSettingsKeys::KPopupNotification, + MusSettingsKeys::EPopupNotificationOff ) ); + User::LeaveIfError( Storage()->Set ( MusSettingsKeys::KPopupNotificationType, + MusSettingsKeys::ENotificationTypeQueryUser ) ); + User::LeaveIfError( Storage()->Set ( MusSettingsKeys::KEdgeDtmSupport, + MusSettingsKeys::EDtmModeNotAllowed ) ); + User::LeaveIfError( Storage()->Set ( MusSettingsKeys::KForceInternetSignaling, + MusSettingsKeys::EFollowProfileConfiguration ) ); + User::LeaveIfError( Storage()->Set ( MusSettingsKeys::KAutoRecord, + MusSettingsKeys::EAutoRecordOn ) ); + User::LeaveIfError( Storage()->Set ( MusSettingsKeys::KSipProfileId, + 0 ) ); //default profile + User::LeaveIfError( Storage()->Set ( MusSettingsKeys::KUiOrientation, + MusSettingsKeys::EPortrait ) ); + User::LeaveIfError( Storage()->Set ( MusSettingsKeys::KCapabilityQuery, + MusSettingsKeys::ENoOptions ) ); + } + +TInt CCRepositoryBehaviorTls::Set(TUint32 aKey, TInt aValue) + { + // Setting of any other value + for ( TInt i = 0; i < iKeys.Count(); ++i ) + { + if ( iKeys[i] == aKey ) + { + iValues[i] = aValue; + return KErrNone; + } + } + + // No wise error handling implemented + TInt error = iKeys.Append( aKey ); + if ( error == KErrNone ) + { + error = iValues.Append( aValue ); + } + + return error; + } + +TInt CCRepositoryBehaviorTls::Get(TUint32 aKey, TInt& aValue) + { + for ( TInt i = 0; i < iKeys.Count(); ++i ) + { + if ( iKeys[i] == aKey ) + { + aValue = iValues[i]; + return KErrNone; + } + } + + return KErrNotFound; + } + +CCRepositoryBehaviorTls::CCRepositoryBehaviorTls() + { + } + +CCRepositoryBehaviorTls::~CCRepositoryBehaviorTls() + { + iKeys.Reset(); + iValues.Reset(); + } +*/ + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CRepository* CRepository::NewL( TUid aRepositoryUid ) + { + CRepository* self = CRepository::NewLC( aRepositoryUid ); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CRepository* CRepository::NewLC( TUid aRepositoryUid ) + { + + CRepository* self = new( ELeave ) CRepository( aRepositoryUid ); + CleanupStack::PushL( self ); + + // This UID cannot be used in normal variant + if ( aRepositoryUid == KCRUidSIPClientResolverConfig && + !iEmulateSawfishRepository ) + { + User::Leave( KErrNotFound ); + } + + // Add a few keys + if ( self->iRepositoryUid == KCRUidInCallVolume ) + { + User::LeaveIfError( self->Set ( KTelIncallEarVolume, 4 ) ); + User::LeaveIfError( self->Set ( KTelIncallLoudspeakerVolume, 4 ) ); + } +/* else if ( self->iRepositoryUid == MusSettingsKeys::KRepositoryUid ) + { + // Set default values for numeric values which are not handled by static + // variables + User::LeaveIfError( + self->Set ( MusSettingsKeys::KActivation, + MusSettingsKeys::EAlwaysActive ) ); + User::LeaveIfError( + self->Set ( MusSettingsKeys::KAuditoryNotification, + MusSettingsKeys::EAuditoryNotificationOff ) ); + User::LeaveIfError( + self->Set ( MusSettingsKeys::KPopupNotification, + MusSettingsKeys::EPopupNotificationOff ) ); + User::LeaveIfError( + self->Set ( MusSettingsKeys::KPopupNotificationType, + MusSettingsKeys::ENotificationTypeQueryUser ) ); + User::LeaveIfError( + self->Set ( MusSettingsKeys::KEdgeDtmSupport, + MusSettingsKeys::EDtmModeNotAllowed ) ); + User::LeaveIfError( + self->Set ( MusSettingsKeys::KForceInternetSignaling, + MusSettingsKeys::EFollowProfileConfiguration ) ); + User::LeaveIfError( + self->Set ( MusSettingsKeys::KAutoRecord, + MusSettingsKeys::EAutoRecordOn ) ); + User::LeaveIfError( + self->Set ( MusSettingsKeys::KSipProfileId, + 0 ) ); //default profile + User::LeaveIfError( + self->Set ( MusSettingsKeys::KUiOrientation, + MusSettingsKeys::EPortrait ) ); + User::LeaveIfError( + self->Set ( MusSettingsKeys::KCapabilityQuery, + MusSettingsKeys::ENoOptions ) ); + // No variation keys defined + } + */ + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CRepository::~CRepository() + { +/* iKeys.Reset(); + iValues.Reset(); +*/ } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CRepository::Create(TUint32 /*aKey*/, TInt /*aValue*/ ) + { + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CRepository::Create(TUint32 /*aKey*/, const TDesC8& /*aValue*/) + { + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CRepository::Delete( TUint32 /*aPartialKey*/, + TUint32 /*aMask*/, + TUint32& /*aErrorKey*/ ) + { + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CRepository::Get(TUint32 aKey, TInt& aValue) + { + TInt error = KErrNone; + + if ( iRepositoryUid == MusSettingsKeys::KRepositoryUid && + aKey == MusSettingsKeys::KOperatorVariant ) + { + aValue = CRepository::iOperatorVariant; + return KErrNone; + } + + CSipSseTestTls* repository = CSipSseTestTls::Storage(); + + if ( repository ) + { + error = repository->Get( aKey, aValue ); + } + else + { + error = KErrNotFound; + } + + return error; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CRepository::Get(TUint32 /*aKey*/, TDes8& /*aValue*/) + { + return KErrNotSupported; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CRepository::Set(TUint32 /*aKey*/, const TDesC8& /*aValue*/) + { + return KErrNotSupported; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CRepository::Get(TUint32 /*aKey*/, TDes& aValue) + { + _LIT( KSampleValue, "\\data\\videos\\"); + aValue.Append( KSampleValue() ); + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CRepository::Set(TUint32 /*aKey*/, const TDesC& /*aValue*/) + { + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CRepository::Set(TUint32 aKey, TInt aValue) + { + // Setting of operator variant value + if ( iRepositoryUid == MusSettingsKeys::KRepositoryUid && + aKey == MusSettingsKeys::KOperatorVariant ) + { + CRepository::iOperatorVariant = + ( MusSettingsKeys::TOperatorVariant ) aValue; + return KErrNone; + } +/* + // Setting of any other value + for ( TInt i = 0; i < iKeys.Count(); ++i ) + { + if ( iKeys[i] == aKey ) + { + iValues[i] = aValue; + return KErrNone; + } + } + + // No wise error handling implemented + TInt error = iKeys.Append( aKey ); + if ( error == KErrNone ) + { + error = iValues.Append( aValue ); + } + */ + TInt error = KErrNone; + //CCRepositoryBehaviorTls* repository = CCRepositoryBehaviorTls::Storage(); + CSipSseTestTls* repository = CSipSseTestTls::Storage(); + if ( repository ) + { + error = repository->Set( aKey, aValue ); + } + return error; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CRepository::FindL( TUint32 /*aPartialKey*/, + TUint32 /*aMask*/, + RArray& /*aFoundKeys*/ ) + { + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CRepository::FindEqL( TUint32 /*aPartialKey*/, + TUint32 /*aMask*/, + const TDesC8& /*aValue*/, + RArray& /*aFoundKeys*/ ) + { + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CRepository::StartTransaction( TTransactionMode /*aMode*/ ) + { + return KErrNone; + } + + +/// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CRepository::CommitTransaction(TUint32& /*aKeyInfo*/) + { + return KErrNone; + } + + + +// ------- Functions that are not present in real CRepository but are ---------- +// ------- defined here exclusively for stubbing purposes ---------- + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CRepository::ResetKeysAndValues() + { + CSipSseTestTls* repository = CSipSseTestTls::Storage(); + if ( repository ) + { + repository->Reset(); + } + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CRepository::CRepository( TUid aRepositoryUid ) + :iRepositoryUid( aRepositoryUid ) + { + } + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/csipcontactheaderstub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/csipcontactheaderstub.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,55 @@ +/* +* 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 "musavacapabilitytesthelper.h" + + +CSIPAddress* CSIPContactHeader::SIPAddress() + { + CSIPAddress* ret = iSIPAddress; + + if (HelpFlags::iUseTestSipAddress) + { + ret = HelpFlags::iTestSipAddress; + } + + return ret; + } + +RPointerArray CSIPContactHeader::DecodeL(const TDesC8& aValue) + { + RPointerArray headers; + if ( !HelpFlags::iEmptyContactHeader ) + { + CleanupClosePushL(headers); + + CSIPAddress* address = CSIPAddress::DecodeL( aValue ); + + CleanupStack::PushL( address ); + CSIPContactHeader* contactHeader = CSIPContactHeader::NewL( address ); + CleanupStack::Pop( address ); + + CleanupStack::PushL( contactHeader ); + headers.AppendL( contactHeader ); + CleanupStack::Pop(contactHeader); + + CleanupStack::Pop(); //headers + } + return headers; + } + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/csipserverstub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/csipserverstub.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,79 @@ +/* +* Copyright (c) 2005-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: SIP Server Stub +* +*/ + + +#include "CSIPServerStub.h" +#include +#include +#include +#include +#include + + +void CSIPServerStub::OpenL () + { + CSIPServerStub* self = new (ELeave) CSIPServerStub(); + self->Reset(); + Dll::SetTls( self ); + } + +void CSIPServerStub::Close () + { + CSIPServerStub* self = Server(); + delete self; + Dll::SetTls( NULL ); + } + + +CSIPServerStub* CSIPServerStub::Server() + { + return static_cast(Dll::Tls()); + } + + +void CSIPServerStub::ClientRequest( CSIPRequestElements* aRequest ) + { + delete iClientRequest; + iClientRequest = aRequest; + } + +void CSIPServerStub::ClientResponse( RStringF aMethod, CSIPResponseElements* aResponse ) + { + iResponseToRequest = aMethod; + delete iClientResponse; + iClientResponse = aResponse; + } + + +void CSIPServerStub::Reset() + { + ClientRequest( NULL ); + ClientResponse( SIPStrings::StringF( SipStrConsts::EEmpty ), NULL ); + } + + +CSIPServerStub::~CSIPServerStub() + { + + delete iClientRequest; + delete iClientResponse; + + } + + + +//end of file \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/mm_phone.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/mm_phone.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,2012 @@ +/* +* Copyright (c) 2000 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 + +// Multimode header files +#include "etelmm.h" +//#include + +#include "CSipSseTestTls.h" +#include "musunittesting.h" +//#include "mm_hold.h" + +/*GLDEF_C TInt E32Dll(TDllReason) +// +// DLL entry point +// + { + return KErrNone; + } +*/ +/************************************************************************/ +// +// TMobileAddress +// +/************************************************************************/ + +EXPORT_C RMobilePhone::TMobileAddress::TMobileAddress() + : iTypeOfNumber(EUnknownNumber), + iNumberPlan(EUnknownNumberingPlan) + { + } + +void RMobilePhone::TMobileAddress::InternalizeL(RReadStream& aStream) +/** + * This method internalizes the mobile address from a stream + * + * \param aStream The read stream containing the mobile address + */ + { + iTypeOfNumber=STATIC_CAST(TMobileTON, aStream.ReadUint32L()); + iNumberPlan=STATIC_CAST(TMobileNPI, aStream.ReadUint32L()); + aStream >> iTelNumber; + } + +void RMobilePhone::TMobileAddress::ExternalizeL(RWriteStream& aStream) const +/** + * This method externalizes the mobile address into a stream + * + * \param aStream The write stream that will contain the mobile address + */ + { + aStream.WriteUint32L(iTypeOfNumber); + aStream.WriteUint32L(iNumberPlan); + aStream << iTelNumber; + } + + +/************************************************************************/ +// +// RMobilePhone +// +/************************************************************************/ + +EXPORT_C RMobilePhone::RMobilePhone() + : iMmPtrHolder(NULL) + { + } + +EXPORT_C void RMobilePhone::ConstructL() + { + RPhone::ConstructL(); +// __ASSERT_ALWAYS(iMmPtrHolder==NULL,PanicClient(EEtelPanicHandleNotClosed)); +// iMmPtrHolder = CMobilePhonePtrHolder::NewL(CMobilePhonePtrHolder::EMaxNumberPhonePtrSlots,CMobilePhonePtrHolder::EMaxNumberPhonePtrCSlots); + } + +EXPORT_C void RMobilePhone::Destruct() + { + RPhone::Destruct(); +// delete iMmPtrHolder; +// iMmPtrHolder = NULL; + } + +/************************************************************************/ +// +// TMultimodeType +// +/************************************************************************/ + +RMobilePhone::TMultimodeType::TMultimodeType() + {} + +EXPORT_C TInt RMobilePhone::TMultimodeType::ExtensionId() const +/** + * This method returns the multimode API extension number of the class + * + * \return TInt An integer that will indicate the version of the type + */ + { + return iExtensionId; + } + +void RMobilePhone::TMultimodeType::InternalizeL(RReadStream& aStream) +/** + * This method internalizes the multimode type from a stream + * + * \param aStream The read stream containing the multimode type + */ + { + iExtensionId=aStream.ReadInt32L(); + } + +void RMobilePhone::TMultimodeType::ExternalizeL(RWriteStream& aStream) const +/** + * This method externalizes the multimode type into a stream + * + * \param aStream The write stream that will contain the multimode type + */ + { + aStream.WriteInt32L(iExtensionId); + } + + +/***********************************************************************************/ +// +// MobilePhoneCapability functional unit +// +/***********************************************************************************/ + +EXPORT_C TInt RMobilePhone::GetMultimodeAPIVersion(TInt& aVersion) const +/** + * This method returns the current version of the multimode ETel API + * + * \param aVersion Will contain the current version of the multimode ETel API + * \return KErrNone + */ + { + aVersion=KETelExtMultimodeV1; + return KErrNone; + } + +EXPORT_C TInt RMobilePhone::GetMultimodeCaps(TUint32& aCaps) const +/** + * This method returns the multimode capabilities of the phone + * + * \retval aCaps An integer that will contain the bit-wise sum of the multimode capabilities + * \return KErrNone + */ + { + TPckg ptr1(aCaps); + return Get(EMobilePhoneGetMultimodeCaps, ptr1); + } + +EXPORT_C void RMobilePhone::GetPhoneStoreInfo(TRequestStatus& aReqStatus, TDes8& aInfo, const TDesC& aStoreName) const +/** + * This method returns the information related to a particular phone store + * + * \param aStoreName Specifies the name of the store, for which information is required + * \retval aInfo A descriptor that will contain the phone store information + */ + { + SetAndGet(EMobilePhoneGetPhoneStoreInfo,aReqStatus, aInfo, aStoreName); + } + +/***********************************************************************************/ +// +// MobilePhoneSimAccess functional unit +// +/***********************************************************************************/ + +EXPORT_C TInt RMobilePhone::GetIccAccessCaps(TUint32& aCaps) const +/** + * This method returns the ICC (Integrated circuit card) access capabilities of the phone + * + * \retval aCaps An integer that will contain the bit-wise sum of the ICC access capabilities + * \return KErrNone + * \exception KErrNotSupported if ICC access is never supported + */ + { + TPckg ptr1(aCaps); + return Get(EMobilePhoneGetIccAccessCaps, ptr1); + } + +EXPORT_C void RMobilePhone::NotifyIccAccessCapsChange(TRequestStatus& aReqStatus, TUint32& aCaps) const +/** + * This notification completes if the ICC access capabilities of the phone change + * + * \retval aCaps An integer that will contain the new ICC access capabilities + */ + { +/* __ASSERT_ALWAYS(iMmPtrHolder!=NULL,PanicClient(EEtelPanicNullHandle)); + + TPtr8& ptr1=iMmPtrHolder->Set(CMobilePhonePtrHolder::ESlot1NotifyIccAccessCapsChange,aCaps); + + Get(EMobilePhoneNotifyIccAccessCapsChange,aReqStatus,ptr1);*/ + } + +EXPORT_C RMobilePhone::TMobilePhoneCspFileV1::TMobilePhoneCspFileV1() + : iCallOfferingServices(0),iCallRestrictionServices(0),iOtherSuppServices(0), + iCallCompletionServices(0),iTeleservices(0),iCphsTeleservices(0),iCphsFeatures(0), + iNumberIdentServices(0),iPhase2PlusServices(0),iValueAddedServices(0) + { + iExtensionId=KETelExtMultimodeV1; + } + +EXPORT_C void RMobilePhone::GetCustomerServiceProfile(TRequestStatus& aReqStatus, TDes8& aCsp) const +/** + * This method returns the Customer Service Profile (CSP) stored on the SIM + * + * \retval aCsp A descriptor that will contain the CSP information + */ + { +// Get(EMobilePhoneGetCustomerServiceProfile, aReqStatus, aCsp); + } + +EXPORT_C RMobilePhone::TMobilePhoneServiceTableV1::TMobilePhoneServiceTableV1() + : iServices1To8(0),iServices9To16(0),iServices17To24(0),iServices25To32(0), + iServices33To40(0) + { + iExtensionId=KETelExtMultimodeV1; + } + +EXPORT_C void RMobilePhone::GetServiceTable(TRequestStatus& aReqStatus, TMobilePhoneServiceTable aTable, TDes8& aSst) const +/** + * This method returns the Service Table (SIM or CDMA) stored on the ICC + * + * \param aTable Specifies whether the SIM or CDMA service table is to be retrieved + * \retval aTable A descriptor that will contain the service table information + */ + { +/* __ASSERT_ALWAYS(iMmPtrHolder!=NULL,PanicClient(EEtelPanicNullHandle)); + + iMmPtrHolder->iServiceTable = aTable; + TPtrC8& ptr1=iMmPtrHolder->SetC(CMobilePhonePtrHolder::ESlot1GetServiceTable, iMmPtrHolder->iServiceTable); + + SetAndGet(EMobilePhoneGetServiceTable, aReqStatus, ptr1, aSst);*/ + } + +/***********************************************************************************/ +// +// MobilePhonePower functional unit +// +/***********************************************************************************/ + +EXPORT_C TInt RMobilePhone::GetBatteryCaps(TUint32& aCaps) const +/** + * This method returns the battery capabilities of the phone + * + * \retval aCaps An integer that will contain the bit-wise sum of the battery capabilities + * \return KErrNone + * \exception KErrNotSupported if battery information is not supported + */ + { +// TPckg ptr1(aCaps); +// return Get(EMobilePhoneGetBatteryCaps, ptr1); + return 0; + } + +EXPORT_C RMobilePhone::TMobilePhoneBatteryInfoV1::TMobilePhoneBatteryInfoV1() : + iStatus(EPowerStatusUnknown), iChargeLevel(0) + { + iExtensionId=KETelExtMultimodeV1; + } + +EXPORT_C void RMobilePhone::GetBatteryInfo(TRequestStatus& aReqStatus, TMobilePhoneBatteryInfoV1& aInfo) const +/** + * This method returns the current battery information of the phone + * + * \retval aInfo Will contain the battery information + */ + { + /*__ASSERT_ALWAYS(iMmPtrHolder!=NULL,PanicClient(EEtelPanicNullHandle)); + + TPtr8& ptr1=iMmPtrHolder->Set(CMobilePhonePtrHolder::ESlot1GetBatteryInfo,aInfo); + + Get(EMobilePhoneGetBatteryInfo,aReqStatus,ptr1);*/ + } + +EXPORT_C void RMobilePhone::NotifyBatteryInfoChange(TRequestStatus& aReqStatus, TMobilePhoneBatteryInfoV1& aInfo) const +/** + * This notification completes if the battery information changes + * + * \retval aInfo Will contain the new battery information + */ + { + /*__ASSERT_ALWAYS(iMmPtrHolder!=NULL,PanicClient(EEtelPanicNullHandle)); + + TPtr8& ptr1=iMmPtrHolder->Set(CMobilePhonePtrHolder::ESlot1NotifyBatteryInfoChange,aInfo); + + Get(EMobilePhoneNotifyBatteryInfoChange,aReqStatus,ptr1);*/ + } + +/***********************************************************************************/ +// +// MobilePhoneSignal functional unit +// +/***********************************************************************************/ + +EXPORT_C TInt RMobilePhone::GetSignalCaps(TUint32& aCaps) const +/** + * This method returns the signal strength capabilities of the phone + * + * \retval aCaps An integer that will contain the bit-wise sum of the signal strength capabilities + * \return KErrNone + * \exception KErrNotSupported if signal strength information is not supported + */ + { +// TPckg ptr1(aCaps); +// return Get(EMobilePhoneGetSignalCaps, ptr1); + return 0; + } + +EXPORT_C void RMobilePhone::GetSignalStrength(TRequestStatus& aReqStatus, TInt32& aSignalStrength, TInt8& aBar) const +/** + * This method returns the current signal strength of the phone + * + * \retval aSignalStrength Will contain the signal strength, expressed in dBm + * \retval aBar Will contain the number of bars of signal strength to display + */ + { +/* __ASSERT_ALWAYS(iMmPtrHolder!=NULL,PanicClient(EEtelPanicNullHandle)); + + TPtr8& ptr1=iMmPtrHolder->Set(CMobilePhonePtrHolder::ESlot1GetSignalStrength,aSignalStrength); + TPtr8& ptr2=iMmPtrHolder->Set(CMobilePhonePtrHolder::ESlot2GetSignalStrength,aBar); + + Get(EMobilePhoneGetSignalStrength,aReqStatus,ptr1,ptr2);*/ + } + +EXPORT_C void RMobilePhone::NotifySignalStrengthChange(TRequestStatus& aReqStatus, TInt32& aSignalStrength, TInt8& aBar) const +/** + * This notification completes if the signal strength of the phone changes + * + * \retval aSignalStrength Will contain the new signal strength, expressed in dBm + * \retval aBar Will contain the new number of bars of signal strength to display + */ + { +/* __ASSERT_ALWAYS(iMmPtrHolder!=NULL,PanicClient(EEtelPanicNullHandle)); + + TPtr8& ptr1=iMmPtrHolder->Set(CMobilePhonePtrHolder::ESlot1NotifySignalStrengthChange,aSignalStrength); + TPtr8& ptr2=iMmPtrHolder->Set(CMobilePhonePtrHolder::ESlot2NotifySignalStrengthChange,aBar); + + Get(EMobilePhoneNotifySignalStrengthChange, aReqStatus, ptr1, ptr2);*/ + } + +/***********************************************************************************/ +// +// MobilePhoneIndicator functional unit +// +/***********************************************************************************/ + +EXPORT_C TInt RMobilePhone::GetIndicatorCaps(TUint32& aActionCaps, TUint32& aIndCaps) const +/** + * This method returns the indicator capabilities of the phone + * + * \retval aActionCaps An integer that will contain the bit-wise sum of TMobilePhoneIndicatorCaps flags + * \retval aIndCaps An integer that will contain the bit-wise sum of supported TMobilePhoneIndicators flags + * \return KErrNone + * \exception KErrNotSupported if indicators are not supported + */ + { + /*TPckg ptr1(aActionCaps); + TPckg ptr2(aIndCaps); + return Get(EMobilePhoneGetIndicatorCaps, ptr1, ptr2);*/ + return 0; + } + +EXPORT_C void RMobilePhone::GetIndicator(TRequestStatus& aReqStatus, TUint32& aIndicator) const +/** + * This method returns the current value of the supported indicators from the phone + * + * \retval aIndicator Will contain bit-wise sum of the current values of each indicator + * \exception KErrNotSupported if indicators are not supported + */ + { + /*__ASSERT_ALWAYS(iMmPtrHolder!=NULL,PanicClient(EEtelPanicNullHandle)); + + TPtr8& ptr1=iMmPtrHolder->Set(CMobilePhonePtrHolder::ESlot1GetIndicator,aIndicator); + + Get(EMobilePhoneGetIndicator,aReqStatus,ptr1);*/ + } + +EXPORT_C void RMobilePhone::NotifyIndicatorChange(TRequestStatus& aReqStatus, TUint32& aIndicator) const +/** + * This notification completes if any of the supported indicators change state + * + * \retval aIndicator Will contain bit-wise sum of the new values of each indicator + * \exception KErrNotSupported if indicators are not supported + */ + { + /*__ASSERT_ALWAYS(iMmPtrHolder!=NULL,PanicClient(EEtelPanicNullHandle)); + + TPtr8& ptr1=iMmPtrHolder->Set(CMobilePhonePtrHolder::ESlot1NotifyIndicatorChange,aIndicator); + + Get(EMobilePhoneNotifyIndicatorChange, aReqStatus, ptr1);*/ + } + +/***********************************************************************************/ +// +// MobilePhoneIdentity functional unit +// +/***********************************************************************************/ + +EXPORT_C TInt RMobilePhone::GetIdentityCaps(TUint32& aCaps) const +/** + * This method returns the identity capabilities of the phone + * + * \retval aCaps An integer that will contain the bit-wise sum of the identity capabilities + * \return KErrNone + * \exception KErrNotSupported if phone and subscriber identity information is not supported + */ + { +// TPckg ptr1(aCaps); +// return Get(EMobilePhoneGetIdentityCaps, ptr1); + return 0; + } + +EXPORT_C RMobilePhone::TMobilePhoneIdentityV1::TMobilePhoneIdentityV1() + { + iExtensionId=KETelExtMultimodeV1; + } + +EXPORT_C void RMobilePhone::GetPhoneId(TRequestStatus& aReqStatus, TMobilePhoneIdentityV1& aId) const +/** + * This method returns the identity of the phone + * + * \retval aId Will contain the identity, which can consist of manufacturer, model, revision and serial numbers + */ + { +/* __ASSERT_ALWAYS(iMmPtrHolder!=NULL,PanicClient(EEtelPanicNullHandle)); + + TPtr8& ptr1=iMmPtrHolder->Set(CMobilePhonePtrHolder::ESlot1GetPhoneId,aId); + + Get(EMobilePhoneGetPhoneId, aReqStatus, ptr1);*/ + } + +EXPORT_C void RMobilePhone::GetSubscriberId(TRequestStatus& aReqStatus, TMobilePhoneSubscriberId& aId) const +/** + * This method returns the identity of the subscriber (IMSI) + * + * \retval aId Will contain the identity + */ + { +/* __ASSERT_ALWAYS(iMmPtrHolder!=NULL,PanicClient(EEtelPanicNullHandle)); + + TPtr8& ptr1=iMmPtrHolder->Set(CMobilePhonePtrHolder::ESlot1GetSubscriberId,aId); + + Get(EMobilePhoneGetSubscriberId, aReqStatus, ptr1);*/ + } + +/***********************************************************************************/ +// +// MobilePhoneDTMF functional unit +// +/***********************************************************************************/ + +EXPORT_C TInt RMobilePhone::GetDTMFCaps(TUint32& aCaps) const +/** + * This method returns the DTMF capabilities of the phone + * + * \retval aCaps An integer that will contain the bit-wise sum of the DTMF capabilities + * \return KErrNone + * \exception KErrNotSupported if DTMF is not supported + */ + { +// TPckg ptr1(aCaps); +// return Get(EMobilePhoneGetDTMFCaps, ptr1); + return 0; + } + +EXPORT_C void RMobilePhone::NotifyDTMFCapsChange(TRequestStatus& aReqStatus, TUint32& aCaps) const +/** + * This notification completes if the DTMF capabilities of the phone change + * + * \retval aCaps An integer that will contain the new DTMF capabilities + */ + { +/* __ASSERT_ALWAYS(iMmPtrHolder!=NULL,PanicClient(EEtelPanicNullHandle)); + + TPtr8& ptr1=iMmPtrHolder->Set(CMobilePhonePtrHolder::ESlot1NotifyDTMFCapsChange, aCaps); + + Get(EMobilePhoneNotifyDTMFCapsChange, aReqStatus, ptr1);*/ + } + +EXPORT_C void RMobilePhone::SendDTMFTones(TRequestStatus& aReqStatus, const TDesC& aTones) const +/** + * This method sends a series of DTMF tones across a connected and active voice call + * + * \param aTones Supplies the tones to send + */ + { +// Set(EMobilePhoneSendDTMFTones, aReqStatus, aTones); + } + +EXPORT_C TInt RMobilePhone::StartDTMFTone(TChar aTone) const +/** + * This method starts the transmission of a single DTMF tone across a connected and active voice call + * + * \param aTone Supplies the tone to send + */ + { + /*TPckgC ptr1(aTone); + return Set(EMobilePhoneStartDTMFTone,ptr1);*/ + } + +EXPORT_C TInt RMobilePhone::StopDTMFTone() const +/** + * This method stops the transmission of a single DTMF tone across a connected and active voice call + */ + { +// return Blank(EMobilePhoneStopDTMFTone); + return 0; + } + +EXPORT_C void RMobilePhone::NotifyStopInDTMFString(TRequestStatus& aRequestStatus) const +/** + * This notification completes if a stop character is found within a DTMF string + */ + { + //Blank(EMobilePhoneNotifyStopInDTMFString,aRequestStatus); + } + +EXPORT_C TInt RMobilePhone::ContinueDTMFStringSending(TBool aContinue) const +/** + * This method either continues or cancels the sending of a string of DTMF tones + * It assumes that a stop character has previously been found within the string + * + * \param aContinue A boolean that specifies whether the sending will continue or stop + */ + { + /*TPckg ptr1(aContinue); + return Set(EMobilePhoneContinueDTMFStringSending,ptr1);*/ + } + +/***********************************************************************************/ +// +// MobilePhoneNetwork functional unit +// +/***********************************************************************************/ + +EXPORT_C RMobilePhone::TMobilePhoneNetworkInfoV1::TMobilePhoneNetworkInfoV1() +: iMode(ENetworkModeUnknown), + iStatus(ENetworkStatusUnknown), + iBandInfo(EBandUnknown) + { + iExtensionId=KETelExtMultimodeV1; + } + +void RMobilePhone::TMobilePhoneNetworkInfoV1::InternalizeL(RReadStream& aStream) +/** + * This method internalizes the mobile network information from a stream + * + * \param aStream The read stream containing the mobile network information + */ + { +/* TMultimodeType::InternalizeL(aStream); + iMode=STATIC_CAST(TMobilePhoneNetworkMode, aStream.ReadUint32L()); + iStatus=STATIC_CAST(TMobilePhoneNetworkStatus, aStream.ReadUint32L()); + iBandInfo=STATIC_CAST(TMobilePhoneNetworkBandInfo, aStream.ReadUint32L()); + aStream >> iCountryCode; + aStream >> iCdmaSID; + aStream >> iAnalogSID; + aStream >> iNetworkId; + aStream >> iDisplayTag; + aStream >> iShortName; + aStream >> iLongName;*/ + } + +void RMobilePhone::TMobilePhoneNetworkInfoV1::ExternalizeL(RWriteStream& aStream) const +/** + * This method externalizes the mobile network information into a stream + * + * \param aStream The write stream that will contain the mobile network information + */ + { +/* TMultimodeType::ExternalizeL(aStream); + aStream.WriteUint32L(iMode); + aStream.WriteUint32L(iStatus); + aStream.WriteUint32L(iBandInfo); + aStream << iCountryCode; + aStream << iCdmaSID; + aStream << iAnalogSID; + aStream << iNetworkId; + aStream << iDisplayTag; + aStream << iShortName; + aStream << iLongName;*/ + } + +EXPORT_C TInt RMobilePhone::GetNetworkCaps(TUint32& aCaps) const +/** + * This method returns the network capabilities of the phone + * + * \retval aCaps An integer that will contain the bit-wise sum of the network capabilities + * \return KErrNone + * \exception KErrNotSupported if network access/information is not supported + */ + { + /*TPckg ptr1(aCaps); + return Get(EMobilePhoneGetNetworkCaps, ptr1);*/ + return 0; + } + +EXPORT_C TInt RMobilePhone::GetCurrentMode(TMobilePhoneNetworkMode& aNetworkMode) const +/** + * This method returns the current mode of the phone + * + * \retval aNetworkMode Will contain the mode (GSM, WCDMA, CDMA, TDMA, AMPS) + */ + { + TInt err = 0; + CSipSseTestTls* tls = CSipSseTestTls::Storage(); + if ( tls ) + { + aNetworkMode = tls->PhoneNetworkModeStatus(); + err = tls->Error(); + } + + return err; + } + +EXPORT_C void RMobilePhone::NotifyModeChange(TRequestStatus& aReqStatus, TMobilePhoneNetworkMode& aNetworkMode) const +/** + * This notification completes if the mode of the phone changes + * + * \retval aNetworkMode Will contain the new mode (GSM, WCDMA, CDMA, TDMA, AMPS) + */ + { +/* __ASSERT_ALWAYS(iMmPtrHolder!=NULL,PanicClient(EEtelPanicNullHandle)); + + TPtr8& ptr1=iMmPtrHolder->Set(CMobilePhonePtrHolder::ESlot1NotifyModeChange, aNetworkMode); + + Get(EMobilePhoneNotifyModeChange,aReqStatus, ptr1);*/ + iReqStatus = &aReqStatus; + iNetworkMode = &aNetworkMode; + } + +void RMobilePhone::DoNotifyModeChange( TMobilePhoneNetworkMode aNetworkMode, TInt aErrorCode ) + { + *iNetworkMode = aNetworkMode; + *iReqStatus = KRequestPending; + TRequestStatus* stat = iReqStatus; + User::RequestComplete( stat, aErrorCode ); + + } + +void RMobilePhone::CancelAsyncRequest(TInt aReqToCancel) const + { + *iReqStatus = KRequestPending; + TRequestStatus* stat = iReqStatus; + User::RequestComplete( stat, KErrNone ); + } + + +EXPORT_C void RMobilePhone::GetHomeNetwork(TRequestStatus& aReqStatus, TDes8& aNetworkInfo) const +/** + * This method returns information on the subscriber's home network + * + * \retval aNetworkInfo Will contain the home network information + */ + { + //Get(EMobilePhoneGetHomeNetwork, aReqStatus, aNetworkInfo); + } + +EXPORT_C RMobilePhone::TMobilePhoneLocationAreaV1::TMobilePhoneLocationAreaV1() +: iAreaKnown(EFalse), iLocationAreaCode(0), iCellId(0) + { + iExtensionId=KETelExtMultimodeV1; + } + +EXPORT_C void RMobilePhone::GetCurrentNetwork(TRequestStatus& aReqStatus, TDes8& aNetworkInfo, TMobilePhoneLocationAreaV1& aArea) const +/** + * This method returns information on the phone's current serving network + * + * \retval aNetworkInfo Will contain the information related to the current network + * \retval aArea Will contain the phone's current location area + */ + { + /*__ASSERT_ALWAYS(iMmPtrHolder!=NULL,PanicClient(EEtelPanicNullHandle)); + + TPtr8& ptr2=iMmPtrHolder->Set(CMobilePhonePtrHolder::ESlot1GetCurrentNetwork, aArea); + + Get(EMobilePhoneGetCurrentNetwork, aReqStatus, aNetworkInfo, ptr2);*/ + } + +EXPORT_C void RMobilePhone::NotifyCurrentNetworkChange(TRequestStatus& aReqStatus, TDes8& aNetworkInfo, TMobilePhoneLocationAreaV1& aArea) const +/** + * This notification completes if the serving network of the phone changes + * + * \retval aNetworkInfo Will contain the information related to the new network + * \retval aArea Will contain the phone's new location area + */ + { + /*__ASSERT_ALWAYS(iMmPtrHolder!=NULL,PanicClient(EEtelPanicNullHandle)); + + TPtr8& ptr2=iMmPtrHolder->Set(CMobilePhonePtrHolder::ESlot1NotifyCurrentNetworkChange, aArea); + + Get(EMobilePhoneNotifyCurrentNetworkChange, aReqStatus, aNetworkInfo, ptr2);*/ + } + +EXPORT_C void RMobilePhone::GetNetworkRegistrationStatus(TRequestStatus& aReqStatus, TMobilePhoneRegistrationStatus& aStatus) const +/** + * This method returns the phone's current network registration status + * + * \retval aStatus Will contain the network registration status + */ + { + CSipSseTestTls* tls = CSipSseTestTls::Storage(); + if ( tls ) + { + tls->RegistrationStatus( aStatus ); + } + + /*__ASSERT_ALWAYS(iMmPtrHolder!=NULL,PanicClient(EEtelPanicNullHandle)); + + TPtr8& ptr1=iMmPtrHolder->Set(CMobilePhonePtrHolder::ESlot1GetNetworkRegistrationStatus, aStatus); + + Get(EMobilePhoneGetNetworkRegistrationStatus, aReqStatus, ptr1);*/ + } + +EXPORT_C void RMobilePhone::NotifyNetworkRegistrationStatusChange(TRequestStatus& aReqStatus, TMobilePhoneRegistrationStatus& aStatus) const +/** + * This notification completes if the network registration status of the phone changes + * + * \retval aStatus Will contain the new network registration status + */ + { + /*__ASSERT_ALWAYS(iMmPtrHolder!=NULL,PanicClient(EEtelPanicNullHandle)); + + TPtr8& ptr1=iMmPtrHolder->Set(CMobilePhonePtrHolder::ESlot1NotifyNetworkRegistrationStatusChange, aStatus); + + Get(EMobilePhoneNotifyNetworkRegistrationStatusChange, aReqStatus, ptr1);*/ + CSipSseTestTls* tls = CSipSseTestTls::Storage(); + if ( tls ) + { + tls->SetRegistrationStatus( &aStatus ); + tls->SetRequestStatus( aReqStatus ); + } + } + +EXPORT_C RMobilePhone::TMobilePhoneNetworkSelectionV1::TMobilePhoneNetworkSelectionV1() + : iMethod(ENetworkSelectionUnknown), + iBandClass(ENetworkBandClassUnknown), + iOperationMode(ENetworkOperationUnknown) + { + iExtensionId=KETelExtMultimodeV1; + } + +EXPORT_C TInt RMobilePhone::GetNetworkSelectionSetting(TDes8& aSetting) const +/** + * This method returns the phone's current network selection setting + * + * \retval aSetting Will contain the network selection setting + */ + { + //return Get(EMobilePhoneGetNetworkSelectionSetting, aSetting); + return 0; + } + +EXPORT_C void RMobilePhone::SetNetworkSelectionSetting(TRequestStatus& aReqStatus, const TDes8& aSetting) const +/** + * This method sets a new value for the phone's network selection setting + * + * \param aSetting Supplies the new network selection setting + */ + { + //Set(EMobilePhoneSetNetworkSelectionSetting,aReqStatus,aSetting); + } + +EXPORT_C void RMobilePhone::NotifyNetworkSelectionSettingChange(TRequestStatus& aReqStatus, TDes8& aSetting) const +/** + * This notification completes if the network selection setting of the phone changes + * + * \retval aSetting Will contain the new setting + */ + { + //Get(EMobilePhoneNotifyNetworkSelectionSettingChange, aReqStatus, aSetting); + } + +EXPORT_C void RMobilePhone::SelectNetwork(TRequestStatus& aReqStatus, TBool aIsManual, const TMobilePhoneNetworkManualSelection& aManualSelection) const +/** + * This method instructs the phone to initiate network selection + * + * \param aIsManual Specifies whether phone should manual or automatic network selection method + * \param aManualSelection If aIsManual=ETrue, then this parameter contain the user's manually selected network + */ + { + /*__ASSERT_ALWAYS(iMmPtrHolder!=NULL,PanicClient(EEtelPanicNullHandle)); + + iMmPtrHolder->iIsManual = aIsManual; + TPtrC8& ptr1=iMmPtrHolder->SetC(CMobilePhonePtrHolder::ESlot1SelectNetwork, iMmPtrHolder->iIsManual); + TPtrC8& ptr2=iMmPtrHolder->SetC(CMobilePhonePtrHolder::ESlot2SelectNetwork, aManualSelection); + + Set(EMobilePhoneSelectNetwork,aReqStatus, ptr1, ptr2);*/ + } + +EXPORT_C RMobilePhone::TMobilePhoneNITZ::TMobilePhoneNITZ() + : iNitzFieldsUsed(0), iTimeZone(0), iDST(0) + { + } + +EXPORT_C RMobilePhone::TMobilePhoneNITZ::TMobilePhoneNITZ(TInt aYear, TMonth aMonth, TInt aDay, TInt aHour, TInt aMinute, TInt aSecond, TInt aMicroSecond) + : TDateTime(aYear,aMonth,aDay,aHour,aMinute,aSecond,aMicroSecond), iNitzFieldsUsed(0), iTimeZone(0), iDST(0) + { + } + +EXPORT_C TInt RMobilePhone::GetNITZInfo(TMobilePhoneNITZ& aNITZInfo) const +/** + * This method returns the current snapshot of network time & date information + * + * \retval aNITZInfo Will contain the time & date information + */ + { + TPckg ptr1(aNITZInfo); + return Get(EMobilePhoneGetNITZInfo,ptr1); + } + +EXPORT_C void RMobilePhone::NotifyNITZInfoChange(TRequestStatus& aReqStatus, TMobilePhoneNITZ& aNITZInfo) const +/** + * This notification completes if the time & date information sent by the network changes + * + * \retval aNITZInfo Will contain the new time & date information + */ + { + /*__ASSERT_ALWAYS(iMmPtrHolder!=NULL,PanicClient(EEtelPanicNullHandle)); + + TPtr8& ptr1 = iMmPtrHolder->Set(CMobilePhonePtrHolder::ESlot1NotifyNITZInfoChange,aNITZInfo); + Get(EMobilePhoneNotifyNITZInfoChange,aReqStatus,ptr1);*/ + } + +/***********************************************************************************/ +// +// MobilePrivacy functional unit +// +/***********************************************************************************/ + +EXPORT_C TInt RMobilePhone::GetDefaultPrivacy(TMobilePhonePrivacy& aSetting) const +/** + * This method returns the phone's default voice privacy setting in CDMA mode + * + * \retval aSetting An enum that will contain the current privacy setting + * \return KErrNone + * \exception KErrNotSupported if user network access is not supported + */ + { + //TPckg ptr1(aSetting); + //return Get(EMobilePhoneGetDefaultPrivacy, ptr1); + return 0; + } + +EXPORT_C void RMobilePhone::SetDefaultPrivacy(TRequestStatus& aReqStatus, TMobilePhonePrivacy aSetting) const +/** + * This method sets the phone's default voice privacy setting in CDMA mode + * + * \param aSetting Supplies the new voice privacy setting + */ + { + /*__ASSERT_ALWAYS(iMmPtrHolder!=NULL,PanicClient(EEtelPanicNullHandle)); + + iMmPtrHolder->iPrivacySetting = aSetting; + TPtrC8& ptr1=iMmPtrHolder->SetC(CMobilePhonePtrHolder::ESlot1SetDefaultPrivacy,iMmPtrHolder->iPrivacySetting); + + Set(EMobilePhoneSetDefaultPrivacy,aReqStatus, ptr1);*/ + } + +EXPORT_C void RMobilePhone::NotifyDefaultPrivacyChange(TRequestStatus& aReqStatus, TMobilePhonePrivacy& aSetting) const +/** + * This notification completes if the default voice privacy setting of the phone changes + * + * \retval aSetting An enum that will contain the new privacy setting + */ + { + /*__ASSERT_ALWAYS(iMmPtrHolder!=NULL,PanicClient(EEtelPanicNullHandle)); + + TPtr8& ptr1=iMmPtrHolder->Set(CMobilePhonePtrHolder::ESlot1NotifyDefaultPrivacyChange, aSetting); + + Get(EMobilePhoneNotifyDefaultPrivacyChange, aReqStatus, ptr1);*/ + } + +/***********************************************************************************/ +// +// TSY Capabilities for supplementary call services +// +/***********************************************************************************/ + +EXPORT_C TInt RMobilePhone::GetCallServiceCaps(TUint32& aCaps) const +/** + * This method returns the supplementary call service capabilities of the phone + * + * \retval aCaps An integer that will contain the bit-wise sum of the call service caps + * \return KErrNone + * \exception KErrNotSupported if user network access is not supported + */ + { + //TPckg ptr1(aCaps); + //return Get(EMobilePhoneGetCallServiceCaps, ptr1); + return 0; + } + +EXPORT_C void RMobilePhone::NotifyCallServiceCapsChange(TRequestStatus& aReqStatus, TUint32& aCaps) const +/** + * This notification completes if the call service capabilities of the phone change + * + * \retval aCaps An integer that will contain the new call service capabilities + */ + { + /*__ASSERT_ALWAYS(iMmPtrHolder!=NULL,PanicClient(EEtelPanicNullHandle)); + + TPtr8& ptr1=iMmPtrHolder->Set(CMobilePhonePtrHolder::ESlot1NotifyCallServiceCapsChange, aCaps); + + Get(EMobilePhoneNotifyCallServiceCapsChange, aReqStatus, ptr1);*/ + } + +/***********************************************************************************/ +// +// MobilePhoneUserNetworkAccess functional unit +// +/***********************************************************************************/ + +EXPORT_C void RMobilePhone::ProgramFeatureCode(TRequestStatus& aReqStatus, const TDesC& aFCString, TMobilePhoneNetworkService aService, TMobilePhoneServiceAction aAction) const +/** + * This method programs a feature code string against a network service action + * + * \param aFCString Supplies the feature code string to be programmed + * \param aService Specifies which service is applicable to the feature code string + * \param aAction Specifies which action is applicable to the feature code string + */ + { + /*__ASSERT_ALWAYS(iMmPtrHolder!=NULL,PanicClient(EEtelPanicNullHandle)); + + iMmPtrHolder->iProgramFeatureCode.iService = aService; + iMmPtrHolder->iProgramFeatureCode.iAction = aAction; + TPtrC8& ptr1=iMmPtrHolder->SetC(CMobilePhonePtrHolder::ESlot1ProgramFeatureCode,iMmPtrHolder->iProgramFeatureCode); + + Set(EMobilePhoneProgramFeatureCode,aReqStatus, ptr1, aFCString);*/ + } + +EXPORT_C void RMobilePhone::GetFeatureCode(TRequestStatus& aReqStatus, TDes& aFCString, TMobilePhoneNetworkService aService, TMobilePhoneServiceAction aAction) const +/** + * This method returns the feature code string programmed against a network service action + * + * \param aService Specifies which service is applicable to the feature code string + * \param aAction Specifies which action is applicable to the feature code string + * \retval aFCString Will contain the feature code string programmed + */ + { + /*__ASSERT_ALWAYS(iMmPtrHolder!=NULL,PanicClient(EEtelPanicNullHandle)); + + iMmPtrHolder->iGetFeatureCode.iService = aService; + iMmPtrHolder->iGetFeatureCode.iAction = aAction; + TPtr8& ptr1=iMmPtrHolder->Set(CMobilePhonePtrHolder::ESlot1GetFeatureCode,iMmPtrHolder->iGetFeatureCode); + + Get(EMobilePhoneGetFeatureCode,aReqStatus, ptr1, aFCString);*/ + } + +EXPORT_C void RMobilePhone::SendNetworkServiceRequest(TRequestStatus& aReqStatus, const TDesC& aServiceString) const +/** + * This method sends a request to the network in the form of a character and digit string + * It will complete either when the network has confirmed the request or after the phone has sent it + * depending upon whether network confirmation is supported by serving network + * + * \param aServiceString Supplies the supplementary service or feature code string to be sent + */ + { + //Set(EMobilePhoneSendNetworkServiceRequest, aReqStatus, aServiceString); + } + +/***********************************************************************************/ +// +// MobilePhoneCallForwarding functional unit +// +/***********************************************************************************/ + +EXPORT_C RMobilePhone::TMobilePhoneCFInfoEntryV1::TMobilePhoneCFInfoEntryV1() +: iCondition(ECallForwardingUnspecified), + iServiceGroup(EServiceUnspecified), + iStatus(ECallForwardingStatusUnknown), + iTimeout(0) + { + iExtensionId=KETelExtMultimodeV1; + } + +void RMobilePhone::TMobilePhoneCFInfoEntryV1::InternalizeL(RReadStream& aStream) +/** + * This method internalizes the call forwarding information from a stream + * + * \param aStream The read stream containing the call forwarding information + */ + { + /*TMultimodeType::InternalizeL(aStream); + iCondition=STATIC_CAST(TMobilePhoneCFCondition, aStream.ReadUint32L()); + iServiceGroup=STATIC_CAST(TMobileService, aStream.ReadUint32L()); + iStatus=STATIC_CAST(TMobilePhoneCFStatus, aStream.ReadUint32L()); + aStream >> iNumber; + iTimeout=aStream.ReadInt32L();*/ + } + +void RMobilePhone::TMobilePhoneCFInfoEntryV1::ExternalizeL(RWriteStream& aStream) const +/** + * This method externalizes the call forwarding information into a stream + * + * \param aStream The write stream that will contain the call forwarding information + */ + { + /*TMultimodeType::ExternalizeL(aStream); + aStream.WriteUint32L(iCondition); + aStream.WriteUint32L(iServiceGroup); + aStream.WriteUint32L(iStatus); + aStream << iNumber; + aStream.WriteInt32L(iTimeout);*/ + } + +EXPORT_C void RMobilePhone::NotifyCallForwardingStatusChange(TRequestStatus& aReqStatus, TMobilePhoneCFCondition& aCondition) const +/** + * This notification completes if the status of a call forwarding service changes + * + * \retval aCondition Will contain the name of the changed service (CFU, CFB, CFNRc, CFNRy) + */ + { + /*__ASSERT_ALWAYS(iMmPtrHolder!=NULL,PanicClient(EEtelPanicNullHandle)); + + TPtr8& ptr1=iMmPtrHolder->Set(CMobilePhonePtrHolder::ESlot1NotifyCallForwardingStatusChange,aCondition); + + Get(EMobilePhoneNotifyCallForwardingStatusChange,aReqStatus, ptr1);*/ + } + +EXPORT_C RMobilePhone::TMobilePhoneCFChangeV1::TMobilePhoneCFChangeV1() +: iServiceGroup(EServiceUnspecified), + iAction(EServiceActionUnspecified), + iTimeout(0) + { + iExtensionId=KETelExtMultimodeV1; + } + +EXPORT_C void RMobilePhone::SetCallForwardingStatus(TRequestStatus& aReqStatus, TMobilePhoneCFCondition aCondition, const TMobilePhoneCFChangeV1& aInfo) const +/** + * This method sets the call forwarding status for incoming calls across all lines + * It will complete either when the network has confirmed the request or after the phone has sent it + * depending upon whether network confirmation is supported by serving network + * + * \param aCondition Specifies which call forwarding service (CFU, CFB, CFNRy, CFNRc) is being set + * \param aInfo Supplies the new status and/or registered information of the call forwarding service, as applied to all basic services (i.e. all lines) + */ + { + /*__ASSERT_ALWAYS(iMmPtrHolder!=NULL,PanicClient(EEtelPanicNullHandle)); + + iMmPtrHolder->iSetCFCondition = aCondition; + TPtrC8& ptr1=iMmPtrHolder->SetC(CMobilePhonePtrHolder::ESlot1SetCallForwardingStatus,iMmPtrHolder->iSetCFCondition); + + TPtrC8& ptr2=iMmPtrHolder->SetC(CMobilePhonePtrHolder::ESlot2SetCallForwardingStatus,aInfo); + + Set(EMobilePhoneSetCallForwardingStatus, aReqStatus, ptr1, ptr2);*/ + } + +EXPORT_C void RMobilePhone::NotifyCallForwardingActive(TRequestStatus& aReqStatus, TMobileService& aServiceGroup, TMobilePhoneCFActive& aActiveType) const +/** + * This notification completes if a call is made on this line while call forwarding is active on it + * + * \retval aActiveType Will indicate whether unconditional (CFU) or one of the conditional (CFB, CFNRy, CFNRc) services is active + */ + { + /*__ASSERT_ALWAYS(iMmPtrHolder!=NULL,PanicClient(EEtelPanicNullHandle)); + + TPtr8& ptr1=iMmPtrHolder->Set(CMobilePhonePtrHolder::ESlot1PhoneNotifyCallForwardingActive, aServiceGroup); + TPtr8& ptr2=iMmPtrHolder->Set(CMobilePhonePtrHolder::ESlot2PhoneNotifyCallForwardingActive, aActiveType); + + Get(EMobilePhoneNotifyCallForwardingActive, aReqStatus, ptr1, ptr2);*/ + } + +/***********************************************************************************/ +// +// Mobile Identity Service functional unit +// +/***********************************************************************************/ + +EXPORT_C void RMobilePhone::GetIdentityServiceStatus(TRequestStatus& aReqStatus, const TMobilePhoneIdService aService, TMobilePhoneIdServiceStatus& aStatus, TMobileInfoLocation aLocation) const +/** + * This method returns the current status of the specified identity service + * + * \param aService Specifies which identity service (CLIP, CLIR, COLP, COLR etc.) is being interrogated + * \retval aStatus Will contain the current status of the service + * \param aLocation Specifies whether the information should be retrieved from phone cache or network + */ + { + /*)__ASSERT_ALWAYS(iMmPtrHolder!=NULL,PanicClient(EEtelPanicNullHandle)); + + iMmPtrHolder->iGetIdentityServiceStatus.iLocation = aLocation; + iMmPtrHolder->iGetIdentityServiceStatus.iService = aService; + TPtrC8& ptr1 = iMmPtrHolder->SetC(CMobilePhonePtrHolder::ESlot1GetIdentityServiceStatus,iMmPtrHolder->iGetIdentityServiceStatus); + TPtr8& ptr2 = iMmPtrHolder->Set(CMobilePhonePtrHolder::ESlot2GetIdentityServiceStatus,aStatus); + + SetAndGet(EMobilePhoneGetIdentityServiceStatus,aReqStatus,ptr1,ptr2);*/ + } + +/***********************************************************************************/ +// +// Mobile Call Barring functional unit +// +/***********************************************************************************/ + +EXPORT_C RMobilePhone::TMobilePhoneCBInfoEntryV1::TMobilePhoneCBInfoEntryV1() +: iCondition(EBarUnspecified), + iServiceGroup(EServiceUnspecified), + iStatus(ECallBarringStatusUnknown) + { + iExtensionId=KETelExtMultimodeV1; + } + +void RMobilePhone::TMobilePhoneCBInfoEntryV1::InternalizeL(RReadStream& aStream) +/** + * This method internalizes the call barring inforamation from a stream + * + * \param aStream The read stream containing the call barring inforamation + */ + { + /*TMultimodeType::InternalizeL(aStream); + iCondition = STATIC_CAST(TMobilePhoneCBCondition,aStream.ReadUint32L()); + iServiceGroup = STATIC_CAST(TMobileService,aStream.ReadUint32L()); + iStatus = STATIC_CAST(TMobilePhoneCBStatus,aStream.ReadUint32L());*/ + } + +void RMobilePhone::TMobilePhoneCBInfoEntryV1::ExternalizeL(RWriteStream& aStream) const +/** + * This method externalizes the call barring information into a stream + * + * \param aStream The write stream that will contain the call barring information + */ + { + /*TMultimodeType::ExternalizeL(aStream); + aStream.WriteUint32L(iCondition); + aStream.WriteUint32L(iServiceGroup); + aStream.WriteUint32L(iStatus);*/ + } + +EXPORT_C RMobilePhone::TMobilePhoneCBChangeV1::TMobilePhoneCBChangeV1() +: iServiceGroup(EServiceUnspecified), + iAction(EServiceActionUnspecified) + { + iExtensionId=KETelExtMultimodeV1; + } + +EXPORT_C void RMobilePhone::SetCallBarringStatus(TRequestStatus& aReqStatus, TMobilePhoneCBCondition aCondition, const TMobilePhoneCBChangeV1& aInfo) const +/** + * This method sets the call barring status for calls across all lines + * It will complete either when the network has confirmed the request or after the phone has sent it + * depending upon whether network confirmation is supported by serving network + * + * \param aCondition Specifies which call barring program (BAOC, BIC etc) is being set + * \param aInfo Supplies the new status of the call barring service, as applied to all basic services (i.e. all lines) + */ + { + /*__ASSERT_ALWAYS(iMmPtrHolder!=NULL,PanicClient(EEtelPanicNullHandle)); + + iMmPtrHolder->iSetCBStatusCondition = aCondition; + TPtrC8& ptr1 = iMmPtrHolder->SetC(CMobilePhonePtrHolder::ESlot1SetCallBarringStatus,iMmPtrHolder->iSetCBStatusCondition); + TPtrC8& ptr2 = iMmPtrHolder->SetC(CMobilePhonePtrHolder::ESlot2SetCallBarringStatus,aInfo); + + Set(EMobilePhoneSetCallBarringStatus,aReqStatus,ptr1,ptr2);*/ + } + +EXPORT_C void RMobilePhone::NotifyCallBarringStatusChange(TRequestStatus& aReqStatus, TMobilePhoneCBCondition& aCondition) const +/** + * This notification completes if the status of a call barring program changes + * + * \retval aCondition Will contain the name of the changed barring program (BAOC, BIC etc.) + */ + { + /*__ASSERT_ALWAYS(iMmPtrHolder!=NULL,PanicClient(EEtelPanicNullHandle)); + + TPtr8& ptr1 = iMmPtrHolder->Set(CMobilePhonePtrHolder::ESlot1NotifyCallBarringStatusChange,aCondition); + + Get(EMobilePhoneNotifyCallBarringStatusChange,aReqStatus,ptr1);*/ + } + +EXPORT_C RMobilePhone::TMobilePhonePasswordChangeV1::TMobilePhonePasswordChangeV1() + { + iExtensionId=KETelExtMultimodeV1; + } + +EXPORT_C void RMobilePhone::SetCallBarringPassword(TRequestStatus& aReqStatus, const TMobilePhonePasswordChangeV1& aPassword) const +/** + * This method sets the call barring password that is part of the subscription for any call barring program + * It will complete either when the network has confirmed the request or after the phone has sent it + * depending upon whether network confirmation is supported by serving network + * + * \param aPassword Supplies the old and new call barring passwords + */ + { + /*__ASSERT_ALWAYS(iMmPtrHolder!=NULL,PanicClient(EEtelPanicNullHandle)); + + TPtrC8& ptr1 = iMmPtrHolder->SetC(CMobilePhonePtrHolder::ESlot1SetCallBarringPassword,aPassword); + + Set(EMobilePhoneSetCallBarringPassword,aReqStatus,ptr1);*/ + } + +/***********************************************************************************/ +// +// Mobile Call Waiting functional unit +// +/***********************************************************************************/ + +void RMobilePhone::TMobilePhoneCWInfoEntryV1::InternalizeL(RReadStream& aStream) +/** + * This method internalizes the call waiting inforamation from a stream + * + * \param aStream The read stream containing the call waiting inforamation + */ + { + /*TMultimodeType::InternalizeL(aStream); + iServiceGroup = STATIC_CAST(TMobileService,aStream.ReadUint32L()); + iStatus = STATIC_CAST(TMobilePhoneCWStatus,aStream.ReadUint32L());*/ + } + +void RMobilePhone::TMobilePhoneCWInfoEntryV1::ExternalizeL(RWriteStream& aStream) const +/** + * This method externalizes the call waiting information into a stream + * + * \param aStream The write stream that will contain the call waiting information + */ + { + /*TMultimodeType::ExternalizeL(aStream); + aStream.WriteUint32L(iServiceGroup); + aStream.WriteUint32L(iStatus);*/ + } + +EXPORT_C RMobilePhone::TMobilePhoneCWInfoEntryV1::TMobilePhoneCWInfoEntryV1() +: iServiceGroup(EServiceUnspecified), + iStatus(ECallWaitingStatusUnknown) + { + iExtensionId=KETelExtMultimodeV1; + } + +EXPORT_C void RMobilePhone::SetCallWaitingStatus(TRequestStatus& aReqStatus, TMobileService aServiceGroup, TMobilePhoneServiceAction aAction) const +/** + * This method sets the status of the call waiting service for all lines + * It will complete either when the network has confirmed the request or after the phone has sent it + * depending upon whether network confirmation is supported by serving network + * + * \param aAction Supplies the new status of the call waiting service, as applied to all basic services + */ + { + /*__ASSERT_ALWAYS(iMmPtrHolder!=NULL,PanicClient(EEtelPanicNullHandle)); + + iMmPtrHolder->iSetCallWaitingStatusGroup = aServiceGroup; + iMmPtrHolder->iSetCallWaitingStatusAction = aAction; + + TPtrC8& ptr1 = iMmPtrHolder->SetC(CMobilePhonePtrHolder::ESlot1SetCallWaitingStatus,iMmPtrHolder->iSetCallWaitingStatusGroup); + TPtrC8& ptr2 = iMmPtrHolder->SetC(CMobilePhonePtrHolder::ESlot2SetCallWaitingStatus,iMmPtrHolder->iSetCallWaitingStatusAction); + + Set(EMobilePhoneSetCallWaitingStatus,aReqStatus,ptr1,ptr2);*/ + } + +EXPORT_C void RMobilePhone::NotifyCallWaitingStatusChange(TRequestStatus& aReqStatus, TDes8& aCWStatus) const +/** + * This notification completes if the status of the call waiting service changes + * + * \retval aCWStatus Will contain the new status of the call waiting service + */ + { + //Get(EMobilePhoneNotifyCallWaitingStatusChange,aReqStatus,aCWStatus); + } + + +/***********************************************************************************/ +// +// Mobile Call Completion functional unit +// +/***********************************************************************************/ + +EXPORT_C void RMobilePhone::GetCCBSStatus(TRequestStatus& aReqStatus, TMobilePhoneCCBSStatus& aCcbsStatus, TMobileInfoLocation aLocation) const +/** + * This method returns the current status of the CCBS service + * + * \retval aCcbsStatus Will contain the current status of the service + * \param aLocation Specifies whether the information should be retrieved from phone cache or network + */ + { + /*__ASSERT_ALWAYS(iMmPtrHolder!=NULL,PanicClient(EEtelPanicNullHandle)); + + iMmPtrHolder->iGetCCBSStatusLocation = aLocation; + TPtr8& ptr1 = iMmPtrHolder->Set(CMobilePhonePtrHolder::ESlot1GetCCBSStatus,aCcbsStatus); + TPtr8& ptr2 = iMmPtrHolder->Set(CMobilePhonePtrHolder::ESlot2GetCCBSStatus,iMmPtrHolder->iGetCCBSStatusLocation); + + Get(EMobilePhoneGetCCBSStatus,aReqStatus,ptr1,ptr2);*/ + } + +EXPORT_C void RMobilePhone::NotifyCCBSStatusChange(TRequestStatus& aReqStatus, TMobilePhoneCCBSStatus& aCcbsStatus) const +/** + * This notification completes if the status of the CCBS service changes + * + * \retval aCcbsStatus Will contain the new status of the CCBS service + */ + { + /*__ASSERT_ALWAYS(iMmPtrHolder!=NULL,PanicClient(EEtelPanicNullHandle)); + + TPtr8& ptr1 = iMmPtrHolder->Set(CMobilePhonePtrHolder::ESlot1NotifyCCBSStatusChange,aCcbsStatus); + + Get(EMobilePhoneNotifyCCBSStatusChange,aReqStatus,ptr1);*/ + } + +/*EXPORT_C void RMobilePhone::DeactivateAllCCBS(TRequestStatus& aReqStatus) const +/** + * This method deactivates all currently active CCBS requests + * It will complete either when the network has confirmed the request or after the phone has sent it + * depending upon whether network confirmation is supported by serving network + * + */ + //{ + //Blank(EMobilePhoneDeactivateAllCCBS,aReqStatus); + //} + +void RMobilePhone::TMobilePhoneCCBSEntryV1::InternalizeL(RReadStream& aStream) +/** + * This method internalizes the CCBS inforamation from a stream + * + * \param aStream The read stream containing the CCBS inforamation + */ + { + /*TMultimodeType::InternalizeL(aStream); + aStream >> iCallName; + iServiceGroup = STATIC_CAST(TMobileService,aStream.ReadUint32L()); + iCcbsIndex = STATIC_CAST(TInt,aStream.ReadUint32L()); + aStream >> iDestination;*/ + } + +void RMobilePhone::TMobilePhoneCCBSEntryV1::ExternalizeL(RWriteStream& aStream) const +/** + * This method externalizes the CCBS information into a stream + * + * \param aStream The write stream that will contain the CCBS information + */ + { + /*TMultimodeType::ExternalizeL(aStream); + aStream << iCallName; + aStream.WriteInt32L(iServiceGroup); + aStream.WriteInt32L(iCcbsIndex); + aStream << iDestination;*/ + } + +EXPORT_C RMobilePhone::TMobilePhoneCCBSEntryV1::TMobilePhoneCCBSEntryV1() +: iCcbsIndex(0), iServiceGroup(EServiceUnspecified) + { + iExtensionId=KETelExtMultimodeV1; + } + +/***********************************************************************************/ +// +// Mobile Alternating Call functional unit +// +/***********************************************************************************/ + +EXPORT_C TInt RMobilePhone::GetAlternatingCallCaps(TUint32& aCaps) const +/** + * This method returns the alternating call capabilities of the phone + * + * \retval aCaps An integer that will contain the bit-wise sum of the alternating call capabilities + * \return KErrNone + * \exception KErrNotSupported if alternating calls are not supported + */ + { + /*TPckg ptr1(aCaps); + return Get(EMobilePhoneGetAlternatingCallCaps,ptr1);*/ + return 0; + } + +EXPORT_C void RMobilePhone::NotifyAlternatingCallCapsChange(TRequestStatus& aReqStatus, TUint32& aCaps) const +/** + * This notification completes if the alternating call capabilities of the phone change + * + * \retval aCaps An integer that will contain the new alternating call capabilities + */ + { + /*__ASSERT_ALWAYS(iMmPtrHolder!=NULL,PanicClient(EEtelPanicNullHandle)); + + TPtr8& ptr1 = iMmPtrHolder->Set(CMobilePhonePtrHolder::ESlot1NotifyAlternatingCallCapsChange,aCaps); + + Get(EMobilePhoneNotifyAlternatingCallCapsChange,aReqStatus,ptr1);*/ + } + +EXPORT_C TInt RMobilePhone::GetAlternatingCallMode(TMobilePhoneAlternatingCallMode& aMode, TMobileService& aFirstService) const +/** + * This method returns the current alternating call mode + * + * \retval aMode Will contain the current alternating call mode + * \retval aFirstService Will contain the service that will be first in an alternating call (voice, data, fax) + */ + { + /*TPckg ptr1(aMode); + TPckg ptr2(aFirstService); + + return Get(EMobilePhoneGetAlternatingCallMode,ptr1,ptr2);*/ + } + +EXPORT_C void RMobilePhone::SetAlternatingCallMode(TRequestStatus& aReqStatus, TMobilePhoneAlternatingCallMode aMode, TMobileService aFirstService) const +/** + * This method sets a new value for alternating call mode + * + * \param aMode Specifies the new alternating call mode + * \param aFirstService Specifies the service that will be first in an alternating call (voice, data, fax) + */ + { + /*__ASSERT_ALWAYS(iMmPtrHolder!=NULL,PanicClient(EEtelPanicNullHandle)); + + iMmPtrHolder->iSetAlternatingCallModeMode = aMode; + iMmPtrHolder->iSetAlternatingCallModeService = aFirstService; + TPtrC8& ptr1 = iMmPtrHolder->SetC(CMobilePhonePtrHolder::ESlot1SetAlternatingCallMode,iMmPtrHolder->iSetAlternatingCallModeMode); + TPtrC8& ptr2 = iMmPtrHolder->SetC(CMobilePhonePtrHolder::ESlot2SetAlternatingCallMode,iMmPtrHolder->iSetAlternatingCallModeService); + + Set(EMobilePhoneSetAlternatingCallMode,aReqStatus,ptr1,ptr2);*/ + } + +EXPORT_C void RMobilePhone::NotifyAlternatingCallModeChange(TRequestStatus& aReqStatus, TMobilePhoneAlternatingCallMode& aMode,TMobileService& aFirstService) const +/** + * This notification completes if the alternating call mode of the phone changes + * + * \retval aMode Will contain the new alternating call mode + * \retval aFirstService Will contain the service that will be first in an alternating call (voice, data, fax) + */ + { + /*__ASSERT_ALWAYS(iMmPtrHolder!=NULL,PanicClient(EEtelPanicNullHandle)); + + TPtr8& ptr1 = iMmPtrHolder->Set(CMobilePhonePtrHolder::ESlot1NotifyAlternatingCallModeChange,aMode); + TPtr8& ptr2 = iMmPtrHolder->Set(CMobilePhonePtrHolder::ESlot2NotifyAlternatingCallModeChange,aFirstService); + + Get(EMobilePhoneNotifyAlternatingCallModeChange,aReqStatus,ptr1,ptr2);*/ + } + +/***********************************************************************************/ +// +// Mobile Alternate Line Service functional unit +// +/***********************************************************************************/ + + +EXPORT_C TInt RMobilePhone::GetALSLine(TMobilePhoneALSLine& aALSLine) const +/** + * This method returns the current ALS line selected + * + * \retval aALSLine Will contain the ALS line selected + */ + { + /*TPckg ptr1(aALSLine); + return Get(EMobilePhoneGetALSLine,ptr1);*/ + return 0; + } + +EXPORT_C void RMobilePhone::SetALSLine(TRequestStatus& aReqStatus, TMobilePhoneALSLine aALSLine) const +/** + * This method sets a new values for the ALS line selected + * + * \param aALSLine Specifies the new ALS line selected + */ + { + /*__ASSERT_ALWAYS(iMmPtrHolder!=NULL,PanicClient(EEtelPanicNullHandle)); + + iMmPtrHolder->iSetALSLine = aALSLine; + TPtrC8& ptr1 = iMmPtrHolder->SetC(CMobilePhonePtrHolder::ESlot1SetALSLine,iMmPtrHolder->iSetALSLine); + + Set(EMobilePhoneSetALSLine,aReqStatus,ptr1);*/ + } + +EXPORT_C void RMobilePhone::NotifyALSLineChange(TRequestStatus& aReqStatus, TMobilePhoneALSLine& aALSLine) const +/** + * This notification completes if the ALS line selected changes + * + * \retval aALSLine Will contain the new ALS line selected + */ + { + /*__ASSERT_ALWAYS(iMmPtrHolder!=NULL,PanicClient(EEtelPanicNullHandle)); + + TPtr8& ptr1 = iMmPtrHolder->Set(CMobilePhonePtrHolder::ESlot1NotifyALSLineChange,aALSLine); + + Get(EMobilePhoneNotifyALSLineChange,aReqStatus,ptr1);*/ + } + +/***********************************************************************************/ +// +// Mobile Cost functional unit +// +/***********************************************************************************/ + + +EXPORT_C TInt RMobilePhone::GetCostCaps(TUint32& aCaps) const +/** + * This method returns the call cost information capabilities of the phone + * + * \retval aCaps An integer that will contain the bit-wise sum of the call cost information capabilities + * \return KErrNone + * \exception KErrNotSupported if call cost information is not supported + */ + { + //TPckg ptr1(aCaps); + //return Get(EMobilePhoneGetCostCaps,ptr1); + return 0; + } + +EXPORT_C void RMobilePhone::NotifyCostCapsChange(TRequestStatus& aReqStatus, TUint32& aCaps) const +/** + * This notification completes if the call cost information capabilities of the phone change + * + * \retval aCaps An integer that will contain the new call cost information capabilities + */ + { + /*__ASSERT_ALWAYS(iMmPtrHolder!=NULL,PanicClient(EEtelPanicNullHandle)); + + TPtr8& ptr1 = iMmPtrHolder->Set(CMobilePhonePtrHolder::ESlot1NotifyCostCapsChange,aCaps); + + Get(EMobilePhoneNotifyCostCapsChange,aReqStatus,ptr1);*/ + } + +EXPORT_C void RMobilePhone::ClearCostMeter(TRequestStatus& aReqStatus, TMobilePhoneCostMeters aMeter) const +/** + * This method clears the Accumulated Cost Meter (ACM) on the SIM + * It will complete either when the SIM confirms that ACM is cleared or after the phone has + * been denied access due to the requirement for PIN2 entry first + */ + { + /*__ASSERT_ALWAYS(iMmPtrHolder!=NULL,PanicClient(EEtelPanicNullHandle)); + + iMmPtrHolder->iClearCostMeter = aMeter; + TPtrC8& ptr1 = iMmPtrHolder->SetC(CMobilePhonePtrHolder::ESlot1ClearCostMeter,iMmPtrHolder->iClearCostMeter); + + Set(EMobilePhoneClearCostMeter,aReqStatus,ptr1);*/ + } + +EXPORT_C void RMobilePhone::SetMaxCostMeter(TRequestStatus& aReqStatus, TUint aUnits) const +/** + * This method sets a new value for the Max Accumulated Cost Meter (ACMmax) on the SIM + * It will complete either when the SIM confirms that ACMmax is set or after the phone has + * been denied access due to the requirement for PIN2 entry first + * + * \param aUnits Specifies the number of units to set ACMmax to + */ + { + /*__ASSERT_ALWAYS(iMmPtrHolder!=NULL,PanicClient(EEtelPanicNullHandle)); + + iMmPtrHolder->iSetMaxCostMeterUnits = aUnits; + TPtrC8& ptr1 = iMmPtrHolder->SetC(CMobilePhonePtrHolder::ESlot1SetMaxCostMeter,iMmPtrHolder->iSetMaxCostMeterUnits); + + Set(EMobilePhoneSetMaxCostMeter,aReqStatus,ptr1);*/ + } + +EXPORT_C RMobilePhone::TMobilePhonePuctV1::TMobilePhonePuctV1() +: iPricePerUnit(0.0) + { + iExtensionId=KETelExtMultimodeV1; + } + + +EXPORT_C void RMobilePhone::SetPuct(TRequestStatus& aReqStatus, const TDesC8& aPuct) const +/** + * This method sets a new value for the Price Per Unit & Currency Table (PUCT) on the SIM + * It will complete either when the SIM confirms that PUCT is set or after the phone has + * been denied access due to the requirement for PIN2 entry first + * + * \param aPuct Supplies the new PUCT setting + */ + { + Set(EMobilePhoneSetPuct,aReqStatus,aPuct); + } + +EXPORT_C RMobilePhone::TMobilePhoneCostInfoV1::TMobilePhoneCostInfoV1() +: iService(ECostServiceUnknown), + iCCM(0), + iACM(0), + iACMmax(0) + { + iExtensionId=KETelExtMultimodeV1; + } + +EXPORT_C void RMobilePhone::GetCostInfo(TRequestStatus& aReqStatus, TDes8& aCostInfo) const +/** + * This method returns the current snapshot of the phone's call cost information + * + * \retval aCostInfo Will contain the cost information + */ + { + //Get(EMobilePhoneGetCostInfo,aReqStatus,aCostInfo); + } + +EXPORT_C void RMobilePhone::NotifyCostInfoChange(TRequestStatus& aReqStatus, TDes8& aCostInfo) const +/** + * This notification completes if the call cost information changes + * + * \retval aCostInfo Will contain the new call cost information + */ + { + //Get(EMobilePhoneNotifyCostInfoChange,aReqStatus,aCostInfo); + } + + +/***********************************************************************************/ +// +// Mobile Security functional unit +// +/***********************************************************************************/ + +EXPORT_C TInt RMobilePhone::GetSecurityCaps(TUint32& aCaps) const +/** + * This method returns the security capabilities of the phone + * + * \retval aCaps An integer that will contain the bit-wise sum of the security capabilities + * \return KErrNone + * \exception KErrNotSupported if security is not supported + */ + { + /*TPckg ptr1(aCaps); + return Get(EMobilePhoneGetSecurityCaps,ptr1);*/ + return 0; + } + +EXPORT_C void RMobilePhone::NotifySecurityCapsChange(TRequestStatus& aReqStatus, TUint32& aCaps) const +/** + * This notification completes if the security capabilities of the phone change + * + * \retval aCaps An integer that will contain the new security capabilities + */ + { + /*__ASSERT_ALWAYS(iMmPtrHolder!=NULL,PanicClient(EEtelPanicNullHandle)); + + TPtr8& ptr1 = iMmPtrHolder->Set(CMobilePhonePtrHolder::ESlot1NotifySecurityCapsChange,aCaps); + + Get(EMobilePhoneNotifySecurityCapsChange,aReqStatus,ptr1);*/ + } + +EXPORT_C RMobilePhone::TMobilePhoneLockInfoV1::TMobilePhoneLockInfoV1() +: iStatus(EStatusLocked), + iSetting(ELockSetEnabled) + { + iExtensionId=KETelExtMultimodeV1; + } + +EXPORT_C void RMobilePhone::GetLockInfo(TRequestStatus& aReqStatus, TMobilePhoneLock aLock, TDes8& aLockInfo) const +/** + * This method returns the current status and setting of the specified lock + * + * \param aLock Specifies which lock is being interrogated + * \retval aLockInfo Will contain the lock's current status and setting + */ + { + /*__ASSERT_ALWAYS(iMmPtrHolder!=NULL,PanicClient(EEtelPanicNullHandle)); + + iMmPtrHolder->iLock = aLock; + TPtrC8& ptr1 = iMmPtrHolder->SetC(CMobilePhonePtrHolder::ESlot1GetLockInfo,iMmPtrHolder->iLock); + + SetAndGet(EMobilePhoneGetLockInfo,aReqStatus,ptr1,aLockInfo);*/ + } + +EXPORT_C void RMobilePhone::NotifyLockInfoChange(TRequestStatus& aReqStatus, TMobilePhoneLock& aLock, TDes8& aLockInfo) const +/** + * This notification completes if the status or information of a lock changes + * + * \retval aLockInfo Will contain the new lock status and information + */ + { + /*__ASSERT_ALWAYS(iMmPtrHolder!=NULL,PanicClient(EEtelPanicNullHandle)); + + TPtr8& ptr1 = iMmPtrHolder->Set(CMobilePhonePtrHolder::ESlot1NotifyLockInfoChange,aLock); + + Get(EMobilePhoneNotifyLockInfoChange,aReqStatus,ptr1,aLockInfo);*/ + } + +EXPORT_C void RMobilePhone::SetLockSetting(TRequestStatus& aReqStatus, TMobilePhoneLock aLock, TMobilePhoneLockSetting aSetting) const +/** + * This method sets a new value for the setting of the specified lock + * + * \param aLock Specifies which lock is being set + * \param aSetting Supplies the lock's new setting + */ + { + /*__ASSERT_ALWAYS(iMmPtrHolder!=NULL,PanicClient(EEtelPanicNullHandle)); + + iMmPtrHolder->iSetLockSettingLock = aLock; + iMmPtrHolder->iSetLockSettingSetting = aSetting; + + TPtrC8& ptr1 = iMmPtrHolder->SetC(CMobilePhonePtrHolder::ESlot1SetLockSetting,iMmPtrHolder->iSetLockSettingLock); + TPtrC8& ptr2 = iMmPtrHolder->SetC(CMobilePhonePtrHolder::ESlot2SetLockSetting,iMmPtrHolder->iSetLockSettingSetting); + + Set(EMobilePhoneSetLockSetting,aReqStatus,ptr1,ptr2);*/ + } + +EXPORT_C void RMobilePhone::ChangeSecurityCode(TRequestStatus& aReqStatus, TMobilePhoneSecurityCode aType, const TMobilePhonePasswordChangeV1& aChange) const +/** + * This method changes the value of the specified security code + * + * \param aType Specifies which security code is being changed + * \param aChange Supplies the old and new values for the security code + */ + { + /*__ASSERT_ALWAYS(iMmPtrHolder!=NULL,PanicClient(EEtelPanicNullHandle)); + + iMmPtrHolder->iChangeSecurityCodeType = aType; + TPtrC8& ptr1 = iMmPtrHolder->SetC(CMobilePhonePtrHolder::ESlot1ChangeSecurityCode,iMmPtrHolder->iChangeSecurityCodeType); + TPtrC8& ptr2 = iMmPtrHolder->SetC(CMobilePhonePtrHolder::ESlot2ChangeSecurityCode,aChange); + + Set(EMobilePhoneChangeSecurityCode,aReqStatus,ptr1,ptr2);*/ + } + +EXPORT_C void RMobilePhone::NotifySecurityEvent(TRequestStatus& aReqStatus, TMobilePhoneSecurityEvent& aEvent) const +/** + * This notification completes if the phone recognises that a security event has occurred + * + * \retval aEvent Will contain the security event + */ + { + /*__ASSERT_ALWAYS(iMmPtrHolder!=NULL,PanicClient(EEtelPanicNullHandle)); + + TPtr8& ptr1 = iMmPtrHolder->Set(CMobilePhonePtrHolder::ESlot1NotifySecurityEvent,aEvent); + + Get(EMobilePhoneNotifySecurityEvent,aReqStatus,ptr1);*/ + } + +EXPORT_C void RMobilePhone::VerifySecurityCode(TRequestStatus& aReqStatus, TMobilePhoneSecurityCode aType, const TMobilePassword& aCode, + const TMobilePassword& aUnblockCode) const +/** + * This method verifies the user's code agains the specified stored security code + * + * \param aType Specifies which security code is being verified + * \param aCode Supplies the user's code + * \param aUnblockCode Supplies the user's unblock code which may be needed if the user is actually unblocking a security code (e.g. PIN1 or PIN2) + */ + { + /*__ASSERT_ALWAYS(iMmPtrHolder!=NULL,PanicClient(EEtelPanicNullHandle)); + + iMmPtrHolder->iVerifySecurityCodeType = aType; + iMmPtrHolder->iVerifySecurityCodeData.iCode = aCode; + iMmPtrHolder->iVerifySecurityCodeData.iUnblockCode = aUnblockCode; + + TPtrC8& ptr1 = iMmPtrHolder->SetC(CMobilePhonePtrHolder::ESlot1VerifySecurityCode,iMmPtrHolder->iVerifySecurityCodeType); + TPtrC8& ptr2 = iMmPtrHolder->SetC(CMobilePhonePtrHolder::ESlot2VerifySecurityCode,iMmPtrHolder->iVerifySecurityCodeData); + + Set(EMobilePhoneVerifySecurityCode,aReqStatus,ptr1,ptr2);*/ + } + +EXPORT_C TInt RMobilePhone::AbortSecurityCode(TMobilePhoneSecurityCode aType) const +/** + * This method informs the phone that the user has cancelled the request for a security code to be entered + */ + { + /*TPckg ptr1(aType); + return Set(EMobilePhoneAbortSecurityCode,ptr1);*/ + } + +EXPORT_C RMobilePhone::TMobilePhoneMulticallSettingsV1::TMobilePhoneMulticallSettingsV1() + : iUserMaxBearers(-1),iServiceProviderMaxBearers(-1),iNetworkSupportedMaxBearers(-1), + iUESupportedMaxBearers(-1) + { + iExtensionId=KETelExtMultimodeV1; + } + +EXPORT_C void RMobilePhone::GetMulticallParams(TRequestStatus& aReqStatus, TDes8& aMulticallParams) const +/** + * This method retrieves the maximum number of simultaneous CS service bearers defined by + * the user, defined by the service provider, supported by the network and supported by the phone. + * + * \param aMulticallParams Will contain the multicall bearer settings + */ + { + //Get(EMobilePhoneGetMulticallParams, aReqStatus, aMulticallParams); + } + +EXPORT_C void RMobilePhone::SetMulticallParams(TRequestStatus& aReqStatus, TInt aUserMaxBearers) const +/** + * This method is used by client application to set the maximum number of + * simultaneous CS bearers specified by the user (iUserMaxBearers) + * + * \param aUserMaxBearers Supplies the new user specified value + */ + { + /*__ASSERT_ALWAYS(iMmPtrHolder!=NULL,PanicClient(EEtelPanicNullHandle)); + + iMmPtrHolder->iUserMaxBearers = aUserMaxBearers; + TPtrC8& ptr1=iMmPtrHolder->SetC(CMobilePhonePtrHolder::ESlot1SetMulticallParams, iMmPtrHolder->iUserMaxBearers); + + Set(EMobilePhoneSetMulticallParams,aReqStatus,ptr1);*/ + } + +EXPORT_C void RMobilePhone::NotifyMulticallParamsChange(TRequestStatus& aReqStatus, TDes8& aMulticallParams) const +/** + * This notification completes if the multicall parameters of the phone change + * + * \retval aMulticallParams Will contain the new Multicall parameters set by the network + */ + { + //Get(EMobilePhoneNotifyMulticallParamsChange, aReqStatus, aMulticallParams); + } + +/***********************************************************************************/ +// +// Mobile Message Waiting functional unit +// +/***********************************************************************************/ + +EXPORT_C RMobilePhone::TMobilePhoneMessageWaitingV1::TMobilePhoneMessageWaitingV1() +: iVoiceMsgs(0), iAuxVoiceMsgs(0), iDataMsgs(0), iFaxMsgs(0), iEmailMsgs(0), iOtherMsgs(0) + { + iExtensionId=KETelExtMultimodeV1; + } + +EXPORT_C void RMobilePhone::NotifyMessageWaiting(TRequestStatus& aReqStatus, TInt& aCount) const +/** + * This notification completes if the phone receives a "message waiting" message from the network + * + * \retval aCount Will contain the number of voicemail messages waiting + */ + { + /*__ASSERT_ALWAYS(iMmPtrHolder!=NULL,PanicClient(EEtelPanicNullHandle)); + + TPtr8& ptr1 = iMmPtrHolder->Set(CMobilePhonePtrHolder::ESlot1NotifyMessageWaiting,aCount); + + Get(EMobilePhoneNotifyMessageWaiting,aReqStatus,ptr1);*/ + } + +EXPORT_C void RMobilePhone::GetIccMessageWaitingIndicators(TRequestStatus& aReqStatus, TDes8& aMsgIndicators) const +/** + * This method retrieves the set of message waiting indicators from the current ICC + * + * \retval aMsgIndicators Will contain the type and number of waiting messages + */ + { + //Get(EMobilePhoneGetIccMessageWaitingIndicators,aReqStatus,aMsgIndicators); + } + +EXPORT_C void RMobilePhone::SetIccMessageWaitingIndicators(TRequestStatus& aReqStatus, const TDesC8& aMsgIndicators) const +/** + * This method sets the message waiting indicators on the current ICC + * + * \retval aMsgIndicators Will contain the type and number of waiting messages + */ + { + //Set(EMobilePhoneSetIccMessageWaitingIndicators,aReqStatus,aMsgIndicators); + } + +EXPORT_C void RMobilePhone::NotifyIccMessageWaitingIndicatorsChange(TRequestStatus& aReqStatus, TDes8& aMsgIndicators) const +/** + * This notification completes if the message waiting indicators change on the current ICC + * + * \retval aMsgIndicators Will contain the type and number of waiting messages + */ + { + //Get(EMobilePhoneNotifyIccMessageWaitingIndicatorsChange,aReqStatus,aMsgIndicators); + } + +/***********************************************************************************/ +// +// Mobile Fixed Dialling Numbers functional unit +// +/***********************************************************************************/ + + +EXPORT_C TInt RMobilePhone::GetFdnStatus(TMobilePhoneFdnStatus& aFdnStatus) const +/** + * This method returns the current status of the Fixed Dialling Number (FDN) service + * + * \retval aFdnStatus Will contain the current status of FDN + */ + { + /*TPckg ptr1(aFdnStatus); + + return Get(EMobilePhoneGetFdnStatus,ptr1);*/ + } + +EXPORT_C void RMobilePhone::SetFdnSetting(TRequestStatus& aReqStatus, TMobilePhoneFdnSetting aFdnSetting) const +/** + * This method sets a new value for the status of the Fixed Dialling Number (FDN) service + * + * \retval aFdnSetting Supplies the new status of FDN + */ + { + /*__ASSERT_ALWAYS(iMmPtrHolder!=NULL,PanicClient(EEtelPanicNullHandle)); + + iMmPtrHolder->iSetFdnSetting = aFdnSetting; + TPtrC8& ptr1 = iMmPtrHolder->SetC(CMobilePhonePtrHolder::ESlot1SetFdnSetting,iMmPtrHolder->iSetFdnSetting); + + Set(EMobilePhoneSetFdnSetting,aReqStatus,ptr1);*/ + } + +EXPORT_C void RMobilePhone::NotifyFdnStatusChange(TRequestStatus& aReqStatus, TMobilePhoneFdnStatus& aFdnStatus) const +/** + * This notification completes if the status of the FDN service changes + * + * \retval aFdnStatus Will contain the new FDN status + */ + { + /*__ASSERT_ALWAYS(iMmPtrHolder!=NULL,PanicClient(EEtelPanicNullHandle)); + + TPtr8& ptr1 = iMmPtrHolder->Set(CMobilePhonePtrHolder::ESlot1NotifyFdnStatusChange,aFdnStatus); + + Get(EMobilePhoneNotifyFdnStatusChange,aReqStatus,ptr1);*/ + } + +/************************************************************************************/ +// +// Single Numbering Scheme functional unit +// +/************************************************************************************/ + + +EXPORT_C void RMobilePhone::GetIncomingCallType(TRequestStatus& aReqStatus, TMobilePhoneIncomingCallType& aCallType, TDes8& aDataParams) const +/** + * This method retrieves the current setting of the incoming call type + * + * \retval aType Will contain the incoming call types supported by the phone + * + * \param aDataParams Will contain the data bearer service settings if aType + * indicates that incoming calls will include a data bearer element + */ + { + /*__ASSERT_ALWAYS(iMmPtrHolder!=NULL,PanicClient(EEtelPanicNullHandle)); + + TPtr8& ptr1 = iMmPtrHolder->Set(CMobilePhonePtrHolder::ESlot1GetIncomingCallType, aCallType); + + Get(EMobilePhoneGetIncomingCallType, aReqStatus, ptr1, aDataParams);*/ + } + +EXPORT_C void RMobilePhone::SetIncomingCallType(TRequestStatus& aReqStatus, TMobilePhoneIncomingCallType aCallType, TDes8& aDataParams) const +/** + * This method sets the incoming call type. + * + * \param aCallType Supplies the new settings for the incoming call types + * \param aDataParam Suppies the new data settings in the case of a data bearer + */ + { + /*)__ASSERT_ALWAYS(iMmPtrHolder!=NULL,PanicClient(EEtelPanicNullHandle)); + + iMmPtrHolder->iCallType = aCallType; + TPtrC8& ptr1 = iMmPtrHolder->SetC(CMobilePhonePtrHolder::ESlot1SetIncomingCallType, iMmPtrHolder->iCallType); + + Set(EMobilePhoneSetIncomingCallType, aReqStatus, ptr1, aDataParams);*/ + } + +EXPORT_C void RMobilePhone::NotifyIncomingCallTypeChange(TRequestStatus& aReqStatus, TMobilePhoneIncomingCallType& aCallType, TDes8& aDataParams) const +/** + * This method notifies the client if the setting of the incoming call type changes. + * + * \retval aCallType Will contain the new incoming call type. + * + * \param aDataParams Will contain the data bearer service settings if aCallType + * indicates that incoming calls will include a data bearer element + */ + { + /*__ASSERT_ALWAYS(iMmPtrHolder!=NULL,PanicClient(EEtelPanicNullHandle)); + + TPtr8& ptr1 = iMmPtrHolder->Set(CMobilePhonePtrHolder::ESlot1NotifyIncomingCallTypeChange, aCallType); + + Get(EMobilePhoneNotifyIncomingCallTypeChange, aReqStatus, ptr1, aDataParams);*/ + } + +/************************************************************************************/ +// +// User-To-User Signalling functional unit +// +/************************************************************************************/ + + +EXPORT_C void RMobilePhone::GetUUSSetting(TRequestStatus& aReqStatus, TMobilePhoneUUSSetting& aSetting) const +/** + * This method retrieves the current User-User Signalling settings of the phone + * + * \retval aSetting An integer that will contain the current UUS settings + * \return KErrNone + * \exception KErrNotSupported if UUS functionality is not supported by the phone/TSY + */ + { + /*__ASSERT_ALWAYS(iMmPtrHolder!=NULL,PanicClient(EEtelPanicNullHandle)); + + TPtr8& ptr1 = iMmPtrHolder->Set(CMobilePhonePtrHolder::ESlot1GetUUSSetting, aSetting); + Get(EMobilePhoneGetUUSSetting, aReqStatus, ptr1);*/ + } + +EXPORT_C void RMobilePhone::SetUUSSetting(TRequestStatus& aReqStatus, TMobilePhoneUUSSetting aSetting) const +/** + * This method sets the User-User Signalling settings of the phone + * + * \param aSetting Supplies the new UUS settings + */ + { + /*__ASSERT_ALWAYS(iMmPtrHolder!=NULL,PanicClient(EEtelPanicNullHandle)); + + iMmPtrHolder->iSetUUSSetting = aSetting; + TPtrC8& ptr1 = iMmPtrHolder->SetC(CMobilePhonePtrHolder::ESlot1SetUUSSetting, iMmPtrHolder->iSetUUSSetting); + + Set(EMobilePhoneSetUUSSetting, aReqStatus, ptr1);*/ + } + +EXPORT_C void RMobilePhone::NotifyUUSSettingChange(TRequestStatus& aReqStatus, TMobilePhoneUUSSetting& aSetting) const +/** + * This notification completes if the User-User Signalling settings of the phone change + * + * \retval aCaps An integer that will contain the new UUS settings + */ + { + /*__ASSERT_ALWAYS(iMmPtrHolder!=NULL,PanicClient(EEtelPanicNullHandle)); + + TPtr8& ptr1 = iMmPtrHolder->Set(CMobilePhonePtrHolder::ESlot1NotifyUUSSettingChange,aSetting); + + Get(EMobilePhoneNotifyUUSSettingChange, aReqStatus, ptr1);*/ + } + +/***********************************************************************************/ diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/musavaInviteresponderobserverimp.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/musavaInviteresponderobserverimp.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,102 @@ +/* +* 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: Implementation class for creating master and slave pattern objects. +* +*/ + + +#include "musunittesting.h" + +#include "musavaInviteresponderobserverimp.h" +#include "musavaobserver.h" +#include "CSipSseTestTls.h" +#include "muslogger.h" + + +#include +#include + +// ----------------------------------------------------------------------------- +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CMusAvaInviteResponderObserverImp* CMusAvaInviteResponderObserverImp::NewL( ) + { + MUS_LOG( " [MUSAVA ] -> CMusAvaInviteResponderObserverImp::NewL" ); + CMusAvaInviteResponderObserverImp* self = new (ELeave) CMusAvaInviteResponderObserverImp(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + MUS_LOG( " [MUSAVA ] <- CMusAvaInviteResponderObserverImp::NewL" ); + return self; + } + +// ----------------------------------------------------------------------------- +// C++ destructor. +// ----------------------------------------------------------------------------- +// +CMusAvaInviteResponderObserverImp::~CMusAvaInviteResponderObserverImp() + { + MUS_LOG( " [MUSAVA ] -> CMusAvaInviteResponderObserverImp::~CMusAvaInviteResponderObserverImp" ); + + MUS_LOG( " [MUSAVA ] <- CMusAvaInviteResponderObserverImp::~CMusAvaInviteResponderObserverImp" ); + } + +// ----------------------------------------------------------------------------- +// Symbian second-phase constructor. +// ----------------------------------------------------------------------------- +// +void CMusAvaInviteResponderObserverImp::ConstructL() + { + MUS_LOG( " [MUSAVA ] -> CMusAvaInviteResponderObserverImp::ConstructL" ); + iApplicationState = MMusAvaSettingsObserver::EApplicationStateNotDefined; + MUS_LOG( " [MUSAVA ] <- CMusAvaInviteResponderObserverImp::ConstructL" ); + } + +// ----------------------------------------------------------------------------- +// C++ constructor. +// ----------------------------------------------------------------------------- +// +CMusAvaInviteResponderObserverImp::CMusAvaInviteResponderObserverImp( ) + { + MUS_LOG( "[MUSAVA ] -> CMusAvaInviteResponderObserverImp::CMusAvaInviteResponderObserverImp" ); + + MUS_LOG( "[MUSAVA ] <- CMusAvaInviteResponderObserverImp::CMusAvaInviteResponderObserverImp" ); + } + +// ----------------------------------------------------------------------------- +// Availability report. +// ----------------------------------------------------------------------------- +// +MMusAvaSettingsObserver::TApplicationState CMusAvaInviteResponderObserverImp::ApplicationState() + { + MUS_LOG( " [MUSAVA ] -> CMusAvaInviteResponderObserverImp::AvailabilityReport" ); + return iApplicationState; + MUS_LOG( " [MUSAVA ] <- CMusAvaInviteResponderObserverImp::AvailabilityReport" ); + } + +// ----------------------------------------------------------------------------- +// MusAvailability shutdown is completed. +// ----------------------------------------------------------------------------- +// +void CMusAvaInviteResponderObserverImp::InvitationAnsweredLD() + { + MUS_LOG( " [MUSAVA ] -> CMusAvaInviteResponderObserverImp::StopComplete" ); + + MUS_LOG( " [MUSAVA ] -> CMusAvaInviteResponderObserverImp::StopComplete" ); + } + + + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/musavaavailabilityobserverimp.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/musavaavailabilityobserverimp.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,106 @@ +/* +* 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: Implementation class for creating master and slave pattern objects. +* +*/ + + +#include "musunittesting.h" + +#include "musavaavailabilityobserverimp.h" +#include "musavaobserver.h" +#include "CSipSseTestTls.h" +#include "muslogger.h" + + +#include +#include + +// ----------------------------------------------------------------------------- +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CMusAvaAvailabilityObserverImp* CMusAvaAvailabilityObserverImp::NewL( ) + { + MUS_LOG( " [MUSAVA ] -> CMusAvaAvailabilityObserverImp::NewL" ); + CMusAvaAvailabilityObserverImp* self = new (ELeave) CMusAvaAvailabilityObserverImp(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + MUS_LOG( " [MUSAVA ] <- CMusAvaAvailabilityObserverImp::NewL" ); + return self; + } + +// ----------------------------------------------------------------------------- +// C++ destructor. +// ----------------------------------------------------------------------------- +// +CMusAvaAvailabilityObserverImp::~CMusAvaAvailabilityObserverImp() + { + MUS_LOG( " [MUSAVA ] -> CMusAvaAvailabilityObserverImp::~CMusAvaAvailabilityObserverImp" ); + + MUS_LOG( " [MUSAVA ] <- CMusAvaAvailabilityObserverImp::~CMusAvaAvailabilityObserverImp" ); + } + +// ----------------------------------------------------------------------------- +// Symbian second-phase constructor. +// ----------------------------------------------------------------------------- +// +void CMusAvaAvailabilityObserverImp::ConstructL() + { + MUS_LOG( " [MUSAVA ] -> CMusAvaAvailabilityObserverImp::ConstructL" ); + + MUS_LOG( " [MUSAVA ] <- CMusAvaAvailabilityObserverImp::ConstructL" ); + } + +// ----------------------------------------------------------------------------- +// C++ constructor. +// ----------------------------------------------------------------------------- +// +CMusAvaAvailabilityObserverImp::CMusAvaAvailabilityObserverImp( ) + { + MUS_LOG( "[MUSAVA ] -> CMusAvaAvailabilityObserverImp::CMusAvaAvailabilityObserverImp" ); + + MUS_LOG( "[MUSAVA ] <- CMusAvaAvailabilityObserverImp::CMusAvaAvailabilityObserverImp" ); + } + + + + +// ----------------------------------------------------------------------------- +// Clear atributes. +// ----------------------------------------------------------------------------- +// +void CMusAvaAvailabilityObserverImp::Clear() + { + iError = KErrNone; + iStatus = MMusAvaObserver::EMusAvaStatusNotAvailable; + iName = MMusAvaObserver::EMusAvaNameNotDefined; + } +// ----------------------------------------------------------------------------- +// MusAvailability shutdown is completed. +// ----------------------------------------------------------------------------- +// +/*void CMusAvaAvailabilityObserverImp::StopComplete( + MMusAvaObserver::TAvailabilityName aName, + TInt aSystemError ) + { + MUS_LOG( " [MUSAVA ] -> CMusAvaAvailabilityObserverImp::StopComplete" ); + CompineStopResult( aName, aSystemError ); + MUS_LOG( " [MUSAVA ] -> CMusAvaAvailabilityObserverImp::StopComplete" ); + }*/ + + + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/musavaavailabilitysettingobserverimp.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/musavaavailabilitysettingobserverimp.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,108 @@ +/* +* 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: Implementation class for creating master and slave pattern objects. +* +*/ + + +#include "musavaavailabilitysettingobserverimp.h" +#include "musunittesting.h" +#include "musavaobserver.h" +#include "CSipSseTestTls.h" +#include "muslogger.h" + + +#include +#include + +// ----------------------------------------------------------------------------- +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CMusAvaAvailabilitySettingObserverImp* CMusAvaAvailabilitySettingObserverImp::NewL( ) + { + MUS_LOG( " [MUSAVA ] -> CMusAvaAvailabilitySettingObserverImp::NewL" ); + CMusAvaAvailabilitySettingObserverImp* self = new (ELeave) CMusAvaAvailabilitySettingObserverImp(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + MUS_LOG( " [MUSAVA ] <- CMusAvaAvailabilitySettingObserverImp::NewL" ); + return self; + } + +// ----------------------------------------------------------------------------- +// C++ destructor. +// ----------------------------------------------------------------------------- +// +CMusAvaAvailabilitySettingObserverImp::~CMusAvaAvailabilitySettingObserverImp() + { + MUS_LOG( " [MUSAVA ] -> CMusAvaAvailabilitySettingObserverImp::~CMusAvaAvailabilitySettingObserverImp" ); + + MUS_LOG( " [MUSAVA ] <- CMusAvaAvailabilitySettingObserverImp::~CMusAvaAvailabilitySettingObserverImp" ); + } + +// ----------------------------------------------------------------------------- +// Symbian second-phase constructor. +// ----------------------------------------------------------------------------- +// +void CMusAvaAvailabilitySettingObserverImp::ConstructL() + { + MUS_LOG( " [MUSAVA ] -> CMusAvaAvailabilitySettingObserverImp::ConstructL" ); + iAvailabilityReport = EFalse; + iStopComplete = EFalse; + MUS_LOG( " [MUSAVA ] <- CMusAvaAvailabilitySettingObserverImp::ConstructL" ); + } + +// ----------------------------------------------------------------------------- +// C++ constructor. +// ----------------------------------------------------------------------------- +// +CMusAvaAvailabilitySettingObserverImp::CMusAvaAvailabilitySettingObserverImp( ) + { + MUS_LOG( "[MUSAVA ] -> CMusAvaAvailabilitySettingObserverImp::CMusAvaAvailabilitySettingObserverImp" ); + + MUS_LOG( "[MUSAVA ] <- CMusAvaAvailabilitySettingObserverImp::CMusAvaAvailabilitySettingObserverImp" ); + } + + +void CMusAvaAvailabilitySettingObserverImp::AvailabilityReport( + MMusAvaObserver::TAvailabilityState aState, + MMusAvaObserver::TAvailabilityStatus aStatus, + MMusAvaObserver::TAvailabilityName aName, + TInt aSystemError ) + { + iAvailabilityReport = ETrue; + iState = aState; + iStatus = aStatus; + iName = aName; + iSystemError = aSystemError; + } + + + void CMusAvaAvailabilitySettingObserverImp::StopComplete( MMusAvaObserver::TAvailabilityState aState, + MMusAvaObserver::TAvailabilityName aName, + TInt aSystemError ) + { + iStopComplete = ETrue; + iState = aState; + iName = aName; + iSystemError = aSystemError; + } + + + + + + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/musavacallmonitorobserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/musavacallmonitorobserver.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,109 @@ +/* +* 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: Unit test stub of MMusCallMonitorObserver +* +*/ + + +#include "musavacallmonitorobserver.h" +#include + + +// ----------------------------------------------------------------------------- +// CMusAvaCallMonitorObserverStub::NewL() +// ----------------------------------------------------------------------------- +// +CMusAvaCallMonitorObserverStub* CMusAvaCallMonitorObserverStub::NewL() + { + CMusAvaCallMonitorObserverStub* self = + new ( ELeave ) CMusAvaCallMonitorObserverStub(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CMusAvaCallMonitorObserverStub::~CMusAvaCallMonitorObserverStub() +// ----------------------------------------------------------------------------- +// +CMusAvaCallMonitorObserverStub::~CMusAvaCallMonitorObserverStub() + { + delete iTelNumber; + } + +// ----------------------------------------------------------------------------- +// CMusAvaCallMonitorObserverStub::CallConnectedL() +// ----------------------------------------------------------------------------- +// +void CMusAvaCallMonitorObserverStub::CallConnectedL( const TDesC& aTelNumber, + TBool aIsSipUri ) + { + CopyDescriptorL( aTelNumber ); + iIsSipUri = aIsSipUri; + } + +// ----------------------------------------------------------------------------- +// CMusAvaCallMonitorObserverStub::CallHoldL() +// ----------------------------------------------------------------------------- +// +void CMusAvaCallMonitorObserverStub::CallHoldL( const TDesC& aTelNumber, + TBool aIsSipUri ) + { + CopyDescriptorL( aTelNumber ); + iIsSipUri = aIsSipUri; + } + +// ----------------------------------------------------------------------------- +// CMusAvaCallMonitorObserverStub::ConferenceCallL() +// ----------------------------------------------------------------------------- +// +void CMusAvaCallMonitorObserverStub::ConferenceCallL() + { + } + +// ----------------------------------------------------------------------------- +// CMusAvaCallMonitorObserverStub::NoActiveCallL() +// ----------------------------------------------------------------------------- +// +void CMusAvaCallMonitorObserverStub::NoActiveCallL() + { + } + +// ----------------------------------------------------------------------------- +// CMusAvaCallMonitorObserverStub::CMusAvaCallMonitorObserverStub() +// ----------------------------------------------------------------------------- +// +CMusAvaCallMonitorObserverStub::CMusAvaCallMonitorObserverStub() + { + } + +// ----------------------------------------------------------------------------- +// CMusAvaCallMonitorObserverStub::ConstructL() +// ----------------------------------------------------------------------------- +// +void CMusAvaCallMonitorObserverStub::ConstructL() + { + } + +// ----------------------------------------------------------------------------- +// CMusAvaCallMonitorObserverStub::CopyDescriptorL() +// ----------------------------------------------------------------------------- +// +void CMusAvaCallMonitorObserverStub::CopyDescriptorL( const TDesC& aSource ) + { + HBufC* newDescriptor = aSource.AllocL(); + delete iTelNumber; + iTelNumber = newDescriptor; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/musavacapabilityqueryobserverimp.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/musavacapabilityqueryobserverimp.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,85 @@ +/* +* Copyright (c) 2005-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: Capability query observer +* +*/ + +#include "musavacapabilityqueryobserverimp.h" +//#include "musavacapabilityquerybase.h" + + +// ------------------------------------------------------------------------- +// C++ constructor. +// ------------------------------------------------------------------------- +// +CMusAvaCapabilityQueryObserverImp::CMusAvaCapabilityQueryObserverImp() + { + + } + + +void CMusAvaCapabilityQueryObserverImp::CapabilitiesResolved( + const CMusAvaCapabilityQueryBase& /*aSentQuery*/ ) + { + + } + +void CMusAvaCapabilityQueryObserverImp::CapabilitiesResolvedL( + const TDesC& /*aUri*/ ) + { + + } + +void CMusAvaCapabilityQueryObserverImp::SetCapabilitiesResolvedForCingular() + { + + } + +TBool CMusAvaCapabilityQueryObserverImp::CapabilitiesResolvedForCingular() + { + + return iCapabilitiesResolvedForCingular; + + } + +void CMusAvaCapabilityQueryObserverImp::SipHeadersL( + const MDesCArray& /*aHeaders*/, + SipStrConsts::TStrings aHeaderType) + { + if (aHeaderType==SipStrConsts::EEmpty) + { + User::Leave(KErrArgument); + } + else + { + // nothing. + } + + } + +void CMusAvaCapabilityQueryObserverImp::VideoCodecsResolvedL( const MDesCArray& aVideoCodecs ) + { + + } + +TBool CMusAvaCapabilityQueryObserverImp::CapabilityQueryAnswered( TBool aAnswered ) + { + return EFalse; + } + +void CMusAvaCapabilityQueryObserverImp::FastModeResolved( + MusSettingsKeys::TFastMode /*aMode*/ ) + { + + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/musavaconnectionMonitorobserverimp.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/musavaconnectionMonitorobserverimp.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,93 @@ +/* +* 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: Implementation class for creating master and slave pattern objects. +* +*/ + + +#include "musunittesting.h" + +#include "musavaconnectionMonitorobserverimp.h" +#include "musavaobserver.h" +#include "CSipSseTestTls.h" +#include "muslogger.h" +#include "CSipSseTestTls.h" + +#include +#include + +// ----------------------------------------------------------------------------- +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CMMusAvaConnectionMonitorObserverImp* CMMusAvaConnectionMonitorObserverImp::NewL( ) + { + MUS_LOG( " [MUSAVA ] -> CMMusAvaConnectionMonitorObserverImp::NewL" ); + CMMusAvaConnectionMonitorObserverImp* self = new (ELeave) CMMusAvaConnectionMonitorObserverImp(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + MUS_LOG( " [MUSAVA ] <- CMMusAvaConnectionMonitorObserverImp::NewL" ); + return self; + } + +// ----------------------------------------------------------------------------- +// C++ destructor. +// ----------------------------------------------------------------------------- +// +CMMusAvaConnectionMonitorObserverImp::~CMMusAvaConnectionMonitorObserverImp() + { + MUS_LOG( " [MUSAVA ] -> CMMusAvaConnectionMonitorObserverImp::~CMMusAvaConnectionMonitorObserverImp" ); + + MUS_LOG( " [MUSAVA ] <- CMMusAvaConnectionMonitorObserverImp::~CMMusAvaConnectionMonitorObserverImp" ); + } + +// ----------------------------------------------------------------------------- +// Symbian second-phase constructor. +// ----------------------------------------------------------------------------- +// +void CMMusAvaConnectionMonitorObserverImp::ConstructL() + { + MUS_LOG( " [MUSAVA ] -> CMMusAvaConnectionMonitorObserverImp::ConstructL" ); + + MUS_LOG( " [MUSAVA ] <- CMMusAvaConnectionMonitorObserverImp::ConstructL" ); + } + +// ----------------------------------------------------------------------------- +// C++ constructor. +// ----------------------------------------------------------------------------- +// +CMMusAvaConnectionMonitorObserverImp::CMMusAvaConnectionMonitorObserverImp( ) + { + MUS_LOG( "[MUSAVA ] -> CMMusAvaConnectionMonitorObserverImp::CMMusAvaConnectionMonitorObserverImp" ); + + MUS_LOG( "[MUSAVA ] <- CMMusAvaConnectionMonitorObserverImp::CMMusAvaConnectionMonitorObserverImp" ); + } + + +// ------------------------------------------------------------------------- +// Constructor function. +// ------------------------------------------------------------------------- +// +void CMMusAvaConnectionMonitorObserverImp::EventL(const CConnMonEventBase& aConnMonEvent ) + { + MUS_LOG( "mus: [MUSAVA] -> CMMusAvaConnectionMonitorObserverImp::EventL()" ); + + iConnMonEventBase = const_cast( &aConnMonEvent ); + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaConnectionAvailability::EventL()" ); + } + + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/musavaobserverimp.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/musavaobserverimp.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,96 @@ +/* +* 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: This observer is used by +* ECOM clients to get function call from the availability Plug-in +* +*/ + + +#include "musavaobserverimp.h" +#include "musavaavailabilityobserver.h" +#include "musavaobserver.h" +#include "muslogger.h" + + +// ------------------------------------------------------------------------- +// Two-phased constructor. +// ------------------------------------------------------------------------- +// +CMusAvaObserverImp* CMusAvaObserverImp::NewL() + { + MUS_LOG( " [MUSAVA ] -> CMusAvaObserverImp::NewL" ); + CMusAvaObserverImp* self = new (ELeave) CMusAvaObserverImp(); + CleanupStack::PushL (self); + self->ConstructL(); + CleanupStack::Pop(); + MUS_LOG( " [MUSAVA ] <- CMusAvaObserverImp::NewL" ); + return self; + } + +// ------------------------------------------------------------------------- +// C++ destructor. +// ------------------------------------------------------------------------- +// +CMusAvaObserverImp::~CMusAvaObserverImp() + { + MUS_LOG( " [MUSAVA ] -> CMusAvaObserverImp::~CMusAvaObserverImp" ); + + MUS_LOG( " [MUSAVA ] <- CMusAvaObserverImp::~CMusAvaObserverImp" ); + } + +// ------------------------------------------------------------------------- +// Symbian second-phase constructor. +// ------------------------------------------------------------------------- +// +void CMusAvaObserverImp::ConstructL() + { + MUS_LOG( " [MUSAVA ] -> CMusAvaObserverImp::ConstructL" ); + + MUS_LOG( " [MUSAVA ] <- CMusAvaObserverImp::ConstructL" ); + } + +// ------------------------------------------------------------------------- +// C++ constructor. +// ------------------------------------------------------------------------- +// +CMusAvaObserverImp::CMusAvaObserverImp() + { + + } +// ----------------------------------------------------------------------------- +// Availability report. +// ----------------------------------------------------------------------------- +// +void CMusAvaObserverImp::AvailabilityChanged( + MMusAvaObserver::TAvailabilityName aName, + MMusAvaObserver::TAvailabilityStatus aStatus ) + { + iStatus= aStatus; + iName = aName; + } + +// ----------------------------------------------------------------------------- +// Availability error report. +// ----------------------------------------------------------------------------- +// +void CMusAvaObserverImp::AvailabilityError( + MMusAvaObserver::TAvailabilityName aName, + MMusAvaObserver::TAvailabilityStatus aStatus ) + { + iStatus= aStatus; + iName = aName; + } + + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/musavaprofileregistryadapterstub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/musavaprofileregistryadapterstub.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,115 @@ +/* +* Copyright (c) 2005-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: Provide interface for the client requestin availability class. +* +*/ + + +#include "musavaprofileregistryadapterstub.h" +#include "musavaobserver.h" +#include "musavaavailability.h" +#include "musavasharedobject.h" +#include "muslogger.h" +#include "musavasettingsimp.h" +#include "musavasip.h" +#include "musavaconnectionmonitor.h" +#include "mussettings.h" +#include "EscapeUtils.h" + +#include +#include + + +// -------------------------------------------------------------------------- +// Symbian two-phase constructor +// -------------------------------------------------------------------------- +// +CMusAvaProfileRegistryAdapterStub* CMusAvaProfileRegistryAdapterStub::NewL() + { + CMusAvaProfileRegistryAdapterStub* self = + CMusAvaProfileRegistryAdapterStub::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// ------------------------------------------------------------------------- +// Two-phased constructor. +// ------------------------------------------------------------------------- +// +CMusAvaProfileRegistryAdapterStub* CMusAvaProfileRegistryAdapterStub::NewLC() + { + CMusAvaProfileRegistryAdapterStub* self = + new (ELeave) CMusAvaProfileRegistryAdapterStub(); + CleanupStack::PushL (self); + self->ConstructL(); + return self; + } + + +// --------------------------------------------------------------------------- +// Destructor. +// --------------------------------------------------------------------------- +// +CMusAvaProfileRegistryAdapterStub::~CMusAvaProfileRegistryAdapterStub() + { + } + + +// --------------------------------------------------------------------------- +// Symbian 2nd phase constructor can leave. +// --------------------------------------------------------------------------- +// +void CMusAvaProfileRegistryAdapterStub::ConstructL() + { + } + + +// ------------------------------------------------------------------------- +// Constructor. +// ------------------------------------------------------------------------- +// +CMusAvaProfileRegistryAdapterStub::CMusAvaProfileRegistryAdapterStub() + { + iProfileId = 0; + iEvent = MSIPProfileRegistryObserver::EProfileCreated; + iError = -1; + } + +// ------------------------------------------------------------------------- +// An event related to SIP Profile has accorred +// ------------------------------------------------------------------------- +// +void CMusAvaProfileRegistryAdapterStub::ProfileRegistryEventOccurred( + TUint32 aProfileId, + MSIPProfileRegistryObserver::TEvent aEvent) + { + iProfileId = aProfileId; + iEvent = aEvent; + } + +// ------------------------------------------------------------------------- +// An asynchronous error has occurred related to SIP profile +// Event is send to those observers, who have the +// corresponding profile instantiated. +// ------------------------------------------------------------------------- +// +void CMusAvaProfileRegistryAdapterStub::ProfileRegistryErrorOccurred( + TUint32 aProfileId, + TInt aError ) + { + iProfileId = aProfileId; + iError = aError; + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/musavasettingsobserverimp.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/musavasettingsobserverimp.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,111 @@ +/* +* 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: Implementation class for creating master and slave pattern objects. +* +*/ + + +#include "musavasettingsobserverimp.h" +#include "musunittesting.h" +#include "musavaobserver.h" +#include "CSipSseTestTls.h" +#include "muslogger.h" + + +#include +#include + +// ----------------------------------------------------------------------------- +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CMusAvaSettingsObserverImp* CMusAvaSettingsObserverImp::NewL( ) + { + MUS_LOG( " [MUSAVA ] -> CMusAvaSettingsObserverImp::NewL" ); + CMusAvaSettingsObserverImp* self = new (ELeave) CMusAvaSettingsObserverImp(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + MUS_LOG( " [MUSAVA ] <- CMusAvaSettingsObserverImp::NewL" ); + return self; + } + +// ----------------------------------------------------------------------------- +// C++ destructor. +// ----------------------------------------------------------------------------- +// +CMusAvaSettingsObserverImp::~CMusAvaSettingsObserverImp() + { + MUS_LOG( " [MUSAVA ] -> CMusAvaSettingsObserverImp::~CMusAvaSettingsObserverImp" ); + + MUS_LOG( " [MUSAVA ] <- CMusAvaSettingsObserverImp::~CMusAvaSettingsObserverImp" ); + } + +// ----------------------------------------------------------------------------- +// Symbian second-phase constructor. +// ----------------------------------------------------------------------------- +// +void CMusAvaSettingsObserverImp::ConstructL() + { + MUS_LOG( " [MUSAVA ] -> CMusAvaSettingsObserverImp::ConstructL" ); + + MUS_LOG( " [MUSAVA ] <- CMusAvaSettingsObserverImp::ConstructL" ); + } + +// ----------------------------------------------------------------------------- +// C++ constructor. +// ----------------------------------------------------------------------------- +// +CMusAvaSettingsObserverImp::CMusAvaSettingsObserverImp( ) + { + MUS_LOG( "[MUSAVA ] -> CMusAvaSettingsObserverImp::CMusAvaSettingsObserverImp" ); + + MUS_LOG( "[MUSAVA ] <- CMusAvaSettingsObserverImp::CMusAvaSettingsObserverImp" ); + } + + + +// ----------------------------------------------------------------------------- +// Availability report. +// ----------------------------------------------------------------------------- +// +MMusAvaSettingsObserver::TApplicationState CMusAvaSettingsObserverImp::ApplicationState() + { + MUS_LOG( " [MUSAVA ] -> CMusAvaSettingsObserverImp::ApplicationState" ); + MUS_LOG( " [MUSAVA ] <- CMusAvaSettingsObserverImp::ApplicationState" ); + return MMusAvaSettingsObserver::EApplicationIsRunning; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMusAvaSettingsObserverImp::OptionAllowed() + { + MUS_LOG( " [MUSAVA ] -> CMusAvaSettingsObserverImp::OptionAllowed" ); + MUS_LOG( " [MUSAVA ] <- CMusAvaSettingsObserverImp::OptionAllowed" ); + return iOptionAllowed; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusAvaSettingsObserverImp::StartApplicationL( MultimediaSharing::TMusUseCase /*aUseCase*/ ) + { + iApplicationStarted = ETrue; + } + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/musavasipadapterimp.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/musavasipadapterimp.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,308 @@ +/* +* 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: +* +*/ + + +#include "musavasipadapterimp.h" +#include + + +// ------------------------------------------------------------------------- +// Two-phased constructor. +// ------------------------------------------------------------------------- +// +CMusAvaSipAdapterImp* CMusAvaSipAdapterImp::NewL() + { + CMusAvaSipAdapterImp* self = new (ELeave) CMusAvaSipAdapterImp(); + CleanupStack::PushL (self); + self->ConstructL(); + CleanupStack::Pop(); + return self; + } + +// ------------------------------------------------------------------------- +// C++ destructor. +// ------------------------------------------------------------------------- +// +CMusAvaSipAdapterImp::~CMusAvaSipAdapterImp() + { + CleanServerTransaction(); + delete iInviteAssoc; + } + +// ------------------------------------------------------------------------- +// Symbian second-phase constructor. +// ------------------------------------------------------------------------- +// +void CMusAvaSipAdapterImp::ConstructL() + { + } + +// ------------------------------------------------------------------------- +// C++ constructor. +// ------------------------------------------------------------------------- +// +CMusAvaSipAdapterImp::CMusAvaSipAdapterImp() + { + + } + +// ------------------------------------------------------------------------- +// CMusAvaSipAdapterImp::Reset() +// ------------------------------------------------------------------------- +// +void CMusAvaSipAdapterImp::Reset() + { + iClientTransaction = NULL; + CleanServerTransaction(); + iState = CSIPConnection::EInit; + iError = KErrNone; + iRegBinding = NULL; + iRefresh = NULL; + iDialogAssoc = NULL; + iDialog = NULL; + iIapId = 0; + delete iInviteAssoc; + iInviteAssoc = NULL; + iTransaction = NULL; + iReturnCode = KErrNone; + } + +void CMusAvaSipAdapterImp::CleanServerTransaction() + { + if ( iServerTransctionOwned ) + { + delete iServerTransaction; + } + iServerTransaction = NULL; + } + +void CMusAvaSipAdapterImp::SetServerTransaction( CSIPServerTransaction& aTransaction ) + { + iServerTransctionOwned = EFalse; + iServerTransaction = &aTransaction; + } + +void CMusAvaSipAdapterImp::SetServerTransaction( CSIPServerTransaction* aTransaction ) + { + iServerTransctionOwned = ETrue; + iServerTransaction = aTransaction; + } + +TInt CMusAvaSipAdapterImp::IncomingRequest( TUint32 aIapId, + CSIPServerTransaction* aTransaction ) + { + if ( iReturnCode != KErrNone ) + { + return iReturnCode; + } + iIapId = aIapId; + CleanServerTransaction(); + SetServerTransaction( aTransaction ); + return iReturnCode; + } + +TInt CMusAvaSipAdapterImp::TimedOut( CSIPServerTransaction& aTransaction ) + { + if ( iReturnCode != KErrNone ) + { + return iReturnCode; + } + CleanServerTransaction(); + SetServerTransaction( aTransaction ); + return iReturnCode; + } + +TInt CMusAvaSipAdapterImp::IncomingRequest( CSIPServerTransaction* aTransaction ) + { + if ( iReturnCode != KErrNone ) + { + return iReturnCode; + } + CleanServerTransaction(); + SetServerTransaction( aTransaction ); + return iReturnCode; + } + +TInt CMusAvaSipAdapterImp::IncomingRequest( CSIPServerTransaction* aTransaction, + CSIPDialog& aDialog ) + { + if ( iReturnCode != KErrNone ) + { + return iReturnCode; + } + + CleanServerTransaction(); + SetServerTransaction( aTransaction ); + iDialog = &aDialog; + return iReturnCode; + } + +TInt CMusAvaSipAdapterImp::IncomingResponse( CSIPClientTransaction& aTransaction ) + { + if ( iReturnCode != KErrNone ) + { + return iReturnCode; + } + iClientTransaction = &aTransaction; + return iReturnCode; + } + +TInt CMusAvaSipAdapterImp::IncomingResponse ( + CSIPClientTransaction& aTransaction, + CSIPDialogAssocBase& aDialogAssoc ) + { + if ( iReturnCode != KErrNone ) + { + return iReturnCode; + } + iClientTransaction = &aTransaction; + iDialogAssoc = &aDialogAssoc; + return iReturnCode; + } + +TInt CMusAvaSipAdapterImp::IncomingResponse( + CSIPClientTransaction& aTransaction, + CSIPInviteDialogAssoc* aDialogAssoc ) + { + if ( iReturnCode != KErrNone ) + { + return iReturnCode; + } + iClientTransaction = &aTransaction; + delete iInviteAssoc; + iInviteAssoc = aDialogAssoc; + return iReturnCode; + } + +TInt CMusAvaSipAdapterImp::IncomingResponse( CSIPClientTransaction& aTransaction, + CSIPRegistrationBinding& aRegistration ) + { + if ( iReturnCode != KErrNone ) + { + return iReturnCode; + } + iClientTransaction = &aTransaction; + iRegBinding = &aRegistration; + return iReturnCode; + } + +TInt CMusAvaSipAdapterImp::ErrorOccured( TInt aError, + CSIPTransactionBase& aTransaction ) + { + if ( iReturnCode != KErrNone ) + { + return iReturnCode; + } + iError = aError; + iTransaction = &aTransaction; + return iReturnCode; + } + +TInt CMusAvaSipAdapterImp::ErrorOccured( TInt aError, + CSIPClientTransaction& aTransaction, + CSIPRegistrationBinding& aRegistration ) + { + if ( iReturnCode != KErrNone ) + { + return iReturnCode; + } + iError = aError; + iClientTransaction = &aTransaction; + iRegBinding = &aRegistration; + return iReturnCode; + } + +TInt CMusAvaSipAdapterImp::ErrorOccured( TInt aError, + CSIPTransactionBase& aTransaction, + CSIPDialogAssocBase& aDialogAssoc ) + { + if ( iReturnCode != KErrNone ) + { + return iReturnCode; + } + iError = aError; + iTransaction = &aTransaction; + iDialogAssoc = &aDialogAssoc; + return iReturnCode; + } + +TInt CMusAvaSipAdapterImp::ErrorOccured( TInt aError, CSIPRefresh& aSIPRefresh ) + { + if ( iReturnCode != KErrNone ) + { + return iReturnCode; + } + iError = aError; + iRefresh = &aSIPRefresh; + return iReturnCode; + } + +TInt CMusAvaSipAdapterImp::ErrorOccured( TInt aError, + CSIPRegistrationBinding& aRegistration ) + { + if ( iReturnCode != KErrNone ) + { + return iReturnCode; + } + iError = aError; + iRegBinding = &aRegistration; + return iReturnCode; + } + +TInt CMusAvaSipAdapterImp::ErrorOccured( TInt aError, + CSIPDialogAssocBase& aDialogAssoc ) + { + if ( iReturnCode != KErrNone ) + { + return iReturnCode; + } + iError = aError; + iDialogAssoc = &aDialogAssoc; + return iReturnCode; + } + +TInt CMusAvaSipAdapterImp::InviteCompleted( CSIPClientTransaction& aTransaction ) + { + if ( iReturnCode != KErrNone ) + { + return iReturnCode; + } + iClientTransaction = &aTransaction; + return iReturnCode; + } + +TInt CMusAvaSipAdapterImp::InviteCanceled( CSIPServerTransaction& aTransaction ) + { + if ( iReturnCode != KErrNone ) + { + return iReturnCode; + } + CleanServerTransaction(); + SetServerTransaction( aTransaction ); + return iReturnCode; + } + +TInt CMusAvaSipAdapterImp::ConnectionStateChanged( CSIPConnection::TState aState ) + { + if ( iReturnCode != KErrNone ) + { + return iReturnCode; + } + iState = aState; + return iReturnCode; + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/musavatelephonystatusobserverimp.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/musavatelephonystatusobserverimp.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,117 @@ +/* +* 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: Implementation class for creating master and slave pattern objects. +* +*/ + + +#include "musunittesting.h" + +#include "musavatelephonystatusobserverimp.h" +#include "musavaobserver.h" +#include "CSipSseTestTls.h" +#include "muslogger.h" +#include "CSipSseTestTls.h" + +#include +#include +#include +// ----------------------------------------------------------------------------- +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CMusAvaTelephonyStatusObserverImp* CMusAvaTelephonyStatusObserverImp::NewL( ) + { + MUS_LOG( " [MUSAVA ] -> CMusAvaTelephonyStatusObserverImp::NewL" ); + CMusAvaTelephonyStatusObserverImp* self = + new (ELeave) CMusAvaTelephonyStatusObserverImp(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + MUS_LOG( " [MUSAVA ] <- CMusAvaTelephonyStatusObserverImp::NewL" ); + return self; + } + +// ----------------------------------------------------------------------------- +// C++ destructor. +// ----------------------------------------------------------------------------- +// +CMusAvaTelephonyStatusObserverImp::~CMusAvaTelephonyStatusObserverImp() + { + MUS_LOG( " [MUSAVA ] -> CMusAvaTelephonyStatusObserverImp::\ + ~CMusAvaTelephonyStatusObserverImp" ); + + MUS_LOG( " [MUSAVA ] <- CMusAvaTelephonyStatusObserverImp::\ + ~CMusAvaTelephonyStatusObserverImp" ); + } + +// ----------------------------------------------------------------------------- +// Symbian second-phase constructor. +// ----------------------------------------------------------------------------- +// +void CMusAvaTelephonyStatusObserverImp::ConstructL() + { + MUS_LOG( " [MUSAVA ] -> CMusAvaTelephonyStatusObserverImp::ConstructL" ); + + MUS_LOG( " [MUSAVA ] <- CMusAvaTelephonyStatusObserverImp::ConstructL" ); + } + +// ----------------------------------------------------------------------------- +// C++ constructor. +// ----------------------------------------------------------------------------- +// +CMusAvaTelephonyStatusObserverImp::CMusAvaTelephonyStatusObserverImp( ) + { + MUS_LOG( "[MUSAVA ] -> CMusAvaTelephonyStatusObserverImp::\ + CMusAvaTelephonyStatusObserverImp" ); + + MUS_LOG( "[MUSAVA ] <- CMusAvaTelephonyStatusObserverImp::\ + CMusAvaTelephonyStatusObserverImp" ); + } + + +// ------------------------------------------------------------------------- +// +// ------------------------------------------------------------------------- +// +void CMusAvaTelephonyStatusObserverImp::NetworkRegistrationStatus( + RMobilePhone::TMobilePhoneRegistrationStatus aRegStatus ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaTelephonyStatusObserverImp::\ + NetworkRegistrationStatus()" ); + + iPhoneRegistrationStatus = aRegStatus; + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaTelephonyStatusObserverImp::\ + NetworkRegistrationStatus()" ); + } + +// ------------------------------------------------------------------------- +// +// ------------------------------------------------------------------------- +// +void CMusAvaTelephonyStatusObserverImp::PhoneNetworkModeStatus( + RMobilePhone::TMobilePhoneNetworkMode aStatus ) + { + MUS_LOG( "mus: [MUSAVA] -> CMusAvaTelephonyStatusObserverImp::\ + PhoneNetworkModeStatus()" ); + + iPhoneNetworkMode = aStatus; + + MUS_LOG( "mus: [MUSAVA] <- CMusAvaTelephonyStatusObserverImp::\ + PhoneNetworkModeStatus()" ); + } + + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/musavatimer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/musavatimer.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,129 @@ +/* +* 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: ?Description +* +*/ + + +// INCLUDES +#include "musavatimer.h" +#include + +const TUint KMicroSecondsInMilliSecond = 1000; + +// ---------------------------------------------------------------------------- +// CMusAvaTimer::NewL +// ---------------------------------------------------------------------------- +// +CMusAvaTimer* CMusAvaTimer::NewL() + { + CMusAvaTimer* self = CMusAvaTimer::NewLC (); + CleanupStack::Pop (self); + return self; + } + +// ---------------------------------------------------------------------------- +// CMusAvaTimer::NewLC +// ---------------------------------------------------------------------------- +// +CMusAvaTimer* CMusAvaTimer::NewLC () + { + CMusAvaTimer* self = new(ELeave)CMusAvaTimer; + CleanupStack::PushL (self); + self->ConstructL (); + return self; + } + +// ---------------------------------------------------------------------------- +// CMusAvaTimer::ConstructL +// ---------------------------------------------------------------------------- +// +void CMusAvaTimer::ConstructL () + { + CActiveScheduler::Add(this); + User::LeaveIfError (iTimer.CreateLocal()); + } + + +// ---------------------------------------------------------------------------- +// CMusAvaTimer::ConstructL +// ---------------------------------------------------------------------------- +// +CMusAvaTimer::CMusAvaTimer () +: CActive(EPriorityHigh) + { + } + + +// ---------------------------------------------------------------------------- +// CMusAvaTimer::~CMusAvaTimer +// ---------------------------------------------------------------------------- +// +CMusAvaTimer::~CMusAvaTimer () + { + CActive::Cancel(); + iTimer.Close(); + } + +// ---------------------------------------------------------------------------- +// CMusAvaTimer::StopActiveSchedulerAfter +// ---------------------------------------------------------------------------- +// +void CMusAvaTimer::StopActiveSchedulerAfter ( TInt aMilliSeconds, + TRequestStatus* aStatus ) + { + + + if (!IsActive()) + { + iTimer.After( iStatus, TTimeIntervalMicroSeconds32(aMilliSeconds * 1000) ); + + iRequestStatus = aStatus; + //*iRequestStatus = KRequestPending; + *iRequestStatus = KErrNone; + SetActive (); + TRequestStatus* ptr = &iStatus; + //User::RequestComplete(ptr, KErrNone); + //TInt result = KErrNone; + //CActiveScheduler::RunIfReady( result, EPriorityStandard ); + /*TRequestStatus* ptr = &iStatus; + iStatus = KRequestPending; + SetActive(); + User::RequestComplete(ptr, KErrNone); + TInt result = KErrNone; + CActiveScheduler::RunIfReady( result, EPriorityStandard );*/ + } + } + +// ---------------------------------------------------------------------------- +// CMusAvaTimer::RunL +// ---------------------------------------------------------------------------- +// +void CMusAvaTimer::RunL () + { + TRequestStatus* pRS = iRequestStatus; + User::RequestComplete(pRS, KErrNone ); + } + +// ---------------------------------------------------------------------------- +// CMusAvaTimer::DoCancel +// ---------------------------------------------------------------------------- +// +void CMusAvaTimer::DoCancel () + { + iTimer.Cancel(); + } + +// End of File + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/muscallmonitorstub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/muscallmonitorstub.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,90 @@ +/* +* 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: ?Description +* +*/ + + +// INCLUDES +#include "muscallmonitorbase.h" +#include "muscallstatusmonitor.h" + +#include + + +// +//CMusCallMonitorBase stub +// + +CMusCallMonitorBase::~CMusCallMonitorBase() + { + } + +// ----------------------------------------------------------------------------- +// C++ constructor. +// ----------------------------------------------------------------------------- +// +CMusCallMonitorBase::CMusCallMonitorBase(const RMobileCall& aCall, + MMusTsyPropertyObserver& aObserver, + MMusCallStateObserver& aCallStateObserver ) + : CActive( EPriorityNormal ),iCall(aCall),iTsyObserver( aObserver ),iCallStateObserver( aCallStateObserver ) + + { + } + +// ----------------------------------------------------------------------------- +// CMusCallMonitorBase::SetStateL( TInt aError ) +// Sets the Call State to Property +// ----------------------------------------------------------------------------- +// +void CMusCallMonitorBase::SetStateL(NMusSessionInformationApi::TMusCallEvent /*aVal*/) + { + } + + +// ----------------------------------------------------------------------------- +// CMusCallMonitorBase::RunError( TInt aError ) +// Implemented for CActive. +// Will be called automatically by framework when RunL Leaves. +// ----------------------------------------------------------------------------- +// + +TInt CMusCallMonitorBase::RunError( TInt /*aError*/ ) + { + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CMusCallMonitorBase::NotifyCallStateChanged() +// Notify TSYobserver that our call status or call event state changed +// ----------------------------------------------------------------------------- +// +void CMusCallMonitorBase::NotifyCallStateChanged( NMusSessionInformationApi::TMusCallEvent /*aVal*/ ) + { + } + + +// ----------------------------------------------------------------------------- +// MusCallStatusMonitor +// ----------------------------------------------------------------------------- +// + +CMusCallStatusMonitor* CMusCallStatusMonitor::NewL(const RMobileCall&, MMusTsyPropertyObserver&, + MMusCallStateObserver& ) + { + return NULL; + } + +// End of File + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/sipprofile.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/sipprofile.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,172 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 FILES + +#include "sipprofile.h" +#include "CSipSseTestTls.h" +#include "musunittesting.h" +//#include "sipmanagedprofile.h" +#include "sipprofileregistry.h" +//#include "sipconcreteprofile.h" +#include "SIPProfileTypeInfo.h" + +_LIT8(KSIPProfileDefAOR, "user@aa"); + + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// CSIPProfile::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CSIPProfile* CSIPProfile::NewL(CSIPProfileRegistry* aSIPRegistry) + { + CSIPProfile* self = CSIPProfile::NewLC (aSIPRegistry); + CleanupStack::Pop(); + return self; + } + +// ----------------------------------------------------------------------------- +// CSIPProfile::NewLC +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CSIPProfile* CSIPProfile::NewLC(CSIPProfileRegistry* aSIPRegistry) + { + CSIPProfile* self = new(ELeave)CSIPProfile(aSIPRegistry); + CleanupStack::PushL (self); + self->ConstructL (); + return self; + } + +// ----------------------------------------------------------------------------- +// CSIPProfile::~CSIPProfile +// ----------------------------------------------------------------------------- +// +EXPORT_C CSIPProfile::~CSIPProfile() + { + delete iArray; + } + +// ----------------------------------------------------------------------------- +// CSIPProfile::GetParameter +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CSIPProfile::GetParameter(TUint32 /*aParam*/, TDesC8 const *& aVal ) const + { + const TDesC8& val= KSIPProfileDefAOR; + aVal = &val; + return iError; + } + +// ----------------------------------------------------------------------------- +// CSIPProfile::GetParameter +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CSIPProfile::GetParameter(TUint32 /*aParam*/, TUint32& aVal) const + { + aVal = 1; + + CSipSseTestTls* tls = CSipSseTestTls::Storage(); + if ( tls ) + { + return tls->Error(); + } + else + { + return iError; + } + } + +// ----------------------------------------------------------------------------- +// CSIPProfile::GetParameter +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CSIPProfile::GetParameter(TUint32 /*aParam*/, TBool& aVal) const + { + aVal = iRegistered; + return iError; + } + +// ----------------------------------------------------------------------------- +// CSIPProfile::GetParameter +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CSIPProfile::GetParameter(TUint32 /*aParam*/, + MDesC8Array const *& aVal) const + { + if ( !iError ) + { + aVal = iArray; + } + return iError; + } + +// ----------------------------------------------------------------------------- +// CSIPProfile::Type +// ----------------------------------------------------------------------------- +// +EXPORT_C const TSIPProfileTypeInfo& CSIPProfile::Type() const + { + return iSIPProfileType; + } + +// ----------------------------------------------------------------------------- +// CSIPProfile::CSIPProfile +// ----------------------------------------------------------------------------- +// +CSIPProfile::CSIPProfile(CSIPProfileRegistryBase* aRegistry): + iSIPProfileRegistry(aRegistry), iEnabled(EFalse), iRegistered( ETrue ), iError(0) + { + } + +// ----------------------------------------------------------------------------- +// CSIPProfile::ConstructL +// ----------------------------------------------------------------------------- +// +void CSIPProfile::ConstructL() + { + CDesC8Array* array = new( ELeave ) CDesC8ArrayFlat( 5 ); + CleanupStack::PushL( array ); + array->AppendL( _L8( "sip:user@domain.com" ) ); + array->AppendL( _L8( "sip:user2@domain.com" ) ); + CleanupStack::Pop( array ); + iArray = array; + } + +// ----------------------------------------------------------------------------- +// CSIPProfile::IsContextActive +// ----------------------------------------------------------------------------- +// +TBool CSIPProfile::IsContextActive() const + { + return ETrue; + } + +// ----------------------------------------------------------------------------- +// CSIPProfile::ContextId +// ----------------------------------------------------------------------------- +// +TUint32 CSIPProfile::ContextId() const + { + return 1; + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/sipprofileregistry.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/sipprofileregistry.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,176 @@ +/* +* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 FILES + +#include "sip.h" +#include "CSipSseTestTls.h" +#include "sipconnection.h" +#include "sipprofileregistry.h" +#include "sipprofileregistryobserver.h" +#include "sipprofile.h" +#include "musunittesting.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistry::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CSIPProfileRegistry* CSIPProfileRegistry::NewL( + CSIP& aSip, + MSIPProfileRegistryObserver& aObserver) + { + CSIPProfileRegistry* self = CSIPProfileRegistry::NewLC(aSip, aObserver); + CleanupStack::Pop(self); + return self; + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistry::NewLC +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CSIPProfileRegistry* CSIPProfileRegistry::NewLC( + CSIP& aSip, + MSIPProfileRegistryObserver& aObserver) + { + CSIPProfileRegistry* self = new (ELeave) CSIPProfileRegistry(aSip, aObserver); + CleanupStack::PushL(self); + self->ConstructL(); + return self; + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistry::~CSIPProfileRegistry +// ----------------------------------------------------------------------------- +// +EXPORT_C CSIPProfileRegistry::~CSIPProfileRegistry() + { + + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistry::EnableL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CSIPProfileRegistry::EnableL(CSIPProfile& /*aSIPProfile*/, + MSIPConnectionObserver& /*&aObserver*/) + { + TBool reg = ETrue; + CSipSseTestTls* tls = CSipSseTestTls::Storage(); + if ( tls ) + { + reg = tls->RegisterSent(); + } + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistry::Disable +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CSIPProfileRegistry::Disable(CSIPProfile& aProfile ) + { + TInt err = KErrNone; + CSipSseTestTls* tls = CSipSseTestTls::Storage(); + if ( tls ) + { + tls->SetRegisterStatus( EFalse ); + } + //aProfile.ConcreteProfile().SetLastRegistrationError(KErrNone); + //TRAPD(err, DisableProfileL(aProfile)); + return err; + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistry::SIP +// ----------------------------------------------------------------------------- +// +EXPORT_C CSIP& CSIPProfileRegistry::SIP() const + { + return iSip; + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistry::ConnectionL +// ----------------------------------------------------------------------------- +// +//EXPORT_C CSIPConnection* CSIPProfileRegistry::ConnectionL( +// /*CSIPProfile& aSIPProfile*/) +// { + //TUint32 apId(0); + //__ASSERT_ALWAYS (iConnectionObserver != 0, User::Leave (KErrArgument)); + //aSIPProfile.GetParameter(KSIPAccessPointId, apId); + //CSIPConnection* connection = iSip.Connection(apId); + //if (connection == 0) + // { + // connection = CSIPConnection::NewL(iSip, apId, + // *iConnectionObserver); + // } + //return connection; +// } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistry::IsEnabled +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool CSIPProfileRegistry::IsEnabled(const CSIPProfile& aSIPProfile ) const + { + CSipSseTestTls* tls = CSipSseTestTls::Storage(); + if ( tls ) + { + return tls->RegisterStatus(); + } + return EFalse; + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistry::CSIPProfileRegistry +// ----------------------------------------------------------------------------- +// +CSIPProfileRegistry::CSIPProfileRegistry( + CSIP& aSip, + MSIPProfileRegistryObserver& aObserver): + CSIPProfileRegistryBase(aObserver), iSip(aSip) + { + CSipSseTestTls* tls = CSipSseTestTls::Storage(); + if ( tls ) + { + tls->StoreRegistry( aObserver ); + } + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistry::ConstructL +// ----------------------------------------------------------------------------- +// +void CSIPProfileRegistry::ConstructL() + { + BaseConstructL(); + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistry::NewInstanceL +// ----------------------------------------------------------------------------- +// +CSIPProfile* CSIPProfileRegistry::NewInstanceL() + { + return CSIPProfile::NewL(this); + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/sipprofileregistrybase.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/sipprofileregistrybase.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,376 @@ +/* +* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 FILES + +#include "sip.h" +#include "sipprofileregistrybase.h" +#include "sipprofileregistryobserver.h" +#include "sipprofileregistry.h" +#include "sipprofileregistryobserver.h" +#include "sipmanagedprofile.h" +#include "musunittesting.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::~CSIPProfileRegistryBase +// ----------------------------------------------------------------------------- +// +EXPORT_C CSIPProfileRegistryBase::~CSIPProfileRegistryBase() + { + + + iProfiles.ResetAndDestroy(); + iProfiles.Close(); + delete iSipClient; + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::ProfilesL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CSIPProfileRegistryBase::ProfilesL( + RPointerArray& aProfiles) + { + // stubs + CSIPProfileRegistry* reg = (CSIPProfileRegistry*) this; + CSIPProfile* profile = CSIPProfile::NewL(reg); + + aProfiles.Append ( profile ); + + + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::ProfilesL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CSIPProfileRegistryBase::ProfilesL( + const TSIPProfileTypeInfo& /*aType*/, + RPointerArray& aProfiles) + { + // stubs + CSIPProfileRegistry* reg = (CSIPProfileRegistry*) this; + CSIPProfile* profile = CSIPProfile::NewL(reg); + aProfiles.Append ( profile ); + + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::ProfilesL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CSIPProfileRegistryBase::ProfilesL( + const TDesC8& /*aAOR*/, + RPointerArray& aProfiles) + { + // stubs + ProfilesL( aProfiles ); + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::ProfilesCommonL +// ----------------------------------------------------------------------------- +// +void CSIPProfileRegistryBase::ProfilesCommonL( + RPointerArray& /*aProfiles*/, + CSIPConcreteProfileHolder* /*aHolder */) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::ProfileL +// ----------------------------------------------------------------------------- +// +EXPORT_C CSIPProfile* CSIPProfileRegistryBase::ProfileL(TUint32 aId) + { + return SIPProfileL(aId); + } + + +// +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::DefaultProfileL +// ----------------------------------------------------------------------------- +// +EXPORT_C CSIPProfile* CSIPProfileRegistryBase::DefaultProfileL() + { + // stubs + CSIPProfileRegistry* reg = (CSIPProfileRegistry*) this; + CSIPProfile* profile = CSIPProfile::NewL(reg); + return profile; + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::SupportedProfileTypesL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CSIPProfileRegistryBase::SupportedProfileTypesL( + RArray& /*aSupportedProfileTypes*/ ) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::LastRegistrationError +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CSIPProfileRegistryBase::LastRegistrationError( + const CSIPProfile& /*aProfile*/) const + { + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::CSIPProfileRegistryBase +// ----------------------------------------------------------------------------- +// +CSIPProfileRegistryBase::CSIPProfileRegistryBase( + MSIPProfileRegistryObserver& aObserver): + iObserver(aObserver) + { + + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::ProfileDeleted +// ----------------------------------------------------------------------------- +// +void CSIPProfileRegistryBase::ProfileDeleted(CSIPProfile& /*aProfile*/) + { + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::EnableProfileL +// ----------------------------------------------------------------------------- +// +void CSIPProfileRegistryBase::EnableProfileL( + CSIPProfile& /*aProfile*/) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::DisableProfileL +// ----------------------------------------------------------------------------- +// +void CSIPProfileRegistryBase::DisableProfileL(CSIPProfile& /*aProfile*/) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::UsageL +// ----------------------------------------------------------------------------- +// +TInt CSIPProfileRegistryBase::UsageL(const CSIPProfile& /*aProfile*/) const + { + User::Leave( KErrNotSupported ); + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::AddProfileL +// ----------------------------------------------------------------------------- +// +void CSIPProfileRegistryBase::AddProfileL(CSIPProfile& aProfile ) + { + //iSipClient = &aProfile; + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::UpdateProfileL +// ----------------------------------------------------------------------------- +// +void CSIPProfileRegistryBase::UpdateProfileL(CSIPProfile& /*aProfile*/) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::RemoveProfileL +// ----------------------------------------------------------------------------- +// +void CSIPProfileRegistryBase::RemoveProfileL(CSIPProfile& /*aProfile*/) + { + iSipClient = NULL; + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::IsDefaultProfileL +// ----------------------------------------------------------------------------- +// +TBool CSIPProfileRegistryBase::IsDefaultProfileL(const CSIPProfile& /*aProfile*/) + { + User::Leave( KErrNotSupported ); + return ETrue; + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::RegistrationStatusChangedL +// ----------------------------------------------------------------------------- +// +void CSIPProfileRegistryBase::NegotiatedSecurityMechanismL( + CSIPConcreteProfile& /*aProfile*/) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::RegisteredAORsL +// ----------------------------------------------------------------------------- +// +void CSIPProfileRegistryBase::RegisteredAORsL(CSIPConcreteProfile& /*aProfile*/) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::SIPProfileL +// ----------------------------------------------------------------------------- +// +CSIPProfile* CSIPProfileRegistryBase::SIPProfileL(TUint32 aId, TInt /*aSize*/) + { + return NewInstanceL(); + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::StoreProfileL +// ----------------------------------------------------------------------------- +// +void CSIPProfileRegistryBase::StoreProfileL(CSIPProfileCleanupItem* /*aCleanupItem*/) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::StoreProfileL +// ----------------------------------------------------------------------------- +// +void CSIPProfileRegistryBase::StoreArrayL( + RPointerArray& /*aProfiles*/, + RPointerArray& /*aRetProfiles*/) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::ProfileItemL +// ----------------------------------------------------------------------------- +// +CSIPProfileItem* CSIPProfileRegistryBase::ProfileItemL(TUint /*aProfileId*/ ) + { + User::Leave( KErrNotSupported ); + return NULL; + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::ProfileIndex +// ----------------------------------------------------------------------------- +// +TInt CSIPProfileRegistryBase::ProfileIndex (TUint /*profileId*/) + { + return 0; + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::ProfileItemByIndex +// ----------------------------------------------------------------------------- +// +CSIPProfileItem* CSIPProfileRegistryBase::ProfileItemByIndex(TUint /*aIndex*/) + { + return NULL; + } + + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::RegistrationStatusChangedL +// ----------------------------------------------------------------------------- +// +void CSIPProfileRegistryBase::RegistrationStatusChangedL(TUint32 /*aProfileId*/, + TInt /*aStatus*/, + TUint32 /*aStatusId*/) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::UpdatedL +// ----------------------------------------------------------------------------- +// +void CSIPProfileRegistryBase::UpdatedL(TUint32 /*aProfileId*/, TUint /*aSize*/) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::AddedL +// ----------------------------------------------------------------------------- +// +void CSIPProfileRegistryBase::AddedL(TUint32 /*aProfileId*/) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::RemovedL +// ----------------------------------------------------------------------------- +// +void CSIPProfileRegistryBase::RemovedL(TUint32 /*aProfileId*/) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::ErrorOccurredL +// ----------------------------------------------------------------------------- +// +void CSIPProfileRegistryBase::ErrorOccurredL(TUint32 /*aProfileId*/, + TInt /*aStatus*/, + TInt /*aError*/ ) + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::BaseConstructL +// ----------------------------------------------------------------------------- +// +void CSIPProfileRegistryBase::BaseConstructL() + { + + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::CrashRevert +// ----------------------------------------------------------------------------- +// +void CSIPProfileRegistryBase::CrashRevert (TAny* /*aItem*/) + { + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistryBase::LocalCrashRevert +// ----------------------------------------------------------------------------- +// +void CSIPProfileRegistryBase::LocalCrashRevert (TAny* /*aItem*/) + { + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/sipprofileregistrystub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/sipprofileregistrystub.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,173 @@ +/* +* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 FILES + +#include "sip.h" +#include "sipconnection.h" +#include "sipprofileregistry.h" +#include "sipprofileregistryobserver.h" +#include "sipprofile.h" +#include "CSipSseTestTls.h" +//#include "sipconcreteprofile.h" + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistry::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CSIPProfileRegistry* CSIPProfileRegistry::NewL( + CSIP& aSip, + MSIPProfileRegistryObserver& aObserver) + { + CSIPProfileRegistry* self = CSIPProfileRegistry::NewLC(aSip, aObserver); + CleanupStack::Pop(self); + return self; + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistry::NewLC +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CSIPProfileRegistry* CSIPProfileRegistry::NewLC( + CSIP& aSip, + MSIPProfileRegistryObserver& aObserver) + { + CSIPProfileRegistry* self = new (ELeave) CSIPProfileRegistry(aSip, aObserver); + CleanupStack::PushL(self); + self->ConstructL(); + return self; + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistry::~CSIPProfileRegistry +// ----------------------------------------------------------------------------- +// +EXPORT_C CSIPProfileRegistry::~CSIPProfileRegistry() + { + + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistry::EnableL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CSIPProfileRegistry::EnableL(CSIPProfile& /*aSIPProfile*/, + MSIPConnectionObserver& /*&aObserver*/) + { + //__ASSERT_ALWAYS (!aSIPProfile.IsEnabled(), User::Leave (KErrArgument)); + //aSIPProfile.ConcreteProfile().SetLastRegistrationError(KErrNone); + //iConnectionObserver = &aObserver; + + //EnableProfileL(aSIPProfile); + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistry::Disable +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CSIPProfileRegistry::Disable(CSIPProfile& /*aProfile*/) + { + TInt err = KErrNone; + iProfileDisabled = ETrue; + //aProfile.ConcreteProfile().SetLastRegistrationError(KErrNone); + //TRAPD(err, DisableProfileL(aProfile)); + return err; + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistry::SIP +// ----------------------------------------------------------------------------- +// +EXPORT_C CSIP& CSIPProfileRegistry::SIP() const + { + return iSip; + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistry::ConnectionL +// ----------------------------------------------------------------------------- +// +//EXPORT_C CSIPConnection* CSIPProfileRegistry::ConnectionL( +// /*CSIPProfile& aSIPProfile*/) +// { + //TUint32 apId(0); + //__ASSERT_ALWAYS (iConnectionObserver != 0, User::Leave (KErrArgument)); + //aSIPProfile.GetParameter(KSIPAccessPointId, apId); + //CSIPConnection* connection = iSip.Connection(apId); + //if (connection == 0) + // { + // connection = CSIPConnection::NewL(iSip, apId, + // *iConnectionObserver); + // } + //return connection; +// } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistry::IsEnabled +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool CSIPProfileRegistry::IsEnabled(const CSIPProfile& /*aSIPProfile*/) const + { + //iProfileEnabled = ETrue; + return ETrue; + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistry::CSIPProfileRegistry +// ----------------------------------------------------------------------------- +// +CSIPProfileRegistry::CSIPProfileRegistry( + CSIP& aSip, + MSIPProfileRegistryObserver& aObserver): + CSIPProfileRegistryBase(aObserver), iSip(aSip) + { + + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistry::ConstructL +// ----------------------------------------------------------------------------- +// +void CSIPProfileRegistry::ConstructL() + { + CSipSseTestTls* tls = CSipSseTestTls::Storage(); + if ( tls ) + { + if ( tls->iRegistryBehavior == KRegistryLeaveAtConstruct ) + { + User::Leave( KErrGeneral ); + } + } + BaseConstructL(); + + } + +// ----------------------------------------------------------------------------- +// CSIPProfileRegistry::NewInstanceL +// ----------------------------------------------------------------------------- +// +CSIPProfile* CSIPProfileRegistry::NewInstanceL() + { + return CSIPProfile::NewL(this); + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/sipprofilestub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/sipprofilestub.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,214 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 FILES + +#include "sipprofile.h" +//#include "sipmanagedprofile.h" +#include "sipprofileregistry.h" +#include "CSipSseTestTls.h" +//#include "sipconcreteprofile.h" +//#include "SIPProfileTypeInfo.h" +//_LIT8(KSIPProfileExtenstionParameter, "%u"); +//const TUint KProfileBufferSize = 25; + +_LIT8(KSIPProfileDefAOR, "user@aa"); + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// CSIPProfile::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CSIPProfile* CSIPProfile::NewL(CSIPProfileRegistry* aSIPRegistry) + { + CSIPProfile* self = CSIPProfile::NewLC (aSIPRegistry); + CleanupStack::Pop(); + return self; + } + +// ----------------------------------------------------------------------------- +// CSIPProfile::NewLC +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CSIPProfile* CSIPProfile::NewLC(CSIPProfileRegistry* aSIPRegistry) + { + CSIPProfile* self = new(ELeave)CSIPProfile(aSIPRegistry); + CleanupStack::PushL (self); + self->ConstructL (); + return self; + } + +// ----------------------------------------------------------------------------- +// CSIPProfile::~CSIPProfile +// ----------------------------------------------------------------------------- +// +EXPORT_C CSIPProfile::~CSIPProfile() + { + delete iRegisteredContact; + if ( iArray ) + { + if ( iArray->Count() > 0 ) + { + iArray->Reset(); + } + delete iArray; + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C const TSIPProfileTypeInfo& CSIPProfile::Type() const + { + return iTypeInfo; + } + +// ----------------------------------------------------------------------------- +// CSIPProfile::GetParameter +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CSIPProfile::GetParameter( TUint32 /*aParam*/, + TDesC8 const *& aVal ) const + { + if ( iRegisteredContact ) + { + aVal = iRegisteredContact; + return KErrNone; + } + else{ + return KErrNotFound; + } + } + +// ----------------------------------------------------------------------------- +// CSIPProfile::GetParameter +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CSIPProfile::GetParameter(TUint32 aParam, TUint32& aVal) const + { + CSipSseTestTls* tls = CSipSseTestTls::Storage(); + if ( tls ) + { + if ( tls->iProfileBehavior == KSIPProfileIdFetchFails && + aParam == KSIPProfileId ) + { + return KErrNotFound; + } + else if ( tls->iProfileBehavior == KSIPIapIdFetchFails && + aParam == KSIPAccessPointId ) + { + return KErrNotFound; + } + } + + if ( iTUint32ValueError == KErrNone ) + { + aVal = iTUint32Value; + } + return iTUint32ValueError; + } + +// ----------------------------------------------------------------------------- +// CSIPProfile::GetParameter +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CSIPProfile::GetParameter(TUint32 aParam, TBool& aVal) const + { + if ( iTBoolValueError == KErrNone ) + { + if ( aParam == KSIPDefaultProfile ) + { + aVal = iIsDefaultProfile; + } + else + { + aVal = iTBoolValue; + } + } + + return iTBoolValueError; + } + + +// ----------------------------------------------------------------------------- +// CSIPProfile::GetParameter +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CSIPProfile::GetParameter( TUint32 /*aParam*/, + MDesC8Array const *& aVal) const + { + if ( iArray ) + { + aVal = iArray; + } + else + { + aVal = NULL; + } + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// CSIPProfile::CSIPProfile +// ----------------------------------------------------------------------------- +// +CSIPProfile::CSIPProfile(CSIPProfileRegistryBase* aRegistry): + iSIPProfileRegistry(aRegistry), + iEnabled(EFalse), + iTUint32Value( 1 ), + iTUint32ValueError( KErrNone ), + iTBoolValue( ETrue ), + iTBoolValueError( KErrNone ), + iIsDefaultProfile( EFalse ) + { + iTypeInfo.iSIPProfileClass = TSIPProfileTypeInfo::EInternet; + } + +// ----------------------------------------------------------------------------- +// CSIPProfile::ConstructL +// ----------------------------------------------------------------------------- +// +void CSIPProfile::ConstructL() + { + } + +// ----------------------------------------------------------------------------- +// CSIPProfile::IsContextActive +// ----------------------------------------------------------------------------- +// +TBool CSIPProfile::IsContextActive() const + { + return ETrue; + } + +// ----------------------------------------------------------------------------- +// CSIPProfile::ContextId +// ----------------------------------------------------------------------------- +// +TUint32 CSIPProfile::ContextId() const + { + return 1; + } + +// end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaCallEventMonitor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaCallEventMonitor.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,94 @@ +/* +* 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: +* +*/ + + +#ifndef __UT_CMUSAVACALLEVENTMONITOR_H__ +#define __UT_CMUSAVACALLEVENTMONITOR_H__ + +#ifdef __MWERKS__ +#pragma warn_emptydecl off +#pragma warn_illtokenpasting off +#endif + +// EXTERNAL INCLUDES +#include + +// INTERNAL INCLUDES + +// FORWARD DECLARATIONS +class CMusAvaCallEventMonitor; +class CMusAvaCallMonitorObserverStub; + + +#include +#ifndef NONSHARABLE_CLASS + #define NONSHARABLE_CLASS(x) class x +#endif + +// CLASS DEFINITION +/** + * + * EUnitWizard generated test class. + * + */ +NONSHARABLE_CLASS( UT_CMusAvaCallEventMonitor ) + : public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static UT_CMusAvaCallEventMonitor* NewL(); + static UT_CMusAvaCallEventMonitor* NewLC(); + /** + * Destructor + */ + ~UT_CMusAvaCallEventMonitor(); + + private: // Constructors and destructors + + UT_CMusAvaCallEventMonitor(); + void ConstructL(); + + public: // From observer interface + + + + private: // New methods + + void SetupL(); + + void Teardown(); + + void UT_CMusAvaCallEventMonitor_GetTelNumberLL(); + + + private: // Data + + EUNIT_DECLARE_TEST_TABLE; + + // Owned + CMusAvaCallEventMonitor* iCallEventMonitor; + + // Owned + CMusAvaCallMonitorObserverStub* iObserver; + }; + +#endif // __UT_CMUSAVACALLEVENTMONITOR_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaCapability.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaCapability.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,135 @@ +/* +* 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: +* +*/ + + +#ifndef __UT_CMUSAVACAPABILITY_H__ +#define __UT_CMUSAVACAPABILITY_H__ + +#ifdef __MWERKS__ +#pragma warn_emptydecl off +#pragma warn_illtokenpasting off +#endif + +// EXTERNAL INCLUDES +#include + +#include "mussettingskeys.h" + +// INTERNAL INCLUDES + + +// FORWARD DECLARATIONS +class CMusAvaCapability; +class CMusAvaCapabilityExchange; +class CSIP; +class CSIPConnection; +class CSIPProfile; +class CMusAvaOptionHandler; +class CMusAvaObserverImp; +class CMusAvaSettingsImp; +class CMusAvaAvailabilityObserverImp; +class CMusAvaCapabilityQueryObserverImp; +class CSipSseTestTls; + +#include +#ifndef NONSHARABLE_CLASS + #define NONSHARABLE_CLASS(x) class x +#endif + +// CLASS DEFINITION +/** + * + * EUnitWizard generated test class. + * + */ +NONSHARABLE_CLASS( UT_CMusAvaCapability ) + : public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static UT_CMusAvaCapability* NewL(); + static UT_CMusAvaCapability* NewLC(); + /** + * Destructor + */ + ~UT_CMusAvaCapability(); + + private: // Constructors and destructors + + UT_CMusAvaCapability(); + void ConstructL(); + + public: // From observer interface + + + + private: // New methods + + void SetupL(); + + void Teardown(); + + void Setup1L(); + + void Teardown1(); + + void UT_CMusAvaCapability_NewLL(); + + void UT_CMusAvaCapability_DoPopulateResponseLL(); + + void UT_CMusAvaCapability_SupportsL(); + + void UT_CMusAvaCapability_ResolveCodecsLL(); + + void UT_CMusAvaCapability_AttributeL(); + + void UT_CMusAvaCapability_PopulateResponseL_OpSpecificL(); + + void UT_CMusAvaCapability_ResolveFastModeLL(); + + void UT_CMusAvaCapability_AddFastModeLL(); + + + private: // Data + + EUNIT_DECLARE_TEST_TABLE; + + CMusAvaCapabilityExchange* iExchange; + + CSipSseTestTls* iStorage; + + CSIP* iSIP; + CSIPConnection* iSIPConnection; + CSIPProfile* iProfile; + + CMusAvaOptionHandler* iOptionHandler; + CMusAvaAvailabilityObserverImp* iAvailabilityObserver; + CMusAvaSettingsImp* iConcreteSettings; + CMusAvaCapabilityQueryObserverImp* iCapabQueryObserver; + + CMusAvaCapability* iCapability; + + MusSettingsKeys::TOperatorVariant iOpVariantSetting; + + }; + +#endif // __UT_CMUSAVACAPABILITY_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaCapabilityExchange.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaCapabilityExchange.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,123 @@ +/* +* 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: +* +*/ + + +#ifndef __UT_CMUSAVACAPABILITYEXCHANGE_H__ +#define __UT_CMUSAVACAPABILITYEXCHANGE_H__ + +// EXTERNAL INCLUDES +#include + +// INTERNAL INCLUDES +#include +#include + +// FORWARD DECLARATIONS +class CSipSseTestTls; +class CMusAvaCapabilityExchange; +class CSIP; +class CSIPConnection; +class CSIPProfile; +class CMusAvaCapability; +class CMusAvaOptionHandler; +class CMusAvaObserverImp; +class CMusAvaSettingsImp; +class CMusAvaAvailabilityObserverImp; + +// CLASS DEFINITION +/** + * + * EUnitWizard generated test class. + * + */ +class UT_CMusAvaCapabilityExchange + : public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static UT_CMusAvaCapabilityExchange* NewL(); + static UT_CMusAvaCapabilityExchange* NewLC(); + /** + * Destructor + */ + ~UT_CMusAvaCapabilityExchange(); + + private: // Constructors and destructors + + UT_CMusAvaCapabilityExchange(); + void ConstructL(); + + public: // From observer interface + + + + private: // New methods + + void SetupL(); + + void Teardown(); + + void UT_CMusAvaCapabilityExchange_NewLL(); + + void UT_CMusAvaCapabilityExchange_QueryObserverL(); + + void UT_CMusAvaCapabilityExchange_TerminalIdL(); + + void UT_CMusAvaCapabilityExchange_QueryReceivedL(); + + void UT_CMusAvaCapabilityExchange_QueryReceived1L(); + + void UT_CMusAvaCapabilityExchange_QueryReceived2L(); + + void UT_CMusAvaCapabilityExchange_CancelQueryL(); + + void UT_CMusAvaCapabilityExchange_AddCapabilityLL(); + + void UT_CMusAvaCapabilityExchange_TerminalLL(); + + void UT_CMusAvaCapabilityExchange_RejectQueryLL(); + + void UT_CMusAvaCapabilityExchange_FindByFeatureL(); + + void UT_CMusAvaCapabilityExchange_AnswerToQueryReceivedL(); + + private: // Data + + EUNIT_DECLARE_TEST_TABLE; + + CSipSseTestTls* iStorage; + CMusAvaCapabilityExchange* iExchange; + CSIP* iSIP; + CSIPConnection* iSIPConnection; + CSIPProfile* iProfile; + + CMusAvaOptionHandler* iOptionHandler; + CMusAvaAvailabilityObserverImp* iAvailabilityObserver; + CMusAvaSettingsImp* iConcreteSettings; + + private: // NOT owned + + CMusAvaCapability* iCapability; + + }; + +#endif // __UT_CMUSAVACAPABILITYEXCHANGE_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaCapabilityQuery.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaCapabilityQuery.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,136 @@ +/* +* 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: +* +*/ + + +#ifndef __UT_CMUSAVACAPABILITYQUERY_H__ +#define __UT_CMUSAVACAPABILITYQUERY_H__ + +// EXTERNAL INCLUDES +#include + +// INTERNAL INCLUDES +#include +#include + +// FORWARD DECLARATIONS +class CSIPConnection; +class CSIPProfile; +class CMusAvaCapability; +class CSipSseTestTls; +class CMusAvaOptionHandler; +class CMusAvaObserverImp; +class CMusAvaSettingsImp; +class CMusAvaCapabilityExchange; +class CMusAvaCapabilitySipAgent; +class CMusAvaCapabilityQuery; +class CMusAvaSharedObject; +class CMusAvaAvailabilityObserverImp; + +#include "mussettingskeys.h" + +// CLASS DEFINITION +/** + * + * EUnitWizard generated test class. + * + */ +class UT_CMusAvaCapabilityQuery + : public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static UT_CMusAvaCapabilityQuery* NewL(); + static UT_CMusAvaCapabilityQuery* NewLC(); + /** + * Destructor + */ + ~UT_CMusAvaCapabilityQuery(); + + private: // Constructors and destructors + + UT_CMusAvaCapabilityQuery(); + void ConstructL(); + + public: // From observer interface + + + + private: // New methods + + void SetupL(); + + void Teardown(); + + void UT_CMusAvaCapabilityQuery_NewLL(); + + void UT_CMusAvaCapabilityQuery_ExecuteLL(); + + void UT_CMusAvaCapabilityQuery_CanceledL(); + + void UT_CMusAvaCapabilityQuery_CompletedLL(); + + void UT_CMusAvaCapabilityQuery_CompletedL1L(); + + void UT_CMusAvaCapabilityQuery_CompletedL2L(); + + void UT_CMusAvaCapabilityQuery_ValidateAndStoreCodecsLL(); + + void UT_CMusAvaCapabilityQuery_ValidateAttributesLL(); + + void UT_CMusAvaCapabilityQuery_ValidateContactLL(); + + void UT_CMusAvaCapabilityQuery_PrepareL(); + + void UT_CMusAvaCapabilityQuery_DoCompletedLL(); + + void UT_CMusAvaCapabilityQuery_DoCompleted200OKLL(); + + EUNIT_DECLARE_TEST_TABLE; + + CMusAvaOptionHandler* iOptionHandler; + + CMusAvaAvailabilityObserverImp* iAvailabilityObserver; + + CMusAvaSettingsImp* iConcreteSettings; + + CMusAvaCapabilitySipAgent* iSipAgent; + + CMusAvaCapabilityExchange* iExchange; + + //CSIP& iSIP; + CSIPConnection* iSIPConnection; + CSIPProfile* iProfile; + + MusSettingsKeys::TOperatorVariant iOpVariantSetting; + + private: // NOT owned + + CSipSseTestTls* iStorage; + CMusAvaCapability* iCapability; + + CMusAvaSharedObject* iSharedObject; + + CMusAvaCapabilityQuery* iQuery; + + }; + +#endif // __UT_CMUSAVACAPABILITYQUERY_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaCapabilitySipAgent.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaCapabilitySipAgent.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,121 @@ +/* +* 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: +* +*/ + + +#ifndef __UT_CMUSAVACAPABILITYSIPAGENT_H__ +#define __UT_CMUSAVACAPABILITYSIPAGENT_H__ + +// EXTERNAL INCLUDES +#include + +// INTERNAL INCLUDES +#include +#include + +// FORWARD DECLARATIONS +class CSIPConnection; +class CSIPProfile; +class CMusAvaCapability; +class CSipSseTestTls; +class CMusAvaOptionHandler; +class CMusAvaObserverImp; +class CMusAvaSettingsImp; +class CMusAvaCapabilityExchange; +class CMusAvaCapabilitySipAgent; +class CMusAvaSharedObject; +class CMusAvaAvailabilityObserverImp; + +// CLASS DEFINITION +/** + * + * EUnitWizard generated test class. + * + */ +class UT_CMusAvaCapabilitySipAgent + : public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static UT_CMusAvaCapabilitySipAgent* NewL(); + static UT_CMusAvaCapabilitySipAgent* NewLC(); + /** + * Destructor + */ + ~UT_CMusAvaCapabilitySipAgent(); + + private: // Constructors and destructors + + UT_CMusAvaCapabilitySipAgent(); + void ConstructL(); + + public: // From observer interface + + + + private: // New methods + + void SetupL(); + + void Teardown(); + + void UT_CMusAvaCapabilitySipAgent_NewLL(); + + void UT_CMusAvaCapabilitySipAgent_ExecuteCapabilityQueryLL(); + + void UT_CMusAvaCapabilitySipAgent_IncomingRequestL(); + + void UT_CMusAvaCapabilitySipAgent_HandleIncomingRequestLL(); + + void UT_CMusAvaCapabilitySipAgent_IncomingResponseL(); + + void UT_CMusAvaCapabilitySipAgent_ErrorOccuredL(); + + void UT_CMusAvaCapabilitySipAgent_TimedOutL(); + + + EUNIT_DECLARE_TEST_TABLE; + + CMusAvaOptionHandler* iOptionHandler; + + CMusAvaAvailabilityObserverImp* iAvailabilityObserver; + + CMusAvaSettingsImp* iConcreteSettings; + + CMusAvaCapabilitySipAgent* iSipAgent; + + CMusAvaCapabilityExchange* iExchange; + + CSIPConnection* iSIPConnection; + CSIPProfile* iProfile; + + private: // NOT owned + + CSipSseTestTls* iStorage; + CMusAvaCapability* iCapability; + + CMusAvaSharedObject* iSharedObject; + + TInt iProfileId; + + }; + +#endif // __UT_CMUSAVACAPABILITYSIPAGENT_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaConnectionAvailability.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaConnectionAvailability.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,113 @@ +/* +* 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: +* +*/ + + +#ifndef __UT_CMUSAVACONNECTIONAVAILABILITY_H__ +#define __UT_CMUSAVACONNECTIONAVAILABILITY_H__ + +// EXTERNAL INCLUDES +#include + +// INTERNAL INCLUDES +#include +#include + +// FORWARD DECLARATIONS +class CSipSseTestTls; +class CMusAvaAvailabilityObserverImp; +class CMusAvaSettingsImp; +class CMusAvaConnectionAvailability; +class CMusAvaSharedObject; + +// CLASS DEFINITION +/** + * + * EUnitWizard generated test class. + * + */ +class UT_CMusAvaConnectionAvailability + : public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static UT_CMusAvaConnectionAvailability* NewL(); + static UT_CMusAvaConnectionAvailability* NewLC(); + /** + * Destructor + */ + ~UT_CMusAvaConnectionAvailability(); + + private: // Constructors and destructors + + UT_CMusAvaConnectionAvailability(); + void ConstructL(); + + public: // From observer interface + + + + private: // New methods + + void SetupL(); + + void Teardown(); + + void UT_CMusAvaConnectionAvailability_NewLL(); + + void UT_CMusAvaConnectionAvailability_DoExecuteLL(); + void UT_CMusAvaConnectionAvailability_DoExecuteLL2(); + + void UT_CMusAvaConnectionAvailability_NameL(); + + void UT_CMusAvaConnectionAvailability_StopL(); + + void UT_CMusAvaConnectionAvailability_PhoneNetworkModeStatusL(); + + void UT_CMusAvaConnectionAvailability_NetworkRegistrationStatusL(); + + void UT_CMusAvaConnectionAvailability_EventLL(); + + void UT_CMusAvaConnectionAvailability_NetworkRegistrationAndSettingsLL(); + + void UT_CMusAvaConnectionAvailability_ManualActivationLL(); + + + + + EUNIT_DECLARE_TEST_TABLE; + + + CMusAvaAvailabilityObserverImp* iAvailabilityObserver; + + CMusAvaSettingsImp* iConcreteSettings; + + CMusAvaConnectionAvailability* iConnectionAvailability; + + CSipSseTestTls* iStorage; + + CMusAvaSharedObject* iSharedObject; + + TInt iProfileId; + + }; + +#endif // __UT_CMUSAVACONNECTIONAVAILABILITY_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaConnectionMonitor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaConnectionMonitor.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,100 @@ +/* +* 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: +* +*/ + + +#ifndef __UT_CMUSAVACONNECTIONMONITOR_H__ +#define __UT_CMUSAVACONNECTIONMONITOR_H__ + +// EXTERNAL INCLUDES +#include + +// INTERNAL INCLUDES +#include +#include + +#include "rconnmon.h" +// FORWARD DECLARATIONS +class CSipSseTestTls; +class CMusAvaConnectionMonitor; +class CMusAvaSharedObject; + +// CLASS DEFINITION +/** + * + * EUnitWizard generated test class. + * + */ +class UT_CMusAvaConnectionMonitor + : public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static UT_CMusAvaConnectionMonitor* NewL(); + static UT_CMusAvaConnectionMonitor* NewLC(); + /** + * Destructor + */ + ~UT_CMusAvaConnectionMonitor(); + + private: // Constructors and destructors + + UT_CMusAvaConnectionMonitor(); + void ConstructL(); + + public: // From observer interface + + + + private: // New methods + + void SetupL(); + + void Teardown(); + + void UT_CMusAvaConnectionMonitor_NewLL(); + + void UT_CMusAvaConnectionMonitor_EventLL(); + + void UT_CMusAvaConnectionMonitor_AddAdapterLL(); + + void UT_CMusAvaConnectionMonitor_RemoveAdapterL(); + + void UT_CMusAvaConnectionMonitor_ConnectionCountL(); + + void UT_CMusAvaConnectionMonitor_ConnectionIDLL(); + + void UT_CMusAvaConnectionMonitor_MultimediaSharingAccessPointIDL(); + + + EUNIT_DECLARE_TEST_TABLE; + + CMusAvaConnectionMonitor* iAvaConnectionMonitor; + + CMusAvaSharedObject* iSharedObject; + + CSipSseTestTls* iStorage; + + TInt iProfileId; + + }; + +#endif // __UT_CMUSAVACONNECTIONMONITOR_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaContactAvailability.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaContactAvailability.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,141 @@ +/* +* 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: +* +*/ + + +#ifndef __UT_CMUSAVACONTACTAVAILABILITY_H__ +#define __UT_CMUSAVACONTACTAVAILABILITY_H__ + +#include + +// EXTERNAL INCLUDES +#include + +// INTERNAL INCLUDES +#include +#include + +// FORWARD DECLARATIONS +class CMusAvaAvailabilityObserverImp; +class CMusAvaContactAvailability; +class CSipSseTestTls; +class CMusAvaSettingsImp; +class CContactTextField; +class CPbkContactItem; +class CPbkContactEngine; + + +// CLASS DEFINITION +/** + * + * EUnitWizard generated test class. + * + */ +class UT_CMusAvaContactAvailability + : public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static UT_CMusAvaContactAvailability* NewL(); + static UT_CMusAvaContactAvailability* NewLC(); + /** + * Destructor + */ + ~UT_CMusAvaContactAvailability(); + + private: // Constructors and destructors + + UT_CMusAvaContactAvailability(); + void ConstructL(); + + public: // From observer interface + + + + private: // New methods + + void SetupL(); + + void SetupOpSpecificL(); + + void Teardown(); + + void UT_CMusAvaController_NewLL(); + + void UT_CMusAvaController_DoExecuteLL(); + + void UT_CMusAvaController_DoExecuteL1_L(); + + void UT_CMusAvaController_DoExecuteL2_L(); + + void UT_CMusAvaController_DoExecuteL3_L(); + + void UT_CMusAvaController_NameL(); + + void UT_CMusAvaController_StatusL(); + + void UT_CMusAvaController_StopL(); + + void UT_CMusAvaController_ActiveCallLL(); + + void UT_CMusAvaController_ActiveCallLOpSpecificL(); + + void UT_CMusAvaController_ContactLL(); + + void UT_CMusAvaController_ContactArrayLL(); + + void UT_CMusAvaController_ContactItemL(); + + void UT_CMusAvaController_PhoneResulutionLL(); + + void UT_CMusAvaController_ContactIdL(); + + void UT_CMusAvaController_ContactIdSearchL(); + + void UT_CMusAvaController_ResolveAddressesLL(); + + void UT_CMusAvaController_ResolveAddressesLOpSpecificL(); + + void UT_CMusAvaController_ResolvePhoneContactLL(); + + void UT_CMusAvaController_ResolvePhoneContactLOpSpecificL(); + + void UT_CMusAvaController_IsExistAlreadyL(); + + void UT_CMusAvaController_UpdateContactNameLL(); + + private: // Data + + EUNIT_DECLARE_TEST_TABLE; + + CMusAvaAvailabilityObserverImp* iAvailabilityObserver; + + CMusAvaSettingsImp* iConcreteSettings; + + CMusAvaContactAvailability* iContactAvailability; + + CSipSseTestTls* iStorage; + + MusSettingsKeys::TOperatorVariant iSaveOperatorVariant; + + }; + +#endif // __UT_CMUSAVACONTACTAVAILABILITY_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaDefaultImp.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaDefaultImp.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,111 @@ +/* +* 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: +* +*/ + + +#ifndef __UT_CMUSAVADEFAULTIMP_H__ +#define __UT_CMUSAVADEFAULTIMP_H__ + +// EXTERNAL INCLUDES +#include + +// INTERNAL INCLUDES +#include +#include + +// FORWARD DECLARATIONS +class CSipSseTestTls; +class CMusAvaDefaultImp; +class CMusAvaAvailabilityObserverImp; +class CMusAvaObserverImp; +class CMusAvaSettingsImp; + +// CLASS DEFINITION +/** + * + * EUnitWizard generated test class. + * + */ +class UT_CMusAvaDefaultImp + : public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static UT_CMusAvaDefaultImp* NewL(); + static UT_CMusAvaDefaultImp* NewLC(); + /** + * Destructor + */ + ~UT_CMusAvaDefaultImp(); + + private: // Constructors and destructors + + UT_CMusAvaDefaultImp(); + void ConstructL(); + + public: // From observer interface + + + + private: // New methods + + void StartL(); + void Teardown(); + + void UT_CMusAvaDefaultImp_NewLL(); + + void UT_CMusAvaDefaultImp_CreateAvailabilityModulesLL(); + + void UT_CMusAvaDefaultImp_ConstuctHandlerAvailabilityModulesLL(); + + void UT_CMusAvaDefaultImp_ConstructStaticAvailabilityModulesLL(); + + void UT_CMusAvaDefaultImp_ConstructDynamicAvailabilityModulesLL(); + + void UT_CMusAvaDefaultImp_ExecuteAvailablitityModulesL(); + + void UT_CMusAvaDefaultImp_SettingsL(); + + void UT_CMusAvaDefaultImp_SetObserverL(); + + void UT_CMusAvaDefaultImp_StartLL(); + + void UT_CMusAvaDefaultImp_StopL(); + + void UT_CMusAvaDefaultImp_AvailabilityChangedL(); + + void UT_CMusAvaDefaultImp_AvailabilityErrorL(); + + void UT_CMusAvaDefaultImp_AvailableL(); + + void UT_CMusAvaDefaultImp_AvailabilityStateL(); + + + EUNIT_DECLARE_TEST_TABLE; + + CMusAvaDefaultImp* iDefaultImp; + CMusAvaAvailabilityObserverImp* iAvailabilityObserver; + CMusAvaObserverImp* iMusAvaObserver; + CSipSseTestTls* iStorage; + CMusAvaSettingsImp* iConcreteSettings; + }; + +#endif // __UT_CMUSAVADEFAULTIMP_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaDefaultOptionHandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaDefaultOptionHandler.h Thu Jul 22 16:32:26 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: +* +*/ + + +#ifndef __UT_CMUSAVADEFAULTOPTIONHANDLER_H__ +#define __UT_CMUSAVADEFAULTOPTIONHANDLER_H__ + +// EXTERNAL INCLUDES +#include + +// INTERNAL INCLUDES +#include +#include + +#include "mussettingskeys.h" + +// FORWARD DECLARATIONS +class CSipSseTestTls; +class CMusAvaDefaultOptionHandler; +class CMusAvaAvailabilityObserverImp; +class CMusAvaSettingsImp; +class CMusAvaSettingsObserverImp; + +// CLASS DEFINITION +/** + * + * EUnitWizard generated test class. + * + */ +class UT_CMusAvaDefaultOptionHandler + : public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static UT_CMusAvaDefaultOptionHandler* NewL(); + static UT_CMusAvaDefaultOptionHandler* NewLC(); + /** + * Destructor + */ + ~UT_CMusAvaDefaultOptionHandler(); + + private: // Constructors and destructors + + UT_CMusAvaDefaultOptionHandler(); + void ConstructL(); + + public: // From observer interface + + + + private: // New methods + + void SetupL(); + + void SetupOpSpecificL(); + + void Teardown(); + + void UT_CMusAvaDefaultOptionHandler_NewLL(); + + void UT_CMusAvaDefaultOptionHandler_IncomingRequestL(); + + void UT_CMusAvaDefaultOptionHandler_DoExecuteLL(); + + void UT_CMusAvaDefaultOptionHandler_NameL(); + + void UT_CMusAvaDefaultOptionHandler_StatusL(); + + void UT_CMusAvaDefaultOptionHandler_StopL(); + + void UT_CMusAvaDefaultOptionHandler_IncomingOptionRequestLL(); + + void UT_CMusAvaDefaultOptionHandler_IncomingOptionRequestLOpSpecificL(); + + void UT_CMusAvaDefaultOptionHandler_ResponseLL(); + + void UT_CMusAvaDefaultOptionHandler_NoCapabilityResponseLL(); + + void UT_CMusAvaDefaultOptionHandler_NoCapabilityResponseLOpSpecificL(); + + void UT_CMusAvaDefaultOptionHandler_CreateResponseLL(); + + void UT_CMusAvaDefaultOptionHandler_TimedOutL(); + + + EUNIT_DECLARE_TEST_TABLE; + CSipSseTestTls* iStorage; + + CMusAvaDefaultOptionHandler* iOptionDefaultHandler; + + CMusAvaAvailabilityObserverImp* iAvailabilityObserver; + + CMusAvaSettingsImp* iConcreteSettings; + + CMusAvaSettingsObserverImp* iSettingsObserverImp; + + }; + +#endif // __UT_CMUSAVADEFAULTOPTIONHANDLER_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaInviteHandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaInviteHandler.h Thu Jul 22 16:32:26 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: +* +*/ + + +#ifndef __UT_CMUSAVAINVITEHANDLER_H__ +#define __UT_CMUSAVAINVITEHANDLER_H__ + +// EXTERNAL INCLUDES +#include + +// INTERNAL INCLUDES +#include +#include + +// FORWARD DECLARATIONS +class CSipSseTestTls; +class CMusAvaInviteHandler; +class CMusAvaAvailabilityObserverImp; +class CMusAvaSettingsImp; + +// CLASS DEFINITION +/** + * + * EUnitWizard generated test class. + * + */ +class UT_CMusAvaInviteHandler + : public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static UT_CMusAvaInviteHandler* NewL(); + static UT_CMusAvaInviteHandler* NewLC(); + /** + * Destructor + */ + ~UT_CMusAvaInviteHandler(); + + private: // Constructors and destructors + + UT_CMusAvaInviteHandler(); + void ConstructL(); + + public: // From observer interface + + + + private: // New methods + + void SetupL(); + + void Teardown(); + + void UT_CMusAvaInviteHandler_NewLL(); + + void UT_CMusAvaInviteHandler_IncomingRequestL(); + + void UT_CMusAvaInviteHandler_DoExecuteLL(); + + void UT_CMusAvaInviteHandler_NameL(); + + void UT_CMusAvaInviteHandler_StopL(); + + void UT_CMusAvaInviteHandler_InvitationReceivedLL(); + + void UT_CMusAvaInviteHandler_InvitationAnsweredLDL(); + + + EUNIT_DECLARE_TEST_TABLE; + + CMusAvaInviteHandler* iInviteHandler; + + CMusAvaAvailabilityObserverImp* iAvailabilityObserver; + + CMusAvaSettingsImp* iConcreteSettings; + + }; + +#endif // __UT_CMUSAVAINVITEHANDLER_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaInviteResponder.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaInviteResponder.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,94 @@ +/* +* 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: +* +*/ + + +#ifndef __UT_CMUSAVAINVITERESPONDER_H__ +#define __UT_CMUSAVAINVITERESPONDER_H__ + +// EXTERNAL INCLUDES +#include + +// INTERNAL INCLUDES +#include +#include + +// FORWARD DECLARATIONS +class CSipSseTestTls; +class CMusAvaInviteResponder; +class CMusAvaInviteResponderObserverImp; +class CSIPServerTransaction; + +// CLASS DEFINITION +/** + * + * EUnitWizard generated test class. + * + */ +class UT_CMusAvaInviteResponder + : public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static UT_CMusAvaInviteResponder* NewL(); + static UT_CMusAvaInviteResponder* NewLC(); + /** + * Destructor + */ + ~UT_CMusAvaInviteResponder(); + + private: // Constructors and destructors + + UT_CMusAvaInviteResponder(); + void ConstructL(); + + + public: // From observer interface + + + + private: // New methods + + void SetupL(); + + void Teardown(); + + void UT_CMusAvaInviteResponder_NewLL(); + + void UT_CMusAvaInviteResponder_AnswerLL(); + + void UT_CMusAvaInviteResponder_SendResponseLL(); + + void UT_CMusAvaInviteResponder_ResponseCompleteL(); + + void UT_CMusAvaInviteResponder_ResponseLL(); + + + EUNIT_DECLARE_TEST_TABLE; + + CSipSseTestTls* iStorage; + CMusAvaInviteResponder* iInviteResponder; + CMusAvaInviteResponderObserverImp* iResponderObserverImp; + CSIPServerTransaction* iServerTransaction; + + }; + +#endif // __UT_CMUSAVAINVITERESPONDER_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaNetworkAvailability.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaNetworkAvailability.h Thu Jul 22 16:32:26 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: +* +*/ + + +#ifndef __UT_CMUSAVANETWORKAVAILABILITY_H__ +#define __UT_CMUSAVANETWORKAVAILABILITY_H__ + +#ifdef __MWERKS__ +#pragma warn_emptydecl off +#pragma warn_illtokenpasting off +#endif + +// EXTERNAL INCLUDES +#include + + +// INTERNAL INCLUDES + + +// FORWARD DECLARATIONS +class CMusAvaNetworkAvailability; +class CMusAvaAvailabilityObserverImp; +class CMusAvaSettingsImp; + + +#include +#ifndef NONSHARABLE_CLASS + #define NONSHARABLE_CLASS(x) class x +#endif + +// CLASS DEFINITION +/** + * + * EUnitWizard generated test class. + * + */ +NONSHARABLE_CLASS( UT_CMusAvaNetworkAvailability ) + : public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static UT_CMusAvaNetworkAvailability* NewL(); + static UT_CMusAvaNetworkAvailability* NewLC(); + /** + * Destructor + */ + ~UT_CMusAvaNetworkAvailability(); + + private: // Constructors and destructors + + UT_CMusAvaNetworkAvailability(); + void ConstructL(); + + public: // From observer interface + + + + private: // New methods + + void SetupL(); + + void Teardown(); + + void UT_CMusAvaNetworkAvailability_DoExecuteLL(); + + void UT_CMusAvaNetworkAvailability_DoExecuteL_SipUriL(); + + void UT_CMusAvaNetworkAvailability_StopL(); + + void UT_CMusAvaNetworkAvailability_NameL(); + + void UT_CMusAvaNetworkAvailability_CallConnectedLL(); + + void UT_CMusAvaNetworkAvailability_ConferenceCallLL(); + + void UT_CMusAvaNetworkAvailability_CallHoldLL(); + + void UT_CMusAvaNetworkAvailability_NoActiveCallLL(); + + void UT_CMusAvaNetworkAvailability_SetRemoteHostLL(); + + private: // Data + + EUNIT_DECLARE_TEST_TABLE; + + CMusAvaNetworkAvailability* iNetworkAvailability; + CMusAvaAvailabilityObserverImp* iAvailabilityObserver; + CMusAvaSettingsImp* iSettings; + }; + +#endif // __UT_CMUSAVANETWORKAVAILABILITY_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaNetworkModeStatus.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaNetworkModeStatus.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,102 @@ +/* +* 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: +* +*/ + + +#ifndef __UT_CMUSAVANETWORKMODESTATUS_H__ +#define __UT_CMUSAVANETWORKMODESTATUS_H__ + +// EXTERNAL INCLUDES +#include + +// INTERNAL INCLUDES +#include +#include + +#include "musavatelephonystatusobserver.h" + +// FORWARD DECLARATIONS +class CSipSseTestTls; +class CMusAvaTelephonyStatusObserverImp; +class CMusAvaNetworkModeStatus; + +// CLASS DEFINITION +/** + * + * EUnitWizard generated test class. + * + */ +class UT_CMusAvaNetworkModeStatus + : public CEUnitTestSuiteClass, + MMusAvaTelephonyStatusObserver + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static UT_CMusAvaNetworkModeStatus* NewL(); + static UT_CMusAvaNetworkModeStatus* NewLC(); + /** + * Destructor + */ + ~UT_CMusAvaNetworkModeStatus(); + + private: // Constructors and destructors + + UT_CMusAvaNetworkModeStatus(); + void ConstructL(); + + public: // From MMusAvaTelephonyStatusObserver observer interface + + void PhoneNetworkModeStatus( + RMobilePhone::TMobilePhoneNetworkMode aStatus ); + + void NetworkRegistrationStatus( + RMobilePhone::TMobilePhoneRegistrationStatus aRegStatus ); + + private: // New methods + + void SetupL(); + + void Teardown(); + + void UT_CMusAvaNetworkModeStatus_NewLL(); + + void UT_CMusAvaNetworkModeStatus_AddAdapterLL(); + + void UT_CMusAvaNetworkModeStatus_RemoveAdapterL(); + + void UT_CMusAvaNetworkModeStatus_PhoneNetworkModeL(); + + void UT_CMusAvaNetworkModeStatus_PhoneNetworkModeStatusL(); + + static TInt Notify( TAny* aPtr ); + + EUNIT_DECLARE_TEST_TABLE; + + + CSipSseTestTls* iStorage; + CMusAvaNetworkModeStatus* iNetworkRegistrationStatus; + CMusAvaTelephonyStatusObserverImp* iObserver; + + RMobilePhone::TMobilePhoneNetworkMode iNetworkStatus; + CPeriodic* iPeriodic; + }; + +#endif // __UT_CMUSAVANETWORKREGISTRATIONYSTATUS_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaNetworkRegistrationStatus.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaNetworkRegistrationStatus.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,102 @@ +/* +* 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: +* +*/ + + +#ifndef __UT_CMUSAVANETWORKREGISTRATIONYSTATUS_H__ +#define __UT_CMUSAVANETWORKREGISTRATIONYSTATUS_H__ + +// EXTERNAL INCLUDES +#include + +// INTERNAL INCLUDES +#include +#include + +// FORWARD DECLARATIONS +class CSipSseTestTls; +class CMusAvaTelephonyStatusObserverImp; +class CMusAvaNetworkRegistrationStatus; + +// CLASS DEFINITION +/** + * + * EUnitWizard generated test class. + * + */ +class UT_CMusAvaNetworkRegistrationStatus + : public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static UT_CMusAvaNetworkRegistrationStatus* NewL(); + static UT_CMusAvaNetworkRegistrationStatus* NewLC(); + /** + * Destructor + */ + ~UT_CMusAvaNetworkRegistrationStatus(); + + private: // Constructors and destructors + + UT_CMusAvaNetworkRegistrationStatus(); + void ConstructL(); + + public: // From observer interface + + + + private: // New methods + + void SetupL(); + + void Teardown(); + + void UT_CMusAvaNetworkRegistrationStatus_NewLL(); + + void UT_CMusAvaNetworkRegistrationStatus_AddAdapterLL(); + + void UT_CMusAvaNetworkRegistrationStatus_NetworkRegistrationL(); + + void UT_CMusAvaNetworkRegistrationStatus_RemoveAdapterL(); + + void UT_CMusAvaNetworkRegistrationStatus_TelephonyStatusL(); + + void UT_CMusAvaNetworkRegistrationStatus_NetworkRegistrationStatusL(); + + void UT_CMusAvaNetworkRegistrationStatus_RunL(); + + void UT_CMusAvaNetworkRegistrationStatus_StatusL(); + + void UT_CMusAvaNetworkRegistrationStatus_DoCancelL(); + + void UT_CMusAvaNetworkRegistrationStatus_RunErrorLL(); + + + EUNIT_DECLARE_TEST_TABLE; + + + CSipSseTestTls* iStorage; + CMusAvaNetworkRegistrationStatus* iNetworkRegistrationStatus; + CMusAvaTelephonyStatusObserverImp* iObserver; + + }; + +#endif // __UT_CMUSAVANETWORKREGISTRATIONYSTATUS_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaOptionHandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaOptionHandler.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,122 @@ +/* +* 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: +* +*/ + + +#ifndef __UT_CMUSAVAOPTIONHANDLER_H__ +#define __UT_CMUSAVAOPTIONHANDLER_H__ + +// EXTERNAL INCLUDES +#include + +// INTERNAL INCLUDES +#include +#include + +// FORWARD DECLARATIONS +class CSIPConnection; +class CSIPProfile; +class CSipSseTestTls; +class CMusAvaOptionHandler; +class CMusAvaObserverImp; +class CMusAvaSettingsImp; +class CMusAvaSharedObject; +class CMusAvaAvailabilityObserverImp; +class CMusAvaSettingsObserverImp; + +// CLASS DEFINITION +/** + * + * EUnitWizard generated test class. + * + */ +class UT_CMusAvaOptionHandler + : public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static UT_CMusAvaOptionHandler* NewL(); + static UT_CMusAvaOptionHandler* NewLC(); + /** + * Destructor + */ + ~UT_CMusAvaOptionHandler(); + + private: // Constructors and destructors + + UT_CMusAvaOptionHandler(); + void ConstructL(); + + public: // From observer interface + + + + private: // New methods + + void SetupL(); + + void Teardown(); + + void UT_CMusAvaOptionHandler_NewLL(); + + void UT_CMusAvaOptionHandler_DoExecuteLL(); + + void UT_CMusAvaOptionHandler_NameL(); + + void UT_CMusAvaOptionHandler_StatusL(); + + void UT_CMusAvaOptionHandler_StopL(); + + void UT_CMusAvaOptionHandler_CapabilitiesResolvedL(); + + void UT_CMusAvaOptionHandler_CapabilitiesResolvedForCingularL(); + + void UT_CMusAvaOptionHandler_SipHeadersL(); + + void UT_CMusAvaOptionHandler_VideoCodecsResolvedLL(); + + void UT_CMusAvaOptionHandler_DoSetStateL(); + + void UT_CMusAvaOptionHandler_DoSetStateFastModeL(); + + void UT_CMusAvaOptionHandler_FastModeResolvedL(); + + void UT_CMusAvaOptionHandler_CapabilityQueryAnsweredL(); + + + EUNIT_DECLARE_TEST_TABLE; + CSipSseTestTls* iStorage; + + CMusAvaOptionHandler* iOptionHandler; + + CMusAvaAvailabilityObserverImp* iAvailabilityObserver; + + CMusAvaSettingsImp* iConcreteSettings; + + CMusAvaSharedObject* iSharedObject; + + CSIPProfile* iProfile; + + CMusAvaSettingsObserverImp* iSettingsObserver; + + }; + +#endif // __UT_CMUSAVAOPTIONHANDLER_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaRegisterAvailability.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaRegisterAvailability.h Thu Jul 22 16:32:26 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: +* +*/ + + +#ifndef __UT_CMUSAVAREGISTERAVAILABILITY_H__ +#define __UT_CMUSAVAREGISTERAVAILABILITY_H__ + +// EXTERNAL INCLUDES +#include + +// INTERNAL INCLUDES +#include + +// FORWARD DECLARATIONS +class CMusAvaAvailabilityObserverImp; +class CSipSseTestTls; +class CMusAvaSettingsImp; +class CMusAvaRegisterAvailability; +class CMusAvaSharedObject; + +// CLASS DEFINITION +/** + * + * EUnitWizard generated test class. + * + */ +class UT_CMusAvaRegisterAvailability + : public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static UT_CMusAvaRegisterAvailability* NewL(); + static UT_CMusAvaRegisterAvailability* NewLC(); + /** + * Destructor + */ + ~UT_CMusAvaRegisterAvailability(); + + private: // Constructors and destructors + + UT_CMusAvaRegisterAvailability(); + void ConstructL(); + + public: // From observer interface + + + + private: // New methods + + void SetupL(); + + void Teardown(); + + void UT_CMusAvaRegisterAvailability_NewLL(); + + void UT_CMusAvaRegisterAvailability_DoExecuteLL(); + + void UT_CMusAvaRegisterAvailability_NameL(); + + void UT_CMusAvaRegisterAvailability_StatusL(); + + void UT_CMusAvaRegisterAvailability_Stop(); + + void UT_CMusAvaRegisterAvailability_ProfileRegistryEventOccurredL(); + + void UT_CMusAvaRegisterAvailability_CreateSipAddressProposalLL(); + + void UT_CMusAvaRegisterAvailability_ConnectionStateChangedL(); + + void UT_CMusAvaRegisterAvailability_ProfileRegistryErrorOccurredL(); + + void UT_CMusAvaRegisterAvailability_RegisterLL(); + + void UT_CMusAvaRegisterAvailability_InitializeRegisterL(); + + void UT_CMusAvaRegisterAvailability_EnableRegisterLL(); + + void UT_CMusAvaRegisterAvailability_UpdateSIPProfileL(); + + void UT_CMusAvaRegisterAvailability_RegistrationStatusL(); + + private: // Data + + EUNIT_DECLARE_TEST_TABLE; + + CMusAvaAvailabilityObserverImp* iAvailabilityObserver; + + CMusAvaSettingsImp* iConcreteSettings; + + CMusAvaRegisterAvailability* iRegisterAvailability; + + CSipSseTestTls* iStorage; + + CMusAvaSharedObject* iSharedObj; + + TInt iProfileId; + }; + +#endif // __UT_CMUSAVAREGISTERAVAILABILITY_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaSettingAvailability.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaSettingAvailability.h Thu Jul 22 16:32:26 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: +* +*/ + + +#ifndef __UT_CMusAvaSettingAvailability_H__ +#define __UT_CMusAvaSettingAvailability_H__ + +// EXTERNAL INCLUDES +#include + +// INTERNAL INCLUDES +#include +#include + +// FORWARD DECLARATIONS +class CMusAvaAvailabilityObserverImp; +class CMusAvaSharedObject; +class CMusAvaSettingAvailability; +// CLASS DEFINITION + +// Next row is to disable warning emerging from EUnit code. +// Placement is due to a fact that most test case files // include this file. Directive can be removed when // EUnit is fixed. +#pragma warn_illtokenpasting off +/** + * + * EUnitWizard generated test class. + * + */ +class UT_CMusAvaSettingAvailability + : public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static UT_CMusAvaSettingAvailability* NewL(); + static UT_CMusAvaSettingAvailability* NewLC(); + /** + * Destructor + */ + ~UT_CMusAvaSettingAvailability(); + + private: // Constructors and destructors + + UT_CMusAvaSettingAvailability(); + void ConstructL(); + + + private: // New methods + + void SetupL(); + + void Teardown(); + + void UT_CMusAvaSettingAvailability_NewLL(); + + void UT_CMusAvaSettingAvailability_IsForbiddenByOptionsResponseL(); + + void UT_CMusAvaSettingAvailability_CheckActivationStateL(); + + void UT_CMusAvaSettingAvailability_DoExecuteLL(); + + void UT_CMusAvaSettingAvailability_NameL(); + + void UT_CMusAvaSettingAvailability_StopL(); + + + EUNIT_DECLARE_TEST_TABLE; + + private: + CMusAvaAvailabilityObserverImp* iAvailabilityObserver; + CMusAvaSettingAvailability* iSettingAvailability; + }; + +#endif // __UT_CMusAvaSettingAvailability_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaSettingsImp.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaSettingsImp.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,123 @@ +/* +* 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: +* +*/ + + +#ifndef __UT_CMUSAVASETTINGSIMP_H__ +#define __UT_CMUSAVASETTINGSIMP_H__ + +// EXTERNAL INCLUDES +#include + +// INTERNAL INCLUDES +#include +#include + +// FORWARD DECLARATIONS +class CMusAvaSettingsImp; + +// CLASS DEFINITION +/** + * + * EUnitWizard generated test class. + * + */ +class UT_CMusAvaSettingsImp + : public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static UT_CMusAvaSettingsImp* NewL(); + static UT_CMusAvaSettingsImp* NewLC(); + /** + * Destructor + */ + ~UT_CMusAvaSettingsImp(); + + private: // Constructors and destructors + + UT_CMusAvaSettingsImp(); + void ConstructL(); + + public: // From observer interface + + + + private: // New methods + + void SetupL(); + + void Teardown(); + + void UT_CMusAvaSettingsImp_NewLL(); + + void UT_CMusAvaSettingsImp_DestructorL(); + + void UT_CMusAvaSettingsImp_TelNumberL(); + + void UT_CMusAvaSettingsImp_ContactNameL(); + + void UT_CMusAvaSettingsImp_SipAddressProposalL(); + + void UT_CMusAvaSettingsImp_SipAddressesL(); + + void UT_CMusAvaSettingsImp_ContactIdL(); + + void UT_CMusAvaSettingsImp_VideoCodecsL(); + + void UT_CMusAvaSettingsImp_AudioCodecsL(); + + void UT_CMusAvaSettingsImp_SipProfileIdL(); + + void UT_CMusAvaSettingsImp_SetObserverL(); + + void UT_CMusAvaSettingsImp_ManualActivationL(); + + void UT_CMusAvaSettingsImp_ApplicationStateL(); + + void UT_CMusAvaSettingsImp_CallDirectionL(); + + void UT_CMusAvaSettingsImp_SetTelNumberLL(); + + void UT_CMusAvaSettingsImp_SetSipAddressProposalLL( ); + + void UT_CMusAvaSettingsImp_ReleseTelNumberL(); + + void UT_CMusAvaSettingsImp_SetSipAddressesLL(); + + void UT_CMusAvaSettingsImp_SetContactIdL(); + + void UT_CMusAvaSettingsImp_SetVideoCodecsLL(); + + void UT_CMusAvaSettingsImp_SetAudioCodecsLL(); + + void UT_CMusAvaSettingsImp_SetSipProfileIdL(); + + void UT_CMusAvaSettingsImp_CopyDescArrayLL(); + + + EUNIT_DECLARE_TEST_TABLE; + + CMusAvaSettingsImp* iSettingsImp; + + }; + +#endif // __UT_CMUSAVASETTINGSIMP_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaSharedObject.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaSharedObject.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,87 @@ +/* +* 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: +* +*/ + + +#ifndef __UT_CMUSAVASHAREDOBJECT_H__ +#define __UT_CMUSAVASHAREDOBJECT_H__ + +// EXTERNAL INCLUDES +#include + +// INTERNAL INCLUDES +#include +#include + +// FORWARD DECLARATIONS +class CSipSseTestTls; +class CMusAvaSharedObject; + +// CLASS DEFINITION +/** + * + * EUnitWizard generated test class. + * + */ +class UT_CMusAvaSharedObject + : public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static UT_CMusAvaSharedObject* NewL(); + static UT_CMusAvaSharedObject* NewLC(); + /** + * Destructor + */ + ~UT_CMusAvaSharedObject(); + + private: // Constructors and destructors + + UT_CMusAvaSharedObject(); + void ConstructL(); + + + public: // From observer interface + + + + private: // New methods + + void SetupL(); + + void Teardown(); + + void UT_CMusAvaSharedObject_NewLL(); + + void UT_CMusAvaSharedObject_ConnectionMonitorL(); + + void UT_CMusAvaSharedObject_MusAvaSipL(); + + void UT_CMusAvaSharedObject_SipL(); + + EUNIT_DECLARE_TEST_TABLE; + + CSipSseTestTls* iStorage; + + CMusAvaSharedObject* iSharedObject; + }; + +#endif // __UT_CMUSAVASHAREDOBJECT_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaSip.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaSip.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,105 @@ +/* +* 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: +* +*/ + + +#ifndef __UT_CMUSAVASIP_H__ +#define __UT_CMUSAVASIP_H__ + +// EXTERNAL INCLUDES +#include + +// INTERNAL INCLUDES +#include +#include + +// FORWARD DECLARATIONS +class CSipSseTestTls; +class CMusAvaSip; + +// CLASS DEFINITION +/** + * + * EUnitWizard generated test class. + * + */ +class UT_CMusAvaSip + : public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static UT_CMusAvaSip* NewL(); + static UT_CMusAvaSip* NewLC(); + /** + * Destructor + */ + ~UT_CMusAvaSip(); + + private: // Constructors and destructors + + UT_CMusAvaSip(); + void ConstructL(); + + + public: // From observer interface + + + + private: // New methods + + void SetupL(); + + void Teardown(); + + void UT_CMusAvaSip_NewLL(); + + void UT_CMusAvaSip_AddAdapterLL(); + + void UT_CMusAvaSip_RemoveAdapterL(); + + void UT_CMusAvaSip_CreateProfileL(); + + void UT_CMusAvaSip_CreateSipProfileL(); + + void UT_CMusAvaSip_ProfileL(); + + void UT_CMusAvaSip_ProfileRegistryL(); + + void UT_CMusAvaSip_ConnectionL(); + + void UT_CMusAvaSip_ConnectionObserverL(); + + void UT_CMusAvaSip_SipL(); + + void UT_CMusAvaSip_CreateSIPConnectionLL(); + + void UT_CMusAvaSip_OwnDomainL(); + + + EUNIT_DECLARE_TEST_TABLE; + + + CSipSseTestTls* iStorage; + CMusAvaSip* iMusAvaSip; + TInt iProfileId; + }; + +#endif // __UT_CMusAvaSip_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaSipConnectionObserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaSipConnectionObserver.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,90 @@ +/* +* 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: +* +*/ + + +#ifndef __UT_CMusAvaSipConnectionObserver_H__ +#define __UT_CMusAvaSipConnectionObserver_H__ + +// EXTERNAL INCLUDES +#include + +// INTERNAL INCLUDES +#include +#include + +// FORWARD DECLARATIONS +class CMusAvaSipConnectionObserver; +class CMusAvaSipAdapterImp; + +// CLASS DEFINITION +/** + * + * EUnitWizard generated test class. + * + */ +class UT_CMusAvaSipConnectionObserver + : public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static UT_CMusAvaSipConnectionObserver* NewL(); + static UT_CMusAvaSipConnectionObserver* NewLC(); + /** + * Destructor + */ + ~UT_CMusAvaSipConnectionObserver(); + + private: // Constructors and destructors + + UT_CMusAvaSipConnectionObserver(); + void ConstructL(); + + + private: // New methods + + void SetupL(); + + void Teardown(); + + void RemoveDefaultHandler(); + void AddObserversL(); + + void UT_CMusAvaSipConnectionObserver_AddObserverL(); + void UT_CMusAvaSipConnectionObserver_RemoveObserverL(); + void UT_CMusAvaSipConnectionObserver_ConnectionStateChangedL(); + void UT_CMusAvaSipConnectionObserver_ErrorOccuredL(); + void UT_CMusAvaSipConnectionObserver_IncomingRequestL(); + void UT_CMusAvaSipConnectionObserver_IncomingResponseL(); + void UT_CMusAvaSipConnectionObserver_InviteCanceledL(); + void UT_CMusAvaSipConnectionObserver_InviteCompletedL(); + + + EUNIT_DECLARE_TEST_TABLE; + + + CMusAvaSipConnectionObserver* iMusAvaSipConnectionObserver; + CMusAvaSipAdapterImp* iAdapterImp; + CMusAvaSipAdapterImp* iAdapterImp2; + CMusAvaSipAdapterImp* iAdapterImp3; + }; + +#endif // __UT_CMusAvaSipConnectionObserver_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaSipObserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaSipObserver.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,87 @@ +/* +* 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: +* +*/ + + +#ifndef __UT_CMusAvaSipObserver_H__ +#define __UT_CMusAvaSipObserver_H__ + +// EXTERNAL INCLUDES +#include + +// INTERNAL INCLUDES +#include +#include + +// FORWARD DECLARATIONS +class CMusAvaSipObserver; +class CMusAvaSipAdapterImp; + +// CLASS DEFINITION +/** + * + * EUnitWizard generated test class. + * + */ +class UT_CMusAvaSipObserver + : public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static UT_CMusAvaSipObserver* NewL(); + static UT_CMusAvaSipObserver* NewLC(); + /** + * Destructor + */ + ~UT_CMusAvaSipObserver(); + + private: // Constructors and destructors + + UT_CMusAvaSipObserver(); + void ConstructL(); + + + private: // New methods + + void SetupL(); + + void Teardown(); + + void AddObserversL(); + + void UT_CMusAvaSipObserver_AddObserverL(); + + void UT_CMusAvaSipObserver_RemoveObserverL(); + + void UT_CMusAvaSipObserver_IncomingRequestL(); + + void UT_CMusAvaSipObserver_TimedOutL(); + + EUNIT_DECLARE_TEST_TABLE; + + + CMusAvaSipObserver* iMusAvaSipObserver; + CMusAvaSipAdapterImp* iAdapterImp; + CMusAvaSipAdapterImp* iAdapterImp2; + CMusAvaSipAdapterImp* iAdapterImp3; + }; + +#endif // __UT_CMusAvaSipObserver_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaSipProfileRegistryObserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaSipProfileRegistryObserver.h Thu Jul 22 16:32:26 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: +* +*/ + + +#ifndef __UT_CMUSAVASIPPROFILEREGISTRYOBSERVER_H__ +#define __UT_CMUSAVASIPPROFILEREGISTRYOBSERVER_H__ + +// EXTERNAL INCLUDES +#include + +// INTERNAL INCLUDES +#include +#include + +// FORWARD DECLARATIONS +class CMusAvaAvailabilityObserverImp; +class CMusAvaSharedObject; +class CMusAvaSipProfileRegistryObserver; +// CLASS DEFINITION + +// Next row is to disable warning emerging from EUnit code. +// Placement is due to a fact that most test case files // include this file. Directive can be removed when // EUnit is fixed. +#pragma warn_illtokenpasting off +/** + * + * EUnitWizard generated test class. + * + */ +class UT_CMusAvaSipProfileRegistryObserver + : public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static UT_CMusAvaSipProfileRegistryObserver* NewL(); + static UT_CMusAvaSipProfileRegistryObserver* NewLC(); + /** + * Destructor + */ + ~UT_CMusAvaSipProfileRegistryObserver(); + + private: // Constructors and destructors + + UT_CMusAvaSipProfileRegistryObserver(); + void ConstructL(); + + + private: // New methods + + void SetupL(); + + void Teardown(); + + void UT_CMusAvaSipProfileRegistryObserver_NewLL(); + + void UT_CMusAvaSipProfileRegistryObserver_AddAdapterLL(); + + void UT_CMusAvaSipProfileRegistryObserver_RemoveAdapterL(); + + void UT_CMusAvaSipProfileRegistryObserver_ProfileRegistryEventOccurredL(); + + void UT_CMusAvaSipProfileRegistryObserver_ProfileRegistryErrorOccurredL(); + + + EUNIT_DECLARE_TEST_TABLE; + + private: + CMusAvaSipProfileRegistryObserver* iSipprofileRegistryObserver; + }; + +#endif // __UT_CMUSAVASIPPROFILEREGISTRYOBSERVER_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaSipheaderUtil.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaSipheaderUtil.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,91 @@ +/* +* 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: +* +*/ + + +#ifndef __UT_CMUSAVASIPHEADERUTIL_H__ +#define __UT_CMUSAVASIPHEADERUTIL_H__ + +// EXTERNAL INCLUDES +#include + +// INTERNAL INCLUDES +#include +#include + +// FORWARD DECLARATIONS +class CSIPHeaderBase; +// CLASS DEFINITION + +// Next row is to disable warning emerging from EUnit code. +// Placement is due to a fact that most test case files // include this file. Directive can be removed when // EUnit is fixed. +#pragma warn_illtokenpasting off +/** + * + * EUnitWizard generated test class. + * + */ +class UT_CMusAvaSipheaderUtil + : public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static UT_CMusAvaSipheaderUtil* NewL(); + static UT_CMusAvaSipheaderUtil* NewLC(); + /** + * Destructor + */ + ~UT_CMusAvaSipheaderUtil(); + + private: // Constructors and destructors + + UT_CMusAvaSipheaderUtil(); + void ConstructL(); + + + private: // New methods + + void SetupL(); + + void Teardown(); + + void UT_AddAcceptContactHeaderLL(); + + void UT_AddAcceptEncodingHeaderLL(); + + void UT_AddAcceptLanguageHeaderLL(); + + void UT_AddPreferredIdentityHeaderLL(); + + void UT_AddAcceptSdpHeaderLL(); + + void UT_AddSdpLL(); + + void UT_LocalHostLL(); + + private : + RPointerArray iRequestHeaders; + + + EUNIT_DECLARE_TEST_TABLE; + }; + +#endif // __UT_CMUSAVASIPHEADERUTIL_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaSipprofileAvailability.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaSipprofileAvailability.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,90 @@ +/* +* 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: +* +*/ + + +#ifndef __UT_CMUSAVASIPPROFILEAVAILABILITY_H__ +#define __UT_CMUSAVASIPPROFILEAVAILABILITY_H__ + +// EXTERNAL INCLUDES +#include + +// INTERNAL INCLUDES +#include +#include + +// FORWARD DECLARATIONS +class CMusAvaAvailabilityObserverImp; +class CMusAvaSharedObject; +class CMusAvaSipprofileAvailability; +// CLASS DEFINITION + +// Next row is to disable warning emerging from EUnit code. +// Placement is due to a fact that most test case files // include this file. Directive can be removed when // EUnit is fixed. +#pragma warn_illtokenpasting off +/** + * + * EUnitWizard generated test class. + * + */ +class UT_CMusAvaSipprofileAvailability + : public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static UT_CMusAvaSipprofileAvailability* NewL(); + static UT_CMusAvaSipprofileAvailability* NewLC(); + /** + * Destructor + */ + ~UT_CMusAvaSipprofileAvailability(); + + private: // Constructors and destructors + + UT_CMusAvaSipprofileAvailability(); + void ConstructL(); + + + private: // New methods + + void SetupL(); + + void Teardown(); + + void UT_CMusAvaSipprofileAvailability_NewLL(); + + void UT_CMusAvaSipprofileAvailability_IsProfileExistL(); + + void UT_CMusAvaSipprofileAvailability_DoExecuteLL(); + + void UT_CMusAvaSipprofileAvailability_NameL(); + + void UT_CMusAvaSipprofileAvailability_StopL(); + + + EUNIT_DECLARE_TEST_TABLE; + + private: + CMusAvaAvailabilityObserverImp* iAvailabilityObserver; + CMusAvaSipprofileAvailability* iSipprofileAvailability; + }; + +#endif // __UT_CMUSAVASIPPROFILEAVAILABILITY_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaTerminal.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_CMusAvaTerminal.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,127 @@ +/* +* 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: +* +*/ + + +#ifndef __UT_CMUSAVATERMINAL_H__ +#define __UT_CMUSAVATERMINAL_H__ + +#ifdef __MWERKS__ +#pragma warn_emptydecl off +#pragma warn_illtokenpasting off +#endif + +// EXTERNAL INCLUDES +#include + +// INTERNAL INCLUDES + + +// FORWARD DECLARATIONS +class CMusAvaTerminal; +class CMusAvaCapabilityExchange; +class CSIP; +class CSIPConnection; +class CSIPProfile; +class CMusAvaCapability; +class CMusAvaOptionHandler; +class CMusAvaObserverImp; +class CMusAvaSettingsImp; +class CMusAvaAvailabilityObserverImp; +class CSipSseTestTls; + +#include +#ifndef NONSHARABLE_CLASS + #define NONSHARABLE_CLASS(x) class x +#endif + +// CLASS DEFINITION +/** + * + * EUnitWizard generated test class. + * + */ +NONSHARABLE_CLASS( UT_CMusAvaTerminal ) + : public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static UT_CMusAvaTerminal* NewL(); + static UT_CMusAvaTerminal* NewLC(); + /** + * Destructor + */ + ~UT_CMusAvaTerminal(); + + private: // Constructors and destructors + + UT_CMusAvaTerminal(); + void ConstructL(); + + public: // From observer interface + + + + private: // New methods + + void SetupL(); + + void Teardown(); + + void UT_CMusAvaTerminal_NewLL(); + + void UT_CMusAvaTerminal_MatchLL(); + + void UT_CMusAvaTerminal_ExecuteQueryLL(); + + void UT_CMusAvaTerminal_QueryCompletedLL(); + + void UT_CMusAvaTerminal_QueryCanceledL(); + + void UT_CMusAvaTerminal_QueryRequestedLL(); + + void UT_CMusAvaTerminal_IsDiscoveredL(); + + + private: // Data + + EUNIT_DECLARE_TEST_TABLE; + + CMusAvaCapabilityExchange* iExchange; + + + CSIP* iSIP; + CSIPConnection* iSIPConnection; + CSIPProfile* iProfile; + CMusAvaTerminal* iTerminal; + + CMusAvaOptionHandler* iOptionHandler; + CMusAvaAvailabilityObserverImp* iAvailabilityObserver; + CMusAvaSettingsImp* iConcreteSettings; + + private: // NOT owned + + CMusAvaCapability* iCapability; + CSipSseTestTls* iStorage; + + }; + +#endif // __UT_CSTCETERMINAL_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_availability.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/inc/UT_availability.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,87 @@ +/* +* 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: +* +*/ + + +#ifndef __T_AVAILABILITY_H__ +#define __T_AVAILABILITY_H__ + +// EXTERNAL INCLUDES +#include + +// INTERNAL INCLUDES + + +// FORWARD DECLARATIONS +class CSipSseTestTls; +class CMusAvaDefaultImp; + +#include +#ifndef NONSHARABLE_CLASS + #define NONSHARABLE_CLASS(x) class x +#endif + +// CLASS DEFINITION +/** + * + * EUnitWizard generated test class. + * + */ +NONSHARABLE_CLASS( T_availability ) + : public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static T_availability* NewL(); + static T_availability* NewLC(); + /** + * Destructor + */ + ~T_availability(); + + private: // Constructors and destructors + + T_availability(); + void ConstructL(); + + public: // From observer interface + + + + private: // New methods + + void SetupL(); + + void Teardown(); + + void TestL(); + + + private: // Data + + CSipSseTestTls* iStorage; + + + EUNIT_DECLARE_TEST_TABLE; + + }; + +#endif // __T_AVAILABILITY_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/inc/capabilitytestdefs.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/inc/capabilitytestdefs.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,32 @@ +/* +* 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: test definitions +* +*/ + + +#ifndef CAPABILITYTESTDEFS_H +#define CAPABILITYTESTDEFS_H + +#define CAPABILITY_UT_DEFINITIONS\ + friend class UT_CMusAvaCapabilityExchange;\ + friend class UT_CMusAvaTerminal;\ + friend class UT_CMusAvaCapabilityQuery;\ + friend class UT_CMusAvaCapability;\ + friend class CapabilityTestHelper; \ + friend class UT_CMusAvaCapabilitySipAgent; + + + +#endif // CAPABILITYTESTDEFS_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/inc/musavacapabilitytesthelper.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/inc/musavacapabilitytesthelper.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,309 @@ +/* +* Copyright (c) 2005-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: Capability Test helper +* +*/ + + +#ifndef MUSAVACAPABILITYTESTHELPER_H +#define MUSAVACAPABILITYTESTHELPER_H + + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +// INTERNAL INCLUDES +#include "SIP.h" +#include "SIPConnection.h" +#include "SIPProfile.h" +#include "SIPClientTransaction.h" +#include "SIPServerTransaction.h" +#include "SIPRequestElements.h" +#include "SIPResponseElements.h" +#include "SIPMessageElements.h" + + +#include "musavacapabilitycontext.h" +#include "musavacapability.h" +#include "musavacapabilityexchange.h" + +// Next row is to disable warning emerging from EUnit code. +// Placement is due to a fact that most test case files +// include this file. Directive can be removed when +// EUnit is fixed. +#pragma warn_illtokenpasting off + +_LIT8( KCapabilityTestTerminalID_A, "Terminal_A"); +_LIT8( KCapabilityTestTerminalID_B, "Terminal_B"); +_LIT8( KPAssertedIdentity_B, "sip:4455667788@foobar.com" ); +_LIT( KPAssertedIdentity_B_16, "sip:4455667788@foobar.com" ); +_LIT8( KPAssertedIdentity_B1, "tel:+4455667788"); +_LIT( KPAssertedIdentity_B1_16, "tel:+4455667788"); +_LIT8( KCapabilityTestAddress_A, "sip:a@foobar.com"); +_LIT8( KCapabilityTestAddress_B, "sip:b@foobar.com"); +_LIT8( KCapabilityPAssertedIdentity, "sip:passertedid@foobar.com"); + + + +_LIT8( KCapabilityTestSDP,"v=0\r\n\ +o=- 452027953 452027953 IN IP4 foobar.com\r\n\ +s=-\r\n\ +c=IN IP4 foobar.com\r\n\ +t=0 0\r\n\ +a=application:com.gsma.rts\r\n\ +a=type:videolive\r\n\ +m=video 0 RTP/AVP 96\r\n\ +a=rtpmap:96 H263-2000/90000\r\n"); + +_LIT8( KCapabilityTestSDPWrongCodec,"v=0\r\n\ +o=- 452027953 452027953 IN IP4 foobar.com\r\n\ +s=-\r\n\ +c=IN IP4 foobar.com\r\n\ +t=0 0\r\n\ +a=application:com.gsma.rts\r\n\ +a=type:videolive\r\n\ +m=video 0 RTP/AVP 96\r\n\ +a=rtpmap:96 MPEG-4/90000\r\n"); + +_LIT8( KCapabilityTestSDPWrongType,"v=0\r\n\ +o=- 452027953 452027953 IN IP4 foobar.com\r\n\ +s=-\r\n\ +c=IN IP4 foobar.com\r\n\ +t=0 0\r\n\ +a=application:com.gsma.rts\r\n\ +a=type:wrongtype\r\n\ +m=video 0 RTP/AVP 96\r\n\ +a=rtpmap:96 H263-2000/90000\r\n"); + +_LIT8( KCapabilityTestSDPWrongApplication,"v=0\r\n\ +o=- 452027953 452027953 IN IP4 foobar.com\r\n\ +s=-\r\n\ +c=IN IP4 foobar.com\r\n\ +t=0 0\r\n\ +a=application:com.gsma.xxx\r\n\ +a=type:videolive\r\n\ +m=video 0 RTP/AVP 96\r\n\ +a=rtpmap:96 H263-2000/90000\r\n"); + +_LIT8( KCapabilityTestSDPNoApplication,"v=0\r\n\ +o=- 452027953 452027953 IN IP4 foobar.com\r\n\ +s=-\r\n\ +c=IN IP4 foobar.com\r\n\ +t=0 0\r\n\ +a=type:videolive\r\n\ +m=video 0 RTP/AVP 96\r\n\ +a=rtpmap:96 H263-2000/90000\r\n"); + +_LIT8( KCapabilityTestSDPNoAppNoType,"v=0\r\n\ +o=- 452027953 452027953 IN IP4 foobar.com\r\n\ +s=-\r\n\ +c=IN IP4 foobar.com\r\n\ +t=0 0\r\n\ +m=video 0 RTP/AVP 96\r\n\ +a=rtpmap:96 H263-2000/90000\r\n"); + +_LIT8( KCapabilityTestSDPNoAppWrongType,"v=0\r\n\ +o=- 452027953 452027953 IN IP4 foobar.com\r\n\ +s=-\r\n\ +c=IN IP4 foobar.com\r\n\ +t=0 0\r\n\ +a=type:wrongtype\r\n\ +m=video 0 RTP/AVP 96\r\n\ +a=rtpmap:96 H263-2000/90000\r\n"); + +_LIT8( KCapabilityTestSDPNoType,"v=0\r\n\ +o=- 452027953 452027953 IN IP4 foobar.com\r\n\ +s=-\r\n\ +c=IN IP4 foobar.com\r\n\ +t=0 0\r\n\ +a=application:com.gsma.rts\r\n\ +m=video 0 RTP/AVP 96\r\n\ +a=rtpmap:96 H263-2000/90000\r\n"); + +_LIT8( KCapabilityTestSDP264,"v=0\r\n\ +o=- 452027953 452027953 IN IP4 foobar.com\r\n\ +s=-\r\n\ +c=IN IP4 foobar.com\r\n\ +t=0 0\r\n\ +a=application:com.gsma.rts\r\n\ +a=type:videolive\r\n\ +m=video 0 RTP/AVP 98\r\n\ +a=rtpmap:98 H264/90000\r\n"); + +_LIT8( KCapabilityTestSDP264And263,"v=0\r\n\ +o=- 452027953 452027953 IN IP4 foobar.com\r\n\ +s=-\r\n\ +c=IN IP4 foobar.com\r\n\ +t=0 0\r\n\ +a=application:com.gsma.rts\r\n\ +a=type:videolive\r\n\ +m=video 0 RTP/AVP 98 96\r\n\ +a=rtpmap:98 H264/90000\r\n\ +a=rtpmap:96 H263-2000/90000\r\n"); + +_LIT8( KCapabilityTestSDP263And264,"v=0\r\n\ +o=- 452027953 452027953 IN IP4 foobar.com\r\n\ +s=-\r\n\ +c=IN IP4 foobar.com\r\n\ +t=0 0\r\n\ +a=application:com.gsma.rts\r\n\ +a=type:videolive\r\n\ +m=video 0 RTP/AVP 96 98\r\n\ +a=rtpmap:98 H264/90000\r\n\ +a=rtpmap:96 H263-2000/90000\r\n"); + +_LIT8( KCapabilityTestSDP264And263AndMpeg,"v=0\r\n\ +o=- 452027953 452027953 IN IP4 foobar.com\r\n\ +s=-\r\n\ +c=IN IP4 foobar.com\r\n\ +t=0 0\r\n\ +a=application:com.gsma.rts\r\n\ +a=type:videolive\r\n\ +m=video 0 RTP/AVP 98 96 99\r\n\ +a=rtpmap:98 H264/90000\r\n\ +a=rtpmap:96 H263-2000/90000\r\n\ +a=rtpmap:99 MPEG4/90000\r\n"); + +_LIT8( KCapabilityTestSDPFastMode,"v=0\r\n\ +o=- 452027953 452027953 IN IP4 foobar.com\r\n\ +s=-\r\n\ +c=IN IP4 foobar.com\r\n\ +t=0 0\r\n\ +a=application:com.gsma.rts\r\n\ +a=type:videolive\r\n\ +a=keywds:fastmode\r\n\ +m=video 0 RTP/AVP 96\r\n\ +a=rtpmap:96 H263-2000/90000\r\n"); + + +_LIT8( KCapabilityTestContentTypeOther, "application/text"); + +_LIT8( KRegisteredContact, "sip:registeredcontact@domain.com" ); + +_LIT8( KCapabilityTestAcceptContactHeader, "Accept-Contact: *;+g.3gpp.cs-voice;explicit"); +_LIT8( KCapabilityTestAcceptHeader, "Accept: application/sdp"); +_LIT8( KCapabilityTestContactHeader_A, "Contact: ;+g.3gpp.cs-voice"); +_LIT8( KCapabilityTestContactHeaderNoFeaturetag_A, "Contact: "); +_LIT8( KCapabilityTestContactHeader_A1, "Contact: ;+g.3gpp.cs-voice"); +_LIT8( KCapabilityTestContactHeader_A1Updated, "Contact: ;+g.3gpp.cs-voice"); +_LIT8( KCapabilityTestContactHeader_B, "Contact: sip:b@foobar.com;+g.3gpp.cs-voice"); +_LIT8( KCapabilityTestSIPAddress_B, "b@localhost"); +_LIT8( KCapabilityTestUserAgent_A, "User-Agent: Terminal_A"); +_LIT8( KCapabilityTestUserAgent_B, "User-Agent: Terminal_B"); +_LIT( KCapabilityTestSIPAddressUri_B, "b@foobar.com"); +_LIT( KCapabilityTestSIPAddressUri_BSIP, "sip:b@foobar.com"); +_LIT8( KCapabilityTestSIPAddressUri8_B, "b@foobar.com"); + +_LIT8( KCapabilityTestDataFeature, "+g.3gpp.cs-data"); +_LIT8( KCapabilitySwisFeatureFalse, "+g.3gpp.cs-voice;false"); + +#define MUS_HEADER_ASSERT( r, ndx, test )\ + if ( r )\ + {\ + HBufC8* header = r->MessageElements().UserHeaders()[ ndx ]->ToTextLC();\ + EUNIT_ASSERT( header->Compare( test ) == 0 );\ + CleanupStack::PopAndDestroy( header );\ + } + + +/** + * Capability Test helper + * + * @lib musavailabilityplugin.lib + * @since S60 v3.2 + */ +class CapabilityTestHelper + { + +public: // static API + + + static CSIPServerTransaction* OptionsRequestL( const TDesC8& aRequestUri, + const TDesC8& aFrom, + const TDesC8& aAcceptContact, + const TDesC8& aContact, + const TDesC8& aAccept, + const TDesC8& aUserAgent ); + + static CSIPServerTransaction* OptionsRequestL( const TDesC8& aRequestUri, + const TDesC8& aFrom, + const TDesC8& aAcceptContact, + const TDesC8& aContact, + const TDesC8& aAccept, + const TDesC8& aUserAgent, + const TDesC8& aAssertId); + + + static CSIPClientTransaction* OptionsResponseL( TUint aResponse, + TInt aPhrase, + const TDesC8& aFrom, + const TDesC8& aContact, + const TDesC8& aUserAgent, + const TDesC8& aPAssertedId, + const TDesC8& aSdp ); + + static void SetResponseL( CSIPClientTransaction& aTrx, + TUint aResponse, + TInt aPhrase, + const TDesC8& aFrom, + const TDesC8& aContact, + const TDesC8& aUserAgent, + const TDesC8& aPAssertedId, + const TDesC8& aSdp, + const TDesC8& aContentType = KNullDesC8 ); + + static void SetResponse2L( CSIPClientTransaction& aTrx, + TUint aResponse, + TInt aPhrase, + const TDesC8& aFrom, + const TDesC8& aContact, + const TDesC8& aUserAgent, + const TDesC8& aPAssertedId, + const TDesC8& aPAssertedId2, + const TDesC8& aSdp, + const TDesC8& aContentType = KNullDesC8 ); + + + }; + + +class HelpFlags + { +public: + static CSIPAddress* iTestSipAddress; + static TBool iUseTestSipAddress; + static TBool iEmptyContactHeader; + }; + + +#endif // MUSAVACAPABILITYTESTHELPER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/inc/ut_cmusavaclientresolverutil.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/inc/ut_cmusavaclientresolverutil.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,87 @@ +/* +* 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: Unit test class +* +*/ + + + +#ifndef __UT_CMUSAVACLIENTRESOLVERUTIL_H__ +#define __UT_CMUSAVACLIENTRESOLVERUTIL_H__ + + +// EXTERNAL INCLUDES +#include +#include + +// FORWARD DECLARATIONS +class CMusAvaClientResolverUtil; + +#ifndef NONSHARABLE_CLASS + #define NONSHARABLE_CLASS(x) class x +#endif + +// CLASS DEFINITION +/** + * Tester class for CMusAvaClientResolverUtil. + * + */ +NONSHARABLE_CLASS( UT_CMusAvaClientResolverUtil ): public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static UT_CMusAvaClientResolverUtil* NewL(); + static UT_CMusAvaClientResolverUtil* NewLC(); + + /** + * Destructor + */ + ~UT_CMusAvaClientResolverUtil(); + + private: // Constructors and destructors + + UT_CMusAvaClientResolverUtil(); + void ConstructL(); + + + private: // Test case setup and teardown + + // Setup and teardown + void SetupL(); + void Teardown(); + + // Setup and teardown for a test to be run using Sawfish + void Setup_SawfishL(); + void Teardown_Sawfish(); + + + private: // Test methods + + void UT_NewL_SucceedsInSawfishL(); + void UT_NewL_FailsInOthersThanSawfishL(); + + private: // Data + + CMusAvaClientResolverUtil* iResolver; + + EUNIT_DECLARE_TEST_TABLE; + + }; + +#endif // __UT_CMUSAVACLIENTRESOLVERUTIL_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaCallEventMonitor.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaCallEventMonitor.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,146 @@ +/* +* 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: +* +*/ + + +// CLASS HEADER +#include "UT_CMusAvaCallEventMonitor.h" + +// EXTERNAL INCLUDES +#include + +// INTERNAL INCLUDES +#include "musavacalleventmonitor.h" +#include "musavacallmonitorobserver.h" +#include "mussesseioninformationapi.h" + + +// CONSTRUCTION +UT_CMusAvaCallEventMonitor* UT_CMusAvaCallEventMonitor::NewL() + { + UT_CMusAvaCallEventMonitor* self = UT_CMusAvaCallEventMonitor::NewLC(); + CleanupStack::Pop( self ); + return self; + } + +UT_CMusAvaCallEventMonitor* UT_CMusAvaCallEventMonitor::NewLC() + { + UT_CMusAvaCallEventMonitor* self = new( ELeave ) UT_CMusAvaCallEventMonitor(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// Destructor (virtual by CBase) +UT_CMusAvaCallEventMonitor::~UT_CMusAvaCallEventMonitor() + { + } + +// Default constructor +UT_CMusAvaCallEventMonitor::UT_CMusAvaCallEventMonitor() + { + } + +// Second phase construct +void UT_CMusAvaCallEventMonitor::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + + +// METHODS + + +void UT_CMusAvaCallEventMonitor::SetupL() + { + iObserver = CMusAvaCallMonitorObserverStub::NewL(); + iCallEventMonitor = CMusAvaCallEventMonitor::NewL( *iObserver ); + } + +void UT_CMusAvaCallEventMonitor::Teardown() + { + delete iObserver; + iObserver = NULL; + delete iCallEventMonitor; + iCallEventMonitor = NULL; + } + +void UT_CMusAvaCallEventMonitor::UT_CMusAvaCallEventMonitor_GetTelNumberLL() + { + // Test tel number + _LIT( KTelNbr, "12345678" ); + User::LeaveIfError( RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusTelNumber, + KTelNbr ) ); + + TBuf telNumber; + TBool isSipUri( ETrue ); + + iCallEventMonitor->GetTelNumberL( telNumber, isSipUri ); + + EUNIT_ASSERT( !isSipUri ); + EUNIT_ASSERT_EQUALS( telNumber, KTelNbr ); + + + // Test SIP URI + _LIT( KSipUri, "sip:12345678@host" ); + User::LeaveIfError( RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusTelNumber, + KSipUri) ); + iCallEventMonitor->GetTelNumberL( telNumber, isSipUri ); + EUNIT_ASSERT( isSipUri ); + EUNIT_ASSERT_EQUALS( telNumber, KSipUri ); + + +#if 0 + // This case can't be run since Unit tests use a stub of RProperty::Get + // and the stub doesn't return KErrOverflow, but results USER 11 panic + // if the value does not fit into given buffer. + + + // Test with a SIP URI that is too long to fit into telNumber buffer + _LIT( KLongSipUri, + "sip:567890@domain.9012345678901234567890123456789012345678901234567890\ +1234567890123456789012345678901" ); + + User::LeaveIfError( RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusTelNumber, + KLongSipUri) ); + EUNIT_ASSERT_SPECIFIC_LEAVE( + iCallEventMonitor->GetTelNumberL( telNumber, isSipUri ), KErrOverflow ); +#endif + } + + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusAvaCallEventMonitor, + "CMusAvaCallEventMonitor", + "UNIT" ) + +EUNIT_TEST( + "GetTelNumberL - test ", + "CMusAvaCapability", + "GetTelNumberL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaCallEventMonitor_GetTelNumberLL, Teardown ) + +EUNIT_END_TEST_TABLE + +// END OF FILE diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaCapability.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaCapability.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,456 @@ +/* +* 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: +* +*/ + + +// CLASS HEADER +#include "UT_CMusAvaCapability.h" + +// EXTERNAL INCLUDES +#include +#include +#include + + +// INTERNAL INCLUDES +#include "sipprofile.h" +#include "sipconnection.h" + +#include "musavaCapabilityExchange.h" +#include "musavaavailabilityobserver.h" +#include "musavaavailabilityobserverimp.h" +#include "musavaoptionhandler.h" +#include "musavasettingsimp.h" +#include "musavaobserverimp.h" +#include "musavaterminal.h" +#include "MusAvaCapability.h" +#include "musavacapabilitytesthelper.h" +#include "CSipSseTestTls.h" +#include "musavacapabilitycontext.h" +#include "musavacapabilityqueryobserverimp.h" +#include "mussettings.h" + +_LIT8( KTestTerminalId, "TestTerminalID" ); + +// CONSTRUCTION +UT_CMusAvaCapability* UT_CMusAvaCapability::NewL() + { + UT_CMusAvaCapability* self = UT_CMusAvaCapability::NewLC(); + CleanupStack::Pop(); + + return self; + } + +UT_CMusAvaCapability* UT_CMusAvaCapability::NewLC() + { + UT_CMusAvaCapability* self = new( ELeave ) UT_CMusAvaCapability(); + CleanupStack::PushL( self ); + + self->ConstructL(); + + return self; + } + +// Destructor (virtual by CBase) +UT_CMusAvaCapability::~UT_CMusAvaCapability() + { + } + +// Default constructor +UT_CMusAvaCapability::UT_CMusAvaCapability() + { + } + +// Second phase construct +void UT_CMusAvaCapability::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + +// METHODS + + + +void UT_CMusAvaCapability::SetupL( ) + { + MSIPObserver* dummyObserver = NULL; + CSIPProfileRegistry* dummyRegistry = NULL; + MSIPConnectionObserver* dummyConnectionObserver = NULL; + + TUid uid = TUid::Uid( 1 ); + TUint32 iapId = 32; + + iSIP = CSIP::NewL( uid, *dummyObserver ); + iProfile = CSIPProfile::NewL( dummyRegistry ); + iSIPConnection = CSIPConnection::NewL( *iSIP, + iapId, + *dummyConnectionObserver ); + + iAvailabilityObserver = CMusAvaAvailabilityObserverImp::NewL(); + iConcreteSettings = CMusAvaSettingsImp::NewL(); + iOptionHandler = CMusAvaOptionHandler::NewL( *iAvailabilityObserver, + *iConcreteSettings ); + + iExchange = iOptionHandler->iCapabilityExchange; + + iCapability = iOptionHandler->iSwisCapability; + + CSipSseTestTls::OpenL(); + iStorage = CSipSseTestTls::Storage(); + iStorage->Set( MusSettingsKeys::KFastStartupMode, + MusSettingsKeys::EFastModeOff ); + } + +void UT_CMusAvaCapability::Teardown( ) + { + delete iOptionHandler; + delete iAvailabilityObserver; + delete iConcreteSettings; + if ( iStorage ) + { + iStorage->Clear(); + CSipSseTestTls::Close(); + iStorage = NULL; + } + + delete iSIPConnection; + delete iProfile; + delete iSIP; + + } + +void UT_CMusAvaCapability::UT_CMusAvaCapability_NewLL( ) + { + + EUNIT_ASSERT( &iCapability->Exchange() == iExchange ); + EUNIT_ASSERT( iCapability->Feature().DesC().Compare( KCapabilitySwisFeature ) == 0 ); + EUNIT_ASSERT( iCapability->Enabled() ); + iCapability->Enabled() = EFalse; + EUNIT_ASSERT( !iCapability->Enabled() ); + + CSIPAcceptContactHeader* acceptContact = NULL; + + // create accept contact with feature tag, check if accept-contact-header has + // feature tag defined in iCapability + acceptContact = MusAvaCapabilityContext::AcceptContactHeaderLC( iCapability->Feature() ); + EUNIT_ASSERT( iCapability->Supports( *acceptContact ) ); + // check if feature tag is the "right one" + EUNIT_ASSERT( iCapability->Feature().DesC().Compare( KCapabilitySwisFeature ) == 0 ); + + // remove the feature tag from accept-contact header, add test-feature-tag + // check that iCapability does not support the test feature tag + // check also that iCapability feature tag is the 'right one' + acceptContact->DeleteParam( iCapability->Feature() ); + RStringF newParam = MusAvaCapabilityContext::SIPStringL( KCapabilityTestDataFeature ); + CleanupClosePushL( newParam ); + acceptContact->SetParamL( newParam ); + CleanupStack::PopAndDestroy();//newParam + EUNIT_ASSERT( !iCapability->Supports( *acceptContact ) ); + EUNIT_ASSERT( iCapability->Feature().DesC().Compare( KCapabilitySwisFeature ) == 0 ); + + CleanupStack::PopAndDestroy( acceptContact ); + + } + +void UT_CMusAvaCapability::UT_CMusAvaCapability_DoPopulateResponseLL( ) + { + CSIPServerTransaction* options = NULL; + + iCapability->Enabled() = ETrue; + + options = CapabilityTestHelper::OptionsRequestL( KCapabilityTestAddress_A, + KCapabilityTestAddress_B, + KCapabilitySwisFeature, + KCapabilitySwisFeature, + KCapabilityTestAcceptHeader, + KCapabilityTestTerminalID_B ); + CleanupStack::PushL( options ); + + CSdpDocument* sdpContent = + CMusAvaCapability::ResponseContentLC( *options ); + + RPointerArray responseHeaders; + CSIPHeaderBase::PushLC( &responseHeaders ); + + iCapability->PopulateResponseL( *options, responseHeaders, *sdpContent ); + + EUNIT_ASSERT( responseHeaders.Count() == 1 ); + EUNIT_ASSERT( sdpContent->AttributeFields().Count() == 2 ); + EUNIT_ASSERT( sdpContent->MediaFields().Count() == 1 ); + EUNIT_ASSERT( sdpContent->MediaFields()[0]->FormatAttributeFields().Count() == 2 ); + + CleanupStack::PopAndDestroy( &responseHeaders ); + CleanupStack::PopAndDestroy( sdpContent ); + CleanupStack::PopAndDestroy( options ); + + } + + +void UT_CMusAvaCapability::Setup1L() + { + // save operator variant setting type to be able to set it back to original value in teardown + iOpVariantSetting = MultimediaSharingSettings::OperatorVariantSettingL(); + iCapabQueryObserver = new ( ELeave ) CMusAvaCapabilityQueryObserverImp(); + iExchange = CMusAvaCapabilityExchange::NewL( KTestTerminalId, *iCapabQueryObserver ); + iCapability = CMusAvaCapability::NewL( *iExchange ); + CSipSseTestTls::OpenL(); + iStorage = CSipSseTestTls::Storage(); + iStorage->Set( MusSettingsKeys::KFastStartupMode, + MusSettingsKeys::EFastModeOff ); + } + +void UT_CMusAvaCapability::Teardown1( ) + { + if ( iStorage ) + { + iStorage->Clear(); + CSipSseTestTls::Close(); + iStorage = NULL; + } + delete iCapability; + delete iExchange; + delete iCapabQueryObserver; + } + + +void UT_CMusAvaCapability::UT_CMusAvaCapability_SupportsL() + { + + CSIPAcceptContactHeader* contactHeader = CSIPAcceptContactHeader::NewLC(); + + RStringF str = MusAvaCapabilityContext::SDPStringL( KCapabilitySwisFeature ); + CleanupClosePushL( str ); + + contactHeader->SetParamL( str ); + + EUNIT_ASSERT( iCapability->Supports( *contactHeader ) ); + + CleanupStack::PopAndDestroy( &str ); + CleanupStack::PopAndDestroy( contactHeader ); + + } + + +void UT_CMusAvaCapability::UT_CMusAvaCapability_ResolveCodecsLL() + { + _LIT( KTest263, "H263-2000/90000"); + _LIT( KTest264, "H264/90000"); + + // Find H.263 codec + CSdpDocument* sdpContent = CSdpDocument::DecodeLC( KCapabilityTestSDP ); + CDesCArrayFlat* codecs = iCapability->ResolveCodecsL( *sdpContent ); + CleanupStack::PushL( codecs ); + EUNIT_ASSERT( codecs->MdcaCount() == 1 ); + EUNIT_ASSERT_EQUALS( (*codecs)[0], KTest263 ); + CleanupStack::PopAndDestroy( codecs ); + CleanupStack::PopAndDestroy( sdpContent ); + + // Find H.264 codec + sdpContent = CSdpDocument::DecodeLC( KCapabilityTestSDP264 ); + codecs = iCapability->ResolveCodecsL( *sdpContent ); + CleanupStack::PushL( codecs ); + EUNIT_ASSERT( codecs->MdcaCount() == 1 ); + EUNIT_ASSERT_EQUALS( (*codecs)[0], KTest264 ); + CleanupStack::PopAndDestroy( codecs ); + CleanupStack::PopAndDestroy( sdpContent ); + + // Find H.263 or H.264 codec + sdpContent = CSdpDocument::DecodeLC( KCapabilityTestSDP264And263 ); + codecs = iCapability->ResolveCodecsL( *sdpContent ); + CleanupStack::PushL( codecs ); + EUNIT_ASSERT( codecs->MdcaCount() == 2 ); + EUNIT_ASSERT_EQUALS( (*codecs)[0], KTest264 ); + EUNIT_ASSERT_EQUALS( (*codecs)[1], KTest263 ); + CleanupStack::PopAndDestroy( codecs ); + CleanupStack::PopAndDestroy( sdpContent ); + + // Do NOT find an invalid codec + sdpContent = CSdpDocument::DecodeLC( KCapabilityTestSDPWrongCodec ); + codecs = iCapability->ResolveCodecsL( *sdpContent ); + CleanupStack::PushL( codecs ); + EUNIT_ASSERT( codecs->MdcaCount() == 0 ); + CleanupStack::PopAndDestroy( codecs ); + CleanupStack::PopAndDestroy( sdpContent ); + + } + +void UT_CMusAvaCapability::UT_CMusAvaCapability_AttributeL() + { + + CSdpDocument* sdpContent = CSdpDocument::DecodeLC( KCapabilityTestSDP ); + + // give an attribute which can be found + RStringF attribute = MusAvaCapabilityContext::SDPStringL( _L8("type") ); + CleanupClosePushL( attribute ); + EUNIT_ASSERT( iCapability->Attribute( attribute, *sdpContent ) ); + CleanupStack::PopAndDestroy( &attribute ); + + // give an attribute which can be not found + attribute = MusAvaCapabilityContext::SDPStringL( _L8("xxx") ); + CleanupClosePushL( attribute ); + EUNIT_ASSERT( !iCapability->Attribute( attribute, *sdpContent ) ); + CleanupStack::PopAndDestroy( &attribute ); + + CleanupStack::PopAndDestroy( sdpContent ); + } + + +void UT_CMusAvaCapability::UT_CMusAvaCapability_PopulateResponseL_OpSpecificL() + { + + MultimediaSharingSettings::SetOperatorVariantSettingL( MusSettingsKeys::EOperatorSpecific ); + iCapabQueryObserver->iCapabilitiesResolvedForCingular = ETrue; + + CSIPServerTransaction* options = + CapabilityTestHelper::OptionsRequestL( KCapabilityTestAddress_A, + KCapabilityTestAddress_B, + KCapabilitySwisFeature, + KCapabilitySwisFeature, + KCapabilityTestAcceptHeader, + KCapabilityTestTerminalID_B ); + CleanupStack::PushL( options ); + + CSdpDocument* sdpContent = + CMusAvaCapability::ResponseContentLC( *options ); + + RPointerArray responseHeaders; + CSIPHeaderBase::PushLC( &responseHeaders ); + + iCapability->PopulateResponseL( *options, responseHeaders, *sdpContent ); + + EUNIT_ASSERT( responseHeaders.Count() == 1 ); + HBufC8* headerValue = responseHeaders[0]->ToTextValueL(); + // header value contains just one field + EUNIT_ASSERT_EQUALS( KErrNotFound, headerValue->Find(_L8(";") ) ); + delete headerValue; + + CleanupStack::PopAndDestroy( &responseHeaders ); + CleanupStack::PopAndDestroy( sdpContent ); + CleanupStack::PopAndDestroy( options ); + } + + +void UT_CMusAvaCapability::UT_CMusAvaCapability_ResolveFastModeLL() + { + // Fast mode feature is disabled in cenrep, fast mode is present in SDP + CSdpDocument* sdpContent = CSdpDocument::DecodeLC( KCapabilityTestSDPFastMode ); + MusSettingsKeys::TFastMode mode = iCapability->ResolveFastModeL( *sdpContent ); + EUNIT_ASSERT( mode == MusSettingsKeys::EFastModeOff ); + CleanupStack::PopAndDestroy( sdpContent ); + + // Fast mode feature is enabled in cenrep, fast mode is present in SDP + iStorage->Set( MusSettingsKeys::KFastStartupMode, MusSettingsKeys::EFastModeOn ); + sdpContent = CSdpDocument::DecodeLC( KCapabilityTestSDPFastMode ); + mode = iCapability->ResolveFastModeL( *sdpContent ); + EUNIT_ASSERT( mode == MusSettingsKeys::EFastModeOn ); + CleanupStack::PopAndDestroy( sdpContent ); + + // Fast mode feature is enabled in cenrep, fast mode isn't present in SDP + sdpContent = CSdpDocument::DecodeLC( KCapabilityTestSDP ); + mode = iCapability->ResolveFastModeL( *sdpContent ); + EUNIT_ASSERT( mode == MusSettingsKeys::EFastModeOff ); + CleanupStack::PopAndDestroy( sdpContent ); + } + +void UT_CMusAvaCapability::UT_CMusAvaCapability_AddFastModeLL() + { + // Fast mode feature is disabled in cenrep + CSdpDocument* sdpContent = CSdpDocument::DecodeLC( KCapabilityTestSDP ); + EUNIT_ASSERT( sdpContent->AttributeFields().Count() == 2 ); + iCapability->AddFastModeL( *sdpContent ); + EUNIT_ASSERT( sdpContent->AttributeFields().Count() == 2 ); + + // Fast mode feature is enabled in cenrep, a=keywds:fastmode added + iStorage->Set( MusSettingsKeys::KFastStartupMode, MusSettingsKeys::EFastModeOn ); + iCapability->AddFastModeL( *sdpContent ); + EUNIT_ASSERT( sdpContent->AttributeFields().Count() == 3 ); + const CSdpAttributeField* field = sdpContent->AttributeFields()[2]; + RStringF keywds = MusAvaCapabilityContext::SDPStringL( + SdpCodecStringConstants::EAttributeKeywds ); + EUNIT_ASSERT( field->Attribute() == keywds ); + EUNIT_ASSERT( field->Value().Compare( KCapabilitySDPAttributeFastMode ) == 0 ); + CleanupStack::PopAndDestroy( sdpContent ); + } + + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusAvaCapability, + "CMusAvaCapability", + "UNIT" ) + +EUNIT_TEST( + "NewL - test ", + "CMusAvaCapability", + "NewL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaCapability_NewLL, Teardown) + +EUNIT_TEST( + "DoPopulateResponseL - test ", + "CMusAvaCapability", + "DoPopulateResponseL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaCapability_DoPopulateResponseLL, Teardown) + +EUNIT_TEST( + "Supports - test ", + "CMusAvaCapability", + "Supports", + "FUNCTIONALITY", + Setup1L, UT_CMusAvaCapability_SupportsL, Teardown1 ) + +EUNIT_TEST( + "ResolveCodecsL - test ", + "CMusAvaCapability", + "ResolveCodecsL", + "FUNCTIONALITY", + Setup1L, UT_CMusAvaCapability_ResolveCodecsLL, Teardown1 ) + +EUNIT_TEST( + "Attribute - test ", + "CMusAvaCapability", + "Attribute", + "FUNCTIONALITY", + Setup1L, UT_CMusAvaCapability_AttributeL, Teardown1 ) + +EUNIT_TEST( + "PopulateResponseL Operator Specific - test ", + "CMusAvaCapability", + "PopulateResponseL", + "FUNCTIONALITY", + Setup1L, UT_CMusAvaCapability_PopulateResponseL_OpSpecificL, Teardown1 ) + +EUNIT_TEST( + "ResolveFastModeL - test ", + "CMusAvaCapability", + "ResolveFastModeL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaCapability_ResolveFastModeLL, Teardown) + +EUNIT_TEST( + "AddFastModeL - test ", + "CMusAvaCapability", + "AddFastModeL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaCapability_AddFastModeLL, Teardown) + +EUNIT_END_TEST_TABLE + +// END OF FILE diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaCapabilityExchange.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaCapabilityExchange.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,929 @@ +/* +* 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: +* +*/ + + +// CLASS HEADER +#include "UT_CMusAvaCapabilityExchange.h" +#include "muslogger.h" + + + +// EXTERNAL INCLUDES +#include +#include +#include +#include +#include +#include +#include +#include +// INTERNAL INCLUDES +#include "musavaCapabilityExchange.h" +#include "musavaavailabilityobserver.h" +#include "musavaavailabilityobserverimp.h" +#include "musavacapabilitytesthelper.h" +#include "musavacapability.h" +#include "musavaterminal.h" +#include "CSipSseTestTls.h" +#include "musavaoptionhandler.h" +#include "musavasettingsimp.h" +#include "musavacapabilityquery.h" +#include "mussettings.h" +#include "mussettingskeys.h" +#include "musavaobserverimp.h" +#include "musavasharedobject.h" +#include "musavasip.h" +#include "musavaobserver.h" +// CONSTRUCTION +UT_CMusAvaCapabilityExchange* UT_CMusAvaCapabilityExchange::NewL() + { + UT_CMusAvaCapabilityExchange* self = UT_CMusAvaCapabilityExchange::NewLC(); + CleanupStack::Pop(); + + return self; + } + +UT_CMusAvaCapabilityExchange* UT_CMusAvaCapabilityExchange::NewLC() + { + UT_CMusAvaCapabilityExchange* self = new( ELeave ) UT_CMusAvaCapabilityExchange(); + CleanupStack::PushL( self ); + self->ConstructL(); + + return self; + } + +// Destructor (virtual by CBase) +UT_CMusAvaCapabilityExchange::~UT_CMusAvaCapabilityExchange() + { + } + +// Default constructor +UT_CMusAvaCapabilityExchange::UT_CMusAvaCapabilityExchange() + { + } + +// Second phase construct +void UT_CMusAvaCapabilityExchange::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + +// METHODS + +_LIT8( KTestNewTerminal, "new@foo.bar"); + +void UT_CMusAvaCapabilityExchange::SetupL( ) + { + MSIPObserver* dummyObserver = NULL; + CSIPProfileRegistry* dummyRegistry = NULL; + MSIPConnectionObserver* dummyConnectionObserver = NULL; + + TUid uid = TUid::Uid( 1 ); + TUint32 iapId = 32; + + iAvailabilityObserver = CMusAvaAvailabilityObserverImp::NewL(); + iConcreteSettings = CMusAvaSettingsImp::NewL(); + iOptionHandler = CMusAvaOptionHandler::NewL( *iAvailabilityObserver, + *iConcreteSettings ); + iSIP = CSIP::NewL( uid, *dummyObserver ); + iProfile = CSIPProfile::NewL( dummyRegistry ); + iOptionHandler->iSharedObj->MusAvaSip().iSipProfile = iProfile; + iSIPConnection = CSIPConnection::NewL( *iSIP, + iapId, + *dummyConnectionObserver ); + iOptionHandler->iSharedObj->MusAvaSip().iSipConnection = iSIPConnection; + + iExchange = iOptionHandler->iCapabilityExchange; + + iCapability = iOptionHandler->iSwisCapability; + if ( !iProfile->iRegisteredContact ) + { + iProfile->iRegisteredContact = KRegisteredContact().AllocL(); + } + + CSipSseTestTls::OpenL(); + iStorage = CSipSseTestTls::Storage(); + iStorage->Set( MusSettingsKeys::KFastStartupMode, + MusSettingsKeys::EFastModeOff ); + } + +void UT_CMusAvaCapabilityExchange::Teardown( ) + { + if ( iStorage ) + { + iStorage->Clear(); + CSipSseTestTls::Close(); + iStorage = NULL; + } + + delete iOptionHandler; + delete iAvailabilityObserver; + delete iConcreteSettings; + delete iSIP; + } + +void UT_CMusAvaCapabilityExchange::UT_CMusAvaCapabilityExchange_NewLL( ) + { + EUNIT_ASSERT( iExchange->Capabilities().Count() == 1 ); + EUNIT_ASSERT( iExchange->Terminals().Count() == 0 ); + EUNIT_ASSERT( iExchange->Capabilities()[0] == iCapability ); + } + +void UT_CMusAvaCapabilityExchange::UT_CMusAvaCapabilityExchange_QueryObserverL( ) + { + EUNIT_ASSERT( &iExchange->QueryObserver() == iOptionHandler ); + } + +void UT_CMusAvaCapabilityExchange::UT_CMusAvaCapabilityExchange_TerminalIdL( ) + { + EUNIT_ASSERT( iExchange->TerminalId().Compare( KNullDesC8 ) == 0 ); + } + +void UT_CMusAvaCapabilityExchange::UT_CMusAvaCapabilityExchange_QueryReceivedL() + { + EUNIT_DISABLE_ALLOC_DECORATOR; + MultimediaSharingSettings::SetSipProfileSettingL( 1 ); + if ( !iProfile->iArray ) + { + iProfile->iArray = new ( ELeave ) CDesC8ArrayFlat( 1 ); + iProfile->iArray->AppendL( _L8("sip:user@domain.com") ); + } + + MultimediaSharingSettings::SetOperatorVariantSettingL( + MusSettingsKeys::EStandard ); + MultimediaSharingSettings::SetCapabilityQuerySettingL( + MusSettingsKeys::ESequential ); + + CSIPServerTransaction* request = NULL; + + TBufC16<16> str(KCapabilityTestSIPAddressUri_BSIP); + HBufC16* ptr; + ptr = str.AllocLC(); + CDesCArrayFlat* sipAddress = new( ELeave ) CDesCArrayFlat( 1 ); + CleanupStack::PushL( sipAddress ); + sipAddress->AppendL( *ptr ); + iOptionHandler->iSettings.SetSipAddressesL( *sipAddress ); + sipAddress->Reset(); + CleanupStack::PopAndDestroy( sipAddress ); + CleanupStack::PopAndDestroy(); //ptr + EUNIT_ENABLE_ALLOC_DECORATOR; + + EUNIT_ASSERT( iExchange->Capabilities().Count() == 1 ); + EUNIT_ASSERT( iExchange->Capabilities()[0] == iCapability ); + EUNIT_ASSERT( iCapability->Feature().DesC().Compare( KCapabilitySwisFeature ) == 0 ); + +//ok & No terminal id configured + EUNIT_DISABLE_ALLOC_DECORATOR; + iStorage->Clear(); + iExchange->iTerminals.ResetAndDestroy(); + iOptionHandler->iState = MMusAvaObserver::EMusAvaStatusNotExecuted; + request = CapabilityTestHelper::OptionsRequestL( KCapabilityTestAddress_A, + KCapabilityTestAddress_B, + KCapabilitySwisFeature, + KCapabilitySwisFeature, + KCapabilityTestAcceptHeader, + KCapabilityTestTerminalID_B ); + + iOptionHandler->iCapabilitiesRequestAnswered = EFalse; + EUNIT_ENABLE_ALLOC_DECORATOR; + iExchange->QueryReceived( request ); + TInt count = NULL; + EUNIT_GET_ALLOC_DECORATOR_FAILCOUNT( count ); + if ( count > 0 && + iOptionHandler->State() != MMusAvaObserver::EMusAvaStatusOptionsSent ) + { + User::Leave( KErrNoMemory ); + } + + EUNIT_ASSERT( iOptionHandler->State() == MMusAvaObserver::EMusAvaStatusOptionsSent ); + EUNIT_ASSERT( iExchange->Terminals().Count() == 1 ); + EUNIT_ASSERT( iExchange->Terminals()[0]->Id().Compare( KCapabilityTestTerminalID_B ) == 0 ); + EUNIT_ASSERT( iExchange->Terminals()[0]->Uri().Compare( KCapabilityTestAddress_B ) == 0 ); + EUNIT_ASSERT( iExchange->Terminals()[0]->RequestedQuery() ); + EUNIT_ASSERT( !iExchange->Terminals()[0]->IsDiscovered() ); + + EUNIT_ASSERT( iStorage->iResponseToRequest == SIPStrings::StringF( SipStrConsts::EOptions ) ); + EUNIT_ASSERT( iStorage->iClientResponse->StatusCode() == KMUSAVASIP200 ); + EUNIT_ASSERT( iStorage->iClientResponse->MessageElements().Content().Length() > 0 ); + EUNIT_ASSERT( iStorage->iClientResponse->MessageElements().Content().Compare( KCapabilityTestSDP264And263 ) == 0 ); + + EUNIT_ASSERT( iStorage->iClientResponse->MessageElements().UserHeaders().Count() == 3 ); + MUS_HEADER_ASSERT( iStorage->iClientResponse, 0, KCapabilityTestContactHeader_A ); + iStorage->Clear(); + } + +void UT_CMusAvaCapabilityExchange::UT_CMusAvaCapabilityExchange_QueryReceived1L() + { + EUNIT_DISABLE_ALLOC_DECORATOR; + MultimediaSharingSettings::SetSipProfileSettingL( 1 ); + if ( !iProfile->iArray ) + { + iProfile->iArray = new ( ELeave ) CDesC8ArrayFlat( 1 ); + iProfile->iArray->AppendL( _L8("sip:user@domain.com") ); + } + + MultimediaSharingSettings::SetOperatorVariantSettingL( + MusSettingsKeys::EStandard ); + MultimediaSharingSettings::SetCapabilityQuerySettingL( + MusSettingsKeys::ESequential ); + + CSIPServerTransaction* request = NULL; + +//fails + iStorage->Clear(); + iOptionHandler->iState = MMusAvaObserver::EMusAvaStatusNotExecuted; + request = CapabilityTestHelper::OptionsRequestL( KCapabilityTestAddress_A, + KCapabilityTestAddress_B, + KNullDesC8,//Accepct-Contact + KCapabilitySwisFeature, + KCapabilityTestAcceptHeader, + KCapabilityTestTerminalID_B ); + + EUNIT_ENABLE_ALLOC_DECORATOR; + iExchange->QueryReceived( request ); + TInt count = NULL; + EUNIT_GET_ALLOC_DECORATOR_FAILCOUNT( count ); + if ( count > 0 && + ( iStorage->iResponseToRequest != SIPStrings::StringF( SipStrConsts::EOptions ) || + iExchange->Terminals().Count() < 1 ) ) + { + User::Leave( KErrNoMemory ); + } + + EUNIT_ASSERT( iStorage->iResponseToRequest == SIPStrings::StringF( SipStrConsts::EOptions ) ); + EUNIT_ASSERT( iExchange->Terminals().Count() == 1 ); + EUNIT_ASSERT( iExchange->Terminals()[0]->IsDiscovered() ); + EUNIT_ASSERT( iStorage->iResponseToRequest == SIPStrings::StringF( SipStrConsts::EOptions ) ); + EUNIT_ASSERT( iStorage->iClientResponse->StatusCode() == KMUSAVASIPServerInternalError ); + EUNIT_ASSERT( iStorage->iClientResponse->MessageElements().Content().Length() == 0 ); + + delete iExchange->iTerminals[ 0 ]; + iExchange->iTerminals.Remove( 0 ); + EUNIT_ASSERT( iExchange->Terminals().Count() == 0 ); + iStorage->Clear(); + } + +void UT_CMusAvaCapabilityExchange::UT_CMusAvaCapabilityExchange_QueryReceived2L() + { + EUNIT_DISABLE_ALLOC_DECORATOR; + MultimediaSharingSettings::SetSipProfileSettingL( 1 ); + if ( !iProfile->iArray ) + { + iProfile->iArray = new ( ELeave ) CDesC8ArrayFlat( 1 ); + iProfile->iArray->AppendL( _L8("sip:user@domain.com") ); + } + + MultimediaSharingSettings::SetOperatorVariantSettingL( + MusSettingsKeys::EStandard ); + MultimediaSharingSettings::SetCapabilityQuerySettingL( + MusSettingsKeys::ESequential ); + + CSIPServerTransaction* request = NULL; + + TBufC16<16> str(KCapabilityTestSIPAddressUri_BSIP); + HBufC16* ptr; + ptr = str.AllocLC(); + CDesCArrayFlat* sipAddress = new( ELeave ) CDesCArrayFlat( 1 ); + CleanupStack::PushL( sipAddress ); + sipAddress->AppendL( *ptr ); + iOptionHandler->iSettings.SetSipAddressesL( *sipAddress ); + sipAddress->Reset(); + CleanupStack::PopAndDestroy( sipAddress ); + CleanupStack::PopAndDestroy(); //ptr + EUNIT_ENABLE_ALLOC_DECORATOR; + + // cingular case && first OPTIONS request received + + iExchange->iTerminals.ResetAndDestroy(); + iOptionHandler->iCapabilitiesRequestAnswered = EFalse; + // set cingular variant key on + MultimediaSharingSettings::SetOperatorVariantSettingL( + MusSettingsKeys::EOperatorSpecific ); + request = CapabilityTestHelper::OptionsRequestL( KCapabilityTestAddress_A, + KCapabilityTestAddress_B, + KCapabilitySwisFeature, + KCapabilitySwisFeature, + KCapabilityTestAcceptHeader, + KCapabilityTestTerminalID_B ); + + iOptionHandler->iState = MMusAvaObserver::EMusAvaStatusNotExecuted; + iExchange->QueryReceived( request ); + TInt count = NULL; + EUNIT_GET_ALLOC_DECORATOR_FAILCOUNT( count ); + if ( count > 0 && + iOptionHandler->State() != MMusAvaObserver::EMusAvaStatusOptionsSent ) + { + User::Leave( KErrNoMemory ); + } + + EUNIT_ASSERT( iOptionHandler->State() == MMusAvaObserver::EMusAvaStatusOptionsSent); + EUNIT_ASSERT( iOptionHandler->CapabilitiesResolvedForCingular() == ETrue ); + MUS_HEADER_ASSERT( iStorage->iClientResponse, 0, KCapabilityTestContactHeader_A ); + + iStorage->Clear(); + // cingular case && second OPTIONS request received + // set cingular variant key on + EUNIT_DISABLE_ALLOC_DECORATOR; + MultimediaSharingSettings::SetOperatorVariantSettingL( + MusSettingsKeys::EOperatorSpecific ); + + + iExchange->iTerminals.ResetAndDestroy(); + iOptionHandler->iState = MMusAvaObserver::EMusAvaStatusNotExecuted; + iOptionHandler->iCapabilitiesRequestAnswered = ETrue; + + request = CapabilityTestHelper::OptionsRequestL( KCapabilityTestAddress_A, + KCapabilityTestAddress_B, + KCapabilitySwisFeature, + KCapabilitySwisFeature, + KCapabilityTestAcceptHeader, + KCapabilityTestTerminalID_B ); + EUNIT_ENABLE_ALLOC_DECORATOR; + iExchange->QueryReceived( request ); + EUNIT_GET_ALLOC_DECORATOR_FAILCOUNT( count ); + if ( count > 0 && + iStorage->iClientResponse->MessageElements().UserHeaders().Count() == 0 ) + { + User::Leave( KErrNoMemory ); + } + + EUNIT_ASSERT( iOptionHandler->CapabilitiesResolvedForCingular() == ETrue ); + EUNIT_ASSERT( MultimediaSharingSettings::OperatorVariantSettingL() == + MusSettingsKeys::EOperatorSpecific ); + EUNIT_ASSERT( iOptionHandler->State() == MMusAvaObserver::EMusAvaStatusNotExecuted ); + MUS_HEADER_ASSERT( iStorage->iClientResponse, 0, KCapabilityTestContactHeaderNoFeaturetag_A ); + } + +void UT_CMusAvaCapabilityExchange::UT_CMusAvaCapabilityExchange_CancelQueryL() + { + EUNIT_DISABLE_ALLOC_DECORATOR; + if ( !iProfile->iArray ) + { + iProfile->iArray = new ( ELeave ) CDesC8ArrayFlat( 1 ); + iProfile->iArray->AppendL( _L8("sip:user@domain.com") ); + } + + CMusAvaCapabilityQuery* query = NULL; + + query = CMusAvaCapabilityQuery::NewL( *iCapability, + *iSIPConnection, + *iProfile, + KCapabilityTestSIPAddressUri_B ); + CleanupStack::PushL( query ); + + EUNIT_ASSERT( query->Result() == KCapabilityQueryNotReady ); + EUNIT_ASSERT( query->State() == + CMusAvaCapabilityQueryBase::ECapabilityQueryCreated ); + EUNIT_ASSERT( !query->iTimer ); + EUNIT_ASSERT( !query->iTrx ); + + EUNIT_ASSERT( iExchange->Terminals().Count() == 1 ); + EUNIT_ASSERT( query->Terminal().Id().Length() == 0 ); + EUNIT_ASSERT( !query->Terminal().RequestedQuery() ); + EUNIT_ASSERT( !query->Terminal().IsDiscovered() ); + + query->Terminal().ExecuteQueryL( query ); + CleanupStack::Pop( query ); + + EUNIT_ASSERT( query->Terminal().iQuery == query ); + EUNIT_ASSERT( query->Result() == KCapabilityQueryNotReady ); + EUNIT_ASSERT( query->State() == + CMusAvaCapabilityQueryBase::ECapabilityQueryExecuting ); + EUNIT_ASSERT( !query->iTimer ); + EUNIT_ASSERT( query->iTrx ); + + query->SetState( CMusAvaCapabilityQueryBase::ECapabilityQueryExecuting ); + + //200 OK with User-Agent + CapabilityTestHelper::SetResponseL( *query->iTrx, + KMUSAVASIP200, + SipStrConsts::EPhraseOk, + KCapabilityTestAddress_B, + KCapabilitySwisFeature, + KCapabilityTestTerminalID_B, + KPAssertedIdentity_B, + KCapabilityTestSDP ); + TInt err = 404; + EUNIT_ENABLE_ALLOC_DECORATOR; + iExchange->CancelQuery( err, *query->iTrx ); + EUNIT_ASSERT( query->State() == + CMusAvaCapabilityQueryBase::ECapabilityQueryCompleted ); + } + +void UT_CMusAvaCapabilityExchange::UT_CMusAvaCapabilityExchange_AddCapabilityLL( ) + { + TInt index = KErrNotFound; + CMusAvaCapability* capability = NULL; + + for ( TInt i=0; i < iExchange->iCapabilities.Count() && index == KErrNotFound; i++ ) + { + capability = iExchange->iCapabilities[i]; + if ( capability->Feature() == iCapability->Feature() ) + { + index = i; + } + } + EUNIT_ASSERT( index == 0 ); + } + +void UT_CMusAvaCapabilityExchange::UT_CMusAvaCapabilityExchange_TerminalLL() + { + EUNIT_ASSERT( iExchange->Terminals().Count() == 0 ); + + CSIPServerTransaction* request = NULL; + + for( TInt i = 0;i<6;i++ ) + { + + if ( i == 0 || i == 1 ) + { + + request = + CapabilityTestHelper::OptionsRequestL( KCapabilityTestAddress_A, + KCapabilityTestAddress_B, + KCapabilitySwisFeature, + KCapabilitySwisFeature, + KCapabilityTestAcceptHeader, + KNullDesC8 ); + } + else if ( i == 2 || i == 3 ) + { + request = + CapabilityTestHelper::OptionsRequestL( KCapabilityTestAddress_A, + KCapabilityTestAddress_B, + KCapabilitySwisFeature, + KCapabilitySwisFeature, + KCapabilityTestAcceptHeader, + KCapabilityTestTerminalID_B ); + } + else if ( i == 4 ) + { + request = + CapabilityTestHelper::OptionsRequestL( KCapabilityTestAddress_A, + KCapabilityTestAddress_A,//OK + KCapabilitySwisFeature, + KCapabilitySwisFeature, + KCapabilityTestAcceptHeader, + KNullDesC8 ); + } + else if ( i == 5 ) + { + request = + CapabilityTestHelper::OptionsRequestL( KCapabilityTestAddress_A, + KCapabilityTestAddress_A,//OK + KCapabilitySwisFeature, + KCapabilitySwisFeature, + KCapabilityTestAcceptHeader, + KCapabilityTestTerminalID_A ); + } + + CleanupStack::PushL( request ); + + // Next function call creates a terminal for capability exchage + iExchange->TerminalL( *request ); + + if ( i == 0 ) + { + // Next function has the same uri as the already created terminal has, it should not create the new one + iExchange->TerminalL( KCapabilityTestAddress_B ); + EUNIT_ASSERT( iExchange->Terminals().Count() == 1 ); + EUNIT_ASSERT( iExchange->Terminals()[0]->Id().Compare( KNullDesC8 ) == 0 ); + EUNIT_ASSERT( iExchange->Terminals()[0]->Uri().Compare( KCapabilityTestAddress_B ) == 0 ); + } + else if ( i == 1 ) + { + // Next function has the same uri as the already created terminal has, it should not create the new one + iExchange->TerminalL( KCapabilityTestAddress_B ); + EUNIT_ASSERT( iExchange->Terminals().Count() == 1 ); + EUNIT_ASSERT( iExchange->Terminals()[0]->Id().Compare( KNullDesC8 ) == 0 ); + EUNIT_ASSERT( iExchange->Terminals()[0]->Uri().Compare( KCapabilityTestAddress_B ) == 0 ); + } + else if ( i == 2 ) + { + // Next function has the same uri as the already created terminal has, it should not create the new one + iExchange->TerminalL( KCapabilityTestAddress_B ); + EUNIT_ASSERT( iExchange->Terminals().Count() == 1 ); + EUNIT_ASSERT( iExchange->Terminals()[0]->Id().Compare( KCapabilityTestTerminalID_B ) == 0 ); + EUNIT_ASSERT( iExchange->Terminals()[0]->Uri().Compare( KCapabilityTestAddress_B ) == 0 ); + } + else if ( i == 3 ) + { + // Next function has the same uri as the already created terminal has, it should not create the new one + iExchange->TerminalL( KCapabilityTestAddress_B ); + EUNIT_ASSERT( iExchange->Terminals().Count() == 1 ); + EUNIT_ASSERT( iExchange->Terminals()[0]->Id().Compare( KCapabilityTestTerminalID_B ) == 0 ); + EUNIT_ASSERT( iExchange->Terminals()[0]->Uri().Compare( KCapabilityTestAddress_B ) == 0 ); + } + else if ( i == 4 ) + { + // Next function has the same uri as the already created terminal has, it should not create the new one + iExchange->TerminalL( KCapabilityTestAddress_B ); + EUNIT_ASSERT( iExchange->Terminals().Count() == 2 ); + EUNIT_ASSERT( iExchange->Terminals()[0]->Id().Compare( KCapabilityTestTerminalID_B ) == 0 ); + EUNIT_ASSERT( iExchange->Terminals()[0]->Uri().Compare( KCapabilityTestAddress_B ) == 0 ); + EUNIT_ASSERT( iExchange->Terminals()[1]->Id().Compare( KNullDesC8 ) == 0 ); + EUNIT_ASSERT( iExchange->Terminals()[1]->Uri().Compare( KCapabilityTestAddress_A ) == 0 ); + } + else if ( i == 5 ) + { + // Next function has the same uri as the already created terminal has, it should not create the new one + iExchange->TerminalL( KCapabilityTestAddress_B ); + EUNIT_ASSERT( iExchange->Terminals().Count() == 2 ); + EUNIT_ASSERT( iExchange->Terminals()[0]->Id().Compare( KCapabilityTestTerminalID_B ) == 0 ); + EUNIT_ASSERT( iExchange->Terminals()[0]->Uri().Compare( KCapabilityTestAddress_B ) == 0 ); + EUNIT_ASSERT( iExchange->Terminals()[1]->Id().Compare( KCapabilityTestTerminalID_A ) == 0 ); + EUNIT_ASSERT( iExchange->Terminals()[1]->Uri().Compare( KCapabilityTestAddress_A ) == 0 ); + } + + CleanupStack::PopAndDestroy( request ); + + } + + } + +void UT_CMusAvaCapabilityExchange::UT_CMusAvaCapabilityExchange_RejectQueryLL() + { + EUNIT_DISABLE_ALLOC_DECORATOR; + CSIPServerTransaction* request = NULL; + + iStorage->Clear(); + + request = + CapabilityTestHelper::OptionsRequestL( KCapabilityTestAddress_A, + KCapabilityTestAddress_B, + KCapabilitySwisFeature, + KCapabilitySwisFeature, + KCapabilityTestAcceptHeader, + KNullDesC8 ); + + + CleanupStack::PushL( request ); + EUNIT_ENABLE_ALLOC_DECORATOR; + + iExchange->RejectQueryL( *request, KMUSAVASIPNotImplemented ); + EUNIT_ASSERT( iStorage->iResponseToRequest == SIPStrings::StringF( SipStrConsts::EOptions ) ); + EUNIT_ASSERT( iStorage->iClientResponse->StatusCode() == KMUSAVASIPNotImplemented ); + EUNIT_ASSERT( iStorage->iClientResponse->ReasonPhrase() == SIPStrings::StringF( SipStrConsts::EEmpty ) ); + EUNIT_ASSERT( iStorage->iClientResponse->MessageElements().Content().Length() == 0 ); + + iStorage->Clear(); + + iExchange->RejectQueryL( *request, KErrGeneral ); + EUNIT_ASSERT( iStorage->iResponseToRequest == SIPStrings::StringF( SipStrConsts::EOptions ) ); + EUNIT_ASSERT( iStorage->iClientResponse->StatusCode() == KMUSAVASIPServerInternalError ); + EUNIT_ASSERT( iStorage->iClientResponse->ReasonPhrase() == SIPStrings::StringF( SipStrConsts::EPhraseServerInternalError ) ); + EUNIT_ASSERT( iStorage->iClientResponse->MessageElements().Content().Length() == 0 ); + + CleanupStack::PopAndDestroy( request ); + } + +void UT_CMusAvaCapabilityExchange::UT_CMusAvaCapabilityExchange_FindByFeatureL() + { + EUNIT_ASSERT( iExchange->FindByFeature(*iCapability) == 0 ); + } + +void UT_CMusAvaCapabilityExchange::UT_CMusAvaCapabilityExchange_AnswerToQueryReceivedL( ) + { + if ( !iProfile->iArray ) + { + iProfile->iArray = new ( ELeave ) CDesC8ArrayFlat( 1 ); + iProfile->iArray->AppendL( _L8("sip:user@domain.com") ); + } + + MultimediaSharingSettings::SetOperatorVariantSettingL( + MusSettingsKeys::EStandard ); + + EUNIT_ASSERT( iExchange->Capabilities().Count() == 1 ); + EUNIT_ASSERT( iExchange->Capabilities()[0] == iCapability ); + EUNIT_ASSERT( iCapability->Feature().DesC().Compare( KCapabilitySwisFeature ) == 0 ); + + CMusAvaCapabilityQuery* query = NULL; + + +//init + for( TInt i = 0; i<5;i++ ) + { + query = CMusAvaCapabilityQuery::NewL( *iCapability, + *iSIPConnection, + *iProfile, + KCapabilityTestSIPAddressUri_B ); + CleanupStack::PushL( query ); + + EUNIT_ASSERT( query->Result() == KCapabilityQueryNotReady ); + EUNIT_ASSERT( query->State() == CMusAvaCapabilityQueryBase::ECapabilityQueryCreated ); + EUNIT_ASSERT( !query->iTimer ); + EUNIT_ASSERT( !query->iTrx ); + + EUNIT_ASSERT( iExchange->Terminals().Count() == 1 ); + if ( i == 0 ) + { + EUNIT_ASSERT( query->Terminal().Id().Length() == 0 ); + } + else + { + EUNIT_ASSERT( query->Terminal().Id().Length() > 0 ); + EUNIT_ASSERT( query->Terminal().Id().Compare( KCapabilityTestTerminalID_B ) == 0 ); + } + + EUNIT_ASSERT( !query->Terminal().RequestedQuery() ); + EUNIT_ASSERT( !query->Terminal().IsDiscovered() ); + + // Since several queries cannot be executed, we delete the old one... + delete query->iTerminal->iQuery; + query->iTerminal->iQuery = NULL; + + // ...before execution + query->Terminal().ExecuteQueryL( query ); + CleanupStack::Pop( query ); + + EUNIT_ASSERT( query->Terminal().iQuery == query ); + EUNIT_ASSERT( query->Result() == KCapabilityQueryNotReady ); + EUNIT_ASSERT( query->State() == CMusAvaCapabilityQueryBase::ECapabilityQueryExecuting ); + EUNIT_ASSERT( !query->iTimer ); + EUNIT_ASSERT( query->iTrx ); + + EUNIT_ASSERT( iExchange->Terminals().Count() == 1 ); + if ( i == 0 ) + { + EUNIT_ASSERT( query->Terminal().Id().Length() == 0 ); + } + else + { + EUNIT_ASSERT( query->Terminal().Id().Length() > 0 ); + EUNIT_ASSERT( query->Terminal().Id().Compare( KCapabilityTestTerminalID_B ) == 0 ); + } + + HBufC* uri16 = EscapeUtils::ConvertToUnicodeFromUtf8L( query->Terminal().Uri() ); + EUNIT_ASSERT( uri16->Compare( KCapabilityTestSIPAddressUri_B ) == 0 ); + delete uri16; + uri16 = NULL; + EUNIT_ASSERT( !query->Terminal().RequestedQuery() ); + EUNIT_ASSERT( !query->Terminal().IsDiscovered() ); + + EUNIT_ASSERT( iStorage->iClientRequest->Method() == SIPStrings::StringF( SipStrConsts::EOptions ) ); + EUNIT_ASSERT( iStorage->iClientRequest->MessageElements().Content().Length() > 0 ); + EUNIT_ASSERT( iStorage->iClientRequest->MessageElements().ContentType() ); + EUNIT_ASSERT( iStorage->iClientRequest->MessageElements().UserHeaders().Count() == 6 ); + MUS_HEADER_ASSERT( iStorage->iClientRequest, 0, KCapabilityTestAcceptContactHeader ); + MUS_HEADER_ASSERT( iStorage->iClientRequest, 5, KCapabilityTestContactHeader_A1Updated ); + MUS_HEADER_ASSERT( iStorage->iClientRequest, 3, KCapabilityTestAcceptHeader ); + + //set response + + // GSMA Cingular + if ( i == 0 || i == 3 )//200 OK FT + { + CapabilityTestHelper::SetResponseL( *query->iTrx, KMUSAVASIP200, SipStrConsts::EPhraseOk, + KCapabilityTestAddress_B, + KCapabilitySwisFeature, + KCapabilityTestTerminalID_B, + KPAssertedIdentity_B, + KCapabilityTestSDP ); + } + // GSMA Cingular + else if ( i == 1 || i == 4 )//200 OK NO FT + { + CapabilityTestHelper::SetResponseL( *query->iTrx, KMUSAVASIP200, SipStrConsts::EPhraseOk, + KCapabilityTestAddress_B, + KNullDesC8, + KCapabilityTestTerminalID_B, + KPAssertedIdentity_B, + KCapabilityTestSDP ); + + } + else if ( i == 2 )//GSMA & 404 + { + CapabilityTestHelper::SetResponseL( *query->iTrx, KMUSAVASIPNotFound, SipStrConsts::EPhraseNotFound, + KCapabilityTestAddress_B, + KNullDesC8, + KNullDesC8, + KNullDesC8, + KNullDesC8 ); + + } + + if ( i == 4 ) + { + EUNIT_ASSERT( + MultimediaSharingSettings::OperatorVariantSettingL() == + MusSettingsKeys::EStandard ); + // set cingular variant key on + MultimediaSharingSettings::SetOperatorVariantSettingL( + MusSettingsKeys::EOperatorSpecific ); + EUNIT_ASSERT( MultimediaSharingSettings::OperatorVariantSettingL() + == MusSettingsKeys::EOperatorSpecific ); + } + + //iExchange->iTerminal + iExchange->AnswerToQueryReceived( *query->iTrx ); + TInt count = NULL; + EUNIT_GET_ALLOC_DECORATOR_FAILCOUNT( count ); + if ( count > 0 && + query->Terminal().Id().Length() == 0 ) + { + User::Leave( KErrNoMemory ); + } + if ( count > 0 && + i == 1 && + query->Terminal().iQuery->Result() != KCapabilityCapabilitesNotFound ) + { + User::Leave( KErrNoMemory ); + } + if ( count > 0 && + i == 2 && + !query->Retrying() ) + { + User::Leave( KErrNoMemory ); + } + + EUNIT_ASSERT( iExchange->Terminals().Count() == 1 ); + EUNIT_ASSERT( query->Terminal().Id().Length() > 0 ); + EUNIT_ASSERT( query->Terminal().Id().Compare( KCapabilityTestTerminalID_B ) == 0 ); + uri16 = EscapeUtils::ConvertToUnicodeFromUtf8L( query->Terminal().Uri() ); + delete uri16; + uri16 = NULL; + EUNIT_ASSERT( !query->Terminal().RequestedQuery() ); + + + if ( i == 0 || i == 3 )//200 OK FT + { + EUNIT_ASSERT( + MultimediaSharingSettings::OperatorVariantSettingL() == + MusSettingsKeys::EStandard ); + EUNIT_ASSERT( query->Terminal().iQuery->State() == CMusAvaCapabilityQueryBase::ECapabilityQueryCompleted ); + EUNIT_ASSERT( query->Terminal().IsDiscovered() ); + EUNIT_ASSERT( !query->Retrying() ); + EUNIT_ASSERT( query->iTimer == NULL ); + } + else if ( i == 1 )//GSMA & 200 OK NO FT + { + EUNIT_ASSERT( + MultimediaSharingSettings::OperatorVariantSettingL() == + MusSettingsKeys::EStandard ); + EUNIT_ASSERT( query->Terminal().iQuery == query ); + EUNIT_ASSERT( query->Terminal().iQuery->Result() == KCapabilityCapabilitesNotFound ); + EUNIT_ASSERT( query->Terminal().IsDiscovered() ); + EUNIT_ASSERT( !query->Retrying() ); + EUNIT_ASSERT( query->iTimer == NULL ); + } + else if ( i == 4 )//( not yet Cingular) & 200 OK NO FT + { + EUNIT_ASSERT( MultimediaSharingSettings::OperatorVariantSettingL() + == MusSettingsKeys::EOperatorSpecific ); + MultimediaSharingSettings::SetOperatorVariantSettingL( + MusSettingsKeys::EStandard ); + EUNIT_ASSERT( query->Terminal().iQuery == query ); + EUNIT_ASSERT( query->Terminal().iQuery->Result() == KCapabilityCapabilitesNotFound ); + EUNIT_ASSERT( query->Terminal().IsDiscovered() ); + EUNIT_ASSERT( !query->Retrying() ); + EUNIT_ASSERT( query->iTimer == NULL ); + } + else if ( i == 2 ) //GSMA & 404 + { + EUNIT_ASSERT( + MultimediaSharingSettings::OperatorVariantSettingL() == + MusSettingsKeys::EStandard ); + EUNIT_ASSERT( !query->Terminal().iQuery == NULL ); + EUNIT_ASSERT( !query->Terminal().IsDiscovered() ); + EUNIT_ASSERT( query->Retrying() ); + EUNIT_ASSERT( query->iTimer != NULL ); + + query->OnExpiredL( KErrNone ); + EUNIT_ASSERT( iStorage->iClientRequest->Method() == SIPStrings::StringF( SipStrConsts::EOptions ) ); + EUNIT_ASSERT( iStorage->iClientRequest->MessageElements().Content().Length() > 0 ); + EUNIT_ASSERT( iStorage->iClientRequest->MessageElements().ContentType() ); + EUNIT_ASSERT( iStorage->iClientRequest->MessageElements().UserHeaders().Count() == 6 ); + MUS_HEADER_ASSERT( iStorage->iClientRequest, 0, KCapabilityTestAcceptContactHeader ); + MUS_HEADER_ASSERT( iStorage->iClientRequest, 5, KCapabilityTestContactHeader_A1Updated ); + + CapabilityTestHelper::SetResponseL( *query->iTrx, KMUSAVASIPNotFound, SipStrConsts::EPhraseNotFound, + KCapabilityTestAddress_B, + KNullDesC8, + KNullDesC8, + KNullDesC8, + KNullDesC8 ); + iExchange->AnswerToQueryReceived( *query->iTrx ); + EUNIT_ASSERT( query->Terminal().iQuery == query ); + EUNIT_ASSERT( query->Terminal().iQuery->Result() == KCapabilityCapabilitesNotFound ); + EUNIT_ASSERT( query->Terminal().IsDiscovered() ); + EUNIT_ASSERT( !query->Retrying() ); + EUNIT_ASSERT( query->iTimer == NULL ); + + } + } + MultimediaSharingSettings::SetOperatorVariantSettingL( + MusSettingsKeys::EStandard ); + } + + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusAvaCapabilityExchange, + "CMusAvaCapabilityExchange", + "UNIT" ) + +EUNIT_TEST( + "NewL - test ", + "CMusAvaCapabilityExchange", + "NewL", + "FUNCTIONALITY", + SetupL,UT_CMusAvaCapabilityExchange_NewLL, Teardown) + +EUNIT_TEST( + "QueryObserverL - test ", + "CMusAvaCapabilityExchange", + "QueryObserver", + "FUNCTIONALITY", + SetupL,UT_CMusAvaCapabilityExchange_QueryObserverL, Teardown) + +EUNIT_TEST( + "TerminalId - test ", + "CMusAvaCapabilityExchange", + "TerminalId", + "FUNCTIONALITY", + SetupL,UT_CMusAvaCapabilityExchange_TerminalIdL, Teardown) + + +EUNIT_TEST( + "QueryReceivedL - test ", + "CMusAvaCapabilityExchange", + "QueryReceivedL", + "FUNCTIONALITY", + SetupL,UT_CMusAvaCapabilityExchange_QueryReceivedL, Teardown) + +EUNIT_TEST( + "QueryReceivedL1 - test ", + "CMusAvaCapabilityExchange", + "QueryReceivedL", + "FUNCTIONALITY", + SetupL,UT_CMusAvaCapabilityExchange_QueryReceived1L, Teardown) + +EUNIT_TEST( + "QueryReceivedL2 - test ", + "CMusAvaCapabilityExchange", + "QueryReceivedL", + "FUNCTIONALITY", + SetupL,UT_CMusAvaCapabilityExchange_QueryReceived2L, Teardown) + +EUNIT_TEST( + "CancelQuery - test ", + "CMusAvaCapabilityExchange", + "CancelQuery", + "FUNCTIONALITY", + SetupL,UT_CMusAvaCapabilityExchange_CancelQueryL, Teardown) + + EUNIT_TEST( + "AddCapability - test ", + "CMusAvaCapabilityExchange", + "AddCapability", + "FUNCTIONALITY", + SetupL,UT_CMusAvaCapabilityExchange_AddCapabilityLL, Teardown) + + EUNIT_TEST( + "TerminalL - test ", + "CMusAvaCapabilityExchange", + "TerminalL", + "FUNCTIONALITY", + SetupL,UT_CMusAvaCapabilityExchange_TerminalLL, Teardown) + + EUNIT_TEST( + "RejectQueryL - test ", + "CMusAvaCapabilityExchange", + "RejectQueryL", + "FUNCTIONALITY", + SetupL,UT_CMusAvaCapabilityExchange_RejectQueryLL, Teardown) + + EUNIT_TEST( + "FindByFeature - test ", + "CMusAvaCapabilityExchange", + "FindByFeature", + "FUNCTIONALITY", + SetupL,UT_CMusAvaCapabilityExchange_FindByFeatureL, Teardown) + + EUNIT_TEST( + "AnswerToQueryReceived - test ", + "CMusAvaCapabilityExchange", + "AnswerToQueryReceived", + "FUNCTIONALITY", + SetupL,UT_CMusAvaCapabilityExchange_AnswerToQueryReceivedL, Teardown) + +EUNIT_END_TEST_TABLE + +// END OF FILE diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaCapabilityQuery.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaCapabilityQuery.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,1160 @@ +/* +* 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 HEADER +#include "UT_CMusAvaCapabilityQuery.h" +#include "musavasettingsimp.h" +#include "musavaobserverimp.h" +#include "musavaavailabilityobserver.h" +#include "musavaavailabilityobserverimp.h" +#include "muslogger.h" +#include "mussesseioninformationapi.h" + +// EXTERNAL INCLUDES +#include +#include +#include +#include +#include +#include +#include +// INTERNAL INCLUDES +#include "musavaoptionhandler.h" +#include "musavacapabilitytesthelper.h" +#include "CSipSseTestTls.h" +#include "musavaCapabilityExchange.h" +#include "musavacapabilitysipagent.h" +#include "MusAvaCapabilityQuery.h" +#include "musavaterminal.h" +#include "sipprofile.h" +#include "musavasharedobject.h" +#include "mussettingskeys.h" +#include "mussettings.h" +#include "musavasip.h" +#include "musavacapabilityqueryobserverimp.h" + + +// CONSTRUCTION +UT_CMusAvaCapabilityQuery* UT_CMusAvaCapabilityQuery::NewL() + { + UT_CMusAvaCapabilityQuery* self = UT_CMusAvaCapabilityQuery::NewLC(); + CleanupStack::Pop(); + + return self; + } + +UT_CMusAvaCapabilityQuery* UT_CMusAvaCapabilityQuery::NewLC() + { + UT_CMusAvaCapabilityQuery* self = new( ELeave ) UT_CMusAvaCapabilityQuery(); + CleanupStack::PushL( self ); + self->ConstructL(); + + return self; + } + +// Destructor (virtual by CBase) +UT_CMusAvaCapabilityQuery::~UT_CMusAvaCapabilityQuery() + { + } + +// Default constructor +UT_CMusAvaCapabilityQuery::UT_CMusAvaCapabilityQuery() + { + } + +// Second phase construct +void UT_CMusAvaCapabilityQuery::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + +// METHODS + +void UT_CMusAvaCapabilityQuery::SetupL( ) + { + iSharedObject = CMusAvaSharedObject::GetSingletonL(); + iAvailabilityObserver = CMusAvaAvailabilityObserverImp::NewL(); + iConcreteSettings = CMusAvaSettingsImp::NewL(); + iOptionHandler = CMusAvaOptionHandler::NewL( *iAvailabilityObserver, + *iConcreteSettings ); + iExchange = iOptionHandler->iCapabilityExchange; + iSipAgent = CMusAvaCapabilitySipAgent::NewL( *iExchange, + *iOptionHandler->iSharedObj, + iOptionHandler->iObserver ); + + iCapability = iOptionHandler->iSwisCapability; + + MSIPConnectionObserver& connectionObserver = + iSharedObject->MusAvaSip().ConnectionObserver(); + + CSIP& sip = iSharedObject->MusAvaSip().Sip(); + iSharedObject->MusAvaSip().CreateProfileL(); + iProfile = iSharedObject->MusAvaSip().Profile(); + if ( !iProfile->iArray ) + { + iProfile->iArray = new ( ELeave ) CDesC8ArrayFlat( 1 ); + iProfile->iArray->AppendL( _L8("sip:user@domain.com") ); + } + if ( !iProfile->iRegisteredContact ) + { + iProfile->iRegisteredContact = KRegisteredContact().AllocL(); + } + + TUint32 iapId; + TInt err = iProfile->GetParameter( KSIPAccessPointId, iapId ); + iSIPConnection = CSIPConnection::NewL( sip, + iapId, + connectionObserver ); + + iQuery = CMusAvaCapabilityQuery::NewL( *iCapability, + *iSIPConnection, + *iProfile, + KCapabilityTestSIPAddressUri_B ); + + CSipSseTestTls::OpenL(); + iStorage = CSipSseTestTls::Storage(); + iStorage->Set( MusSettingsKeys::KFastStartupMode, + MusSettingsKeys::EFastModeOff ); + iOpVariantSetting = MultimediaSharingSettings::OperatorVariantSettingL(); + } + +void UT_CMusAvaCapabilityQuery::Teardown( ) + { + delete HelpFlags::iTestSipAddress; + HelpFlags::iTestSipAddress = NULL; + delete iQuery; + CMusAvaSharedObject::DeleteSingleton(); + if ( iStorage ) + { + iStorage->Clear(); + CSipSseTestTls::Close(); + iStorage = NULL; + } + + delete iSipAgent; + delete iOptionHandler; + delete iConcreteSettings; + delete iAvailabilityObserver; + delete iSIPConnection; + PropertyHelper::Close(); + } + +void UT_CMusAvaCapabilityQuery::UT_CMusAvaCapabilityQuery_NewLL( ) + { + // 1.basic test and iQuery is constructed already. Check it + EUNIT_ASSERT( iQuery ); + + // 2.test for sipaddress is empty,should leave + delete iQuery; + iQuery = NULL; // clean the previous one + TRAPD( error, iQuery = CMusAvaCapabilityQuery::NewL( *iCapability, + *iSIPConnection, + *iProfile, + KNullDesC ) ); + EUNIT_ASSERT( error == KErrNoMemory || error == KErrArgument ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT( !iQuery ); // iQuery Should be empty. + + // 3.Contact user part tests, getting KSIPRegisteredContact leaves + delete iProfile->iRegisteredContact; + iProfile->iRegisteredContact = NULL; + TRAP( error, iQuery = CMusAvaCapabilityQuery::NewL( *iCapability, + *iSIPConnection, + *iProfile, + KCapabilityTestSIPAddressUri_B ) ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT( error == KErrNotFound ); + EUNIT_ASSERT( !iQuery ); // iQuery Should be empty. + + // 4.Contact user part tests, CSIPContactHeader::DecodeL has less than 1. + iProfile->iRegisteredContact = KRegisteredContact().AllocL(); + HelpFlags::iEmptyContactHeader = ETrue; + TRAP( error, iQuery = CMusAvaCapabilityQuery::NewL( *iCapability, + *iSIPConnection, + *iProfile, + KCapabilityTestSIPAddressUri_B ) ); + HelpFlags::iEmptyContactHeader = EFalse; + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT( error == KErrNotFound ); + EUNIT_ASSERT( !iQuery ); // iQuery Should be empty. + + // 5.Contact user part tests ,CSIPContactHeader::DecodeL has 1 contact + delete iQuery; + iQuery = NULL; // clean the previous one + delete iProfile->iRegisteredContact; + iProfile->iRegisteredContact = NULL; + iProfile->iRegisteredContact = KRegisteredContact().AllocL(); + + HelpFlags::iTestSipAddress = CSIPAddress::DecodeL( KRegisteredContact ); + HelpFlags::iUseTestSipAddress = ETrue; + + TRAP( error, iQuery = CMusAvaCapabilityQuery::NewL( *iCapability, + *iSIPConnection, + *iProfile, + KCapabilityTestSIPAddressUri_B ) ); + HelpFlags::iUseTestSipAddress = EFalse; + if ( error == KErrNoMemory ) User::Leave( error ); + delete HelpFlags::iTestSipAddress; + HelpFlags::iTestSipAddress = NULL; + + EUNIT_ASSERT( error == KErrNone ); + EUNIT_ASSERT( iQuery ); + + // 6.Contact user part tests ,CSIPContactHeader::DecodeL has 1 contact but + // sip address empty + delete iQuery; + iQuery = NULL; // clean the previous one + + delete iProfile->iRegisteredContact; + iProfile->iRegisteredContact = NULL; + iProfile->iRegisteredContact = KRegisteredContact().AllocL(); + + HelpFlags::iUseTestSipAddress = ETrue; + TRAP(error,iQuery = CMusAvaCapabilityQuery::NewL( *iCapability, + *iSIPConnection, + *iProfile, + KCapabilityTestSIPAddressUri_B )); + HelpFlags::iUseTestSipAddress = EFalse; + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT( error == KErrNotFound ); + EUNIT_ASSERT( !iQuery ); // iQuery Should be empty. + + } + +void UT_CMusAvaCapabilityQuery::UT_CMusAvaCapabilityQuery_ExecuteLL( ) + { + /* includes testing of functions: + * Prepare(), + * DoCompletedL() case KMUSAVASIP200 + * DoCompleted200OKL() + * ValidateCodecL() + * ValidateAttributesL() + * ValidateContactL(), + * Retrying() + * Capability() + * SetState() + * Terminal() + * ExecuteL() + * CompletedL() + * State() + * Result() + * AddAcceptContactHeaderL() + * AddContactHeaderL() + * ResetAndDestroyTrx() + * LocalAddress() + */ + + EUNIT_ASSERT( iExchange->Terminals().Count() == 1 ); + + CMusAvaTerminal& terminal = iQuery->Terminal(); + EUNIT_ASSERT( terminal.iQueries == 1 ); + EUNIT_ASSERT( terminal.iQuery == NULL ); + + EUNIT_ASSERT( iQuery->Terminal().Uri().Compare( KCapabilityTestSIPAddressUri8_B ) == 0 ); + + iQuery->SetState( CMusAvaCapabilityQueryBase::ECapabilityQueryPrepared ); + TRAPD( error, iQuery->ExecuteL() ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT( error != KErrNone ); + + iQuery->SetState( CMusAvaCapabilityQueryBase::ECapabilityQueryCreated ); + iQuery->ExecuteL( ); + + EUNIT_ASSERT( iQuery->State() == + CMusAvaCapabilityQueryBase::ECapabilityQueryExecuting ); + EUNIT_ASSERT( !iQuery->iTimer ); + EUNIT_ASSERT( iQuery->iTrx ); + + EUNIT_ASSERT( iStorage->iClientRequest->Method() == + SIPStrings::StringF( SipStrConsts::EOptions ) ); + EUNIT_ASSERT( iStorage->iClientRequest->MessageElements().Content().Length() + != 0 ); + _LIT8(contentType,"application/sdp"); + EUNIT_ASSERT( + iStorage->iClientRequest->MessageElements().ContentType() ); + EUNIT_ASSERT( + iStorage->iClientRequest->MessageElements().UserHeaders().Count() + == 6 ); + MUS_HEADER_ASSERT( iStorage->iClientRequest, 0, + KCapabilityTestAcceptContactHeader ); + MUS_HEADER_ASSERT( iStorage->iClientRequest, 5, + KCapabilityTestContactHeader_A1Updated ); + MUS_HEADER_ASSERT( iStorage->iClientRequest, 3, + KCapabilityTestAcceptHeader ); + EUNIT_ASSERT( iOptionHandler->State() == + MMusAvaObserver::EMusAvaStatusNotExecuted ); + + // set response 200 OK FT + CapabilityTestHelper::SetResponseL( *iQuery->iTrx, KMUSAVASIP200, + SipStrConsts::EPhraseOk, + KCapabilityTestAddress_B, + KCapabilitySwisFeature, + KCapabilityTestTerminalID_B, + KPAssertedIdentity_B, + KCapabilityTestSDP ); + iQuery->CompletedL( *iQuery->iTrx ); + + MusSettingsKeys::TOperatorVariant op = MultimediaSharingSettings::OperatorVariantSettingL(); + EUNIT_ASSERT( op == MusSettingsKeys::EStandard ); + + EUNIT_ASSERT( iQuery->iState == + CMusAvaCapabilityQueryBase::ECapabilityQueryCompleted ); + EUNIT_ASSERT( !iQuery->Retrying() ); + EUNIT_ASSERT( iQuery->iTimer == NULL ); + + EUNIT_ASSERT( iStorage->iClientRequest->Method() == + SIPStrings::StringF( SipStrConsts::EOptions ) ); + + EUNIT_ASSERT( iStorage->iClientRequest->MessageElements().Content().Length() + > 0 ); + EUNIT_ASSERT( iStorage->iClientRequest->MessageElements().ContentType() ); + EUNIT_ASSERT( iStorage->iClientRequest->RemoteUri().Uri().UriDes().Compare( + KCapabilityTestSIPAddressUri8_B ) == 0); + EUNIT_ASSERT( iStorage->iClientRequest->MessageElements().UserHeaders(). + Count() == 6 ); + MUS_HEADER_ASSERT( iStorage->iClientRequest, + 0, + KCapabilityTestAcceptContactHeader ); + MUS_HEADER_ASSERT( iStorage->iClientRequest, + 5, + KCapabilityTestContactHeader_A1Updated ); + MUS_HEADER_ASSERT( iStorage->iClientRequest, 3, + KCapabilityTestAcceptHeader ); + EUNIT_ASSERT( iOptionHandler->State() == + MMusAvaObserver::EMusAvaStatusAvailable ); + + + iQuery->SetState( CMusAvaCapabilityQueryBase::ECapabilityQueryCompleted ); + TRAP( error, iQuery->ExecuteL() ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT ( error == KErrNone ); + + iQuery->DoRetryL(); + TRAP( error, iQuery->ExecuteL() ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT ( error == KErrNone ); + iQuery->DoRetryL(); + + // set TerminalId for CMusAvaCapabilityExchange, terminal Id will be added to headers + CMusAvaCapabilityQueryObserverImp* capabQueryObserver = + new ( ELeave ) CMusAvaCapabilityQueryObserverImp(); + CleanupStack::PushL( capabQueryObserver ); + CMusAvaCapabilityExchange* exchange = + CMusAvaCapabilityExchange::NewL( + KCapabilityTestTerminalID_A, + *capabQueryObserver ); + CleanupStack::PushL( exchange ); + CMusAvaCapability* capability = CMusAvaCapability::NewL( *exchange ); + CleanupStack::PushL( capability ); + + CMusAvaCapabilityQuery* query = CMusAvaCapabilityQuery::NewL( *capability, + *iSIPConnection, + *iProfile, + KCapabilityTestSIPAddressUri_B ); + CleanupStack::PushL( query ); + + query->SetState( CMusAvaCapabilityQueryBase::ECapabilityQueryCreated ); + query->ExecuteL(); + EUNIT_ASSERT_EQUALS( iStorage->iClientRequest->MessageElements().UserHeaders().Count(), 7 ); + MUS_HEADER_ASSERT( iStorage->iClientRequest, 6, + KCapabilityTestUserAgent_A ); + + CleanupStack::PopAndDestroy( query ); + CleanupStack::PopAndDestroy( capability ); + CleanupStack::PopAndDestroy( exchange ); + CleanupStack::PopAndDestroy( capabQueryObserver ); + } + +void UT_CMusAvaCapabilityQuery::UT_CMusAvaCapabilityQuery_CanceledL( ) + { + + iQuery->ExecuteL( ); + + + EUNIT_ASSERT( iQuery->State() == + CMusAvaCapabilityQueryBase::ECapabilityQueryExecuting ); + + // set response 200 OK FT + CapabilityTestHelper::SetResponseL( *iQuery->iTrx, + KMUSAVASIP200, + SipStrConsts::EPhraseOk, + KCapabilityTestAddress_B, + KCapabilitySwisFeature, + KCapabilityTestTerminalID_B, + KPAssertedIdentity_B, + KCapabilityTestSDP ); + + iQuery->Canceled( *iQuery->iTrx ); + EUNIT_ASSERT( iQuery->State() == + CMusAvaCapabilityQueryBase::ECapabilityQueryCompleted ); + EUNIT_ASSERT( iQuery->Result() == KCapabilityCapabilitesNotFound ); + EUNIT_ASSERT( iOptionHandler->State() == + MMusAvaObserver::EMusAvaOptionNotAvailable ); + + + // give different response than iTrx + iQuery->SetState( CMusAvaCapabilityQueryBase::ECapabilityQueryCreated ); + iQuery->ExecuteL(); + CSIPClientTransaction* cliTransaction = NULL; + cliTransaction = CSIPClientTransaction::NewL( iQuery->iTrx->Type() ); + CleanupStack::PushL( cliTransaction ); + + CapabilityTestHelper::SetResponseL( *cliTransaction, + KMUSAVASIPForbidden, + SipStrConsts::EPhraseOk, + KCapabilityTestAddress_B, + KCapabilitySwisFeature, + KCapabilityTestTerminalID_B, + KPAssertedIdentity_B, + KCapabilityTestSDP ); + iQuery->Canceled( *cliTransaction ); + EUNIT_ASSERT_NOT_EQUALS( iQuery->State(), CMusAvaCapabilityQueryBase::ECapabilityQueryCompleted ); + iQuery->ResetAndDestroyTrx(); + iQuery->Canceled( *cliTransaction ); + EUNIT_ASSERT_NOT_EQUALS( iQuery->State(), CMusAvaCapabilityQueryBase::ECapabilityQueryCompleted ); + CleanupStack::PopAndDestroy( cliTransaction ); + } + +void UT_CMusAvaCapabilityQuery::UT_CMusAvaCapabilityQuery_CompletedLL( ) + { + TRAPD( error, RProperty::Define( + NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMUSForbidden, + RProperty::EInt, + 0 ) ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT ( error == KErrNone ); + + TRAP( error, RProperty::Set( + NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMUSForbidden, + ( TInt ) NMusSessionInformationApi::EMUSAllowed ) ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT ( error == KErrNone ); + + // Test for forbidden response (403) + + //Cingular specific case && 403 Forbidden + MultimediaSharingSettings::SetOperatorVariantSettingL( + MusSettingsKeys::EOperatorSpecific ); + iQuery->ExecuteL( ); + + EUNIT_ASSERT( iQuery->State() == + CMusAvaCapabilityQueryBase::ECapabilityQueryExecuting ); + + // set response 200 OK FT + CapabilityTestHelper::SetResponseL( *iQuery->iTrx, + KMUSAVASIPForbidden, + SipStrConsts::EPhraseOk, + KCapabilityTestAddress_B, + KCapabilitySwisFeature, + KCapabilityTestTerminalID_B, + KPAssertedIdentity_B, + KCapabilityTestSDP ); + + iQuery->CompletedL( *iQuery->iTrx ); + EUNIT_ASSERT( iQuery->State() == + CMusAvaCapabilityQueryBase::ECapabilityQueryCompleted ); + EUNIT_ASSERT( iQuery->Result() == KCapabilityCapabilitiesForbidden ); + EUNIT_ASSERT( iOptionHandler->State() == + MMusAvaObserver::EMusAvaFailureCode ); + // check if it is "forbidden" + TInt forbidden; + TRAP( error, RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMUSForbidden, + forbidden ) ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT ( error == KErrNone ); + + EUNIT_ASSERT_EQUALS( NMusSessionInformationApi::EMUSForbidden, forbidden ); + // set back the forbidden flag to allowed + TRAP( error, RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMUSForbidden, + ( TInt ) NMusSessionInformationApi::EMUSAllowed ) ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT ( error == KErrNone ); + + MultimediaSharingSettings::SetOperatorVariantSettingL( + MusSettingsKeys::EStandard ); + + // give different response than iTrx + iQuery->SetState( CMusAvaCapabilityQueryBase::ECapabilityQueryCreated ); + iQuery->ExecuteL( ); + CSIPClientTransaction* cliTransaction = NULL; + cliTransaction = CSIPClientTransaction::NewL( iQuery->iTrx->Type() ); + CleanupStack::PushL( cliTransaction ); + + CapabilityTestHelper::SetResponseL( *cliTransaction, + KMUSAVASIPForbidden, + SipStrConsts::EPhraseOk, + KCapabilityTestAddress_B, + KCapabilitySwisFeature, + KCapabilityTestTerminalID_B, + KPAssertedIdentity_B, + KCapabilityTestSDP ); + iQuery->CompletedL( *cliTransaction ); + EUNIT_ASSERT_NOT_EQUALS( iQuery->State(), CMusAvaCapabilityQueryBase::ECapabilityQueryCompleted ); + iQuery->ResetAndDestroyTrx(); + iQuery->CompletedL( *cliTransaction ); + EUNIT_ASSERT_NOT_EQUALS( iQuery->State(), CMusAvaCapabilityQueryBase::ECapabilityQueryCompleted ); + CleanupStack::PopAndDestroy( cliTransaction ); + + // set response 199 + iQuery->SetState( CMusAvaCapabilityQueryBase::ECapabilityQueryCreated ); + iQuery->ExecuteL( ); + CapabilityTestHelper::SetResponseL( *iQuery->iTrx, + KMUSAVASIP200-1, + SipStrConsts::EPhraseOk, + KCapabilityTestAddress_B, + KCapabilitySwisFeature, + KCapabilityTestTerminalID_B, + KPAssertedIdentity_B, + KCapabilityTestSDP ); + + + iQuery->CompletedL( *iQuery->iTrx ); + EUNIT_ASSERT_NOT_EQUALS( iQuery->State(), CMusAvaCapabilityQueryBase::ECapabilityQueryCompleted ); + iQuery->ResetAndDestroyTrx(); + + // set response <100 + iQuery->SetState( CMusAvaCapabilityQueryBase::ECapabilityQueryCreated ); + iQuery->ExecuteL( ); + CapabilityTestHelper::SetResponseL( *iQuery->iTrx, + KMUSAVASIP200-150, + SipStrConsts::EPhraseOk, + KCapabilityTestAddress_B, + KCapabilitySwisFeature, + KCapabilityTestTerminalID_B, + KPAssertedIdentity_B, + KCapabilityTestSDP ); + iQuery->CompletedL( *iQuery->iTrx ); + EUNIT_ASSERT_EQUALS( iQuery->State(), CMusAvaCapabilityQueryBase::ECapabilityQueryCompleted ); + } + +void UT_CMusAvaCapabilityQuery::UT_CMusAvaCapabilityQuery_CompletedL1L( ) + { + //Standard case && 403 Forbidden + iQuery->ExecuteL( ); + + EUNIT_ASSERT( iQuery->State() == + CMusAvaCapabilityQueryBase::ECapabilityQueryExecuting ); + + // set response 200 OK FT + CapabilityTestHelper::SetResponseL( *iQuery->iTrx, + KMUSAVASIPForbidden, + SipStrConsts::EPhraseOk, + KCapabilityTestAddress_B, + KCapabilitySwisFeature, + KCapabilityTestTerminalID_B, + KPAssertedIdentity_B, + KCapabilityTestSDP ); + + iQuery->CompletedL( *iQuery->iTrx ); + EUNIT_ASSERT( iQuery->State() == + CMusAvaCapabilityQueryBase::ECapabilityQueryCompleted ); + EUNIT_ASSERT( iQuery->Result() == KCapabilityCapabilitesNotFound ); + EUNIT_ASSERT( iOptionHandler->State() == + MMusAvaObserver::EMusAvaOptionNotAvailable ); + + } + +void UT_CMusAvaCapabilityQuery::UT_CMusAvaCapabilityQuery_CompletedL2L( ) + { + //Standard case + iQuery->ExecuteL( ); + + EUNIT_ASSERT( iQuery->State() == + CMusAvaCapabilityQueryBase::ECapabilityQueryExecuting ); + + // set response 200 OK FT + CapabilityTestHelper::SetResponse2L( *iQuery->iTrx, + KMUSAVASIP200, + SipStrConsts::EPhraseOk, + KCapabilityTestAddress_B, + KCapabilitySwisFeature, + KCapabilityTestTerminalID_B, + KPAssertedIdentity_B, + KPAssertedIdentity_B1, + KCapabilityTestSDP ); + + iQuery->CompletedL( *iQuery->iTrx ); + EUNIT_ASSERT( iQuery->State() == + CMusAvaCapabilityQueryBase::ECapabilityQueryCompleted ); + EUNIT_ASSERT( iQuery->Result() == KCapabilityCapabilitesReady ); + EUNIT_ASSERT( iOptionHandler->State() == + MMusAvaObserver::EMusAvaStatusAvailable ); + const MDesCArray& sipAddresses = iOptionHandler->iSettings.SipAddresses(); + EUNIT_ASSERT( sipAddresses.MdcaCount() == 1); + EUNIT_ASSERT( sipAddresses.MdcaPoint( 0 ).Compare( KPAssertedIdentity_B_16() ) + == KErrNone ); + } + +void UT_CMusAvaCapabilityQuery::UT_CMusAvaCapabilityQuery_ValidateAndStoreCodecsLL() + { + + // OK - H.263 codec + TBool ret = EFalse; + CSdpDocument* sdpContent = CSdpDocument::DecodeLC( KCapabilityTestSDP ); + TRAPD( error, ret = iQuery->ValidateAndStoreCodecsL( *sdpContent ) ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT( ret ); + CleanupStack::PopAndDestroy( sdpContent ); + + // OK - H.264 codec + ret = EFalse; + sdpContent = CSdpDocument::DecodeLC( KCapabilityTestSDP264 ); + TRAP( error, ret = iQuery->ValidateAndStoreCodecsL( *sdpContent ) ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT( ret ); + CleanupStack::PopAndDestroy( sdpContent ); + + // OK - both H.263 and H.264 codec + ret = EFalse; + sdpContent = CSdpDocument::DecodeLC( KCapabilityTestSDP264And263 ); + TRAP( error, ret = iQuery->ValidateAndStoreCodecsL( *sdpContent ) ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT( ret ); + CleanupStack::PopAndDestroy( sdpContent ); + + // NOK - invalid codec + ret = ETrue; + sdpContent = CSdpDocument::DecodeLC( KCapabilityTestSDPWrongCodec ); + TRAP( error, ret = iQuery->ValidateAndStoreCodecsL( *sdpContent ) ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT( !ret ); + CleanupStack::PopAndDestroy( sdpContent ); +} + +void UT_CMusAvaCapabilityQuery::UT_CMusAvaCapabilityQuery_ValidateAttributesLL() + { + + // set operator specific + MultimediaSharingSettings::SetOperatorVariantSettingL( MusSettingsKeys::EOperatorSpecific ); + + // operator specific OK + CSdpDocument* sdpContent = CSdpDocument::DecodeLC( KCapabilityTestSDP ); + TBool ret = EFalse; + TRAPD( error, ret = iQuery->ValidateAttributesL( *sdpContent ) ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT( ret ); + CleanupStack::PopAndDestroy( sdpContent ); + + // operator specific no application + sdpContent = CSdpDocument::DecodeLC( KCapabilityTestSDPNoApplication ); + TRAP( error, ret = iQuery->ValidateAttributesL( *sdpContent ) ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT( !ret ); + CleanupStack::PopAndDestroy( sdpContent ); + + // operator specific wrong application + sdpContent = CSdpDocument::DecodeLC( KCapabilityTestSDPWrongApplication ); + TRAP( error, ret = iQuery->ValidateAttributesL( *sdpContent ) ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT( !ret ); + CleanupStack::PopAndDestroy( sdpContent ); + + // operator specific no type + sdpContent = CSdpDocument::DecodeLC( KCapabilityTestSDPNoType ); + TRAP( error, ret = iQuery->ValidateAttributesL( *sdpContent ) ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT( !ret ); + CleanupStack::PopAndDestroy( sdpContent ); + + // operator specific wrong type + sdpContent = CSdpDocument::DecodeLC( KCapabilityTestSDPWrongType ); + TRAP( error, ret = iQuery->ValidateAttributesL( *sdpContent ) ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT( !ret ); + CleanupStack::PopAndDestroy( sdpContent ); + + // set standard + MultimediaSharingSettings::SetOperatorVariantSettingL( MusSettingsKeys::EStandard ); + + // OK + sdpContent = CSdpDocument::DecodeLC( KCapabilityTestSDP ); + TRAP( error, ret = iQuery->ValidateAttributesL( *sdpContent ) ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT( ret ); + CleanupStack::PopAndDestroy( sdpContent ); + + // no application, good type + sdpContent = CSdpDocument::DecodeLC( KCapabilityTestSDPNoApplication ); + TRAP( error, ret = iQuery->ValidateAttributesL( *sdpContent ) ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT( ret ); + CleanupStack::PopAndDestroy( sdpContent ); + + // wrong application, good type + sdpContent = CSdpDocument::DecodeLC( KCapabilityTestSDPWrongApplication ); + TRAP( error, ret = iQuery->ValidateAttributesL( *sdpContent ) ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT( ret ); + CleanupStack::PopAndDestroy( sdpContent ); + + // no type, good application + sdpContent = CSdpDocument::DecodeLC( KCapabilityTestSDPNoType ); + TRAP( error, ret = iQuery->ValidateAttributesL( *sdpContent ) ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT( ret ); + CleanupStack::PopAndDestroy( sdpContent ); + + // wrong type, good application + sdpContent = CSdpDocument::DecodeLC( KCapabilityTestSDPWrongType ); + TRAP( error, ret = iQuery->ValidateAttributesL( *sdpContent ) ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT( ret ); + CleanupStack::PopAndDestroy( sdpContent ); + + // no application, no type + sdpContent = CSdpDocument::DecodeLC( KCapabilityTestSDPNoAppNoType ); + TRAP( error, ret = iQuery->ValidateAttributesL( *sdpContent ) ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT( !ret ); + CleanupStack::PopAndDestroy( sdpContent ); + + // no application, wrong type + sdpContent = CSdpDocument::DecodeLC( KCapabilityTestSDPNoAppWrongType ); + TRAP( error, ret = iQuery->ValidateAttributesL( *sdpContent ) ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT( !ret ); + CleanupStack::PopAndDestroy( sdpContent ); + } + + +void UT_CMusAvaCapabilityQuery::UT_CMusAvaCapabilityQuery_ValidateContactLL() + { + + // no contact header + CSIPClientTransaction* optionResp = CapabilityTestHelper::OptionsResponseL( + KMUSAVASIP200, + SipStrConsts::EPhraseOk, + KCapabilityTestAddress_B, + KNullDesC8, + KCapabilityTestTerminalID_B, + KPAssertedIdentity_B, + KCapabilityTestSDP ); + CleanupStack::PushL( optionResp ); + TBool ret = EFalse; + TRAPD( error, ret = iQuery->ValidateContactL( *optionResp ) ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT( !ret ); + CleanupStack::PopAndDestroy( optionResp ); + + // valid contact header + optionResp = CapabilityTestHelper::OptionsResponseL( KMUSAVASIP200, + SipStrConsts::EPhraseOk, + KCapabilityTestAddress_B, + KCapabilitySwisFeature, + KCapabilityTestTerminalID_B, + KPAssertedIdentity_B, + KCapabilityTestSDP ); + CleanupStack::PushL( optionResp ); + + TRAP( error, ret = iQuery->ValidateContactL( *optionResp ) ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT( ret ); + CleanupStack::PopAndDestroy( optionResp ); + + // false contact header + optionResp = CapabilityTestHelper::OptionsResponseL( KMUSAVASIP200, + SipStrConsts::EPhraseOk, + KCapabilityTestAddress_B, + KCapabilitySwisFeatureFalse, + KCapabilityTestTerminalID_B, + KPAssertedIdentity_B, + KCapabilityTestSDP ); + CleanupStack::PushL( optionResp ); + TRAP( error, ret = iQuery->ValidateContactL( *optionResp ) ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT( !ret ); + CleanupStack::PopAndDestroy( optionResp ); + + // wrong contact header + optionResp = CapabilityTestHelper::OptionsResponseL( KMUSAVASIP200, + SipStrConsts::EPhraseOk, + KCapabilityTestAddress_B, + KCapabilityTestDataFeature, + KCapabilityTestTerminalID_B, + KPAssertedIdentity_B, + KCapabilityTestSDP ); + CleanupStack::PushL( optionResp ); + TRAP( error, ret = iQuery->ValidateContactL( *optionResp ) ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT( !ret ); + CleanupStack::PopAndDestroy( optionResp ); + } + + +void UT_CMusAvaCapabilityQuery::UT_CMusAvaCapabilityQuery_PrepareL() + { + RPointerArray headers; + CleanupClosePushL(headers); + + iQuery->Prepare( headers ); + EUNIT_ASSERT_EQUALS( iQuery->State(), CMusAvaCapabilityQueryBase::ECapabilityQueryPrepared ); + + iQuery->DoRetryL(); + + EUNIT_ASSERT_EQUALS( iQuery->State(), CMusAvaCapabilityQueryBase::ECapabilityQueryCreated ); + iQuery->Prepare( headers ); + EUNIT_ASSERT_EQUALS( iQuery->State(), CMusAvaCapabilityQueryBase::ECapabilityQueryCreated ); + iQuery->DoRetryL(); + EUNIT_ASSERT_EQUALS( iQuery->State(), CMusAvaCapabilityQueryBase::ECapabilityQueryCompleted ); + + CleanupStack::PopAndDestroy( &headers ); + } + + +void UT_CMusAvaCapabilityQuery::UT_CMusAvaCapabilityQuery_DoCompletedLL() + { + + // response elements are NULL + CSIPClientTransaction* optionResp = NULL; + optionResp = CapabilityTestHelper::OptionsResponseL( + KMUSAVASIP200, + SipStrConsts::EPhraseOk, + KCapabilityTestAddress_B, + KNullDesC8, + KCapabilityTestTerminalID_B, + KPAssertedIdentity_B, + KCapabilityTestSDP ); + CleanupStack::PushL( optionResp ); + optionResp->SetResponseElements( NULL ); + + TRAPD( error, iQuery->DoCompletedL( *optionResp ) ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT( error == KErrGeneral ); + CleanupStack::PopAndDestroy( optionResp ); + + // status code KMUSAVASIPNotImplemented + optionResp = CapabilityTestHelper::OptionsResponseL( + KMUSAVASIPNotImplemented, + SipStrConsts::EPhraseOk, + KCapabilityTestAddress_B, + KNullDesC8, + KCapabilityTestTerminalID_B, + KPAssertedIdentity_B, + KCapabilityTestSDP ); + CleanupStack::PushL( optionResp ); + iQuery->DoCompletedL( *optionResp ); + EUNIT_ASSERT_EQUALS( iQuery->State(), CMusAvaCapabilityQueryBase::ECapabilityQueryCompleted ); + EUNIT_ASSERT_EQUALS( iQuery->Result(), KCapabilityCapabilitesReady ); + CleanupStack::PopAndDestroy( optionResp ); + + // status code KMUSAVASIPTemporarilyUnavailable + optionResp = CapabilityTestHelper::OptionsResponseL( + KMUSAVASIPTemporarilyUnavailable, + SipStrConsts::EPhraseOk, + KCapabilityTestAddress_B, + KNullDesC8, + KCapabilityTestTerminalID_B, + KPAssertedIdentity_B, + KCapabilityTestSDP ); + CleanupStack::PushL( optionResp ); + iQuery->DoCompletedL( *optionResp ); + EUNIT_ASSERT_EQUALS( iQuery->State(), CMusAvaCapabilityQueryBase::ECapabilityQueryCreated ); + EUNIT_ASSERT_EQUALS( iQuery->Result(), KCapabilityQueryNotReady ); + TRAP( error, iQuery->DoRetryL() ); + if ( error == KErrNoMemory ) User::Leave( error ); + CleanupStack::PopAndDestroy( optionResp ); + + // status code KMUSAVASIPServerInternalError + optionResp = CapabilityTestHelper::OptionsResponseL( + KMUSAVASIPServerInternalError, + SipStrConsts::EPhraseOk, + KCapabilityTestAddress_B, + KNullDesC8, + KCapabilityTestTerminalID_B, + KPAssertedIdentity_B, + KCapabilityTestSDP ); + CleanupStack::PushL( optionResp ); + TRAP( error, iQuery->DoCompletedL( *optionResp ) ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT_EQUALS( iQuery->State(), CMusAvaCapabilityQueryBase::ECapabilityQueryCompleted ); + EUNIT_ASSERT_EQUALS( iQuery->Result(), KCapabilityCapabilitesNotFound ); + CleanupStack::PopAndDestroy( optionResp ); + + } + + +void UT_CMusAvaCapabilityQuery::UT_CMusAvaCapabilityQuery_DoCompleted200OKLL() + { + + // no content + CSIPClientTransaction* optionResp = CapabilityTestHelper::OptionsResponseL( + KMUSAVASIP200, + SipStrConsts::EPhraseOk, + KCapabilityTestAddress_B, + KCapabilitySwisFeature, + KCapabilityTestTerminalID_B, + KPAssertedIdentity_B, + KNullDesC8 ); + CleanupStack::PushL( optionResp ); + iQuery->DoCompleted200OKL( *optionResp ); + EUNIT_ASSERT_EQUALS( iQuery->State(), CMusAvaCapabilityQueryBase::ECapabilityQueryCompleted ); + EUNIT_ASSERT_EQUALS( iQuery->Result(), KCapabilityCapabilitesNotFound ); + CleanupStack::PopAndDestroy( optionResp ); + + + // wrong content type header + optionResp = + CapabilityTestHelper::OptionsResponseL( KMUSAVASIP200, + SipStrConsts::EPhraseOk, + KCapabilityTestAddress_B, + KCapabilitySwisFeature, + KCapabilityTestTerminalID_B, + KPAssertedIdentity_B, + KCapabilityTestSDP ); + CleanupStack::PushL( optionResp ); + + const TDesC8& sdp = KCapabilityTestSDP; + HBufC8* content = NULL; + content = sdp.AllocL(); + CleanupStack::PushL( content ); + const CSIPResponseElements* response = optionResp->ResponseElements(); + CSIPMessageElements& message = + CONST_CAST(CSIPResponseElements*, response)->MessageElements(); + + CSIPContentTypeHeader* contentTypeHeader = CSIPContentTypeHeader::NewLC( + KMUSAVASIPMediaTypeApplication, + KMUSAVASIPParamFalse ); + + message.SetContentL( content, contentTypeHeader ); + CleanupStack::Pop( contentTypeHeader ); + CleanupStack::Pop( content ); + iQuery->DoCompleted200OKL( *optionResp ); + EUNIT_ASSERT_EQUALS( iQuery->State(), + CMusAvaCapabilityQueryBase::ECapabilityQueryCompleted ); + EUNIT_ASSERT_EQUALS( iQuery->Result(), KCapabilityCapabilitesNotFound ); + + content = sdp.AllocL(); + CleanupStack::PushL( content ); + contentTypeHeader = CSIPContentTypeHeader::NewLC( KMUSAVASIPParamFalse, + KMUSAVASIPMediaSubTypeSDP ); + message.SetContentL( content, contentTypeHeader ); + CleanupStack::Pop( contentTypeHeader ); + CleanupStack::Pop( content ); + iQuery->DoCompleted200OKL( *optionResp ); + EUNIT_ASSERT_EQUALS( iQuery->State(), + CMusAvaCapabilityQueryBase::ECapabilityQueryCompleted ); + EUNIT_ASSERT_EQUALS( iQuery->Result(), KCapabilityCapabilitesNotFound ); + + CleanupStack::PopAndDestroy( optionResp ); + + + // wrong codec + optionResp = CapabilityTestHelper::OptionsResponseL( KMUSAVASIP200, + SipStrConsts::EPhraseOk, + KCapabilityTestAddress_B, + KCapabilitySwisFeature, + KCapabilityTestTerminalID_B, + KPAssertedIdentity_B, + KCapabilityTestSDPWrongCodec ); + CleanupStack::PushL( optionResp ); + iQuery->DoCompleted200OKL( *optionResp ); + EUNIT_ASSERT_EQUALS( iQuery->State(), + CMusAvaCapabilityQueryBase::ECapabilityQueryCompleted ); + EUNIT_ASSERT_EQUALS( iQuery->Result(), KCapabilityCapabilitesNotFound ); + CleanupStack::PopAndDestroy( optionResp ); + + // set standard + MultimediaSharingSettings::SetOperatorVariantSettingL( + MusSettingsKeys::EStandard ); + + // wrong attribute (no application, no type ), wrong feature tag + optionResp = CapabilityTestHelper::OptionsResponseL( KMUSAVASIP200, + SipStrConsts::EPhraseOk, + KCapabilityTestAddress_B, + KCapabilitySwisFeatureFalse, + KCapabilityTestTerminalID_B, + KPAssertedIdentity_B, + KCapabilityTestSDPNoAppNoType ); + CleanupStack::PushL( optionResp ); + iQuery->DoCompleted200OKL( *optionResp ); + EUNIT_ASSERT_EQUALS( iQuery->State(), + CMusAvaCapabilityQueryBase::ECapabilityQueryCompleted ); + EUNIT_ASSERT_EQUALS( iQuery->Result(), KCapabilityCapabilitesNotFound ); + CleanupStack::PopAndDestroy( optionResp ); + + + // good attribute, wrong feature tag => KCapabilityCapabilitesReady + optionResp = CapabilityTestHelper::OptionsResponseL( KMUSAVASIP200, + SipStrConsts::EPhraseOk, + KCapabilityTestAddress_B, + KCapabilitySwisFeatureFalse, + KCapabilityTestTerminalID_B, + KPAssertedIdentity_B, + KCapabilityTestSDP ); + CleanupStack::PushL( optionResp ); + iQuery->DoCompleted200OKL( *optionResp ); + EUNIT_ASSERT_EQUALS( iQuery->State(), + CMusAvaCapabilityQueryBase::ECapabilityQueryCompleted ); + EUNIT_ASSERT_EQUALS( iQuery->Result(), KCapabilityCapabilitesNotFound ); + CleanupStack::PopAndDestroy( optionResp ); + + // wrong attribute (no application, no type ), good feature tag => KCapabilityCapabilitesReady + optionResp = CapabilityTestHelper::OptionsResponseL( KMUSAVASIP200, + SipStrConsts::EPhraseOk, + KCapabilityTestAddress_B, + KCapabilitySwisFeature, + KCapabilityTestTerminalID_B, + KPAssertedIdentity_B, + KCapabilityTestSDPNoAppNoType ); + CleanupStack::PushL( optionResp ); + iQuery->DoCompleted200OKL( *optionResp ); + EUNIT_ASSERT_EQUALS( iQuery->State(), + CMusAvaCapabilityQueryBase::ECapabilityQueryCompleted ); + EUNIT_ASSERT_EQUALS( iQuery->Result(), KCapabilityCapabilitesReady ); + CleanupStack::PopAndDestroy( optionResp ); + + + + // set operator specific + MultimediaSharingSettings::SetOperatorVariantSettingL( + MusSettingsKeys::EOperatorSpecific ); + + // operator specific, wrong attribute (no application, no type ) + optionResp = CapabilityTestHelper::OptionsResponseL( KMUSAVASIP200, + SipStrConsts::EPhraseOk, + KCapabilityTestAddress_B, + KCapabilitySwisFeature, + KCapabilityTestTerminalID_B, + KPAssertedIdentity_B, + KCapabilityTestSDPNoAppNoType ); + CleanupStack::PushL( optionResp ); + iQuery->DoCompleted200OKL( *optionResp ); + EUNIT_ASSERT_EQUALS( iQuery->State(), + CMusAvaCapabilityQueryBase::ECapabilityQueryCompleted ); + EUNIT_ASSERT_EQUALS( iQuery->Result(), KCapabilityCapabilitesNotFound ); + CleanupStack::PopAndDestroy( optionResp ); + + + // operator specific, wrong feature tag + optionResp = CapabilityTestHelper::OptionsResponseL( KMUSAVASIP200, + SipStrConsts::EPhraseOk, + KCapabilityTestAddress_B, + KCapabilitySwisFeatureFalse, + KCapabilityTestTerminalID_B, + KPAssertedIdentity_B, + KCapabilityTestSDP ); + CleanupStack::PushL( optionResp ); + iQuery->DoCompleted200OKL( *optionResp ); + EUNIT_ASSERT_EQUALS( iQuery->State(), + CMusAvaCapabilityQueryBase::ECapabilityQueryCompleted ); + EUNIT_ASSERT_EQUALS( iQuery->Result(), KCapabilityCapabilitesNotFound ); + CleanupStack::PopAndDestroy( optionResp ); + + + } + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusAvaCapabilityQuery, + "CMusAvaCapabilityQuery", + "UNIT" ) + +EUNIT_TEST( + "NewL - test ", + "CMusAvaCapabilityQuery", + "NewL", + "FUNCTIONALITY", + SetupL,UT_CMusAvaCapabilityQuery_NewLL, Teardown) + +EUNIT_TEST( + "ExecuteL - test ", + "CMusAvaCapabilityQuery", + "ExecuteL", + "FUNCTIONALITY", + SetupL,UT_CMusAvaCapabilityQuery_ExecuteLL, Teardown) + +EUNIT_TEST( + "Canceled - test ", + "CMusAvaCapabilityQuery", + "Canceled", + "FUNCTIONALITY", + SetupL,UT_CMusAvaCapabilityQuery_CanceledL, Teardown) + +EUNIT_TEST( + "CompletedL - test ", + "CMusAvaCapabilityQuery", + "CompletedL", + "FUNCTIONALITY", + SetupL,UT_CMusAvaCapabilityQuery_CompletedLL, Teardown) + +EUNIT_TEST( + "CompletedL1 - test ", + "CMusAvaCapabilityQuery", + "CompletedL", + "FUNCTIONALITY", + SetupL,UT_CMusAvaCapabilityQuery_CompletedL1L, Teardown) + +EUNIT_TEST( + "CompletedL2 - test ", + "CMusAvaCapabilityQuery", + "CompletedL", + "FUNCTIONALITY", + SetupL,UT_CMusAvaCapabilityQuery_CompletedL2L, Teardown) + +EUNIT_TEST( + "ValidateAndStoreCodecsL - test ", + "CMusAvaCapabilityQuery", + "ValidateAndStoreCodecsL", + "FUNCTIONALITY", + SetupL,UT_CMusAvaCapabilityQuery_ValidateAndStoreCodecsLL, Teardown) + +EUNIT_TEST( + "ValidateAttributesL - test ", + "CMusAvaCapabilityQuery", + "ValidateAttributesL", + "FUNCTIONALITY", + SetupL,UT_CMusAvaCapabilityQuery_ValidateAttributesLL, Teardown) + +EUNIT_TEST( + "ValidateContactL - test ", + "CMusAvaCapabilityQuery", + "ValidateContactL", + "FUNCTIONALITY", + SetupL,UT_CMusAvaCapabilityQuery_ValidateContactLL, Teardown) + +EUNIT_TEST( + "Prepare - test ", + "CMusAvaCapabilityQuery", + "Prepare", + "FUNCTIONALITY", + SetupL,UT_CMusAvaCapabilityQuery_PrepareL, Teardown) + +EUNIT_TEST( + "DoCompletedL - test ", + "CMusAvaCapabilityQuery", + "DoCompletedL", + "FUNCTIONALITY", + SetupL,UT_CMusAvaCapabilityQuery_DoCompletedLL, Teardown) + +EUNIT_TEST( + "DoCompleted200OKL - test ", + "CMusAvaCapabilityQuery", + "DoCompleted200OKL", + "FUNCTIONALITY", + SetupL,UT_CMusAvaCapabilityQuery_DoCompleted200OKLL, Teardown) + +EUNIT_END_TEST_TABLE + +// END OF FILE diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaCapabilitySipAgent.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaCapabilitySipAgent.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,625 @@ +/* +* 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: +* +*/ + + +// CLASS HEADER +#include "UT_CMusAvaCapabilitySipAgent.h" +#include "musavasettingsimp.h" +#include "musavaobserverimp.h" +#include "musavaavailabilityobserver.h" +#include "musavaavailabilityobserverimp.h" +#include "muslogger.h" + + + +// EXTERNAL INCLUDES +#include +#include +#include +#include +#include +#include +#include +#include +// INTERNAL INCLUDES +#include "musavaoptionhandler.h" +#include "musavacapabilitytesthelper.h" +#include "CSipSseTestTls.h" +#include "musavaCapabilityExchange.h" +#include "musavacapabilitysipagent.h" +#include "MusAvaCapabilityQuery.h" +#include "musavaterminal.h" +#include "sipprofile.h" +#include "musavasharedobject.h" +#include "mussettingskeys.h" +#include "mussettings.h" +#include "musavasip.h" + + +// CONSTRUCTION +UT_CMusAvaCapabilitySipAgent* UT_CMusAvaCapabilitySipAgent::NewL() + { + UT_CMusAvaCapabilitySipAgent* self = UT_CMusAvaCapabilitySipAgent::NewLC(); + CleanupStack::Pop(); + + return self; + } + +UT_CMusAvaCapabilitySipAgent* UT_CMusAvaCapabilitySipAgent::NewLC() + { + UT_CMusAvaCapabilitySipAgent* self = new( ELeave ) UT_CMusAvaCapabilitySipAgent(); + CleanupStack::PushL( self ); + self->ConstructL(); + + return self; + } + +// Destructor (virtual by CBase) +UT_CMusAvaCapabilitySipAgent::~UT_CMusAvaCapabilitySipAgent() + { + } + +// Default constructor +UT_CMusAvaCapabilitySipAgent::UT_CMusAvaCapabilitySipAgent() + { + } + +// Second phase construct +void UT_CMusAvaCapabilitySipAgent::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + +// METHODS + +void UT_CMusAvaCapabilitySipAgent::SetupL( ) + { + iSharedObject = CMusAvaSharedObject::GetSingletonL(); + iAvailabilityObserver = CMusAvaAvailabilityObserverImp::NewL(); + iConcreteSettings = CMusAvaSettingsImp::NewL(); + iOptionHandler = CMusAvaOptionHandler::NewL( *iAvailabilityObserver, + *iConcreteSettings ); + iExchange = iOptionHandler->iCapabilityExchange; + iSipAgent = CMusAvaCapabilitySipAgent::NewL( *iExchange, + *iOptionHandler->iSharedObj, + iOptionHandler->iObserver); + + iCapability = iOptionHandler->iSwisCapability; + + MSIPConnectionObserver& connectionObserver = + iSharedObject->MusAvaSip().ConnectionObserver(); + + CSIP& sip = iSharedObject->MusAvaSip().Sip(); + iSharedObject->MusAvaSip().CreateProfileL(); + iProfile = iSharedObject->MusAvaSip().Profile(); + TUint32 iapId; + TInt err = iProfile->GetParameter( KSIPAccessPointId, iapId ); + iSIPConnection = CSIPConnection::NewL( sip, + iapId, + connectionObserver ); + + iSharedObject->MusAvaSip().ConnectionL(); // Forced connection creation + + if ( !iProfile->iArray ) + { + iProfile->iArray = new ( ELeave ) CDesC8ArrayFlat( 1 ); + iProfile->iArray->AppendL( _L8("sip:user@domain.com") ); + } + if ( !iProfile->iRegisteredContact ) + { + iProfile->iRegisteredContact = KRegisteredContact().AllocL(); + } + + CSipSseTestTls::OpenL(); + iStorage = CSipSseTestTls::Storage(); + iStorage->Set( MusSettingsKeys::KFastStartupMode, + MusSettingsKeys::EFastModeOff ); + + iProfileId = MultimediaSharingSettings::SipProfileSettingL(); + } + +void UT_CMusAvaCapabilitySipAgent::Teardown( ) + { + CMusAvaSharedObject::DeleteSingleton(); + + if ( iStorage ) + { + iStorage->Clear(); + CSipSseTestTls::Close(); + iStorage = NULL; + } + delete iSipAgent; + delete iOptionHandler; + delete iConcreteSettings; + delete iAvailabilityObserver; + + delete iSIPConnection; + } + +void UT_CMusAvaCapabilitySipAgent::UT_CMusAvaCapabilitySipAgent_NewLL( ) + { + EUNIT_ASSERT( iSipAgent ); + } + +void UT_CMusAvaCapabilitySipAgent::UT_CMusAvaCapabilitySipAgent_ExecuteCapabilityQueryLL( ) + { + EUNIT_ASSERT( iSipAgent ); + EUNIT_ASSERT( iExchange->Terminals().Count() == 0 ); + + TInt ret = NULL; + TRAPD ( error, ret = iSharedObject->MusAvaSip().CreateProfileL() ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT( ret ); + MultimediaSharingSettings::SetSipProfileSettingL( 1 ); + + iSipAgent->ExecuteCapabilityQueryL( *iCapability, + KCapabilityTestSIPAddressUri_B ); + EUNIT_ASSERT( iStorage->iClientRequest->Method() == + SIPStrings::StringF( SipStrConsts::EOptions ) ); + + EUNIT_ASSERT( iStorage->iClientRequest->MessageElements().Content().Length() > 0 ); + EUNIT_ASSERT( iStorage->iClientRequest->MessageElements().ContentType() ); + EUNIT_ASSERT( iStorage->iClientRequest->RemoteUri().Uri().UriDes().Compare( + KCapabilityTestSIPAddressUri8_B ) == 0); + EUNIT_ASSERT( iStorage->iClientRequest->MessageElements().UserHeaders().Count() == 6 ); + MUS_HEADER_ASSERT( iStorage->iClientRequest, 0, KCapabilityTestAcceptContactHeader ); + MUS_HEADER_ASSERT( iStorage->iClientRequest, 5, KCapabilityTestContactHeader_A1Updated ); + MUS_HEADER_ASSERT( iStorage->iClientRequest, 3, KCapabilityTestAcceptHeader ); + } + +void UT_CMusAvaCapabilitySipAgent::UT_CMusAvaCapabilitySipAgent_IncomingRequestL( ) + { + + CSIPServerTransaction* request = CapabilityTestHelper::OptionsRequestL( + KCapabilityTestAddress_A, + KCapabilityTestAddress_B, + KCapabilitySwisFeature, + KCapabilitySwisFeature, + KCapabilityTestAcceptHeader, + KCapabilityTestTerminalID_B ); + + TUint32 iapId = iSIPConnection->IapId(); + + /*EUNIT_ASSERT( iSipAgent->IncomingRequest( iapId, request ) == KErrNone ); + + EUNIT_ASSERT( server->iResponseToRequest == SIPStrings::StringF( SipStrConsts::EOptions ) ); + EUNIT_ASSERT( server->iClientResponse->StatusCode() == KMUSAVASIP200 ); + EUNIT_ASSERT( server->iClientResponse->MessageElements().Content().Length() > 0 ); + EUNIT_ASSERT( server->iClientResponse->MessageElements().Content().Compare( KCapabilityTestSDP ) == 0 ); + + EUNIT_ASSERT( server->iClientResponse->MessageElements().UserHeaders().Count() == 1 ); + MUS_HEADER_ASSERT( server->iClientResponse, 0, KCapabilityTestContactHeader_A ); + */ + EUNIT_ASSERT( iSipAgent->IncomingRequest( iapId, request ) == KErrNotFound ); + delete request; + + EUNIT_ASSERT( !iOptionHandler->iCapabilityQueryAnswered ); + iOptionHandler->iObserver.AvailabilityChanged(MMusAvaObserver::EMusAvaOptionHandler, + MMusAvaObserver::EMusAvaStatusCallOnHold); + request = CapabilityTestHelper::OptionsRequestL( + KCapabilityTestAddress_A, + KCapabilityTestAddress_B, + KCapabilitySwisFeature, + KCapabilitySwisFeature, + KCapabilityTestAcceptHeader, + KCapabilityTestTerminalID_B ); + EUNIT_ASSERT( iSipAgent->IncomingRequest( request ) == KErrNotFound ); + delete request; + + iOptionHandler->iObserver.AvailabilityChanged(MMusAvaObserver::EMusAvaOptionHandler, + MMusAvaObserver::EMusAvaStatusOptionsNotSent); + request = CapabilityTestHelper::OptionsRequestL( + KCapabilityTestAddress_A, + KCapabilityTestAddress_B, + KCapabilitySwisFeature, + KCapabilitySwisFeature, + KCapabilityTestAcceptHeader, + KCapabilityTestTerminalID_B ); + EUNIT_ASSERT( iSipAgent->IncomingRequest( request ) == KErrNone ); + + iOptionHandler->iCapabilityQueryAnswered = ETrue; + EUNIT_ASSERT( iOptionHandler->iCapabilityQueryAnswered ); + + request = CapabilityTestHelper::OptionsRequestL( + KCapabilityTestAddress_A, + KCapabilityTestAddress_B, + KCapabilitySwisFeature, + KCapabilitySwisFeature, + KCapabilityTestAcceptHeader, + KCapabilityTestTerminalID_B ); + + EUNIT_ASSERT( iSipAgent->IncomingRequest( request ) == KErrNotFound ); + delete request; + + CSIPServerTransaction* transaction = + CSIPServerTransaction::NewL( SIPStrings::StringF( SipStrConsts::EInvite ) ); + iStorage->SetError( KErrGeneral ); + EUNIT_ASSERT( iSipAgent->IncomingRequest( transaction ) == KErrNone ); + iStorage->SetError( KErrNone ); + + + + + } + +void UT_CMusAvaCapabilitySipAgent::UT_CMusAvaCapabilitySipAgent_HandleIncomingRequestLL( ) + { + CSIPServerTransaction* transaction = + CSIPServerTransaction::NewL( SIPStrings::StringF( SipStrConsts::EInvite ) ); + CleanupStack::PushL( transaction ); + transaction->iIsClientTransaction = ETrue; + transaction->iState = CSIPTransactionBase::ETrying; + + TUriParser8 Uri; + User::LeaveIfError( Uri.Parse( KCapabilityTestAddress_A ) ); + + CUri8* uri = CUri8::NewLC( Uri ); + + CSIPRequestElements* requestelements = CSIPRequestElements::NewL( uri ); + CleanupStack::Pop( uri ); + CleanupStack::PushL( requestelements ); + requestelements->SetMethodL( SIPStrings::StringF( SipStrConsts::EInvite ) ); + transaction->SetRequestElements( requestelements ); + CleanupStack::Pop( requestelements ); + + iSipAgent->HandleIncomingRequestL( *transaction ); + //iSipAgent->IncomingRequest( transaction ); + + EUNIT_ASSERT( iStorage->iClientResponse->ReasonPhrase() == + SIPStrings::StringF( SipStrConsts::EPhraseNotImplemented ) ); + EUNIT_ASSERT( iStorage->iClientResponse->StatusCode() == KMUSAVASIPNotImplemented ); + CleanupStack::PopAndDestroy( transaction ); + + } + +void UT_CMusAvaCapabilitySipAgent::UT_CMusAvaCapabilitySipAgent_IncomingResponseL( ) + { + CMusAvaCapabilityQuery* query = NULL; + MultimediaSharingSettings::SetOperatorVariantSettingL( + MusSettingsKeys::EStandard ); +//init + for( TInt i = 0; i<5;i++ ) + { + query = CMusAvaCapabilityQuery::NewL( *iCapability, + *iSIPConnection, + *iProfile, + KCapabilityTestSIPAddressUri_B ); + CleanupStack::PushL( query ); + + EUNIT_ASSERT( query->Result() == KCapabilityQueryNotReady ); + EUNIT_ASSERT( query->State() == CMusAvaCapabilityQueryBase::ECapabilityQueryCreated ); + EUNIT_ASSERT( !query->iTimer ); + EUNIT_ASSERT( !query->iTrx ); + + EUNIT_ASSERT( iExchange->Terminals().Count() == 1 ); + if ( i == 0 ) + { + EUNIT_ASSERT( query->Terminal().Id().Length() == 0 ); + } + else + { + EUNIT_ASSERT( query->Terminal().Id().Length() > 0 ); + EUNIT_ASSERT( query->Terminal().Id().Compare( KCapabilityTestTerminalID_B ) == 0 ); + } + + EUNIT_ASSERT( !query->Terminal().RequestedQuery() ); + EUNIT_ASSERT( !query->Terminal().IsDiscovered() ); + + // Since several queries cannot be executed, we delete the old one... + delete query->iTerminal->iQuery; + query->iTerminal->iQuery = NULL; + + // ...before execution + query->Terminal().ExecuteQueryL( query ); + CleanupStack::Pop( query ); + + EUNIT_ASSERT( query->Terminal().iQuery == query ); + EUNIT_ASSERT( query->Result() == KCapabilityQueryNotReady ); + EUNIT_ASSERT( query->State() == CMusAvaCapabilityQueryBase::ECapabilityQueryExecuting ); + EUNIT_ASSERT( !query->iTimer ); + EUNIT_ASSERT( query->iTrx ); + + EUNIT_ASSERT( iExchange->Terminals().Count() == 1 ); + if ( i == 0 ) + { + EUNIT_ASSERT( query->Terminal().Id().Length() == 0 ); + } + else + { + EUNIT_ASSERT( query->Terminal().Id().Length() > 0 ); + EUNIT_ASSERT( query->Terminal().Id().Compare( KCapabilityTestTerminalID_B ) == 0 ); + } + + + HBufC* uri16 = EscapeUtils::ConvertToUnicodeFromUtf8L( query->Terminal().Uri() ); + EUNIT_ASSERT( uri16->Compare( KCapabilityTestSIPAddressUri_B ) == 0 ); + delete uri16; + uri16 = NULL; + EUNIT_ASSERT( !query->Terminal().RequestedQuery() ); + EUNIT_ASSERT( !query->Terminal().IsDiscovered() ); + + EUNIT_ASSERT( iStorage->iClientRequest->Method() == SIPStrings::StringF( SipStrConsts::EOptions ) ); + EUNIT_ASSERT( iStorage->iClientRequest->MessageElements().Content().Length() > 0 ); + EUNIT_ASSERT( iStorage->iClientRequest->MessageElements().ContentType() ); + EUNIT_ASSERT( iStorage->iClientRequest->MessageElements().UserHeaders().Count() == 6 ); + MUS_HEADER_ASSERT( iStorage->iClientRequest, 0, KCapabilityTestAcceptContactHeader ); + MUS_HEADER_ASSERT( iStorage->iClientRequest, 5, KCapabilityTestContactHeader_A1Updated ); + MUS_HEADER_ASSERT( iStorage->iClientRequest, 3, KCapabilityTestAcceptHeader ); + + //set response + // GSMA Cingular + if ( i == 0 || i == 3 )//200 OK FT + { + CapabilityTestHelper::SetResponseL( *query->iTrx, KMUSAVASIP200, SipStrConsts::EPhraseOk, + KCapabilityTestAddress_B, + KCapabilitySwisFeature, + KCapabilityTestTerminalID_B, + KPAssertedIdentity_B, + KCapabilityTestSDP ); + } + // GSMA Cingular + else if ( i == 1 || i == 4 )//200 OK NO FT + { + CapabilityTestHelper::SetResponseL( *query->iTrx, KMUSAVASIP200, SipStrConsts::EPhraseOk, + KCapabilityTestAddress_B, + KNullDesC8, + KCapabilityTestTerminalID_B, + KPAssertedIdentity_B, + KCapabilityTestSDP ); + + } + else if ( i == 2 )//GSMA & 404 + { + CapabilityTestHelper::SetResponseL( *query->iTrx, KMUSAVASIPNotFound, SipStrConsts::EPhraseNotFound, + KCapabilityTestAddress_B, + KNullDesC8, + KNullDesC8, + KNullDesC8, + KNullDesC8 ); + + } + + if ( i == 4 ) + { + EUNIT_ASSERT( + MultimediaSharingSettings::OperatorVariantSettingL() == + MusSettingsKeys::EStandard ); + // set cingular variant key on + MultimediaSharingSettings::SetOperatorVariantSettingL( + MusSettingsKeys::EOperatorSpecific ); + EUNIT_ASSERT( MultimediaSharingSettings::OperatorVariantSettingL() + == MusSettingsKeys::EOperatorSpecific ); + } + + iSipAgent->IncomingResponse( *query->iTrx ); + + EUNIT_ASSERT( iExchange->Terminals().Count() == 1 ); + TInt count = 0; + EUNIT_GET_ALLOC_DECORATOR_FAILCOUNT( count ); + if ( count == 0 ) + { + EUNIT_ASSERT( query->Terminal().Id().Length() > 0 ); + EUNIT_ASSERT( query->Terminal().Id().Compare( KCapabilityTestTerminalID_B ) == 0 ); + uri16 = EscapeUtils::ConvertToUnicodeFromUtf8L( query->Terminal().Uri() ); + //EUNIT_ASSERT( uri16->Compare( iOptionHandler->SipAddressProposal() ) == 0 ); + delete uri16; + uri16 = NULL; + EUNIT_ASSERT( !query->Terminal().RequestedQuery() ); + + + if ( i == 0 || i == 3 )//200 OK FT + { + EUNIT_ASSERT( + MultimediaSharingSettings::OperatorVariantSettingL() == + MusSettingsKeys::EStandard ); + EUNIT_ASSERT( query->Terminal().iQuery->State() == CMusAvaCapabilityQueryBase::ECapabilityQueryCompleted ); + EUNIT_ASSERT( query->Terminal().IsDiscovered() ); + EUNIT_ASSERT( !query->Retrying() ); + EUNIT_ASSERT( query->iTimer == NULL ); + } + else if ( i == 1 )//GSMA & 200 OK NO FT + { + EUNIT_ASSERT( + MultimediaSharingSettings::OperatorVariantSettingL() == + MusSettingsKeys::EStandard ); + EUNIT_ASSERT( query->Terminal().iQuery == query ); + EUNIT_ASSERT( query->Terminal().iQuery->Result() == KCapabilityCapabilitesNotFound ); + EUNIT_ASSERT( query->Terminal().IsDiscovered() ); + EUNIT_ASSERT( !query->Retrying() ); + EUNIT_ASSERT( query->iTimer == NULL ); + } + else if ( i == 4 )//( not yet Cingular) & 200 OK NO FT + { + EUNIT_ASSERT( MultimediaSharingSettings::OperatorVariantSettingL() + == MusSettingsKeys::EOperatorSpecific ); + MultimediaSharingSettings::SetOperatorVariantSettingL( + MusSettingsKeys::EStandard ); + EUNIT_ASSERT( query->Terminal().iQuery == query ); + EUNIT_ASSERT( query->Terminal().iQuery->Result() == KCapabilityCapabilitesNotFound ); + EUNIT_ASSERT( query->Terminal().IsDiscovered() ); + EUNIT_ASSERT( !query->Retrying() ); + EUNIT_ASSERT( query->iTimer == NULL ); + } + else if ( i == 2 ) //GSMA & 404 + { + EUNIT_ASSERT( + MultimediaSharingSettings::OperatorVariantSettingL() == + MusSettingsKeys::EStandard ); + EUNIT_ASSERT( !query->Terminal().iQuery == NULL ); + EUNIT_ASSERT( !query->Terminal().IsDiscovered() ); + EUNIT_ASSERT( query->Retrying() ); + EUNIT_ASSERT( query->iTimer != NULL ); + + query->OnExpiredL( KErrNone ); + EUNIT_ASSERT( iStorage->iClientRequest->Method() == SIPStrings::StringF( SipStrConsts::EOptions ) ); + EUNIT_ASSERT( iStorage->iClientRequest->MessageElements().Content().Length() > 0 ); + EUNIT_ASSERT( iStorage->iClientRequest->MessageElements().ContentType() ); + EUNIT_ASSERT( iStorage->iClientRequest->MessageElements().UserHeaders().Count() == 6 ); + MUS_HEADER_ASSERT( iStorage->iClientRequest, 0, KCapabilityTestAcceptContactHeader ); + MUS_HEADER_ASSERT( iStorage->iClientRequest, 5, KCapabilityTestContactHeader_A1Updated ); + MUS_HEADER_ASSERT( iStorage->iClientRequest, 3, KCapabilityTestAcceptHeader ); + + CapabilityTestHelper::SetResponseL( *query->iTrx, KMUSAVASIPNotFound, SipStrConsts::EPhraseNotFound, + KCapabilityTestAddress_B, + KNullDesC8, + KNullDesC8, + KNullDesC8, + KNullDesC8 ); + //iExchange->AnswerToQueryReceived( *query->iTrx ); + iSipAgent->IncomingResponse( *query->iTrx ); + EUNIT_ASSERT( query->Terminal().iQuery == query ); + EUNIT_ASSERT( query->Terminal().iQuery->Result() == KCapabilityCapabilitesNotFound ); + EUNIT_ASSERT( query->Terminal().IsDiscovered() ); + EUNIT_ASSERT( !query->Retrying() ); + EUNIT_ASSERT( query->iTimer == NULL ); + } + } + else + { + break; + } + } + } + +void UT_CMusAvaCapabilitySipAgent::UT_CMusAvaCapabilitySipAgent_ErrorOccuredL( ) + { + CMusAvaCapabilityQuery* query = NULL; + + query = CMusAvaCapabilityQuery::NewL( *iCapability, + *iSIPConnection, + *iProfile, + KCapabilityTestSIPAddressUri_B ); + CleanupStack::PushL( query ); + + EUNIT_ASSERT( query->Result() == KCapabilityQueryNotReady ); + EUNIT_ASSERT( query->State() == + CMusAvaCapabilityQueryBase::ECapabilityQueryCreated ); + EUNIT_ASSERT( !query->iTimer ); + EUNIT_ASSERT( !query->iTrx ); + + EUNIT_ASSERT( iExchange->Terminals().Count() == 1 ); + EUNIT_ASSERT( query->Terminal().Id().Length() == 0 ); + EUNIT_ASSERT( !query->Terminal().RequestedQuery() ); + EUNIT_ASSERT( !query->Terminal().IsDiscovered() ); + + query->Terminal().ExecuteQueryL( query ); + CleanupStack::Pop( query ); + + EUNIT_ASSERT( query->Terminal().iQuery == query ); + EUNIT_ASSERT( query->Result() == KCapabilityQueryNotReady ); + EUNIT_ASSERT( query->State() == + CMusAvaCapabilityQueryBase::ECapabilityQueryExecuting ); + EUNIT_ASSERT( !query->iTimer ); + EUNIT_ASSERT( query->iTrx ); + + query->SetState( CMusAvaCapabilityQueryBase::ECapabilityQueryExecuting ); + + //200 OK with User-Agent + CapabilityTestHelper::SetResponseL( *query->iTrx, + KMUSAVASIP200, + SipStrConsts::EPhraseOk, + KCapabilityTestAddress_B, + KCapabilitySwisFeature, + KCapabilityTestTerminalID_B, + KPAssertedIdentity_B, + KCapabilityTestSDP ); + TInt err = 404; + EUNIT_ASSERT( iSipAgent->ErrorOccured( err, *query->iTrx ) == KErrNone ); + EUNIT_ASSERT( query->State() == + CMusAvaCapabilityQueryBase::ECapabilityQueryCompleted ); + + CSIPServerTransaction* transaction = + CSIPServerTransaction::NewL( SIPStrings::StringF( SipStrConsts::EInvite ) ); + EUNIT_ASSERT( iSipAgent->ErrorOccured( err, *transaction ) == KErrNone ); + delete transaction; + } + +void UT_CMusAvaCapabilitySipAgent::UT_CMusAvaCapabilitySipAgent_TimedOutL() + { + CSIPServerTransaction* request = CapabilityTestHelper::OptionsRequestL( + KCapabilityTestAddress_A, + KCapabilityTestAddress_B, + KCapabilitySwisFeature, + KCapabilitySwisFeature, + KCapabilityTestAcceptHeader, + KCapabilityTestTerminalID_B ); + EUNIT_ASSERT( iSipAgent->TimedOut( *request ) == KErrNotSupported ); + delete request; + } + + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusAvaCapabilitySipAgent, + "CMusAvaCapabilitySipAgent", + "UNIT" ) + +EUNIT_TEST( + "NewL - test ", + "CMusAvaCapabilitySipAgent", + "NewL", + "FUNCTIONALITY", + SetupL,UT_CMusAvaCapabilitySipAgent_NewLL, Teardown) + +EUNIT_TEST( + "ExecuteCapabilityQueryL - test ", + "CMusAvaCapabilitySipAgent", + "ExecuteCapabilityQueryL", + "FUNCTIONALITY", + SetupL,UT_CMusAvaCapabilitySipAgent_ExecuteCapabilityQueryLL, Teardown) + +EUNIT_TEST( + "IncomingRequest - test ", + "CMusAvaCapabilitySipAgent", + "IncomingRequest", + "FUNCTIONALITY", + SetupL,UT_CMusAvaCapabilitySipAgent_IncomingRequestL, Teardown) + +EUNIT_TEST( + "HandleIncomingRequestL - test ", + "CMusAvaCapabilitySipAgent", + "HandleIncomingRequestL", + "FUNCTIONALITY", + SetupL,UT_CMusAvaCapabilitySipAgent_HandleIncomingRequestLL, Teardown) + +EUNIT_TEST( + "IncomingResponse - test ", + "CMusAvaCapabilitySipAgent", + "IncomingResponse", + "FUNCTIONALITY", + SetupL,UT_CMusAvaCapabilitySipAgent_IncomingResponseL, Teardown) + +EUNIT_TEST( + "ErrorOccured - test ", + "CMusAvaCapabilitySipAgent", + "ErrorOccured", + "FUNCTIONALITY", + SetupL,UT_CMusAvaCapabilitySipAgent_ErrorOccuredL, Teardown) + +EUNIT_TEST( + "TimedOut - test ", + "CMusAvaCapabilitySipAgent", + "TimedOut", + "FUNCTIONALITY", + SetupL,UT_CMusAvaCapabilitySipAgent_TimedOutL, Teardown) + +EUNIT_END_TEST_TABLE + +// END OF FILE diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaConnectionAvailability.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaConnectionAvailability.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,951 @@ +/* +* 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: +* +*/ + + +// CLASS HEADER +#include "UT_CMusAvaConnectionAvailability.h" +#include "musavaavailabilityobserver.h" +#include "musavaavailabilityobserverimp.h" +#include "musavaavailability.h" +#include "muslogger.h" +#include "musavaobserver.h" +#include "musavaobserverimp.h" +#include "musavadefaultimp.h" +#include "musavaobserverimp.h" +#include "musavasettingsimp.h" +#include "musavaconnectionmonitor.h" +#include "musavasharedobject.h" +#include "musavasip.h" +#include "mussettingskeys.h" +#include "mussettings.h" +#include "CSipSseTestTls.h" +#include "musavanetworkregistrationstatus.h" +#include "musavacapabilitytesthelper.h" //remove compilation warning + + +// EXTERNAL INCLUDES +#include +#include +//#include +#include +#include +#include +#include +#include +#include + + +// INTERNAL INCLUDES +#include "musavaconnectionavailability.h" + + + +// CONSTRUCTION +UT_CMusAvaConnectionAvailability* UT_CMusAvaConnectionAvailability::NewL() + { + UT_CMusAvaConnectionAvailability* self = UT_CMusAvaConnectionAvailability::NewLC(); + CleanupStack::Pop(); + + return self; + } + +UT_CMusAvaConnectionAvailability* UT_CMusAvaConnectionAvailability::NewLC() + { + UT_CMusAvaConnectionAvailability* self = new( ELeave ) UT_CMusAvaConnectionAvailability(); + CleanupStack::PushL( self ); + + self->ConstructL(); + + return self; + } + +// Destructor (virtual by CBase) +UT_CMusAvaConnectionAvailability::~UT_CMusAvaConnectionAvailability() + { + } + +// Default constructor +UT_CMusAvaConnectionAvailability::UT_CMusAvaConnectionAvailability() + { + } + +// Second phase construct +void UT_CMusAvaConnectionAvailability::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + +// METHODS + + + +void UT_CMusAvaConnectionAvailability::SetupL( ) + { + SIPStrings::OpenL(); + CSipSseTestTls::OpenL(); + iProfileId = MultimediaSharingSettings::SipProfileSettingL(); + iStorage = CSipSseTestTls::Storage(); + iAvailabilityObserver = CMusAvaAvailabilityObserverImp::NewL(); + iConcreteSettings = CMusAvaSettingsImp::NewL(); + iConnectionAvailability = + CMusAvaConnectionAvailability::NewL( *iAvailabilityObserver, *iConcreteSettings ); + + iSharedObject = CMusAvaSharedObject::GetSingletonL(); + } + +void UT_CMusAvaConnectionAvailability::Teardown( ) + { + delete iAvailabilityObserver; + iAvailabilityObserver = NULL; + delete iConcreteSettings; + iConcreteSettings = NULL; + delete iConnectionAvailability; + iConnectionAvailability = NULL; + + if ( iStorage ) + { + iStorage->Clear(); + CSipSseTestTls::Close(); + iStorage = NULL; + } + CMusAvaSharedObject::DeleteSingleton(); + SIPStrings::Close(); + } + +void UT_CMusAvaConnectionAvailability::UT_CMusAvaConnectionAvailability_NewLL() + { + EUNIT_ASSERT( iConnectionAvailability ); + } + +void UT_CMusAvaConnectionAvailability::UT_CMusAvaConnectionAvailability_DoExecuteLL() + { + // Test: VS is allowed in All Netwoks by Default. + + // Test1: VS in 3G Always Allowed. + TInt error = KErrArgument; + TInt count = KErrNone; + iStorage->SetPhoneNetworkModeStatus( RMobilePhone::ENetworkModeWcdma ); + iStorage->SetRegistrationStatus( RMobilePhone::ERegisteredOnHomeNetwork ); + MultimediaSharingSettings::SetActivationSettingL( MusSettingsKeys::EActiveInHomeNetworks ); + TRAP( error, iConnectionAvailability->DoExecuteL() ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT ( error == KErrNone ); + + EUNIT_GET_ALLOC_DECORATOR_FAILCOUNT( count ); + if ( count > 0 && iConnectionAvailability->State() + == MMusAvaObserver::EMusActivationError ) + { + User::Leave( KErrNoMemory ); + } + EUNIT_ASSERT( iConnectionAvailability->State() == MMusAvaObserver::EMusAvaStatusAvailable ); + + + //Test2 : VS is even allowed when Network type is Unknown + iStorage->SetPhoneNetworkModeStatus( RMobilePhone::ENetworkModeUnknown ); + iStorage->SetRegistrationStatus( RMobilePhone::ERegisteredOnHomeNetwork ); + MultimediaSharingSettings::SetActivationSettingL( MusSettingsKeys::EAlwaysActive ); + CMusAvaConnectionMonitor& avaConnectionMonitor = iSharedObject->ConnectionMonitor(); + avaConnectionMonitor.iConnectionMonitor.iConnectionId = 1; + avaConnectionMonitor.iConnectionMonitor.iConnectionCounter = 1; + avaConnectionMonitor.iConnectionMonitor.iUintAttributeValue = 1; + avaConnectionMonitor.iConnectionMonitor.iConnectionInfoError = KErrNone; + + //EUNIT_DISABLE_ALLOC_DECORATOR; + + TRAP( error, iConnectionAvailability->DoExecuteL() ); + if ( error == KErrNoMemory ) User::Leave( error ); + + //EUNIT_DISABLE_ALLOC_DECORATOR; + + EUNIT_ASSERT ( error == KErrNone ); + EUNIT_GET_ALLOC_DECORATOR_FAILCOUNT( count ); + + //HKK Define own error condition in which it can fil. + + + if ( count > 0 && ( iConnectionAvailability->State() + == MMusAvaObserver::EMusActivationError) || + (iConnectionAvailability->State() == MMusAvaObserver::EMusAvaNetworkType )) + { + User::Leave( KErrNoMemory ); + } + EUNIT_ASSERT( iConnectionAvailability->State() == MMusAvaObserver::EMusAvaStatusAvailable ); + + // Test3: VS in GSM Network is Allowed Ensure, PDP Context Need to be up to ensure network does + // support data connection; Note DTM Flag is not needed anymore since VS is allowed in all network. + iStorage->SetPhoneNetworkModeStatus( RMobilePhone::ENetworkModeGsm ); + iStorage->SetRegistrationStatus( RMobilePhone::ERegisteredOnHomeNetwork ); + + MultimediaSharingSettings::SetActivationSettingL( MusSettingsKeys::EAlwaysActive ); + avaConnectionMonitor.iConnectionMonitor.iConnectionId = 1; + avaConnectionMonitor.iConnectionMonitor.iConnectionCounter = 1; + avaConnectionMonitor.iConnectionMonitor.iUintAttributeValue = 1; + avaConnectionMonitor.iConnectionMonitor.iConnectionInfoError = KErrNone; + TRAP( error, iConnectionAvailability->DoExecuteL() ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT ( error == KErrNone ); + EUNIT_GET_ALLOC_DECORATOR_FAILCOUNT( count ); + if ( count > 0 && ( iConnectionAvailability->State() + == MMusAvaObserver::EMusActivationError ) || + (iConnectionAvailability->State() == MMusAvaObserver::EMusAvaNetworkType )) + + { + User::Leave( KErrNoMemory ); + } + EUNIT_ASSERT( iConnectionAvailability->State() == MMusAvaObserver::EMusAvaStatusAvailable ); + + + // Test4: VS in GSM Network is dis-allowed if PDP context is not up. + iStorage->SetPhoneNetworkModeStatus( RMobilePhone::ENetworkModeGsm ); + iStorage->SetRegistrationStatus( RMobilePhone::ERegisteredOnHomeNetwork ); + MultimediaSharingSettings::SetActivationSettingL( MusSettingsKeys::EAlwaysActive ); + avaConnectionMonitor.iConnectionMonitor.iConnectionId = 1; + avaConnectionMonitor.iConnectionMonitor.iConnectionCounter = 0; + avaConnectionMonitor.iConnectionMonitor.iUintAttributeValue = 1; + avaConnectionMonitor.iConnectionMonitor.iConnectionInfoError = KErrNone; + TRAP( error, iConnectionAvailability->DoExecuteL() ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT ( error == KErrNone ); + EUNIT_GET_ALLOC_DECORATOR_FAILCOUNT( count ); + if ( count > 0 && ( iConnectionAvailability->State() + == MMusAvaObserver::EMusActivationError ) || + (iConnectionAvailability->State() == MMusAvaObserver::EMusAvaNetworkType )) + + { + User::Leave( KErrNoMemory ); + } + EUNIT_ASSERT( iConnectionAvailability->State() == MMusAvaObserver::EMusAvaEdgeDtmStatusUnknown ); + } + + +void UT_CMusAvaConnectionAvailability::UT_CMusAvaConnectionAvailability_DoExecuteLL2() + { + // Restrict VS to be only Used in 3G mode, + + iStorage->Set ( MusSettingsKeys::KAllowOnlyIn3GNetwork, + MusSettingsKeys::EAllowed3GOnly ); + + // Test: In GSM VS is not Allowed when its restricted to be only used in 3G + + TInt ret = 0; + iStorage->SetPhoneNetworkModeStatus( RMobilePhone::ENetworkModeGsm ); + iStorage->SetRegistrationStatus( RMobilePhone::ERegisteredOnHomeNetwork ); + MultimediaSharingSettings::SetActivationSettingL( MusSettingsKeys::EAlwaysActive ); + MultimediaSharingSettings::SetEdgeDtmSupportSettingL( MusSettingsKeys::EDtmModeNotAllowed ); + TRAPD( error, iConnectionAvailability->DoExecuteL() ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT ( error == KErrNone ); + + TInt count = 0; + EUNIT_GET_ALLOC_DECORATOR_FAILCOUNT( count ); + if ( count > 0 && + iConnectionAvailability->State() != MMusAvaObserver::EMusAvaNetworkType ) + { + User::Leave( KErrNoMemory ); + } + EUNIT_ASSERT( iConnectionAvailability->State() == MMusAvaObserver::EMusAvaNetworkType ); + + // Test2: In 3G VS is allowed. + + iStorage->SetPhoneNetworkModeStatus( RMobilePhone::ENetworkModeWcdma ); + iStorage->SetRegistrationStatus( RMobilePhone::ERegisteredOnHomeNetwork ); + MultimediaSharingSettings::SetActivationSettingL( MusSettingsKeys::EActiveInHomeNetworks ); + TRAP( error, iConnectionAvailability->DoExecuteL() ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT ( error == KErrNone ); + + EUNIT_GET_ALLOC_DECORATOR_FAILCOUNT( count ); + if ( count > 0 && iConnectionAvailability->State() + == MMusAvaObserver::EMusActivationError ) + { + User::Leave( KErrNoMemory ); + } + EUNIT_ASSERT( iConnectionAvailability->State() == MMusAvaObserver::EMusAvaStatusAvailable ); + + // Test3: Active in home networks + MultimediaSharingSettings::SetActivationSettingL( MusSettingsKeys::EActiveInHomeNetworks ); + TRAP( error, iConnectionAvailability->DoExecuteL() ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT ( error == KErrNone ); + EUNIT_GET_ALLOC_DECORATOR_FAILCOUNT( count ); + if ( count > 0 && iConnectionAvailability->State() + == MMusAvaObserver::EMusActivationError ) + { + User::Leave( KErrNoMemory ); + } + EUNIT_ASSERT( iConnectionAvailability->State() == MMusAvaObserver::EMusAvaStatusAvailable ); + + //Test4: activation set off + iStorage->SetPhoneNetworkModeStatus( RMobilePhone::ENetworkModeWcdma ); + iStorage->SetRegistrationStatus( RMobilePhone::ERegisteredOnHomeNetwork ); + MultimediaSharingSettings::SetActivationSettingL( MusSettingsKeys::ENever ); + TRAP( error, iConnectionAvailability->DoExecuteL() ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT ( error == KErrNone ); + EUNIT_ASSERT( iConnectionAvailability->State() == MMusAvaObserver::EMusActivationError ); + + // Test5: Edge/Dtm activation settings + // case 1 Dtm mode allowed and atleast one pdp context exist + iStorage->SetPhoneNetworkModeStatus( RMobilePhone::ENetworkModeGsm ); + iStorage->SetRegistrationStatus( RMobilePhone::ERegisteredOnHomeNetwork ); + MultimediaSharingSettings::SetActivationSettingL( MusSettingsKeys::EAlwaysActive ); + MultimediaSharingSettings::SetEdgeDtmSupportSettingL( MusSettingsKeys::EDtmModeAllowed ); + CMusAvaConnectionMonitor& avaConnectionMonitor = iSharedObject->ConnectionMonitor(); + avaConnectionMonitor.iConnectionMonitor.iConnectionId = 1; + avaConnectionMonitor.iConnectionMonitor.iConnectionCounter = 1; + avaConnectionMonitor.iConnectionMonitor.iUintAttributeValue = 1; + avaConnectionMonitor.iConnectionMonitor.iConnectionInfoError = KErrNone; + TRAP( error, iConnectionAvailability->DoExecuteL() ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT ( error == KErrNone ); + EUNIT_GET_ALLOC_DECORATOR_FAILCOUNT( count ); + if ( count > 0 && iConnectionAvailability->State() + == MMusAvaObserver::EMusActivationError ) + { + User::Leave( KErrNoMemory ); + } + EUNIT_ASSERT( iConnectionAvailability->State() == MMusAvaObserver::EMusAvaStatusAvailable ); + + // Test5: Edge DTM is allowed but no pdp context + // case 2 Dtm mode allowed and no pdp context exist + iStorage->SetPhoneNetworkModeStatus( RMobilePhone::ENetworkModeGsm ); + iStorage->SetRegistrationStatus( RMobilePhone::ERegisteredOnHomeNetwork ); + MultimediaSharingSettings::SetActivationSettingL( MusSettingsKeys::EAlwaysActive ); + MultimediaSharingSettings::SetEdgeDtmSupportSettingL( MusSettingsKeys::EDtmModeAllowed ); + avaConnectionMonitor.iConnectionMonitor.iConnectionId = 1; + avaConnectionMonitor.iConnectionMonitor.iConnectionCounter = 0; + avaConnectionMonitor.iConnectionMonitor.iUintAttributeValue = 1; + avaConnectionMonitor.iConnectionMonitor.iConnectionInfoError = KErrNone; + TRAP( error, iConnectionAvailability->DoExecuteL() ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT ( error == KErrNone ); + EUNIT_GET_ALLOC_DECORATOR_FAILCOUNT( count ); + if ( count > 0 && iConnectionAvailability->State() + == MMusAvaObserver::EMusActivationError ) + { + User::Leave( KErrNoMemory ); + } + EUNIT_ASSERT( iConnectionAvailability->State() == MMusAvaObserver::EMusAvaEdgeDtmStatusUnknown ); + + // Test6: case 2 Dtm mode not allowed + iStorage->SetPhoneNetworkModeStatus( RMobilePhone::ENetworkModeGsm ); + iStorage->SetRegistrationStatus( RMobilePhone::ERegisteredOnHomeNetwork ); + MultimediaSharingSettings::SetActivationSettingL( MusSettingsKeys::EAlwaysActive ); + MultimediaSharingSettings::SetEdgeDtmSupportSettingL( MusSettingsKeys::EDtmModeNotAllowed ); + TRAP( error, iConnectionAvailability->DoExecuteL() ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT ( error == KErrNone ); + EUNIT_GET_ALLOC_DECORATOR_FAILCOUNT( count ); + if ( count > 0 && iConnectionAvailability->State() + == MMusAvaObserver::EMusActivationError ) + { + User::Leave( KErrNoMemory ); + } + EUNIT_ASSERT( iConnectionAvailability->State() == MMusAvaObserver::EMusAvaNetworkType ); + + // Reset the Central Reppository to the default value to avoid + // poluting common storage. + + iStorage->Set ( MusSettingsKeys::KAllowOnlyIn3GNetwork, + MusSettingsKeys::EAllowedAllBearers ); + } + +void UT_CMusAvaConnectionAvailability::UT_CMusAvaConnectionAvailability_NameL() + { + EUNIT_ASSERT( iConnectionAvailability->Name() == MMusAvaObserver::EMusAvaBearerStatus ); + } + +void UT_CMusAvaConnectionAvailability::UT_CMusAvaConnectionAvailability_StopL() + { + iConnectionAvailability->Stop(); + EUNIT_ASSERT( iSharedObject->MusAvaTelephonyStatus().iObserver.Count() == 0 ); + } + +void UT_CMusAvaConnectionAvailability::UT_CMusAvaConnectionAvailability_PhoneNetworkModeStatusL() + { + //Test1: VS by default would allow all type of Networks. + // Unknow Network Type : Allowed + iConnectionAvailability->PhoneNetworkModeStatus( RMobilePhone::ENetworkModeUnknown ); + TInt count = 0; + EUNIT_GET_ALLOC_DECORATOR_FAILCOUNT( count ); + if ( count > 0 && ( iConnectionAvailability->State() == MMusAvaObserver::EMusActivationError ) || + (iConnectionAvailability->State() == MMusAvaObserver::EMusAvaNetworkType )) + { + User::Leave( KErrNoMemory ); + } + EUNIT_ASSERT( iConnectionAvailability->iState == MMusAvaObserver::EMusAvaStatusAvailable ); + + //GSM Network is Allowed: + iConnectionAvailability->PhoneNetworkModeStatus( RMobilePhone::ENetworkModeGsm ); + + count = 0; + EUNIT_GET_ALLOC_DECORATOR_FAILCOUNT( count ); + if ( count > 0 && ( iConnectionAvailability->State() == MMusAvaObserver::EMusActivationError ) || + (iConnectionAvailability->State() == MMusAvaObserver::EMusAvaNetworkType )) + { + User::Leave( KErrNoMemory ); + } + + EUNIT_ASSERT( iConnectionAvailability->iState == MMusAvaObserver::EMusAvaStatusAvailable ); + + //WCDMA: 3G is Allowed + iConnectionAvailability->PhoneNetworkModeStatus( RMobilePhone::ENetworkModeWcdma ); + MMusAvaObserver::TAvailabilityStatus state = MMusAvaObserver::EMusAvaStatusNotExecuted; + state = iConnectionAvailability->State(); + count = 0; + EUNIT_GET_ALLOC_DECORATOR_FAILCOUNT( count ); + if ( count > 0 && (state == MMusAvaObserver::EMusActivationError ) || + ( state == MMusAvaObserver::EMusAvaNetworkType )) + { + User::Leave( KErrNoMemory ); + } + EUNIT_ASSERT( state == MMusAvaObserver::EMusAvaStatusAvailable ); + + //Test2: Restrict VS to be only used in 3G + iStorage->Set ( MusSettingsKeys::KAllowOnlyIn3GNetwork, + MusSettingsKeys::EAllowed3GOnly ); + + //Unknown Network DisAllowed + iConnectionAvailability->PhoneNetworkModeStatus( RMobilePhone::ENetworkModeUnknown ); + EUNIT_ASSERT( iConnectionAvailability->iState == MMusAvaObserver::EMusAvaNetworkType ); + + //GSM Network is Dis-Allowed: + iConnectionAvailability->PhoneNetworkModeStatus( RMobilePhone::ENetworkModeGsm ); + EUNIT_ASSERT( iConnectionAvailability->iState == MMusAvaObserver::EMusAvaNetworkType ); + + + //3G is Allowed: + iConnectionAvailability->PhoneNetworkModeStatus( RMobilePhone::ENetworkModeWcdma ); + MMusAvaObserver::TAvailabilityStatus state1 = MMusAvaObserver::EMusAvaStatusNotExecuted; + state1 = iConnectionAvailability->State(); + TInt count1 = 0; + EUNIT_GET_ALLOC_DECORATOR_FAILCOUNT( count ); + if ( count1 > 0 && state1 == MMusAvaObserver::EMusActivationError ) + { + User::Leave( KErrNoMemory ); + } + EUNIT_ASSERT( state1 == MMusAvaObserver::EMusAvaStatusAvailable ); + + //Reset the key to the default value. + iStorage->Set ( MusSettingsKeys::KAllowOnlyIn3GNetwork, + MusSettingsKeys::EAllowedAllBearers ); + } + +void UT_CMusAvaConnectionAvailability::UT_CMusAvaConnectionAvailability_NetworkRegistrationStatusL() + { + MultimediaSharingSettings::SetActivationSettingL( MusSettingsKeys::EActiveInHomeNetworks ); + iConnectionAvailability->iState = MMusAvaObserver::EMusAvaStatusAvailable; + iConnectionAvailability->NetworkRegistrationStatus( RMobilePhone::ERegistrationUnknown ); + MultimediaSharingSettings::SetActivationSettingL( MusSettingsKeys::EAlwaysActive ); + TInt count = 0; + EUNIT_GET_ALLOC_DECORATOR_FAILCOUNT( count ); + if ( count > 0 && iConnectionAvailability->iState + == MMusAvaObserver::EMusActivationError ) + { + User::Leave( KErrNoMemory ); + } + EUNIT_ASSERT( iConnectionAvailability->iState == MMusAvaObserver::EMusAvaRoamingError ); + iConnectionAvailability->iState = MMusAvaObserver::EMusAvaStatusAvailable; + MultimediaSharingSettings::SetActivationSettingL( MusSettingsKeys::EActiveInHomeNetworks ); + iConnectionAvailability->NetworkRegistrationStatus( RMobilePhone::ERegisteredOnHomeNetwork ); + EUNIT_GET_ALLOC_DECORATOR_FAILCOUNT( count ); + if ( count > 0 && iConnectionAvailability->iState + == MMusAvaObserver::EMusActivationError ) + { + User::Leave( KErrNoMemory ); + } + EUNIT_ASSERT( iConnectionAvailability->iState == MMusAvaObserver::EMusAvaStatusAvailable ); + } + +void UT_CMusAvaConnectionAvailability::UT_CMusAvaConnectionAvailability_EventLL() + { + MultimediaSharingSettings::SetActivationSettingL( MusSettingsKeys::EAlwaysActive ); + CMusAvaConnectionMonitor& avaConnectionMonitor = iSharedObject->ConnectionMonitor(); + avaConnectionMonitor.iConnectionMonitor.iConnectionId = 1; + avaConnectionMonitor.iConnectionMonitor.iConnectionCounter = 1; + avaConnectionMonitor.iConnectionMonitor.iUintAttributeValue = 1; + avaConnectionMonitor.iConnectionMonitor.iConnectionInfoError = KErrNone; + + //Test create connection + //Access point + MultimediaSharingSettings::SetSipProfileSettingL( 1 ); + //IAP + avaConnectionMonitor.iConnectionID = 0; + CConnMonCreateConnection* createConnection = + new( ELeave ) CConnMonCreateConnection( 1 ); + CleanupStack::PushL( createConnection ); + iConnectionAvailability->EventL( *createConnection ); + CleanupStack::PopAndDestroy( createConnection ); + EUNIT_ASSERT( avaConnectionMonitor.iConnectionMonitor.iConnectionId == 1 ); + //Connection is created + avaConnectionMonitor.iConnectionMonitor.iConnectionId = 1; + createConnection = + new( ELeave ) CConnMonCreateConnection( 2 ); + CleanupStack::PushL( createConnection ); + iConnectionAvailability->EventL( *createConnection ); + CleanupStack::PopAndDestroy( createConnection ); + EUNIT_ASSERT( avaConnectionMonitor.iConnectionMonitor.iConnectionId == 1 ); + avaConnectionMonitor.iConnectionID = 0; + //PDP context deleted, before is created + createConnection = + new( ELeave ) CConnMonCreateConnection( 1 ); + CleanupStack::PushL( createConnection ); + avaConnectionMonitor.iConnectionMonitor.iConnectionInfoError = KErrNotFound; + iConnectionAvailability->EventL( *createConnection ); + EUNIT_ASSERT( iConnectionAvailability->State() == + MMusAvaObserver::EMusAvaConnectionErr ); + CleanupStack::PopAndDestroy( createConnection ); + avaConnectionMonitor.iConnectionMonitor.iConnectionInfoError = KErrNone; + + //Test delete connection ///////////////////////////////////////////////////// + CConnMonDeleteConnection* deleteConnection = + new( ELeave ) CConnMonDeleteConnection( 1, 64, 64, ETrue ); + CleanupStack::PushL( deleteConnection ); + iConnectionAvailability->EventL( *deleteConnection ); + EUNIT_ASSERT( iConnectionAvailability->State() == + MMusAvaObserver::EMusAvaConnectionErr ); + EUNIT_ASSERT( iAvailabilityObserver->iStatus == + MMusAvaObserver::EMusAvaConnectionErr ); + CleanupStack::PopAndDestroy( deleteConnection ); + iAvailabilityObserver->iStatus = MMusAvaObserver::EMusAvaStatusNotExecuted ; + iAvailabilityObserver->iName = MMusAvaObserver::EMusAvaNameNotDefined; + iConnectionAvailability->SetState( + MMusAvaObserver::EMusAvaStatusNotExecuted ); + ; + //Connection ID not found + CConnMonDeleteConnection* deleteConnection2 = + new( ELeave ) CConnMonDeleteConnection( 3 , 64, 64, ETrue ); + CleanupStack::PushL( deleteConnection2 ); + iConnectionAvailability->EventL( *deleteConnection2 ); + //Initial value or previous values + EUNIT_ASSERT( iConnectionAvailability->State() == + MMusAvaObserver::EMusAvaStatusNotExecuted ); + EUNIT_ASSERT( iAvailabilityObserver->iStatus == + MMusAvaObserver::EMusAvaStatusNotExecuted ); + CleanupStack::PopAndDestroy( deleteConnection2 ); + iAvailabilityObserver->iStatus = MMusAvaObserver::EMusAvaStatusNotExecuted; + iConnectionAvailability->SetState( + MMusAvaObserver::EMusAvaStatusNotExecuted ); + + // Connection Status Change /////////////////////////////////////////////// + + //Connection status found, but no connection + CConnMonConnectionStatusChange* connectionStatusChange = + new( ELeave ) CConnMonConnectionStatusChange( 2, 1, KConnectionFailure ); + CleanupStack::PushL( connectionStatusChange ); + iConnectionAvailability->EventL( *connectionStatusChange ); + CleanupStack::PopAndDestroy( connectionStatusChange ); + EUNIT_ASSERT( iAvailabilityObserver->iStatus == + MMusAvaObserver::EMusAvaStatusNotExecuted ); + + //Connection status and connection ID are found + avaConnectionMonitor.iConnectionID = 1; + connectionStatusChange = + new( ELeave ) CConnMonConnectionStatusChange( 1, 1, KConnectionFailure ); + CleanupStack::PushL( connectionStatusChange ); + iConnectionAvailability->EventL( *connectionStatusChange ); + CleanupStack::PopAndDestroy( connectionStatusChange ); + EUNIT_ASSERT( iAvailabilityObserver->iStatus == + MMusAvaObserver::EMusAvaConnectionErr ); + iConnectionAvailability->SetState( + MMusAvaObserver::EMusAvaStatusNotExecuted ); + iAvailabilityObserver->iStatus = + MMusAvaObserver::EMusAvaStatusNotExecuted; + //Connection status and connection ID are not found + connectionStatusChange = new( ELeave ) CConnMonConnectionStatusChange( + 2, 1, KConfigDaemonFinishedDeregistrationStop ); + + CleanupStack::PushL( connectionStatusChange ); + iConnectionAvailability->EventL( *connectionStatusChange ); + CleanupStack::PopAndDestroy( connectionStatusChange ); + EUNIT_ASSERT( iAvailabilityObserver->iStatus == + MMusAvaObserver::EMusAvaStatusNotExecuted ); + + //Connection status is not found, but connection ID is found + connectionStatusChange = + new( ELeave ) CConnMonConnectionStatusChange( 1, 1, KConfigDaemonFinishedDeregistrationStop ); + CleanupStack::PushL( connectionStatusChange ); + iConnectionAvailability->EventL( *connectionStatusChange ); + CleanupStack::PopAndDestroy( connectionStatusChange ); + EUNIT_ASSERT( iAvailabilityObserver->iStatus == + MMusAvaObserver::EMusAvaStatusNotExecuted ); + + //Connection created, but connection ID is not found + connectionStatusChange = + new( ELeave ) CConnMonConnectionStatusChange( 2, 1, KConnectionOpen ); + CleanupStack::PushL( connectionStatusChange ); + iConnectionAvailability->EventL( *connectionStatusChange ); + CleanupStack::PopAndDestroy( connectionStatusChange ); + EUNIT_ASSERT( iAvailabilityObserver->iStatus == + MMusAvaObserver::EMusAvaStatusNotExecuted ); + //Connection created, but connection ID is found + connectionStatusChange = + new( ELeave ) CConnMonConnectionStatusChange( 1, 1, KConnectionOpen ); + CleanupStack::PushL( connectionStatusChange ); + iConnectionAvailability->EventL( *connectionStatusChange ); + CleanupStack::PopAndDestroy( connectionStatusChange ); + EUNIT_ASSERT( iAvailabilityObserver->iStatus == + MMusAvaObserver::EMusAvaStatusAvailable ); + //Test network status //////////////////////////////////////////////////// + CConnMonNetworkStatusChange* networkStatusChange = + new( ELeave ) CConnMonNetworkStatusChange( EBearerIdWCDMA, EConnMonStatusActive ); + CleanupStack::PushL( networkStatusChange ); + iConnectionAvailability->EventL( *networkStatusChange ); + EUNIT_ASSERT( iConnectionAvailability->State() == + MMusAvaObserver::EMusAvaStatusAvailable ); + CleanupStack::PopAndDestroy( networkStatusChange ); + + networkStatusChange = + new( ELeave ) CConnMonNetworkStatusChange( EBearerIdWCDMA, EConnMonStatusNotAvailable ); + CleanupStack::PushL( networkStatusChange ); + iConnectionAvailability->EventL( *networkStatusChange ); + EUNIT_ASSERT( iAvailabilityObserver->iStatus == + MMusAvaObserver::EMusAvaConnectionErr ); + CleanupStack::PopAndDestroy( networkStatusChange ); + iAvailabilityObserver->iStatus = + MMusAvaObserver::EMusAvaStatusNotExecuted; + iAvailabilityObserver->iName = MMusAvaObserver::EMusAvaNameNotDefined; + iConnectionAvailability->SetState( + MMusAvaObserver::EMusAvaStatusNotExecuted ); + + + //Network status not available + CConnMonNetworkStatusChange* networkStatusChange4 = + new( ELeave ) CConnMonNetworkStatusChange( 3, EConnMonStatusNotAvailable ); + CleanupStack::PushL( networkStatusChange4 ); + iConnectionAvailability->EventL( *networkStatusChange4 ); + EUNIT_ASSERT( iConnectionAvailability->State() == + MMusAvaObserver::EMusAvaStatusNotExecuted ); + EUNIT_ASSERT( iAvailabilityObserver->iStatus == + MMusAvaObserver::EMusAvaStatusNotExecuted ); + CleanupStack::PopAndDestroy( networkStatusChange4 ); + iAvailabilityObserver->iStatus = + MMusAvaObserver::EMusAvaStatusNotExecuted; + iAvailabilityObserver->iName = MMusAvaObserver::EMusAvaNameNotDefined; + + //Test network Registration /////////////////////////////////////////////// + iConnectionAvailability->SetState( + MMusAvaObserver::EMusAvaStatusAvailable ); + CConnMonNetworkRegistrationChange* registrationChange = + new( ELeave ) CConnMonNetworkRegistrationChange( EBearerIdWCDMA, + ENetworkRegistrationHomeNetwork ); + CleanupStack::PushL( registrationChange ); + iConnectionAvailability->EventL( *registrationChange ); + EUNIT_ASSERT( iConnectionAvailability->State() == + MMusAvaObserver::EMusAvaStatusAvailable ); + CleanupStack::PopAndDestroy( registrationChange ); + iAvailabilityObserver->iStatus = + MMusAvaObserver::EMusAvaStatusNotExecuted; + iAvailabilityObserver->iName = MMusAvaObserver::EMusAvaNameNotDefined; + iConnectionAvailability->SetState( + MMusAvaObserver::EMusAvaStatusAvailable ); + + registrationChange = new( ELeave ) CConnMonNetworkRegistrationChange( + EBearerIdWCDMA, + ENetworkRegistrationRoaming ); + CleanupStack::PushL( registrationChange ); + iConnectionAvailability->EventL( *registrationChange ); + EUNIT_ASSERT( iConnectionAvailability->State() == + MMusAvaObserver::EMusAvaRoamingError ); + CleanupStack::PopAndDestroy( registrationChange ); + EUNIT_ASSERT( iAvailabilityObserver->iStatus == + MMusAvaObserver::EMusAvaRoamingError ); + iAvailabilityObserver->iStatus = + MMusAvaObserver::EMusAvaStatusNotExecuted; + iAvailabilityObserver->iName = MMusAvaObserver::EMusAvaNameNotDefined; + + //Test bearer change/////////////////////////////////////////////////////// + + CConnMonBearerChange* bearerChange = + new( ELeave ) CConnMonBearerChange( EBearerIdWCDMA, EBearerWCDMA ); + CleanupStack::PushL( bearerChange ); + iConnectionAvailability->EventL( *bearerChange ); + EUNIT_ASSERT( iConnectionAvailability->State() == + MMusAvaObserver::EMusAvaStatusAvailable ); + EUNIT_ASSERT( iAvailabilityObserver->iStatus == + MMusAvaObserver::EMusAvaStatusAvailable ); + CleanupStack::PopAndDestroy( bearerChange ); + iAvailabilityObserver->iStatus = + MMusAvaObserver::EMusAvaStatusNotExecuted; + iAvailabilityObserver->iName = MMusAvaObserver::EMusAvaNameNotDefined; + + //Unknown unknown bearer change + bearerChange = + new( ELeave ) CConnMonBearerChange( EBearerIdGSM, EBearerGPRS ); + CleanupStack::PushL( bearerChange ); + iConnectionAvailability->EventL( *bearerChange ); + EUNIT_ASSERT( iConnectionAvailability->State() == + MMusAvaObserver::EMusAvaNetworkType ); + EUNIT_ASSERT( iAvailabilityObserver->iStatus == + MMusAvaObserver::EMusAvaNetworkType ); + CleanupStack::PopAndDestroy( bearerChange ); + iAvailabilityObserver->iStatus = + MMusAvaObserver::EMusAvaStatusNotExecuted; + iAvailabilityObserver->iName = MMusAvaObserver::EMusAvaNameNotDefined; + } + +void UT_CMusAvaConnectionAvailability::UT_CMusAvaConnectionAvailability_NetworkRegistrationAndSettingsLL() + { + iStorage->Clear(); + MultimediaSharingSettings::SetOperatorVariantSettingL( MusSettingsKeys::EOperatorSpecific ); + iStorage->SetPhoneNetworkModeStatus( RMobilePhone::ENetworkModeWcdma ); + MultimediaSharingSettings::SetActivationSettingL( MusSettingsKeys:: ENever ); + EUNIT_ASSERT( iConnectionAvailability->NetworkRegistrationAndSettingsL() + == MMusAvaObserver::EMusActivationError ); + + iStorage->Clear(); + iStorage->SetPhoneNetworkModeStatus( RMobilePhone::ENetworkModeWcdma ); + MultimediaSharingSettings::SetActivationSettingL( MusSettingsKeys:: ENever ); + EUNIT_ASSERT( iConnectionAvailability->NetworkRegistrationAndSettingsL() + == MMusAvaObserver::EMusActivationError ); + + iStorage->Clear(); + iStorage->SetPhoneNetworkModeStatus( RMobilePhone::ENetworkModeUnknown ); + iStorage->SetRegistrationStatus( RMobilePhone::ERegistrationUnknown ); + EUNIT_ASSERT( iConnectionAvailability->NetworkRegistrationAndSettingsL() + == MMusAvaObserver::EMusActivationError ); + + iStorage->Clear(); + iStorage->SetPhoneNetworkModeStatus( RMobilePhone::ENetworkModeWcdma ); + iStorage->SetRegistrationStatus( RMobilePhone::ERegisteredOnHomeNetwork ); + MultimediaSharingSettings::SetActivationSettingL( MusSettingsKeys::ENever ); + EUNIT_ASSERT( iConnectionAvailability->NetworkRegistrationAndSettingsL() + == MMusAvaObserver::EMusActivationError ); + + iStorage->SetPhoneNetworkModeStatus( RMobilePhone::ENetworkModeWcdma ); + iStorage->SetRegistrationStatus( RMobilePhone::ERegistrationUnknown ); + MultimediaSharingSettings::SetActivationSettingL( MusSettingsKeys::EAlwaysActive ); + EUNIT_ASSERT( iConnectionAvailability->NetworkRegistrationAndSettingsL() + == MMusAvaObserver::EMusAvaStatusAvailable ); + + iStorage->SetPhoneNetworkModeStatus( RMobilePhone::ENetworkModeWcdma ); + iStorage->SetRegistrationStatus( RMobilePhone::ERegistrationUnknown ); + MultimediaSharingSettings::SetActivationSettingL( MusSettingsKeys::EActiveInHomeNetworks ); + EUNIT_ASSERT( iConnectionAvailability->NetworkRegistrationAndSettingsL() + == MMusAvaObserver::EMusActivationError ); + + iStorage->SetPhoneNetworkModeStatus( RMobilePhone::ENetworkModeWcdma ); + iStorage->SetRegistrationStatus( RMobilePhone::ERegisteredOnHomeNetwork ); + MultimediaSharingSettings::SetActivationSettingL( MusSettingsKeys::ENever ); + EUNIT_ASSERT( iConnectionAvailability->NetworkRegistrationAndSettingsL() + == MMusAvaObserver::EMusActivationError ); + + iStorage->SetPhoneNetworkModeStatus( RMobilePhone::ENetworkModeWcdma ); + iStorage->SetRegistrationStatus( RMobilePhone::ERegisteredOnHomeNetwork ); + MultimediaSharingSettings::SetActivationSettingL( MusSettingsKeys::EActiveInHomeNetworks ); + EUNIT_ASSERT( iConnectionAvailability->NetworkRegistrationAndSettingsL() + == MMusAvaObserver::EMusAvaStatusAvailable ); + + iStorage->SetPhoneNetworkModeStatus( RMobilePhone::ENetworkModeWcdma ); + iStorage->SetRegistrationStatus( RMobilePhone::ERegisteredOnHomeNetwork ); + MultimediaSharingSettings::SetActivationSettingL( MusSettingsKeys::EAlwaysActive ); + EUNIT_ASSERT( iConnectionAvailability->NetworkRegistrationAndSettingsL() + == MMusAvaObserver::EMusAvaStatusAvailable ); + + iStorage->SetPhoneNetworkModeStatus( RMobilePhone::ENetworkModeWcdma ); + iStorage->SetRegistrationStatus( RMobilePhone::ERegisteredRoaming ); + iConcreteSettings->SetManualActivation( MMusAvaSettings::EActivationAllowed); + MultimediaSharingSettings::SetActivationSettingL( MusSettingsKeys::EAlwaysActive ); + EUNIT_ASSERT( iConnectionAvailability->NetworkRegistrationAndSettingsL() + == MMusAvaObserver::EMusAvaStatusAvailable ); + + iStorage->SetPhoneNetworkModeStatus( RMobilePhone::ENetworkModeWcdma ); + iStorage->SetRegistrationStatus( RMobilePhone::ERegisteredOnHomeNetwork ); + iConcreteSettings->SetManualActivation( MMusAvaSettings::EActivationAllowed); + MultimediaSharingSettings::SetActivationSettingL( MusSettingsKeys::EAlwaysActive ); + EUNIT_ASSERT( iConnectionAvailability->NetworkRegistrationAndSettingsL() + == MMusAvaObserver::EMusAvaStatusAvailable ); + + + iStorage->SetPhoneNetworkModeStatus( RMobilePhone::ENetworkModeWcdma ); + iStorage->SetRegistrationStatus( RMobilePhone::ERegisteredRoaming ); + MultimediaSharingSettings::SetActivationSettingL( MusSettingsKeys::EAlwaysActive ); + EUNIT_ASSERT( iConnectionAvailability->NetworkRegistrationAndSettingsL() + == MMusAvaObserver::EMusAvaStatusAvailable ); + + iStorage->SetPhoneNetworkModeStatus( RMobilePhone::ENetworkModeWcdma ); + iStorage->SetRegistrationStatus( RMobilePhone::ERegisteredOnHomeNetwork ); + iConcreteSettings->SetManualActivation( MMusAvaSettings::EActivationAllowed); + MultimediaSharingSettings::SetActivationSettingL( MusSettingsKeys::EAlwaysActive ); + EUNIT_ASSERT( iConnectionAvailability->NetworkRegistrationAndSettingsL() + == MMusAvaObserver::EMusAvaStatusAvailable ); + + iStorage->SetPhoneNetworkModeStatus( RMobilePhone::ENetworkModeWcdma ); + iStorage->SetRegistrationStatus( RMobilePhone::ERegisteredRoaming ); + iConcreteSettings->SetManualActivation( MMusAvaSettings::EActivationExecuted); + MultimediaSharingSettings::SetActivationSettingL( MusSettingsKeys::EAlwaysActive ); + EUNIT_ASSERT( iConnectionAvailability->NetworkRegistrationAndSettingsL() + == MMusAvaObserver::EMusAvaStatusAvailable ); + + iStorage->SetPhoneNetworkModeStatus( RMobilePhone::ENetworkModeWcdma ); + iStorage->SetRegistrationStatus( RMobilePhone::ERegisteredRoaming ); + iConcreteSettings->SetManualActivation( MMusAvaSettings::EActivationExecuted); + MultimediaSharingSettings::SetActivationSettingL( MusSettingsKeys::EActiveInHomeNetworks ); + EUNIT_ASSERT( iConnectionAvailability->NetworkRegistrationAndSettingsL() + == MMusAvaObserver::EMusActivationError ); + + MultimediaSharingSettings::SetOperatorVariantSettingL( MusSettingsKeys::EStandard ); + iStorage->SetPhoneNetworkModeStatus( RMobilePhone::ENetworkModeWcdma ); + iStorage->SetRegistrationStatus( RMobilePhone::ERegisteredRoaming ); + iConcreteSettings->SetManualActivation( MMusAvaSettings::EActivationNotExecuted); + MultimediaSharingSettings::SetActivationSettingL( MusSettingsKeys::EActiveInHomeNetworks ); + EUNIT_ASSERT( iConnectionAvailability->NetworkRegistrationAndSettingsL() + == MMusAvaObserver::EMusAvaManualActivation ); + + MultimediaSharingSettings::SetOperatorVariantSettingL( MusSettingsKeys::EStandard ); + iStorage->SetPhoneNetworkModeStatus( RMobilePhone::ENetworkModeWcdma ); + iStorage->SetRegistrationStatus( RMobilePhone::ERegisteredRoaming ); + iConcreteSettings->SetManualActivation( MMusAvaSettings::EActivationAllowed); + MultimediaSharingSettings::SetActivationSettingL( MusSettingsKeys::EAlwaysActive ); + EUNIT_ASSERT( iConnectionAvailability->NetworkRegistrationAndSettingsL() + == MMusAvaObserver::EMusAvaStatusAvailable ); + + MultimediaSharingSettings::SetOperatorVariantSettingL( MusSettingsKeys::EStandard ); + iStorage->SetPhoneNetworkModeStatus( RMobilePhone::ENetworkModeWcdma ); + iStorage->SetRegistrationStatus( RMobilePhone::ERegisteredRoaming ); + iConcreteSettings->SetManualActivation( MMusAvaSettings::EActivationNotAllowed); + MultimediaSharingSettings::SetActivationSettingL( MusSettingsKeys::EAlwaysActive ); + EUNIT_ASSERT( iConnectionAvailability->NetworkRegistrationAndSettingsL() + == MMusAvaObserver::EMusAvaStatusAvailable ); + + MultimediaSharingSettings::SetOperatorVariantSettingL( MusSettingsKeys::EStandard ); + iStorage->SetPhoneNetworkModeStatus( RMobilePhone::ENetworkModeWcdma ); + iStorage->SetRegistrationStatus( RMobilePhone::ERegisteredRoaming ); + iConcreteSettings->SetManualActivation( MMusAvaSettings::EActivationNotAllowed); + MultimediaSharingSettings::SetActivationSettingL( MusSettingsKeys::EActiveInHomeNetworks ); + EUNIT_ASSERT( iConnectionAvailability->NetworkRegistrationAndSettingsL() + == MMusAvaObserver::EMusActivationError ); + + MultimediaSharingSettings::SetOperatorVariantSettingL( MusSettingsKeys::EStandard ); + iStorage->SetPhoneNetworkModeStatus( RMobilePhone::ENetworkModeWcdma ); + iStorage->SetRegistrationStatus( RMobilePhone::ERegisteredRoaming ); + iConcreteSettings->SetManualActivation( MMusAvaSettings::EActivationNotExecuted); + MultimediaSharingSettings::SetActivationSettingL( MusSettingsKeys::EActiveInHomeNetworks ); + EUNIT_ASSERT( iConnectionAvailability->NetworkRegistrationAndSettingsL() + == MMusAvaObserver::EMusAvaManualActivation ); + + MultimediaSharingSettings::SetOperatorVariantSettingL( MusSettingsKeys::EStandard ); + iStorage->SetPhoneNetworkModeStatus( RMobilePhone::ENetworkModeWcdma ); + iStorage->SetRegistrationStatus( RMobilePhone::ERegisteredRoaming ); + iConcreteSettings->SetManualActivation( MMusAvaSettings::EActivationAllowed); + MultimediaSharingSettings::SetActivationSettingL( MusSettingsKeys::EActiveInHomeNetworks ); + EUNIT_ASSERT( iConnectionAvailability->NetworkRegistrationAndSettingsL() + == MMusAvaObserver::EMusAvaStatusAvailable ); + } + + +void UT_CMusAvaConnectionAvailability::UT_CMusAvaConnectionAvailability_ManualActivationLL() + { + MultimediaSharingSettings::SetOperatorVariantSettingL( MusSettingsKeys::EOperatorSpecific ); + EUNIT_ASSERT( iConnectionAvailability->ManualActivationL() == MMusAvaObserver::EMusActivationError ); + + MultimediaSharingSettings::SetOperatorVariantSettingL( MusSettingsKeys::EStandard ); + iConcreteSettings->SetManualActivation( MMusAvaSettings::EActivationAllowed); + EUNIT_ASSERT( iConnectionAvailability->ManualActivationL() == MMusAvaObserver::EMusAvaStatusAvailable ); + + iConcreteSettings->SetManualActivation( MMusAvaSettings::EActivationNotExecuted ); + EUNIT_ASSERT( iConnectionAvailability->ManualActivationL() == MMusAvaObserver::EMusAvaManualActivation ); + + iConcreteSettings->SetManualActivation( MMusAvaSettings::EActivationExecuted ); + EUNIT_ASSERT( iConnectionAvailability->ManualActivationL() == MMusAvaObserver::EMusActivationError ); + } + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusAvaConnectionAvailability, + "CMusAvaConnectionAvailability", + "UNIT" ) + +EUNIT_TEST( + "NewL - test ", + "CMusAvaConnectionAvailability", + "NewL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaConnectionAvailability_NewLL, Teardown) + +EUNIT_TEST( + "DoExecuteL - test ", + "CMusAvaConnectionAvailability", + "DoExecuteL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaConnectionAvailability_DoExecuteLL, Teardown) + +EUNIT_TEST( + "DoExecuteL - test 3G Restricted", + "CMusAvaConnectionAvailability", + "DoExecuteL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaConnectionAvailability_DoExecuteLL2, Teardown) + + +EUNIT_TEST( + "Name - test ", + "CMusAvaConnectionAvailability", + "Name", + "FUNCTIONALITY", + SetupL, UT_CMusAvaConnectionAvailability_NameL, Teardown) + +EUNIT_TEST( + "Stop - test ", + "CMusAvaConnectionAvailability", + "Stop", + "FUNCTIONALITY", + SetupL, UT_CMusAvaConnectionAvailability_StopL, Teardown) + + + EUNIT_TEST( + "PhoneNetworkModeStatusL - test ", + "CMusAvaConnectionAvailability", + "PhoneNetworkModeStatusL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaConnectionAvailability_PhoneNetworkModeStatusL, Teardown) + + EUNIT_TEST( + "NetworkRegistrationStatus - test ", + "CMusAvaConnectionAvailability", + "NetworkRegistrationStatus", + "FUNCTIONALITY", + SetupL, UT_CMusAvaConnectionAvailability_NetworkRegistrationStatusL, Teardown) + + EUNIT_TEST( + "EventL - test ", + "CMusAvaConnectionAvailability", + "EventL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaConnectionAvailability_EventLL, Teardown) + + +EUNIT_TEST( + "NetworkRegistrationAndSettingsL - test ", + "CMusAvaConnectionAvailability", + "NetworkRegistrationAndSettingsL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaConnectionAvailability_NetworkRegistrationAndSettingsLL, Teardown) + +EUNIT_TEST( + "ManualActivationL - test ", + "CMusAvaConnectionAvailability", + "ManualActivationL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaConnectionAvailability_ManualActivationLL, Teardown) + +EUNIT_END_TEST_TABLE + +// END OF FILE diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaConnectionMonitor.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaConnectionMonitor.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,295 @@ +/* +* 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: +* +*/ + + +// CLASS HEADER +#include "sipprofile.h" +#include "UT_CMusAvaConnectionMonitor.h" +#include "musavaavailability.h" +#include "muslogger.h" +#include "musavaobserver.h" +#include "musavaobserverimp.h" +#include "musavadefaultimp.h" +#include "musavaobserverimp.h" +#include "musavasettingsimp.h" +#include "musavasharedobject.h" +#include "musavasip.h" +#include "musavaconnectionMonitorobserverimp.h" +#include "mussettingskeys.h" +#include "mussettings.h" +#include "musavacapabilitytesthelper.h" //remove compilation warning +#include "CSipSseTestTls.h" + + +// EXTERNAL INCLUDES +#include "sipprofile.h" +#include +#include +#include +//#include + + +// INTERNAL INCLUDES +#include "musavaconnectionmonitor.h" + + + +// CONSTRUCTION +UT_CMusAvaConnectionMonitor* UT_CMusAvaConnectionMonitor::NewL() + { + UT_CMusAvaConnectionMonitor* self = UT_CMusAvaConnectionMonitor::NewLC(); + CleanupStack::Pop(); + + return self; + } + +UT_CMusAvaConnectionMonitor* UT_CMusAvaConnectionMonitor::NewLC() + { + UT_CMusAvaConnectionMonitor* self = new( ELeave ) UT_CMusAvaConnectionMonitor(); + CleanupStack::PushL( self ); + + self->ConstructL(); + + return self; + } + +// Destructor (virtual by CBase) +UT_CMusAvaConnectionMonitor::~UT_CMusAvaConnectionMonitor() + { + } + +// Default constructor +UT_CMusAvaConnectionMonitor::UT_CMusAvaConnectionMonitor() + { + } + +// Second phase construct +void UT_CMusAvaConnectionMonitor::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + +// METHODS + + + +void UT_CMusAvaConnectionMonitor::SetupL( ) + { + SIPStrings::OpenL(); + CSipSseTestTls::OpenL(); + iSharedObject = CMusAvaSharedObject::GetSingletonL(); + iAvaConnectionMonitor = &iSharedObject->ConnectionMonitor(); + } + +void UT_CMusAvaConnectionMonitor::Teardown( ) + { + CMusAvaSharedObject::DeleteSingleton(); + CSipSseTestTls::Close(); + SIPStrings::Close(); + } + +void UT_CMusAvaConnectionMonitor::UT_CMusAvaConnectionMonitor_NewLL( ) + { + EUNIT_ASSERT( ETrue ); + } + +void UT_CMusAvaConnectionMonitor::UT_CMusAvaConnectionMonitor_EventLL() + { + CConnMonNetworkStatusChange* netStatus = + new( ELeave ) CConnMonNetworkStatusChange( 1, EBearerWCDMA ); + CleanupStack::PushL( netStatus ); + CMMusAvaConnectionMonitorObserverImp* imp1 = CMMusAvaConnectionMonitorObserverImp::NewL(); + CleanupStack::PushL( imp1 ); + iAvaConnectionMonitor->EventL( *netStatus ); + EUNIT_ASSERT( imp1->iConnMonEventBase == NULL ); + iAvaConnectionMonitor->AddAdapterL( *imp1 ); + iAvaConnectionMonitor->EventL(* netStatus ); + EUNIT_ASSERT( &imp1->iConnMonEventBase != NULL ); + CMMusAvaConnectionMonitorObserverImp* imp2 = CMMusAvaConnectionMonitorObserverImp::NewL(); + CleanupStack::PushL( imp2 ); + iAvaConnectionMonitor->AddAdapterL( *imp2 ); + iAvaConnectionMonitor->EventL( *netStatus ); + EUNIT_ASSERT( &imp1->iConnMonEventBase != NULL ); + CleanupStack::PopAndDestroy( imp2 ); + CleanupStack::PopAndDestroy( imp1 ); + CleanupStack::PopAndDestroy( netStatus ); + } + +void UT_CMusAvaConnectionMonitor::UT_CMusAvaConnectionMonitor_AddAdapterLL() + { + CMMusAvaConnectionMonitorObserverImp* imp1 = CMMusAvaConnectionMonitorObserverImp::NewL(); + CleanupStack::PushL( imp1 ); + CMMusAvaConnectionMonitorObserverImp* imp2 = CMMusAvaConnectionMonitorObserverImp::NewL(); + CleanupStack::PushL( imp2 ); + iAvaConnectionMonitor->AddAdapterL( *imp1 ); + iAvaConnectionMonitor->AddAdapterL( *imp2 ); + CleanupStack::PopAndDestroy( imp2 ); + CleanupStack::PopAndDestroy( imp1 ); + } + +void UT_CMusAvaConnectionMonitor::UT_CMusAvaConnectionMonitor_RemoveAdapterL() + { + CMMusAvaConnectionMonitorObserverImp* imp1 = CMMusAvaConnectionMonitorObserverImp::NewL(); + CleanupStack::PushL( imp1 ); + CMMusAvaConnectionMonitorObserverImp* imp2 = CMMusAvaConnectionMonitorObserverImp::NewL(); + CleanupStack::PushL( imp2 ); + iAvaConnectionMonitor->AddAdapterL( *imp1 ); + iAvaConnectionMonitor->AddAdapterL( *imp2 ); + iAvaConnectionMonitor->RemoveAdapter( *imp1 ); + iAvaConnectionMonitor->RemoveAdapter( *imp2 ); + CleanupStack::PopAndDestroy( imp2 ); + CleanupStack::PopAndDestroy( imp1 ); + } +void UT_CMusAvaConnectionMonitor::UT_CMusAvaConnectionMonitor_ConnectionCountL() + { + iAvaConnectionMonitor->iConnectionMonitor.iConnectionCounter = 10; + TUint ret = iAvaConnectionMonitor->ConnectionCount(); + EUNIT_ASSERT( ret == 10 ); + iAvaConnectionMonitor->iConnectionMonitor.iConnectionCounter = 0; + ret = iAvaConnectionMonitor->ConnectionCount(); + EUNIT_ASSERT( ret == 0 ); + } + +void UT_CMusAvaConnectionMonitor::UT_CMusAvaConnectionMonitor_ConnectionIDLL() + { + //No connection + iAvaConnectionMonitor->iConnectionMonitor.iConnectionCounter = 0; + EUNIT_ASSERT( iAvaConnectionMonitor->ConnectionIDL() == 0 ); + //Connection created + iAvaConnectionMonitor->iConnectionMonitor.iConnectionCounter = 1; + EUNIT_ASSERT( !iAvaConnectionMonitor->ConnectionIDL() ); + //Access point found + MultimediaSharingSettings::SetSipProfileSettingL( 1 ); + EUNIT_ASSERT( iAvaConnectionMonitor->ConnectionIDL() == 0 ); + //ConnectionId leavs + iAvaConnectionMonitor->iConnectionMonitor.iConnectionInfoError = KErrNotFound; + TRAPD( error, iAvaConnectionMonitor->ConnectionIDL() ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT( error == KErrNotFound ); + //Connection ID found + iAvaConnectionMonitor->iConnectionMonitor.iConnectionId = 1; + iAvaConnectionMonitor->iConnectionMonitor.iConnectionInfoError = KErrNone; + EUNIT_ASSERT( iAvaConnectionMonitor->ConnectionIDL() == 0); + //IAP doesn't match + iAvaConnectionMonitor->iConnectionMonitor.iUintAttributeValue = 3; + EUNIT_ASSERT( iAvaConnectionMonitor->ConnectionIDL() == 0 ); + //IAP found + iAvaConnectionMonitor->iConnectionMonitor.iUintAttributeValue = 1; + EUNIT_ASSERT( iAvaConnectionMonitor->ConnectionIDL() ); + } + +void UT_CMusAvaConnectionMonitor::UT_CMusAvaConnectionMonitor_MultimediaSharingAccessPointIDL() + { + //No profile + MultimediaSharingSettings::SetSipProfileSettingL( KErrNotFound ); + TInt ret = iAvaConnectionMonitor->MultimediaSharingAccessPointID(); + if ( ret != KErrNotFound ) + { + if ( iSharedObject->MusAvaSip().Profile() ) + { + TBool val; + iSharedObject->MusAvaSip().Profile()->GetParameter( KSIPDefaultProfile, val ); + if ( val ) + { + User::Leave( KErrNoMemory ); + } + } + } + else + { + EUNIT_ASSERT( ret == KErrNotFound ); + } + MultimediaSharingSettings::SetSipProfileSettingL( 1 ); + TRAPD( err, ret = iSharedObject->MusAvaSip().CreateProfileL() ); + if ( err == KErrNoMemory || !ret ) + { + User::Leave( KErrNoMemory ); + } + //No profile id found + iSharedObject->MusAvaSip().Profile()->iTUint32Value = 0; + EUNIT_ASSERT( iAvaConnectionMonitor->MultimediaSharingAccessPointID() == 0 ); + //Profile id found + iSharedObject->MusAvaSip().Profile()->iTUint32Value = 1; + EUNIT_ASSERT( iAvaConnectionMonitor->MultimediaSharingAccessPointID() == 1 ); + } + + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusAvaConnectionMonitor, + "CMusAvaConnectionMonitor", + "UNIT" ) + +EUNIT_TEST( + "NewL - test ", + "CMusAvaConnectionMonitor", + "NewL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaConnectionMonitor_NewLL, Teardown) + +EUNIT_TEST( + "EventL - test ", + "CMusAvaConnectionMonitor", + "EventL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaConnectionMonitor_EventLL, Teardown) + +EUNIT_TEST( + "AddAdapterL - test ", + "CMusAvaConnectionMonitor", + "AddAdapterL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaConnectionMonitor_AddAdapterLL, Teardown) + + +EUNIT_TEST( + "RemoveAdapter - test ", + "CMusAvaConnectionMonitor", + "RemoveAdapter", + "FUNCTIONALITY", + SetupL, UT_CMusAvaConnectionMonitor_RemoveAdapterL, Teardown) + + +EUNIT_TEST( + "ConnectionCount - test ", + "CMusAvaConnectionMonitor", + "ConnectionCount", + "FUNCTIONALITY", + SetupL, UT_CMusAvaConnectionMonitor_ConnectionCountL, Teardown) + +EUNIT_TEST( + "ConnectionIDL - test ", + "CMusAvaConnectionMonitor", + "ConnectionIDL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaConnectionMonitor_ConnectionIDLL, Teardown) + +EUNIT_TEST( + "MultimediaSharingAccessPointID - test ", + "CMusAvaConnectionMonitor", + "MultimediaSharingAccessPointID", + "FUNCTIONALITY", + SetupL, UT_CMusAvaConnectionMonitor_MultimediaSharingAccessPointIDL, Teardown) + + + +EUNIT_END_TEST_TABLE + +// END OF FILE diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaContactAvailability.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaContactAvailability.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,509 @@ +/* +* 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: +* +*/ + + +// CLASS HEADER +#include "UT_CMusAvaContactAvailability.h" +#include "musavaavailabilityobserver.h" +#include "musavaavailabilityobserverimp.h" +#include "musavaobserver.h" +#include "musavaobserverimp.h" +#include "musavasettingsimp.h" +#include "muslogger.h" +#include "musavadefaultimp.h" +#include "musavacapabilitytesthelper.h" +#include "mussettings.h" + +// EXTERNAL INCLUDES +#include +#include +#include +#include +#include + +// INTERNAL INCLUDES +#include "musavacontactavailability.h" + +const TInt KNumberMatchingDigitsRequired( 7 ); + +_LIT(KNumberZero,""); +_LIT(KNumber,"05012345678"); +_LIT(KPlusNumber,"+3585012345678"); +_LIT(KFirstName,"Matti"); +_LIT(KLastName,"Meikalainen"); +_LIT(KFirstLastName,"Matti Meikalainen"); +_LIT(KLastFirstName,"Meikalainen Matti"); + +// CONSTRUCTION +UT_CMusAvaContactAvailability* UT_CMusAvaContactAvailability::NewL() + { + UT_CMusAvaContactAvailability* self = UT_CMusAvaContactAvailability::NewLC(); + CleanupStack::Pop(); + + return self; + } + +UT_CMusAvaContactAvailability* UT_CMusAvaContactAvailability::NewLC() + { + UT_CMusAvaContactAvailability* self = new( ELeave ) UT_CMusAvaContactAvailability(); + CleanupStack::PushL( self ); + + self->ConstructL(); + + return self; + } + +// Destructor (virtual by CBase) +UT_CMusAvaContactAvailability::~UT_CMusAvaContactAvailability() + { + TRAP_IGNORE( + MultimediaSharingSettings::SetOperatorVariantSettingL( iSaveOperatorVariant ) ) + } + +// Default constructor +UT_CMusAvaContactAvailability::UT_CMusAvaContactAvailability() + { + } + +// Second phase construct +void UT_CMusAvaContactAvailability::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + iSaveOperatorVariant = MultimediaSharingSettings::OperatorVariantSettingL(); + } + +// METHODS + + + +void UT_CMusAvaContactAvailability::SetupL( ) + { + MultimediaSharingSettings::SetOperatorVariantSettingL( + MusSettingsKeys::EStandard ); + + iAvailabilityObserver = CMusAvaAvailabilityObserverImp::NewL(); + iConcreteSettings = CMusAvaSettingsImp::NewL(); + iContactAvailability = CMusAvaContactAvailability::NewL( *iAvailabilityObserver, + *iConcreteSettings ); + } + +void UT_CMusAvaContactAvailability::SetupOpSpecificL() + { + MultimediaSharingSettings::SetOperatorVariantSettingL( + MusSettingsKeys::EOperatorSpecific ); + + iAvailabilityObserver = CMusAvaAvailabilityObserverImp::NewL(); + iConcreteSettings = CMusAvaSettingsImp::NewL(); + iContactAvailability = CMusAvaContactAvailability::NewL( *iAvailabilityObserver, + *iConcreteSettings ); + } + +void UT_CMusAvaContactAvailability::Teardown( ) + { + delete iContactAvailability; + delete iAvailabilityObserver; + delete iConcreteSettings; + + /* // obtain contact no in contacts DB + TInt contactNo = iListBox->CurrentItemIndex(); + contactNo = iPositionInContactsDB.operator[](contactNo); + + // connect to contact database + CContactDatabase* contactsDb = CContactDatabase::OpenL(); + CleanupStack::PushL(contactsDb); + + // set iterator for contacts DB + TContactIter iter(*contactsDb); + TContactItemId cardId; + + // index of contacts in contacs DB + TInt round(0); + + // go to correct contact card + while( ( cardId = iter.NextL() ) != KNullContactId ) + { + // if currect index is index of contact we're looking - break + if(round == contactNo) + break; + round++; + } + + // delete contact + contactsDb->DeleteContactL(cardId); + + CleanupStack::PopAndDestroy(); // contactsDb + + // some function to recreate and redraw List Box should be called here + // to reflect changes*/ + } + +void UT_CMusAvaContactAvailability::UT_CMusAvaController_NewLL( ) + { + // EUNIT_ASSERT( iContactAvailability ); + } + +void UT_CMusAvaContactAvailability::UT_CMusAvaController_DoExecuteLL() + { + // Non cont or phone number added to contact DB + TRAPD( error, iContactAvailability->DoExecuteL( ) ); + if ( error == KErrNoMemory ) User::Leave( KErrNoMemory ); + TInt count = 0; + EUNIT_GET_ALLOC_DECORATOR_FAILCOUNT( count ); + if ( count > 0 && error != KErrNone ) + { + User::Leave( KErrNoMemory ); + } + } + + +void UT_CMusAvaContactAvailability::UT_CMusAvaController_DoExecuteL1_L() + { + } + + +void UT_CMusAvaContactAvailability::UT_CMusAvaController_DoExecuteL2_L() + { + + iConcreteSettings->SetTelNumberL( KPlusNumber ); + + TRAPD( error, iContactAvailability->DoExecuteL() ); + EUNIT_ASSERT( error == KErrNoMemory || error == KErrNone ); + if ( error == KErrNoMemory ) User::Leave( error ); + TInt count; + EUNIT_GET_ALLOC_DECORATOR_FAILCOUNT( count ); + if ( count > 0 && error != KErrNone ) + { + User::Leave( KErrNoMemory ); + } + + iConcreteSettings->SetTelNumberL( KPlusNumber ); + + TRAP( error, iContactAvailability->DoExecuteL() ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_GET_ALLOC_DECORATOR_FAILCOUNT( count ); + if ( count > 0 && error != KErrNone ) + { + User::Leave( KErrNoMemory ); + } + } + +void UT_CMusAvaContactAvailability::UT_CMusAvaController_DoExecuteL3_L() + { + iConcreteSettings->SetTelNumberL( KPlusNumber ); + + TRAPD( error, iContactAvailability->DoExecuteL() ); + EUNIT_ASSERT( error == KErrNoMemory || error == KErrNone ); + if ( error == KErrNoMemory ) User::Leave( error ); + TInt count; + EUNIT_GET_ALLOC_DECORATOR_FAILCOUNT( count ); + if ( count > 0 && error != KErrNone ) + { + User::Leave( KErrNoMemory ); + } + + iConcreteSettings->SetTelNumberL( KPlusNumber ); + + TRAP( error, iContactAvailability->DoExecuteL() ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_GET_ALLOC_DECORATOR_FAILCOUNT( count ); + if ( count > 0 && error != KErrNone ) + { + User::Leave( KErrNoMemory ); + } + + } + + +void UT_CMusAvaContactAvailability::UT_CMusAvaController_NameL() + { + EUNIT_ASSERT( iContactAvailability->Name() == MMusAvaObserver::EMusAvaNameContactStatus ); + } + +void UT_CMusAvaContactAvailability::UT_CMusAvaController_StatusL() + { + EUNIT_ASSERT( iContactAvailability->State() == MMusAvaObserver::EMusAvaStatusNotExecuted ); + } + +void UT_CMusAvaContactAvailability::UT_CMusAvaController_StopL() + { + //EUNIT_ASSERT( iContactAvailability->Stop() == KErrNone ); + } + +void UT_CMusAvaContactAvailability::UT_CMusAvaController_ActiveCallLL() + { + //No prefix + CDesCArrayFlat* array = new ( ELeave ) CDesCArrayFlat( 10 ); + CleanupStack::PushL( array ); + + iConcreteSettings->SetTelNumberL( KNumber ); + EUNIT_ASSERT( !iContactAvailability->ActiveCallL( array ) ); + EUNIT_ASSERT( array->MdcaCount() == 0 ); + + + //Prefix + iConcreteSettings->SetTelNumberL( KPlusNumber ); + EUNIT_ASSERT( iContactAvailability->ActiveCallL( array ) ); + EUNIT_ASSERT( array->Count() == 1 ) + array->Reset(); + + + //No number + iConcreteSettings->ReleseTelNumberL(); + EUNIT_ASSERT( !iContactAvailability->ActiveCallL( array ) ); + EUNIT_ASSERT( array->MdcaCount() == 0 ); + CleanupStack::PopAndDestroy( array ); + } + +void UT_CMusAvaContactAvailability::UT_CMusAvaController_ActiveCallLOpSpecificL() + { + //No prefix + CDesCArrayFlat* array = new ( ELeave ) CDesCArrayFlat( 10 ); + CleanupStack::PushL( array ); + + iConcreteSettings->SetTelNumberL( KNumber ); + EUNIT_ASSERT( iContactAvailability->ActiveCallL( array ) ); + EUNIT_ASSERT( array->MdcaCount() == 1 ); + array->Reset(); + + //Prefix + iConcreteSettings->SetTelNumberL( KPlusNumber ); + EUNIT_ASSERT( iContactAvailability->ActiveCallL( array ) ); + EUNIT_ASSERT( array->Count() == 1 ) + array->Reset(); + + //No number + iConcreteSettings->ReleseTelNumberL(); + EUNIT_ASSERT( !iContactAvailability->ActiveCallL( array ) ); + EUNIT_ASSERT( array->MdcaCount() == 0 ); + CleanupStack::PopAndDestroy( array ); + } + +void UT_CMusAvaContactAvailability::UT_CMusAvaController_ContactLL() + { + } + +void UT_CMusAvaContactAvailability::UT_CMusAvaController_ContactArrayLL() + { + } + +void UT_CMusAvaContactAvailability::UT_CMusAvaController_ContactItemL() + { + } + +void UT_CMusAvaContactAvailability::UT_CMusAvaController_PhoneResulutionLL() + { + } + +void UT_CMusAvaContactAvailability::UT_CMusAvaController_ContactIdL() + { + } + +void UT_CMusAvaContactAvailability::UT_CMusAvaController_ContactIdSearchL() + { + } + +void UT_CMusAvaContactAvailability::UT_CMusAvaController_ResolveAddressesLL() + { + } + +void UT_CMusAvaContactAvailability::UT_CMusAvaController_ResolveAddressesLOpSpecificL() + { + } + +void UT_CMusAvaContactAvailability::UT_CMusAvaController_ResolvePhoneContactLL() + { + } + +void UT_CMusAvaContactAvailability::UT_CMusAvaController_ResolvePhoneContactLOpSpecificL() + { + } + +void UT_CMusAvaContactAvailability::UT_CMusAvaController_IsExistAlreadyL() + { + } + +void UT_CMusAvaContactAvailability::UT_CMusAvaController_UpdateContactNameLL() + { + } + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusAvaContactAvailability, + "CMusAvaContactAvailability", + "UNIT" ) + +EUNIT_TEST( + "NewL - test ", + "CMusAvaContactAvailability", + "NewL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaController_NewLL, Teardown) + +EUNIT_TEST( + "DoExecuteL - test ", + "CMusAvaContactAvailability", + "DoExecuteL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaController_DoExecuteLL, Teardown) + +EUNIT_TEST( + "DoExecuteL_1 - test ", + "CMusAvaContactAvailability", + "DoExecuteL_1", + "FUNCTIONALITY", + SetupL, UT_CMusAvaController_DoExecuteL1_L, Teardown) + +EUNIT_TEST( + "DoExecuteL_2 - test ", + "CMusAvaContactAvailability", + "DoExecuteL_2", + "FUNCTIONALITY", + SetupL, UT_CMusAvaController_DoExecuteL2_L, Teardown) + +EUNIT_TEST( + "DoExecuteL_3 - test ", + "CMusAvaContactAvailability", + "DoExecuteL_3", + "FUNCTIONALITY", + SetupL, UT_CMusAvaController_DoExecuteL3_L, Teardown) + +EUNIT_TEST( + "Name - test ", + "CMusAvaController", + "Name", + "FUNCTIONALITY", + SetupL, UT_CMusAvaController_NameL, Teardown) + +EUNIT_TEST( + "Status - test ", + "CMusAvaController", + "Status", + "FUNCTIONALITY", + SetupL, UT_CMusAvaController_StatusL, Teardown) + +EUNIT_TEST( + "Stop - test ", + "CMusAvaController", + "Stop", + "FUNCTIONALITY", + SetupL, UT_CMusAvaController_StopL, Teardown) + +EUNIT_TEST( + "ActiveCallL - test ", + "CMusAvaContactAvailability", + "ActiveCallL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaController_ActiveCallLL, Teardown) + +EUNIT_TEST( + "ActiveCallL OpSpecific - test ", + "CMusAvaContactAvailability", + "ActiveCallL", + "FUNCTIONALITY", + SetupOpSpecificL, UT_CMusAvaController_ActiveCallLOpSpecificL, Teardown) + +EUNIT_TEST( + "ContactL - test ", + "CMusAvaContactAvailability", + "ContactL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaController_ContactLL, Teardown) + +EUNIT_TEST( + "ContactArrayL - test ", + "CMusAvaContactAvailability", + "ContactArrayL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaController_ContactArrayLL, Teardown) + +EUNIT_TEST( + "ContactItem - test ", + "CMusAvaContactAvailability", + "ContactItem", + "FUNCTIONALITY", + SetupL, UT_CMusAvaController_ContactItemL, Teardown) + +EUNIT_TEST( + "PhoneResolutionL - test ", + "CMusAvaContactAvailability", + "PhoneResolutionL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaController_PhoneResulutionLL, Teardown) + +EUNIT_TEST( + "ContactIdSearch - test ", + "CMusAvaContactAvailability", + "ContactIdSearch", + "FUNCTIONALITY", + SetupL, UT_CMusAvaController_ContactIdSearchL, Teardown) + +EUNIT_TEST( + "ContactId - test ", + "CMusAvaContactAvailability", + "ContactId", + "FUNCTIONALITY", + SetupL, UT_CMusAvaController_ContactIdL, Teardown) + +EUNIT_TEST( + "ResolveAddressesL - test ", + "CMusAvaContactAvailability", + "ResolveAddressesL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaController_ResolveAddressesLL, Teardown) + +EUNIT_TEST( + "ResolveAddressesL OpSpecific- test ", + "CMusAvaContactAvailability", + "ResolveAddressesL", + "FUNCTIONALITY", + SetupOpSpecificL, UT_CMusAvaController_ResolveAddressesLOpSpecificL, Teardown) + +EUNIT_TEST( + "ResolvePhoneContactL - test ", + "CMusAvaContactAvailability", + "ResolvePhoneContactL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaController_ResolvePhoneContactLL, Teardown) + +EUNIT_TEST( + "ResolvePhoneContactL OpSpecific - test ", + "CMusAvaContactAvailability", + "ResolvePhoneContactL", + "FUNCTIONALITY", + SetupOpSpecificL, UT_CMusAvaController_ResolvePhoneContactLOpSpecificL, Teardown) + +EUNIT_TEST( + "IsExistAlready - test ", + "CMusAvaContactAvailability", + "IsExistAlready", + "FUNCTIONALITY", + SetupL, UT_CMusAvaController_IsExistAlreadyL, Teardown) + +EUNIT_TEST( + "UpdateContactNameL - test ", + "CMusAvaContactAvailability", + "UpdateContactNameL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaController_UpdateContactNameLL, Teardown) + +EUNIT_END_TEST_TABLE + +// END OF FILE + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaDefaultImp.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaDefaultImp.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,514 @@ +/* +* 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: +* +*/ + + +// CLASS HEADER +#include "UT_CMusAvaDefaultImp.h" +#include "musavasettingsimp.h" +#include "musavaavailabilityobserverimp.h" +#include "musavaavailabilitystub.h" +#include "musavaobserverimp.h" +#include "muslogger.h" +#include "musavacapabilitytesthelper.h" +#include "mussesseioninformationapi.h" +#include "mussettings.h" +#include "musavasettingsimp.h" +#include "CSipSseTestTls.h" + +#include + +// EXTERNAL INCLUDES +#include +#include +#include + +// INTERNAL INCLUDES +#include "musavadefaultimp.h" + +_LIT(KPlusNumber,"+3585012345678"); + +// CONSTRUCTION +UT_CMusAvaDefaultImp* UT_CMusAvaDefaultImp::NewL() + { + UT_CMusAvaDefaultImp* self = UT_CMusAvaDefaultImp::NewLC(); + CleanupStack::Pop(); + + return self; + } + +UT_CMusAvaDefaultImp* UT_CMusAvaDefaultImp::NewLC() + { + UT_CMusAvaDefaultImp* self = new( ELeave ) UT_CMusAvaDefaultImp(); + CleanupStack::PushL( self ); + self->ConstructL(); + + return self; + } + +// Destructor (virtual by CBase) +UT_CMusAvaDefaultImp::~UT_CMusAvaDefaultImp() + { + } + +// Default constructor +UT_CMusAvaDefaultImp::UT_CMusAvaDefaultImp() + { + } + +// Second phase construct +void UT_CMusAvaDefaultImp::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + +// METHODS + +void UT_CMusAvaDefaultImp::StartL( ) + { + TRAPD( error, RProperty::Define( + NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMUSForbidden, + RProperty::EInt, + 0 ) ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT ( error == KErrNone ); + TRAP( error, RProperty::Set( + NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMUSForbidden, + ( TInt ) NMusSessionInformationApi::EMUSAllowed ) ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT ( error == KErrNone ); + + SIPStrings::OpenL(); + CSipSseTestTls::OpenL(); + MultimediaSharingSettings::SetActivationSettingL(MusSettingsKeys::EAlwaysActive); + iDefaultImp = new (ELeave) CMusAvaDefaultImp(); + iMusAvaObserver = CMusAvaObserverImp::NewL(); + iDefaultImp->SetObserver( *iMusAvaObserver ); + iConcreteSettings = CMusAvaSettingsImp::NewL(); + } + +void UT_CMusAvaDefaultImp::Teardown( ) + { + delete iDefaultImp; + delete iMusAvaObserver; + CSipSseTestTls::Close(); + delete iConcreteSettings; + SIPStrings::Close(); + PropertyHelper::Close(); + } + +void UT_CMusAvaDefaultImp::UT_CMusAvaDefaultImp_NewLL( ) + { + EUNIT_ASSERT( iDefaultImp ); + } + +void UT_CMusAvaDefaultImp::UT_CMusAvaDefaultImp_CreateAvailabilityModulesLL() + { + + User::LeaveIfError( RProperty::Set( NMusSessionInformationApi::KCategoryUid , + NMusSessionInformationApi::KMUSForbidden , + NMusSessionInformationApi::EMUSAllowed )); + + MultimediaSharingSettings::SetActivationSettingL(MusSettingsKeys::EAlwaysActive); + TRAPD( error, iDefaultImp->CreateAvailabilityModulesL() ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT ( error == KErrNone ); + TInt count = NULL; + EUNIT_GET_ALLOC_DECORATOR_FAILCOUNT( count ); + if ( count > 0 && iDefaultImp->iAvailabilities.Count() < 9 ) + { + User::Leave( KErrNoMemory ); + } + EUNIT_ASSERT( iDefaultImp->iAvailabilities.Count() == 9 ); + + + User::LeaveIfError( RProperty::Set( NMusSessionInformationApi::KCategoryUid , + NMusSessionInformationApi::KMUSForbidden , + NMusSessionInformationApi::EMUSForbidden )); + + TRAP( error, iDefaultImp->CreateAvailabilityModulesL() ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT ( error == KErrNone ); + EUNIT_ASSERT( iDefaultImp->iAvailabilities.Count() == 4 ); + + + + User::LeaveIfError( RProperty::Set( NMusSessionInformationApi::KCategoryUid , + NMusSessionInformationApi::KMUSForbidden , + NMusSessionInformationApi::EMUSAllowed )); + + MultimediaSharingSettings::SetActivationSettingL(MusSettingsKeys::ENever); + TRAP( error, iDefaultImp->CreateAvailabilityModulesL() ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT ( error == KErrNone ); + EUNIT_ASSERT( iDefaultImp->iAvailabilities.Count() == 4 ); + } + +void UT_CMusAvaDefaultImp::UT_CMusAvaDefaultImp_ExecuteAvailablitityModulesL() + { + /* ConstuctL will construct all availability Modules */ + iDefaultImp->ConstructL(); + TInt count = NULL; + EUNIT_GET_ALLOC_DECORATOR_FAILCOUNT( count ); + if ( count > 0 && + iDefaultImp->iAvailabilities.Count() < 9 ) + { + User::Leave( KErrNoMemory ); + } + /* Execute and Check all the availability Modules */ + iDefaultImp->ExecuteAvailablitityModules(); + EUNIT_ASSERT( iDefaultImp->iAvailabilities.Count() == 9 ); + + MMusAvaObserver::TAvailabilityStatus state; + for ( TInt i = 0; i < iDefaultImp->iAvailabilities.Count(); i++ ) + { + state = iDefaultImp->iAvailabilities[i]->State(); + EUNIT_ASSERT( state !=MMusAvaObserver::EMusAvaStatusNotExecuted || + state != MMusAvaObserver::EMusAvaStatusInProgress ); + } + } + +void UT_CMusAvaDefaultImp::UT_CMusAvaDefaultImp_ConstuctHandlerAvailabilityModulesLL() + { + TRAPD( error, iDefaultImp->ConstuctHandlerAvailabilityModulesL() ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT ( error == KErrNone ); + + EUNIT_ASSERT( iDefaultImp->iAvailabilities.Count() == 2 ); + } + +void UT_CMusAvaDefaultImp::UT_CMusAvaDefaultImp_ConstructStaticAvailabilityModulesLL() + { + TRAPD( error, iDefaultImp->ConstructStaticAvailabilityModulesL() ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT ( error == KErrNone ); + EUNIT_ASSERT( iDefaultImp->iAvailabilities.Count() == 2 ); + } + +void UT_CMusAvaDefaultImp::UT_CMusAvaDefaultImp_ConstructDynamicAvailabilityModulesLL() + { + TRAPD( error, iDefaultImp->ConstructDynamicAvailabilityModulesL() ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT ( error == KErrNone ); + + EUNIT_ASSERT( iDefaultImp->iAvailabilities.Count() == 5 ); + } + +void UT_CMusAvaDefaultImp::UT_CMusAvaDefaultImp_SettingsL() + { + /* ConstuctL will construct all availability Modules */ + iDefaultImp->ConstructL(); + MMusAvaSettings& settings = iDefaultImp->Settings(); + EUNIT_ASSERT( &settings ); + } + +void UT_CMusAvaDefaultImp::UT_CMusAvaDefaultImp_SetObserverL() + { + CMusAvaObserverImp* temp = CMusAvaObserverImp::NewL(); + CleanupStack::PushL( temp ); + iDefaultImp->SetObserver( *temp ); + delete iMusAvaObserver; + iMusAvaObserver = temp; + CleanupStack::Pop( temp ); + EUNIT_ASSERT( iDefaultImp->iObserver == iMusAvaObserver); + } + +void UT_CMusAvaDefaultImp::UT_CMusAvaDefaultImp_StartLL() + { + iDefaultImp->ConstructL(); + TInt count = NULL; + EUNIT_GET_ALLOC_DECORATOR_FAILCOUNT( count ); + if ( count > 0 && + iDefaultImp->iAvailabilities.Count() < 9 ) + { + User::Leave( KErrNoMemory ); + } + iDefaultImp->StartL(); + EUNIT_ASSERT( iDefaultImp->iAvailabilities.Count() == 9 ); + } + +void UT_CMusAvaDefaultImp::UT_CMusAvaDefaultImp_StopL() + { + iDefaultImp->ConstructL(); + TInt count = NULL; + EUNIT_GET_ALLOC_DECORATOR_FAILCOUNT( count ); + if ( count > 0 && + iDefaultImp->iAvailabilities.Count() < 9 ) + { + User::Leave( KErrNoMemory ); + } + iDefaultImp->StartL(); + EUNIT_ASSERT( iDefaultImp->iAvailabilities.Count() == 9 ); + iDefaultImp->Stop(); + } + +void UT_CMusAvaDefaultImp::UT_CMusAvaDefaultImp_AvailabilityChangedL() + { + MMusAvaObserver::TAvailabilityStatus status = MMusAvaObserver::EMusAvaStatusAvailable; + MMusAvaObserver::TAvailabilityName name = MMusAvaObserver::EMusAvaNameContactStatus; + + iDefaultImp->ConstructL(); + TInt count = NULL; + EUNIT_GET_ALLOC_DECORATOR_FAILCOUNT( count ); + if ( count > 0 && + iDefaultImp->iAvailabilities.Count() < 9 ) + { + User::Leave( KErrNoMemory ); + } + iDefaultImp->StartL(); + EUNIT_ASSERT( iDefaultImp->iAvailabilities.Count() == 9 ); + + //delete iDefaultImp->iObserver; + delete iMusAvaObserver; + iMusAvaObserver = NULL; + iDefaultImp->iObserver = NULL; + iDefaultImp->AvailabilityChanged(name,status); + + iMusAvaObserver = CMusAvaObserverImp::NewL(); + iDefaultImp->SetObserver( *iMusAvaObserver ); + iDefaultImp->iStopping=ETrue; + iDefaultImp->AvailabilityChanged(name,status); + + iDefaultImp->iStopping=EFalse; + status=MMusAvaObserver::EMusAvaConnectionErr; + iDefaultImp->AvailabilityChanged(name,status); + + iDefaultImp->iStopping=EFalse; + status=MMusAvaObserver::EMusAvaStatusAvailable; + iDefaultImp->iExecuteStarted=ETrue; + iDefaultImp->AvailabilityChanged(name,status); + } + +void UT_CMusAvaDefaultImp::UT_CMusAvaDefaultImp_AvailabilityErrorL() + { + MMusAvaObserver::TAvailabilityStatus status = iDefaultImp->AvailabilityStatus(); + MMusAvaObserver::TAvailabilityName name = iDefaultImp->CurrentAvailability(); + EUNIT_ASSERT( name == MMusAvaObserver::EMusAvaNameNotDefined ); + EUNIT_ASSERT( status == MMusAvaObserver::EMusAvaStatusNotExecuted ); + + /* ConstuctL will construct all availability Modules */ + iDefaultImp->ConstructL(); + TInt count = NULL; + EUNIT_GET_ALLOC_DECORATOR_FAILCOUNT( count ); + if ( count > 0 && + iDefaultImp->iAvailabilities.Count() < 9 ) + { + User::Leave( KErrNoMemory ); + } + iDefaultImp->StartL(); + EUNIT_ASSERT( iDefaultImp->iAvailabilities.Count() > 0 ); + + for ( TInt i = 0; iiAvailabilities.Count(); i++ ) + { + iDefaultImp->iAvailabilities[i]->SetState( MMusAvaObserver::EMusAvaStatusAvailable ); + } + TBool min = iDefaultImp->MinimumAvailability(); + TBool man = iDefaultImp->MandatoryAvailability(); + TBool ext = iDefaultImp->ExtensionAvailability(); + EUNIT_ASSERT( ext == ETrue ); + + status = iDefaultImp->AvailabilityStatus(); + name = iDefaultImp->CurrentAvailability(); + EUNIT_ASSERT(name == MMusAvaObserver::EMusAvaFullAvailability); + + iDefaultImp->iAvailabilities[iDefaultImp->iAvailabilities.Count()-1]->SetState( + MMusAvaObserver::EMusAvaOptionNotAvailable ); + + iDefaultImp->AvailabilityError( iDefaultImp->iAvailabilities[iDefaultImp->iAvailabilities.Count()-1]->Name(), + MMusAvaObserver::EMusAvaOptionNotAvailable ); + + CMusAvaObserverImp* observer = static_cast(iDefaultImp->iObserver); + EUNIT_ASSERT( observer->iStatus == MMusAvaObserver::EMusAvaOptionNotAvailable ); + EUNIT_ASSERT( observer->iName == MMusAvaObserver::EMusAvaOptionHandler); + + status = iDefaultImp->AvailabilityStatus(); + name = iDefaultImp->CurrentAvailability(); + EUNIT_ASSERT( status == MMusAvaObserver::EMusAvaOptionNotAvailable ); + EUNIT_ASSERT( name == MMusAvaObserver::EMusAvaOptionHandler); + } + +void UT_CMusAvaDefaultImp::UT_CMusAvaDefaultImp_AvailableL() + { + MMusAvaObserver::TAvailabilityStatus status = iDefaultImp->AvailabilityStatus(); + MMusAvaObserver::TAvailabilityName name = iDefaultImp->CurrentAvailability(); + EUNIT_ASSERT( name == MMusAvaObserver::EMusAvaNameNotDefined ); + EUNIT_ASSERT( status == MMusAvaObserver::EMusAvaStatusNotExecuted ); + + /* ConstuctL will construct all availability Modules */ + iDefaultImp->ConstructL(); + TInt count = NULL; + EUNIT_GET_ALLOC_DECORATOR_FAILCOUNT( count ); + if ( count > 0 && + iDefaultImp->iAvailabilities.Count() < 9 ) + { + User::Leave( KErrNoMemory ); + } + iDefaultImp->StartL(); + EUNIT_ASSERT( !iDefaultImp->Available(MMusAvaObserver::EMusAvaOptionHandler) ); + EUNIT_ASSERT( iDefaultImp->Available(MMusAvaObserver::EMusAvaInviteHandler) ); + } + +void UT_CMusAvaDefaultImp::UT_CMusAvaDefaultImp_AvailabilityStateL() + { + MMusAvaObserver::TAvailabilityStatus status = iDefaultImp->AvailabilityStatus(); + MMusAvaObserver::TAvailabilityName name = iDefaultImp->CurrentAvailability(); + EUNIT_ASSERT( name == MMusAvaObserver::EMusAvaNameNotDefined ); + EUNIT_ASSERT( status == MMusAvaObserver::EMusAvaStatusNotExecuted ); + + /* ConstuctL will construct all availability Modules */ + iDefaultImp->ConstructL(); + TInt count = NULL; + EUNIT_GET_ALLOC_DECORATOR_FAILCOUNT( count ); + if ( count > 0 && + iDefaultImp->iAvailabilities.Count() < 9 ) + { + User::Leave( KErrNoMemory ); + } + + EUNIT_DISABLE_ALLOC_DECORATOR; + EUNIT_ENABLE_ALLOC_DECORATOR; + + // dummy initialization, other ways CPbkContactEngine leaks memory + + //contact + EUNIT_DISABLE_ALLOC_DECORATOR; + EUNIT_ENABLE_ALLOC_DECORATOR; + + iConcreteSettings->SetTelNumberL( KPlusNumber() ); + + iDefaultImp->StartL(); + EUNIT_ASSERT( iDefaultImp->AvailabilityState( + MMusAvaObserver::EMusAvaOptionHandler) + == MMusAvaObserver::EMusAvaStatusNotExecuted ); + EUNIT_ASSERT( iDefaultImp->AvailabilityState( + MMusAvaObserver::EMusAvaInviteHandler) + == MMusAvaObserver::EMusAvaStatusAvailable ); + + } + + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusAvaDefaultImp, + "CMusAvaDefaultImp", + "UNIT" ) + +EUNIT_TEST( + "NewL - test ", + "CMusAvaDefaultImp", + "NewL", + "FUNCTIONALITY", + StartL, UT_CMusAvaDefaultImp_NewLL, Teardown) + +EUNIT_TEST( + "CreateAvailabilityModulesL - test ", + "CMusAvaDefaultImp", + "CreateAvailabilityModulesL", + "FUNCTIONALITY", + StartL, UT_CMusAvaDefaultImp_CreateAvailabilityModulesLL, Teardown) + +EUNIT_TEST( + "ConstructHandlerAvailabilityModulesL - test ", + "CMusAvaDefaultImp", + "ConstuctHandlerAvailabilityModulesL", + "FUNCTIONALITY", + StartL, UT_CMusAvaDefaultImp_ConstuctHandlerAvailabilityModulesLL, Teardown) + +EUNIT_TEST( + "ConstructStaticAvailabilityModulesL - test ", + "CMusAvaDefaultImp", + "ConstructStaticAvailabilityModulesL", + "FUNCTIONALITY", + StartL, UT_CMusAvaDefaultImp_ConstructStaticAvailabilityModulesLL, Teardown) + +EUNIT_TEST( + "ConstructDynamicAvailabilityModulesL - test ", + "CMusAvaDefaultImp", + "ConstructDynamicAvailabilityModulesL", + "FUNCTIONALITY", + StartL, UT_CMusAvaDefaultImp_ConstructDynamicAvailabilityModulesLL, Teardown) + +EUNIT_TEST( + "ExecuteAvailablitityModules - test ", + "CMusAvaDefaultImp", + "ExecuteAvailablitityModules", + "FUNCTIONALITY", + StartL, UT_CMusAvaDefaultImp_ExecuteAvailablitityModulesL, Teardown) + +EUNIT_TEST( + "Settings - test ", + "CMusAvaDefaultImp", + "Settings", + "FUNCTIONALITY", + StartL, UT_CMusAvaDefaultImp_SettingsL, Teardown) + +EUNIT_TEST( + "SetObserver - test ", + "CMusAvaDefaultImp", + "SetObserver", + "FUNCTIONALITY", + StartL, UT_CMusAvaDefaultImp_SetObserverL, Teardown) + + EUNIT_TEST( + "StartL - test ", + "CMusAvaDefaultImp", + "StartL", + "FUNCTIONALITY", + StartL, UT_CMusAvaDefaultImp_StartLL, Teardown) + + EUNIT_TEST( + "Stop - test ", + "CMusAvaDefaultImp", + "Stop", + "FUNCTIONALITY", + StartL, UT_CMusAvaDefaultImp_StopL, Teardown) + + EUNIT_TEST( + "AvailabilityChanged - test ", + "CMusAvaDefaultImp", + "AvailabilityChanged", + "FUNCTIONALITY", + StartL, UT_CMusAvaDefaultImp_AvailabilityChangedL, Teardown) + + EUNIT_TEST( + "AvailabilityError - test ", + "CMusAvaDefaultImp", + "AvailabilityError", + "FUNCTIONALITY", + StartL, UT_CMusAvaDefaultImp_AvailabilityErrorL, Teardown) + +EUNIT_TEST( + "Available - test ", + "CMusAvaDefaultImp", + "Available", + "FUNCTIONALITY", + StartL, UT_CMusAvaDefaultImp_AvailableL, Teardown) + +EUNIT_TEST( + "AvailabilityState - test ", + "CMusAvaDefaultImp", + "AvailabilityState", + "FUNCTIONALITY", + StartL, UT_CMusAvaDefaultImp_AvailabilityStateL, Teardown) + +EUNIT_END_TEST_TABLE + +// END OF FILE diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaDefaultOptionHandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaDefaultOptionHandler.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,641 @@ +/* +* 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: +* +*/ + + +// CLASS HEADER +#include "UT_CMusAvaDefaultOptionHandler.h" +#include "musavaavailabilityobserver.h" +#include "musavaavailabilityobserverimp.h" +#include "musavasettingsimp.h" +#include "musavaobserverimp.h" +#include "musavadefaultoptionhandler.h" +#include "musavasettingsobserverimp.h" +#include "mussettingskeys.h" +#include "mussettings.h" +#include "muslogger.h" +#include "musavacapabilitytesthelper.h" +#include "CSipSseTestTls.h" +#include "musavacapabilitycontext.h" + + + +// EXTERNAL INCLUDES +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +// INTERNAL INCLUDES + + +_LIT8( KMUSAVATESTSipAddress, "sip:test@10.20.30.40"); + +// CONSTRUCTION +UT_CMusAvaDefaultOptionHandler* UT_CMusAvaDefaultOptionHandler::NewL() + { + UT_CMusAvaDefaultOptionHandler* self = UT_CMusAvaDefaultOptionHandler::NewLC(); + CleanupStack::Pop(); + + return self; + } + +UT_CMusAvaDefaultOptionHandler* UT_CMusAvaDefaultOptionHandler::NewLC() + { + UT_CMusAvaDefaultOptionHandler* self = new( ELeave ) UT_CMusAvaDefaultOptionHandler(); + CleanupStack::PushL( self ); + self->ConstructL(); + + return self; + } + +// Destructor (virtual by CBase) +UT_CMusAvaDefaultOptionHandler::~UT_CMusAvaDefaultOptionHandler() + { + } + +// Default constructor +UT_CMusAvaDefaultOptionHandler::UT_CMusAvaDefaultOptionHandler() + { + } + +// Second phase construct +void UT_CMusAvaDefaultOptionHandler::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + +// METHODS + +void UT_CMusAvaDefaultOptionHandler::SetupL( ) + { + TRAP_IGNORE( SIPStrings::OpenL() ) + CSipSseTestTls::OpenL(); + iStorage = CSipSseTestTls::Storage(); + iStorage->Set( MusSettingsKeys::KFastStartupMode, + MusSettingsKeys::EFastModeOff ); + + iStorage->Set( MusSettingsKeys::KFastStartupMode, + MusSettingsKeys::EFastModeOff ); + MultimediaSharingSettings::SetOperatorVariantSettingL( MusSettingsKeys::EStandard ); + MultimediaSharingSettings::SetEdgeDtmSupportSettingL( MusSettingsKeys::EDtmModeAllowed ); + iAvailabilityObserver = CMusAvaAvailabilityObserverImp::NewL(); + iConcreteSettings = CMusAvaSettingsImp::NewL(); + iSettingsObserverImp = CMusAvaSettingsObserverImp::NewL(); + iConcreteSettings->SetObserver( *iSettingsObserverImp ); + iOptionDefaultHandler = CMusAvaDefaultOptionHandler::NewL( *iAvailabilityObserver, + *iConcreteSettings ); + MultimediaSharingSettings::SetCapabilityQuerySettingL( + MusSettingsKeys::ENoOptions ); + } + +void UT_CMusAvaDefaultOptionHandler::SetupOpSpecificL( ) + { + TRAP_IGNORE( SIPStrings::OpenL() ) + CSipSseTestTls::OpenL(); + iStorage = CSipSseTestTls::Storage(); + iStorage->Set( MusSettingsKeys::KFastStartupMode, + MusSettingsKeys::EFastModeOff ); + + MultimediaSharingSettings::SetOperatorVariantSettingL( MusSettingsKeys::EOperatorSpecific ); + MultimediaSharingSettings::SetEdgeDtmSupportSettingL( MusSettingsKeys::EDtmModeAllowed ); + iAvailabilityObserver = CMusAvaAvailabilityObserverImp::NewL(); + iConcreteSettings = CMusAvaSettingsImp::NewL(); + iSettingsObserverImp = CMusAvaSettingsObserverImp::NewL(); + iConcreteSettings->SetObserver( *iSettingsObserverImp ); + iOptionDefaultHandler = CMusAvaDefaultOptionHandler::NewL( *iAvailabilityObserver, + *iConcreteSettings ); + MultimediaSharingSettings::SetCapabilityQuerySettingL( + MusSettingsKeys::ENoOptions ); + } + +void UT_CMusAvaDefaultOptionHandler::Teardown( ) + { + if ( iStorage ) + { + iStorage->Clear(); + CSipSseTestTls::Close(); + iStorage = NULL; + } + + SIPStrings::Close(); + delete iAvailabilityObserver; + delete iConcreteSettings; + delete iSettingsObserverImp; + delete iOptionDefaultHandler; + } + +void UT_CMusAvaDefaultOptionHandler::UT_CMusAvaDefaultOptionHandler_NewLL( ) + { + EUNIT_ASSERT( iOptionDefaultHandler ); + } + +void UT_CMusAvaDefaultOptionHandler::UT_CMusAvaDefaultOptionHandler_IncomingRequestL() + { + MultimediaSharingSettings::SetActivationSettingL( MusSettingsKeys::EAlwaysActive ); + CSIPServerTransaction* serverTransaction = NULL; + + serverTransaction = CSIPServerTransaction::NewL( SIPStrings::StringF( SipStrConsts::EOptions ) ); + CleanupStack::PushL( serverTransaction ); + + TUriParser8 Uri; + User::LeaveIfError( Uri.Parse( KCapabilityTestAddress_A ) ); + + CUri8* uri = CUri8::NewLC( Uri ); + + CSIPRequestElements* requestelements = CSIPRequestElements::NewL( uri ); + CleanupStack::Pop( uri ); + CleanupStack::PushL( requestelements ); + requestelements->SetMethodL( SIPStrings::StringF( SipStrConsts::EOptions ) ); + serverTransaction->SetRequestElements( requestelements ); + CleanupStack::Pop( requestelements ); + + TInt ret = iOptionDefaultHandler->IncomingRequest( serverTransaction ); + if ( ret == KErrNoMemory ) User::Leave( ret ); + EUNIT_ASSERT( ret == KErrNone ); + + CleanupStack::Pop( serverTransaction ); + + serverTransaction = CSIPServerTransaction::NewL( SIPStrings::StringF( SipStrConsts::EInvite ) ); + CleanupStack::PushL( serverTransaction ); + ret = iOptionDefaultHandler->IncomingRequest( serverTransaction ); + if ( ret == KErrNoMemory ) User::Leave( ret ); + EUNIT_ASSERT( ret == KErrNotFound ); + CleanupStack::PopAndDestroy( serverTransaction ); + + iSettingsObserverImp->iOptionAllowed = EFalse; + iAvailabilityObserver->AvailabilityChanged( + MMusAvaObserver::EMusAvaDefaultOptionHandler, + MMusAvaObserver::EMusAvaStatusAvailable ); + serverTransaction = CSIPServerTransaction::NewL( SIPStrings::StringF( SipStrConsts::EOptions ) ); + CleanupStack::PushL( serverTransaction ); + + uri = CUri8::NewLC( Uri ); + + requestelements = CSIPRequestElements::NewL( uri ); + CleanupStack::Pop( uri ); + CleanupStack::PushL( requestelements ); + requestelements->SetMethodL( SIPStrings::StringF( SipStrConsts::EOptions ) ); + serverTransaction->SetRequestElements( requestelements ); + CleanupStack::Pop( requestelements ); + + ret = iOptionDefaultHandler->IncomingRequest( serverTransaction ); + if ( ret == KErrNoMemory ) User::Leave( ret ); + EUNIT_ASSERT( ret == KErrNone ); + + CleanupStack::Pop( serverTransaction ); + + //IAP Request + iAvailabilityObserver->AvailabilityChanged( + MMusAvaObserver::EMusAvaDefaultOptionHandler, + MMusAvaObserver::EMusAvaStatusNotExecuted ); + serverTransaction = CSIPServerTransaction::NewL( SIPStrings::StringF( SipStrConsts::EOptions ) ); + CleanupStack::PushL( serverTransaction ); + + uri = CUri8::NewLC( Uri ); + + requestelements = CSIPRequestElements::NewL( uri ); + CleanupStack::Pop( uri ); + CleanupStack::PushL( requestelements ); + requestelements->SetMethodL( SIPStrings::StringF( SipStrConsts::EOptions ) ); + serverTransaction->SetRequestElements( requestelements ); + CleanupStack::Pop( requestelements ); + + ret = iOptionDefaultHandler->IncomingRequest( 1, serverTransaction ); + if ( ret == KErrNoMemory ) User::Leave( ret ); + EUNIT_ASSERT( ret == KErrNone ); + + CleanupStack::Pop( serverTransaction ); + + serverTransaction = CSIPServerTransaction::NewL( SIPStrings::StringF( SipStrConsts::EInvite ) ); + CleanupStack::PushL( serverTransaction ); + ret = iOptionDefaultHandler->IncomingRequest( 1, serverTransaction ); + if ( ret == KErrNoMemory ) User::Leave( ret ); + EUNIT_ASSERT( ret == KErrNotFound ); + CleanupStack::PopAndDestroy( serverTransaction ); + + iSettingsObserverImp->iOptionAllowed = EFalse; + iAvailabilityObserver->AvailabilityChanged( + MMusAvaObserver::EMusAvaOptionHandler, + MMusAvaObserver::EMusAvaStatusAvailable ); + serverTransaction = CSIPServerTransaction::NewL( SIPStrings::StringF( SipStrConsts::EOptions ) ); + CleanupStack::PushL( serverTransaction ); + uri = CUri8::NewLC( Uri ); + + requestelements = CSIPRequestElements::NewL( uri ); + CleanupStack::Pop( uri ); + CleanupStack::PushL( requestelements ); + requestelements->SetMethodL( SIPStrings::StringF( SipStrConsts::EOptions ) ); + serverTransaction->SetRequestElements( requestelements ); + CleanupStack::Pop( requestelements ); + ret = iOptionDefaultHandler->IncomingRequest( 1, serverTransaction ); + if ( ret == KErrNoMemory ) User::Leave( ret ); + EUNIT_ASSERT( ret == KErrNotFound ); + CleanupStack::PopAndDestroy( serverTransaction ); + } + +void UT_CMusAvaDefaultOptionHandler::UT_CMusAvaDefaultOptionHandler_DoExecuteLL() + { + TRAPD( error, iOptionDefaultHandler->DoExecuteL() ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT( error == KErrNone ); + EUNIT_ASSERT( iOptionDefaultHandler->State() == MMusAvaObserver::EMusAvaStatusAvailable ); + } + +void UT_CMusAvaDefaultOptionHandler::UT_CMusAvaDefaultOptionHandler_NameL() + { + EUNIT_ASSERT( iOptionDefaultHandler->Name() == MMusAvaObserver::EMusAvaDefaultOptionHandler ); + } + +void UT_CMusAvaDefaultOptionHandler::UT_CMusAvaDefaultOptionHandler_StatusL() + { + EUNIT_ASSERT( iOptionDefaultHandler->State() == MMusAvaObserver::EMusAvaStatusAvailable ); + } + +void UT_CMusAvaDefaultOptionHandler::UT_CMusAvaDefaultOptionHandler_StopL() + { + iOptionDefaultHandler->Stop(); + } + +void UT_CMusAvaDefaultOptionHandler::UT_CMusAvaDefaultOptionHandler_IncomingOptionRequestLL() + { + CSIPServerTransaction* serverTransaction = + CSIPServerTransaction::NewL( SIPStrings::StringF( SipStrConsts::EOptions ) ); + CleanupStack::PushL( serverTransaction ); + + TUriParser8 Uri; + User::LeaveIfError( Uri.Parse( KCapabilityTestAddress_A ) ); + + CUri8* uri = CUri8::NewLC( Uri ); + + CSIPRequestElements* requestelements = CSIPRequestElements::NewL( uri ); + CleanupStack::Pop( uri ); + CleanupStack::PushL( requestelements ); + requestelements->SetMethodL( SIPStrings::StringF( SipStrConsts::EOptions ) ); + serverTransaction->SetRequestElements( requestelements ); + CleanupStack::Pop( requestelements ); + + MultimediaSharingSettings::SetActivationSettingL( MusSettingsKeys::EAlwaysActive ); + TRAPD( ret, iOptionDefaultHandler->IncomingOptionRequestL( serverTransaction ) ); + if ( ret == KErrNoMemory ) User::Leave( ret ); + EUNIT_ASSERT( ret == KErrNone ); + + TUint statusCode = iStorage->iClientResponse->StatusCode(); + EUNIT_ASSERT( statusCode == KMUSAVASIPTemporarilyUnavailable ); + + iSettingsObserverImp->iOptionAllowed = ETrue; + iAvailabilityObserver->AvailabilityChanged( + MMusAvaObserver::EMusAvaDefaultOptionHandler, + MMusAvaObserver::EMusAvaStatusAvailable ); + TRAP( ret, iOptionDefaultHandler->IncomingOptionRequestL( serverTransaction ) ); + if ( ret == KErrNoMemory ) User::Leave( ret ); + EUNIT_ASSERT( ret == KErrNone ); + + iSettingsObserverImp->iOptionAllowed = EFalse; + MultimediaSharingSettings::SetActivationSettingL( MusSettingsKeys::EActiveInHomeNetworks ); + TRAP( ret, iOptionDefaultHandler->IncomingOptionRequestL( serverTransaction ) ); + if ( ret == KErrNoMemory ) User::Leave( ret ); + EUNIT_ASSERT( ret == KErrNone ); + + MultimediaSharingSettings::SetActivationSettingL( MusSettingsKeys::ENever ); + TRAP( ret, iOptionDefaultHandler->IncomingOptionRequestL( serverTransaction ) ); + if ( ret == KErrNoMemory ) User::Leave( ret ); + EUNIT_ASSERT( ret == KErrNone ); + statusCode = iStorage->iClientResponse->StatusCode(); + EUNIT_ASSERT( statusCode == KMUSAVASIPDecline ); + + CleanupStack::PopAndDestroy( serverTransaction ); + } + +void UT_CMusAvaDefaultOptionHandler::UT_CMusAvaDefaultOptionHandler_IncomingOptionRequestLOpSpecificL() + { + CSIPServerTransaction* serverTransaction = + CSIPServerTransaction::NewL( SIPStrings::StringF( SipStrConsts::EOptions ) ); + CleanupStack::PushL( serverTransaction ); + TUriParser8 Uri; + User::LeaveIfError( Uri.Parse( KCapabilityTestAddress_A ) ); + CUri8* uri = CUri8::NewLC( Uri ); + CSIPRequestElements* requestelements = CSIPRequestElements::NewL( uri ); + CleanupStack::Pop( uri ); + CleanupStack::PushL( requestelements ); + requestelements->SetMethodL( SIPStrings::StringF( SipStrConsts::EOptions ) ); + serverTransaction->SetRequestElements( requestelements ); + CleanupStack::Pop( requestelements ); + + TRAPD( ret, iOptionDefaultHandler->IncomingOptionRequestL( serverTransaction ) ); + if ( ret == KErrNoMemory ) User::Leave( ret ); + EUNIT_ASSERT( ret == KErrNone ); + TUint statusCode = iStorage->iClientResponse->StatusCode(); + EUNIT_ASSERT( statusCode == KMUSAVASIP200 ); + + CleanupStack::PopAndDestroy( serverTransaction ); + + } + +void UT_CMusAvaDefaultOptionHandler::UT_CMusAvaDefaultOptionHandler_ResponseLL() + { + TInt statusCode = KMUSAVASIPDecline; + RStringF reasonPhrase = + SIPStrings::StringF( SipStrConsts::EPhraseDecline); + CSIPResponseElements* respElem = + CSIPResponseElements::NewL( statusCode, reasonPhrase ); + CleanupStack::PushL( respElem ); + + CSIPServerTransaction* serverTransaction = + CSIPServerTransaction::NewL( SIPStrings::StringF( SipStrConsts::EOptions ) ); + CleanupStack::PushL( serverTransaction ); + + TUriParser8 Uri; + User::LeaveIfError( Uri.Parse( KCapabilityTestAddress_A ) ); + + CUri8* uri = CUri8::NewLC( Uri ); + + CSIPRequestElements* requestelements = CSIPRequestElements::NewL( uri ); + CleanupStack::Pop( uri ); + CleanupStack::PushL( requestelements ); + requestelements->SetMethodL( SIPStrings::StringF( SipStrConsts::EOptions ) ); + serverTransaction->SetRequestElements( requestelements ); + CleanupStack::Pop( requestelements ); + + //This transaction is not client TR + serverTransaction->iIsClientTransaction = ETrue; + serverTransaction->iState = CSIPTransactionBase::ETerminated; + TRAPD( error, iOptionDefaultHandler->ResponseL( respElem, serverTransaction ) ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT( error == KErrNotReady ); + + // Transaction state proceeding + serverTransaction->ChangeState( CSIPTransactionBase::EProceeding ); + TRAP( error, iOptionDefaultHandler->ResponseL( respElem, serverTransaction ) ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT( error == KErrNone ); + + CleanupStack::PopAndDestroy( serverTransaction ); + CleanupStack::Pop( respElem ); + + //Sent response + serverTransaction = + CSIPServerTransaction::NewL( SIPStrings::StringF( SipStrConsts::EOptions ) ); + CleanupStack::PushL( serverTransaction ); + respElem = + CSIPResponseElements::NewL( statusCode, reasonPhrase ); + CleanupStack::PushL( respElem ); + + uri = CUri8::NewLC( Uri ); + requestelements = CSIPRequestElements::NewL( uri ); + CleanupStack::Pop( uri ); + CleanupStack::PushL( requestelements ); + requestelements->SetMethodL( SIPStrings::StringF( SipStrConsts::EOptions ) ); + serverTransaction->SetRequestElements( requestelements ); + CleanupStack::Pop( requestelements ); + + serverTransaction->iIsClientTransaction = ETrue; + serverTransaction->iState = CSIPTransactionBase::ETrying; + iOptionDefaultHandler->ResponseL( respElem, serverTransaction ); + CleanupStack::Pop( respElem ); + statusCode = iStorage->iClientResponse->StatusCode(); + EUNIT_ASSERT( statusCode == KMUSAVASIPDecline ); + + CleanupStack::PopAndDestroy( serverTransaction ); + serverTransaction = NULL; + + // response not allowed + serverTransaction = + CSIPServerTransaction::NewL( SIPStrings::StringF( SipStrConsts::EAck ) ); + CleanupStack::PushL( serverTransaction ); + respElem = + CSIPResponseElements::NewL( statusCode, reasonPhrase ); + CleanupStack::PushL( respElem ); + + TRAP( error, iOptionDefaultHandler->ResponseL( respElem, serverTransaction ) ); + if ( error == KErrNoMemory ) User::Leave( error ); + CleanupStack::PopAndDestroy( respElem ); + EUNIT_ASSERT( error == KErrNotReady ); + + CleanupStack::PopAndDestroy( serverTransaction ); + } + +void UT_CMusAvaDefaultOptionHandler::UT_CMusAvaDefaultOptionHandler_NoCapabilityResponseLL() + { + CSIPServerTransaction* serverTransaction = + CSIPServerTransaction::NewL( SIPStrings::StringF( SipStrConsts::EOptions ) ); + CleanupStack::PushL( serverTransaction ); + + TUriParser8 Uri; + User::LeaveIfError( Uri.Parse( KCapabilityTestAddress_A ) ); + + CUri8* uri = CUri8::NewLC( Uri ); + + CSIPRequestElements* requestelements = CSIPRequestElements::NewL( uri ); + CleanupStack::Pop( uri ); + CleanupStack::PushL( requestelements ); + requestelements->SetMethodL( SIPStrings::StringF( SipStrConsts::EOptions ) ); + serverTransaction->SetRequestElements( requestelements ); + CleanupStack::Pop( requestelements ); + + serverTransaction->iIsClientTransaction = ETrue; + serverTransaction->iState = CSIPTransactionBase::ETrying; + iSettingsObserverImp->iOptionAllowed = ETrue; + iOptionDefaultHandler->NoCapabilityResponseL( serverTransaction, + KMUSAVASIPTemporarilyUnavailable, + SipStrConsts::EPhraseTemporarilyNotAvailable ); + TUint statusCode = iStorage->iClientResponse->StatusCode(); + EUNIT_ASSERT( statusCode == KMUSAVASIPTemporarilyUnavailable ); + + CleanupStack::PopAndDestroy( serverTransaction ); + } + +void UT_CMusAvaDefaultOptionHandler::UT_CMusAvaDefaultOptionHandler_NoCapabilityResponseLOpSpecificL() + { + CSIPServerTransaction* serverTransaction = + CSIPServerTransaction::NewL( SIPStrings::StringF( SipStrConsts::EOptions ) ); + CleanupStack::PushL( serverTransaction ); + + TUriParser8 Uri; + User::LeaveIfError( Uri.Parse( KCapabilityTestAddress_A ) ); + + CUri8* uri = CUri8::NewLC( Uri ); + + CSIPRequestElements* requestelements = CSIPRequestElements::NewL( uri ); + CleanupStack::Pop( uri ); + CleanupStack::PushL( requestelements ); + requestelements->SetMethodL( SIPStrings::StringF( SipStrConsts::EOptions ) ); + serverTransaction->SetRequestElements( requestelements ); + CleanupStack::Pop( requestelements ); + + serverTransaction->iIsClientTransaction = ETrue; + serverTransaction->iState = CSIPTransactionBase::ETrying; + iSettingsObserverImp->iOptionAllowed = ETrue; + iOptionDefaultHandler->NoCapabilityResponseL( serverTransaction, + KMUSAVASIPTemporarilyUnavailable, + SipStrConsts::EPhraseTemporarilyNotAvailable ); + TUint statusCode = iStorage->iClientResponse->StatusCode(); + EUNIT_ASSERT( statusCode == KMUSAVASIP200 ); + + CleanupStack::PopAndDestroy( serverTransaction ); + } + +void UT_CMusAvaDefaultOptionHandler::UT_CMusAvaDefaultOptionHandler_CreateResponseLL() + { + CSIPServerTransaction* serverTransaction = + CSIPServerTransaction::NewL( SIPStrings::StringF( SipStrConsts::EOptions ) ); + CleanupStack::PushL( serverTransaction ); + TUriParser8 Uri; + User::LeaveIfError( Uri.Parse( KMUSAVATESTSipAddress() ) ); + + CUri8* uri = CUri8::NewLC( Uri ); + CSIPRequestElements* requestelements = CSIPRequestElements::NewL( uri ); + CleanupStack::Pop( uri ); + CleanupStack::PushL( requestelements ); + serverTransaction->SetRequestElements( requestelements ); + CleanupStack::Pop( requestelements ); + + //Sent response + serverTransaction->iIsClientTransaction = ETrue; + serverTransaction->iState = CSIPTransactionBase::ETrying; + iSettingsObserverImp->iOptionAllowed = ETrue; + CSIPResponseElements* resp = + iOptionDefaultHandler->CreateResponseL( *serverTransaction ); + CleanupStack::PopAndDestroy( serverTransaction ); + CleanupStack::PushL( resp ); + EUNIT_ASSERT( resp->MessageElements().Content().Length() > 0); + EUNIT_ASSERT( resp->StatusCode() == KMUSAVASIP200 ); + CleanupStack::PopAndDestroy( resp ); + } + + +void UT_CMusAvaDefaultOptionHandler::UT_CMusAvaDefaultOptionHandler_TimedOutL() + { + CSIPServerTransaction* serverTransaction = + CSIPServerTransaction::NewL( SIPStrings::StringF( SipStrConsts::EOptions ) ); + EUNIT_ASSERT_EQUALS( + iOptionDefaultHandler->TimedOut( *serverTransaction ), + KErrNotSupported ); + delete serverTransaction; + } + + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusAvaDefaultOptionHandler, + "CMusAvaDefaultOptionHandler", + "UNIT" ) + +EUNIT_TEST( + "NewL - test ", + "CMusAvaDefaultOptionHandler", + "NewL", + "FUNCTIONALITY", + SetupL,UT_CMusAvaDefaultOptionHandler_NewLL, Teardown) + +EUNIT_TEST( + "IncomingRequest - test ", + "CMusAvaDefaultOptionHandler", + "IncomingRequest", + "FUNCTIONALITY", + SetupL,UT_CMusAvaDefaultOptionHandler_IncomingRequestL, Teardown) + +EUNIT_TEST( + "DoExecuteL - test ", + "CMusAvaDefaultOptionHandler", + "DoExecuteL", + "FUNCTIONALITY", + SetupL,UT_CMusAvaDefaultOptionHandler_DoExecuteLL, Teardown) + +EUNIT_TEST( + "Name - test ", + "CMusAvaDefaultOptionHandler", + "Name", + "FUNCTIONALITY", + SetupL,UT_CMusAvaDefaultOptionHandler_NameL, Teardown) + + +EUNIT_TEST( + "Status - test ", + "CMusAvaDefaultOptionHandler", + "Status", + "FUNCTIONALITY", + SetupL,UT_CMusAvaDefaultOptionHandler_StatusL, Teardown) + +EUNIT_TEST( + "Stop - test ", + "CMusAvaDefaultOptionHandler", + "Stop", + "FUNCTIONALITY", + SetupL,UT_CMusAvaDefaultOptionHandler_StopL, Teardown) + +EUNIT_TEST( + "IncomingOptionRequestL - test ", + "CMusAvaDefaultOptionHandler", + "IncomingOptionRequestL", + "FUNCTIONALITY", + SetupL,UT_CMusAvaDefaultOptionHandler_IncomingOptionRequestLL, Teardown) + +EUNIT_TEST( + "IncomingOptionRequestL - Op specific test ", + "CMusAvaDefaultOptionHandler", + "IncomingOptionRequestL", + "FUNCTIONALITY", + SetupOpSpecificL, UT_CMusAvaDefaultOptionHandler_IncomingOptionRequestLOpSpecificL, Teardown) + +EUNIT_TEST( + "ResponseL - test ", + "CMusAvaDefaultOptionHandler", + "ResponseL", + "FUNCTIONALITY", + SetupL,UT_CMusAvaDefaultOptionHandler_ResponseLL, Teardown) + +EUNIT_TEST( + "NoCapabilityResponseL - test ", + "CMusAvaDefaultOptionHandler", + "NoCapabilityResponseL", + "FUNCTIONALITY", + SetupL,UT_CMusAvaDefaultOptionHandler_NoCapabilityResponseLL, Teardown) + +EUNIT_TEST( + "NoCapabilityResponseL Op specific- test ", + "CMusAvaDefaultOptionHandler", + "NoCapabilityResponseL", + "FUNCTIONALITY", + SetupOpSpecificL,UT_CMusAvaDefaultOptionHandler_NoCapabilityResponseLOpSpecificL, Teardown) + +EUNIT_TEST( + "CreateResponseL - test ", + "CMusAvaDefaultOptionHandler", + "CreateResponseL", + "FUNCTIONALITY", + SetupL,UT_CMusAvaDefaultOptionHandler_CreateResponseLL, Teardown) + +EUNIT_TEST( + "TimedOut - test ", + "CMusAvaDefaultOptionHandler", + "TimedOut", + "FUNCTIONALITY", + SetupL,UT_CMusAvaDefaultOptionHandler_TimedOutL, Teardown) + + +EUNIT_END_TEST_TABLE + +// END OF FILE diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaInviteHandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaInviteHandler.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,269 @@ +/* +* 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: +* +*/ + + +// CLASS HEADER +#include "UT_CMusAvaInviteHandler.h" +#include "musavaavailabilityobserver.h" +#include "musavaavailabilityobserverimp.h" +#include "musavasettingsimp.h" +#include "musavaInviteresponderobserverimp.h" +#include "musavainviteresponder.h" +#include "muslogger.h" +#include "musavaobserverimp.h" +#include "musavacapabilitytesthelper.h" //remove compilation warning + + +// EXTERNAL INCLUDES +#include +#include +#include +#include +#include +#include +#include +// INTERNAL INCLUDES +#include "musavainvitehandler.h" + + + +// CONSTRUCTION +UT_CMusAvaInviteHandler* UT_CMusAvaInviteHandler::NewL() + { + UT_CMusAvaInviteHandler* self = UT_CMusAvaInviteHandler::NewLC(); + CleanupStack::Pop(); + + return self; + } + +UT_CMusAvaInviteHandler* UT_CMusAvaInviteHandler::NewLC() + { + UT_CMusAvaInviteHandler* self = new( ELeave ) UT_CMusAvaInviteHandler(); + CleanupStack::PushL( self ); + self->ConstructL(); + + return self; + } + +// Destructor (virtual by CBase) +UT_CMusAvaInviteHandler::~UT_CMusAvaInviteHandler() + { + } + +// Default constructor +UT_CMusAvaInviteHandler::UT_CMusAvaInviteHandler() + { + } + +// Second phase construct +void UT_CMusAvaInviteHandler::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + +// METHODS + +void UT_CMusAvaInviteHandler::SetupL( ) + { + SIPStrings::OpenL(); + iAvailabilityObserver = CMusAvaAvailabilityObserverImp::NewL(); + iConcreteSettings = CMusAvaSettingsImp::NewL(); + iInviteHandler = CMusAvaInviteHandler::NewL( *iAvailabilityObserver, + *iConcreteSettings ); + } + +void UT_CMusAvaInviteHandler::Teardown( ) + { + delete iAvailabilityObserver; + delete iConcreteSettings; + delete iInviteHandler; + SIPStrings::Close(); + } + +void UT_CMusAvaInviteHandler::UT_CMusAvaInviteHandler_NewLL( ) + { + EUNIT_ASSERT( iInviteHandler ); + } +void UT_CMusAvaInviteHandler::UT_CMusAvaInviteHandler_IncomingRequestL() + { + CSIPServerTransaction* transaction = + CSIPServerTransaction::NewL( SIPStrings::StringF( SipStrConsts::EInvite ) ); + CleanupStack::PushL( transaction ); + transaction->iIsClientTransaction = ETrue; + transaction->iState = CSIPTransactionBase::ETrying; + EUNIT_ASSERT( !iInviteHandler->IncomingRequest( transaction ) ); + CleanupStack::Pop( transaction ); + + // Request not INVITE + transaction = + CSIPServerTransaction::NewL( SIPStrings::StringF( SipStrConsts::EOptions ) ); + CleanupStack::PushL( transaction ); + transaction->iIsClientTransaction = ETrue; + transaction->iState = CSIPTransactionBase::ETrying; + EUNIT_ASSERT( iInviteHandler->IncomingRequest( transaction ) == KErrNotFound ); + CleanupStack::PopAndDestroy( transaction ); + } + +void UT_CMusAvaInviteHandler::UT_CMusAvaInviteHandler_DoExecuteLL() + { + TInt ret = 0; + TRAPD( error, iInviteHandler->DoExecuteL() ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT ( error == KErrNone ); + + EUNIT_ASSERT( iInviteHandler->State() == MMusAvaObserver::EMusAvaStatusAvailable ); + } + +void UT_CMusAvaInviteHandler::UT_CMusAvaInviteHandler_NameL() + { + EUNIT_ASSERT( iInviteHandler->Name() == MMusAvaObserver::EMusAvaInviteHandler ); + } + + +void UT_CMusAvaInviteHandler::UT_CMusAvaInviteHandler_StopL() + { + iInviteHandler->Stop(); + EUNIT_ASSERT( iInviteHandler->iResponders.Count() == 0 ); + } + +void UT_CMusAvaInviteHandler::UT_CMusAvaInviteHandler_InvitationReceivedLL() + { + //Fails + CSIPServerTransaction* transaction2 = + CSIPServerTransaction::NewL( SIPStrings::StringF( SipStrConsts::EInvite ) ); + CleanupStack::PushL( transaction2 ); + transaction2->iState = CSIPTransactionBase::ETerminated; + iInviteHandler->InvitationReceivedL( transaction2 ); + EUNIT_ASSERT( iInviteHandler->iResponders.Count() == 0 ); + CleanupStack::Pop( transaction2 ); + //Ok + CSIPServerTransaction* transaction = + CSIPServerTransaction::NewL( SIPStrings::StringF( SipStrConsts::EInvite ) ); + CleanupStack::PushL( transaction ); + transaction->iIsClientTransaction = EFalse; + transaction->iState = CSIPTransactionBase::ETrying; + TRAPD( error, iInviteHandler->InvitationReceivedL( transaction ) ); + if ( error == KErrNoMemory ) User::Leave( error ); + CleanupStack::Pop( transaction ); + TInt count = NULL; + EUNIT_GET_ALLOC_DECORATOR_FAILCOUNT( count ); + if ( count > 0 && iInviteHandler->iResponders.Count() == 0 ) + { + User::Leave( KErrNoMemory ); + } + EUNIT_ASSERT( iInviteHandler->iResponders.Count() > 0 ); + } + +void UT_CMusAvaInviteHandler::UT_CMusAvaInviteHandler_InvitationAnsweredLDL() + { + //not removed, because response it not completed + CMusAvaInviteResponderObserverImp* responderObserverImp = CMusAvaInviteResponderObserverImp::NewL(); + CleanupStack::PushL( responderObserverImp ); + CSIPServerTransaction* serverTransaction = CSIPServerTransaction::NewL( SIPStrings::StringF( SipStrConsts::EInvite ) ); + CleanupStack::PushL( serverTransaction ); + CMusAvaInviteResponder* inviteResponder = CMusAvaInviteResponder::NewL( serverTransaction, + *responderObserverImp ); + CleanupStack::Pop( serverTransaction ); + CleanupStack::PushL( inviteResponder ); + User::LeaveIfError( iInviteHandler->iResponders.Append( inviteResponder ) ); + CleanupStack::Pop( inviteResponder ); + iInviteHandler->InvitationAnsweredLD( ); + EUNIT_ASSERT( iInviteHandler->iResponders.Count() > 0 ); + iInviteHandler->iResponders.ResetAndDestroy(); + CleanupStack::PopAndDestroy( responderObserverImp ); + //Ok + CMusAvaInviteResponderObserverImp* responderObserverImp2 = CMusAvaInviteResponderObserverImp::NewL(); + CleanupStack::PushL( responderObserverImp2 ); + + CSIPServerTransaction* serverTransaction2 = CSIPServerTransaction::NewL( SIPStrings::StringF( SipStrConsts::EInvite ) ); + CleanupStack::PushL( serverTransaction2 ); + CMusAvaInviteResponder* inviteResponder2 = CMusAvaInviteResponder::NewL( serverTransaction2, + *responderObserverImp2 ); + CleanupStack::Pop( serverTransaction2 ); + CleanupStack::PushL( inviteResponder2 ); + User::LeaveIfError( iInviteHandler->iResponders.Append( inviteResponder2 ) ); + CleanupStack::Pop( inviteResponder2 ); + serverTransaction2->iState = CSIPTransactionBase::ETerminated; + iInviteHandler->InvitationAnsweredLD( ); + EUNIT_ASSERT( iInviteHandler->iResponders.Count() == 0 ); + CleanupStack::PopAndDestroy( responderObserverImp2 ); + } + + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusAvaInviteHandler, + "CMusAvaInviteHandler", + "UNIT" ) + +EUNIT_TEST( + "NewL - test ", + "CMusAvaInviteHandler", + "NewL", + "FUNCTIONALITY", + SetupL,UT_CMusAvaInviteHandler_NewLL, Teardown) + +EUNIT_TEST( + "IncomingRequest - test ", + "CMusAvaInviteHandler", + "IncomingRequest", + "FUNCTIONALITY", + SetupL,UT_CMusAvaInviteHandler_IncomingRequestL, Teardown) + +EUNIT_TEST( + "DoExecuteL - test ", + "CMusAvaInviteHandler", + "DoExecuteL", + "FUNCTIONALITY", + SetupL,UT_CMusAvaInviteHandler_DoExecuteLL, Teardown) + +EUNIT_TEST( + "Name - test ", + "CMusAvaInviteHandler", + "Name", + "FUNCTIONALITY", + SetupL,UT_CMusAvaInviteHandler_NameL, Teardown) + + +EUNIT_TEST( + "Stop - test ", + "CMusAvaInviteHandler", + "Stop", + "FUNCTIONALITY", + SetupL,UT_CMusAvaInviteHandler_StopL, Teardown) + + EUNIT_TEST( + "InvitationReceivedL - test ", + "CMusAvaInviteHandler", + "InvitationReceivedL", + "FUNCTIONALITY", + SetupL,UT_CMusAvaInviteHandler_InvitationReceivedLL, Teardown) + + EUNIT_TEST( + "InvitationAnsweredLD - test ", + "CMusAvaInviteHandler", + "InvitationAnsweredLD", + "FUNCTIONALITY", + SetupL,UT_CMusAvaInviteHandler_InvitationAnsweredLDL, Teardown) + + +EUNIT_END_TEST_TABLE + +// END OF FILE diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaInviteResponder.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaInviteResponder.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,263 @@ +/* +* 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: +* +*/ + + +// CLASS HEADER +#include "UT_CMusAvaInviteResponder.h" +#include "sipservertransaction.h" +#include "siptransactionbase.h" +#include "musavaInviteresponderobserverimp.h" +#include "siptransactionbase.h" +#include "muslogger.h" +#include "CSipSseTestTls.h" +#include "musavacapabilitytesthelper.h" //remove compilation warning + +// EXTERNAL INCLUDES +#include +#include +#include +#include +#include +#include +// INTERNAL INCLUDES +#include "musavainviteresponder.h" + + +const TUint KMUSAVA603 = 603; // Decline/Reject +_LIT8( KMusAvaStatusDecline, "Decline" ); + +// CONSTRUCTION +UT_CMusAvaInviteResponder* UT_CMusAvaInviteResponder::NewL() + { + UT_CMusAvaInviteResponder* self = UT_CMusAvaInviteResponder::NewLC(); + CleanupStack::Pop(); + + return self; + } + +UT_CMusAvaInviteResponder* UT_CMusAvaInviteResponder::NewLC() + { + UT_CMusAvaInviteResponder* self = new( ELeave ) UT_CMusAvaInviteResponder(); + CleanupStack::PushL( self ); + + self->ConstructL(); + + return self; + } + +// Destructor (virtual by CBase) +UT_CMusAvaInviteResponder::~UT_CMusAvaInviteResponder() + { + } + +// Default constructor +UT_CMusAvaInviteResponder::UT_CMusAvaInviteResponder() + { + } + +// Second phase construct +void UT_CMusAvaInviteResponder::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + +// METHODS + + + +void UT_CMusAvaInviteResponder::SetupL( ) + { + iResponderObserverImp = CMusAvaInviteResponderObserverImp::NewL(); + SIPStrings::OpenL(); + + CSIPServerTransaction* serverTransaction = CSIPServerTransaction::NewL( SIPStrings::StringF( SipStrConsts::EInvite ) ); + CleanupStack::PushL( serverTransaction ); + iInviteResponder = CMusAvaInviteResponder::NewL( serverTransaction, + *iResponderObserverImp ); + CleanupStack::Pop( serverTransaction ); + } + +void UT_CMusAvaInviteResponder::Teardown( ) + { + delete iResponderObserverImp; + delete iInviteResponder; + SIPStrings::Close(); + } + + +void UT_CMusAvaInviteResponder::UT_CMusAvaInviteResponder_NewLL() + { + EUNIT_ASSERT( iInviteResponder ); + } + +void UT_CMusAvaInviteResponder::UT_CMusAvaInviteResponder_AnswerLL() + { + //Busy + iResponderObserverImp->iApplicationState = MMusAvaSettingsObserver::EApplicationIsRunning; + iInviteResponder->iTransaction->iIsClientTransaction = EFalse; + iInviteResponder->AnswerL(); + EUNIT_ASSERT( iInviteResponder->iTransaction->iResponseElements->StatusCode() == 486 ); + + ////Decline + iResponderObserverImp->iApplicationState = MMusAvaSettingsObserver::EApplicationStateNotDefined; + iInviteResponder->iTransaction->iIsClientTransaction = EFalse; + iInviteResponder->AnswerL(); + EUNIT_ASSERT( iInviteResponder->iTransaction->iResponseElements->StatusCode() == 603 ); + } + +void UT_CMusAvaInviteResponder::UT_CMusAvaInviteResponder_SendResponseLL() + { + iInviteResponder->iTransaction->iIsClientTransaction = EFalse; + iInviteResponder->SendResponseL( KMUSAVA603, KMusAvaStatusDecline); + EUNIT_ASSERT( iInviteResponder->iTransaction->iResponseElements->StatusCode() == 603 ); + } + + +void UT_CMusAvaInviteResponder::UT_CMusAvaInviteResponder_ResponseCompleteL() + { + //Response is not client transaction + iInviteResponder->iTransaction->iState = CSIPTransactionBase::ETrying; + EUNIT_ASSERT( !iInviteResponder->ResponseComplete() ); + + //Response is trying state + delete iInviteResponder->iTransaction; + iInviteResponder->iTransaction = NULL; + iInviteResponder->iTransaction = CSIPServerTransaction::NewL( SIPStrings::StringF( SipStrConsts::EAck ) ); + iInviteResponder->iTransaction->iState = CSIPTransactionBase::ETerminated; + EUNIT_ASSERT( !iInviteResponder->ResponseComplete() ); + + //OK + delete iInviteResponder->iTransaction; + iInviteResponder->iTransaction = NULL; + iInviteResponder->iTransaction = CSIPServerTransaction::NewL( SIPStrings::StringF( SipStrConsts::EInvite ) ); + iInviteResponder->iTransaction->iState = CSIPTransactionBase::ETerminated; + EUNIT_ASSERT( iInviteResponder->ResponseComplete() ); + } + +void UT_CMusAvaInviteResponder::UT_CMusAvaInviteResponder_ResponseLL() + { + CSIPResponseElements* responseElements = NULL; + RStringF responseString; + //It is not a client transaction + iInviteResponder->iTransaction->iIsClientTransaction = ETrue; + responseString = SIPStrings::Pool().OpenFStringL( KMusAvaStatusDecline() ); + CleanupClosePushL( responseString ); + responseElements = CSIPResponseElements::NewLC( KMUSAVA603, responseString ); + TRAPD( error, iInviteResponder->ResponseL( responseElements ) ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT( error != KErrNone ); + + CleanupStack::PopAndDestroy( responseElements ); + CleanupStack::PopAndDestroy(); //responseString + + //Response not sent, becase is in ECalling state + iInviteResponder->iTransaction->iIsClientTransaction = ETrue; + iInviteResponder->iTransaction->iState = CSIPTransactionBase::ECalling; + responseString = SIPStrings::Pool().OpenFStringL( KMusAvaStatusDecline() ); + CleanupClosePushL( responseString ); + responseElements = CSIPResponseElements::NewLC( KMUSAVA603, responseString ); + TRAP( error, iInviteResponder->ResponseL( responseElements ) ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT( error != KErrNone ); + + CleanupStack::PopAndDestroy( responseElements ); + CleanupStack::PopAndDestroy(); //responseString + + //Response not sent, becase is not allowed + delete iInviteResponder->iTransaction; + iInviteResponder->iTransaction = NULL; + iInviteResponder->iTransaction = CSIPServerTransaction::NewL( SIPStrings::StringF( SipStrConsts::EAck ) ); + iInviteResponder->iTransaction->iIsClientTransaction = ETrue; + iInviteResponder->iTransaction->iState = CSIPTransactionBase::ETrying; + responseString = SIPStrings::Pool().OpenFStringL( KMusAvaStatusDecline() ); + CleanupClosePushL( responseString ); + responseElements = CSIPResponseElements::NewLC( KMUSAVA603, responseString ); + TRAP( error, iInviteResponder->ResponseL( responseElements ) ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT( error != KErrNone ); + CleanupStack::PopAndDestroy( responseElements ); + CleanupStack::PopAndDestroy(); //responseString + + //Ok case + delete iInviteResponder; + iInviteResponder = NULL; + CSIPServerTransaction* serverTransaction = CSIPServerTransaction::NewL( SIPStrings::StringF( SipStrConsts::EInvite ) ); + CleanupStack::PushL( serverTransaction ); + iInviteResponder = CMusAvaInviteResponder::NewL( serverTransaction, + *iResponderObserverImp ); + CleanupStack::Pop( serverTransaction ); + iInviteResponder->iTransaction->iIsClientTransaction = EFalse; + iInviteResponder->iTransaction->iState = CSIPTransactionBase::ETrying; + responseString = SIPStrings::Pool().OpenFStringL( KMusAvaStatusDecline() ); + CleanupClosePushL( responseString ); + responseElements = CSIPResponseElements::NewLC( KMUSAVA603, responseString ); + iInviteResponder->ResponseL( responseElements ); + CleanupStack::Pop( responseElements ); + CleanupStack::PopAndDestroy(); //responseString + EUNIT_ASSERT( iInviteResponder->iTransaction->iResponseElements->StatusCode() == 603 ); + } + + + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusAvaInviteResponder, + "CMusAvaInviteResponder", + "UNIT" ) + +EUNIT_TEST( + "NewL - test ", + "CMusAvaSip", + "NewL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaInviteResponder_NewLL, Teardown) + +EUNIT_TEST( + "AnswerL - test ", + "CMusAvaInviteResponder", + "AnswerL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaInviteResponder_AnswerLL, Teardown) + +EUNIT_TEST( + "SendResponseL - test ", + "CMusAvaInviteResponder", + "SendResponseL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaInviteResponder_SendResponseLL, Teardown) + +EUNIT_TEST( + "ResponseComplete - test ", + "CMusAvaInviteResponder", + "ResponseComplete", + "FUNCTIONALITY", + SetupL, UT_CMusAvaInviteResponder_ResponseCompleteL, Teardown) + +EUNIT_TEST( + "ResponseL - test ", + "CMusAvaInviteResponder", + "ResponseL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaInviteResponder_ResponseLL, Teardown) + + +EUNIT_END_TEST_TABLE + +// END OF FILE diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaNetworkAvailability.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaNetworkAvailability.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,330 @@ +/* +* 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: +* +*/ + + +// CLASS HEADER +#include "UT_CMusAvaNetworkAvailability.h" + +// EXTERNAL INCLUDES +#include +#include +#include + + +// INTERNAL INCLUDES +#include "musavanetworkavailability.h" +#include "musavaavailabilityobserverimp.h" +#include "musavasettingsimp.h" +#include "mussesseioninformationapi.h" + +_LIT( KTelNumber, "12345" ); +_LIT( KSipUri, "sip:uri@host" ); + +// CONSTRUCTION +UT_CMusAvaNetworkAvailability* UT_CMusAvaNetworkAvailability::NewL() + { + UT_CMusAvaNetworkAvailability* self = UT_CMusAvaNetworkAvailability::NewLC(); + CleanupStack::Pop(); + + return self; + } + +UT_CMusAvaNetworkAvailability* UT_CMusAvaNetworkAvailability::NewLC() + { + UT_CMusAvaNetworkAvailability* self = new( ELeave ) UT_CMusAvaNetworkAvailability(); + CleanupStack::PushL( self ); + + self->ConstructL(); + + return self; + } + +// Destructor (virtual by CBase) +UT_CMusAvaNetworkAvailability::~UT_CMusAvaNetworkAvailability() + { + User::LeaveIfError( RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + 0 )); + } + +// Default constructor +UT_CMusAvaNetworkAvailability::UT_CMusAvaNetworkAvailability() + { + } + +// Second phase construct +void UT_CMusAvaNetworkAvailability::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + RProperty::Define( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + RProperty::EInt, + 0 ); + + RProperty::Define( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusTelNumber, + RProperty::EText, + 0 ); + + RProperty::Define( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallDirection, + RProperty::EInt, + 0 ); + + } + +// METHODS + + + +void UT_CMusAvaNetworkAvailability::SetupL() + { + iAvailabilityObserver = CMusAvaAvailabilityObserverImp::NewL(); + iSettings = CMusAvaSettingsImp::NewL(); + iNetworkAvailability = CMusAvaNetworkAvailability::NewL( + *iAvailabilityObserver, + *iSettings ); + } + +void UT_CMusAvaNetworkAvailability::Teardown() + { + delete iNetworkAvailability; + delete iSettings; + delete iAvailabilityObserver; + PropertyHelper::Close(); + } + +void UT_CMusAvaNetworkAvailability::UT_CMusAvaNetworkAvailability_DoExecuteLL() + { + // no call + + User::LeaveIfError( RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + 0 )); + + iNetworkAvailability->DoExecuteL(); + EUNIT_ASSERT_EQUALS( iNetworkAvailability->State(), + MMusAvaObserver::EMusAvaStatusNoCall ); + + // one call, tel number given + + User::LeaveIfError( RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + 1 )); + + User::LeaveIfError( RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusTelNumber, + KTelNumber )); + + User::LeaveIfError( RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallDirection, + 0 )); + + iNetworkAvailability->DoExecuteL(); + EUNIT_ASSERT_EQUALS( iNetworkAvailability->State(), + MMusAvaObserver::EMusAvaStatusAvailable ); + EUNIT_ASSERT_EQUALS( iSettings->TelNumber(), KTelNumber ); + const MDesCArray& sipAddresses = iSettings->SipAddresses(); + EUNIT_ASSERT_EQUALS( sipAddresses.MdcaCount(), 0 ); + EUNIT_ASSERT_EQUALS( iSettings->CallDirection(), 0 ); + } + +void UT_CMusAvaNetworkAvailability::UT_CMusAvaNetworkAvailability_DoExecuteL_SipUriL() + { + // one call, SIP URI given + User::LeaveIfError( RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + 1 )); + + User::LeaveIfError( RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusTelNumber, + KSipUri )); + + User::LeaveIfError( RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallDirection, + 0 )); + + iNetworkAvailability->DoExecuteL(); + EUNIT_ASSERT_EQUALS( iNetworkAvailability->State(), + MMusAvaObserver::EMusAvaStatusAvailable ); + EUNIT_ASSERT_EQUALS( iSettings->TelNumber(), KNullDesC ); + + const MDesCArray& sipAddresses = iSettings->SipAddresses(); + EUNIT_ASSERT_EQUALS( sipAddresses.MdcaCount(), 1 ); + EUNIT_ASSERT_EQUALS( sipAddresses.MdcaPoint( 0 ), KSipUri ); + + EUNIT_ASSERT_EQUALS( iSettings->CallDirection(), 0 ); + } + +void UT_CMusAvaNetworkAvailability::UT_CMusAvaNetworkAvailability_StopL() + { + iNetworkAvailability->Stop(); + EUNIT_ASSERT_EQUALS( iNetworkAvailability->State(), + MMusAvaObserver::EMusAvaStatusNotExecuted ); + } + +void UT_CMusAvaNetworkAvailability::UT_CMusAvaNetworkAvailability_NameL() + { + EUNIT_ASSERT_EQUALS( iNetworkAvailability->Name(), + MMusAvaObserver::EMusAvaNameNetworkStatus ); + } + +void UT_CMusAvaNetworkAvailability::UT_CMusAvaNetworkAvailability_CallConnectedLL() + { + User::LeaveIfError( RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallDirection, + 0 )); + + iNetworkAvailability->CallConnectedL( KTelNumber, EFalse ); + EUNIT_ASSERT_EQUALS( iNetworkAvailability->State(), + MMusAvaObserver::EMusAvaStatusAvailable ); + EUNIT_ASSERT_EQUALS( iSettings->TelNumber(), KTelNumber ); + + + // Test SIP URI + iNetworkAvailability->CallConnectedL( KSipUri, ETrue ); + // Tel number should not have been modified + EUNIT_ASSERT_EQUALS( iSettings->TelNumber(), KTelNumber ); + const MDesCArray& sipAddresses = iSettings->SipAddresses(); + EUNIT_ASSERT_EQUALS( sipAddresses.MdcaCount(), 1 ); + EUNIT_ASSERT_EQUALS( sipAddresses.MdcaPoint( 0 ), KSipUri ); + } + +void UT_CMusAvaNetworkAvailability::UT_CMusAvaNetworkAvailability_ConferenceCallLL() + { + iNetworkAvailability->ConferenceCallL(); + EUNIT_ASSERT_EQUALS( iNetworkAvailability->State(), + MMusAvaObserver::EMusAvaStatusConferenceCall ); + } + +void UT_CMusAvaNetworkAvailability::UT_CMusAvaNetworkAvailability_CallHoldLL() + { + User::LeaveIfError( RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallDirection, + 0 )); + + iNetworkAvailability->CallHoldL( KTelNumber, EFalse ); + EUNIT_ASSERT_EQUALS( iNetworkAvailability->State(), + MMusAvaObserver::EMusAvaStatusCallOnHold ); + EUNIT_ASSERT_EQUALS( iSettings->TelNumber(), KTelNumber ); + + // Test SIP URI + iNetworkAvailability->CallConnectedL( KSipUri, ETrue ); + // Tel number should not have been modified + EUNIT_ASSERT_EQUALS( iSettings->TelNumber(), KTelNumber ); + const MDesCArray& sipAddresses = iSettings->SipAddresses(); + EUNIT_ASSERT_EQUALS( sipAddresses.MdcaCount(), 1 ); + EUNIT_ASSERT_EQUALS( sipAddresses.MdcaPoint( 0 ), KSipUri ); + } + +void UT_CMusAvaNetworkAvailability::UT_CMusAvaNetworkAvailability_NoActiveCallLL() + { + iNetworkAvailability->NoActiveCallL(); + EUNIT_ASSERT_EQUALS( iNetworkAvailability->State(), + MMusAvaObserver::EMusAvaStatusNoCall ); + EUNIT_ASSERT_EQUALS( iSettings->TelNumber(), KNullDesC ); + } + +void UT_CMusAvaNetworkAvailability::UT_CMusAvaNetworkAvailability_SetRemoteHostLL() + { + _LIT( KMusTestPhoneNum, "12341234" ); + iNetworkAvailability->SetRemoteHostL( KMusTestPhoneNum(), EFalse ); + EUNIT_ASSERT_EQUALS( iSettings->TelNumber(), KMusTestPhoneNum ); + EUNIT_ASSERT_EQUALS( iSettings->ContactResolvingUri(), KNullDesC ); + + _LIT( KMusTestSipUri, "sip:12341234@1.2.3.4" ); + iNetworkAvailability->SetRemoteHostL( KMusTestSipUri(), ETrue ); + EUNIT_ASSERT_EQUALS( iSettings->ContactResolvingUri(), KMusTestSipUri ); + } + + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusAvaNetworkAvailability, + "CMusAvaNetworkAvailability", + "UNIT" ) + +EUNIT_TEST( + "DoExecuteL - test ", + "CMusAvaNetworkAvailability", + "DoExecuteL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaNetworkAvailability_DoExecuteLL, Teardown) + +EUNIT_TEST( + "DoExecuteL - test SIP URI ", + "CMusAvaNetworkAvailability", + "DoExecuteL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaNetworkAvailability_DoExecuteL_SipUriL, Teardown) + +EUNIT_TEST( + "Stop - test ", + "CMusAvaNetworkAvailability", + "Stop", + "FUNCTIONALITY", + SetupL, UT_CMusAvaNetworkAvailability_StopL, Teardown) + +EUNIT_TEST( + "Name - test ", + "CMusAvaNetworkAvailability", + "Name", + "FUNCTIONALITY", + SetupL, UT_CMusAvaNetworkAvailability_NameL, Teardown) + +EUNIT_TEST( + "CallConnectedL - test ", + "CMusAvaNetworkAvailability", + "CallConnectedL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaNetworkAvailability_CallConnectedLL, Teardown ) + +EUNIT_TEST( + "ConferenceCallL - test ", + "CMusAvaNetworkAvailability", + "ConferenceCallL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaNetworkAvailability_ConferenceCallLL, Teardown ) + +EUNIT_TEST( + "CallHoldL - test ", + "CMusAvaNetworkAvailability", + "CallHoldL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaNetworkAvailability_CallHoldLL, Teardown ) + +EUNIT_TEST( + "NoActiveCallL - test ", + "CMusAvaNetworkAvailability", + "NoActiveCallL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaNetworkAvailability_NoActiveCallLL, Teardown ) + +EUNIT_TEST( + "SetRemoteHostL - test ", + "CMusAvaNetworkAvailability", + "SetRemoteHostL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaNetworkAvailability_SetRemoteHostLL, Teardown ) + + +EUNIT_END_TEST_TABLE + +// END OF FILE diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaNetworkModeStatus.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaNetworkModeStatus.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,221 @@ +/* +* 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: +* +*/ + + +// CLASS HEADER +#include "UT_CMusAvaNetworkModeStatus.h" +#include "musavatelephonystatusobserverimp.h" +#include "musavaavailability.h" +#include "muslogger.h" +#include "musavacapabilitytesthelper.h" //remove compilation warning +#include "CSipSseTestTls.h" + +// EXTERNAL INCLUDES +#include +#include +//#include +#include +#include +#include + +// INTERNAL INCLUDES +#include "musavanetworkmodestatus.h" + +// CONSTRUCTION +UT_CMusAvaNetworkModeStatus* UT_CMusAvaNetworkModeStatus::NewL() + { + UT_CMusAvaNetworkModeStatus* self = UT_CMusAvaNetworkModeStatus::NewLC(); + CleanupStack::Pop(); + + return self; + } + +UT_CMusAvaNetworkModeStatus* UT_CMusAvaNetworkModeStatus::NewLC() + { + UT_CMusAvaNetworkModeStatus* self = new( ELeave ) UT_CMusAvaNetworkModeStatus(); + CleanupStack::PushL( self ); + self->ConstructL(); + + return self; + } + +// Destructor (virtual by CBase) +UT_CMusAvaNetworkModeStatus::~UT_CMusAvaNetworkModeStatus() + { + } + +// Default constructor +UT_CMusAvaNetworkModeStatus::UT_CMusAvaNetworkModeStatus() + { + } + +// Second phase construct +void UT_CMusAvaNetworkModeStatus::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + +// METHODS + +void UT_CMusAvaNetworkModeStatus::SetupL( ) + { + SIPStrings::OpenL(); + CSipSseTestTls::OpenL(); + iStorage = CSipSseTestTls::Storage(); + iObserver = CMusAvaTelephonyStatusObserverImp::NewL(); + iNetworkRegistrationStatus = CMusAvaNetworkModeStatus::NewL(); + } + +void UT_CMusAvaNetworkModeStatus::Teardown( ) + { + if ( iStorage ) + { + iStorage->Clear(); + CSipSseTestTls::Close(); + iStorage = NULL; + } + delete iObserver; + delete iNetworkRegistrationStatus; + SIPStrings::Close(); + } + +void UT_CMusAvaNetworkModeStatus::UT_CMusAvaNetworkModeStatus_NewLL( ) + { + EUNIT_ASSERT( iNetworkRegistrationStatus ); + } +void UT_CMusAvaNetworkModeStatus::UT_CMusAvaNetworkModeStatus_AddAdapterLL() + { + iNetworkRegistrationStatus->AddAdapterL( *iObserver ); + } + +void UT_CMusAvaNetworkModeStatus::UT_CMusAvaNetworkModeStatus_RemoveAdapterL() + { + iNetworkRegistrationStatus->RemoveAdapter( *iObserver ); + } + +void UT_CMusAvaNetworkModeStatus::UT_CMusAvaNetworkModeStatus_PhoneNetworkModeL() + { + iStorage->SetPhoneNetworkModeStatus( RMobilePhone::ENetworkModeUnknown ); + EUNIT_ASSERT( !iNetworkRegistrationStatus->PhoneNetworkMode( ) ); + iStorage->Clear(); + iStorage->SetPhoneNetworkModeStatus( RMobilePhone::ENetworkModeWcdma ); + EUNIT_ASSERT( iNetworkRegistrationStatus->PhoneNetworkMode() ); + } + +void UT_CMusAvaNetworkModeStatus::UT_CMusAvaNetworkModeStatus_PhoneNetworkModeStatusL() + { + + TRAPD( error, iNetworkRegistrationStatus->AddAdapterL( *this ) ); + EUNIT_ASSERT( error == KErrNoMemory || error == KErrNone ); + if ( error == KErrNoMemory ) + { + User::Leave( error ); + } + + EUNIT_DISABLE_ALLOC_DECORATOR; + // no error => status updated + iNetworkRegistrationStatus->iPhone.DoNotifyModeChange( + RMobilePhone::ENetworkModeGsm, KErrNone ); + CActiveScheduler::Start(); + EUNIT_ASSERT_EQUALS( iNetworkStatus, RMobilePhone::ENetworkModeGsm ); + + // error => status not updated + iNetworkRegistrationStatus->iPhone.DoNotifyModeChange( + RMobilePhone::ENetworkModeCdma95, KErrGeneral ); + + iPeriodic = CPeriodic::NewL( EPriorityLow ); + iPeriodic->Start( 1000, 1000, TCallBack( UT_CMusAvaNetworkModeStatus::Notify, this ) ); + CActiveScheduler::Start(); + delete iPeriodic; + EUNIT_ENABLE_ALLOC_DECORATOR; + + EUNIT_ASSERT_EQUALS( iNetworkStatus, RMobilePhone::ENetworkModeGsm ); + + iNetworkRegistrationStatus->RemoveAdapter( *this ); + } + +void UT_CMusAvaNetworkModeStatus::PhoneNetworkModeStatus( + RMobilePhone::TMobilePhoneNetworkMode aStatus ) + { + iNetworkStatus = aStatus; + CActiveScheduler::Stop(); + } + +void UT_CMusAvaNetworkModeStatus::NetworkRegistrationStatus( + RMobilePhone::TMobilePhoneRegistrationStatus /*aRegStatus*/ ) + { + + } + +TInt UT_CMusAvaNetworkModeStatus::Notify( TAny* aPtr ) + { + ( ( UT_CMusAvaNetworkModeStatus* ) aPtr )->iPeriodic->Cancel(); + CActiveScheduler::Stop(); + return KErrNone; + } + + + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusAvaNetworkModeStatus, + "CMusAvaNetworkModeStatus", + "UNIT" ) + +EUNIT_TEST( + "NewL - test ", + "CMusAvaNetworkModeStatus", + "NewL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaNetworkModeStatus_NewLL, Teardown) + +EUNIT_TEST( + "AddAdapterL - test ", + "CMusAvaNetworkModeStatus", + "AddAdapterL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaNetworkModeStatus_AddAdapterLL, Teardown) + + +EUNIT_TEST( + "RemoveAdapter - test ", + "CMusAvaNetworkModeStatus", + "RemoveAdapter", + "FUNCTIONALITY", + SetupL, UT_CMusAvaNetworkModeStatus_RemoveAdapterL, Teardown) + +EUNIT_TEST( + "PhoneNetworkMode - test ", + "CMusAvaNetworkModeStatus", + "PhoneNetworkMode", + "FUNCTIONALITY", + SetupL, UT_CMusAvaNetworkModeStatus_PhoneNetworkModeL, Teardown) + +EUNIT_TEST( + "PhoneNetworkModeStatus - test ", + "CMusAvaNetworkModeStatus", + "PhoneNetworkModeStatus", + "FUNCTIONALITY", + SetupL, UT_CMusAvaNetworkModeStatus_PhoneNetworkModeStatusL, Teardown) + + +EUNIT_END_TEST_TABLE + +// END OF FILE diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaNetworkRegistrationStatus.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaNetworkRegistrationStatus.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,239 @@ +/* +* 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: +* +*/ + + +// CLASS HEADER +#include "UT_CMusAvaNetworkRegistrationStatus.h" +#include "musavatelephonystatusobserverimp.h" +#include "musavaavailability.h" +#include "muslogger.h" +#include "musavacapabilitytesthelper.h" //remove compilation warning + + + +// EXTERNAL INCLUDES +#include +#include +//#include +#include +#include +#include "CSipSseTestTls.h" + +// INTERNAL INCLUDES +#include "musavanetworkregistrationstatus.h" + + + +// CONSTRUCTION +UT_CMusAvaNetworkRegistrationStatus* UT_CMusAvaNetworkRegistrationStatus::NewL() + { + UT_CMusAvaNetworkRegistrationStatus* self = UT_CMusAvaNetworkRegistrationStatus::NewLC(); + CleanupStack::Pop(); + + return self; + } + +UT_CMusAvaNetworkRegistrationStatus* UT_CMusAvaNetworkRegistrationStatus::NewLC() + { + UT_CMusAvaNetworkRegistrationStatus* self = new( ELeave ) UT_CMusAvaNetworkRegistrationStatus(); + CleanupStack::PushL( self ); + self->ConstructL(); + + return self; + } + +// Destructor (virtual by CBase) +UT_CMusAvaNetworkRegistrationStatus::~UT_CMusAvaNetworkRegistrationStatus() + { + } + +// Default constructor +UT_CMusAvaNetworkRegistrationStatus::UT_CMusAvaNetworkRegistrationStatus() + { + } + +// Second phase construct +void UT_CMusAvaNetworkRegistrationStatus::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + +// METHODS + +void UT_CMusAvaNetworkRegistrationStatus::SetupL( ) + { + SIPStrings::OpenL(); + CSipSseTestTls::OpenL(); + iStorage = CSipSseTestTls::Storage(); + iObserver = CMusAvaTelephonyStatusObserverImp::NewL(); + iNetworkRegistrationStatus = CMusAvaNetworkRegistrationStatus::NewL( ); + } + +void UT_CMusAvaNetworkRegistrationStatus::Teardown( ) + { + if ( iStorage ) + { + iStorage->Clear(); + CSipSseTestTls::Close(); + iStorage = NULL; + } + delete iObserver; + delete iNetworkRegistrationStatus; + SIPStrings::Close(); + } + +void UT_CMusAvaNetworkRegistrationStatus::UT_CMusAvaNetworkRegistrationStatus_NewLL( ) + { + EUNIT_ASSERT( iNetworkRegistrationStatus ); + } +void UT_CMusAvaNetworkRegistrationStatus::UT_CMusAvaNetworkRegistrationStatus_AddAdapterLL() + { + iNetworkRegistrationStatus->AddAdapterL( *iObserver ); + } + +void UT_CMusAvaNetworkRegistrationStatus::UT_CMusAvaNetworkRegistrationStatus_NetworkRegistrationL() + { + RMobilePhone::TMobilePhoneRegistrationStatus regStatus = RMobilePhone::ERegistrationUnknown; + RMobilePhone::TMobilePhoneRegistrationStatus regStatusUpdate = RMobilePhone::ERegistrationUnknown; + iStorage->SetRegistrationStatus( regStatus ); + iNetworkRegistrationStatus->NetworkRegistrationStatus( regStatusUpdate ); + EUNIT_ASSERT( regStatus == regStatusUpdate ); + } + +void UT_CMusAvaNetworkRegistrationStatus::UT_CMusAvaNetworkRegistrationStatus_RemoveAdapterL() + { + iNetworkRegistrationStatus->RemoveAdapter( *iObserver ); + } + +void UT_CMusAvaNetworkRegistrationStatus::UT_CMusAvaNetworkRegistrationStatus_TelephonyStatusL() + { + /*iNetworkRegistrationStatus->TelephonyStatus(); + EUNIT_ASSERT( iNetworkRegistrationStatus->iRegistrationStatus == iStorage->iPhoneRegistrationStatus ); + User::RequestComplete(KErrNone, iObserver->iRequestStatus );*/ + } + +void UT_CMusAvaNetworkRegistrationStatus::UT_CMusAvaNetworkRegistrationStatus_NetworkRegistrationStatusL() + { + iNetworkRegistrationStatus->NetworkRegistrationStatus( RMobilePhone::ERegisteredOnHomeNetwork ); + EUNIT_ASSERT( RMobilePhone::ERegisteredOnHomeNetwork != iStorage->iPhoneRegistrationStatus ); + + iNetworkRegistrationStatus->AddAdapterL( *iObserver ); + iNetworkRegistrationStatus->NetworkRegistrationStatus( RMobilePhone::ERegisteredOnHomeNetwork ); + EUNIT_ASSERT( iObserver->iPhoneRegistrationStatus == RMobilePhone::ERegisteredOnHomeNetwork ); + } + +void UT_CMusAvaNetworkRegistrationStatus::UT_CMusAvaNetworkRegistrationStatus_RunL() + { + CActiveScheduler::Start(); + } + +void UT_CMusAvaNetworkRegistrationStatus::UT_CMusAvaNetworkRegistrationStatus_StatusL() + { + // NetworkRegistrationStatus->RunL(); + } + +void UT_CMusAvaNetworkRegistrationStatus::UT_CMusAvaNetworkRegistrationStatus_DoCancelL() + { + + } + +void UT_CMusAvaNetworkRegistrationStatus::UT_CMusAvaNetworkRegistrationStatus_RunErrorLL() + { + + } + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusAvaNetworkRegistrationStatus, + "CMusAvaNetworkRegistrationStatus", + "UNIT" ) + +EUNIT_TEST( + "NewL - test ", + "CMusAvaNetworkRegistrationStatus", + "NewL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaNetworkRegistrationStatus_NewLL, Teardown) + +EUNIT_TEST( + "AddAdapterL - test ", + "CMusAvaNetworkRegistrationStatus", + "AddAdapterL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaNetworkRegistrationStatus_AddAdapterLL, Teardown) + + +EUNIT_TEST( + "NetworkRegistrationL - test ", + "CMusAvaNetworkRegistrationStatus", + "NetworkRegistrationL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaNetworkRegistrationStatus_NetworkRegistrationL, Teardown) + +EUNIT_TEST( + "RemoveAdapter - test ", + "CMusAvaNetworkRegistrationStatus", + "RemoveAdapter", + "FUNCTIONALITY", + SetupL, UT_CMusAvaNetworkRegistrationStatus_RemoveAdapterL, Teardown) + + +EUNIT_TEST( + "TelephonyStatus - test ", + "CMusAvaNetworkRegistrationStatus", + "TelephonyStatus", + "FUNCTIONALITY", + SetupL, UT_CMusAvaNetworkRegistrationStatus_TelephonyStatusL, Teardown) + + +EUNIT_TEST( + "NetworkRegistrationStatus - test ", + "CMusAvaNetworkRegistrationStatus", + "NetworkRegistrationStatus", + "FUNCTIONALITY", + SetupL, UT_CMusAvaNetworkRegistrationStatus_NetworkRegistrationStatusL, Teardown) + +EUNIT_TEST( + "StatusL - test ", + "CMusAvaNetworkRegistrationStatus", + "StatusL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaNetworkRegistrationStatus_StatusL, Teardown) + +EUNIT_TEST( + "DoCancel - test ", + "CMusAvaNetworkRegistrationStatus", + "DoCancel", + "FUNCTIONALITY", + SetupL, UT_CMusAvaNetworkRegistrationStatus_DoCancelL, Teardown) + +EUNIT_TEST( + "RunErrorL - test ", + "CMusAvaNetworkRegistrationStatus", + "RunErrorL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaNetworkRegistrationStatus_RunErrorLL, Teardown) + + + + +EUNIT_END_TEST_TABLE + +// END OF FILE diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaOptionHandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaOptionHandler.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,579 @@ +/* +* 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: +* +*/ + + +// CLASS HEADER +#include "sipprofile.h" +#include "UT_CMusAvaOptionHandler.h" + +// EXTERNAL INCLUDES +#include +#include +#include +#include +#include +#include +#include +#include +// INTERNAL INCLUDES +#include "musavaoptionhandler.h" +#include "musavaavailabilityobserver.h" +#include "musavaavailabilityobserverimp.h" +#include "musavasettingsimp.h" +#include "musavaobserverimp.h" +#include "muslogger.h" +#include "musavasharedobject.h" +#include "mussettingskeys.h" +#include "mussettings.h" +#include "musavasip.h" +#include "CSipSseTestTls.h" +#include "musavacapabilitytesthelper.h" +#include "musavasettingsobserverimp.h" + + +// CONSTRUCTION +UT_CMusAvaOptionHandler* UT_CMusAvaOptionHandler::NewL() + { + UT_CMusAvaOptionHandler* self = UT_CMusAvaOptionHandler::NewLC(); + CleanupStack::Pop(); + + return self; + } + +UT_CMusAvaOptionHandler* UT_CMusAvaOptionHandler::NewLC() + { + UT_CMusAvaOptionHandler* self = new( ELeave ) UT_CMusAvaOptionHandler(); + CleanupStack::PushL( self ); + self->ConstructL(); + + return self; + } + +// Destructor (virtual by CBase) +UT_CMusAvaOptionHandler::~UT_CMusAvaOptionHandler() + { + } + +// Default constructor +UT_CMusAvaOptionHandler::UT_CMusAvaOptionHandler() + { + } + +// Second phase construct +void UT_CMusAvaOptionHandler::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + +// METHODS + +void UT_CMusAvaOptionHandler::SetupL( ) + { + iSharedObject = CMusAvaSharedObject::GetSingletonL(); + iAvailabilityObserver = CMusAvaAvailabilityObserverImp::NewL(); + iSettingsObserver = CMusAvaSettingsObserverImp::NewL(); + iConcreteSettings = CMusAvaSettingsImp::NewL(); + iConcreteSettings->SetObserver( *iSettingsObserver ); + iOptionHandler = CMusAvaOptionHandler::NewL( *iAvailabilityObserver, + *iConcreteSettings ); + + MSIPConnectionObserver& connectionObserver = + iSharedObject->MusAvaSip().ConnectionObserver(); + CSIP& sip = iSharedObject->MusAvaSip().Sip(); + CSipSseTestTls::OpenL(); + iStorage = CSipSseTestTls::Storage(); + iStorage->Set( MusSettingsKeys::KFastStartupMode, + MusSettingsKeys::EFastModeOff ); + + iSharedObject->MusAvaSip().CreateProfileL(); + iProfile = iSharedObject->MusAvaSip().Profile(); + iSharedObject->MusAvaSip().ConnectionL( ); + + if ( !iProfile->iArray ) + { + iProfile->iArray = new ( ELeave ) CDesC8ArrayFlat( 1 ); + iProfile->iArray->AppendL( _L8("sip:user@domain.com") ); + } + if ( !iProfile->iRegisteredContact ) + { + iProfile->iRegisteredContact = KRegisteredContact().AllocL(); + } + + MultimediaSharingSettings::SetCapabilityQuerySettingL( + MusSettingsKeys::ESequential ); + } + +void UT_CMusAvaOptionHandler::Teardown( ) + { + CMusAvaSharedObject::DeleteSingleton(); + delete iAvailabilityObserver; + delete iConcreteSettings; + if ( iStorage ) + { + iStorage->Clear(); + CSipSseTestTls::Close(); + iStorage = NULL; + } + delete iOptionHandler; + delete iSettingsObserver; + + PropertyHelper::Close(); + } + +void UT_CMusAvaOptionHandler::UT_CMusAvaOptionHandler_NewLL( ) + { + EUNIT_ASSERT( iOptionHandler ); + EUNIT_ASSERT( iOptionHandler->State() == + MMusAvaObserver::EMusAvaStatusNotExecuted ); + } + +void UT_CMusAvaOptionHandler::UT_CMusAvaOptionHandler_DoExecuteLL() + { + // test for B-party && Cingular variant + iOptionHandler->iSettings.SetCallDirection( 2 ); + MultimediaSharingSettings::SetOperatorVariantSettingL( + MusSettingsKeys::EOperatorSpecific ); + iOptionHandler->DoExecuteL(); + EUNIT_ASSERT( iOptionHandler->State() == + MMusAvaObserver::EMusAvaStatusOptionsNotSent ); + iOptionHandler->iSettings.SetCallDirection( 1 ); + MultimediaSharingSettings::SetOperatorVariantSettingL( + MusSettingsKeys::EStandard ); + + // usual case + TBufC16<16> str(KCapabilityTestSIPAddressUri_B); + HBufC16* ptr; + ptr = str.AllocLC(); + CDesCArrayFlat* sipAddress = new( ELeave ) CDesCArrayFlat( 1 ); + CleanupStack::PushL( sipAddress ); + sipAddress->AppendL( *ptr ); + iOptionHandler->iSettings.SetSipAddressesL( *sipAddress ); + sipAddress->Reset(); + CleanupStack::PopAndDestroy( sipAddress ); + CleanupStack::PopAndDestroy(); //ptr + + MultimediaSharingSettings::SetCapabilityQuerySettingL( + MusSettingsKeys::ESequential ); + EUNIT_ASSERT( iSharedObject->MusAvaSip().CreateProfileL() == ETrue ); + MultimediaSharingSettings::SetSipProfileSettingL( 1 ); + TRAPD( error, iOptionHandler->DoExecuteL() ); + TInt count = 0; + EUNIT_GET_ALLOC_DECORATOR_FAILCOUNT( count ); + EUNIT_ASSERT( error == KErrNoMemory || error == KErrNone ); + if ( error == KErrNoMemory ) User::Leave( error ); + + if ( count > 0 ) + { + EUNIT_ASSERT( iOptionHandler->State() == + MMusAvaObserver::EMusAvaOptionNotAvailable ); + } + else + { + EUNIT_ASSERT( iOptionHandler->State() == + MMusAvaObserver::EMusAvaStatusOptionsSent ); + + EUNIT_ASSERT( iStorage->iClientRequest->Method() == + SIPStrings::StringF( SipStrConsts::EOptions ) ); + + EUNIT_ASSERT( + iStorage->iClientRequest->MessageElements().Content().Length() > 0 ); + EUNIT_ASSERT( iStorage->iClientRequest->MessageElements().ContentType() ); + EUNIT_ASSERT( iStorage->iClientRequest->RemoteUri().Uri().UriDes().Compare( + KCapabilityTestSIPAddressUri8_B ) == 0); + EUNIT_ASSERT( iStorage->iClientRequest->MessageElements().UserHeaders(). + Count() == 6 ); + MUS_HEADER_ASSERT( iStorage->iClientRequest, + 0, + KCapabilityTestAcceptContactHeader ); + MUS_HEADER_ASSERT( iStorage->iClientRequest, + 5, + KCapabilityTestContactHeader_A1Updated ); + } + + // when needed sip profile and not registered yet. means sip connection is still + // null + MultimediaSharingSettings::SetCapabilityQuerySettingL( + MusSettingsKeys::ESequential ); + EUNIT_ASSERT( iSharedObject->MusAvaSip().CreateProfileL() == ETrue ); + MultimediaSharingSettings::SetSipProfileSettingL( 1 ); + iSharedObject->MusAvaSip().ConnectionL(EFalse); + + delete iSharedObject->MusAvaSip().iSipConnection; + iSharedObject->MusAvaSip().iSipConnection = NULL; + + iOptionHandler->SetState( MMusAvaObserver::EMusAvaStatusOptionsNotSent ); + + iOptionHandler->DoExecuteL(); + EUNIT_ASSERT( iOptionHandler->State() == + MMusAvaObserver::EMusAvaStatusNotExecuted ); + } + +void UT_CMusAvaOptionHandler::UT_CMusAvaOptionHandler_NameL() + { + EUNIT_ASSERT( iOptionHandler->Name() == + MMusAvaObserver::EMusAvaOptionHandler ); + } + + +void UT_CMusAvaOptionHandler::UT_CMusAvaOptionHandler_StatusL() + { + EUNIT_ASSERT( iOptionHandler->State() == + MMusAvaObserver::EMusAvaStatusNotExecuted ); + } + +void UT_CMusAvaOptionHandler::UT_CMusAvaOptionHandler_StopL() + { + iOptionHandler->Stop(); + } + +void UT_CMusAvaOptionHandler::UT_CMusAvaOptionHandler_CapabilitiesResolvedL() + { + _LIT( KSipAddress , "b@foobar.com" ); + _LIT( KSipAddressA , "a@foobar.com" ); + _LIT( KEmpty, "" ); + + EUNIT_ASSERT( iOptionHandler->State() == + MMusAvaObserver::EMusAvaStatusNotExecuted ); + iOptionHandler->CapabilitiesResolvedL( KEmpty ); + EUNIT_ASSERT( iOptionHandler->iSettings.SipAddresses().MdcaCount() == 0 ); + EUNIT_ASSERT( iOptionHandler->State() == + MMusAvaObserver::EMusAvaStatusNotExecuted ); + + iOptionHandler->iState = MMusAvaObserver::EMusAvaStatusNotExecuted; + iOptionHandler->CapabilitiesResolvedL( KSipAddress ); + EUNIT_ASSERT( iOptionHandler->iSettings.SipAddresses().MdcaPoint( 0 ). + Compare( KSipAddress() ) == KErrNone ); + EUNIT_ASSERT( iOptionHandler->State() == + MMusAvaObserver::EMusAvaStatusNotExecuted ); + + iOptionHandler->CapabilitiesResolvedL( KSipAddressA ); + EUNIT_ASSERT( iOptionHandler->iSettings.SipAddresses().MdcaPoint( 0 ). + Compare( KSipAddressA() ) == KErrNone ); + + EUNIT_ASSERT( iOptionHandler->State() == + MMusAvaObserver::EMusAvaStatusNotExecuted ); + } + +void UT_CMusAvaOptionHandler::UT_CMusAvaOptionHandler_CapabilitiesResolvedForCingularL() + { + EUNIT_ASSERT( iOptionHandler->CapabilitiesResolvedForCingular() == EFalse ); + iOptionHandler->SetCapabilitiesResolvedForCingular(); + EUNIT_ASSERT( iOptionHandler->CapabilitiesResolvedForCingular() == ETrue ); + } + +void UT_CMusAvaOptionHandler::UT_CMusAvaOptionHandler_SipHeadersL() + { + CDesCArrayFlat* headers = new( ELeave ) CDesCArrayFlat( 1 ); + CleanupStack::PushL(headers); + headers->AppendL(_L("sip:test1@10.21.32.51")); + iOptionHandler->SipHeadersL(*headers,SipStrConsts::EToHeader); + EUNIT_ASSERT( iOptionHandler->iSettings.SipAddresses().MdcaCount()==1 ); + + _LIT( KPAssertedIdentityTelNumber, "+4455667788"); + headers->Reset(); + headers->AppendL(KPAssertedIdentity_B_16); + headers->AppendL(KPAssertedIdentity_B1_16); + iOptionHandler->SipHeadersL(*headers,SipStrConsts::EToHeader); + EUNIT_ASSERT( iOptionHandler->iSettings.SipAddresses().MdcaCount()==1 ); + EUNIT_ASSERT( iOptionHandler->iSettings.SipAddresses().MdcaPoint( 0 ).Compare( + KPAssertedIdentity_B_16() ) == KErrNone ); + EUNIT_ASSERT( iOptionHandler->iSettings.TelNumber().Compare( + KPAssertedIdentityTelNumber ) == 0 ); + + headers->Reset(); + iOptionHandler->SipHeadersL(*headers,SipStrConsts::EToHeader); + EUNIT_ASSERT( iOptionHandler->iSettings.SipAddresses().MdcaCount()==0 ); + + headers->Reset(); + headers->AppendL(_L("sip:test1@10.21.32.51")); + iOptionHandler->SipHeadersL(*headers,SipStrConsts::EFromHeader); + EUNIT_ASSERT( iOptionHandler->iSettings.SipAddresses().MdcaCount()==0 ); + + CleanupStack::PopAndDestroy(headers); + + + } + +void UT_CMusAvaOptionHandler::UT_CMusAvaOptionHandler_VideoCodecsResolvedLL() + { + _LIT16( KVideoCodec , "H.264" ); + TBufC16<16> str(KVideoCodec); + HBufC16* ptr; + ptr = str.AllocLC(); + + CDesCArrayFlat* videoCodecs = new( ELeave ) CDesCArrayFlat( 1 ); + CleanupStack::PushL( videoCodecs ); + + videoCodecs->AppendL( *ptr ); + iOptionHandler->VideoCodecsResolvedL( *videoCodecs ); + EUNIT_ASSERT ( iOptionHandler->iSettings.iVideoCodecs->MdcaCount() > KErrNone ); + EUNIT_ASSERT ( iOptionHandler->iSettings.iVideoCodecs->MdcaPoint(0).Compare ( *ptr ) == 0 ); + + videoCodecs->Reset(); + CleanupStack::PopAndDestroy( videoCodecs ); + CleanupStack::PopAndDestroy(); + + } + +void UT_CMusAvaOptionHandler::UT_CMusAvaOptionHandler_DoSetStateL() + { + // Set some state which does not cause special handling + iOptionHandler->iFastModeCapable = EFalse; + iOptionHandler->DoSetState( MMusAvaObserver::EMusAvaStatusOptionsSent ); + EUNIT_ASSERT( iOptionHandler->iState == MMusAvaObserver::EMusAvaStatusOptionsSent ); + + // Set special handling state, but fast mode is not enabled + iOptionHandler->DoSetState( MMusAvaObserver::EMusAvaStatusAvailable ); + EUNIT_ASSERT( iOptionHandler->iState == MMusAvaObserver::EMusAvaStatusAvailable ); + EUNIT_ASSERT( !iSettingsObserver->iApplicationStarted ); + + // Set special handling state, fast capable but mode is not enabled + iOptionHandler->iFastModeCapable = ETrue; + iConcreteSettings->SetFastMode( MusSettingsKeys::EFastModeOff ); + iOptionHandler->DoSetState( MMusAvaObserver::EMusAvaStatusAvailable ); + EUNIT_ASSERT( iOptionHandler->iState == MMusAvaObserver::EMusAvaStatusAvailable ); + EUNIT_ASSERT( !iSettingsObserver->iApplicationStarted ); + } + +void UT_CMusAvaOptionHandler::UT_CMusAvaOptionHandler_DoSetStateFastModeL() + { + iOptionHandler->iFastModeCapable = ETrue; + iConcreteSettings->SetFastMode( MusSettingsKeys::EFastModeOn ); + iOptionHandler->iSettings.SetCallDirection( 1 ); + + // State which does not have special handling + iOptionHandler->DoSetState( MMusAvaObserver::EMusAvaFailureCode ); + EUNIT_ASSERT( iOptionHandler->iState == MMusAvaObserver::EMusAvaFailureCode ); + EUNIT_ASSERT( !iOptionHandler->iFastModeAvailabilityDelayed ); + + // OptionsNotSent handling + // + + // MT, not answered + iOptionHandler->iSettings.SetCallDirection( 2 ); + iOptionHandler->iCapabilityQueryAnswered = EFalse; + iOptionHandler->DoSetState( MMusAvaObserver::EMusAvaStatusOptionsNotSent ); + EUNIT_ASSERT( iOptionHandler->iState == MMusAvaObserver::EMusAvaStatusOptionsNotSent ); + EUNIT_ASSERT( !iOptionHandler->iFastModeAvailabilityDelayed ); + + // MT, answered (makes state available delayed) + iOptionHandler->iCapabilityQueryAnswered = ETrue; + iOptionHandler->DoSetState( MMusAvaObserver::EMusAvaStatusOptionsNotSent ); + EUNIT_ASSERT( iOptionHandler->iState == MMusAvaObserver::EMusAvaStatusOptionsNotSent ); + EUNIT_ASSERT( iOptionHandler->iFastModeAvailabilityDelayed ); + + // Available handling + // + + // MO, start app + iOptionHandler->iSettings.SetCallDirection( 1 ); + iSettingsObserver->iApplicationStarted = EFalse; + iOptionHandler->iFastModeAvailabilityDelayed = EFalse; + iOptionHandler->DoSetState( MMusAvaObserver::EMusAvaStatusAvailable ); + EUNIT_ASSERT( iOptionHandler->iState == MMusAvaObserver::EMusAvaStatusAvailable ); + EUNIT_ASSERT( !iOptionHandler->iFastModeAvailabilityDelayed ); + EUNIT_ASSERT( iSettingsObserver->iApplicationStarted ); + + // App already started by going to available state, do not do twice + iSettingsObserver->iApplicationStarted = EFalse; + iOptionHandler->DoSetState( MMusAvaObserver::EMusAvaStatusAvailable ); + EUNIT_ASSERT( iOptionHandler->iState == MMusAvaObserver::EMusAvaStatusAvailable ); + EUNIT_ASSERT( !iOptionHandler->iFastModeAvailabilityDelayed ); + EUNIT_ASSERT( !iSettingsObserver->iApplicationStarted ); + + // MT, delayed availability publishing (state not changed yet) + iOptionHandler->iSettings.SetCallDirection( 2 ); + iOptionHandler->iFastModeAvailabilityDelayed = EFalse; + iSettingsObserver->iApplicationStarted = EFalse; + iOptionHandler->iState = MMusAvaObserver::EMusAvaStatusOptionsNotSent; + iOptionHandler->DoSetState( MMusAvaObserver::EMusAvaStatusAvailable ); + EUNIT_ASSERT( iOptionHandler->iState == MMusAvaObserver::EMusAvaStatusOptionsNotSent ); + EUNIT_ASSERT( iOptionHandler->iFastModeAvailabilityDelayed ); + EUNIT_ASSERT( !iSettingsObserver->iApplicationStarted ); + + // Invite ends availability delaying + iOptionHandler->PrepareForReceivedInviteL(); + EUNIT_ASSERT( iOptionHandler->iState == MMusAvaObserver::EMusAvaStatusAvailable ); + EUNIT_ASSERT( !iOptionHandler->iFastModeAvailabilityDelayed ); + + // No effect if no delay pending + iOptionHandler->iState = MMusAvaObserver::EMusAvaStatusOptionsNotSent; + iOptionHandler->PrepareForReceivedInviteL(); + EUNIT_ASSERT( iOptionHandler->iState == MMusAvaObserver::EMusAvaStatusOptionsNotSent ); + + // OptionNotAvailable handling + // + + // Normal handling when no pending availabilty publishing nor state is + // not already available + iOptionHandler->iFastModeAvailabilityDelayed = EFalse; + iOptionHandler->DoSetState( MMusAvaObserver::EMusAvaOptionNotAvailable ); + EUNIT_ASSERT( iOptionHandler->iState == MMusAvaObserver::EMusAvaOptionNotAvailable ); + + // If already set to available by succesfull answer, sending failure + // does not clear availability + iOptionHandler->iState = MMusAvaObserver::EMusAvaStatusAvailable; + iOptionHandler->DoSetState( MMusAvaObserver::EMusAvaOptionNotAvailable ); + EUNIT_ASSERT( iOptionHandler->iState == MMusAvaObserver::EMusAvaStatusAvailable ); + } + +void UT_CMusAvaOptionHandler::UT_CMusAvaOptionHandler_FastModeResolvedL() + { + iOptionHandler->iFastModeCapable = ETrue; + + // Normal case + iOptionHandler->iSettings.SetFastMode( MusSettingsKeys::EFastModeOff ); + iOptionHandler->FastModeResolved( MusSettingsKeys::EFastModeOn ); + EUNIT_ASSERT( iOptionHandler->iSettings.FastMode() == MusSettingsKeys::EFastModeOn ) + + // MO side fast mode negotiation has failed, value is not set + iOptionHandler->iSettings.SetFastMode( MusSettingsKeys::EFastModeOff ); + iOptionHandler->iSettings.SetCallDirection( 1 ); + iOptionHandler->iState = MMusAvaObserver::EMusAvaOptionNotAvailable; + iOptionHandler->FastModeResolved( MusSettingsKeys::EFastModeOn ); + EUNIT_ASSERT( iOptionHandler->iSettings.FastMode() == MusSettingsKeys::EFastModeOff ) + } + +void UT_CMusAvaOptionHandler::UT_CMusAvaOptionHandler_CapabilityQueryAnsweredL() + { + iOptionHandler->iFastModeCapable = ETrue; + + // If fast mode MO side, no special handling for answer + iOptionHandler->CapabilityQueryAnswered( ETrue ); + EUNIT_ASSERT( iOptionHandler->iCapabilityQueryAnswered ) + EUNIT_ASSERT( !iOptionHandler->iFastModeAvailabilityDelayed ); + + // If fast mode MT side, MT can start waiting for invite already after answering + iOptionHandler->iCapabilityQueryAnswered = EFalse; + iOptionHandler->iSettings.SetFastMode( MusSettingsKeys::EFastModeOn ); + iOptionHandler->iSettings.SetCallDirection( 2 ); + iOptionHandler->CapabilityQueryAnswered( ETrue ); + EUNIT_ASSERT( iOptionHandler->iCapabilityQueryAnswered ) + EUNIT_ASSERT( iOptionHandler->iFastModeAvailabilityDelayed ); + } + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusAvaOptionHandler, + "CMusAvaOptionHandler", + "UNIT" ) + +EUNIT_TEST( + "NewL - test ", + "CMusAvaOptionHandler", + "NewL", + "FUNCTIONALITY", + SetupL,UT_CMusAvaOptionHandler_NewLL, Teardown) + +EUNIT_TEST( + "DoExecuteL - test ", + "CMusAvaOptionHandler", + "DoExecuteL", + "FUNCTIONALITY", + SetupL,UT_CMusAvaOptionHandler_DoExecuteLL, Teardown) + +EUNIT_TEST( + "Name - test ", + "CMusAvaOptionHandler", + "Name", + "FUNCTIONALITY", + SetupL,UT_CMusAvaOptionHandler_NameL, Teardown) + + +EUNIT_TEST( + "Status - test ", + "CMusAvaOptionHandler", + "Status", + "FUNCTIONALITY", + SetupL,UT_CMusAvaOptionHandler_StatusL, Teardown) + +EUNIT_TEST( + "Stop - test ", + "CMusAvaOptionHandler", + "Stop", + "FUNCTIONALITY", + SetupL,UT_CMusAvaOptionHandler_StopL, Teardown) + +EUNIT_TEST( + "CapabilitiesResolved - test ", + "CMusAvaOptionHandler", + "CapabilitiesResolved", + "FUNCTIONALITY", + SetupL,UT_CMusAvaOptionHandler_CapabilitiesResolvedL, Teardown) + +EUNIT_TEST( + "CapabilitiesResolvedForCingular - test ", + "CMusAvaOptionHandler", + "CapabilitiesResolvedForCingular", + "FUNCTIONALITY", + SetupL,UT_CMusAvaOptionHandler_CapabilitiesResolvedForCingularL, + Teardown) + +EUNIT_TEST( + "SipHeadersL - test ", + "CMusAvaOptionHandler", + "SipHeadersL", + "FUNCTIONALITY", + SetupL,UT_CMusAvaOptionHandler_SipHeadersL, + Teardown) + +EUNIT_TEST( + "VideoCodecsResolvedL - test ", + "CMusAvaOptionHandler", + "VideoCodecsResolvedL", + "FUNCTIONALITY", + SetupL,UT_CMusAvaOptionHandler_VideoCodecsResolvedLL, + Teardown) + +EUNIT_TEST( + "DoSetState - test ", + "CMusAvaOptionHandler", + "DoSetState", + "FUNCTIONALITY", + SetupL,UT_CMusAvaOptionHandler_DoSetStateL, + Teardown) + +EUNIT_TEST( + "DoSetState - fastmode test ", + "CMusAvaOptionHandler", + "DoSetState", + "FUNCTIONALITY", + SetupL,UT_CMusAvaOptionHandler_DoSetStateFastModeL, + Teardown) + +EUNIT_TEST( + "FastModeResolved - test ", + "CMusAvaOptionHandler", + "FastModeResolved", + "FUNCTIONALITY", + SetupL,UT_CMusAvaOptionHandler_FastModeResolvedL, + Teardown) + +EUNIT_TEST( + "CapabilityQueryAnswered - test ", + "CMusAvaOptionHandler", + "CapabilityQueryAnswered", + "FUNCTIONALITY", + SetupL,UT_CMusAvaOptionHandler_CapabilityQueryAnsweredL, + Teardown) + +EUNIT_END_TEST_TABLE + +// END OF FILE diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaRegisterAvailability.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaRegisterAvailability.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,486 @@ +/* +* 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: +* +*/ + + +// CLASS HEADER +#include "sipprofile.h" +#include "UT_CMusAvaRegisterAvailability.h" +#include "musavaavailabilityobserver.h" +#include "musavaavailabilityobserverimp.h" +#include "musavaobserver.h" +#include "musavaobserverimp.h" +#include "musavadefaultimp.h" +#include "musavaobserverimp.h" +#include "musavasettingsimp.h" +#include "mussettingskeys.h" +#include "mussettings.h" +#include "CSipSseTestTls.h" +#include "musavasharedobject.h" +#include "sipprofile.h" +#include "musavasip.h" +#include "sipprofileregistry.h" +#include "sipprofileregistryobserver.h" +#include "musavasipprofileregistryobserver.h" +#include "musavacapabilitytesthelper.h" //remove compilation warning + +// EXTERNAL INCLUDES +#include +#include +//#include +#include +#include +#include +#include +#include + +// INTERNAL INCLUDES +#include "musavaregisteravailability.h" + +//const TInt KNumberMatchingDigitsRequired( 7 ); + +//_LIT(KNumberZero,""); +//_LIT(KNumber,"05012345678"); +//_LIT(KPlusNumber,"+3585012345678"); + +// CONSTRUCTION +UT_CMusAvaRegisterAvailability* UT_CMusAvaRegisterAvailability::NewL() + { + UT_CMusAvaRegisterAvailability* self = UT_CMusAvaRegisterAvailability::NewLC(); + CleanupStack::Pop(); + + return self; + } + +UT_CMusAvaRegisterAvailability* UT_CMusAvaRegisterAvailability::NewLC() + { + UT_CMusAvaRegisterAvailability* self = new( ELeave ) UT_CMusAvaRegisterAvailability(); + CleanupStack::PushL( self ); + + self->ConstructL(); + + return self; + } + +// Destructor (virtual by CBase) +UT_CMusAvaRegisterAvailability::~UT_CMusAvaRegisterAvailability() + { + } + +// Default constructor +UT_CMusAvaRegisterAvailability::UT_CMusAvaRegisterAvailability() + { + } + +// Second phase construct +void UT_CMusAvaRegisterAvailability::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + +// METHODS + + + +void UT_CMusAvaRegisterAvailability::SetupL( ) + { + SIPStrings::OpenL(); + CSipSseTestTls::OpenL(); + iProfileId = MultimediaSharingSettings::SipProfileSettingL(); + iAvailabilityObserver = CMusAvaAvailabilityObserverImp::NewL(); + iConcreteSettings = CMusAvaSettingsImp::NewL(); + iRegisterAvailability = CMusAvaRegisterAvailability::NewL( *iAvailabilityObserver, + *iConcreteSettings ); + iSharedObj = CMusAvaSharedObject::GetSingletonL(); + } + +void UT_CMusAvaRegisterAvailability::Teardown( ) + { + delete iAvailabilityObserver; + iAvailabilityObserver = NULL; + delete iConcreteSettings; + iConcreteSettings = NULL; + delete iRegisterAvailability; + iRegisterAvailability = NULL; + + CSipSseTestTls::Close(); + CMusAvaSharedObject::DeleteSingleton(); + SIPStrings::Close(); + } + +void UT_CMusAvaRegisterAvailability::UT_CMusAvaRegisterAvailability_NewLL() + { + EUNIT_ASSERT( iRegisterAvailability ); + } + +void UT_CMusAvaRegisterAvailability::UT_CMusAvaRegisterAvailability_DoExecuteLL() + { + MultimediaSharingSettings::SetSipProfileSettingL( 5 ); + + TRAPD( error, iRegisterAvailability->DoExecuteL() ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT ( error == KErrNone ); + + TInt count = 0; + EUNIT_GET_ALLOC_DECORATOR_FAILCOUNT( count ); + if ( count == 0 ) + { + EUNIT_ASSERT( iAvailabilityObserver->iStatus == + MMusAvaObserver::EMusAvaStatusAvailable ); + } + else + { + EUNIT_ASSERT( iAvailabilityObserver->iStatus == + MMusAvaObserver::EMusAvaStatusNoSipProfile); + } + + EUNIT_ASSERT( iAvailabilityObserver->iName == MMusAvaObserver::EMusAvaNameRegistration ); + } +void UT_CMusAvaRegisterAvailability::UT_CMusAvaRegisterAvailability_NameL() + { + EUNIT_ASSERT( iRegisterAvailability->Name() == MMusAvaObserver::EMusAvaNameRegistration ); + } +void UT_CMusAvaRegisterAvailability::UT_CMusAvaRegisterAvailability_StatusL() + { + //No profile created + EUNIT_ASSERT( iRegisterAvailability->State() == MMusAvaObserver::EMusAvaStatusNotExecuted ); + + MultimediaSharingSettings::SetSipProfileSettingL( 5 ); + + iRegisterAvailability->DoExecuteL(); + + TInt count = 0; + EUNIT_GET_ALLOC_DECORATOR_FAILCOUNT( count ); + if ( count == 0 ) + { + EUNIT_ASSERT( iAvailabilityObserver->iStatus == + MMusAvaObserver::EMusAvaStatusAvailable ); + } + else + { + EUNIT_ASSERT( iAvailabilityObserver->iStatus == + MMusAvaObserver::EMusAvaStatusNoSipProfile); + } + + } +void UT_CMusAvaRegisterAvailability::UT_CMusAvaRegisterAvailability_Stop() + { + //Profile is not created + iRegisterAvailability->Stop(); + EUNIT_ASSERT( iRegisterAvailability->State() == MMusAvaObserver::EMusAvaStatusNotExecuted ); + + // Test with profile + // Create Profile + TRAPD ( error, iSharedObj->MusAvaSip().CreateProfileL() ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT ( error == KErrNone ); + + MultimediaSharingSettings::SetSipProfileSettingL( 1 ); + //Profile created + iRegisterAvailability->Stop(); + CSIPProfileRegistry& registry = iSharedObj->MusAvaSip().ProfileRegistryL(); + EUNIT_ASSERT( registry.iProfileDisabled == ETrue); + } +void UT_CMusAvaRegisterAvailability::UT_CMusAvaRegisterAvailability_ProfileRegistryEventOccurredL() + { + iRegisterAvailability->ProfileRegistryEventOccurred( 1, MSIPProfileRegistryObserver::EProfileCreated ); + + MultimediaSharingSettings::SetSipProfileSettingL( 1 ); + EUNIT_ASSERT( iSharedObj->MusAvaSip().CreateProfileL() ); + iRegisterAvailability->ProfileRegistryEventOccurred( 1, MSIPProfileRegistryObserver::EProfileRegistered ); + + TRAPD( error, iRegisterAvailability->DoExecuteL() ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT ( error == KErrNone ); + + iRegisterAvailability->ProfileRegistryEventOccurred( 1, MSIPProfileRegistryObserver::EProfileCreated ); + iRegisterAvailability->ProfileRegistryEventOccurred( 1, MSIPProfileRegistryObserver::EProfileUpdated ); + iRegisterAvailability->ProfileRegistryEventOccurred( 1, MSIPProfileRegistryObserver::EProfileRegistered ); + + EUNIT_ASSERT( iAvailabilityObserver->iStatus == MMusAvaObserver::EMusAvaStatusAvailable ); + EUNIT_ASSERT( iAvailabilityObserver->iName == MMusAvaObserver::EMusAvaNameRegistration ); + + iRegisterAvailability->ProfileRegistryEventOccurred( 1, MSIPProfileRegistryObserver::EProfileDeregistered ); + + EUNIT_ASSERT( iAvailabilityObserver->iStatus == MMusAvaObserver::EMusAvaStatusNotRegistered ); + EUNIT_ASSERT( iAvailabilityObserver->iName == MMusAvaObserver::EMusAvaNameRegistration ); + + iRegisterAvailability->ProfileRegistryEventOccurred( 1, MSIPProfileRegistryObserver::EProfileDestroyed ); + EUNIT_ASSERT( iRegisterAvailability->State() == MMusAvaObserver::EMusAvaStatusNotRegistered ); + } + +void UT_CMusAvaRegisterAvailability::UT_CMusAvaRegisterAvailability_CreateSipAddressProposalLL() + { + //Profile is not created + iRegisterAvailability->Stop(); + EUNIT_ASSERT( iRegisterAvailability->State() == MMusAvaObserver::EMusAvaStatusNotExecuted ); + + // Test with profile + // Create Profile + TRAPD( error, iSharedObj->MusAvaSip().CreateProfileL() ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT ( error == KErrNone ); + iRegisterAvailability->CreateSipAddressProposalL(); + + } + +void UT_CMusAvaRegisterAvailability::UT_CMusAvaRegisterAvailability_ConnectionStateChangedL() + { + iRegisterAvailability->SetState( MMusAvaObserver::EMusAvaStatusNotExecuted ); + + iRegisterAvailability->SetState( MMusAvaObserver::EMusAvaStatusNotExecuted ); + iRegisterAvailability->ConnectionStateChanged( CSIPConnection::EInit ); + EUNIT_ASSERT( iRegisterAvailability->State() == MMusAvaObserver::EMusAvaStatusNotExecuted ); + + iRegisterAvailability->SetState( MMusAvaObserver::EMusAvaStatusNotExecuted ); + iRegisterAvailability->ConnectionStateChanged( CSIPConnection::EActive ); + EUNIT_ASSERT( iRegisterAvailability->State() == MMusAvaObserver::EMusAvaStatusNotExecuted ); + + iRegisterAvailability->SetState( MMusAvaObserver::EMusAvaStatusNotExecuted ); + iRegisterAvailability->ConnectionStateChanged( CSIPConnection::ESuspended ); + EUNIT_ASSERT( iRegisterAvailability->State() == MMusAvaObserver::EMusAvaConnectionErr ); + + iRegisterAvailability->SetState( MMusAvaObserver::EMusAvaStatusNotExecuted ); + iRegisterAvailability->ConnectionStateChanged( CSIPConnection::EInactive ); + EUNIT_ASSERT( iRegisterAvailability->State() == MMusAvaObserver::EMusAvaConnectionErr ); + + iRegisterAvailability->SetState( MMusAvaObserver::EMusAvaStatusNotExecuted ); + iRegisterAvailability->ConnectionStateChanged( CSIPConnection::EUnavailable ); + EUNIT_ASSERT( iRegisterAvailability->State() == MMusAvaObserver::EMusAvaConnectionErr ); + + iRegisterAvailability->SetState( MMusAvaObserver::EMusAvaStatusNotExecuted ); + iRegisterAvailability->ConnectionStateChanged( (CSIPConnection::TState)6 ); + EUNIT_ASSERT( iRegisterAvailability->State() == MMusAvaObserver::EMusAvaStatusNotExecuted ); + } + +void UT_CMusAvaRegisterAvailability::UT_CMusAvaRegisterAvailability_ProfileRegistryErrorOccurredL() + { + iRegisterAvailability->ProfileRegistryErrorOccurred(5, -5 ); + + // Test Profile + TRAPD( error, iSharedObj->MusAvaSip().CreateProfileL() ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT ( error == KErrNone ); + //Profile created + iRegisterAvailability->ProfileRegistryErrorOccurred(5, -5 ); + + MultimediaSharingSettings::SetSipProfileSettingL( 1 ); + + iRegisterAvailability->ProfileRegistryErrorOccurred(1, -5 ); + EUNIT_ASSERT( iRegisterAvailability->State() == MMusAvaObserver::EMusAvaStatusNotRegistered ); + } + + +void UT_CMusAvaRegisterAvailability::UT_CMusAvaRegisterAvailability_RegisterLL() + { + MultimediaSharingSettings::SetSipProfileSettingL( 5 ); + TRAPD( error, iRegisterAvailability->RegisterL() ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT ( error == KErrNone ); + TInt count = 0; + EUNIT_GET_ALLOC_DECORATOR_FAILCOUNT( count ); + if ( count == 0 ) + { + EUNIT_ASSERT( iSharedObj->MusAvaSip().iSipConnection != NULL ); + EUNIT_ASSERT( iAvailabilityObserver->iStatus == + MMusAvaObserver::EMusAvaStatusAvailable ); + } + else + { + EUNIT_ASSERT( iAvailabilityObserver->iStatus == + MMusAvaObserver::EMusAvaStatusNoSipProfile); + } + } + +void UT_CMusAvaRegisterAvailability::UT_CMusAvaRegisterAvailability_InitializeRegisterL() + { + MultimediaSharingSettings::SetSipProfileSettingL( 5 ); + EUNIT_ASSERT( iRegisterAvailability->InitializeRegister() ); + } + +void UT_CMusAvaRegisterAvailability::UT_CMusAvaRegisterAvailability_EnableRegisterLL() + { + MultimediaSharingSettings::SetSipProfileSettingL( 1 ); + iSharedObj->MusAvaSip().CreateProfileL(); + iRegisterAvailability->EnableRegisterL(); + EUNIT_ASSERT( iSharedObj->MusAvaSip().ProfileRegistryL().IsEnabled( + *iSharedObj->MusAvaSip().Profile() )); + + } + +void UT_CMusAvaRegisterAvailability::UT_CMusAvaRegisterAvailability_UpdateSIPProfileL() + { + delete iSharedObj->MusAvaSip().iSipProfileRegistry; + iSharedObj->MusAvaSip().iSipProfileRegistry = NULL; + delete iSharedObj->MusAvaSip().iSipProfile; + iSharedObj->MusAvaSip().iSipProfile = NULL; + + // Profile Id found + iSharedObj->MusAvaSip().iSipProfileRegistry = CSIPProfileRegistry::NewL( + iSharedObj->MusAvaSip().Sip(), + *iSharedObj->MusAvaSip().iSipProfileRegistryObserver ); + iRegisterAvailability->iSharedObj->MusAvaSip().iSipProfile = CSIPProfile::NewL( iSharedObj->MusAvaSip().iSipProfileRegistry ); + iRegisterAvailability->iSharedObj->MusAvaSip().Profile()->iTUint32ValueError = KErrNone; + EUNIT_ASSERT( iRegisterAvailability->UpdateSIPProfile() ); + // Profile Id found + iRegisterAvailability->iSharedObj->MusAvaSip().Profile()->iTUint32Value = 1; + EUNIT_ASSERT( iRegisterAvailability->UpdateSIPProfile() ); + // Profile not Id found + iRegisterAvailability->iSharedObj->MusAvaSip().Profile()->iTUint32Value = 0; + iRegisterAvailability->iSharedObj->MusAvaSip().Profile()->iTUint32ValueError = KErrNotFound; + EUNIT_ASSERT( !iRegisterAvailability->UpdateSIPProfile() ); + delete iRegisterAvailability->iSharedObj->MusAvaSip().iSipProfile; + iRegisterAvailability->iSharedObj->MusAvaSip().iSipProfile = NULL; + } + +void UT_CMusAvaRegisterAvailability::UT_CMusAvaRegisterAvailability_RegistrationStatusL() + { + delete iSharedObj->MusAvaSip().iSipProfileRegistry; + iSharedObj->MusAvaSip().iSipProfileRegistry = NULL; + delete iSharedObj->MusAvaSip().iSipProfile; + iSharedObj->MusAvaSip().iSipProfile = NULL; + iSharedObj->MusAvaSip().iSipProfileRegistry = CSIPProfileRegistry::NewL( + iSharedObj->MusAvaSip().Sip(), + *iSharedObj->MusAvaSip().iSipProfileRegistryObserver ); + iRegisterAvailability->iSharedObj->MusAvaSip().iSipProfile = CSIPProfile::NewL( iSharedObj->MusAvaSip().iSipProfileRegistry ); + //Not registred + iRegisterAvailability->iSharedObj->MusAvaSip().Profile()->iTBoolValueError = KErrNone; + iRegisterAvailability->iSharedObj->MusAvaSip().Profile()->iTBoolValue = EFalse; + EUNIT_ASSERT( !iRegisterAvailability->RegistrationStatusL() ); + //Register error + iRegisterAvailability->iSharedObj->MusAvaSip().Profile()->iTBoolValueError = KErrNotFound; + EUNIT_ASSERT( !iRegisterAvailability->RegistrationStatusL() ); + // Registred + iRegisterAvailability->iSharedObj->MusAvaSip().Profile()->iTBoolValueError = KErrNone; + iRegisterAvailability->iSharedObj->MusAvaSip().Profile()->iTBoolValue = ETrue; + EUNIT_ASSERT( iRegisterAvailability->RegistrationStatusL() ); + delete iRegisterAvailability->iSharedObj->MusAvaSip().iSipProfile; + iRegisterAvailability->iSharedObj->MusAvaSip().iSipProfile = NULL; + } + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusAvaRegisterAvailability, + "CMusAvaRegisterAvailability", + "UNIT" ) + +EUNIT_TEST( + "NewL - test ", + "CMusAvaRegisterAvailability", + "NewL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaRegisterAvailability_NewLL, Teardown) + +EUNIT_TEST( + "DoExecuteL - test ", + "CMusAvaRegisterAvailability", + "DoExecuteL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaRegisterAvailability_DoExecuteLL, Teardown) + +EUNIT_TEST( + "Name - test ", + "CMusAvaRegisterAvailability", + "Name", + "FUNCTIONALITY", + SetupL, UT_CMusAvaRegisterAvailability_NameL, Teardown) + + +EUNIT_TEST( + "Status - test ", + "CMusAvaRegisterAvailability", + "Status", + "FUNCTIONALITY", + SetupL, UT_CMusAvaRegisterAvailability_StatusL, Teardown) + +EUNIT_TEST( + "StopPattern - test ", + "CMusAvaRegisterAvailability", + "StopPattern", + "FUNCTIONALITY", + SetupL, UT_CMusAvaRegisterAvailability_Stop, Teardown) + +EUNIT_TEST( + "ProfileRegistryEventOccurred - test ", + "CMusAvaRegisterAvailability", + "ProfileRegistryEventOccurred", + "FUNCTIONALITY", + SetupL, UT_CMusAvaRegisterAvailability_ProfileRegistryEventOccurredL, Teardown) + +EUNIT_TEST( + "CreateSipAddressProposalL - test ", + "CMusAvaRegisterAvailability", + "CreateSipAddressProposalL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaRegisterAvailability_CreateSipAddressProposalLL, Teardown) + +EUNIT_TEST( + "ConnectionStateChanged - test ", + "CMusAvaRegisterAvailability", + "ConnectionStateChanged", + "FUNCTIONALITY", + SetupL, UT_CMusAvaRegisterAvailability_ConnectionStateChangedL, Teardown) + +EUNIT_TEST( + "ErrorOccurred - test ", + "CMusAvaRegisterAvailability", + "ErrorOccurred", + "FUNCTIONALITY", + SetupL, UT_CMusAvaRegisterAvailability_ProfileRegistryErrorOccurredL, Teardown) + +EUNIT_TEST( + "RegisterL - test ", + "CMusAvaRegisterAvailability", + "RegisterL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaRegisterAvailability_RegisterLL, Teardown) + +EUNIT_TEST( + "InitializeRegisterL - test ", + "CMusAvaRegisterAvailability", + "InitializeRegisterL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaRegisterAvailability_InitializeRegisterL, Teardown) + +EUNIT_TEST( + "EnableRegisterL - test ", + "CMusAvaRegisterAvailability", + "EnableRegisterL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaRegisterAvailability_EnableRegisterLL, Teardown) + +EUNIT_TEST( + "UpdateSIPProfile - test ", + "CMusAvaRegisterAvailability", + "UpdateSIPProfile", + "FUNCTIONALITY", + SetupL, UT_CMusAvaRegisterAvailability_UpdateSIPProfileL, Teardown) + + +EUNIT_TEST( + "RegistrationStatus - test ", + "CMusAvaRegisterAvailability", + "RegistrationStatus", + "FUNCTIONALITY", + SetupL, UT_CMusAvaRegisterAvailability_RegistrationStatusL, Teardown) + + +EUNIT_END_TEST_TABLE + +// END OF FILE diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaSettingAvailability.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaSettingAvailability.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,276 @@ +/* +* 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: +* +*/ + + +// CLASS HEADER +#include "UT_CMusAvaSettingAvailability.h" +#include "musavaavailabilityobserver.h" +#include "musavaavailabilityobserverimp.h" +#include "musavaavailability.h" +#include "muslogger.h" +#include "musavaobserver.h" +#include "musavaobserverimp.h" +#include "musavadefaultimp.h" +#include "musavaobserverimp.h" +#include "musavasharedobject.h" +#include "mussettingskeys.h" +#include "mussettings.h" +#include "mussesseioninformationapi.h" +#include "CSipSseTestTls.h" + +// EXTERNAL INCLUDES +#include +#include +#include +#include + + +// INTERNAL INCLUDES +#include "musavasettingavailability.h" + + + +// CONSTRUCTION +UT_CMusAvaSettingAvailability* UT_CMusAvaSettingAvailability::NewL() + { + UT_CMusAvaSettingAvailability* self = UT_CMusAvaSettingAvailability::NewLC(); + CleanupStack::Pop(); + + return self; + } + +UT_CMusAvaSettingAvailability* UT_CMusAvaSettingAvailability::NewLC() + { + UT_CMusAvaSettingAvailability* self = new( ELeave ) UT_CMusAvaSettingAvailability(); + CleanupStack::PushL( self ); + + self->ConstructL(); + + return self; + } + +// Destructor (virtual by CBase) +UT_CMusAvaSettingAvailability::~UT_CMusAvaSettingAvailability() + { + } + +// Default constructor +UT_CMusAvaSettingAvailability::UT_CMusAvaSettingAvailability() + { + } + +// Second phase construct +void UT_CMusAvaSettingAvailability::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + +// METHODS + + + +void UT_CMusAvaSettingAvailability::SetupL( ) + { + iAvailabilityObserver = CMusAvaAvailabilityObserverImp::NewL(); + iSettingAvailability = CMusAvaSettingAvailability::NewL( *iAvailabilityObserver ); + TRAP_IGNORE( SIPStrings::OpenL() ) + CSipSseTestTls::OpenL(); + } + +void UT_CMusAvaSettingAvailability::Teardown( ) + { + CSipSseTestTls::Close(); + SIPStrings::Close(); + delete iAvailabilityObserver; + iAvailabilityObserver = NULL; + delete iSettingAvailability; + iSettingAvailability = NULL; + PropertyHelper::Close(); + } + +void UT_CMusAvaSettingAvailability::UT_CMusAvaSettingAvailability_NewLL() + { + EUNIT_ASSERT( iSettingAvailability ); + } + +void UT_CMusAvaSettingAvailability::UT_CMusAvaSettingAvailability_CheckActivationStateL() + { + MultimediaSharingSettings::SetActivationSettingL(MusSettingsKeys::EAlwaysActive); + RProperty::Define( NMusSessionInformationApi::KCategoryUid , + NMusSessionInformationApi::KMUSForbidden, + RProperty::EInt,0); + + User::LeaveIfError( RProperty::Set( NMusSessionInformationApi::KCategoryUid , + NMusSessionInformationApi::KMUSForbidden , + NMusSessionInformationApi::EMUSAllowed )); + + iSettingAvailability->CheckActivationState(); + TInt count = 0; + EUNIT_GET_ALLOC_DECORATOR_FAILCOUNT( count ); + if ( count > 0 && iSettingAvailability->iState + == MMusAvaObserver::EMusActivationError ) + { + User::Leave( KErrNoMemory ); + } + EUNIT_ASSERT( iSettingAvailability->iState == MMusAvaObserver::EMusAvaStatusAvailable ); + + MultimediaSharingSettings::SetActivationSettingL(MusSettingsKeys::EActiveInHomeNetworks); + iSettingAvailability->CheckActivationState(); + EUNIT_GET_ALLOC_DECORATOR_FAILCOUNT( count ); + if ( count > 0 && iSettingAvailability->iState + == MMusAvaObserver::EMusActivationError ) + { + User::Leave( KErrNoMemory ); + } + EUNIT_ASSERT( iSettingAvailability->iState == MMusAvaObserver::EMusAvaStatusAvailable ); + + MultimediaSharingSettings::SetActivationSettingL(MusSettingsKeys::ENever); + iSettingAvailability->CheckActivationState(); + EUNIT_ASSERT( iSettingAvailability->iState == MMusAvaObserver::EMusActivationError ); + + MultimediaSharingSettings::SetActivationSettingL(MusSettingsKeys::EAlwaysActive); + + User::LeaveIfError( RProperty::Set( NMusSessionInformationApi::KCategoryUid , + NMusSessionInformationApi::KMUSForbidden , + NMusSessionInformationApi::EMUSForbidden )); + + iSettingAvailability->CheckActivationState(); + EUNIT_GET_ALLOC_DECORATOR_FAILCOUNT( count ); + if ( count > 0 && iSettingAvailability->iState + == MMusAvaObserver::EMusActivationError ) + { + User::Leave( KErrNoMemory ); + } + EUNIT_ASSERT( iSettingAvailability->iState == MMusAvaObserver::EMusAvaFailureCode ); + } + +void UT_CMusAvaSettingAvailability::UT_CMusAvaSettingAvailability_IsForbiddenByOptionsResponseL() + { + RProperty::Define( NMusSessionInformationApi::KCategoryUid , + NMusSessionInformationApi::KMUSForbidden, + RProperty::EInt,0 ); + + + User::LeaveIfError( RProperty::Set( NMusSessionInformationApi::KCategoryUid , + NMusSessionInformationApi::KMUSForbidden , + NMusSessionInformationApi::EMUSForbidden )); + EUNIT_ASSERT(iSettingAvailability->IsForbiddenByOptionsResponse()); + + User::LeaveIfError( RProperty::Set( NMusSessionInformationApi::KCategoryUid , + NMusSessionInformationApi::KMUSForbidden , + NMusSessionInformationApi::EMUSAllowed )); + + EUNIT_ASSERT(!iSettingAvailability->IsForbiddenByOptionsResponse()); + } + + +void UT_CMusAvaSettingAvailability::UT_CMusAvaSettingAvailability_StopL() + { + iSettingAvailability->Stop(); + EUNIT_ASSERT( iSettingAvailability->State() == MMusAvaObserver::EMusAvaStatusNotExecuted ); + + TRAPD( error, iSettingAvailability->DoExecuteL() ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT ( error == KErrNone ); + + iSettingAvailability->Stop(); + EUNIT_ASSERT( iSettingAvailability->State() == MMusAvaObserver::EMusAvaStatusNotExecuted ); + } + +void UT_CMusAvaSettingAvailability::UT_CMusAvaSettingAvailability_NameL() + { + EUNIT_ASSERT( iSettingAvailability->Name() == MMusAvaObserver::EMusAvaNameSetting ); + } + +void UT_CMusAvaSettingAvailability::UT_CMusAvaSettingAvailability_DoExecuteLL() + { + MultimediaSharingSettings::SetActivationSettingL(MusSettingsKeys::EAlwaysActive); + TRAPD( error, iSettingAvailability->DoExecuteL() ); + TInt count = 0; + EUNIT_GET_ALLOC_DECORATOR_FAILCOUNT( count ); + if ( count > 0 && iSettingAvailability->iState + == MMusAvaObserver::EMusActivationError ) + { + User::Leave( KErrNoMemory ); + } + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT ( error == KErrNone ); + + + User::LeaveIfError( RProperty::Set( NMusSessionInformationApi::KCategoryUid , + NMusSessionInformationApi::KMUSForbidden , + NMusSessionInformationApi::EMUSAllowed )); + + EUNIT_ASSERT( iSettingAvailability->State() == MMusAvaObserver::EMusAvaStatusAvailable ); + } + + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusAvaSettingAvailability, + "CMusAvaSettingAvailability", + "UNIT" ) + +EUNIT_TEST( + "NewL - test ", + "CMusAvaSettingAvailability", + "NewL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSettingAvailability_NewLL, Teardown) + +EUNIT_TEST( + "CheckActivationState - test ", + "CMusAvaSettingAvailability", + "CheckActivationState", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSettingAvailability_CheckActivationStateL, Teardown) + +EUNIT_TEST( + "IsForbiddenByOptionsResponse - test ", + "CMusAvaSettingAvailability", + "IsForbiddenByOptionsResponse", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSettingAvailability_IsForbiddenByOptionsResponseL, Teardown) + +EUNIT_TEST( + "Stop - test ", + "CMusAvaSettingAvailability", + "Stop", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSettingAvailability_StopL, Teardown) + +EUNIT_TEST( + "Name - test ", + "CMusAvaSettingAvailability", + "Name", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSettingAvailability_NameL, Teardown) + +EUNIT_TEST( + "DoExecuteL - test ", + "CMusAvaSettingAvailability", + "DoExecuteL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSettingAvailability_DoExecuteLL, Teardown) + + +EUNIT_END_TEST_TABLE + +// END OF FILE diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaSettingsImp.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaSettingsImp.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,520 @@ +/* +* 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: +* +*/ + + +// CLASS HEADER +#include "UT_CMusAvaSettingsImp.h" +#include "musavasettingsobserverimp.h" +#include "muslogger.h" +#include "musavacapabilitytesthelper.h" //remove compilation warning + +// EXTERNAL INCLUDES +#include +#include + +// INTERNAL INCLUDES +#include "musavasettingsimp.h" + +_LIT(KContactName,"Matti Meikalainen"); + +// CONSTRUCTION +UT_CMusAvaSettingsImp* UT_CMusAvaSettingsImp::NewL() + { + UT_CMusAvaSettingsImp* self = UT_CMusAvaSettingsImp::NewLC(); + CleanupStack::Pop(); + + return self; + } + +UT_CMusAvaSettingsImp* UT_CMusAvaSettingsImp::NewLC() + { + UT_CMusAvaSettingsImp* self = new( ELeave ) UT_CMusAvaSettingsImp(); + CleanupStack::PushL( self ); + self->ConstructL(); + + return self; + } + +// Destructor (virtual by CBase) +UT_CMusAvaSettingsImp::~UT_CMusAvaSettingsImp() + { + } + +// Default constructor +UT_CMusAvaSettingsImp::UT_CMusAvaSettingsImp() + { + } + +// Second phase construct +void UT_CMusAvaSettingsImp::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + +// METHODS + +void UT_CMusAvaSettingsImp::SetupL() + { + iSettingsImp = CMusAvaSettingsImp::NewL(); + } + +void UT_CMusAvaSettingsImp::Teardown() + { + delete iSettingsImp; + } + +void UT_CMusAvaSettingsImp::UT_CMusAvaSettingsImp_NewLL() + { + EUNIT_ASSERT( iSettingsImp ); + } + +void UT_CMusAvaSettingsImp::UT_CMusAvaSettingsImp_DestructorL() + { + if( iSettingsImp->iSipAddresses ) + { + iSettingsImp->iSipAddresses->Reset(); + delete iSettingsImp->iSipAddresses; + iSettingsImp->iSipAddresses = NULL ; + } + + if( iSettingsImp->iVideoCodecs ) + { + iSettingsImp->iVideoCodecs->Reset(); + delete iSettingsImp->iVideoCodecs; + iSettingsImp->iVideoCodecs = NULL ; + } + + if( iSettingsImp->iAudioCodecs ) + { + iSettingsImp->iAudioCodecs->Reset(); + delete iSettingsImp->iAudioCodecs; + iSettingsImp->iAudioCodecs = NULL ; + } + } + +void UT_CMusAvaSettingsImp::UT_CMusAvaSettingsImp_TelNumberL() + { + EUNIT_ASSERT( iSettingsImp->TelNumber().Length() == 0 ); + } + +void UT_CMusAvaSettingsImp::UT_CMusAvaSettingsImp_ContactNameL() + { + _LIT(KContactName,"Matti Meikalainen"); + iSettingsImp->SetContactNameL( KContactName ); + EUNIT_ASSERT( iSettingsImp->iContactName->Compare( KContactName ) == 0 ); + EUNIT_ASSERT( iSettingsImp->ContactName().Compare( KContactName ) == 0 ); + } + +void UT_CMusAvaSettingsImp::UT_CMusAvaSettingsImp_SipAddressProposalL() + { + EUNIT_ASSERT( iSettingsImp->SipAddressProposal().Length() == 0 ); + } + +void UT_CMusAvaSettingsImp::UT_CMusAvaSettingsImp_SipAddressesL() + { + EUNIT_ASSERT( iSettingsImp->SipAddresses().MdcaCount() == 0 ); + } + +void UT_CMusAvaSettingsImp::UT_CMusAvaSettingsImp_ContactIdL() + { + EUNIT_ASSERT( iSettingsImp->ContactId() == KErrNotFound ); + } + +void UT_CMusAvaSettingsImp::UT_CMusAvaSettingsImp_VideoCodecsL() + { + EUNIT_ASSERT( iSettingsImp->VideoCodecs().MdcaCount() == 0 ); + } + +void UT_CMusAvaSettingsImp::UT_CMusAvaSettingsImp_AudioCodecsL() + { + EUNIT_ASSERT( iSettingsImp->AudioCodecs().MdcaCount() == 0 ); + } + +void UT_CMusAvaSettingsImp::UT_CMusAvaSettingsImp_SipProfileIdL() + { + EUNIT_ASSERT( iSettingsImp->SipProfileId() == KErrNotFound ); + } + +void UT_CMusAvaSettingsImp::UT_CMusAvaSettingsImp_SetObserverL() + { + CMusAvaSettingsObserverImp* observer = CMusAvaSettingsObserverImp::NewL(); + CleanupStack::PushL( observer ); + iSettingsImp->SetObserver( *observer ); + EUNIT_ASSERT( iSettingsImp->iObserver == observer); + CleanupStack::PopAndDestroy( observer ); + } + +void UT_CMusAvaSettingsImp::UT_CMusAvaSettingsImp_ManualActivationL() + { + EUNIT_ASSERT(iSettingsImp->iManualActivation == MMusAvaSettings::EActivationNotExecuted ); + iSettingsImp->SetManualActivation( MMusAvaSettings::EActivationAllowed ); + EUNIT_ASSERT(iSettingsImp->ManualActivation() == MMusAvaSettings::EActivationAllowed ); + } + +void UT_CMusAvaSettingsImp::UT_CMusAvaSettingsImp_ApplicationStateL() + { + EUNIT_ASSERT( iSettingsImp->ApplicationState() == + MMusAvaSettingsObserver::EApplicationStateNotDefined ); + + CMusAvaSettingsObserverImp* observer = CMusAvaSettingsObserverImp::NewL(); + CleanupStack::PushL( observer ); + iSettingsImp->SetObserver( *observer ); + EUNIT_ASSERT( iSettingsImp->ApplicationState() == + MMusAvaSettingsObserver::EApplicationIsRunning ); + EUNIT_ASSERT( iSettingsImp->iObserver == observer ); + CleanupStack::PopAndDestroy( observer ); + } + +void UT_CMusAvaSettingsImp::UT_CMusAvaSettingsImp_CallDirectionL() + { + TInt callDirection = iSettingsImp->CallDirection(); + EUNIT_ASSERT( callDirection == 0 ); + callDirection = 1; + iSettingsImp->SetCallDirection( callDirection ); + EUNIT_ASSERT( callDirection == iSettingsImp->CallDirection() ); + } + +void UT_CMusAvaSettingsImp::UT_CMusAvaSettingsImp_SetTelNumberLL() + { + _LIT( KNumber , "123456789" ); + iSettingsImp->SetTelNumberL( KNumber ); + EUNIT_ASSERT( iSettingsImp->iTelNumber->Compare( KNumber ) == 0 ); + } + +void UT_CMusAvaSettingsImp::UT_CMusAvaSettingsImp_SetSipAddressProposalLL( ) + { + _LIT( KNumber , "123456789" ); + _LIT( KDomain , "test.com" ); + _LIT( KSipAddress , "123456789@test.com" ); + iSettingsImp->SetSipAddressProposalL( KNumber, KDomain ); + EUNIT_ASSERT( iSettingsImp->iSipAddressProposal->Des().Compare( KSipAddress() ) == KErrNone ); + } + +void UT_CMusAvaSettingsImp::UT_CMusAvaSettingsImp_ReleseTelNumberL() + { + _LIT( KNumber , "123456789" ); + iSettingsImp->SetTelNumberL( KNumber ); + EUNIT_ASSERT( iSettingsImp->iTelNumber->Compare( KNumber ) == 0 ); + iSettingsImp->ReleseTelNumberL(); + EUNIT_ASSERT( iSettingsImp->iTelNumber->Length() == 0 ) + } + +void UT_CMusAvaSettingsImp::UT_CMusAvaSettingsImp_SetSipAddressesLL() + { + _LIT16( KSipAddress , "test@123456789" ); + _LIT16( KSipAddress1 , "test1@123456789" ); + TBufC16<16> str(KSipAddress); + TBufC16<16> str1(KSipAddress); + + HBufC16* ptr; + ptr = str.AllocLC(); + + CDesCArrayFlat* sipAddress = new( ELeave ) CDesCArrayFlat( 1 ); + CleanupStack::PushL( sipAddress ); + + sipAddress->AppendL( *ptr ); + + iSettingsImp->SetSipAddressesL( *sipAddress ); + + EUNIT_ASSERT( iSettingsImp->iSipAddresses->MdcaCount() > KErrNone ); + EUNIT_ASSERT( iSettingsImp->iSipAddresses->MdcaPoint( 0 ).Compare( *ptr ) == 0); + sipAddress->Reset(); + CleanupStack::PopAndDestroy( sipAddress ); + CleanupStack::PopAndDestroy(); + + // set sipaddresses again + HBufC16* ptr1; + ptr1 = str1.AllocLC(); + sipAddress = new( ELeave ) CDesCArrayFlat( 1 ); + CleanupStack::PushL( sipAddress ); + + sipAddress->AppendL( *ptr1 ); + + iSettingsImp->SetSipAddressesL( sipAddress ); + + EUNIT_ASSERT( iSettingsImp->iSipAddresses->MdcaCount() == 1 ); + EUNIT_ASSERT( iSettingsImp->iSipAddresses->MdcaPoint( 0 ).Compare( *ptr1 ) == 0); + CleanupStack::Pop( sipAddress ); + CleanupStack::PopAndDestroy(); + } + +void UT_CMusAvaSettingsImp::UT_CMusAvaSettingsImp_SetContactIdL() + { + iSettingsImp->SetContactId( 1 ); + EUNIT_ASSERT( iSettingsImp->iContactId == 1 ); + } + +void UT_CMusAvaSettingsImp::UT_CMusAvaSettingsImp_SetVideoCodecsLL() + { + _LIT16( KSipAddress , "amr" ); + TBufC16<16> str(KSipAddress); + HBufC16* ptr; + ptr = str.AllocLC(); + + CDesCArrayFlat* videoCodecs = new( ELeave ) CDesCArrayFlat( 1 ); + CleanupStack::PushL( videoCodecs ); + + videoCodecs->AppendL( *ptr ); + iSettingsImp->SetVideoCodecsL( *videoCodecs ); + + EUNIT_ASSERT( iSettingsImp->iVideoCodecs->MdcaCount() > KErrNone ); + EUNIT_ASSERT( iSettingsImp->iVideoCodecs->MdcaPoint( 0 ).Compare( *ptr ) == 0); + videoCodecs->Reset(); + CleanupStack::PopAndDestroy( videoCodecs ); + CleanupStack::PopAndDestroy(); + } + +void UT_CMusAvaSettingsImp::UT_CMusAvaSettingsImp_SetAudioCodecsLL() + { + _LIT16( KSipAddress , "H.263" ); + TBufC16<16> str(KSipAddress); + HBufC16* ptr; + ptr = str.AllocLC(); + + CDesCArrayFlat* audioCodecs = new( ELeave ) CDesCArrayFlat( 1 ); + CleanupStack::PushL( audioCodecs ); + + audioCodecs->AppendL( *ptr ); + iSettingsImp->SetAudioCodecsL( *audioCodecs ); + audioCodecs->Reset(); + CleanupStack::PopAndDestroy( audioCodecs ); + + EUNIT_ASSERT( iSettingsImp->iAudioCodecs->MdcaCount() > KErrNone ); + EUNIT_ASSERT( iSettingsImp->iAudioCodecs->MdcaPoint( 0 ).Compare( *ptr ) == 0); + EUNIT_ASSERT( iSettingsImp->iAudioCodecs->MdcaPoint( 0 ).Compare( KSipAddress ) == 0); + + CleanupStack::PopAndDestroy(); + } + +void UT_CMusAvaSettingsImp::UT_CMusAvaSettingsImp_SetSipProfileIdL() + { + iSettingsImp->SetSipProfileId(1); + EUNIT_ASSERT( iSettingsImp->iSipProfileId == 1 ); + } + +void UT_CMusAvaSettingsImp::UT_CMusAvaSettingsImp_CopyDescArrayLL() + { + CDesCArrayFlat* array = new( ELeave ) CDesCArrayFlat( 2 ); + CleanupStack::PushL( array ); + CDesCArrayFlat* target = new( ELeave ) CDesCArrayFlat( 2 ); + CleanupStack::PushL( target ); + + _LIT16( KDummy1 , "Dummy1" ); + TBufC16<16> str1(KDummy1); + HBufC16* ptr1; + ptr1 = str1.AllocLC(); + + _LIT16( KDummy2 , "Dummy1" ); + TBufC16<16> str2(KDummy2); + HBufC16* ptr2; + ptr2 = str2.AllocLC(); + + array->AppendL( *ptr1 ); + array->AppendL( *ptr2 ); + + + iSettingsImp->CopyDescArrayL( *target, *array ); + EUNIT_ASSERT( target->MdcaCount() == 2 ); + EUNIT_ASSERT( target->MdcaPoint( 0 ).Compare( *ptr1 ) == 0); + EUNIT_ASSERT( target->MdcaPoint( 1 ).Compare( *ptr2 ) == 0); + + CleanupStack::PopAndDestroy( 2 ); + CleanupStack::PopAndDestroy( target ); + CleanupStack::PopAndDestroy( array ); + } + + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusAvaSettingsImp, + "CMusAvaSettingsImp", + "UNIT" ) + +EUNIT_TEST( + "NewL - test ", + "CMusAvaSettingsImp", + "NewL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSettingsImp_NewLL, Teardown) + +EUNIT_TEST( + "~CMusAvaSettingsImp - test ", + "CMusAvaSettingsImp", + "~CMusAvaSettingsImp", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSettingsImp_DestructorL, Teardown) + +EUNIT_TEST( + "TelNumber - test ", + "CMusAvaSettingsImp", + "TelNumber", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSettingsImp_TelNumberL, Teardown) + +EUNIT_TEST( + "ContactName - test ", + "CMusAvaSettingsImp", + "ContactName", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSettingsImp_ContactNameL, Teardown) + + EUNIT_TEST( + "SipAddressProposal - test ", + "CMusAvaSettingsImp", + "SipAddressProposal", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSettingsImp_SipAddressProposalL, Teardown) + + EUNIT_TEST( + "SipAddresses - test ", + "CMusAvaSettingsImp", + "SipAddresses", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSettingsImp_SipAddressesL, Teardown) + + EUNIT_TEST( + "ContactId - test ", + "CMusAvaSettingsImp", + "ContactId", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSettingsImp_ContactIdL, Teardown) + + EUNIT_TEST( + "VideoCodecs - test ", + "CMusAvaSettingsImp", + "VideoCodecs", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSettingsImp_VideoCodecsL, Teardown) + +EUNIT_TEST( + "AudioCodecs - test ", + "CMusAvaSettingsImp", + "AudioCodecs", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSettingsImp_AudioCodecsL, Teardown) + + EUNIT_TEST( + "SipProfileId - test ", + "CMusAvaSettingsImp", + "SipProfileId", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSettingsImp_SipProfileIdL, Teardown) + +EUNIT_TEST( + "SetObserver - test ", + "CMusAvaSettingsImp", + "SetObserver", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSettingsImp_SetObserverL, Teardown) + +EUNIT_TEST( + "ManualActivation - test ", + "CMusAvaSettingsImp", + "ManualActivation", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSettingsImp_ManualActivationL, Teardown) + +EUNIT_TEST( + "ApplicationState - test ", + "CMusAvaSettingsImp", + "ApplicationState", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSettingsImp_ApplicationStateL, Teardown) + +EUNIT_TEST( + "CallDirection - test ", + "CMusAvaSettingsImp", + "CallDirection", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSettingsImp_CallDirectionL, Teardown) + + EUNIT_TEST( + "SetTelNumberL - test ", + "CMusAvaSettingsImp", + "SetTelNumberL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSettingsImp_SetTelNumberLL, Teardown) + + EUNIT_TEST( + "SetSipAddressProposalL - test ", + "CMusAvaSettingsImp", + "SetSipAddressProposalL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSettingsImp_SetSipAddressProposalLL, Teardown) + + EUNIT_TEST( + "ReleseTelNumberL - test ", + "CMusAvaSettingsImp", + "ReleseTelNumberL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSettingsImp_ReleseTelNumberL, Teardown) + + EUNIT_TEST( + "SetTelNumberL - test ", + "CMusAvaSettingsImp", + "SetTelNumberL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSettingsImp_SetTelNumberLL, Teardown) + + EUNIT_TEST( + "SetSipAddressesL - test ", + "CMusAvaSettingsImp", + "SetSipAddressesL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSettingsImp_SetSipAddressesLL, Teardown) + + EUNIT_TEST( + "SetContactId - test ", + "CMusAvaSettingsImp", + "SetContactId", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSettingsImp_SetContactIdL, Teardown) + + EUNIT_TEST( + "SetVideoCodecsL - test ", + "CMusAvaSettingsImp", + "SetVideoCodecsL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSettingsImp_SetVideoCodecsLL, Teardown) + + EUNIT_TEST( + "SetAudioCodecsL - test ", + "CMusAvaSettingsImp", + "SetAudioCodecsL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSettingsImp_SetAudioCodecsLL, Teardown) + +EUNIT_TEST( + "SetSipProfileId - test ", + "CMusAvaSettingsImp", + "SetSipProfileId", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSettingsImp_SetSipProfileIdL, Teardown) + +EUNIT_TEST( + "Sip - test ", + "CMusAvaSettingsImp", + "Sip", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSettingsImp_CopyDescArrayLL, Teardown) + +EUNIT_END_TEST_TABLE + +// END OF FILE diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaSharedObject.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaSharedObject.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,179 @@ +/* +* 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: +* +*/ + + +// CLASS HEADER +#include +#include +#include "UT_CMusAvaSharedObject.h" +#include "muslogger.h" +#include "CSipSseTestTls.h" +#include "musavasipdefaulthandler.h" +#include "sipconnectionobserver.h" +#include "musavasipdefaulthandler.h" +#include "musavasipconnectionadapter.h" +#include "musavasettingsimp.h" +#include "musavaregisteravailability.h" +#include "musavasipdefaulthandler.h" +#include "musavacapabilitytesthelper.h" //remove compilation warning + +// EXTERNAL INCLUDES +#include +#include +//#include +#include + +// INTERNAL INCLUDES +#include "musavasharedobject.h" + + + +// CONSTRUCTION +UT_CMusAvaSharedObject* UT_CMusAvaSharedObject::NewL() + { + UT_CMusAvaSharedObject* self = UT_CMusAvaSharedObject::NewLC(); + CleanupStack::Pop(); + + return self; + } + +UT_CMusAvaSharedObject* UT_CMusAvaSharedObject::NewLC() + { + UT_CMusAvaSharedObject* self = new( ELeave ) UT_CMusAvaSharedObject(); + CleanupStack::PushL( self ); + + self->ConstructL(); + + return self; + } + +// Destructor (virtual by CBase) +UT_CMusAvaSharedObject::~UT_CMusAvaSharedObject() + { + } + +// Default constructor +UT_CMusAvaSharedObject::UT_CMusAvaSharedObject() + { + } + +// Second phase construct +void UT_CMusAvaSharedObject::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + +// METHODS + + + +void UT_CMusAvaSharedObject::SetupL( ) + { + SIPStrings::OpenL(); + iSharedObject = CMusAvaSharedObject::GetSingletonL(); + CSipSseTestTls::OpenL(); + iStorage = CSipSseTestTls::Storage(); + + } + +void UT_CMusAvaSharedObject::Teardown( ) + { + CMusAvaSharedObject::DeleteSingleton(); + + if ( iStorage ) + { + iStorage->Clear(); + CSipSseTestTls::Close(); + iStorage = NULL; + } + SIPStrings::Close(); + } + + +void UT_CMusAvaSharedObject::UT_CMusAvaSharedObject_NewLL() + { + EUNIT_ASSERT( iSharedObject->iSelfCounter == 1 ); + CMusAvaSharedObject* sharedObject = CMusAvaSharedObject::GetSingletonL(); + EUNIT_ASSERT( iSharedObject->iSelfCounter == 2 ); + CMusAvaSharedObject::DeleteSingleton(); + EUNIT_ASSERT( iSharedObject->iSelfCounter == 1 ); + EUNIT_ASSERT( &(iSharedObject->MusAvaSip()) != NULL ); + EUNIT_ASSERT( &(iSharedObject->MusAvaTelephonyStatus()) != NULL ); + EUNIT_ASSERT( &(iSharedObject->NetworkModeStatus()) != NULL ); + } + +void UT_CMusAvaSharedObject::UT_CMusAvaSharedObject_ConnectionMonitorL() + { + CMusAvaConnectionMonitor& connectionMonitor = iSharedObject->ConnectionMonitor(); + EUNIT_ASSERT( &connectionMonitor != NULL ); + } + +void UT_CMusAvaSharedObject::UT_CMusAvaSharedObject_MusAvaSipL() + { + CMusAvaSip& avaSip = iSharedObject->MusAvaSip(); + EUNIT_ASSERT( &avaSip != NULL ); + } + +void UT_CMusAvaSharedObject::UT_CMusAvaSharedObject_SipL() + { + CSIP& sip = iSharedObject->Sip(); + EUNIT_ASSERT( &sip != NULL ); + } + + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusAvaSharedObject, + "CMusAvaSharedObject", + "UNIT" ) + +EUNIT_TEST( + "NewL - test ", + "CMusAvaSip", + "NewL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSharedObject_NewLL, Teardown) + +EUNIT_TEST( + "ConnectionMonitor - test ", + "CMusAvaSharedObjectp", + "ConnectionMonitor", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSharedObject_ConnectionMonitorL, Teardown) + + +EUNIT_TEST( + "MusAvaSip - test ", + "CMusAvaSharedObjectp", + "MusAvaSip", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSharedObject_MusAvaSipL, Teardown) + +EUNIT_TEST( + "Sip - test ", + "CMusAvaSharedObjectp", + "Sip", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSharedObject_SipL, Teardown) + + +EUNIT_END_TEST_TABLE + +// END OF FILE diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaSip.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaSip.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,478 @@ +/* +* 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: +* +*/ + + +// CLASS HEADER +#include "sipprofile.h" +#include "UT_CMusAvaSip.h" +#include "muslogger.h" +#include "mussettings.inl" +#include "CSipSseTestTls.h" +#include "mussettingskeys.h" +#include "musavasipdefaulthandler.h" +#include "sipconnectionobserver.h" +#include "musavasipdefaulthandler.h" +#include "musavasipconnectionadapter.h" +#include "musavasettingsimp.h" +#include "musavaregisteravailability.h" +#include "musavasipprofileregistryobserver.h" +#include "musavacapabilitytesthelper.h" //remove compilation warning +#include "CSipSseTestTls.h" + +// EXTERNAL INCLUDES +#include +#include +//#include +#include +#include +#include +#include + + +// INTERNAL INCLUDES +#include "musavasip.h" + + + +// CONSTRUCTION +UT_CMusAvaSip* UT_CMusAvaSip::NewL() + { + UT_CMusAvaSip* self = UT_CMusAvaSip::NewLC(); + CleanupStack::Pop(); + + return self; + } + +UT_CMusAvaSip* UT_CMusAvaSip::NewLC() + { + UT_CMusAvaSip* self = new( ELeave ) UT_CMusAvaSip(); + CleanupStack::PushL( self ); + + self->ConstructL(); + + return self; + } + +// Destructor (virtual by CBase) +UT_CMusAvaSip::~UT_CMusAvaSip() + { + } + +// Default constructor +UT_CMusAvaSip::UT_CMusAvaSip() + { + } + +// Second phase construct +void UT_CMusAvaSip::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + +// METHODS + + + +void UT_CMusAvaSip::SetupL( ) + { + SIPStrings::OpenL(); + CSipSseTestTls::OpenL(); + iProfileId = MultimediaSharingSettings::SipProfileSettingL(); + iMusAvaSip = CMusAvaSip::NewL(); + } + +void UT_CMusAvaSip::Teardown( ) + { + delete iMusAvaSip; + iMusAvaSip = NULL; + MultimediaSharingSettings::SetSipProfileSettingL( iProfileId ); + CSipSseTestTls::Close(); + SIPStrings::Close(); + } + +void UT_CMusAvaSip::UT_CMusAvaSip_NewLL( ) + { + EUNIT_ASSERT( iMusAvaSip->iSip ); + EUNIT_ASSERT( iMusAvaSip->iSipObserver ); + EUNIT_ASSERT( iMusAvaSip->iSipConnectionObserver ); + EUNIT_ASSERT( iMusAvaSip->iSipProfileRegistryObserver ); + } + +void UT_CMusAvaSip::UT_CMusAvaSip_AddAdapterLL() + { + CMusAvaSipDefaultHandler* defaultHandler + = new( ELeave ) CMusAvaSipDefaultHandler(); + CleanupStack::PushL( defaultHandler ); + iMusAvaSip->AddAdapterL( *defaultHandler ); + EUNIT_ASSERT( iMusAvaSip->iSipConnectionObserver ); + CleanupStack::PopAndDestroy( defaultHandler ); + } + +void UT_CMusAvaSip::UT_CMusAvaSip_RemoveAdapterL() + { + CMusAvaSipDefaultHandler* defaultHandler + = new( ELeave ) CMusAvaSipDefaultHandler(); + CleanupStack::PushL( defaultHandler ); + iMusAvaSip->AddAdapterL( *defaultHandler ); + EUNIT_ASSERT( iMusAvaSip->iSipConnectionObserver ); + iMusAvaSip->RemoveAdapter( *defaultHandler ); + // EUNIT_ASSERT( !iMusAvaSip->iSipConnectionObserver->iObservers.Count() ); + CleanupStack::PopAndDestroy( defaultHandler ); + } +void UT_CMusAvaSip::UT_CMusAvaSip_CreateProfileL() + { + // Test Profile + //No profile + TInt ret = NULL; + TRAPD( error, ret = iMusAvaSip->CreateProfileL() ); + if ( error == KErrNoMemory ) User::Leave( error ); + TInt count = 0; + EUNIT_GET_ALLOC_DECORATOR_FAILCOUNT( count ); + if ( count > 0 && ret == KErrNone ) + { + User::Leave( KErrNoMemory ); + } + EUNIT_ASSERT ( ret ); + + // Test Profile + //Profile created + delete iMusAvaSip; + iMusAvaSip = NULL; + iMusAvaSip = CMusAvaSip::NewL(); + MultimediaSharingSettings::SetSipProfileSettingL( 1 ); + iMusAvaSip->iSipProfileRegistry = CSIPProfileRegistry::NewL( + *iMusAvaSip->iSip, + *iMusAvaSip->iSipProfileRegistryObserver ); + iMusAvaSip->iSipProfile = + iMusAvaSip->GetMusProfileL( *iMusAvaSip->iSipProfileRegistry ); + TRAP( error, ret = iMusAvaSip->CreateProfileL() ); + if ( error == KErrNoMemory ) User::Leave( KErrNoMemory ); + EUNIT_ASSERT ( ret ); + + delete iMusAvaSip; + iMusAvaSip = NULL; + iMusAvaSip = CMusAvaSip::NewL(); + //Test sip profile registry + //No profile registry, registry creation fails + CSipSseTestTls::Storage()->iRegistryBehavior = KRegistryLeaveAtConstruct; + TRAP( error, ret = iMusAvaSip->CreateProfileL() ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT ( !ret ); + CSipSseTestTls::Storage()->Reset(); + + //Create sip profile registry + delete iMusAvaSip; + iMusAvaSip = NULL; + iMusAvaSip = CMusAvaSip::NewL(); + + iMusAvaSip->iSipProfileRegistry = CSIPProfileRegistry::NewL( + *iMusAvaSip->iSip, + *iMusAvaSip->iSipProfileRegistryObserver ); + MultimediaSharingSettings::SetSipProfileSettingL( 1 ); + TRAP( error, ret = iMusAvaSip->CreateProfileL() ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT ( ret ); + + //Test sip profile registry + //No profile registry, registry creation ok + TRAP( error, ret = iMusAvaSip->CreateProfileL() ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT ( ret ); + //Create sip profile registry + delete iMusAvaSip; + iMusAvaSip = NULL; + iMusAvaSip = CMusAvaSip::NewL(); + iMusAvaSip->iSipProfileRegistry = CSIPProfileRegistry::NewL( + *iMusAvaSip->iSip, + *iMusAvaSip->iSipProfileRegistryObserver ); + MultimediaSharingSettings::SetSipProfileSettingL( 1 ); + TRAP( error, ret = iMusAvaSip->CreateProfileL() ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT ( ret ); + // Test profile settings + // Resolve profile fail + delete iMusAvaSip; + iMusAvaSip = NULL; + iMusAvaSip = CMusAvaSip::NewL(); + // Profile found, profile id not found + CSipSseTestTls::Storage()->iProfileBehavior = KSIPProfileIdFetchFails; + MultimediaSharingSettings::SetSipProfileSettingL( 1 ); + TRAP( error, ret = iMusAvaSip->CreateProfileL() ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT ( ret ); + CSipSseTestTls::Storage()->Reset(); + + // Profile found, iap id not found + delete iMusAvaSip; + iMusAvaSip = NULL; + iMusAvaSip = CMusAvaSip::NewL(); + CSipSseTestTls::Storage()->iProfileBehavior = KSIPIapIdFetchFails; + TRAP( error, ret = iMusAvaSip->CreateProfileL() ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT ( !ret ); + CSipSseTestTls::Storage()->Reset(); + + // All ok + delete iMusAvaSip; + iMusAvaSip = NULL; + iMusAvaSip = CMusAvaSip::NewL(); + TRAP( error, ret = iMusAvaSip->CreateProfileL() ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT ( ret ); + + } + +void UT_CMusAvaSip::UT_CMusAvaSip_CreateSipProfileL() + { + // Test Profile + //No profile + TInt ret = NULL; + TRAPD( error, ret = iMusAvaSip->CreateSipProfile() ); + if ( error == KErrNoMemory ) User::Leave( error ); + TInt count = 0; + EUNIT_GET_ALLOC_DECORATOR_FAILCOUNT( count ); + if ( count > 0 && ret == KErrNone ) + { + User::Leave( KErrNoMemory ); + } + EUNIT_ASSERT ( ret ); + // Test Profile + //Profile created + delete iMusAvaSip; + iMusAvaSip = NULL; + iMusAvaSip = CMusAvaSip::NewL(); + MultimediaSharingSettings::SetSipProfileSettingL( 1 ); + iMusAvaSip->iSipProfileRegistry = CSIPProfileRegistry::NewL( + *iMusAvaSip->iSip, + *iMusAvaSip->iSipProfileRegistryObserver ); + iMusAvaSip->iSipProfile = + iMusAvaSip->GetMusProfileL( *iMusAvaSip->iSipProfileRegistry ); + TRAP( error, ret = iMusAvaSip->CreateSipProfile() ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_GET_ALLOC_DECORATOR_FAILCOUNT( count ); + if ( count > 0 && ret == KErrNone ) + { + User::Leave( KErrNoMemory ); + } + EUNIT_ASSERT ( ret ); + } + +void UT_CMusAvaSip::UT_CMusAvaSip_ProfileL() + { + //No profile + EUNIT_ASSERT( iMusAvaSip->Profile() == NULL ); + //Profile created + MultimediaSharingSettings::SetSipProfileSettingL( 1 ); + EUNIT_ASSERT( iMusAvaSip->CreateProfileL()); + EUNIT_ASSERT( iMusAvaSip->Profile() != NULL ); + } + +void UT_CMusAvaSip::UT_CMusAvaSip_ProfileRegistryL() + { + //Create SIP Profile Registry + CSIPProfileRegistry* registry = &iMusAvaSip->ProfileRegistryL(); + EUNIT_ASSERT( registry != NULL ); + //SIP Profile Registry is created + registry = &iMusAvaSip->ProfileRegistryL(); + EUNIT_ASSERT( registry != NULL ); + } + +void UT_CMusAvaSip::UT_CMusAvaSip_ConnectionL() + { + //No connection + EUNIT_ASSERT( iMusAvaSip->iSipConnection == NULL ); + //Connection is created when SIP profile is created + MultimediaSharingSettings::SetSipProfileSettingL( 1 ); + EUNIT_ASSERT( iMusAvaSip->CreateProfileL() ); + + //Still no connection + EUNIT_ASSERT( iMusAvaSip->iSipConnection == NULL ); + + TRAPD( err, iMusAvaSip->ConnectionL( EFalse ) ); + EUNIT_ASSERT( err == KErrSIPInvalidRegistrationState ); + + // Forced creation (done normally when profile is registered). + EUNIT_ASSERT( iMusAvaSip->ConnectionL() != NULL ); + } + +void UT_CMusAvaSip::UT_CMusAvaSip_ConnectionObserverL() + { + MSIPConnectionObserver& con = iMusAvaSip->ConnectionObserver(); + EUNIT_ASSERT( &con != NULL ); + } + +void UT_CMusAvaSip::UT_CMusAvaSip_SipL() + { + CSIP& sip = iMusAvaSip->Sip(); + EUNIT_ASSERT( &sip != NULL ); + } + +void UT_CMusAvaSip::UT_CMusAvaSip_CreateSIPConnectionLL() + { + TUint32 iapId; + //Profile created + delete iMusAvaSip; + iMusAvaSip = NULL; + iMusAvaSip = CMusAvaSip::NewL(); + MultimediaSharingSettings::SetSipProfileSettingL( 0 ); + iMusAvaSip->CreateSipProfile(); + iMusAvaSip->Profile()->GetParameter( KSIPAccessPointId, iapId ); + iMusAvaSip->iIapId = iapId; + iMusAvaSip->CreateSIPConnectionL(); + EUNIT_ASSERT( iMusAvaSip->ConnectionL( EFalse )->IapId() == iapId ); + } + +void UT_CMusAvaSip::UT_CMusAvaSip_OwnDomainL() + { + // Profile does not exist + HBufC* ownDomain = iMusAvaSip->OwnDomainLC(); + EUNIT_ASSERT( ownDomain->Length() == 0 ); + CleanupStack::PopAndDestroy( ownDomain ); + ownDomain = NULL; + + // Profile exists, no aors + MultimediaSharingSettings::SetSipProfileSettingL( 1 ); + TInt ret = NULL; + TRAPD( error, ret = iMusAvaSip->CreateProfileL() ); + if ( error == KErrNoMemory ) User::Leave( error ); + TInt count = 0; + EUNIT_GET_ALLOC_DECORATOR_FAILCOUNT( count ); + if ( count > 0 && ret == KErrNone ) + { + User::Leave( KErrNoMemory ); + } + EUNIT_ASSERT ( ret ); + ownDomain = iMusAvaSip->OwnDomainLC(); + EUNIT_ASSERT( ownDomain->Length() == 0 ); + CleanupStack::PopAndDestroy( ownDomain ); + ownDomain = NULL; + + // Empty aors + CSIPProfile* profile = iMusAvaSip->Profile(); + delete profile->iArray; + profile->iArray = NULL; + profile->iArray = new ( ELeave ) CDesC8ArrayFlat( 1 ); + ownDomain = iMusAvaSip->OwnDomainLC(); + EUNIT_ASSERT( ownDomain->Length() == 0 ); + CleanupStack::PopAndDestroy( ownDomain ); + ownDomain = NULL; + + // Aors found + profile->iArray->AppendL( _L8("sip:user@domain.com") ); + ownDomain = iMusAvaSip->OwnDomainLC(); + EUNIT_ASSERT( ownDomain->Length() > 0 ); + CleanupStack::PopAndDestroy( ownDomain ); + } + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusAvaSip, + "CMusAvaSip.", + "UNIT" ) + +EUNIT_TEST( + "NewL - test ", + "CMusAvaSip", + "NewL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSip_NewLL, Teardown) + +EUNIT_TEST( + "AddAdapterL - test ", + "CMusAvaSip", + "AddAdapterL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSip_AddAdapterLL, Teardown) + +EUNIT_TEST( + "RemoveAdapter - test ", + "CMusAvaSip", + "RemoveAdapter", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSip_RemoveAdapterL, Teardown) + + +EUNIT_TEST( + "CreateProfile - test ", + "CMusAvaSip", + "CreateProfile", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSip_CreateProfileL, Teardown) + +EUNIT_TEST( + "CreateSipProfile - test ", + "CMusAvaSip", + "CreateSipProfile", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSip_CreateSipProfileL, Teardown) + + +EUNIT_TEST( + "ProfileL - test ", + "CMusAvaSip", + "ProfileL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSip_ProfileL, Teardown) + +EUNIT_TEST( + "ProfileRegistry - test ", + "CMusAvaSip", + "ProfileRegistry", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSip_ProfileRegistryL, Teardown) + + EUNIT_TEST( + "Connection - test ", + "CMusAvaSip", + "Connection", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSip_ConnectionL, Teardown) + +EUNIT_TEST( + "ConnectionObserver - test ", + "CMusAvaSip", + "ConnectionObserver", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSip_ConnectionObserverL, Teardown) + +EUNIT_TEST( + "Sip - test ", + "CMusAvaSip", + "Sip", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSip_SipL, Teardown) + +EUNIT_TEST( + "CreateSIPConnectionL - test ", + "CMusAvaSip", + "CreateSIPConnectionL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSip_CreateSIPConnectionLL, Teardown) + +EUNIT_TEST( + "OwnDomainLC - test ", + "CMusAvaSip", + "OwnDomainLC", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSip_OwnDomainL, Teardown) + +EUNIT_END_TEST_TABLE + +// END OF FILE diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaSipConnectionObserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaSipConnectionObserver.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,500 @@ +/* +* 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: +* +*/ + + +// CLASS HEADER +#include "UT_CMusAvaSipConnectionObserver.h" +#include "muslogger.h" +#include "mussettings.inl" +#include "CSipSseTestTls.h" +#include "mussettingskeys.h" +#include "musavasipdefaulthandler.h" +#include "sipconnectionobserver.h" +#include "musavasipdefaulthandler.h" +#include "musavasipconnectionadapter.h" +#include "musavasettingsimp.h" +#include "musavaregisteravailability.h" +#include "musavasipprofileregistryobserver.h" +#include "musavasipadapterimp.h" +#include "musavasipconnectionobserver.h" +#include "musavacapabilitytesthelper.h" //remove compilation warning + +// EXTERNAL INCLUDES +#include +#include +//#include +#include +#include +#include + +// INTERNAL INCLUDES +#include "musavasipobserver.h" + + + +// CONSTRUCTION +UT_CMusAvaSipConnectionObserver* UT_CMusAvaSipConnectionObserver::NewL() + { + UT_CMusAvaSipConnectionObserver* self = UT_CMusAvaSipConnectionObserver::NewLC(); + CleanupStack::Pop(); + + return self; + } + +UT_CMusAvaSipConnectionObserver* UT_CMusAvaSipConnectionObserver::NewLC() + { + UT_CMusAvaSipConnectionObserver* self = new( ELeave ) UT_CMusAvaSipConnectionObserver(); + CleanupStack::PushL( self ); + + self->ConstructL(); + + return self; + } + +// Destructor (virtual by CBase) +UT_CMusAvaSipConnectionObserver::~UT_CMusAvaSipConnectionObserver() + { + } + +// Default constructor +UT_CMusAvaSipConnectionObserver::UT_CMusAvaSipConnectionObserver() + { + } + +// Second phase construct +void UT_CMusAvaSipConnectionObserver::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + +// METHODS + + + +void UT_CMusAvaSipConnectionObserver::SetupL( ) + { + SIPStrings::OpenL(); + iAdapterImp = CMusAvaSipAdapterImp::NewL(); + iAdapterImp2 = CMusAvaSipAdapterImp::NewL(); + iAdapterImp3 = CMusAvaSipAdapterImp::NewL(); + iMusAvaSipConnectionObserver = CMusAvaSipConnectionObserver::NewL(); + } + +void UT_CMusAvaSipConnectionObserver::Teardown( ) + { + delete iMusAvaSipConnectionObserver; + iMusAvaSipConnectionObserver = NULL; + delete iAdapterImp; + iAdapterImp = NULL; + delete iAdapterImp2; + iAdapterImp2 = NULL; + delete iAdapterImp3; + iAdapterImp3 = NULL; + SIPStrings::Close(); + } + +void UT_CMusAvaSipConnectionObserver::RemoveDefaultHandler() + { + TInt defaultHandlerIndex( iMusAvaSipConnectionObserver->iObservers.Count() - 1 ); + MMusAvaSipConnectionAdapter* defaultHandler = + iMusAvaSipConnectionObserver->iObservers[ defaultHandlerIndex ]; + iMusAvaSipConnectionObserver->iObservers.Remove( defaultHandlerIndex ); + delete iMusAvaSipConnectionObserver->iDefaultHandler; + iMusAvaSipConnectionObserver->iDefaultHandler = NULL; + } + +void UT_CMusAvaSipConnectionObserver::AddObserversL() + { + EUNIT_ASSERT( iMusAvaSipConnectionObserver->iObservers.Count() == 1 ); // default observer + iMusAvaSipConnectionObserver->AddObserverL( *iAdapterImp, KErrNotFound ); + EUNIT_ASSERT( iMusAvaSipConnectionObserver->iObservers.Count() == 2 ); + + } + +void UT_CMusAvaSipConnectionObserver::UT_CMusAvaSipConnectionObserver_AddObserverL() + { + EUNIT_ASSERT( iMusAvaSipConnectionObserver->iObservers.Count() == 1 ); // default observer + iMusAvaSipConnectionObserver->AddObserverL( *iAdapterImp, KErrNotFound ); + EUNIT_ASSERT( iMusAvaSipConnectionObserver->iObservers.Count() == 2 ); + + iMusAvaSipConnectionObserver->AddObserverL( *iAdapterImp, KErrNotFound ); + EUNIT_ASSERT( iMusAvaSipConnectionObserver->iObservers.Count() == 2 ); + + iMusAvaSipConnectionObserver->AddObserverL( *iAdapterImp2, 0 ); + EUNIT_ASSERT( iMusAvaSipConnectionObserver->iObservers.Count() == 3 ); + EUNIT_ASSERT( iMusAvaSipConnectionObserver->iObservers[0] == iAdapterImp2 ); + EUNIT_ASSERT( iMusAvaSipConnectionObserver->iObservers[1] == iAdapterImp ); + EUNIT_ASSERT( iMusAvaSipConnectionObserver->iObservers[2] != NULL ); + + iMusAvaSipConnectionObserver->iObservers.Remove(1); + iMusAvaSipConnectionObserver->iObservers.Remove(0); + EUNIT_ASSERT( iMusAvaSipConnectionObserver->iObservers[0] != iAdapterImp ); + EUNIT_ASSERT( iMusAvaSipConnectionObserver->iObservers[0] != iAdapterImp2 ); + EUNIT_ASSERT( iMusAvaSipConnectionObserver->iObservers[0] != NULL ); + + iMusAvaSipConnectionObserver->AddObserverL( *iAdapterImp, KErrNotFound ); // invite handler + iMusAvaSipConnectionObserver->AddObserverL( *iAdapterImp2, KErrNotFound ); // default option handler + iMusAvaSipConnectionObserver->AddObserverL( *iAdapterImp3, 1 ); // option handler + EUNIT_ASSERT( iMusAvaSipConnectionObserver->iObservers[0] == iAdapterImp ); + EUNIT_ASSERT( iMusAvaSipConnectionObserver->iObservers[1] == iAdapterImp3 ); + EUNIT_ASSERT( iMusAvaSipConnectionObserver->iObservers[2] == iAdapterImp2 ); + EUNIT_ASSERT( iMusAvaSipConnectionObserver->iObservers[3] != NULL ); + + iMusAvaSipConnectionObserver->iObservers.Remove(2); + EUNIT_ASSERT( iMusAvaSipConnectionObserver->iObservers.Count() == 3 ); + + iMusAvaSipConnectionObserver->AddObserverL( *iAdapterImp2, 10 ); + EUNIT_ASSERT( iMusAvaSipConnectionObserver->iObservers.Count() == 4 ); + + } + +void UT_CMusAvaSipConnectionObserver::UT_CMusAvaSipConnectionObserver_RemoveObserverL() + { + AddObserversL(); + iMusAvaSipConnectionObserver->RemoveObserver( *iAdapterImp ); + EUNIT_ASSERT( iMusAvaSipConnectionObserver->iObservers.Count() == 1 ); + iMusAvaSipConnectionObserver->RemoveObserver( *iAdapterImp ); + EUNIT_ASSERT( iMusAvaSipConnectionObserver->iObservers.Count() == 1 ); + } + +void UT_CMusAvaSipConnectionObserver::UT_CMusAvaSipConnectionObserver_ConnectionStateChangedL() + { + AddObserversL(); + + RemoveDefaultHandler(); + + iMusAvaSipConnectionObserver->ConnectionStateChanged( CSIPConnection::EActive ); + EUNIT_ASSERT( iAdapterImp->iState == CSIPConnection::EActive ); + + iAdapterImp->Reset(); + iAdapterImp->iReturnCode = KErrGeneral; + iMusAvaSipConnectionObserver->ConnectionStateChanged( CSIPConnection::EActive ); + EUNIT_ASSERT( iAdapterImp->iState != CSIPConnection::EActive ); + } + +void UT_CMusAvaSipConnectionObserver::UT_CMusAvaSipConnectionObserver_ErrorOccuredL() + { + AddObserversL(); + + RemoveDefaultHandler(); + + // ErrorOccured variant 1 + // + CSIPClientTransaction* clientTransaction = + CSIPClientTransaction::NewL( SIPStrings::StringF( SipStrConsts::EOptions ) ); + CleanupStack::PushL( clientTransaction ); + TInt regBindingFake( 3 ); + CSIPRegistrationBinding* regBinding = reinterpret_cast( ®BindingFake ); + iMusAvaSipConnectionObserver->ErrorOccured( KErrNotFound, *clientTransaction, *regBinding ); + EUNIT_ASSERT( iAdapterImp->iError == KErrNotFound ); + EUNIT_ASSERT( iAdapterImp->iClientTransaction == clientTransaction ); + EUNIT_ASSERT( iAdapterImp->iRegBinding == regBinding ); + + iAdapterImp->Reset(); + iAdapterImp->iReturnCode = KErrGeneral; + iMusAvaSipConnectionObserver->ErrorOccured( KErrNotFound, *clientTransaction, *regBinding ); + EUNIT_ASSERT( iAdapterImp->iError == KErrNone ); + + // ErrorOccured variant 2 + // + iAdapterImp->Reset(); + CSIPServerTransaction* serverTransaction = + CSIPServerTransaction::NewL( SIPStrings::StringF( SipStrConsts::EOptions ) ); + CleanupStack::PushL( serverTransaction ); + TInt dialogAssocFake( 4 ); + CSIPInviteDialogAssoc* dialogAssoc = reinterpret_cast( &dialogAssocFake ); + iMusAvaSipConnectionObserver->ErrorOccured( KErrNotFound, *dialogAssoc ); + EUNIT_ASSERT( iAdapterImp->iError == KErrNotFound ); + EUNIT_ASSERT( iAdapterImp->iDialogAssoc == dialogAssoc ); + + iAdapterImp->Reset(); + iAdapterImp->iReturnCode = KErrGeneral; + iMusAvaSipConnectionObserver->ErrorOccured( KErrNotFound, *dialogAssoc ); + EUNIT_ASSERT( iAdapterImp->iError == KErrNone ); + + // ErrorOccured variant 3 + // + iAdapterImp->Reset(); + TInt refreshFake( 5 ); + CSIPRefresh* refresh = reinterpret_cast( &refreshFake ); + iMusAvaSipConnectionObserver->ErrorOccured( KErrNotFound, *refresh ); + EUNIT_ASSERT( iAdapterImp->iError == KErrNotFound ); + EUNIT_ASSERT( iAdapterImp->iRefresh == refresh ); + + iAdapterImp->Reset(); + iAdapterImp->iReturnCode = KErrGeneral; + iMusAvaSipConnectionObserver->ErrorOccured( KErrNotFound, *refresh ); + EUNIT_ASSERT( iAdapterImp->iError == KErrNone ); + + // ErrorOccured variant 4 + // + iAdapterImp->Reset(); + iMusAvaSipConnectionObserver->ErrorOccured( KErrNotFound, *regBinding ); + EUNIT_ASSERT( iAdapterImp->iError == KErrNotFound ); + EUNIT_ASSERT( iAdapterImp->iRegBinding == regBinding ); + + iAdapterImp->Reset(); + iAdapterImp->iReturnCode = KErrGeneral; + iMusAvaSipConnectionObserver->ErrorOccured( KErrNotFound, *regBinding ); + EUNIT_ASSERT( iAdapterImp->iError == KErrNone ); + + // ErrorOccured variant 5 + // + iAdapterImp->Reset(); + iMusAvaSipConnectionObserver->ErrorOccured( KErrNotFound, *clientTransaction ); + EUNIT_ASSERT( iAdapterImp->iError == KErrNotFound ); + EUNIT_ASSERT( iAdapterImp->iTransaction == clientTransaction ); + + iAdapterImp->Reset(); + iAdapterImp->iReturnCode = KErrGeneral; + iMusAvaSipConnectionObserver->ErrorOccured( KErrNotFound, *clientTransaction ); + EUNIT_ASSERT( iAdapterImp->iError == KErrNone ); + + // ErrorOccured variant 6 + // + iAdapterImp->Reset(); + iMusAvaSipConnectionObserver->ErrorOccured( KErrNotFound, *clientTransaction, *dialogAssoc ); + EUNIT_ASSERT( iAdapterImp->iError == KErrNotFound ); + EUNIT_ASSERT( iAdapterImp->iTransaction == clientTransaction ); + EUNIT_ASSERT( iAdapterImp->iDialogAssoc == dialogAssoc ); + + iAdapterImp->Reset(); + iAdapterImp->iReturnCode = KErrGeneral; + iMusAvaSipConnectionObserver->ErrorOccured( KErrNotFound, *clientTransaction, *dialogAssoc ); + EUNIT_ASSERT( iAdapterImp->iError == KErrNone ); + + CleanupStack::PopAndDestroy( serverTransaction ); + CleanupStack::PopAndDestroy( clientTransaction ); + } + +void UT_CMusAvaSipConnectionObserver::UT_CMusAvaSipConnectionObserver_IncomingRequestL() + { + AddObserversL(); + + RemoveDefaultHandler(); + + // Variant 1 + // + CSIPServerTransaction* serverTransaction = + CSIPServerTransaction::NewL( SIPStrings::StringF( SipStrConsts::EOptions ) ); + + iMusAvaSipConnectionObserver->IncomingRequest( serverTransaction ); + EUNIT_ASSERT( iAdapterImp->iServerTransaction == serverTransaction ); + + serverTransaction = NULL; + serverTransaction = + CSIPServerTransaction::NewL( SIPStrings::StringF( SipStrConsts::EOptions ) ); + iAdapterImp->Reset(); + iAdapterImp->iReturnCode = KErrGeneral; + iMusAvaSipConnectionObserver->IncomingRequest( serverTransaction ); + EUNIT_ASSERT( iAdapterImp->iServerTransaction == NULL ); + delete serverTransaction; + + // Variant 2 + // + serverTransaction = NULL; + serverTransaction = + CSIPServerTransaction::NewL( SIPStrings::StringF( SipStrConsts::EOptions ) ); + iAdapterImp->Reset(); + TInt dialogFake( 4 ); + CSIPDialog* dialog = reinterpret_cast( &dialogFake ); + iMusAvaSipConnectionObserver->IncomingRequest( serverTransaction, *dialog ); + EUNIT_ASSERT( iAdapterImp->iServerTransaction == serverTransaction ); + EUNIT_ASSERT( iAdapterImp->iDialog == dialog ); + + serverTransaction = NULL; + serverTransaction = + CSIPServerTransaction::NewL( SIPStrings::StringF( SipStrConsts::EOptions ) ); + iAdapterImp->Reset(); + iAdapterImp->iReturnCode = KErrGeneral; + iMusAvaSipConnectionObserver->IncomingRequest( serverTransaction, *dialog ); + EUNIT_ASSERT( iAdapterImp->iServerTransaction == NULL ); + delete serverTransaction; + } + +void UT_CMusAvaSipConnectionObserver::UT_CMusAvaSipConnectionObserver_IncomingResponseL() + { + AddObserversL(); + + RemoveDefaultHandler(); + + // Variant 1 + // + CSIPClientTransaction* clientTransaction = + CSIPClientTransaction::NewL( SIPStrings::StringF( SipStrConsts::EOptions ) ); + CleanupStack::PushL( clientTransaction ); + iMusAvaSipConnectionObserver->IncomingResponse( *clientTransaction ); + EUNIT_ASSERT( iAdapterImp->iClientTransaction == clientTransaction ); + + iAdapterImp->Reset(); + iAdapterImp->iReturnCode = KErrGeneral; + iMusAvaSipConnectionObserver->IncomingResponse( *clientTransaction ); + EUNIT_ASSERT( iAdapterImp->iClientTransaction == NULL ); + + // Variant 2 + // + iAdapterImp->Reset(); + TInt dialogAssocFake( 4 ); + CSIPInviteDialogAssoc* dialogAssoc = reinterpret_cast( &dialogAssocFake ); + iMusAvaSipConnectionObserver->IncomingResponse( *clientTransaction, *dialogAssoc ); + EUNIT_ASSERT( iAdapterImp->iClientTransaction == clientTransaction ); + EUNIT_ASSERT( iAdapterImp->iDialogAssoc == dialogAssoc ); + + iAdapterImp->Reset(); + iAdapterImp->iReturnCode = KErrGeneral; + iMusAvaSipConnectionObserver->IncomingResponse( *clientTransaction, *dialogAssoc ); + EUNIT_ASSERT( iAdapterImp->iClientTransaction == NULL ); + + // Variant 3 + // + iAdapterImp->Reset(); + iMusAvaSipConnectionObserver->IncomingResponse( *clientTransaction, NULL ); + EUNIT_ASSERT( iAdapterImp->iClientTransaction == clientTransaction ); + EUNIT_ASSERT( iAdapterImp->iInviteAssoc == NULL ); + + iAdapterImp->Reset(); + iAdapterImp->iReturnCode = KErrGeneral; + iMusAvaSipConnectionObserver->IncomingResponse( *clientTransaction, NULL ); + EUNIT_ASSERT( iAdapterImp->iClientTransaction == NULL ); + + // Variant 4 + // + iAdapterImp->Reset(); + TInt regBindingFake( 3 ); + CSIPRegistrationBinding* regBinding = reinterpret_cast( ®BindingFake ); + iMusAvaSipConnectionObserver->IncomingResponse( *clientTransaction, *regBinding ); + EUNIT_ASSERT( iAdapterImp->iClientTransaction == clientTransaction ); + EUNIT_ASSERT( iAdapterImp->iRegBinding == regBinding ); + + iAdapterImp->Reset(); + iAdapterImp->iReturnCode = KErrGeneral; + iMusAvaSipConnectionObserver->IncomingResponse( *clientTransaction, *regBinding ); + EUNIT_ASSERT( iAdapterImp->iClientTransaction == NULL ); + + CleanupStack::PopAndDestroy( clientTransaction ); + } + +void UT_CMusAvaSipConnectionObserver::UT_CMusAvaSipConnectionObserver_InviteCanceledL() + { + AddObserversL(); + + RemoveDefaultHandler(); + + CSIPServerTransaction* serverTransaction = + CSIPServerTransaction::NewL( SIPStrings::StringF( SipStrConsts::EOptions ) ); + CleanupStack::PushL( serverTransaction ); + + iMusAvaSipConnectionObserver->InviteCanceled( *serverTransaction ); + EUNIT_ASSERT( iAdapterImp->iServerTransaction == serverTransaction ); + + iAdapterImp->Reset(); + iAdapterImp->iReturnCode = KErrGeneral; + iMusAvaSipConnectionObserver->InviteCanceled( *serverTransaction ); + EUNIT_ASSERT( iAdapterImp->iServerTransaction == NULL ); + + CleanupStack::PopAndDestroy( serverTransaction ); + } + +void UT_CMusAvaSipConnectionObserver::UT_CMusAvaSipConnectionObserver_InviteCompletedL() + { + AddObserversL(); + + RemoveDefaultHandler(); + + CSIPClientTransaction* clientTransaction = + CSIPClientTransaction::NewL( SIPStrings::StringF( SipStrConsts::EOptions ) ); + CleanupStack::PushL( clientTransaction ); + + iMusAvaSipConnectionObserver->InviteCompleted( *clientTransaction ); + EUNIT_ASSERT( iAdapterImp->iClientTransaction == clientTransaction ); + + iAdapterImp->Reset(); + iAdapterImp->iReturnCode = KErrGeneral; + iMusAvaSipConnectionObserver->InviteCompleted( *clientTransaction ); + EUNIT_ASSERT( iAdapterImp->iClientTransaction == NULL ); + + CleanupStack::PopAndDestroy( clientTransaction ); + } + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusAvaSipConnectionObserver, + "CMusAvaSipConnectionObserver", + "UNIT" ) + +EUNIT_TEST( + "AddObserverL - test ", + "CMusAvaSipConnectionObserver", + "AddObserverL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSipConnectionObserver_AddObserverL, Teardown) + +EUNIT_TEST( + "RemoveObserverL - test ", + "CMusAvaSipConnectionObserver", + "RemoveObserverL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSipConnectionObserver_RemoveObserverL, Teardown) + +EUNIT_TEST( + "ConnectionStateChangedL - test ", + "CMusAvaSipConnectionObserver", + "ConnectionStateChangedL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSipConnectionObserver_ConnectionStateChangedL, Teardown) + +EUNIT_TEST( + "ErrorOccuredL - test ", + "CMusAvaSipConnectionObserver", + "ErrorOccuredL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSipConnectionObserver_ErrorOccuredL, Teardown) + +EUNIT_TEST( + "IncomingRequestL - test ", + "CMusAvaSipConnectionObserver", + "IncomingRequestL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSipConnectionObserver_IncomingRequestL, Teardown) + +EUNIT_TEST( + "IncomingResponseL - test ", + "CMusAvaSipConnectionObserver", + "IncomingResponseL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSipConnectionObserver_IncomingResponseL, Teardown) + +EUNIT_TEST( + "InviteCanceledL - test ", + "CMusAvaSipConnectionObserver", + "InviteCanceledL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSipConnectionObserver_InviteCanceledL, Teardown) + +EUNIT_TEST( + "InviteCompletedL - test ", + "CMusAvaSipConnectionObserver", + "InviteCompletedL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSipConnectionObserver_InviteCompletedL, Teardown) + +EUNIT_END_TEST_TABLE + +// END OF FILE diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaSipObserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaSipObserver.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,243 @@ +/* +* 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: +* +*/ + + +// CLASS HEADER +#include "UT_CMusAvaSipObserver.h" +#include "muslogger.h" +#include "mussettings.inl" +#include "CSipSseTestTls.h" +#include "mussettingskeys.h" +#include "musavasipdefaulthandler.h" +#include "sipconnectionobserver.h" +#include "musavasipdefaulthandler.h" +#include "musavasipconnectionadapter.h" +#include "musavasettingsimp.h" +#include "musavaregisteravailability.h" +#include "musavasipprofileregistryobserver.h" +#include "musavasipadapterimp.h" +#include "musavacapabilitytesthelper.h" //remove compilation warning + +// EXTERNAL INCLUDES +#include +#include +//#include +#include +#include + + +// INTERNAL INCLUDES +#include "musavasipobserver.h" + + + +// CONSTRUCTION +UT_CMusAvaSipObserver* UT_CMusAvaSipObserver::NewL() + { + UT_CMusAvaSipObserver* self = UT_CMusAvaSipObserver::NewLC(); + CleanupStack::Pop(); + + return self; + } + +UT_CMusAvaSipObserver* UT_CMusAvaSipObserver::NewLC() + { + UT_CMusAvaSipObserver* self = new( ELeave ) UT_CMusAvaSipObserver(); + CleanupStack::PushL( self ); + + self->ConstructL(); + + return self; + } + +// Destructor (virtual by CBase) +UT_CMusAvaSipObserver::~UT_CMusAvaSipObserver() + { + } + +// Default constructor +UT_CMusAvaSipObserver::UT_CMusAvaSipObserver() + { + } + +// Second phase construct +void UT_CMusAvaSipObserver::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + +// METHODS + + + +void UT_CMusAvaSipObserver::SetupL( ) + { + SIPStrings::OpenL(); + iAdapterImp = CMusAvaSipAdapterImp::NewL(); + iAdapterImp2 = CMusAvaSipAdapterImp::NewL(); + iAdapterImp3 = CMusAvaSipAdapterImp::NewL(); + + iMusAvaSipObserver = CMusAvaSipObserver::NewL(); + } + +void UT_CMusAvaSipObserver::Teardown( ) + { + delete iMusAvaSipObserver; + iMusAvaSipObserver = NULL; + delete iAdapterImp; + iAdapterImp = NULL; + delete iAdapterImp2; + iAdapterImp2 = NULL; + delete iAdapterImp3; + iAdapterImp3 = NULL; + SIPStrings::Close(); + } + +void UT_CMusAvaSipObserver::AddObserversL() + { + iMusAvaSipObserver->AddObserverL( *iAdapterImp, KErrNotFound ); + EUNIT_ASSERT( iMusAvaSipObserver->iObservers.Count() == 1 ); + + // Do it twice, duplicates are ignored + iMusAvaSipObserver->AddObserverL( *iAdapterImp, KErrNotFound ); + EUNIT_ASSERT( iMusAvaSipObserver->iObservers.Count() == 1 ); + } + +void UT_CMusAvaSipObserver::UT_CMusAvaSipObserver_AddObserverL() + { + iMusAvaSipObserver->AddObserverL( *iAdapterImp, KErrNotFound ); + EUNIT_ASSERT( iMusAvaSipObserver->iObservers.Count() == 1 ); + + // Do it twice, duplicates are ignored + iMusAvaSipObserver->AddObserverL( *iAdapterImp, KErrNotFound ); + EUNIT_ASSERT( iMusAvaSipObserver->iObservers.Count() == 1 ); + + iMusAvaSipObserver->AddObserverL( *iAdapterImp2, 0 ); + EUNIT_ASSERT( iMusAvaSipObserver->iObservers.Count() == 2 ); + EUNIT_ASSERT( iMusAvaSipObserver->iObservers[0] == iAdapterImp2 ); + EUNIT_ASSERT( iMusAvaSipObserver->iObservers[1] == iAdapterImp ); + + iMusAvaSipObserver->iObservers.Reset(); + EUNIT_ASSERT( iMusAvaSipObserver->iObservers.Count() == 0 ); + + iMusAvaSipObserver->AddObserverL( *iAdapterImp, KErrNotFound ); // invite handler + iMusAvaSipObserver->AddObserverL( *iAdapterImp2, KErrNotFound ); // default option handler + iMusAvaSipObserver->AddObserverL( *iAdapterImp3, 1 ); // option handler + EUNIT_ASSERT( iMusAvaSipObserver->iObservers[0] == iAdapterImp ); + EUNIT_ASSERT( iMusAvaSipObserver->iObservers[1] == iAdapterImp3 ); + EUNIT_ASSERT( iMusAvaSipObserver->iObservers[2] == iAdapterImp2 ); + + iMusAvaSipObserver->iObservers.Remove(2); + EUNIT_ASSERT( iMusAvaSipObserver->iObservers.Count() == 2 ); + + iMusAvaSipObserver->AddObserverL( *iAdapterImp2, 10 ); + EUNIT_ASSERT( iMusAvaSipObserver->iObservers.Count() == 3 ); + + + } + +void UT_CMusAvaSipObserver::UT_CMusAvaSipObserver_RemoveObserverL() + { + AddObserversL(); + iMusAvaSipObserver->RemoveObserver( *iAdapterImp ); + EUNIT_ASSERT( iMusAvaSipObserver->iObservers.Count() == 0 ); + iMusAvaSipObserver->RemoveObserver( *iAdapterImp ); + EUNIT_ASSERT( iMusAvaSipObserver->iObservers.Count() == 0 ); + } + +void UT_CMusAvaSipObserver::UT_CMusAvaSipObserver_IncomingRequestL() + { + AddObserversL(); + + // Ok + TUint32 iapId( 6 ); + CSIPServerTransaction* serverTransaction = + CSIPServerTransaction::NewL( SIPStrings::StringF( SipStrConsts::EOptions ) ); + iMusAvaSipObserver->IncomingRequest( iapId, serverTransaction ); + EUNIT_ASSERT( iAdapterImp->iServerTransaction == serverTransaction ); + EUNIT_ASSERT( iAdapterImp->iIapId == iapId ); + + // Not ok + iAdapterImp->Reset(); + iAdapterImp->iReturnCode = KErrGeneral; + CSIPServerTransaction* serverTransaction2 = + CSIPServerTransaction::NewL( SIPStrings::StringF( SipStrConsts::EOptions ) ); + iMusAvaSipObserver->IncomingRequest( iapId, serverTransaction2 ); + EUNIT_ASSERT( iAdapterImp->iServerTransaction == NULL ); + + } + +void UT_CMusAvaSipObserver::UT_CMusAvaSipObserver_TimedOutL() + { + AddObserversL(); + + CSIPServerTransaction* serverTransaction = + CSIPServerTransaction::NewL( SIPStrings::StringF( SipStrConsts::EOptions ) ); + CleanupStack::PushL( serverTransaction ); + iMusAvaSipObserver->TimedOut( *serverTransaction ); + EUNIT_ASSERT( iAdapterImp->iServerTransaction == serverTransaction ); + + // Not ok + iAdapterImp->Reset(); + iAdapterImp->iReturnCode = KErrGeneral; + iMusAvaSipObserver->TimedOut( *serverTransaction ); + EUNIT_ASSERT( iAdapterImp->iServerTransaction == NULL ); + CleanupStack::PopAndDestroy( serverTransaction ); + } + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusAvaSipObserver, + "CMusAvaSipObserver", + "UNIT" ) + +EUNIT_TEST( + "AddObserverL - test ", + "CMusAvaSipObserver", + "AddObserverL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSipObserver_AddObserverL, Teardown) + + +EUNIT_TEST( + "RemoveObserverL - test ", + "CMusAvaSipObserver", + "RemoveObserverL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSipObserver_RemoveObserverL, Teardown) + +EUNIT_TEST( + "IncomingRequestL - test ", + "CMusAvaSipObserver", + "IncomingRequestL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSipObserver_IncomingRequestL, Teardown) + + +EUNIT_TEST( + "TimedOutL - test ", + "CMusAvaSipObserver", + "TimedOutL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSipObserver_TimedOutL, Teardown) + +EUNIT_END_TEST_TABLE + +// END OF FILE diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaSipProfileRegistryObserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaSipProfileRegistryObserver.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,197 @@ +/* +* 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: +* +*/ + + +// CLASS HEADER +#include "UT_CMusAvaSipProfileRegistryObserver.h" + +// EXTERNAL INCLUDES +#include +#include + +// INTERNAL INCLUDES +#include "musavasipprofileregistryobserver.h" +#include "musavaprofileregistryadapterstub.h" + +// CONSTRUCTION +UT_CMusAvaSipProfileRegistryObserver* UT_CMusAvaSipProfileRegistryObserver::NewL() + { + UT_CMusAvaSipProfileRegistryObserver* self = UT_CMusAvaSipProfileRegistryObserver::NewLC(); + CleanupStack::Pop(); + + return self; + } + +UT_CMusAvaSipProfileRegistryObserver* UT_CMusAvaSipProfileRegistryObserver::NewLC() + { + UT_CMusAvaSipProfileRegistryObserver* self = new( ELeave ) UT_CMusAvaSipProfileRegistryObserver(); + CleanupStack::PushL( self ); + + self->ConstructL(); + + return self; + } + +// Destructor (virtual by CBase) +UT_CMusAvaSipProfileRegistryObserver::~UT_CMusAvaSipProfileRegistryObserver() + { + } + +// Default constructor +UT_CMusAvaSipProfileRegistryObserver::UT_CMusAvaSipProfileRegistryObserver() + { + } + +// Second phase construct +void UT_CMusAvaSipProfileRegistryObserver::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + +// METHODS + +void UT_CMusAvaSipProfileRegistryObserver::SetupL( ) + { + iSipprofileRegistryObserver = CMusAvaSipProfileRegistryObserver::NewL(); + } + +void UT_CMusAvaSipProfileRegistryObserver::Teardown( ) + { + delete iSipprofileRegistryObserver; + } + +void UT_CMusAvaSipProfileRegistryObserver::UT_CMusAvaSipProfileRegistryObserver_NewLL() + { + EUNIT_ASSERT( iSipprofileRegistryObserver ); + } + +void UT_CMusAvaSipProfileRegistryObserver::UT_CMusAvaSipProfileRegistryObserver_AddAdapterLL() + { + CMusAvaProfileRegistryAdapterStub* profileRegistryAdapter = CMusAvaProfileRegistryAdapterStub::NewLC(); + EUNIT_ASSERT( iSipprofileRegistryObserver->iAdapter == NULL ); + iSipprofileRegistryObserver->AddAdapterL( *profileRegistryAdapter ); + EUNIT_ASSERT( iSipprofileRegistryObserver->iAdapter == profileRegistryAdapter ); + iSipprofileRegistryObserver->AddAdapterL( *profileRegistryAdapter ); + EUNIT_ASSERT( iSipprofileRegistryObserver->iAdapter == profileRegistryAdapter ); + iSipprofileRegistryObserver->iAdapter = NULL; + EUNIT_ASSERT( iSipprofileRegistryObserver->iAdapter == NULL ); + CleanupStack::PopAndDestroy(); + } + +void UT_CMusAvaSipProfileRegistryObserver::UT_CMusAvaSipProfileRegistryObserver_RemoveAdapterL() + { + CMusAvaProfileRegistryAdapterStub* profileRegistryAdapter = CMusAvaProfileRegistryAdapterStub::NewLC(); + EUNIT_ASSERT( iSipprofileRegistryObserver->iAdapter == NULL ); + iSipprofileRegistryObserver->AddAdapterL( *profileRegistryAdapter ); + EUNIT_ASSERT( iSipprofileRegistryObserver->iAdapter == profileRegistryAdapter ); + CMusAvaProfileRegistryAdapterStub* profileRegistryAdapter2 = CMusAvaProfileRegistryAdapterStub::NewLC(); + iSipprofileRegistryObserver->AddAdapterL( *profileRegistryAdapter2 ); + EUNIT_ASSERT( iSipprofileRegistryObserver->iAdapter == profileRegistryAdapter2 ); + iSipprofileRegistryObserver->RemoveAdapter( *profileRegistryAdapter ); + EUNIT_ASSERT( iSipprofileRegistryObserver->iAdapter == profileRegistryAdapter2 ); + iSipprofileRegistryObserver->RemoveAdapter( *profileRegistryAdapter2 ); + EUNIT_ASSERT( iSipprofileRegistryObserver->iAdapter == NULL ); + CleanupStack::PopAndDestroy(2); + } + +void UT_CMusAvaSipProfileRegistryObserver::UT_CMusAvaSipProfileRegistryObserver_ProfileRegistryEventOccurredL() + { + CMusAvaProfileRegistryAdapterStub* profileRegistryAdapter = CMusAvaProfileRegistryAdapterStub::NewLC(); + TUint32 profileId = 1; + MSIPProfileRegistryObserver::TEvent event = MSIPProfileRegistryObserver::EProfileUpdated; + iSipprofileRegistryObserver->ProfileRegistryEventOccurred( profileId, event ); + EUNIT_ASSERT( profileRegistryAdapter->iProfileId == 0 ); + EUNIT_ASSERT( profileRegistryAdapter->iEvent == MSIPProfileRegistryObserver::EProfileCreated ); + + + EUNIT_ASSERT( iSipprofileRegistryObserver->iAdapter == NULL ); + iSipprofileRegistryObserver->AddAdapterL( *profileRegistryAdapter ); + EUNIT_ASSERT( iSipprofileRegistryObserver->iAdapter == profileRegistryAdapter ); + iSipprofileRegistryObserver->ProfileRegistryEventOccurred( profileId, event ); + EUNIT_ASSERT( profileRegistryAdapter->iProfileId == profileId ); + EUNIT_ASSERT( profileRegistryAdapter->iEvent == event ); + CleanupStack::PopAndDestroy(); + } + +void UT_CMusAvaSipProfileRegistryObserver::UT_CMusAvaSipProfileRegistryObserver_ProfileRegistryErrorOccurredL() + { + CMusAvaProfileRegistryAdapterStub* profileRegistryAdapter = CMusAvaProfileRegistryAdapterStub::NewLC(); + TUint32 profileId = 1; + TInt error = -5; + iSipprofileRegistryObserver->ProfileRegistryErrorOccurred( profileId, error ); + EUNIT_ASSERT( profileRegistryAdapter->iProfileId == 0 ); + EUNIT_ASSERT( profileRegistryAdapter->iError == -1 ); + + EUNIT_ASSERT( iSipprofileRegistryObserver->iAdapter == NULL ); + iSipprofileRegistryObserver->AddAdapterL( *profileRegistryAdapter ); + EUNIT_ASSERT( iSipprofileRegistryObserver->iAdapter == profileRegistryAdapter ); + iSipprofileRegistryObserver->ProfileRegistryErrorOccurred( profileId, error ); + EUNIT_ASSERT( profileRegistryAdapter->iProfileId == profileId ); + EUNIT_ASSERT( profileRegistryAdapter->iError == error ); + CleanupStack::PopAndDestroy(); + } + + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusAvaSipProfileRegistryObserver, + "CMusAvaSipProfileRegistryObserver", + "UNIT" ) + +EUNIT_TEST( + "NewL - test ", + "CMusAvaSipProfileRegistryObserver", + "NewL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSipProfileRegistryObserver_NewLL, Teardown) + +EUNIT_TEST( + "AddAdapterL - test ", + "CMusAvaSipProfileRegistryObserver", + "AddAdapterL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSipProfileRegistryObserver_AddAdapterLL, Teardown) + +EUNIT_TEST( + "RemoveAdapter - test ", + "CMusAvaSipProfileRegistryObserver", + "RemoveAdapter", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSipProfileRegistryObserver_RemoveAdapterL, Teardown) + + +EUNIT_TEST( + "ProfileRegistryEventOccurred - test ", + "CMusAvaSipProfileRegistryObserver", + "ProfileRegistryEventOccurred", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSipProfileRegistryObserver_ProfileRegistryEventOccurredL, Teardown) + +EUNIT_TEST( + "ProfileRegistryErrorOccurred - test ", + "CMusAvaSipProfileRegistryObserver", + "ProfileRegistryErrorOccurred", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSipProfileRegistryObserver_ProfileRegistryErrorOccurredL, Teardown) + + +EUNIT_END_TEST_TABLE + +// END OF FILE diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaSipheaderUtil.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaSipheaderUtil.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,257 @@ +/* +* 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: +* +*/ + + +// CLASS HEADER +#include "UT_CMusAvaSipheaderUtil.h" +#include "musavasipheaderutil.h" +#include "muslogger.h" +#include "musavasipobserver.h" +#include "musavasipconnectionobserver.h" + +// EXTERNAL INCLUDES +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +// CONSTRUCTION +UT_CMusAvaSipheaderUtil* UT_CMusAvaSipheaderUtil::NewL() + { + UT_CMusAvaSipheaderUtil* self = UT_CMusAvaSipheaderUtil::NewLC(); + CleanupStack::Pop(); + return self; + } + +UT_CMusAvaSipheaderUtil* UT_CMusAvaSipheaderUtil::NewLC() + { + UT_CMusAvaSipheaderUtil* self = new( ELeave ) UT_CMusAvaSipheaderUtil(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// Destructor (virtual by CBase) +UT_CMusAvaSipheaderUtil::~UT_CMusAvaSipheaderUtil() + { + } + +// Default constructor +UT_CMusAvaSipheaderUtil::UT_CMusAvaSipheaderUtil() + { + } + +// Second phase construct +void UT_CMusAvaSipheaderUtil::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + +// METHODS + + + +void UT_CMusAvaSipheaderUtil::SetupL( ) + { + SIPStrings::OpenL(); + SdpCodecStringPool::OpenL(); + } + +void UT_CMusAvaSipheaderUtil::Teardown( ) + { + iRequestHeaders.ResetAndDestroy(); + SIPStrings::Close(); + SdpCodecStringPool::Close(); + } + +void UT_CMusAvaSipheaderUtil::UT_AddAcceptContactHeaderLL() + { + _LIT8( KCapabilitySwisFeature, "+g.3gpp.cs-voice"); + RStringF featureTag = SIPStrings::Pool().OpenFStringL( KCapabilitySwisFeature ); + CleanupClosePushL( featureTag ); + CMusAvaSipheaderUtil::AddAcceptContactHeaderL(iRequestHeaders,featureTag); + CleanupStack::PopAndDestroy(); + EUNIT_ASSERT( iRequestHeaders.Count()==1 ); + } + +void UT_CMusAvaSipheaderUtil::UT_AddAcceptEncodingHeaderLL() + { + CMusAvaSipheaderUtil::AddAcceptEncodingHeaderL(iRequestHeaders); + TInt count = 0; + EUNIT_GET_ALLOC_DECORATOR_FAILCOUNT( count ); + if ( count == 0 ) + { + EUNIT_ASSERT( iRequestHeaders.Count()==1 ); + } + else + { + EUNIT_ASSERT( iRequestHeaders.Count()==0 ); + } + } + +void UT_CMusAvaSipheaderUtil::UT_AddAcceptLanguageHeaderLL() + { + CMusAvaSipheaderUtil::AddAcceptLanguageHeaderL(iRequestHeaders); + TInt count = 0; + EUNIT_GET_ALLOC_DECORATOR_FAILCOUNT( count ); + if ( count == 0 ) + { + EUNIT_ASSERT( iRequestHeaders.Count()==1 ); + } + else + { + EUNIT_ASSERT( iRequestHeaders.Count()==0 ); + } + } + +void UT_CMusAvaSipheaderUtil::UT_AddPreferredIdentityHeaderLL() + { + _LIT8(val,"sip:siva@sofia.net"); + CMusAvaSipheaderUtil::AddPreferredIdentityHeaderL(iRequestHeaders,val); + EUNIT_ASSERT( iRequestHeaders.Count()==1 ); + } + +void UT_CMusAvaSipheaderUtil::UT_AddAcceptSdpHeaderLL() + { + CMusAvaSipheaderUtil::AddAcceptSdpHeaderL(iRequestHeaders); + TInt count = 0; + EUNIT_GET_ALLOC_DECORATOR_FAILCOUNT( count ); + if ( count == 0 ) + { + EUNIT_ASSERT( iRequestHeaders.Count()==1 ); + } + else + { + EUNIT_ASSERT( iRequestHeaders.Count()==0 ); + } + } + +void UT_CMusAvaSipheaderUtil::UT_AddSdpLL() + { + CUri8* remoteUri = CUri8::NewL(); + CleanupStack::PushL( remoteUri ); + _LIT8(uri,"siva@sofia.net"); + remoteUri->SetComponentL(uri,EUriHost); + CSIPRequestElements* rElements = CSIPRequestElements::NewL(remoteUri); + CleanupStack::Pop( remoteUri ); + CleanupStack::PushL( rElements ); + _LIT8(contentDes,"v=0\n/"); + /*o=- 63359607229508250 63359607229508250 IN IP4 10.21.32.54\n/ + s=-\n/c=IN IP4 10.21.32.51\n/ + t=0 0\na=X-application:com.nokia.rtvs\nm=video 49152 RTP/AVP 96\n/ + a=sendonly\na=curr:qos local send\na=curr:qos remote none\n/ + a=des:qos mandatory local send\na=des:qos none remote send\n/ + a=rtpmap:96 H263-2000/90000\na=framerate:15\na=framesize:96 176-144\n/ + a=fmtp:96 profile=0; level=45\n"); */ + HBufC8* content = HBufC8::NewLC(contentDes().Length()); + TPtr8 contentPtr = content->Des(); + contentPtr.Copy(contentDes); + CMusAvaSipheaderUtil::AddSdpL(rElements,content); + CleanupStack::Pop(content); + EUNIT_ASSERT(rElements->MessageElements().Content().Length()>0); + CleanupStack::PopAndDestroy(rElements); + } + +void UT_CMusAvaSipheaderUtil::UT_LocalHostLL() + { + TUid uid = TUid::Uid(0); + // just for compilation this will be ignored in stub. + CMusAvaSipObserver* tempObs = CMusAvaSipObserver::NewL(); + CleanupStack::PushL(tempObs); + CSIP* sip = CSIP::NewLC(uid,*tempObs); + TUint32 aIapId(0); + CMusAvaSipConnectionObserver* connObs = CMusAvaSipConnectionObserver::NewL(); + CleanupStack::PushL(connObs); + CSIPConnection* connection = CSIPConnection::NewL(*sip,aIapId,*connObs); + CleanupStack::PushL(connection); + TPtrC8 host; + CMusAvaSipheaderUtil::LocalHostL(*connection,host); + CleanupStack::PopAndDestroy(4); + EUNIT_ASSERT(host.Length() > 0); + } + + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusAvaSipheaderUtil, + "CMusAvaSipheaderUtil", + "UNIT" ) + +EUNIT_TEST( + "AddAcceptContactHeaderL - test ", + "CMusAvaSipheaderUtil", + "AddAcceptContactHeaderL", + "FUNCTIONALITY", + SetupL, UT_AddAcceptContactHeaderLL, Teardown) + +EUNIT_TEST( + "AddAcceptEncodingHeaderL - test ", + "CMusAvaSipheaderUtil", + "AddAcceptEncodingHeaderL", + "FUNCTIONALITY", + SetupL, UT_AddAcceptEncodingHeaderLL, Teardown) + +EUNIT_TEST( + "AddAcceptLanguageHeaderL - test ", + "CMusAvaSipheaderUtil", + "AddAcceptLanguageHeaderL", + "FUNCTIONALITY", + SetupL, UT_AddAcceptLanguageHeaderLL, Teardown) + +EUNIT_TEST( + "AddPreferredIdentityHeaderL - test ", + "CMusAvaSipheaderUtil", + "AddPreferredIdentityHeaderL", + "FUNCTIONALITY", + SetupL, UT_AddPreferredIdentityHeaderLL, Teardown) + +EUNIT_TEST( + "AddAcceptSdpHeaderL - test ", + "CMusAvaSipheaderUtil", + "AddAcceptSdpHeaderL", + "FUNCTIONALITY", + SetupL, UT_AddAcceptSdpHeaderLL, Teardown) + +EUNIT_TEST( + "AddSdpL - test ", + "CMusAvaSipheaderUtil", + "AddSdpL", + "FUNCTIONALITY", + SetupL, UT_AddSdpLL, Teardown) + +EUNIT_TEST( + "LocalHostL - test ", + "CMusAvaSipheaderUtil", + "LocalHostL", + "FUNCTIONALITY", + SetupL, UT_LocalHostLL, Teardown) + + +EUNIT_END_TEST_TABLE + +// END OF FILE diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaSipprofileAvailability.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaSipprofileAvailability.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,186 @@ +/* +* 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: +* +*/ + + +// CLASS HEADER +#include "UT_CMusAvaSipprofileAvailability.h" +#include "musavaavailabilityobserver.h" +#include "musavaavailabilityobserverimp.h" +#include "musavaavailability.h" +#include "muslogger.h" +#include "musavaobserver.h" +#include "musavaobserverimp.h" +#include "musavadefaultimp.h" +#include "musavaobserverimp.h" +#include "musavasharedobject.h" +#include "mussettingskeys.h" +#include "mussettings.h" + +// EXTERNAL INCLUDES +#include +#include +//#include +#include +#include + + + +// INTERNAL INCLUDES +#include "musavasipprofileavailability.h" + + + +// CONSTRUCTION +UT_CMusAvaSipprofileAvailability* UT_CMusAvaSipprofileAvailability::NewL() + { + UT_CMusAvaSipprofileAvailability* self = UT_CMusAvaSipprofileAvailability::NewLC(); + CleanupStack::Pop(); + + return self; + } + +UT_CMusAvaSipprofileAvailability* UT_CMusAvaSipprofileAvailability::NewLC() + { + UT_CMusAvaSipprofileAvailability* self = new( ELeave ) UT_CMusAvaSipprofileAvailability(); + CleanupStack::PushL( self ); + + self->ConstructL(); + + return self; + } + +// Destructor (virtual by CBase) +UT_CMusAvaSipprofileAvailability::~UT_CMusAvaSipprofileAvailability() + { + } + +// Default constructor +UT_CMusAvaSipprofileAvailability::UT_CMusAvaSipprofileAvailability() + { + } + +// Second phase construct +void UT_CMusAvaSipprofileAvailability::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + +// METHODS + + + +void UT_CMusAvaSipprofileAvailability::SetupL( ) + { + iAvailabilityObserver = CMusAvaAvailabilityObserverImp::NewL(); + iSipprofileAvailability = CMusAvaSipprofileAvailability::NewL( *iAvailabilityObserver ); + } + +void UT_CMusAvaSipprofileAvailability::Teardown( ) + { + delete iAvailabilityObserver; + iAvailabilityObserver = NULL; + delete iSipprofileAvailability; + iSipprofileAvailability = NULL; + } + +void UT_CMusAvaSipprofileAvailability::UT_CMusAvaSipprofileAvailability_NewLL() + { + EUNIT_ASSERT( iSipprofileAvailability ); + } + +void UT_CMusAvaSipprofileAvailability::UT_CMusAvaSipprofileAvailability_IsProfileExistL() + { + TBool val = iSipprofileAvailability->IsProfileExist(); + EUNIT_ASSERT( val == ETrue ); + } + +void UT_CMusAvaSipprofileAvailability::UT_CMusAvaSipprofileAvailability_StopL() + { + iSipprofileAvailability->Stop(); + EUNIT_ASSERT( iSipprofileAvailability->State() == MMusAvaObserver::EMusAvaStatusNotExecuted ); + + TRAPD( error, iSipprofileAvailability->DoExecuteL() ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT ( error == KErrNone ); + + iSipprofileAvailability->Stop(); + EUNIT_ASSERT( iSipprofileAvailability->State() == MMusAvaObserver::EMusAvaStatusNotExecuted ); + } + +void UT_CMusAvaSipprofileAvailability::UT_CMusAvaSipprofileAvailability_NameL() + { + EUNIT_ASSERT( iSipprofileAvailability->Name() == MMusAvaObserver::EMusAvaNameSipprofileExist ); + } + +void UT_CMusAvaSipprofileAvailability::UT_CMusAvaSipprofileAvailability_DoExecuteLL() + { + TRAPD( error, iSipprofileAvailability->DoExecuteL() ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT ( error == KErrNone ); + + EUNIT_ASSERT( iSipprofileAvailability->State() == MMusAvaObserver::EMusAvaStatusAvailable ); + } + + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusAvaSipprofileAvailability, + "CMusAvaSipprofileAvailability", + "UNIT" ) + +EUNIT_TEST( + "NewL - test ", + "CMusAvaSipprofileAvailability", + "NewL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSipprofileAvailability_NewLL, Teardown) + +EUNIT_TEST( + "IsProfileExist - test ", + "CMusAvaSipprofileAvailability", + "IsProfileExist", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSipprofileAvailability_IsProfileExistL, Teardown) + +EUNIT_TEST( + "Stop - test ", + "CMusAvaSipprofileAvailability", + "Stop", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSipprofileAvailability_StopL, Teardown) + +EUNIT_TEST( + "Name - test ", + "CMusAvaSipprofileAvailability", + "Name", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSipprofileAvailability_NameL, Teardown) + +EUNIT_TEST( + "DoExecuteL - test ", + "CMusAvaSipprofileAvailability", + "DoExecuteL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaSipprofileAvailability_DoExecuteLL, Teardown) + + +EUNIT_END_TEST_TABLE + +// END OF FILE diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaTerminal.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/src/UT_CMusAvaTerminal.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,660 @@ +/* +* 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: +* +*/ + + +// CLASS HEADER +#include "UT_CMusAvaTerminal.h" + +// EXTERNAL INCLUDES +#include + + +// INTERNAL INCLUDES +#include "musavaCapabilityExchange.h" +#include "musavaavailabilityobserver.h" +#include "musavaavailabilityobserverimp.h" +#include "musavaoptionhandler.h" +#include "musavasettingsimp.h" +#include "musavaobserverimp.h" +#include "musavaterminal.h" +#include "MusAvaCapability.h" +#include "MusAvaCapabilityQuery.h" +#include "MusAvaCapabilityTestHelper.h" +#include "CSipSseTestTls.h" +#include "musavacapabilitycontext.h" +#include "musavasip.h" +#include "musavasharedobject.h" +#include "mussettings.h" + + +// CONSTRUCTION +UT_CMusAvaTerminal* UT_CMusAvaTerminal::NewL() + { + UT_CMusAvaTerminal* self = UT_CMusAvaTerminal::NewLC(); + CleanupStack::Pop(); + + return self; + } + +UT_CMusAvaTerminal* UT_CMusAvaTerminal::NewLC() + { + UT_CMusAvaTerminal* self = new( ELeave ) UT_CMusAvaTerminal(); + CleanupStack::PushL( self ); + + self->ConstructL(); + + return self; + } + +// Destructor (virtual by CBase) +UT_CMusAvaTerminal::~UT_CMusAvaTerminal() + { + } + +// Default constructor +UT_CMusAvaTerminal::UT_CMusAvaTerminal() + { + } + +// Second phase construct +void UT_CMusAvaTerminal::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + +// METHODS + + + +void UT_CMusAvaTerminal::SetupL( ) + { + + MSIPObserver* dummyObserver = NULL; + CSIPProfileRegistry* dummyRegistry = NULL; + MSIPConnectionObserver* dummyConnectionObserver = NULL; + + TUid uid = TUid::Uid( 1 ); + TUint32 iapId = 32; + + iSIP = CSIP::NewL( uid, *dummyObserver ); + iProfile = CSIPProfile::NewL( dummyRegistry ); + iSIPConnection = CSIPConnection::NewL( *iSIP, + iapId, + *dummyConnectionObserver ); + + + iAvailabilityObserver = CMusAvaAvailabilityObserverImp::NewL(); + iConcreteSettings = CMusAvaSettingsImp::NewL(); + iOptionHandler = CMusAvaOptionHandler::NewL( *iAvailabilityObserver, + *iConcreteSettings ); + + iExchange = iOptionHandler->iCapabilityExchange; + + iCapability = iOptionHandler->iSwisCapability; + + iTerminal = CMusAvaTerminal::NewL( *iExchange, + KCapabilityTestAddress_B, + KCapabilityTestTerminalID_B ); + if ( !iProfile->iRegisteredContact ) + { + iProfile->iRegisteredContact = KRegisteredContact().AllocL(); + } + + CSipSseTestTls::OpenL(); + iStorage = CSipSseTestTls::Storage(); + iStorage->Set( MusSettingsKeys::KFastStartupMode, + MusSettingsKeys::EFastModeOff ); + } + + +void UT_CMusAvaTerminal::Teardown( ) + { + if ( iStorage ) + { + iStorage->Clear(); + CSipSseTestTls::Close(); + iStorage = NULL; + } + + delete iTerminal; + delete iOptionHandler; + delete iConcreteSettings; + delete iAvailabilityObserver; + + delete iSIPConnection; + delete iProfile; + delete iSIP; + + } + +void UT_CMusAvaTerminal::UT_CMusAvaTerminal_NewLL( ) + { + + + EUNIT_ASSERT( iTerminal->Id().Compare( KCapabilityTestTerminalID_B ) == 0 ); + EUNIT_ASSERT( iTerminal->Uri().Compare( KCapabilityTestAddress_B ) == 0 ); + EUNIT_ASSERT( iTerminal->IsDiscovered() ); + EUNIT_ASSERT( iTerminal->RequestedQuery() == NULL ); + + + } + +void UT_CMusAvaTerminal::UT_CMusAvaTerminal_MatchLL( ) + { + + EUNIT_ASSERT( iTerminal->Id().Compare( KCapabilityTestTerminalID_B ) == 0 ); + EUNIT_ASSERT( iTerminal->Uri().Compare( KCapabilityTestAddress_B ) == 0 ); + EUNIT_ASSERT( iTerminal->IsDiscovered() ); + EUNIT_ASSERT( iTerminal->RequestedQuery() == NULL ); + + + EUNIT_ASSERT( iTerminal->MatchL( KCapabilityTestAddress_B, + KCapabilityTestTerminalID_B ) ); + EUNIT_ASSERT( iTerminal->Uri().Compare( KCapabilityTestAddress_B ) == 0 ); + EUNIT_ASSERT( iTerminal->Id().Compare( KCapabilityTestTerminalID_B ) + == 0 ); + + EUNIT_ASSERT( !iTerminal->MatchL( KCapabilityTestTerminalID_B, + KCapabilityTestAddress_B ) );//!wrong way around + EUNIT_ASSERT( iTerminal->Uri().Compare( KCapabilityTestAddress_B ) == 0 ); + EUNIT_ASSERT( iTerminal->Id().Compare( KCapabilityTestTerminalID_B ) + == 0 ); + + EUNIT_ASSERT( iTerminal->MatchL( KCapabilityTestAddress_B, KNullDesC8 ) ); + EUNIT_ASSERT( iTerminal->Uri().Compare( KCapabilityTestAddress_B ) == 0 ); + EUNIT_ASSERT( iTerminal->Id().Compare( KCapabilityTestTerminalID_B ) + == 0 ); + + EUNIT_ASSERT( !iTerminal->MatchL( KNullDesC8, KNullDesC8 ) ); + EUNIT_ASSERT( iTerminal->Uri().Compare( KCapabilityTestAddress_B ) == 0 ); + EUNIT_ASSERT( iTerminal->Id().Compare( KCapabilityTestTerminalID_B ) + == 0 ); + + EUNIT_ASSERT( !iTerminal->MatchL( KNullDesC8, + KCapabilityTestTerminalID_B ) ); + EUNIT_ASSERT( iTerminal->Uri().Compare( KCapabilityTestAddress_B ) == 0 ); + EUNIT_ASSERT( iTerminal->Id().Compare( KCapabilityTestTerminalID_B ) + == 0 ); + + iTerminal->AttachUriL( KNullDesC8 ); + EUNIT_ASSERT( iTerminal->Uri().Compare( KCapabilityTestAddress_B ) == 0 ); + EUNIT_ASSERT( iTerminal->Id().Compare( KCapabilityTestTerminalID_B ) + == 0 ); + + iTerminal->AttachIdL( KNullDesC8 ); + EUNIT_ASSERT( iTerminal->Uri().Compare( KCapabilityTestAddress_B ) == 0 ); + EUNIT_ASSERT( iTerminal->Id().Compare( KCapabilityTestTerminalID_B ) + == 0 ); + + delete iTerminal->iTerminalId; + iTerminal->iTerminalId = NULL; + iTerminal->iTerminalId = KNullDesC8().AllocL(); + EUNIT_ASSERT( iTerminal->Id().Compare( KNullDesC8 ) == 0 ); + + EUNIT_ASSERT( iTerminal->MatchL( KCapabilityTestAddress_B, KNullDesC8 ) ); + EUNIT_ASSERT( iTerminal->Uri().Compare( KCapabilityTestAddress_B ) == 0 ); + EUNIT_ASSERT( iTerminal->Id().Compare( KNullDesC8 ) == 0 ); + + EUNIT_ASSERT( iTerminal->MatchL( KCapabilityTestAddress_B, + KCapabilityTestTerminalID_B ) ); + EUNIT_ASSERT( iTerminal->Uri().Compare( KCapabilityTestAddress_B ) == 0 ); + EUNIT_ASSERT( iTerminal->Id().Compare( KCapabilityTestTerminalID_B ) + == 0 ); + + + } + +void UT_CMusAvaTerminal::UT_CMusAvaTerminal_ExecuteQueryLL( ) + { + MultimediaSharingSettings::SetSipProfileSettingL( 1 ); + if ( !iProfile->iArray ) + { + iProfile->iArray = new ( ELeave ) CDesC8ArrayFlat( 1 ); + iProfile->iArray->AppendL( _L8("sip:user@domain.com") ); + } + + EUNIT_ASSERT( iExchange->Terminals().Count() == 0 ); + + CMusAvaCapabilityQuery* query = NULL; + query = CMusAvaCapabilityQuery::NewL( *iCapability, + *iSIPConnection, + *iProfile, + KCapabilityTestSIPAddressUri_B ); + CleanupStack::PushL( query ); + EUNIT_ASSERT( iExchange->Terminals().Count() == 1 ); + + CMusAvaTerminal& terminal = query->Terminal(); + EUNIT_ASSERT( terminal.iQueries == 1 ); + EUNIT_ASSERT( terminal.iQuery == NULL ); + + TRAPD( error, terminal.ExecuteQueryL( NULL ) ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT( error != KErrNone ); + + EUNIT_ASSERT( terminal.iQueries == 1 ); + EUNIT_ASSERT( terminal.iQuery == NULL ); + + query->SetState( CMusAvaCapabilityQueryBase::ECapabilityQueryExecuting ); + TRAP( error, terminal.ExecuteQueryL( query ) ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT( error != KErrNone ); + + EUNIT_ASSERT( terminal.iQueries == 1 ); + EUNIT_ASSERT( terminal.iQuery == NULL ); + + query->SetState( CMusAvaCapabilityQueryBase::ECapabilityQueryCreated ); + terminal.ExecuteQueryL( query ); + CleanupStack::Pop( query ); + + EUNIT_ASSERT( terminal.iQueries == 1 ); + EUNIT_ASSERT( terminal.iQuery == query ); + + query = CMusAvaCapabilityQuery::NewL( *iCapability, + *iSIPConnection, + *iProfile, + KCapabilityTestSIPAddressUri_B ); + CleanupStack::PushL( query ); + EUNIT_ASSERT( iExchange->Terminals().Count() == 1 ); + EUNIT_ASSERT( terminal.iQueries == 2 ); + + //Second query cannot be executed + EUNIT_ASSERT_SPECIFIC_LEAVE( terminal.ExecuteQueryL( query ), + KErrAlreadyExists ) + EUNIT_ASSERT( terminal.iQuery != query ); + CleanupStack::PopAndDestroy( query ); + } + + +void UT_CMusAvaTerminal::UT_CMusAvaTerminal_QueryCompletedLL( ) + { + MultimediaSharingSettings::SetSipProfileSettingL( 1 ); + if ( !iProfile->iArray ) + { + iProfile->iArray = new ( ELeave ) CDesC8ArrayFlat( 1 ); + iProfile->iArray->AppendL( _L8("sip:user@domain.com") ); + } + + EUNIT_ASSERT( iExchange->Terminals().Count() == 0 ); + + CMusAvaCapabilityQuery* query = NULL; + query = CMusAvaCapabilityQuery::NewL( *iCapability, + *iSIPConnection, + *iProfile, + KCapabilityTestSIPAddressUri_B ); + CleanupStack::PushL( query ); + EUNIT_ASSERT( iExchange->Terminals().Count() == 1 ); + + CMusAvaTerminal& terminal = query->Terminal(); + EUNIT_ASSERT( terminal.iQueries == 1 ); + + TBool ret; + TRAPD( err, ret = terminal.QueryCompletedL( *query->iTrx ) ); + if ( err == KErrNoMemory ) User::Leave( err ); + EUNIT_ASSERT( !ret ); + + terminal.ExecuteQueryL( query ); + CleanupStack::Pop( query ); + + EUNIT_ASSERT( terminal.iQueries == 1 ); + EUNIT_ASSERT( terminal.iQuery == query ); + + query->SetState( CMusAvaCapabilityQueryBase::ECapabilityQueryExecuting ); + + //timeout + CapabilityTestHelper::SetResponseL( *query->iTrx, + KMUSAVASIPTimeout, + SipStrConsts::EPhraseRequestTimeout, + KCapabilityTestAddress_B, + KNullDesC8, + KNullDesC8, + KNullDesC8, + KNullDesC8 ); + + TRAP( err, ret = terminal.QueryCompletedL( *query->iTrx ) ); + if ( err == KErrNoMemory ) User::Leave( err ); + EUNIT_ASSERT( !ret ); + + query->SetState( CMusAvaCapabilityQueryBase::ECapabilityQueryExecuting ); + + //200 OK with no User-Agent + CapabilityTestHelper::SetResponseL( *query->iTrx, + KMUSAVASIP200, + SipStrConsts::EPhraseOk, + KCapabilityTestAddress_B, + KCapabilitySwisFeature, + KNullDesC8, + KPAssertedIdentity_B, + KCapabilityTestSDP ); + + TRAP( err, ret = terminal.QueryCompletedL( *query->iTrx ) ); + if ( err == KErrNoMemory ) User::Leave( err ); + EUNIT_ASSERT( ret ); + + query->SetState( CMusAvaCapabilityQueryBase::ECapabilityQueryExecuting ); + + //200 OK with User-Agent + CapabilityTestHelper::SetResponseL( *query->iTrx, + KMUSAVASIP200, + SipStrConsts::EPhraseOk, + KCapabilityTestAddress_B, + KCapabilitySwisFeature, + KCapabilityTestTerminalID_B, + KPAssertedIdentity_B, + KCapabilityTestSDP ); + + TRAP( err, ret = terminal.QueryCompletedL( *query->iTrx ) ); + if ( err == KErrNoMemory ) User::Leave( err ); + EUNIT_ASSERT( ret ); + + TRAP( err, ret = terminal.QueryCompletedL( *query->iTrx ) ); + if ( err == KErrNoMemory ) User::Leave( err ); + EUNIT_ASSERT( !ret ); + } + +void UT_CMusAvaTerminal::UT_CMusAvaTerminal_QueryCanceledL( ) + { + if ( !iProfile->iArray ) + { + iProfile->iArray = new ( ELeave ) CDesC8ArrayFlat( 1 ); + iProfile->iArray->AppendL( _L8("sip:user@domain.com") ); + } + + EUNIT_ASSERT( iExchange->Terminals().Count() == 0 ); + + CMusAvaCapabilityQuery* query = NULL; + query = CMusAvaCapabilityQuery::NewL( *iCapability, + *iSIPConnection, + *iProfile, + KCapabilityTestSIPAddressUri_B ); + CleanupStack::PushL( query ); + EUNIT_ASSERT( iExchange->Terminals().Count() == 1 ); + + CMusAvaTerminal& terminal = query->Terminal(); + EUNIT_ASSERT( terminal.iQueries == 1 ); + + terminal.ExecuteQueryL( query ); + CleanupStack::Pop( query ); + + EUNIT_ASSERT( terminal.iQueries == 1 ); + EUNIT_ASSERT( terminal.iQuery == query ); + + query->SetState( CMusAvaCapabilityQueryBase::ECapabilityQueryExecuting ); + + //200 OK with User-Agent + CapabilityTestHelper::SetResponseL( *query->iTrx, + KMUSAVASIP200, + SipStrConsts::EPhraseOk, + KCapabilityTestAddress_B, + KCapabilitySwisFeature, + KCapabilityTestTerminalID_B, + KPAssertedIdentity_B, + KCapabilityTestSDP ); + //TInt err = 404; + EUNIT_ASSERT( terminal.QueryCanceled( *query->iTrx ) ); + EUNIT_ASSERT( query->State() == + CMusAvaCapabilityQueryBase::ECapabilityQueryCompleted ); + + } + +void UT_CMusAvaTerminal::UT_CMusAvaTerminal_QueryRequestedLL( ) + { + + CSIPServerTransaction* options = NULL; + EUNIT_ASSERT( iTerminal->Id().Compare( KCapabilityTestTerminalID_B ) == 0 ); + EUNIT_ASSERT( iTerminal->Uri().Compare( KCapabilityTestAddress_B ) == 0 ); + EUNIT_ASSERT( iTerminal->IsDiscovered() ); + EUNIT_ASSERT( iTerminal->RequestedQuery() == NULL ); + + + options = + CapabilityTestHelper::OptionsRequestL( KCapabilityTestAddress_A, + KCapabilityTestAddress_B, + KNullDesC8, + KCapabilitySwisFeature, + KCapabilityTestAcceptHeader, + KCapabilityTestTerminalID_B ); + CleanupStack::PushL( options ); + + TRAPD( error, iTerminal->QueryRequestedL( *options ) ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT( error != KErrNone ); + + + CleanupStack::PopAndDestroy( options ); + + options = + CapabilityTestHelper::OptionsRequestL( KCapabilityTestAddress_A, + KCapabilityTestAddress_B, + KCapabilitySwisFeature, + KCapabilitySwisFeature, + KCapabilityTestAcceptHeader, + KCapabilityTestTerminalID_B ); + CleanupStack::PushL( options ); + + iTerminal->QueryRequestedL( *options ); + + EUNIT_ASSERT( iTerminal->RequestedQuery() == iCapability ); + EUNIT_ASSERT( iConcreteSettings->SipAddresses().MdcaCount() == 0 ); + + CleanupStack::PopAndDestroy( options ); + + // with Asserted Identity + options = + CapabilityTestHelper::OptionsRequestL( KCapabilityTestAddress_A, + KCapabilityTestAddress_B, + KCapabilitySwisFeature, + KCapabilitySwisFeature, + KCapabilityTestAcceptHeader, + KCapabilityTestTerminalID_B, + KCapabilityPAssertedIdentity ); + CleanupStack::PushL( options ); + iTerminal->QueryRequestedL( *options ); + EUNIT_ASSERT( iConcreteSettings->SipAddresses().MdcaCount() == 1 ); + CleanupStack::PopAndDestroy( options ); + + + CSipSseTestTls* server = CSipSseTestTls::Storage(); + CSipSseTestTls::Storage()->Clear(); + + iTerminal->iRequestedQuery = NULL; + EUNIT_ASSERT( iTerminal->RequestedQuery() == NULL ); + + options = + CapabilityTestHelper::OptionsRequestL( KCapabilityTestAddress_A, + KCapabilityTestAddress_B, + KCapabilityTestDataFeature, + KCapabilitySwisFeature, + KCapabilityTestAcceptHeader, + KCapabilityTestTerminalID_B ); + CleanupStack::PushL( options ); + + iTerminal->QueryRequestedL( *options ); + EUNIT_ASSERT( iTerminal->RequestedQuery() == NULL ); + EUNIT_ASSERT( server->iResponseToRequest == + SIPStrings::StringF( SipStrConsts::EOptions ) ); + EUNIT_ASSERT( server->iClientResponse->StatusCode() == + KMUSAVASIPNotImplemented ); + + CleanupStack::PopAndDestroy( options ); + + + } + +void UT_CMusAvaTerminal::UT_CMusAvaTerminal_IsDiscoveredL( ) + { + if ( !iProfile->iArray ) + { + iProfile->iArray = new ( ELeave ) CDesC8ArrayFlat( 1 ); + iProfile->iArray->AppendL( _L8("sip:user@domain.com") ); + } + + CMusAvaCapabilityQuery* query = NULL; + query = CMusAvaCapabilityQuery::NewL( *iCapability, + *iSIPConnection, + *iProfile, + KCapabilityTestSIPAddressUri_B ); + CleanupStack::PushL( query ); + + EUNIT_ASSERT( iTerminal->Id().Compare( KCapabilityTestTerminalID_B ) + == 0 ); + EUNIT_ASSERT( iTerminal->Uri().Compare( KCapabilityTestAddress_B ) == 0 ); + + EUNIT_ASSERT( iTerminal->RequestedQuery() == NULL ); + EUNIT_ASSERT( iTerminal->iQueries == 0 ); + + EUNIT_ASSERT( iTerminal->IsDiscovered() ); + + iTerminal->iQueries = 0; + iTerminal->iRequestedQuery = iCapability; + EUNIT_ASSERT( !iTerminal->IsDiscovered() ); + + iTerminal->AttachQuery( *query ); + EUNIT_ASSERT( iTerminal->iQueries == 1 ); + iTerminal->iRequestedQuery = NULL; + EUNIT_ASSERT( iTerminal->RequestedQuery() == NULL ); + + EUNIT_ASSERT( !iTerminal->IsDiscovered() ); + + iTerminal->iRequestedQuery = iCapability; + + EUNIT_ASSERT( iTerminal->iQueries == 1 ); + EUNIT_ASSERT( iTerminal->RequestedQuery() == iCapability ); + EUNIT_ASSERT( !iTerminal->IsDiscovered() ); + + iTerminal->AttachQuery( *query ); + EUNIT_ASSERT( iTerminal->iQueries == 2 ); + EUNIT_ASSERT( iTerminal->RequestedQuery() == iCapability ); + EUNIT_ASSERT( !iTerminal->IsDiscovered() ); + + iTerminal->iRequestedQuery = NULL; + EUNIT_ASSERT( iTerminal->iQueries == 2 ); + EUNIT_ASSERT( iTerminal->RequestedQuery() == NULL ); + EUNIT_ASSERT( !iTerminal->IsDiscovered() ); + + iTerminal->iQuery = query; + CleanupStack::Pop( query ); + + EUNIT_ASSERT( iTerminal->iQueries == 2 ); + EUNIT_ASSERT( iTerminal->iQuery == query ); + EUNIT_ASSERT( iTerminal->RequestedQuery() == NULL ); + EUNIT_ASSERT( !iTerminal->IsDiscovered() ); + + iTerminal->DetachQuery( *query ); + + EUNIT_ASSERT( iTerminal->iQueries == 1 ); + EUNIT_ASSERT( iTerminal->iQuery == query ); + EUNIT_ASSERT( iTerminal->iQuery->State() == + CMusAvaCapabilityQueryBase::ECapabilityQueryCreated ); + EUNIT_ASSERT( iTerminal->RequestedQuery() == NULL ); + EUNIT_ASSERT( !iTerminal->IsDiscovered() ); + + iTerminal->iRequestedQuery = iCapability; + EUNIT_ASSERT( iTerminal->iQueries == 1 ); + EUNIT_ASSERT( iTerminal->iQuery == query ); + EUNIT_ASSERT( iTerminal->iQuery->State() == + CMusAvaCapabilityQueryBase::ECapabilityQueryCreated ); + EUNIT_ASSERT( iTerminal->RequestedQuery() == iCapability ); + EUNIT_ASSERT( !iTerminal->IsDiscovered() ); + + iTerminal->iQuery->SetState( + CMusAvaCapabilityQueryBase::ECapabilityQueryCompleted ); + iTerminal->iRequestedQuery = NULL; + EUNIT_ASSERT( iTerminal->iQueries == 1 ); + EUNIT_ASSERT( iTerminal->iQuery == query ); + EUNIT_ASSERT( iTerminal->iQuery->State() == + CMusAvaCapabilityQueryBase::ECapabilityQueryCompleted ); + EUNIT_ASSERT( iTerminal->RequestedQuery() == NULL ); + EUNIT_ASSERT( iTerminal->IsDiscovered() ); + + iTerminal->iRequestedQuery = iCapability; + EUNIT_ASSERT( iTerminal->iQueries == 1 ); + EUNIT_ASSERT( iTerminal->iQuery == query ); + EUNIT_ASSERT( iTerminal->iQuery->State() == + CMusAvaCapabilityQueryBase::ECapabilityQueryCompleted ); + EUNIT_ASSERT( iTerminal->RequestedQuery() == iCapability ); + EUNIT_ASSERT( iTerminal->IsDiscovered() ); +// CMusAvaSharedObject::DeleteSingleton(); + } + +// TEST TABLE +EUNIT_BEGIN_TEST_TABLE( + UT_CMusAvaTerminal, + "CMusAvaTerminal", + "UNIT" ) + +EUNIT_TEST( + "NewL - test ", + "CMusAvaTerminal", + "NewL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaTerminal_NewLL, Teardown) + +EUNIT_TEST( + "MatchL - test ", + "CMusAvaTerminal", + "MatchL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaTerminal_MatchLL, Teardown) + + +EUNIT_TEST( + "ExecuteQueryL - test ", + "CMusAvaTerminal", + "ExecuteQueryL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaTerminal_ExecuteQueryLL, Teardown) + + +EUNIT_TEST( + "QueryCompletedL - test ", + "CMusAvaTerminal", + "QueryCompletedL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaTerminal_QueryCompletedLL, Teardown) + + +EUNIT_TEST( + "QueryCanceled - test ", + "CMusAvaTerminal", + "QueryCanceled", + "FUNCTIONALITY", + SetupL, UT_CMusAvaTerminal_QueryCanceledL, Teardown) + + +EUNIT_TEST( + "QueryRequestedL - test ", + "CMusAvaTerminal", + "QueryRequestedL", + "FUNCTIONALITY", + SetupL, UT_CMusAvaTerminal_QueryRequestedLL, Teardown) + +EUNIT_TEST( + "IsDiscovered - test ", + "CMusAvaTerminal", + "IsDiscovered", + "FUNCTIONALITY", + SetupL, UT_CMusAvaTerminal_IsDiscoveredL, Teardown) + + + + + +EUNIT_END_TEST_TABLE + +// END OF FILE diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/src/UT_availability.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/src/UT_availability.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,114 @@ +/* +* 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: +* +*/ + + +// CLASS HEADER +#include "UT_availability.h" +#include "CSipSseTestTls.h" + +// EXTERNAL INCLUDES +#include + + +// INTERNAL INCLUDES + + +// CONSTRUCTION +T_availability* T_availability::NewL() + { + T_availability* self = T_availability::NewLC(); + CleanupStack::Pop(); + + return self; + } + +T_availability* T_availability::NewLC() + { + T_availability* self = new( ELeave ) T_availability(); + CleanupStack::PushL( self ); + + self->ConstructL(); + + return self; + } + +// Destructor (virtual by CBase) +T_availability::~T_availability() + { + } + +// Default constructor +T_availability::T_availability() + { + } + +// Second phase construct +void T_availability::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + +// METHODS + + + +void T_availability::SetupL( ) + { + CSipSseTestTls::OpenL(); + iStorage = CSipSseTestTls::Storage(); + } + +void T_availability::Teardown( ) + { + if ( iStorage ) + { + iStorage->Clear(); + CSipSseTestTls::Close(); + iStorage = NULL; + } + } + +void T_availability::TestL( ) + { + EUNIT_ASSERT( EFalse ); + } + +void UT_CMusAvaController_StartAvailibilityLL() + { + + } + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + T_availability, + "Add test suite description here.", + "MODULE" ) + +EUNIT_TEST( + "Empty test skeleton", + "Add tested class name here", + "Add tested function name here", + "FUNCTIONALITY", + SetupL, TestL, Teardown) + + +EUNIT_END_TEST_TABLE + +// END OF FILE diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/src/UT_availabilityDllMain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/src/UT_availabilityDllMain.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,151 @@ +/* +* 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: +* +*/ + + +// CLASS HEADER +#include "UT_CMusAvaDefaultImp.h" +#include "UT_CMusAvaContactAvailability.h" +#include "UT_CMusAvaRegisterAvailability.h" +#include "UT_CMusAvaInviteResponder.h" +#include "UT_CMusAvaSip.h" +#include "UT_CMusAvaSharedObject.h" +#include "UT_CMusAvaConnectionAvailability.h" +#include "UT_CMusAvaConnectionMonitor.h" +#include "UT_CMusAvaNetworkRegistrationStatus.h" +#include "UT_CMusAvaNetworkModeStatus.h" +#include "UT_CMusAvaNetworkAvailability.h" +#include "UT_availability.h" +#include "UT_CMusAvaInviteHandler.h" +#include "UT_CMusAvaDefaultImp.h" +#include "UT_CMusAvaSettingsImp.h" +#include "UT_CMusAvaOptionHandler.h" +#include "UT_CMusAvaCapabilityExchange.h" +#include "UT_CMusAvaCapability.h" +#include "UT_CMusAvaTerminal.h" +#include "UT_CMusAvaCapabilitySipAgent.h" +#include "UT_CMusAvaDefaultOptionHandler.h" +#include "UT_CMusAvaCapabilityQuery.h" +#include "UT_CMusAvaSipprofileAvailability.h" +#include "UT_CMusAvaSettingAvailability.h" +#include "UT_CMusAvaSipObserver.h" +#include "UT_CMusAvaSipConnectionObserver.h" +#include "UT_CMusAvaSipProfileRegistryObserver.h" +#include "UT_CMusAvaSipheaderUtil.h" +#include "UT_CMusAvaClientResolverUtil.h" +#include "UT_CMusAvaCallEventMonitor.h" + + +// EXTERNAL INCLUDES +#include + +/** + * Test suite factory function. + */ +EXPORT_C MEUnitTest* CreateTestSuiteL() + { + CEUnitTestSuite* rootSuite = CEUnitTestSuite::NewLC(_L("Mush Availability")); + + rootSuite->AddL( UT_CMusAvaOptionHandler::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusAvaSharedObject::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusAvaContactAvailability::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusAvaRegisterAvailability::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusAvaSip::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusAvaSipObserver::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusAvaSipConnectionObserver::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusAvaInviteResponder::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusAvaConnectionAvailability::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusAvaConnectionMonitor::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusAvaNetworkRegistrationStatus::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusAvaNetworkModeStatus::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusAvaNetworkAvailability::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusAvaInviteHandler::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusAvaDefaultImp::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusAvaSettingsImp::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusAvaCapabilityExchange::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusAvaCapability::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusAvaTerminal::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusAvaCapabilitySipAgent::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusAvaDefaultOptionHandler::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusAvaCapabilityQuery::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusAvaSipprofileAvailability::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusAvaSipProfileRegistryObserver::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusAvaSettingAvailability::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusAvaSipheaderUtil::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusAvaClientResolverUtil::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusAvaCallEventMonitor::NewLC() ); + CleanupStack::Pop(); + + CleanupStack::Pop(); // rootSuite + + return rootSuite; + } + +// END OF FILE diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/src/musavacapabilitytesthelper.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/src/musavacapabilitytesthelper.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,464 @@ +/* +* Copyright (c) 2005-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: Capability Test helper +* +*/ + + +#include "musavacapabilitytesthelper.h" + + + +CSIPServerTransaction* CapabilityTestHelper::OptionsRequestL( + const TDesC8& aRequestUri, + const TDesC8& aFrom, + const TDesC8& aAcceptContact, + const TDesC8& aContact, + const TDesC8& aAccept, + const TDesC8& aUserAgent ) + { + + CSIPServerTransaction* srvtransaction = + CSIPServerTransaction::NewL( SIPStrings::StringF( SipStrConsts::EOptions )); + CleanupStack::PushL( srvtransaction ); + + TUriParser8 Uri; + User::LeaveIfError( Uri.Parse( aRequestUri ) ); + + CUri8* uri = CUri8::NewLC( Uri ); + + CSIPRequestElements* requestelements = CSIPRequestElements::NewL( uri ); + CleanupStack::Pop( uri ); + CleanupStack::PushL( requestelements ); + +//headers + + RPointerArray sipHdrs; + CSIPHeaderBase::PushLC( &sipHdrs ); + + if ( aAcceptContact.Length() > 0 ) + { + + RStringF value = MusAvaCapabilityContext::SIPStringL( aAcceptContact ); + CleanupClosePushL( value ); + + CSIPAcceptContactHeader* acceptContact = + MusAvaCapabilityContext::AcceptContactHeaderLC( value ); + sipHdrs.AppendL( acceptContact ); + CleanupStack::Pop( acceptContact ); + + CleanupStack::PopAndDestroy();//value + + } + + if ( aAccept.Length() > 0 ) + { + CSIPAcceptHeader* accept = + CSIPAcceptHeader::NewLC( KMUSAVASIPMediaTypeApplication, + KMUSAVASIPMediaSubTypeSDP ); + sipHdrs.AppendL( accept ); + CleanupStack::Pop( accept ); + } + + if ( aContact.Length() > 0 ) + { + RStringF value = MusAvaCapabilityContext::SIPStringL( aContact ); + CleanupClosePushL( value ); + + TUriParser8 uriValue; + User::LeaveIfError( uriValue.Parse( aFrom ) ); + CUri8* uri = CUri8::NewLC( uriValue ); + + CSIPContactHeader* contact = + MusAvaCapabilityContext::ContactHeaderLC( *uri, value ); + sipHdrs.AppendL( contact ); + CleanupStack::Pop( contact ); + CleanupStack::PopAndDestroy( uri ); + + CleanupStack::PopAndDestroy();//value + + } + + if ( aUserAgent.Length() > 0 ) + { + + CSIPExtensionHeader* userAgent = + MusAvaCapabilityContext::UserAgentHeaderLC( aUserAgent ); + sipHdrs.AppendL( userAgent ); + CleanupStack::Pop( userAgent ); + } + + requestelements->MessageElements().SetUserHeadersL( sipHdrs ); + CleanupStack::PopAndDestroy( &sipHdrs ); + +//to, from + + CSIPToHeader* toheader = CSIPToHeader::DecodeL( aRequestUri ); + CleanupStack::PushL( toheader ); + CSIPFromHeader* fromheader = CSIPFromHeader::DecodeL( aFrom ); + CleanupStack::PushL( fromheader ); + + requestelements->SetFromHeaderL(fromheader); + CleanupStack::Pop( fromheader ); + requestelements->SetToHeaderL(toheader); + CleanupStack::Pop( toheader ); + + + requestelements->SetMethodL( SIPStrings::StringF( SipStrConsts::EOptions ) ); + + srvtransaction->SetRequestElements( requestelements ); + CleanupStack::Pop( requestelements ); + CleanupStack::Pop( srvtransaction ); + + return srvtransaction; + + } + + +CSIPServerTransaction* CapabilityTestHelper::OptionsRequestL( + const TDesC8& aRequestUri, + const TDesC8& aFrom, + const TDesC8& aAcceptContact, + const TDesC8& aContact, + const TDesC8& aAccept, + const TDesC8& aUserAgent, + const TDesC8& aAssertId ) + { + + CSIPServerTransaction* srvtransaction = + CSIPServerTransaction::NewL( SIPStrings::StringF( SipStrConsts::EOptions )); + CleanupStack::PushL( srvtransaction ); + + TUriParser8 Uri; + User::LeaveIfError( Uri.Parse( aRequestUri ) ); + + CUri8* uri = CUri8::NewLC( Uri ); + + CSIPRequestElements* requestelements = CSIPRequestElements::NewL( uri ); + CleanupStack::Pop( uri ); + CleanupStack::PushL( requestelements ); + +//headers + + RPointerArray sipHdrs; + CSIPHeaderBase::PushLC( &sipHdrs ); + + if ( aAcceptContact.Length() > 0 ) + { + + RStringF value = MusAvaCapabilityContext::SIPStringL( aAcceptContact ); + CleanupClosePushL( value ); + + CSIPAcceptContactHeader* acceptContact = + MusAvaCapabilityContext::AcceptContactHeaderLC( value ); + sipHdrs.AppendL( acceptContact ); + CleanupStack::Pop( acceptContact ); + + CleanupStack::PopAndDestroy();//value + + } + + if ( aAccept.Length() > 0 ) + { + CSIPAcceptHeader* accept = + CSIPAcceptHeader::NewLC( KMUSAVASIPMediaTypeApplication, + KMUSAVASIPMediaSubTypeSDP ); + sipHdrs.AppendL( accept ); + CleanupStack::Pop( accept ); + } + + if ( aContact.Length() > 0 ) + { + RStringF value = MusAvaCapabilityContext::SIPStringL( aContact ); + CleanupClosePushL( value ); + + TUriParser8 uriValue; + User::LeaveIfError( uriValue.Parse( aFrom ) ); + CUri8* uri = CUri8::NewLC( uriValue ); + + CSIPContactHeader* contact = + MusAvaCapabilityContext::ContactHeaderLC( *uri, value ); + sipHdrs.AppendL( contact ); + CleanupStack::Pop( contact ); + CleanupStack::PopAndDestroy( uri ); + + CleanupStack::PopAndDestroy();//value + + } + + if ( aUserAgent.Length() > 0 ) + { + + CSIPExtensionHeader* userAgent = + MusAvaCapabilityContext::UserAgentHeaderLC( aUserAgent ); + sipHdrs.AppendL( userAgent ); + CleanupStack::Pop( userAgent ); + } + + if ( aAssertId.Length() > 0 ) + { + + CSIPExtensionHeader* assertId = + MusAvaCapabilityContext::PAssertedIdentityHeaderLC( aAssertId ); + sipHdrs.AppendL( assertId ); + CleanupStack::Pop( assertId ); + } + + requestelements->MessageElements().SetUserHeadersL( sipHdrs ); + CleanupStack::PopAndDestroy( &sipHdrs ); + +//to, from + + CSIPToHeader* toheader = CSIPToHeader::DecodeL( aRequestUri ); + CleanupStack::PushL( toheader ); + CSIPFromHeader* fromheader = CSIPFromHeader::DecodeL( aFrom ); + CleanupStack::PushL( fromheader ); + + requestelements->SetFromHeaderL(fromheader); + CleanupStack::Pop( fromheader ); + requestelements->SetToHeaderL(toheader); + CleanupStack::Pop( toheader ); + + + requestelements->SetMethodL( SIPStrings::StringF( SipStrConsts::EOptions ) ); + + srvtransaction->SetRequestElements( requestelements ); + CleanupStack::Pop( requestelements ); + CleanupStack::Pop( srvtransaction ); + + return srvtransaction; + + } +CSIPClientTransaction* CapabilityTestHelper::OptionsResponseL( TUint aResponse, + TInt aPhrase, + const TDesC8& aFrom, + const TDesC8& aContact, + const TDesC8& aUserAgent, + const TDesC8& aPAssertedId, + const TDesC8& aSdp ) + { + + CSIPClientTransaction* clitransaction = + CSIPClientTransaction::NewL( SIPStrings::StringF( SipStrConsts::EOptions )); + CleanupStack::PushL( clitransaction ); + + SetResponseL( *clitransaction, aResponse, aPhrase, aFrom, aContact, + aUserAgent, aPAssertedId, aSdp ); + + CleanupStack::Pop( clitransaction ); + + return clitransaction; + + + } + + +void CapabilityTestHelper::SetResponseL( CSIPClientTransaction& aTrx, + TUint aResponse, + TInt aPhrase, + const TDesC8& aFrom, + const TDesC8& aContact, + const TDesC8& aUserAgent, + const TDesC8& aPAssertedId, + const TDesC8& aSdp, + const TDesC8& aContentType ) + { + + CSIPResponseElements* response = + CSIPResponseElements::NewLC( aResponse, + SIPStrings::StringF( aPhrase ) ); + + CSIPMessageElements& message = response->MessageElements(); + +//headers + + RPointerArray sipHdrs; + CSIPHeaderBase::PushLC( &sipHdrs ); + + if ( aContact.Length() > 0 ) + { + + RStringF value = MusAvaCapabilityContext::SIPStringL( aContact ); + CleanupClosePushL( value ); + + TUriParser8 uriValue; + User::LeaveIfError( uriValue.Parse( aFrom ) ); + CUri8* uri = CUri8::NewLC( uriValue ); + + CSIPContactHeader* contact = + MusAvaCapabilityContext::ContactHeaderLC( *uri, value ); + sipHdrs.AppendL( contact ); + CleanupStack::Pop( contact ); + CleanupStack::PopAndDestroy( uri ); + CleanupStack::PopAndDestroy();//value + + } + + if ( aUserAgent.Length() > 0 ) + { + + CSIPExtensionHeader* userAgent = + MusAvaCapabilityContext::UserAgentHeaderLC( aUserAgent ); + sipHdrs.AppendL( userAgent ); + CleanupStack::Pop( userAgent ); + } + + if ( aPAssertedId.Length() > 0 ) + { + + CSIPExtensionHeader* pAssertedId = + MusAvaCapabilityContext::PAssertedIdentityHeaderLC( aPAssertedId ); + sipHdrs.AppendL( pAssertedId ); + CleanupStack::Pop( pAssertedId ); + + } + + message.SetUserHeadersL( sipHdrs ); + CleanupStack::PopAndDestroy( &sipHdrs ); + + if ( aSdp.Length() > 0 ) + { + CSIPContentTypeHeader* contenttype = NULL; + if ( aContentType.Length() == 0 ) + { + contenttype = + CSIPContentTypeHeader::NewLC( KMUSAVASIPMediaTypeApplication, + KMUSAVASIPMediaSubTypeSDP ); + } + else + { + contenttype = + CSIPContentTypeHeader::DecodeL( aContentType ); + CleanupStack::PushL( contenttype ); + + } + HBufC8* content = aSdp.AllocLC(); + + message.SetContentL( content, contenttype ); + CleanupStack::Pop( content ); + CleanupStack::Pop( contenttype ); + + } + + aTrx.SetResponseElements( response ); + CleanupStack::Pop( response ); + + } + +void CapabilityTestHelper::SetResponse2L(CSIPClientTransaction& aTrx, + TUint aResponse, + TInt aPhrase, + const TDesC8& aFrom, + const TDesC8& aContact, + const TDesC8& aUserAgent, + const TDesC8& aPAssertedId, + const TDesC8& aPAssertedId2, + const TDesC8& aSdp, + const TDesC8& aContentType ) + { + CSIPResponseElements* response = + CSIPResponseElements::NewLC( aResponse, + SIPStrings::StringF( aPhrase ) ); + + CSIPMessageElements& message = response->MessageElements(); + +//headers + + RPointerArray sipHdrs; + CSIPHeaderBase::PushLC( &sipHdrs ); + + if ( aContact.Length() > 0 ) + { + + RStringF value = MusAvaCapabilityContext::SIPStringL( aContact ); + CleanupClosePushL( value ); + + TUriParser8 uriValue; + User::LeaveIfError( uriValue.Parse( aFrom ) ); + CUri8* uri = CUri8::NewLC( uriValue ); + + CSIPContactHeader* contact = + MusAvaCapabilityContext::ContactHeaderLC( *uri, value ); + sipHdrs.AppendL( contact ); + CleanupStack::Pop( contact ); + CleanupStack::PopAndDestroy( uri ); + CleanupStack::PopAndDestroy();//value + + } + + if ( aUserAgent.Length() > 0 ) + { + + CSIPExtensionHeader* userAgent = + MusAvaCapabilityContext::UserAgentHeaderLC( aUserAgent ); + sipHdrs.AppendL( userAgent ); + CleanupStack::Pop( userAgent ); + } + + if ( aPAssertedId.Length() > 0 ) + { + + CSIPExtensionHeader* pAssertedId = + MusAvaCapabilityContext::PAssertedIdentityHeaderLC( aPAssertedId ); + sipHdrs.AppendL( pAssertedId ); + CleanupStack::Pop( pAssertedId ); + + } + + if ( aPAssertedId2.Length() > 0 ) + { + + CSIPExtensionHeader* pAssertedId2 = + MusAvaCapabilityContext::PAssertedIdentityHeaderLC( aPAssertedId2 ); + sipHdrs.AppendL( pAssertedId2 ); + CleanupStack::Pop( pAssertedId2 ); + + } + + message.SetUserHeadersL( sipHdrs ); + CleanupStack::PopAndDestroy( &sipHdrs ); + + if ( aSdp.Length() > 0 ) + { + CSIPContentTypeHeader* contenttype = NULL; + if ( aContentType.Length() == 0 ) + { + contenttype = + CSIPContentTypeHeader::NewLC( KMUSAVASIPMediaTypeApplication, + KMUSAVASIPMediaSubTypeSDP ); + } + else + { + contenttype = + CSIPContentTypeHeader::DecodeL( aContentType ); + CleanupStack::PushL( contenttype ); + + } + HBufC8* content = aSdp.AllocLC(); + + message.SetContentL( content, contenttype ); + CleanupStack::Pop( content ); + CleanupStack::Pop( contenttype ); + + } + + aTrx.SetResponseElements( response ); + CleanupStack::Pop( response ); + + } + +CSIPAddress* HelpFlags::iTestSipAddress = NULL; +TBool HelpFlags::iUseTestSipAddress = EFalse; +TBool HelpFlags::iEmptyContactHeader = EFalse; + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshavailability/tsrc/ut_availability/src/ut_cmusavaclientresolverutil.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshavailability/tsrc/ut_availability/src/ut_cmusavaclientresolverutil.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,186 @@ +/* +* 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: Unit test class implementation +* +*/ + + +// INTERNAL INCLUDES +#include "ut_cmusavaclientresolverutil.h" +#include "musavaclientresolverutil.h" +#include "CSipSseTestTls.h" + +// SYSTEM INCLUDES +#include +#include +#include + + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusAvaClientResolverUtil* UT_CMusAvaClientResolverUtil::NewL() + { + UT_CMusAvaClientResolverUtil* self = UT_CMusAvaClientResolverUtil::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusAvaClientResolverUtil* UT_CMusAvaClientResolverUtil::NewLC() + { + UT_CMusAvaClientResolverUtil* self = new( ELeave ) UT_CMusAvaClientResolverUtil(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusAvaClientResolverUtil::~UT_CMusAvaClientResolverUtil() + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// Default constructor +// ----------------------------------------------------------------------------- +// +UT_CMusAvaClientResolverUtil::UT_CMusAvaClientResolverUtil() + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// Second phase construct +// ----------------------------------------------------------------------------- +// +void UT_CMusAvaClientResolverUtil::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusAvaClientResolverUtil::SetupL() + { + TRAP_IGNORE( SIPStrings::OpenL() ) + CSipSseTestTls::OpenL(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusAvaClientResolverUtil::Teardown() + { + CSipSseTestTls::Close(); + SIPStrings::Close(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusAvaClientResolverUtil::Setup_SawfishL() + { + TRAP_IGNORE( SIPStrings::OpenL() ) + CSipSseTestTls::OpenL(); + CRepository::iEmulateSawfishRepository = ETrue; + iResolver = CMusAvaClientResolverUtil::NewL(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusAvaClientResolverUtil::Teardown_Sawfish() + { + delete iResolver; + CRepository::iEmulateSawfishRepository = EFalse; + CSipSseTestTls::Close(); + SIPStrings::Close(); + } + + +// TEST CASES + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusAvaClientResolverUtil::UT_NewL_SucceedsInSawfishL() + { + EUNIT_ASSERT( iResolver ) + + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusAvaClientResolverUtil::UT_NewL_FailsInOthersThanSawfishL() + { + TRAPD( error, iResolver = CMusAvaClientResolverUtil::NewL() ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT( error != KErrNone ); + } + + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusAvaClientResolverUtil, + "CMusAvaClientResolverUtil", + "UNIT" ) + +EUNIT_TEST( + "UT_NewL_SucceedsInSawfishL", + "CMusAvaClientResolverUtil", + "NewL", + "FUNCTIONALITY", + Setup_SawfishL, UT_NewL_SucceedsInSawfishL, Teardown_Sawfish) + +EUNIT_TEST( + "UT_NewL_FailsInOthersThanSawfishL", + "CMusAvaClientResolverUtil", + "NewL", + "FUNCTIONALITY", + SetupL, UT_NewL_FailsInOthersThanSawfishL, Teardown) + + +EUNIT_END_TEST_TABLE + +// END OF FILE + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/data/20021341.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/data/20021341.rss Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,40 @@ +/* +* 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 "registryinfov2.rh" + +RESOURCE REGISTRY_INFO theInfo + { + resource_format_version = RESOURCE_FORMAT_VERSION_2; + dll_uid = 0x20021341; + interfaces = + { + INTERFACE_INFO + { + interface_uid = 0x20021340; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x20021341; + version_no = 1; + default_data = "MultimediaSharing"; + } + }; + } + }; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/group/bld.inf Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,23 @@ +/* +* 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 + +PRJ_MMPFILES +musengineplugin.mmp + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/group/musengineplugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/group/musengineplugin.mmp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,77 @@ +/* +* 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 + +TARGET musengineplugin.dll +TARGETTYPE PLUGIN +UID 0x10009D8D 0x20021341 +VENDORID VID_DEFAULT +CAPABILITY CAP_ECOM_PLUGIN + +SOURCEPATH ../data +START RESOURCE 20021341.rss +TARGET musengineplugin.rsc +END + +SOURCEPATH ../src +SOURCE musenginepluginentry.cpp +SOURCE musengsessionmanager.cpp +SOURCE musengmcesession.cpp +SOURCE musengmceoutsession.cpp +SOURCE musenglivesession.cpp +SOURCE musengreceivesession.cpp +SOURCE musengtwowaysession.cpp +SOURCE musengtwowayrecvsession.cpp +SOURCE musengtelephoneutils.cpp +SOURCE musengsessiondurationtimer.cpp +SOURCE musengclipsession.cpp +SOURCE musenguriparser.cpp +SOURCE musengmceutils.cpp +SOURCE mussipprofilehandler.cpp +SOURCE musengcamerahandler.cpp +SOURCE musengvideoplayerbase.cpp +SOURCE musenglocalvideoplayer.cpp +SOURCE musenglivevideoplayer.cpp +SOURCE musengremotevideoplayer.cpp +SOURCE musengclipvideoplayer.cpp + +SOURCEPATH ../../mmshshared/src +SOURCE muspropertywatch.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../mmshshared/inc +USERINCLUDE ../../inc +USERINCLUDE ../../../inc + +APP_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/ecom + +LIBRARY euser.lib +LIBRARY bafl.lib +LIBRARY inetprotutil.lib +LIBRARY phoneclient.lib +LIBRARY centralrepository.lib +LIBRARY sipprofilecli.lib +LIBRARY sipclient.lib +LIBRARY sipcodec.lib +LIBRARY mceclient.lib +LIBRARY drmcommon.lib +LIBRARY charconv.lib +LIBRARY telephonyaudiorouting.lib +LIBRARY cntmodel.lib ecom.lib +DEBUGLIBRARY flogger.lib diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/inc/musengaudioroutingobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/inc/musengaudioroutingobserver.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,42 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef MUSENGAUDIOROUTINGOBSERVER_H +#define MUSENGAUDIOROUTINGOBSERVER_H + +// INCLUDES +#include + +// CLASS DECLARATION + +/** +* An interface to get notifcations when the audio routing changes +*/ +class MMusEngAudioRoutingObserver + { + + public: + + /** + * The audio routing has changed. + */ + virtual void AudioRoutingChanged() = 0; + + }; + +#endif // MUSENGAUDIOROUTINGOBSERVER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/inc/musengcamerahandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/inc/musengcamerahandler.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,159 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef MUSHENGCAMERAHANDLER_H +#define MUSHENGCAMERAHANDLER_H + +// USER +#include "musunittesting.h" +#include "mussettings.h" + +// SYSTEM +#include +#include +#include +#include + +// FORWARD DECLARATIONS +class CMceCameraSource; +class CMceSession; + +// CLASS + +class TMusEngCameraHandler : + public MLcCameraControl, + public MLcBrightnessControl, + public MLcZoomControl + { + MUS_UNITTEST( UT_CMusEngOutSession ) + MUS_UNITTEST( UT_CMusEngLiveSession ) + MUS_UNITTEST( UT_CMusEngTwoWaySession ) + MUS_UNITTEST( UT_CMusEngTwoWayRecvSession ) + MUS_UNITTEST( UT_TMusEngCameraHandler ) + + 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: + + /** + * Resumes previously paused session. + * Continues using viewfinder and enables streaming video. + * + */ + void PlayL(); + + /** + * Pauses session. + * Holds display and disables streaming video to network. + * + */ + void PauseL(); + + /** + * Tells whether session is paused or not + */ + TBool IsPlayingL(); + + public: + + TMusEngCameraHandler(); + + void SetSession( CMceSession* aSession ); + + void InitializeL( CMceCameraSource& aCamera ); + + void InitializeZoomStepSize(); + + void ReadCameraUsageKeyL(); + + TInt ZoomStepSize( TInt64& aTime ); + + private: + + enum TCurrentCamera + { + ECameraNotAvailable = KErrNotFound, + EBackCamera = 0, + EFrontCamera = 1 + }; + + private: // New functions + + TInt CamerasAvailableL( TCurrentCamera& aCurrentCamera ); + + void ChangeCameraL( TCurrentCamera aCurrentCamera ); + + void ChangeActiveCameraL( TCurrentCamera aNewCamera ); + + private: // Data + + CMceSession* iSession; // Not owned + + TCameraInfo iCameraInfo; + + TInt iDefaultBrightness; + + TInt64 iZoomInTime; + + TInt64 iZoomOutTime; + + TInt iSmallZoomStep; + + TInt iBigZoomStep; + + TCurrentCamera iCurrentCamera; + + MusSettingsKeys::TUseCamera iCameraUsage; + }; + +#endif + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/inc/musengclipsession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/inc/musengclipsession.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,117 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef MUSHENGCLIPSESSION_H +#define MUSHENGCLIPSESSION_H + +// USER +#include "musengmceoutsession.h" +#include "musunittesting.h" + +class MMusEngClipSessionObserver; +class CMusEngLiveSession; +class CMceFileSource; +class CMceAudioStream; +class CMceVideoStream; +class CMceAudioCodec; +class CMusEngClipVideoPlayer; + + +class CMusEngClipSession : public CMusEngMceOutSession + { + MUS_UNITTEST( UT_CMusEngClipSession ) + MUS_UNITTEST( UT_CMusEngMceSession ) + + public: // Constructors and destructor + + /** + * Constructor + */ + static CMusEngClipSession* NewL(); + + /** + * Destructor + */ + ~CMusEngClipSession(); + + public: // from MLcSession + + MLcVideoPlayer* LocalVideoPlayer(); + + + protected: // implementation of virtual helper from CMusEngMceOutSession + + /** + * @param aLocalBundle All local streams are supposed to be added to + * this bundle + */ + void CompleteSessionStructureL( CMceStreamBundle& aLocalBundle ); + + + protected: // overrides function from CMusEngMceOutSession + + /** + * Checks that there is no need for transcoding before calling + * overridden base class variant of this function. + */ + void EstablishSessionL(); + + + private: // from MMceStreamObserver, + // overrides the function in CMusEngMceSession + + /** + * The state of the stream has changed. + * + * @param aStream, the stream that has changed. + */ + void StreamStateChanged( CMceMediaStream& aStream ); + + /** + * The state of the source has changed. + * @param aStream, the stream that uses the source. + * @param aSource, the source that has changed. + */ + void StreamStateChanged( CMceMediaStream& aStream, + CMceMediaSource& aSource ); + + private: + + CMusEngClipSession(); + + void ConstructL(); + + + private: // HELPERS + + void AddAmrCodecL( CMceAudioStream& aAudioStream ); + + void AddVideoCodecL( CMceVideoStream& aVideoStream ); + + void ConstructAudioStructureL( CMceStreamBundle& aLocalBundle ); + + void DetermineBufferingPeriod( CMceMediaStream& aStream ); + + private: // Data + + CMusEngClipVideoPlayer* iClipVideoPlayer; + TTime iBufferingStartedTime; + }; + +#endif // MUSHENGCLIPSESSION_H + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/inc/musengclipvideoplayer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/inc/musengclipvideoplayer.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,105 @@ +/* +* 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 MUSHENGCLIPVIDEOPLAYER_H +#define MUSHENGCLIPVIDEOPLAYER_H + +// INCLUDES +#include "musenglocalvideoplayer.h" +#include "musunittesting.h" +#include + +// CLASS DECLARATION +class CMusEngClipVideoPlayer : + public CMusEngLocalVideoPlayer, + public MLcSourceFileControl + { + MUS_UNITTEST( UT_CMusEngClipVideoPlayer ) + + public: // Constructors and destructor + + static CMusEngClipVideoPlayer* NewL( + MMusEngDisplayHandler& aDisplayHandler, + MLcAudioControl& aLcAudioControl ); + + ~CMusEngClipVideoPlayer(); + + public: // New functions + + TBool HasClipEnded(); + + void SetBufferingPeriod( const TTimeIntervalMicroSeconds& aPeriod ); + + public: // From MLcVideoPlayer + + TBool LcIsPlayingL(); + + void LcPlayL(); + + void LcPauseL(); + + MLcSourceFileControl* LcSourceFileControl(); + + public: // From MLcSourceFileControl + + void SetLcFileNameL( const TFileName& aFileName ); + + TFileName& LcFileName(); + + void LcFastForwardL( TBool aUseFFWD ); + + void LcFastRewindL( TBool aUseFRWD ); + + TTimeIntervalSeconds LcFileDurationL(); + + TTimeIntervalSeconds LcFilePositionL(); + + void SetLcFilePositionL( const TTimeIntervalSeconds& aPosition ); + + private: // Constructors + + CMusEngClipVideoPlayer( + MMusEngDisplayHandler& aDisplayHandler, + MLcAudioControl& aLcAudioControl ); + + private: // Helper functions + + TBool IsProtectedFileL( const TDesC& aClipFile ); + + TTimeIntervalMicroSeconds PositionMicroSecondsL( + TBool aActualPosition = EFalse ); + + TTimeIntervalMicroSeconds GetVideoSinkRelativeFilePos( + const TTimeIntervalMicroSeconds& aActualPosition, + const TTimeIntervalMicroSeconds& aDuration ); + + private: // Data + + TFileName iFileName; + TTime iFFWDStartTime; + TTime iFRWDStartTime; + TTimeIntervalMicroSeconds iBufferingPeriod; + TTimeIntervalMicroSeconds iDelayFileEndingPos; + TTimeIntervalMicroSeconds iPreviousPos; + TBool iRewindedToBeginning; + }; + +#endif // MUSHENGCLIPVIDEOPLAYER_H + +// End of file + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/inc/musengdisplayhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/inc/musengdisplayhandler.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,109 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef MUSHENGDISPLAYHANDLER_H +#define MUSHENGDISPLAYHANDLER_H + + +#include + +// CLASS DECLARATION + +/** +* An Interface for display services +* +* @lib museng.lib +* @since S60 v3.2 +*/ +class MMusEngDisplayHandler + { + + public: + + /* + * Defines possible rotations + */ + enum TDisplayOrientation + { + EPortrait, // Normal + ELandscape // 90 degree's clockwise rotation + }; + + /** + * Returns currently assigned drawing area + * + * @return TRect This session drawing area rectangle + */ + virtual TRect Rect() const = 0; + + /** + * Sets new drawing area + * + * @param TRect This session new drawing area rectangle + */ + virtual void SetRectL( const TRect& aRect ) = 0; + + /** + * Sets secondary rect (e.g. viewfinder in twoway session) + * @param TRect This session new secondary drawing area rectangle + */ + virtual void SetSecondaryRectL( const TRect& aSecondaryRect ) = 0; + + /** + * Gets secondary rect. + * @return TRect This session secondary drawing area rectangle + */ + virtual TRect SecondaryRect() const = 0; + + /** + * Enables or disables display. Call to this function is considered + * as a permission or denial to draw to the display. + */ + virtual void EnableDisplayL( TBool aEnable ) = 0; + + /** + * Check whether display is enabled + */ + virtual TBool IsDisplayEnabled() = 0; + + /** + * Returns current display orientation. + * + * @pre Session is ongoing + * @return Current display orientation + * @leave KErrNotReady if precondition is not fullfilled + */ + virtual TDisplayOrientation OrientationL() = 0; + + /** + * Sets display orientation. + * + * @pre Session is ongoing + * @return Sets display orientation + * @leave KErrNotReady if precondition is not fullfilled + */ + virtual void SetOrientationL( TDisplayOrientation aOrientation ) = 0; + + /** + * Check if display is actively displaying content + * @return ETrue if is displaying content, otherwise EFalse + */ + virtual TBool IsDisplayActive() = 0; + }; + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/inc/musenglivesession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/inc/musenglivesession.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,128 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef MUSENGLIVESESSION_H +#define MUSENGLIVESESSION_H + +// USER +#include "musengmceoutsession.h" +#include "musunittesting.h" +#include "mussettings.h" +#include "musengcamerahandler.h" + +// SYSTEM +#include + +// FORWARD DECLARATIONS +class MMusEngLiveSessionObserver; +class CMusEngLiveVideoPlayer; + + +class CMusEngLiveSession : + public CMusEngMceOutSession + { + MUS_UNITTEST( UT_CMusEngMceSession ) + MUS_UNITTEST( UT_CMusEngOutSession ) + MUS_UNITTEST( UT_CMusEngLiveSession ) + + public: + + /** + * Creates new MultimediaSharing Live session. + * @return CMusEngLiveSession* New instanse of specified class + */ + static CMusEngLiveSession* NewL(); + + public: + + /** + * Destructor + */ + ~CMusEngLiveSession(); + + public: // from MLcSession + + MLcVideoPlayer* LocalVideoPlayer(); + + protected: // inherited from CMusEngMceOutSession + + /** + * @param aLocalBundle All local streams are supposed to be added to + * this bundle + */ + void CompleteSessionStructureL( CMceStreamBundle& aLocalBundle ); + + + protected: // overrides ancestor class versions + + /** + * Sets Multimediasharing specific video codec settings like video + * bitrate maxbitrate. This functions gets called for every video codec + * in session. This function overrides function in ancestor classes. + * Function calls also overridden version. + */ + virtual void AdjustVideoCodecL( CMceVideoCodec& aVideoCodec, + TMceSourceType aSourceType ); + + /** + * Sets Multimediasharing specific audio codec settings. This functions + * gets called for every audio codec in session. This function overrides + * function in base class. Function calls also overridden version. + */ + virtual void AdjustAudioCodecL( CMceAudioCodec& aAudioCodec ); + + /** + * Removes AVC if known that it is not supported + */ + virtual void DoCodecSelectionL( CMceVideoStream& aVideoStream ); + + + protected: // from MMceStreamObserver, + // overrides the function in CMusEngMceSession + + /** + * The state of the sink has changed. + * + * @param aStream, the stream that uses the sink. + * @param aSink, the sink that has changed. + */ + void StreamStateChanged( CMceMediaStream& aStream, + CMceMediaSink& aSink ); + + + protected: + + /** + * Constructor + */ + CMusEngLiveSession(); + + /** + * Second-phase constructor + */ + void ConstructL(); + + + protected: + + TMusEngCameraHandler iCameraHandler; + CMusEngLiveVideoPlayer* iLiveVideoPlayer; + }; + +#endif // MUSENGLIVESESSION_H + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/inc/musenglivevideoplayer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/inc/musenglivevideoplayer.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,83 @@ +/* +* 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 MUSHENGLIVEVIDEOPLAYER_H +#define MUSHENGLIVEVIDEOPLAYER_H + +// INCLUDES +#include "musenglocalvideoplayer.h" +#include + +// FORWARD DECLARATIONS +class CMceSession; +class TMusEngCameraHandler; + +// CLASS DECLARATION +class CMusEngLiveVideoPlayer : + public CMusEngLocalVideoPlayer, + public MLcDestinationFileControl + { + public: // Constructors and destructor + + static CMusEngLiveVideoPlayer* NewL( + MMusEngDisplayHandler& aDisplayHandler, + TMusEngCameraHandler& aCameraHandler, + MLcAudioControl& aLcAudioControl ); + + ~CMusEngLiveVideoPlayer(); + + public: // From MLcVideoPlayer + + TBool LcIsPlayingL(); + + void LcPlayL( TLcVideoPlayerSource aSource=ECameraSource ); + + void LcPauseL(); + + MLcCameraControl* LcCameraControl(); + + MLcDestinationFileControl* LcDestinationFileControl(); + + MLcZoomControl* LcZoomControl(); + + MLcBrightnessControl* LcBrightnessControl(); + + public: // From MLcDestinationFileControl + + void SetLcFileNameL( const TFileName& aFileName ); + + TFileName& LcFileName(); + + void LcRecordL( TBool aRecord ); + + TBool LcIsRecording(); + + private: // Constructors + + CMusEngLiveVideoPlayer( + MMusEngDisplayHandler& aDisplayHandler, + TMusEngCameraHandler& aCameraHandler, + MLcAudioControl& aLcAudioControl ); + + private: // Data + + TFileName iFileName; + TMusEngCameraHandler& iCameraHandler; + }; + +#endif // MUSHENGLIVEVIDEOPLAYER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/inc/musenglocalvideoplayer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/inc/musenglocalvideoplayer.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,47 @@ +/* +* 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 MUSHENGLOCALVIDEOPLAYER_H +#define MUSHENGLOCALVIDEOPLAYER_H + +// INCLUDES +#include "musengvideoplayerbase.h" + +// CLASS DECLARATION +class CMusEngLocalVideoPlayer : public CMusEngVideoPlayerBase + { + public: // Constructors and destructor + + ~CMusEngLocalVideoPlayer(); + + public: // from CMusEngVideoPlayerBase + + TLcVideoPlayerState LcVideoPlayerState() const; + + void SetLcWindowRectL( TRect aRect ); + + TRect LcWindowRect(); + + protected: // Constructors + + CMusEngLocalVideoPlayer( + MMusEngDisplayHandler& aDisplayHandler, + MLcAudioControl& aLcAudioControl ); + }; + +#endif // MUSHENGLOCALVIDEOPLAYER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/inc/musenglogger.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/inc/musenglogger.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,301 @@ +/* +* 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: ?Description +* +*/ + + +#ifndef MUSENGLOGGER_H +#define MUSENGLOGGER_H + + +#include "muslogger.h" + +#if ( !_DEBUG || UNIT_TESTING ) // release or unit test build; no logs + +#define MUS_ENG_LOG_SESSION_STATE( aSession ) +#define MUS_ENG_LOG_SESSION_STATE_AND_STATUS( aSession, aStatusCode, aReasonPhrase ) +#define MUS_ENG_LOG_STREAM_STATE( aStream ) +#define MUS_ENG_LOG_SINK_STATES( aStream ) +#define MUS_ENG_LOG_SOURCE_STATE( aSource ) +#define MUS_ENG_LOG_SINK_STATE( aSink ) +#define MUS_ENG_LOG_STATUS( aStatusCode, aReasonPhrase ) + +#else // debug build; logs + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define MUS_ENG_LOG_SESSION_STATE( aSession )\ + {\ + TBuf<15> state;\ + switch ( (aSession).State() )\ + {\ + case CMceSession::EIdle:\ + {\ + state = _L("EIdle");\ + break;\ + }\ + case CMceSession::EOffering :\ + {\ + state = _L("EOffering");\ + break;\ + }\ + case CMceSession::EIncoming:\ + {\ + state = _L("EIncoming");\ + break;\ + }\ + case CMceSession::EReserving :\ + {\ + state = _L("EReserving");\ + break;\ + }\ + case CMceSession::EAnswering :\ + {\ + state = _L("EAnswering");\ + break;\ + }\ + case CMceSession::EProceeding :\ + {\ + state = _L("EProceeding");\ + break;\ + }\ + case CMceSession::EEstablished:\ + {\ + state = _L("EEstablished");\ + break;\ + }\ + case CMceSession::ECancelling:\ + {\ + state = _L("ECancelling");\ + break;\ + }\ + case CMceSession::ETerminating:\ + {\ + state = _L("ETerminating");\ + break;\ + }\ + case CMceSession::ETerminated:\ + {\ + state = _L("ETerminated");\ + break;\ + }\ + default:\ + {\ + state = _L("Unknown");\ + break;\ + }\ + }\ + MUS_LOG_TDESC( "mus: [ENGINE] Session state is ", state )\ + } + + +#define MUS_ENG_LOG_SESSION_STATE_AND_STATUS( aSession, aStatusCode, aReasonPhrase )\ + {\ + MUS_ENG_LOG_SESSION_STATE( aSession )\ + MUS_ENG_LOG_STATUS( aStatusCode, aReasonPhrase )\ + } + + +#define MUS_ENG_LOG_STREAM_STATE( aStream )\ + {\ + TBuf<20> streamState;\ + switch ( (aStream).State() )\ + {\ + case CMceMediaStream::EUninitialized:\ + {\ + streamState = _L("EIdle");\ + break;\ + }\ + case CMceMediaStream::EInitialized:\ + {\ + streamState = _L("EInitialized");\ + break;\ + }\ + case CMceMediaStream::EBuffering:\ + {\ + streamState = _L("EBuffering");\ + break;\ + }\ + case CMceMediaStream::EIdle:\ + {\ + streamState = _L("EIdle");\ + break;\ + }\ + case CMceMediaStream::EStreaming:\ + {\ + streamState = _L("EStreaming");\ + break;\ + }\ + case CMceMediaStream::EDisabled:\ + {\ + streamState = _L("EDisabled");\ + break;\ + }\ + case CMceMediaStream::ENoResources:\ + {\ + streamState = _L("ENoResources");\ + break;\ + }\ + case CMceMediaStream::ETranscodingRequired:\ + {\ + streamState = _L("ETranscodingRequired");\ + break;\ + }\ + case CMceMediaStream::ETranscoding:\ + {\ + streamState = _L("ETranscoding");\ + break;\ + }\ + default:\ + {\ + streamState = _L("Unknown");\ + break;\ + }\ + }\ + if ( (aStream).Type() == KMceAudio )\ + {\ + MUS_LOG_TDESC( "mus: [ENGINE] AudioStream state is ", streamState )\ + }\ + else\ + {\ + MUS_LOG_TDESC( "mus: [ENGINE] VideoStream state is ", streamState )\ + }\ + MUS_ENG_LOG_SOURCE_STATE( (aStream).Source() )\ + MUS_ENG_LOG_SINK_STATES( (aStream) )\ + } + + +#define MUS_ENG_LOG_SINK_STATES( aStream )\ + {\ + for ( TInt sinkIndex = 0; sinkIndex < aStream.Sinks().Count(); ++sinkIndex )\ + {\ + MUS_ENG_LOG_SINK_STATE( aStream.Sinks()[ sinkIndex ] )\ + }\ + } + + +#define MUS_ENG_LOG_SOURCE_STATE( aSource )\ + {\ + if ( aSource )\ + {\ + TBuf<10> sourceState;\ + if ( aSource->IsEnabled() )\ + {\ + sourceState = _L("enabled");\ + }\ + else\ + {\ + sourceState = _L("disabled");\ + }\ + switch ( aSource->Type() )\ + {\ + case KMceCameraSource:\ + {\ + MUS_LOG_TDESC( " CameraSource is ", sourceState )\ + break;\ + }\ + case KMceFileSource:\ + {\ + MUS_LOG_TDESC( " FileSource is ", sourceState )\ + break;\ + }\ + case KMceRTPSource:\ + {\ + MUS_LOG_TDESC( " RtpSource is ", sourceState )\ + break;\ + }\ + default:\ + {\ + MUS_LOG_TDESC( " UnknownSource is ", sourceState )\ + break;\ + }\ + }\ + }\ + else\ + {\ + MUS_LOG( " No source in stream" )\ + }\ + } + +#define MUS_ENG_LOG_SINK_STATE( aSink )\ + {\ + if ( aSink )\ + {\ + TBuf<10> sinkState;\ + if ( aSink->IsEnabled() )\ + {\ + sinkState = _L("enabled");\ + }\ + else\ + {\ + sinkState = _L("disabled");\ + }\ + switch ( aSink->Type() )\ + {\ + case KMceDisplaySink:\ + {\ + MUS_LOG_TDESC( " DisplaySink is ", sinkState )\ + break;\ + }\ + case KMceSpeakerSink:\ + {\ + MUS_LOG_TDESC( " SpeakerSink is ", sinkState )\ + break;\ + }\ + case KMceRTPSink:\ + {\ + MUS_LOG_TDESC( " RtpSink is ", sinkState )\ + break;\ + }\ + case KMceFileSink:\ + {\ + MUS_LOG_TDESC( " FileSink is ", sinkState )\ + break;\ + }\ + default:\ + {\ + MUS_LOG_TDESC( " UnknownSink is ", sinkState )\ + break;\ + }\ + }\ + }\ + } + + +#define MUS_ENG_LOG_STATUS( aStatusCode, aReasonPhrase )\ + {\ + MUS_LOG1( " StatusCode is %d", aStatusCode )\ + HBufC16* reasonPhrase = HBufC16::NewLC( aReasonPhrase.Length() );\ + reasonPhrase->Des().Copy( aReasonPhrase );\ + MUS_LOG_TDESC( " ReasonPhrase is ",(*reasonPhrase) )\ + CleanupStack::PopAndDestroy( reasonPhrase );\ + } + + + +#endif // _DEBUG + + +#endif // MUSENGLOGGER_H + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/inc/musengmceoutsession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/inc/musengmceoutsession.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,179 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef MUSHENGMCEOUTSESSION_H +#define MUSHENGMCEOUTSESSION_H + +// USER +#include "musengmcesession.h" +#include "musunittesting.h" + +// FORWARD DECLARATIONS +class MLcUiProvider; +class CMceStreamBundle; + +// CLASS DECLARATION +/** +* Class for handling MCE out sessions. Direct inherit classes are +* CMusEngLiveSession and CMusEngClipSession. +* +* @lib musengine.lib +*/ +class CMusEngMceOutSession : public CMusEngMceSession + { + MUS_UNITTEST( UT_CMusEngOutSession ) + + public: + + /** + * Destructor + */ + ~CMusEngMceOutSession(); + + public: // From MLcSession + + const TDesC& RemoteDisplayName(); + + void EstablishLcSessionL(); + + void TerminateLcSessionL(); + + protected: // Must be implemented in derived class + + /** + * @param aLocalBundle All local streams are supposed to be added to + * this bundle + */ + virtual void CompleteSessionStructureL( + CMceStreamBundle& aLocalBundle ) = 0; + + virtual void AddDisplayL( CMceMediaStream& aStream ); + + protected: // May be overridden in derived classes + + /** + * Calls EstablishL-function of class CMceOutSession with feature tag + * in Accept-Contact header. Functions also adjusts stream and codec + * settings by calling CMusEngMceSession::AdjustStreamsAndCodecsL. + * Intention of the function is to provide subclasses means to set + * preconditions to establishment, e.g. succesfull transcoding. + */ + virtual void EstablishSessionL(); + + TBool IsH264Supported() const; + + /** + * + */ + virtual void CreateMceSessionStructureL( TBool aForceSdpBandwidth = + EFalse ); + + + protected: // helper function inherited from CMusEngMceSession + + /** + * Function handling MCE session termination. + */ + void HandleTermination( TInt aStatusCode, const TDesC8& aReasonPhrase ); + + /** + * Sets Multimediasharing specific video codec settings like video + * payload types. This functions gets called for every video codec in + * session. This function overrides function in base class and may + * be further overridden. Function calls also overridden version. + */ + void AdjustVideoCodecL( CMceVideoCodec& aVideoCodec, + TMceSourceType aSourceType ); + + /** + * Sets Multimediasharing specific audio codec settings like audio and + * video payload types. This functions gets called for every audio + * codec in session. This function overrides function in base class and + * may be further overridden. Function calls also overridden version. + */ + void AdjustAudioCodecL( CMceAudioCodec& aAudioCodec ); + + + protected: + + /** + * Constructor + */ + CMusEngMceOutSession(); + + /** + * Second-phase constructor + */ + void ConstructL(); + + + private: // from MMusSipProfileUser, overrides base class definition + + virtual void ProfileRegistered(); + + + private: + + void DoInviteL( const TDesC& aRecipient = KNullDesC ); + + HBufC* ResolveRecipientLC(); + + static TInt AsyncBrakeCompleted( TAny* aPtr ); + + static TInt RegistrationTimerExpired( TAny* aPtr ); + + static TInt InvitationResponseTimerExpired( TAny* aPtr ); + + void InitRecipientNotFoundHandling(); + + void HandleRecipientNotFound(); + + TBool DoSyncRetryL(); + + void SplitL( const TDesC& aDes, const TDesC& aChar, CDesCArray* aArray ); + + HBufC* ReadDescPropertyL( TUint aKey ); + + TBool IgnoreErrorNote(); + + HBufC* RemoteAddressL() const; + + void InputRecipientL( TDes& aRecipientAddress ); + + protected: // DATA + + HBufC* iRemoteDisplayName; + HBufC8* iRecipient; + HBufC8* iVideoCodecList; + TInt iTriedInvitations; + HBufC* iRemoteSipAddressProposal; + CDeltaTimer* iDeltaTimer; + TCallBack iAsyncBrakeCallBack; + TDeltaTimerEntry iAsyncBrakeEntry; + TCallBack iRegistrationCallBack; + TCallBack iInvitationResponseCallBack; + TDeltaTimerEntry iRegistrationEntry; + TDeltaTimerEntry iInvitationResponseEntry; + TBool iRegistrationPending; + TBool iAddressQueried; + + private: + + MUS_UNITTEST ( UT_CMusEngOutSession ) + }; +#endif //MUSHENGMCESESSION_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/inc/musengmcesession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/inc/musengmcesession.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,718 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef MUSENGMCESESSION_H +#define MUSENGMCESESSION_H + +// USER +#include "musengsessiondurationtimerobserver.h" +#include "musunittesting.h" +#include "mussipprofileuser.h" +#include "musengdisplayhandler.h" +#include "musengaudioroutingobserver.h" + +// SYSTEM +#include +#include +#include +#include +#include +#include +#include +#include + +// FORWARD DECLARATIONS +class CMceManager; +class CMceSession; +class CMceVideoStream; +class CMceAudioStream; +class CMceVideoCodec; +class CMceAudioCodec; +class CMusEngSessionDurationTimer; +class CMusSipProfileHandler; +class CMusEngTelephoneUtils; +class MMusEngAudioRoutingObserver; +class MLcSessionObserver; + +// CONSTANTS + +_LIT8( KMusEngAcceptContactHeader, + "Accept-Contact: *;+g.3gpp.cs-voice; explicit" ); +_LIT8( KMusAcceptHeader, + "Accept: application/sdp" ); +_LIT8( KMusEngSessionSdpLineXApplication, "a=X-application:com.nokia.rtvs\r\n" ); +_LIT8( KMusEngSessionSdpLineApplication , "a=application:com.gsma.rts\r\n" ); +_LIT8( KMusEngSessionSdpLineType, "a=type:videolive\r\n" ); +_LIT8( KMusEngSessionSdpLineBandwidthLine , "b=AS:" ); +_LIT8( KMusEngSessionSdpLineBandwidthField , "b=AS:85\r\n" ); +_LIT8( KMusEngSessionSdpLineTiasLine , "b=TIAS:" ); +_LIT8( KMusPPreferredIdentity, "P-Preferred-Identity" ); +_LIT8( KMusEngNewLine , "\r\n" ); + +const TInt KMusTiasMultiplier = 1000; +const TUint8 KMusEngRtpKeepAliveTimer = 5; +const TUint8 KMusEngKeepAlivePayloadTypeVideoH263 = 96; +const TUint8 KMusEngKeepAlivePayloadTypeAudio = 97; +const TUint8 KMusEngKeepAlivePayloadTypeVideoAvc = 98; + +// Value for uninitialized rect +const TInt KMusEngRectNotInit = 1000; + +// CLASS DECLARATION + +/** +* Base class for Multimedia Sharing Engine MCE sessions, inherited by +* CMusEngLiveSession CMusEngClipSession and CMusEngReceiveSession. +* +* CMusEngMceSession encapsulates CMCESession and simplifies use of +* MCE Sessions to user interface. Also splits observers messy events +* to simplified function calls. +* +* @lib musengine.lib +*/ +class CMusEngMceSession : public CBase, + public MLcSession, + public MLcAudioControl, + public MMceSessionObserver, + public MMceInSessionObserver, + public MMceStreamObserver, + public MMceRtpObserver, + public MMusEngSessionDurationTimerObserver, + public MMusSipProfileUser, + public MMusEngDisplayHandler, + public MMusEngAudioRoutingObserver + { + public: + + /** + * Destructor + */ + ~CMusEngMceSession(); + + + public: // from MMusEngDisplayHandler + + /** + * Returns currently assigned drawing area + * + * @return TRect This session drawing area rectangle + */ + TRect Rect() const; + + /** + * Sets new drawing area + * + * @param TRect This session new drawing area rectangle + */ + void SetRectL( const TRect& aRect ); + + /** + * Sets secondary rect (e.g. viewfinder in twoway session) + * @param TRect This session new secondary drawing area rectangle + */ + void SetSecondaryRectL( const TRect& aSecondaryRect ); + + /** + * Gets secondary rect. + * @return TRect This session secondary drawing area rectangle + */ + virtual TRect SecondaryRect() const; + + /** + * Returns current display orientation. + * + * @pre Session is ongoing + * @return Current display orientation + * @leave KErrNotReady if precondition is not fullfilled + */ + TDisplayOrientation OrientationL(); + + /** + * Sets display orientation. + * + * @pre Session is ongoing + * @return Sets display orientation + * @leave KErrNotReady if precondition is not fullfilled + */ + void SetOrientationL( TDisplayOrientation aOrientation ); + + /** + * Permission to draw on screen device. + * + * @pre Session is ongoing + */ + void EnableDisplayL( TBool aEnable ); + + /** + * Implements virtual from MMusEngDisplayHandler + * + * @pre Session is ongoing + */ + TBool IsDisplayEnabled(); + + /** + * Implements virtual from MMusEngDisplayHandler + * + * @pre Session is ongoing + */ + TBool IsDisplayActive(); + + + public: // From MMusEngAudioRoutingObserver + + void AudioRoutingChanged(); + + + public: // From MLcSession + + virtual TLcSessionState LcSessionState() const; + + void SetLcSessionObserver( MLcSessionObserver* aObserver ); + + void SetLcUiProvider( MLcUiProvider* aUiProvider ); + + virtual MLcVideoPlayer* RemoteVideoPlayer(); + + virtual MLcVideoPlayer* LocalVideoPlayer(); + + virtual const TDesC& LocalDisplayName(); + + virtual const TDesC& RemoteDisplayName(); + + TInt SetParameter( TInt aId, TInt aValue ); + + TInt ParameterValue( TInt aId ); + + TBool IsBackgroundStartup(); + + 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: + + MLcSessionObserver* LcSessionObserver(); + + MLcUiProvider* LcUiProvider(); + + protected: // CONSTRUCTORS + + /** + * Constructor + * + */ + CMusEngMceSession(); + + /** + * Second-phase constructor + */ + void ConstructL(); + + + protected: // VIRTUAL HELPER FUNCTIONS + + /** + * Function handling MCE session state changes. + * To be overridden in sibling classes if needed. + */ + virtual void HandleSessionStateChanged( CMceSession& aSession, + TInt aStatusCode, + const TDesC8& aReasonPhrase ); + + /** + * Function handling MCE session termination. + */ + virtual void HandleTermination( TInt aStatusCode, + const TDesC8& aReasonPhrase ); + + /** + * Sets Multimediasharing specific video codec settings. This functions + * gets called for every video codec in session. To be overridden in + * sibling classes if needed. + */ + virtual void AdjustVideoCodecL( CMceVideoCodec& aVideoCodec, + TMceSourceType aSourceType ); + + /** + * Sets Multimediasharing specific audio codec settings like audio MMF + * priority and preference. This functions gets called for every audio + * codec in session. To be overridden in sibling classes if needed. + */ + virtual void AdjustAudioCodecL( CMceAudioCodec& aAudioCodec ); + + /** + * Removes multiples of H.263 codec, prefers H263-2000 over H263-1998. + * Additionally selects just the one with best quality from selected mode. + * @param aVideoStream + */ + virtual void DoCodecSelectionL( CMceVideoStream& aVideoStream ); + + virtual void RectChangedL(); + + protected: // HELPER FUNCTIONS + + void InformObserverAboutSessionStateChange(); + + void InformObserverAboutSessionUpdate(); + + void InformObserverAboutSessionFailure( TInt aReason ); + + void InformObserverAboutPlayerStateChange( MLcVideoPlayer* aPlayer ); + + void InformObserverAboutPlayerUpdate( MLcVideoPlayer* aPlayer ); + + void InformObserverAboutPlayerFailure( + MLcVideoPlayer* aPlayer, + TInt aReason ); + + void InformUiProviderAboutReceivingStart(); + + MLcUiProvider& LcUiProviderL(); + + /** + * Sets session specific SDP lines to a session. + */ + void SetSessionSdpLinesL( CMceSession& aSession, + TBool aForceBandwidthLine = EFalse ); + /** + * Sets media specific SDP lines to media. + */ + void SetMediaSdpLinesL( CMceMediaStream& aStream, + TBool aForceBandwidthLine = EFalse ); + + /** + * Sets the volume level of all speakers in session structure. + * @param aNewVolume New volume level for all speakers + */ + void SetSpeakerVolumeL( TInt aNewVolume ); + + /** + * Adjusts settings of all streams. Calls AdjustVideoStreamL for every + * video stream and AdjustAudioStreamL for every audio stream in session. + */ + void AdjustStreamsAndCodecsL(); + + /** + * Adjusts stream settings. Calls AdjustVideoCodecL for every video + * codec in stream. + */ + void AdjustVideoStreamL( CMceVideoStream& aVideoStream ); + + /** + * Adjusts stream settings. Calls AdjustAudioCodecL for every audio + * codec in stream. + */ + void AdjustAudioStreamL( CMceAudioStream& aAudioStream ); + + /* + * Calls CMceInSession::RejectL() inside TRAP_IGNORE + */ + void Reject( CMceInSession& aSession, + const TDesC8& aReason = KNullDesC8(), + TUint32 aCode = 0 ); + + void SaveContactL( const TDesC8& aAddress ); + + protected: // from MMceInSessionObserver + + /** + * Incoming session invitation. The CMceInSession is given to the + * application as a callback. This default implementation rejects + * session immediately. + * @param aSession, pointer to the incoming session. Ownership is + * transferred. + * @param aContainer, if present, holds details of + * transaction causing state change. + */ + void IncomingSession( CMceInSession* aSession, + TMceTransactionDataContainer* aContainer ); + + + /** + * Incoming session update. The new updated CMceInSession is given to the + * application as a callback. This default implementation rejects + * session immediately. + * @param aOrigSession, the original session to be updated. This instance + * cannot be used anymore, all actions done using aUpdatedSession + * instance. + * @param aUpdatedSession, pointer to the new updated session. Ownership + * is transferred. + * @param aContainer, if present, holds details of + * update transaction. + */ + void IncomingUpdate( CMceSession& aOrigSession, + CMceInSession* aUpdatedSession, + TMceTransactionDataContainer* aContainer ); + + + protected: // from MMceStreamObserver + + /** + * The state of the stream has changed. + * + * @param aStream, the stream that has changed. + */ + void StreamStateChanged( CMceMediaStream& aStream ); + + /** + * The state of the source has changed. + * + * @param aStream, the stream that uses the source. + * @param aSource, the source that has changed. + */ + void StreamStateChanged( CMceMediaStream& aStream, + CMceMediaSource& aSource ); + + /** + * The state of the sink has changed. + * + * @param aStream, the stream that uses the sink. + * @param aSink, the sink that has changed. + */ + void StreamStateChanged( CMceMediaStream& aStream, + CMceMediaSink& aSink ); + + + private: // from MMceSessionObserver + + /** + * The state of the session has changed. + * + * @param aSession, the session that has changed. + * @param aContainer, if present, holds details of + * transaction causing state change. + */ + void SessionStateChanged( CMceSession& aSession, + TMceTransactionDataContainer* aContainer ); + + /** + * The state of the connection used by the session has changed. + * + * @param aSession, the session that has changed. + * @param aActive, ETrue if connection active, EFalse if + * connection inactive. + */ + void SessionConnectionStateChanged( CMceSession& aSession, + TBool aActive ); + + /** + * An error has occurred concerning a specific session. + * Note, that each error causes the session state to be ETerminated. + * + * @param aSession, The session raising the error. + * @param aError, Error code + */ + void Failed( CMceSession& aSession, TInt aError ); + + /** + * An session update has been failed concerning a specific session. + * Note, that each error causes the session state to be ETerminated. + * + * @param aSession, The session raising the error. + * @param aContainer, if present, holds details of + * transaction causing update. + */ + void UpdateFailed( CMceSession& aSession, + TMceTransactionDataContainer* aContainer ); + + + private: // from MMCERtpObserver + + /** + * Callback function to indicate that an RTCP sender report + * has been received. + * @param aSession the session that has changed + * @param aStream the stream that has changed + */ + void SRReceived( CMceSession& aSession, CMceMediaStream& aStream); + + /** + * Callback function to indicate that an RTCP receiver report + * has been received. + * @param aSession the session that has changed + * @param aStream the stream that has changed + */ + void RRReceived( CMceSession& aSession, CMceMediaStream& aStream); + + /** + * Callback function to indicate inactivity timer timeout + * has occurred. Timer is disabled after the timeout. + * + * @param aStream, the session that has changed. + * @param aSource, the source that the timeout occurred. + */ + void InactivityTimeout( CMceMediaStream& aStream, + CMceRtpSource& aSource ); + + /** + * Callback function to indicate that spesified CMceRtpSource has + * received RTP from a new synchronization source (SSRC). + * @param aStream the stream that new SSRC was added to + * @param aSource the source that new SSRC was added to + * @param aSsrc added SSRC identifier + */ + void SsrcAdded( CMceMediaStream& aStream, + CMceRtpSource& aSource, + TUint aSsrc ); + + /** + * Callback function to indicate that spesified CMceRtpSource has + * received RTP BYE message from a spesified synchronization + * source (SSRC). + * @param aStream the stream that SSRC was removed from + * @param aSource the source that SSRC was removed from + * @param aSsrc removed SSRC identifier + */ + void SsrcRemoved( CMceMediaStream& aStream, + CMceRtpSource& aSource, + TUint aSsrc ); + + + private: // from MMusSipProfileUser + + virtual TBool IsRoamingBetweenAPsAllowed(); + + virtual void ProfileRegistered(); + + + private: // HELPER FUNCTIONS + + /** + * Adds b=AS and b=TIAS lines to the array + */ + void AddSdpBandwidthAttributesL( CDesC8Array& aSdpLinesArray, + TInt aBandwidthAs ); + + /** + * Checks whether AS or TIAS bandwidth attributes present in the array + */ + TBool IsBandwidthAttributeSet( MDesC8Array* aSdpLinesArray ); + + + /** + * Callback + */ + void UpdateTimerEvent(); + + /** + * Does actual muting or unmuting of local audio playback but does not + * mark speaker as explicitly muted so this function can be called also + * when muting speaker as a consequence of disabling or enabling + * bundled display sink. + * + */ + void DoMuteSpeakerL( TBool aMute ); + + /** + * Checks if some of array items contains specific text. + * @param aArray + * @param aItem + * @return ETrue if array contains aItem + */ + TBool ContainsText( MDesC8Array* aArray, const TDesC8& aItem ); + + void DoBitrateBasedRemovalL( CMceVideoStream& aVideoStream, + const CMceVideoCodec& aBestBitrateVideoCodec ); + + void DoCodecModeBasedRemovalL( CMceVideoStream& aVideoStream ); + + /** + * Get session time return estabilished session time + * @return TTime returns time if connection established else < 0 + */ + TTimeIntervalSeconds GetSessionTime() const; + + protected: + + /** + * Reads from CenRep and sets encoding device for a codec. + */ + void SetEncodingDeviceL( CMceVideoCodec& aVideoCodec ); + + /** + * Sets configuration key for a codec + */ + void SetCodecConfigKeyL( CMceVideoCodec& aVideoCodec ); + + /** + * Reads proper configuration key for a codec. NULL if not available. + * Ownership is transferred. + */ + HBufC8* ReadCodecConfigKeyL( const CMceVideoCodec& aVideoCodec ) const; + + /** + * Constructs and stores to cenrep a concatenation of all AVC config keys. + */ + void StoreEncoderConfigInfoL() const; + + /** + * Returns config key id for the provided codec. Ownership is transferred + */ + const TPtrC8 ConfigKeyIdL( const CMceVideoCodec& aVideoCodec ) const; + + + protected: // Data + + /** + * Drawing area rect. + */ + TRect iRect; + + /** + * Telephone utilities. + */ + CMusEngTelephoneUtils* iTelephoneUtils; + + /** + * UID used to identify application, needed to create MCE manager + */ + TUid iMceManagerUid; + + /** + * Class for connecting to MCE server. + * This class provides the connection to the MCE server and + * provides functions + * for setting observers for asynchronous events. + * The user should create only one instance of this class. + */ + CMceManager* iManager; + + /** + * Base class for MCE sessions, inherited by both CMCEInSession and + * CMCEOutSession. * CMCESession represents peer-to-peer connection + * made with remote terminal. This connection is also known as dialog + * and it is set up using SIP INVITE method. The characteristics of the + * session are defined by user of this class by attaching media streams + * into the session. After the session has been succesfully established, + * it can be later updated and must be finally terminated. If for any + * reason instance of this class is deleted while in established state, + * session is automatically terminated by MCE server. + */ + CMceSession* iSession; + + /** + * ETrue if operator specific behavior is expected + */ + TBool iOperatorVariant; + + /** + * The handler for the SIP profile related to this session + */ + CMusSipProfileHandler* iSipProfileHandler; + + /** + * Session state for MLcSession + */ + MLcSession::TLcSessionState iLcSessionState; + + /** + * If true, configuration key of current AVC codec must be written to + * CenRep after session establishment. + */ + TBool iStoreEncoderConfigInfo; + + /** + * Remote details + */ + HBufC* iRemoteDetails; + + private: // New functions + + void StreamStreaming( CMceMediaStream& aStream ); + + private: // Data + + /** + * The session observer, if present. + */ + MLcSessionObserver* iLcSessionObserver; + + /** + * The UI provider, if present. + */ + MLcUiProvider* iLcUiProvider; + + /** + * It is assumed, that user has only one instance of this class. + * The same instance is passed between MCE and user, but the data + * inside of this container is just updated for each event. + */ + TMceTransactionDataContainer iTransactionDataContainer; + + /** + * Session time. Acts simultaneously as RTCP inactivity timer. + */ + TTime iStartTime; + + CMusEngSessionDurationTimer* iUpdateTimer; + + /** + * Value indicating seconds gone since last received RTCP sender or + * receiver report. Value 20 indicates RTCP inactivity timeout. + */ + TInt iSecondsFromLastRtcpReport; + + /** + * Value indicating if speaker is explicitly muted instead of + * muted as part of disabling bundled display sink + */ + TBool iExplicitlyMuted; + + /** + * Value indicates whether session was started in background mode. + * (see IsBackgroundStartup()). Once application comes to foreground, + * iBackground is set to EFalse + */ + TBool iBackground; + + MUS_UNITTEST( UT_CMusEngSession ) + MUS_UNITTEST( UT_CMusEngMceSession ) + MUS_UNITTEST( UT_CMusEngReceiveSession ) + MUS_UNITTEST( UT_CMusEngSessionManager ) + }; + +#endif // MUSENGMCESESSION_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/inc/musengmceutils.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/inc/musengmceutils.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,275 @@ +/* +* 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: Utilities to locate and manipulate MCE sessions, streams, +* sources and sinks +* +*/ + + + +#ifndef MUSENGMCEUTILS_H +#define MUSENGMCEUTILS_H + + +#include +#include +#include + + +class CMceSession; +class CMceDisplaySink; +class CMceCameraSource; +class CMceFileSource; +class CMceVideoStream; +class CMceSpeakerSink; + +const TUint KMusEngNoAssociatedSourceType = KMaxTUint; + +/** +* Static class including utility methods to locate and manipulate MCE +* sessions, streams, sources and sinks +* @lib musengine.lib +*/ +class MusEngMceUtils + { + + public: + + /** + * Tells if a stream is a video stream with rtp source. + * + * @param aStream Stream to be investigated + * @return ETrue if parameter is a video stream with a RTP source + */ + static TBool IsVideoInStream( CMceMediaStream& aStream ); + + /** + * Tells if a stream is a video stream with rtp sink. + * + * @param aStream Stream to be investigated + * @return ETrue if parameter is a video stream with a RTP sink + */ + static TBool IsVideoOutStream( CMceMediaStream& aStream ); + + /** + * Tells if a stream is an audio stream with rtp source. + * + * @param aStream Stream to be investigated + * @return ETrue if parameter is an audio stream with a RTP source + */ + static TBool IsAudioInStream( CMceMediaStream& aStream ); + + /** + * Gets handle to video stream with RTP sink. + * Ownership is not transferred. + * + * @return Outgoing video stream + * @leave KErrNotFound if none exists + * @leave KErrOverflow if session contains more than one outgoing + * video stream + */ + static CMceVideoStream* GetVideoOutStreamL( CMceSession& aSession ); + + /** + * Gets handle to video stream with RTP source. + * Ownership is not transferred. + * + * @return Incoming video stream + * @leave KErrNotFound if none exists + * @leave KErrOverflow if session contains more than one incoming + * video stream + */ + static CMceVideoStream* GetVideoInStreamL( CMceSession& aSession ); + + /** + * Gets handle to video stream with file sink. + * Ownership is not transferred. + * + * @return Recording video stream, NULL if none exists + */ + static CMceVideoStream* GetRecordingStream( CMceSession& aSession ); + + /** + * Gets handle to a media sink of spesified type contained by + * a mediastream. If there are several sink instances, first one is + * returned. If associated source type is defined, sink in stream having + * the source is tried to be searched. If no such match, first matching + * sink is returned. Ownership is not transferred. + * + * @return Media sink of the spesified type. NULL if none exists + */ + static CMceMediaSink* GetMediaSink( + CMceMediaStream& aStream, + TMceSinkType aType, + TMceSourceType aAssociatedSourceType = KMusEngNoAssociatedSourceType ); + + /** + * Gets handle to a media sink of spesified type contained by + * a mediastream. If there are several sink instances, first one is + * returned. If associated source type is defined, sink in stream having + * the source is tried to be searched. If no such match, first matching + * sink is returned. Ownership is not transferred. + * + * @return Media sink of the spesified type. + * @leave KErrNotFound if there is no sink of spesified type + */ + static CMceMediaSink* GetMediaSinkL( + CMceMediaStream& aStream, + TMceSinkType aType, + TMceSourceType aAssociatedSourceType = KMusEngNoAssociatedSourceType ); + + /** + * Gets handle to a media sink of spesified type contained by + * a session. If there are several sink instances, first one is + * returned. If associated source type is defined, sink in stream having + * the source is tried to be searched. If no such match, first matching + * sink is returned. Ownership is not transferred. + * + * @return Media sink of the spesified type. NULL if none exists + */ + static CMceMediaSink* GetMediaSink( + CMceSession& aSession, + TMceSinkType aType, + TMceSourceType aAssociatedSourceType = KMusEngNoAssociatedSourceType, + TBool aStrictMatch = EFalse ); + + /** + * Gets handle to a media sink of spesified type contained by + * a session. If there are several sink instances, first one is + * returned. If associated source type is defined, sink in stream having + * the source is tried to be searched. If no such match, first matching + * sink is returned. Ownership is not transferred. + * + * @return Media sink of the spesified type. + * @leave KErrNotFound if there is no sink of spesified type + */ + static CMceMediaSink* GetMediaSinkL( + CMceSession& aSession, + TMceSinkType aType, + TMceSourceType aAssociatedSourceType = KMusEngNoAssociatedSourceType, + TBool aStrictMatch = EFalse ); + + /** + * Gets handle to a speaker sink contained by specified stream + * or its' bound stream. Ownership is not transferred. + * + * @return Speaker sink, NULL if none exists + */ + static CMceSpeakerSink* GetSpeaker( CMceMediaStream& aStream ); + + /** + * Gets handle to a camera source. Ownership is not transferred. + * + * @return Camera source + * @leave KErrNotFound if none exists + */ + static CMceCameraSource* GetCameraL( CMceSession& aSession ); + + /** + * Gets handle to a file source. Ownership is not transferred. + * + * @return File source + * @leave KErrNotFound if none exists + */ + static CMceFileSource* GetFileSourceL( CMceSession& aSession ); + + /** + * Gets handle to a display sink. Ownership is not transferred. + * + * @return Display sink, NULL if none exists + */ + static CMceDisplaySink* GetDisplay( CMceSession& aSession, + TBool aPreferViewFinder = ETrue ); + + /** + * Gets handle to a display sink. If there are several display + * sink instances view finder is preferred with default arguments. + * Ownership is not transferred. + * + * @return Display sink + * @leave KErrNotFound if there is no display + */ + static CMceDisplaySink* GetDisplayL( CMceSession& aSession, + TBool aPreferViewFinder = ETrue ); + + /** + * Gets handle to a display sink. Ownership is not transferred. + * + * @return Display sink, NULL if none exists + */ + static CMceDisplaySink* GetReceivingDisplay( CMceSession& aSession ); + + /** + * Gets handle to a receiving display sink. Ownership is not transferred. + * + * @return Display sink + * @leave KErrNotFound if there is no display + */ + static CMceDisplaySink* GetReceivingDisplayL( CMceSession& aSession ); + + /** + * Gets handle to a viewfinder display sink. Ownership is not transferred. + * + * @return Display sink + * @leave KErrNotFound if there is no display + */ + static CMceDisplaySink* GetVfDisplay( CMceSession& aSession ); + + /** + * Adds display sink to specified stream if one does not exist already. + * Display rect is set in both cases to a specified one. + * Display is disabled by default. + * + * @param aStream is a stream where display is supposed to be added + * @param aManager reference to used MCE manager + * @param aDisplayRect is desired display area + * @leave KErrArgument if offered stream is not a video stream + */ + static void AddDisplayL( CMceMediaStream& aStream, + CMceManager& aManager, + const TRect& aDisplayRect, + TBool aDisable = EFalse ); + + /** + * Adds speaker sink to specified stream if one does not exist already. + * Speaker is disabled by default. + * + * @param aStream is a stream where speaker is supposed to be added + * @leave KErrArgument if offered stream is not a video stream + */ + static void AddSpeakerL( CMceMediaStream& aStream ); + + /** + * Disables a specified stream, its' source and all the sinks + * + * @param aStream is a stream to be disabled + */ + static void DisableStreamL( CMceMediaStream& aStream ); + + /** + * Enables or disables display sink. If the state is already correct, + * nothing is done. + */ + static void DoEnableDisplayL( CMceDisplaySink& aDisplay, TBool aEnable ); + + /** + * Enables inactivity timer if possible. + */ + static TInt EnableInactivityTimer( CMceSession& aSession, + TUint32 aInactivityTimeout ); + + }; + + +#endif // MUSENGMCEUTILS_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/inc/musengreceivesession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/inc/musengreceivesession.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,223 @@ +/* +* 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: +* +*/ + + +#ifndef MUSHENGREVEIVESESSION_H +#define MUSHENGREVEIVESESSION_H + +// INCLUDES +#include "musengmcesession.h" +#include "musenguriparser.h" +#include "musunittesting.h" +#include + +// FORWARD DECLARATIONS +class MMusEngReceiveSessionObserver; +class CMceInSession; +class CMusEngRemoteVideoPlayer; + + +class CMusEngReceiveSession : + public CMusEngMceSession + { + MUS_UNITTEST( UT_CMusEngMceSession ) + MUS_UNITTEST( UT_CMusEngReceiveSession ) + + public: // Contructors and destructor + + /** + * Creates new MultimediaSharing Receive session. + * @return CMusEngReceiveSession* New instanse of specified class + */ + static CMusEngReceiveSession* NewL(); + + /** + * Destructor + * + * @since S60 v3.2 + */ + ~CMusEngReceiveSession(); + + public: // From MLcSession + + TLcSessionState LcSessionState() const; + + void EstablishLcSessionL(); + + void TerminateLcSessionL(); + + MLcVideoPlayer* RemoteVideoPlayer(); + + const TDesC& RemoteDisplayName(); + + protected: // Overrides function in CMusEngMceSession + + /** + * The state of the session has changed. + * + * @since S60 v3.2 + * @param aSession, the session that has changed. + */ + virtual void HandleSessionStateChanged( CMceSession& aSession, + TInt aStatusCode, + const TDesC8& aReasonPhrase ); + + /** + * Sets Multimediasharing specific video codec settings like keepalive + * timer. This functions gets called for every video codec in + * session. This function overrides function in base class. + * Function calls also overridden version. + */ + virtual void AdjustVideoCodecL( CMceVideoCodec& aVideoCodec, + TMceSourceType aSourceType ); + + /** + * Sets Multimediasharing specific audio codec settings like keepalive + * timer. This functions gets called for every audio + * codec in session. This function overrides function in base class. + * Function calls also overridden version. + */ + virtual void AdjustAudioCodecL( CMceAudioCodec& aAudioCodec ); + + /** + * Removes multiples of H.263 codec, prefers H263-2000 over H263-1998. + * Additionally selects just the one with best quality from selected mode. + * Removes all the H.263 codecs if any AVC codecs found. Prefers + * non-interleaved AVC over single NAL AVC + * @param aVideoStream + */ + virtual void DoCodecSelectionL( CMceVideoStream& aVideoStream ); + + protected: // from MMceInSessionObserver + // overrides the function in CMusEngMceSession + + /** + * Incoming session invitation. The CMCEInSession is given to the + * application as a callback. + * @param aSession, pointer to the incoming session. Ownership is + * transferred. + * @param aContainer, if present, holds details of + * transaction causing state change. + */ + void IncomingSession( + CMceInSession* aSession, + TMceTransactionDataContainer* aContainer ); + + + /** + * Incoming session update. The new updated CMCEInSession is given to the + * application as a callback. + * @param aOrigSession, the original session to be updated. This instance + * cannot be used anymore, all actions done using aUpdatedSession + * instance. + * @param aUpdatedSession, pointer to the new updated session. Ownership + * is transferred. + * @param aContainer, if present, holds details of update transaction. + */ + void IncomingUpdate( + CMceSession& aOrigSession, + CMceInSession* aUpdatedSession, + TMceTransactionDataContainer* aContainer ); + + + protected: // from MMceStreamObserver, + // overrides the function in CMusEngMceSession + + /** + * The state of the stream has changed. + * + * @since S60 v3.2 + * @param aStream, the stream that uses the source. + */ + void StreamStateChanged( CMceMediaStream& aStream ); + + protected: // from MMceRtpObserver + + void InactivityTimeout( CMceMediaStream& aStream, + CMceRtpSource& aSource ); + + + + protected: // CONSTRUCTORS + + CMusEngReceiveSession(); + + void ConstructL(); + + protected: // HELPERS + + CMceInSession* InSession(); + + void PrepareToRequire100RelL( + TMceTransactionDataContainer* aContainer ); + + virtual void CompleteSessionStructureL(); + + /** + * Parse P-Asserted-Identity header. + * Tries to fetch the telephone number from tel uri, + * if tel uri not found it suppose that telephone number + * is in sip url. + */ + void ParseAssertedIdentity( TMceTransactionDataContainer* aContainer ); + /* + * Checks for buffering event happened & receiving already not started + * If yes, start the RTP inactivity timer and indicate to observer + * about videoplayer state change. + * else will not do anything. Bascially ignores the event. + */ + void ReceivingStarted(); + + /** + * Checks for receiving already started and display sink is enabled + * If yes ETrue else otherwise. + */ + TBool IsDisplayActive(); + + protected: // DATA + + // Set to ETrue if CMceInSession::RingL has already been called + TBool iRingLCalled; + + // identity of originator parsed form P-Asserted-Identity field + TBuf8 iIdentity; + + HBufC8* iOriginator; + + HBufC* iRemoteDisplayName; + + /// The remote video player implementing MLcVideoPlayer + CMusEngRemoteVideoPlayer* iRemoteVideoPlayer; + + TUint32 iReceivingInactivityTimeout; + + TUint8 iKeepaliveTimer; + + private: + /* Flag for whether receiving started. It will go EFalse + * when RTP inactivity timeout happen. + */ + TBool iReceiving; + /* Flag to indicate buffering event happened. This flag is for + * optimization purpose since buffering event is the only place + * we can be sure about some packets were received. + */ + TBool iBuffered; + }; + +#endif + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/inc/musengremotevideoplayer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/inc/musengremotevideoplayer.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,58 @@ +/* +* 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 MUSHENGREMOTEVIDEOPLAYER_H +#define MUSHENGREMOTEVIDEOPLAYER_H + +// INCLUDES +#include +#include "musengvideoplayerbase.h" + +// FORWARD DECLARATIONS +class CMceSession; +class MLcWindow; +class MLcAudioControl; + +// CLASS DECLARATION +class CMusEngRemoteVideoPlayer : public CMusEngVideoPlayerBase + { + public: // Constructors and destructor + + static CMusEngRemoteVideoPlayer* NewL( MMusEngDisplayHandler& aDisplayHandler, + MLcAudioControl& aLcAudioControl ); + + ~CMusEngRemoteVideoPlayer(); + + + public: // from CMusEngVideoPlayerBase + + TLcVideoPlayerState LcVideoPlayerState() const; + + TBool LcIsPlayingL(); + + private: // Constructors + + CMusEngRemoteVideoPlayer( MMusEngDisplayHandler& aDisplayHandler, + MLcAudioControl& aLcAudioControl ); + void ConstructL(); + + private: // Data + + }; + +#endif // MUSHENGREMOTEVIDEOPLAYER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/inc/musengsessiondurationtimer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/inc/musengsessiondurationtimer.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,109 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef _MUSENGSESSIONDURATIONTIMER_H_ +#define _MUSENGSESSIONDURATIONTIMER_H_ + + +// USER INCLUDES +#include "musunittesting.h" + +// KERNEL INCLUDES +#include + +// FORWARD DECLERATIONS +class MMusEngSessionDurationTimerObserver; + +class CMusEngSessionDurationTimer : public CActive + { + MUS_UNITTEST( UT_CMusEngSessionDurationTimer ) + + public: + + /** + * + * @since S60 v3.2 + */ + static CMusEngSessionDurationTimer* NewL( + MMusEngSessionDurationTimerObserver& aObserver ); + + /** + * + * @since S60 v3.2 + */ + ~CMusEngSessionDurationTimer(); + + + public: // API + + /** + * + * @since S60 v3.2 + */ + void Start( TInt aDelay ); + + + private: + + /** + * + * @since S60 v3.2 + */ + CMusEngSessionDurationTimer( + MMusEngSessionDurationTimerObserver& aObserver ); + + /** + * + * @since S60 v3.2 + */ + void ConstructL(); + + + private: // inherited from CActive + + /** + * + * @since S60 v3.2 + */ + void RunL(); + + /** + * + * @since S60 v3.2 + */ + void DoCancel(); + + + private: // DATA + + /** + * + * @since S60 v3.2 + */ + RTimer iTimer; + + /** + * + * @since S60 v3.2 + */ + MMusEngSessionDurationTimerObserver& iObserver; + + }; + +#endif // _MUSENGSESSIONDURATIONTIMER_H_ + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/inc/musengsessiondurationtimerobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/inc/musengsessiondurationtimerobserver.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef _MUSENGSESSIONDURATIONTIMEROBSERVER_H_ +#define _MUSENGSESSIONDURATIONTIMEROBSERVER_H_ + + +class MMusEngSessionDurationTimerObserver + { + public: + virtual void UpdateTimerEvent() = 0; + }; + +#endif // _MUSENGSESSIONDURATIONTIMEROBSERVER_H_ \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/inc/musengsessionmanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/inc/musengsessionmanager.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,76 @@ +/* +* 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 CMUSENGSESSIONMANAGER_H +#define CMUSENGSESSIONMANAGER_H + +// INCLUDES +#include "musunittesting.h" +#include "muspropertyobserver.h" +#include +#include + +// FORWARD DECLARATIONS +class MLcSession; +class CMusEngMceSession; +class MLcUiProvider; +class CMusPropertyWatch; + + +class CMusEngSessionManager : public CLcEngine, public MMusPropertyObserver + { + public: + + static CMusEngSessionManager* NewL(); + ~CMusEngSessionManager(); + + public: // From CLcEngine + + MLcSession& Session(); + + TBool IsFeatureSupported( TLcFeature aLcFeature ); + + public: // From MMusPropertyObserver + + virtual void PropertyChanged( const TUint aKey, const TInt aValue ); + + virtual void HandlePropertyError( const TInt aReason ); + + private: // Constructors + + CMusEngSessionManager(); + void ConstructL(); + + private: // New functions + + CMusEngMceSession* CreateMusSessionL( + MultimediaSharing::TMusUseCase aUseCase ); + + private: // Data + + CMusEngMceSession* iSession; + + CMusPropertyWatch* iUseCaseWatch; + + MultimediaSharing::TMusUseCase iCurrentUseCase; + + MUS_UNITTEST( UT_CMusEngSessionManager ) + }; + +#endif // CMUSENGSESSIONMANAGER_H + +// end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/inc/musengtelephoneutils.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/inc/musengtelephoneutils.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,182 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef MUSENGTELEPHONEUTILS_H +#define MUSENGTELEPHONEUTILS_H + + +#include "musunittesting.h" + +// SYSTEM +#include +#include +#include +#include + +// FORWARD DECLARATIONS +class CRepository; +class CTelephonyAudioRouting; +class CPhCltCommandHandler; +class MMusEngAudioRoutingObserver; + +/** +* Utility class to handle all phone related requests: +* Audio routing, volume control and microphone muting. +*/ +class CMusEngTelephoneUtils : public CActive, + public MTelephonyAudioRoutingObserver + { + MUS_UNITTEST( UT_CMusEngTelephoneUtils ) + MUS_UNITTEST( UT_CMusEngSession ) + + public: + + /** + * + */ + static CMusEngTelephoneUtils* NewL( + MMusEngAudioRoutingObserver& aAudioRoutingObserver ); + + /** + * + */ + ~CMusEngTelephoneUtils(); + + public: // API + + /** + * Checks if audio routing can be changed using LoudspeakerL + * + * @return ETrue if audio routing can be changed using LoudspeakerL + */ + TBool AudioRoutingCanBeChanged(); + + /** + * Changes the audio routing between loudspeaker and handset. + */ + void LoudspeakerL( TBool aEnable ); + + /** + * + */ + TBool IsLoudSpeakerEnabled() const; + + /** + * + */ + TInt GetVolumeL() const; + + /** + * + */ + void SetVolumeL( TInt aVolume ); + + /** + * Mutes CS call microphone. + */ + void MuteMicL( TBool aMute ); + + /** + * Returns current CS call mic mute state. + */ + TBool IsMicMutedL(); + + private: // inherited from CActive + + /** + * + */ + void RunL(); + + /** + * Cancels outstanding request to phone client + */ + void DoCancel(); + + + private: // MTelephonyAudioRoutingObserver functions + + /** + * Available outputs have changed + */ + void AvailableOutputsChanged( + CTelephonyAudioRouting& aTelephonyAudioRouting ); + + /** + * Some other application has changed audio output routing + */ + void OutputChanged( + CTelephonyAudioRouting& aTelephonyAudioRouting ); + + /** + * Our request to change audio output routing has completed + */ + void SetOutputComplete( + CTelephonyAudioRouting& aTelephonyAudioRouting, + TInt aError ); + + private: + + /** + * Default C++ constructor + */ + CMusEngTelephoneUtils( + MMusEngAudioRoutingObserver& aAudioRoutingObserver ); + + /** + * 2nd phase constructor + */ + void ConstructL(); + + + private: // HELPER + + /** + * Checks that volume value is between 1 and 10. + * + * @return validated volume value + */ + TInt ValidateVolume( const TInt aVolume ) const; + + + private: // DATA + + MMusEngAudioRoutingObserver& iAudioRoutingObserver; + + /** + * Stores the audio routing state at startup. + */ + CTelephonyAudioRouting::TAudioOutput iAudioOutputAtStartup; + + /** + * Telephony audio routing instance. Owned. + */ + CTelephonyAudioRouting* iTelephonyAudioRouting; + + /** + * Central repository. Owned. + */ + CRepository* iRepository; + + /** + * Command handler for muting the microphone + */ + CPhCltCommandHandler* iPhoneCommandHandler; + }; + +#endif // MUSENGTELEPHONEUTILS_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/inc/musengtwowayrecvsession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/inc/musengtwowayrecvsession.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,143 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef MUSHENGTWOWAYRECVSESSION_H +#define MUSHENGTWOWAYRECVSESSION_H + +// USER +#include "musengreceivesession.h" +#include "musunittesting.h" +#include "mussettings.h" +#include "musengcamerahandler.h" + +// SYSTEM +#include + +// FORWARD DECLARATIONS +class CMceDisplaySink; +class CMceStreamBundle; +class CMusEngLiveVideoPlayer; + + +class CMusEngTwoWayRecvSession : public CMusEngReceiveSession + { + MUS_UNITTEST( UT_CMusEngTwoWayRecvSession ) + + + public: + /** + * Creates new MultimediaSharing two-way receive session. + * @return CMusEngTwoWayRecvSession* New instanse of specified class + */ + static CMusEngTwoWayRecvSession* NewL(); + + public: + + /** + * Destructor + */ + ~CMusEngTwoWayRecvSession(); + + public: + + void EnableDisplayL( TBool aEnable ); + + TBool IsDisplayEnabled(); + + CMusEngMceSession::TDisplayOrientation OrientationL(); + + void SetOrientationL( TDisplayOrientation aOrientation ); + + public: + + /** + * Sets both remote (receiving video) and local (viewfinder) rects. + * + */ + void SetRectsL( const TRect& aRemoteRect, + const TRect& aLocalRect ); + + /** + * Gets camera handler (can be used for zooming etc.) + */ + TMusEngCameraHandler& Camera(); + + public: // from MLcSession + + MLcVideoPlayer* LocalVideoPlayer(); + + protected: // From CMusEngReceiveSession + + /** + * Sets local rect (viewfinder). + * + */ + void SetSecondaryRectL( const TRect& aSecondaryRect ); + + /** + * Gets local rect (viewfinder). + * + */ + TRect SecondaryRect() const; + + void CompleteSessionStructureL(); + + void RectChangedL(); + + private: + + /** + * Constructor + */ + CMusEngTwoWayRecvSession(); + + /** + * Second-phase constructor + */ + void ConstructL(); + + private: + + void CompleteSessionStructureAudioPartL( + const RPointerArray& aStreams, + CMceStreamBundle& aLocalBundle, + CMceMediaStream* aVideoInStream, + CMceMediaStream* aVideoOutStream ); + + void CompleteSessionStructureInStreamL( CMceMediaStream& aVideoInStream, + CMceStreamBundle& aLocalBundle ); + + void CompleteSessionStructureOutStreamL( CMceMediaStream& aVideoOutStream ); + + + private: + + TRect iLocalRect; + + TMusEngCameraHandler iCameraHandler; + + /// The live video player implementing MLcVideoPlayer + CMusEngLiveVideoPlayer* iLiveVideoPlayer; + + TRect iSetRemoteRect; + TRect iSetLocalRect; + + }; + +#endif + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/inc/musengtwowaysession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/inc/musengtwowaysession.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,179 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef MUSHENGTWOWAYSESSION_H +#define MUSHENGTWOWAYSESSION_H + +// USER +#include "musenglivesession.h" +#include "musunittesting.h" +#include "mussettings.h" + +// SYSTEM +#include + +// FORWARD DECLARATIONS +class MMusEngLiveSessionObserver; +class CMceDisplaySink; +class MMusEngTwoWaySessionObserver; +class CMusEngRemoteVideoPlayer; + + +class CMusEngTwoWaySession : public CMusEngLiveSession + { + MUS_UNITTEST( UT_CMusEngOutSession ) + MUS_UNITTEST( UT_CMusEngTwoWaySession ) + + + public: + /** + * Creates new MultimediaSharing Live session. + * @return CMusEngTwoWaySession* New instanse of specified class + */ + static CMusEngTwoWaySession* NewL(); + + + public: + + /** + * Destructor + */ + ~CMusEngTwoWaySession(); + + public: + + void EnableDisplayL( TBool aEnable ); + + void SetOrientationL( TDisplayOrientation aOrientation ); + + public: + + /** + * Sets both remote (receiving video) and local (viewfinder) rects. + * + */ + void SetRectsL( const TRect& aRemoteRect, + const TRect& aLocalRect ); + + public: // From MLcSession + + MLcVideoPlayer* RemoteVideoPlayer(); + + public: // from MLcFileControl + + void EnableLcFileL( TBool aEnable ); + + protected: // inherited from CMusEngMceOutSession + + /** + * Sets local rect (viewfinder). + * + */ + void SetSecondaryRectL( const TRect& aSecondaryRect ); + + /** + * Gets local rect (viewfinder). + * + */ + TRect SecondaryRect() const; + + /** + * + */ + TBool IsDisplayEnabled(); + + /** + * Checks if displaying remote video. + * + */ + TBool IsDisplayActive(); + + void RectChangedL(); + + /** + * @param aLocalBundle All local streams are supposed to be added to + * this bundle + */ + void CompleteSessionStructureL( CMceStreamBundle& aLocalBundle ); + + void AddDisplayL( CMceMediaStream& aStream ); + + void CreateMceSessionStructureL( TBool aForceSdpBandwidth = + EFalse ); + + + protected: // overrides ancestor class versions + + /** + * The state of the session has changed + * @param aSession, the session that has changed. + */ + virtual void HandleSessionStateChanged( CMceSession& aSession, + TInt aStatusCode, + const TDesC8& aReasonPhrase ); + + /** + * Sets Multimediasharing specific video codec settings like video + * bitrate maxbitrate. This functions gets called for every video codec + * in session. This function overrides function in ancestor classes. + * Function calls also overridden version. + */ + virtual void AdjustVideoCodecL( CMceVideoCodec& aVideoCodec, + TMceSourceType aSourceType ); + + private: // from MMceStreamObserver, + // overrides the function in CMusEngMceSession + + void StreamStateChanged( CMceMediaStream& aStream ); + + void InactivityTimeout( CMceMediaStream& aStream, + CMceRtpSource& aSource ); + + private: + + /** + * Constructor + */ + CMusEngTwoWaySession(); + + /** + * Second-phase constructor + */ + void ConstructL(); + + private: + + void ReceivingStarted(); + + private: // Data + + TRect iLocalRect; + + TBool iReceiving; + + TBool iBuffered; + + /// The remote video player implementing MLcVideoPlayer + CMusEngRemoteVideoPlayer* iRemoteVideoPlayer; + + TRect iSetRemoteRect; + TRect iSetLocalRect; + }; + +#endif + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/inc/musenguriparser.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/inc/musenguriparser.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,101 @@ +/* +* 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: Parser for recipient's address +* +*/ + + +#ifndef MUSENGURIPARSER_H +#define MUSENGURIPARSER_H + +// INCLUDES + +#include "musunittesting.h" +#include + +const TInt KMaxUriLength = 512; +_LIT8( KMusEngAtSign, "@" ); +_LIT8( KMusEngPlusSign, "+" ); +_LIT8( KMusEngSipPrefix, "sip:" ); +_LIT8( KMusEngSipsPrefix, "sips:" ); +_LIT8( KMusEngTelPrefix, "tel:" ); + +// CLASS DECLARATION + +/** +* +*/ +class TMusEngUriParser + { + MUS_UNITTEST( UT_TMusEngUriParser ) + + public: + + enum TMusEngUriType + { + ENotParsed = 0, + ESip, + ETel + }; + + public: + + /** + * Default constructor + */ + TMusEngUriParser( const TDesC16& aUri ); + + /** + * @returns Uri type + */ + TMusEngUriType UriType(); + + /** + * @returns Parsed and validated 8-bit version of contained URI + * Ownership is transferred + * @pre UriType() != ENotParsed + * @leave KErrNotReady if precondition is not fulfilled + */ + HBufC8* GetUri8L(); + + /** + * @param aPrefix if ETrue, also sip: or tel:prefix is returned + * @returns Parsed and validated 16-bit version of contained URI + * Ownership is transferred + * @pre UriType() != ENotParsed + * @leave KErrNotReady if precondition is not fulfilled + */ + HBufC16* GetUri16L( TBool aPrefix ); + + /** + * Parses and validates contained URI + * @leave KErrCorrupt if URI is not valid SIP or TEL URI + * @post UriType() != ENotParsed + */ + void ParseUriL(); + + + private: + + void HandleSipUriL(); + void HandleTelUriL(); + void HandleLocalTelUriL(); + + private: // Data + + TBuf8 iUri; + TMusEngUriType iUriType; + }; + +#endif // MUSENGURIPARSER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/inc/musengvideoplayerbase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/inc/musengvideoplayerbase.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,93 @@ +/* +* 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 MUSHENGVIDEOPLAYERBASE_H +#define MUSHENGVIDEOPLAYERBASE_H + +// INCLUDES +#include +#include +#include + +// FORWARD DECLARATIONS +class CMceSession; +class TMusEngCameraHandler; +class MMusEngDisplayHandler; + +// CLASS DECLARATION +class CMusEngVideoPlayerBase : + public CBase, public MLcVideoPlayer, public MLcWindow + { + public: // Constructors and destructor + + ~CMusEngVideoPlayerBase(); + + public: // New functions + + void SetMceSession( CMceSession* aMceSession ); + + public: // From MLcVideoPlayer + + virtual void LcPlayL( TLcVideoPlayerSource aSource=ECameraSource ); + + virtual void LcPauseL(); + + MLcWindow* LcWindow(); + + virtual MLcCameraControl* LcCameraControl(); + + virtual MLcSourceFileControl* LcSourceFileControl(); + + virtual MLcDestinationFileControl* LcDestinationFileControl(); + + MLcAudioControl* LcAudioControl(); + + virtual MLcZoomControl* LcZoomControl(); + + virtual 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 + + CMusEngVideoPlayerBase( + MMusEngDisplayHandler& aDisplayHandler, + MLcAudioControl& aLcAudioControl ); + + protected: // Data + + MMusEngDisplayHandler& iDisplayHandler; + MLcAudioControl& iLcAudioControl; + + CMceSession* iMceSession; // Not owned + }; + +#endif // MUSHENGVIDEOPLAYERBASE_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/inc/mussipprofilehandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/inc/mussipprofilehandler.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,215 @@ +/* +* 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: +* Version : %version: 6.1.4 % << Don't touch! Updated by Synergy at check-out. +* +*/ + + + +#ifndef MUSSIPPROFILEHANDLER_H +#define MUSSIPPROFILEHANDLER_H + + +// INTERNAL INCLUDE +#include "musunittesting.h" + +// SYSTEM INCLUDE +#include +#include +#include +#include +#include + + +class CSIPProfile; +class CSIPProfileRegistry; +class CSipProfileAlrController; +class CUri8; +class MMusSipProfileUser; + +/** +* +* @lib musengine.lib +*/ +class CMusSipProfileHandler : public CBase, + public MSIPProfileRegistryObserver, + public MSIPObserver, + public MSIPConnectionObserver, + public MSipProfileAlrObserver + { + MUS_UNITTEST( UT_CMusEngSipProfileHandler ) + + public: + + /** + * Creates new instance of CMusSipProfileHandler + * @param aSipProfileId profile id of requested profile + */ + static CMusSipProfileHandler* NewL( MMusSipProfileUser& aUser ); + + /** + * Destructor + * + */ + ~CMusSipProfileHandler(); + + + public: // API + + /** + * Creates the SIP profile used. + * @param aSipProfileId profile ID of requested SIP profile + */ + void CreateProfileL( TUint32 aSipProfileId ); + + /** + * Returns the used SIP profile. + * @pre SipProfileL has been called + * @return SIP profile or NULL if the SIP profile cannot be found, + * The ownership is not transferred. + */ + CSIPProfile* Profile(); + + /** + * Returns the registered public user identity of the used SIP profile + * @pre SipProfileL has been called + * @return a pointer to the URI, the ownership is transferred + */ + CUri8* UserFromProfileLC(); + + /** + * Refreshes the availabilities of the access points + * for the used SIP profile. + * Should be called when a MuS session terminates. + */ + void RefreshIapAvailabilities(); + + /** + * @return ETrue if SIP profile returned by Profile() is registered + */ + TBool IsRegistered(); + + + private: + + /** + * Constructor + */ + CMusSipProfileHandler( MMusSipProfileUser& aUser ); + + /** + * Second-phase constructor + */ + void ConstructL(); + + private: // From MSIPProfileRegistryObserver + + /** + * An event related to SIP Profile has accorred + * + * @param aProfileId a profile Id + * @param aEvent an occurred event + **/ + void ProfileRegistryEventOccurred( + TUint32 aProfileId, + MSIPProfileRegistryObserver::TEvent aEvent ); + + /** + * An asynchronous error has occurred related to SIP profile + * Event is send to those observers, who have the + * corresponding profile instantiated. + * + * @param aProfileId the id of failed profile + * @param aError an occurred error + */ + void ProfileRegistryErrorOccurred( + TUint32 aProfileId, + TInt aError ); + + private: // From MSIPObserver + + void IncomingRequest( TUint32 aIapId, + CSIPServerTransaction* aTransaction ); + + void TimedOut( CSIPServerTransaction& aTransaction ); + + private: // MSIPConnectionObserver must be implemented to enable SIP profile + + void IncomingRequest (CSIPServerTransaction* aTransaction ); + + void IncomingRequest (CSIPServerTransaction* aTransaction, + CSIPDialog& aDialog ); + + void IncomingResponse (CSIPClientTransaction& aTransaction ); + + void IncomingResponse ( CSIPClientTransaction& aTransaction, + CSIPDialogAssocBase& aDialogAssoc ); + + void IncomingResponse ( CSIPClientTransaction& aTransaction, + CSIPInviteDialogAssoc* aDialogAssoc ); + + void IncomingResponse( CSIPClientTransaction& aTransaction, + CSIPRegistrationBinding& aRegistration ); + + void ErrorOccured( TInt aError, CSIPTransactionBase& aTransaction ); + + void ErrorOccured( TInt aError, + CSIPClientTransaction& aTransaction, + CSIPRegistrationBinding& aRegistration ); + + void ErrorOccured( TInt aError, + CSIPTransactionBase& aTransaction, + CSIPDialogAssocBase& aDialogAssoc ); + + void ErrorOccured( TInt aError, CSIPRefresh& aSIPRefresh ); + + void ErrorOccured( TInt aError, + CSIPRegistrationBinding& aRegistration ); + + void ErrorOccured( TInt aError, CSIPDialogAssocBase& aDialogAssoc ); + + void InviteCompleted( CSIPClientTransaction& aTransaction ); + + void InviteCanceled( CSIPServerTransaction& aTransaction ); + + void ConnectionStateChanged( CSIPConnection::TState aState ); + + private: // From MSipProfileAlrObserver + + void AlrEvent( MSipProfileAlrObserver::TEvent aEvent, + TUint32 aProfileId, + TUint32 aSnapId, + TUint32 aIapId ); + + void AlrError( TInt aError, + TUint32 aProfileId, + TUint32 aSnapId, + TUint32 aIapId ); + + private: // New functions + + TUint32 ProfileId() const; + + private: // DATA + + MMusSipProfileUser& iUser; + CSIP* iSip; + CSIPProfileRegistry* iProfileRegistry; + CSipProfileAlrController* iProfileAlrController; + CSIPProfile* iSipProfile; + }; + + +#endif // MUSSIPPROFILEHANDLER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/inc/mussipprofileuser.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/inc/mussipprofileuser.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,48 @@ +/* +* 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 MUSSIPPROFILEUSER_H +#define MUSSIPPROFILEUSER_H + +// SYSTEM INCLUDE +#include + +/** +* Callbacks for asking permission to roam between access points +* and notifying client about registering event +* @lib musengine.lib +*/ +class MMusSipProfileUser + { + public: + + /** + * Checks whether roaming between access points is allowed. + * @return ETrue is roaming is allowed, otherwise EFalse. + */ + virtual TBool IsRoamingBetweenAPsAllowed() = 0; + + /** + * Indicates that SIP profile has been registered. + */ + virtual void ProfileRegistered() = 0; + + }; + + +#endif // MUSSIPPROFILEUSER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/src/musengcamerahandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/src/musengcamerahandler.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,681 @@ +/* +* Copyright (c) 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: +* +*/ + + +// USER +#include "musengcamerahandler.h" +#include "musunittesting.h" +#include "musengmceutils.h" +#include "musenglogger.h" + +// SYSTEM +#include +#include +#include +#include +#include +#include +#include + +const TInt KMaxBrightness = 100; +const TInt KMinBrightness = -100; +const TInt KBrightnessStepSize = 10; + + +//Number of big and small zoom steps on Zoom scale +const TInt KZoomBigStepCount = 15; +const TInt KZoomSmallStepCount = KZoomBigStepCount*2; +const TInt KZoomStepMinSize = 1; + +const TInt64 KZoomFasterTime = 333333; // 1/3 second + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TMusEngCameraHandler::TMusEngCameraHandler() : + iSession( NULL ), + iDefaultBrightness( 0 ), + iZoomInTime(0), + iZoomOutTime(0), + iSmallZoomStep( KZoomStepMinSize ), + iBigZoomStep( KZoomStepMinSize ), + iCurrentCamera( TMusEngCameraHandler::ECameraNotAvailable ), + iCameraUsage( MusSettingsKeys::EUseCameraSwapping ) + { + } + +// ----------------------------------------------------------------------------- +// From MLcCameraControl +// ----------------------------------------------------------------------------- +// +TInt TMusEngCameraHandler::LcCameraCountL() + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::LcCameraCountL()" ) + __ASSERT_ALWAYS( iSession != NULL, User::Leave( KErrNotReady ) ); + + CMceCameraSource* camera = MusEngMceUtils::GetCameraL( *iSession ); + __ASSERT_ALWAYS( camera != NULL, User::Leave( KErrNotReady ) ); + TInt camerasAvailable = camera->CamerasAvailable(); + + if ( camerasAvailable > 1 && + iCameraUsage != MusSettingsKeys::EUseCameraSwapping ) + { + camerasAvailable = 1; + } + + MUS_LOG1( "mus: [ENGINE] <- TMusEngCameraHandler::LcCameraCountL()", + camerasAvailable ); + return camerasAvailable; + } + +// ----------------------------------------------------------------------------- +// From MLcCameraControl +// ----------------------------------------------------------------------------- +// +TInt TMusEngCameraHandler::CurrentLcCameraIndex() + { + return iCurrentCamera; + } + +// ----------------------------------------------------------------------------- +// From MLcCameraControl +// ----------------------------------------------------------------------------- +// +void TMusEngCameraHandler::ToggleLcCameraL() + { + TCurrentCamera newCamera( TMusEngCameraHandler::EBackCamera ); + if ( iCurrentCamera == TMusEngCameraHandler::EBackCamera ) + { + newCamera = TMusEngCameraHandler::EFrontCamera; + } + ChangeCameraL( newCamera ); + } + +// ----------------------------------------------------------------------------- +// From MLcBrightnessControl +// ----------------------------------------------------------------------------- +// +TInt TMusEngCameraHandler::MinLcBrightnessL() + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::MinLcBrightnessL()" ) + + // minimum brightness is not in camera info, but a constant + + MUS_LOG1( "mus: [ENGINE] <- TMusEngCameraHandler::MinLcBrightnessL(): %d", + KMinBrightness ) + + return KMinBrightness; + } + +// ----------------------------------------------------------------------------- +// From MLcBrightnessControl +// ----------------------------------------------------------------------------- +// +TInt TMusEngCameraHandler::MaxLcBrightnessL() + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::MaxLcBrightnessL()" ) + + // maximum brightness is not in camera info, but a constant + + MUS_LOG1( "mus: [ENGINE] <- TMusEngCameraHandler::MaxLcBrightnessL(): %d", + KMaxBrightness ) + + return KMaxBrightness; + } + +// ----------------------------------------------------------------------------- +// From MLcBrightnessControl +// ----------------------------------------------------------------------------- +// +TInt TMusEngCameraHandler::LcBrightnessL() + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::LcBrightnessL()" ) + + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + CMceCameraSource* camera = MusEngMceUtils::GetCameraL( *iSession ); + TInt brightness = camera->BrightnessL(); + + MUS_LOG1( "mus: [ENGINE] <- TMusEngCameraHandler::LcBrightnessL(): %d", + brightness ) + + return brightness; + } + +// ----------------------------------------------------------------------------- +// From MLcBrightnessControl +// ----------------------------------------------------------------------------- +// +void TMusEngCameraHandler::SetLcBrightnessL( TInt aValue ) + { + MUS_LOG1( "mus: [ENGINE] -> TMusEngCameraHandler::SetLcBrightnessL( %d )", + aValue ) + + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + CMceCameraSource* camera = MusEngMceUtils::GetCameraL( *iSession ); + camera->SetBrightnessL( aValue ); + + MUS_LOG( "mus: [ENGINE] <- TMusEngCameraHandler::SetLcBrightnessL()" ) + } + +// ----------------------------------------------------------------------------- +// From MLcBrightnessControl +// ----------------------------------------------------------------------------- +// +void TMusEngCameraHandler::IncreaseLcBrightnessL() + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::IncreaseLcBrightnessL()" ) + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + CMceCameraSource* camera = MusEngMceUtils::GetCameraL( *iSession ); + + TInt newBrightness = camera->BrightnessL() + KBrightnessStepSize; + + if ( newBrightness < KMaxBrightness ) + { + camera->SetBrightnessL( newBrightness ); + } + else + { + camera->SetBrightnessL( KMaxBrightness ); + } + + MUS_LOG( "mus: [ENGINE] <- TMusEngCameraHandler::IncreaseLcBrightnessL()" ) + } + +// ----------------------------------------------------------------------------- +// From MLcBrightnessControl +// ----------------------------------------------------------------------------- +// +void TMusEngCameraHandler::DecreaseLcBrightnessL() + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::DecreaseLcBrightnessL()" ) + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + CMceCameraSource* camera = MusEngMceUtils::GetCameraL( *iSession ); + + TInt newBrightness = camera->BrightnessL() - KBrightnessStepSize; + + if ( newBrightness > KMinBrightness ) + { + camera->SetBrightnessL( newBrightness ); + } + else + { + camera->SetBrightnessL( KMinBrightness ); + } + + MUS_LOG( "mus: [ENGINE] <- TMusEngCameraHandler::DecreaseLcBrightnessL()" ) + } + +// ----------------------------------------------------------------------------- +// From MLcZoomControl +// ----------------------------------------------------------------------------- +// +TInt TMusEngCameraHandler::MinLcZoomL() + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::MinLcZoomL()" ) + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + // Although we do not need camera for return value, we have to have it in + // order to have proper iCameraInfo + MusEngMceUtils::GetCameraL( *iSession ); + + MUS_LOG1( "mus: [ENGINE] <- TMusEngCameraHandler::MinLcZoomL( %d )", + iCameraInfo.iMinZoom ) + + return iCameraInfo.iMinZoom; + } + +// ----------------------------------------------------------------------------- +// From MLcZoomControl +// ----------------------------------------------------------------------------- +// +TInt TMusEngCameraHandler::MaxLcZoomL() + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::MaxLcZoomL()" ) + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + // Although we do not need camera for return value, we have to have it in + // order to have proper iCameraInfo + MusEngMceUtils::GetCameraL( *iSession ); + + TInt maxZoom = iCameraInfo.iMaxZoom + iCameraInfo.iMaxDigitalZoom; + + MUS_LOG1( "mus: [ENGINE] Max optical zoom( %d )", + iCameraInfo.iMaxZoom ) + MUS_LOG1( "mus: [ENGINE] Max digital zoom( %d )", + iCameraInfo.iMaxDigitalZoom ) + MUS_LOG1( "mus: [ENGINE] <- TMusEngCameraHandler::MaxLcZoomL( %d )", + maxZoom ) + + return maxZoom; + } + +// ----------------------------------------------------------------------------- +// From MLcZoomControl +// ----------------------------------------------------------------------------- +// +TInt TMusEngCameraHandler::LcZoomValueL() + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::LcZoomValueL" ) + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + CMceCameraSource* camera = MusEngMceUtils::GetCameraL( *iSession ); + + TInt currentZoom = camera->ZoomFactorL() + camera->DigitalZoomFactorL(); + + MUS_LOG1( "mus: [ENGINE] <- TMusEngCameraHandler::LcZoomValueL( %d )", + currentZoom ) + + return currentZoom; + } + +// ----------------------------------------------------------------------------- +// From MLcZoomControl +// ----------------------------------------------------------------------------- +// +void TMusEngCameraHandler::SetLcZoomValueL( TInt aValue ) + { + MUS_LOG1( "mus: [ENGINE] -> TMusEngCameraHandler::SetLcZoomValueL( %d )", + aValue ) + + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + __ASSERT_ALWAYS( aValue <= MaxLcZoomL() && aValue >= MinLcZoomL(), + User::Leave( KErrArgument ) ); + + CMceCameraSource* camera = MusEngMceUtils::GetCameraL( *iSession ); + + if ( aValue <= iCameraInfo.iMaxZoom ) + { + MUS_LOG( "mus: [ENGINE] Optical zoom factor increased" ) + camera->SetZoomFactorL( aValue ); + } + + if ( aValue - iCameraInfo.iMaxZoom > 0 ) + { + camera->SetDigitalZoomFactorL( aValue - iCameraInfo.iMaxZoom ); + MUS_LOG1( "mus: [ENGINE] Digital zoom factor increased to %d", + aValue - iCameraInfo.iMaxZoom ) + } + + MUS_LOG( "mus: [ENGINE] <- MusEngCameraHandler::SetLcZoomValueL()" ) + } + +// ----------------------------------------------------------------------------- +// From MLcZoomControl +// ----------------------------------------------------------------------------- +// +void TMusEngCameraHandler::LcZoomInL() + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::LcZoomInL()" ) + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + CMceCameraSource* camera = MusEngMceUtils::GetCameraL( *iSession ); + + // First try to increase optical zoom factor. If in maximum value, try to + // increase digital zoom factor. + TInt stepSize = ZoomStepSize( iZoomInTime ); + TInt zoomFactor = camera->ZoomFactorL(); + TInt zoomDigitalFactor = camera->DigitalZoomFactorL(); + + //increate optical zoom factor + if ( zoomFactor + stepSize <= iCameraInfo.iMaxZoom ) + { + //optical zoom factor is enough + camera->SetZoomFactorL( zoomFactor + stepSize ); + stepSize = 0; + } + else if (zoomFactor < iCameraInfo.iMaxZoom) + { + stepSize -= iCameraInfo.iMaxZoom - zoomFactor; + camera->SetZoomFactorL( iCameraInfo.iMaxZoom ); + } + + //increate digital zoom factor + if (stepSize > 0) + { + if ( zoomDigitalFactor + stepSize <= iCameraInfo.iMaxDigitalZoom ) + { + camera->SetDigitalZoomFactorL( zoomDigitalFactor + stepSize ); + } + else + { + camera->SetDigitalZoomFactorL( iCameraInfo.iMaxDigitalZoom ); + MUS_LOG( "mus: [ENGINE] TMusEngCameraHandler::ZoomInL(): \ + Optical and digital zoom factors are in maximum value" ) + } + } + + MUS_LOG( "mus: [ENGINE] <- TMusEngCameraHandler::LcZoomInL()" ) + } + +// ----------------------------------------------------------------------------- +// From MLcZoomControl +// ----------------------------------------------------------------------------- +// +void TMusEngCameraHandler::LcZoomOutL() + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::LcZoomOutL()" ) + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + CMceCameraSource* camera = MusEngMceUtils::GetCameraL( *iSession ); + + // First try to decrease digital zoom factor. If already zero, try to + // decrease optical zoom factor. + TInt stepSize = ZoomStepSize( iZoomOutTime ); + TInt zoomFactor = camera->ZoomFactorL(); + TInt zoomDigitalFactor = camera->DigitalZoomFactorL(); + + //decreate digital zoom factor firstly + if ( zoomDigitalFactor - stepSize >= 0 ) + { + //digital zoom factor is enough + camera->SetDigitalZoomFactorL( zoomDigitalFactor - stepSize ); + stepSize = 0; + } + else if ( zoomDigitalFactor > 0 ) + { + stepSize -= zoomDigitalFactor; + camera->SetDigitalZoomFactorL( 0 ); + MUS_LOG("mus: [ENGINE] Digigal Factor to zero") + } + + //decreate optical zoom factor firstly + if ( stepSize > 0 ) + { + if ( zoomFactor - stepSize > iCameraInfo.iMinZoom ) + { + camera->SetZoomFactorL( zoomFactor - stepSize ); + } + else + { + MUS_LOG( "mus: [ENGINE] TMusEngCameraHandler::LcZoomOutL():\ + Optical and digital zoom factors are in minimum value" ) + camera->SetZoomFactorL( iCameraInfo.iMinZoom ); + } + } + + MUS_LOG( "mus: [ENGINE] <- TMusEngCameraHandler::LcZoomOutL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void TMusEngCameraHandler::SetSession( CMceSession* aSession ) + { + iSession = aSession; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void TMusEngCameraHandler::InitializeL( CMceCameraSource& aCamera ) + { + aCamera.GetCameraInfo( iCameraInfo ); + + InitializeZoomStepSize(); + + iCurrentCamera = EBackCamera; + if ( iCameraUsage == MusSettingsKeys::EUseOnlySecondaryCamera ) + { + iCurrentCamera = EFrontCamera; + } + aCamera.SetCameraIndexL( (TInt)iCurrentCamera ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void TMusEngCameraHandler::PlayL() + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::PlayL()" ) + + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + CMceCameraSource* camera = MusEngMceUtils::GetCameraL( *iSession ); + + if ( !camera->IsEnabled() ) + { + camera->EnableL(); + } + else + { + MUS_LOG( "mus: [ENGINE] Camera already enabled, ignore request" ) + } + + MUS_LOG( "mus: [ENGINE] <- TMusEngCameraHandler::PlayL()" ) + } + + +// ----------------------------------------------------------------------------- +// Disable camera if not already disabled +// ----------------------------------------------------------------------------- +// +void TMusEngCameraHandler::PauseL() + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::PauseL()" ) + + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + CMceCameraSource* camera = MusEngMceUtils::GetCameraL( *iSession ); + + if ( camera->IsEnabled() ) + { + camera->DisableL(); + } + else + { + MUS_LOG( "mus: [ENGINE] Camera already disabled, ignore request" ) + } + + MUS_LOG( "mus: [ENGINE] <- TMusEngCameraHandler::PauseL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool TMusEngCameraHandler::IsPlayingL() + { + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + return ( MusEngMceUtils::GetCameraL( *iSession )->IsEnabled() ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void TMusEngCameraHandler::InitializeZoomStepSize() + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::InitializeZoomStepSize()" ) + MUS_LOG2( "iMaxZoom = %d, iMinZoom = %d", iCameraInfo.iMaxZoom, iCameraInfo.iMinZoom); + MUS_LOG2( "iMaxDigitalZoom = %d, iMaxDigitalZoomFactor = %d", + iCameraInfo.iMaxDigitalZoom, iCameraInfo.iMaxDigitalZoomFactor); + + iBigZoomStep = ( iCameraInfo.iMaxZoom + iCameraInfo.iMaxDigitalZoom - + iCameraInfo.iMinZoom ) / KZoomBigStepCount; + + if ( iBigZoomStep < KZoomStepMinSize ) + iBigZoomStep = KZoomStepMinSize; + + iSmallZoomStep = ( iCameraInfo.iMaxZoom + iCameraInfo.iMaxDigitalZoom - + iCameraInfo.iMinZoom ) / KZoomSmallStepCount; + + if ( iSmallZoomStep < KZoomStepMinSize ) + iSmallZoomStep = KZoomStepMinSize; + + MUS_LOG2( "mus: [ENGINE] iSmallZoomStep = %d, iBigZoomStep = %d", + iSmallZoomStep, iBigZoomStep ) + MUS_LOG( "mus: [ENGINE] <- TMusEngCameraHandler::InitializeZoomStepSize()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void TMusEngCameraHandler::ReadCameraUsageKeyL() + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::ReadCameraUsageKeyL()" ) + + // We try to read camera usage. If we do not succeed, we use default + iCameraUsage = MusSettingsKeys::EUseCameraSwapping; + TRAPD( error, + iCameraUsage = MultimediaSharingSettings::CameraUsageL() ) + __ASSERT_ALWAYS( error == KErrNone || error == KErrNotFound, + User::Leave( error ) ); + + MUS_LOG( "mus: [ENGINE] <- TMusEngCameraHandler::ReadCameraUsageKeyL()" ) + + } + +// ----------------------------------------------------------------------------- +// Calculate the zoom step based time escaped +// ----------------------------------------------------------------------------- +// +TInt TMusEngCameraHandler::ZoomStepSize( TInt64& aTime ) + { + TTime now; + now.HomeTime(); + TInt64 timeNow = now.Int64(); + TInt stepSize = ( ( timeNow - aTime ) <= KZoomFasterTime ) ? iBigZoomStep : iSmallZoomStep; + + aTime = now.Int64(); + + MUS_LOG1( "mus: [ENGINE] stepSize = %d", stepSize ); + + return stepSize; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt TMusEngCameraHandler::CamerasAvailableL( + TMusEngCameraHandler::TCurrentCamera& aCurrentCamera ) + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::CamerasAvailableL()" ) + __ASSERT_ALWAYS( iSession != NULL, User::Leave( KErrNotReady ) ); + + CMceCameraSource* camera = MusEngMceUtils::GetCameraL( *iSession ); + __ASSERT_ALWAYS( camera != NULL, User::Leave( KErrNotReady ) ); + aCurrentCamera = iCurrentCamera; + TInt camerasAvailable = camera->CamerasAvailable(); + + if ( camerasAvailable > 1 && + iCameraUsage != MusSettingsKeys::EUseCameraSwapping ) + { + camerasAvailable = 1; + } + + MUS_LOG( "mus: [ENGINE] <- TMusEngCameraHandler::CamerasAvailable()" ) + return camerasAvailable; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void TMusEngCameraHandler::ChangeCameraL( TCurrentCamera aCurrentCamera ) + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::ChangeCameraL()" ) + __ASSERT_ALWAYS( iSession != NULL, User::Leave( KErrNotReady ) ); + + CMceCameraSource* camera = MusEngMceUtils::GetCameraL( *iSession ); + CMceDisplaySink* display = MusEngMceUtils::GetDisplayL( *iSession ); + + if ( camera->CamerasAvailable() ) + { + if ( TMusEngCameraHandler::EFrontCamera == aCurrentCamera && + TMusEngCameraHandler::EFrontCamera != iCurrentCamera ) + { + MUS_LOG( "mus: [ENGINE] Set Front camera" ) + iCurrentCamera = TMusEngCameraHandler::EFrontCamera; + ChangeActiveCameraL( iCurrentCamera ); + } + else if ( TMusEngCameraHandler::EBackCamera == aCurrentCamera && + TMusEngCameraHandler::EBackCamera != iCurrentCamera ) + { + MUS_LOG( "mus: [ENGINE] Set Back camera " ) + iCurrentCamera = TMusEngCameraHandler::EBackCamera; + ChangeActiveCameraL( iCurrentCamera ); + } + else if ( TMusEngCameraHandler::ECameraNotAvailable == aCurrentCamera ) + { + if ( iCurrentCamera == TMusEngCameraHandler::EBackCamera ) + { + iCurrentCamera = TMusEngCameraHandler::EFrontCamera; + } + else + { + iCurrentCamera = TMusEngCameraHandler::EBackCamera; + } + ChangeActiveCameraL( iCurrentCamera ); + } + } + MUS_LOG( "mus: [ENGINE] <- TMusEngCameraHandler::ChangeCameraL()" ) + } + +// ----------------------------------------------------------------------------- +// Disable camera before it changes it. It enables camera after change. +// ----------------------------------------------------------------------------- +// +void TMusEngCameraHandler::ChangeActiveCameraL( TCurrentCamera aNewCamera ) + { + MUS_LOG( "mus: [ENGINE] -> ChangeActiveCamera()" ) + + CMceCameraSource* camera = MusEngMceUtils::GetCameraL( *iSession ); + CMceDisplaySink* display = MusEngMceUtils::GetDisplayL( *iSession ); + MUS_LOG( "mus: [ENGINE] Camera enabled ?" ) + if ( camera->IsEnabled() ) + { + MUS_LOG( "mus: [ENGINE] Is view finder enabled? " ) + if ( display->IsEnabled() ) + { + MUS_LOG( "mus: [ENGINE] Disable view finder" ) + display->DisableL(); + } + MUS_LOG( "mus: [ENGINE] Disable camera" ) + camera->DisableL(); + camera->SetCameraIndexL( aNewCamera ); + camera->EnableL(); + display->EnableL(); + } + else + { + if ( display->IsEnabled() ) + { + MUS_LOG( "mus: [ENGINE] Disable view finder" ) + display->DisableL(); + } + MUS_LOG( "mus: [ENGINE] set camera index" ) + camera->SetCameraIndexL( aNewCamera ); + MUS_LOG( "mus: [ENGINE] Enable camera" ) + display->EnableL(); + } + + MUS_LOG( "mus: [ENGINE] -> fetching new iCameraInfo..." ) + camera->GetCameraInfo( iCameraInfo ); + InitializeZoomStepSize(); + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/src/musengclipsession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/src/musengclipsession.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,438 @@ +/* +* Copyright (c) 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: +* +*/ + + +// USER +#include "musengclipsession.h" +#include "musengmceoutsession.h" +#include "musenglivesession.h" +#include "musengmceutils.h" +#include "musenglogger.h" +#include "musengclipvideoplayer.h" + +// SYSTEM +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +// CONSTANTS +const TInt KMusEngAmrBitRate = KMceAmrNbBitrate475; +const TUint KMusEngAllowedAmrBitrates = KMceAllowedAmrNbBitrate475; + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngClipSession* CMusEngClipSession::NewL() + { + CMusEngClipSession* self = new( ELeave )CMusEngClipSession(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngClipSession::CMusEngClipSession() + : CMusEngMceOutSession() + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngClipSession::ConstructL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngClipSession::ConstructL(...)" ) + + CMusEngMceOutSession::ConstructL(); + + iClipVideoPlayer = CMusEngClipVideoPlayer::NewL( *this, *this ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngClipSession::ConstructL(...)" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngClipSession::~CMusEngClipSession() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngClipSession::~CMusEngClipSession()" ) + + delete iClipVideoPlayer; + + MUS_LOG( "mus: [ENGINE] <- CMusEngClipSession::~CMusEngClipSession()" ) + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +MLcVideoPlayer* CMusEngClipSession::LocalVideoPlayer() + { + return iClipVideoPlayer; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngClipSession::CompleteSessionStructureL( + CMceStreamBundle& aLocalBundle ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngClipSession::CompleteSessionStructureL()" ) + + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + // Create outgoing video stream + CMceVideoStream* videoStream = CMceVideoStream::NewLC(); + + CMceRtpSink* rtpsink = CMceRtpSink::NewLC(); + videoStream->AddSinkL( rtpsink ); + CleanupStack::Pop( rtpsink ); + + CMceFileSource* fileSource = + CMceFileSource::NewLC( *iManager, iClipVideoPlayer->LcFileName() ); + fileSource->DisableL(); // Start session in pause mode. + videoStream->SetSourceL( fileSource ); + CleanupStack::Pop( fileSource ); + + iSession->AddStreamL( videoStream ); + CleanupStack::Pop( videoStream ); + + ConstructAudioStructureL( aLocalBundle ); + + iClipVideoPlayer->SetMceSession( iSession ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngClipSession::CompleteSessionStructureL()" ) + } + +// ----------------------------------------------------------------------------- +// Checks that that there is no need for transcoding before calling +// overridden base class variant of this function. +// ----------------------------------------------------------------------------- +// +void CMusEngClipSession::EstablishSessionL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngClipSession::EstablishSessionL()" ) + + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + const RPointerArray& streams = iSession->Streams(); + + if ( iVideoCodecList ) + { + MUS_LOG_TDESC8( "iVideoCodecList: ", iVideoCodecList->Des() ) + } + + CMceVideoStream* videoStream = NULL; + for ( TInt i = 0; i < streams.Count(); ++i ) + { + if ( streams[i]->State() == CMceMediaStream::ETranscodingRequired ) + { + User::Leave( KErrNotSupported ); + } + else if ( streams[i]->Type() == KMceVideo && + !IsH264Supported() ) + { + MUS_LOG( " -> video stream found!!!" ) + videoStream = static_cast( streams[i] ); + + //transcoding of H264 is not needed only if we know explicitly + //that the peer supports it (from OPTIONS response) + + const RPointerArray& codecs = videoStream->Codecs(); + for ( TInt codecIndex = 0; codecIndex < codecs.Count(); ++codecIndex ) + { + if ( codecs[codecIndex]->SdpName() == KMceSDPNameH264() ) + { + User::Leave( KErrNotSupported ); + } + } + } + } + + CMusEngMceOutSession::EstablishSessionL(); + // Now session state is right to adjust volume + SetSpeakerVolumeL( LcVolumeL() ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngClipSession::EstablishSessionL()" ) + } + +// ----------------------------------------------------------------------------- +// Implemented for MMceStreamObserver +// ----------------------------------------------------------------------------- +// +void CMusEngClipSession::StreamStateChanged( CMceMediaStream& aStream ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngClipSession::StreamStateChanged()" ) + + if ( !iSession ) + { + return; + } + + DetermineBufferingPeriod( aStream ); + + CMusEngMceSession::StreamStateChanged( aStream ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngClipSession::StreamStateChanged()" ) + } + +// ----------------------------------------------------------------------------- +// Implemented for MMceStreamObserver +// ----------------------------------------------------------------------------- +// +void CMusEngClipSession::StreamStateChanged( CMceMediaStream& aStream, + CMceMediaSource& aSource ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngClipSession::StreamStateChanged( src )" ) + + if ( !iSession ) + { + return; + } + + MUS_ENG_LOG_STREAM_STATE( aStream ) + + DetermineBufferingPeriod( aStream ); + + if ( iClipVideoPlayer->HasClipEnded() ) + { + MUS_LOG( "mus: [ENGINE] Clip ended." ) + InformObserverAboutPlayerStateChange( iClipVideoPlayer ); + } + else + { + // Cannot handle, forward to the ancestor class + CMusEngMceSession::StreamStateChanged( aStream, aSource ); + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngClipSession::StreamStateChanged( src )" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngClipSession::AddAmrCodecL( CMceAudioStream& aAudioStream ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngClipSession::AddAmrCodecL" ) + + // Remove old codecs + while ( aAudioStream.Codecs().Count() > 0 ) + { + aAudioStream.RemoveCodecL( *aAudioStream.Codecs()[0] ); + } + + // Create AMR codec instance + const RPointerArray& supportedCodecs = + iManager->SupportedAudioCodecs(); + + CMceAudioCodec* amr = NULL; + + for ( TInt i = 0; i < supportedCodecs.Count(); ++i ) + { + if ( supportedCodecs[i]->SdpName() == KMceSDPNameAMR() ) + { + amr = supportedCodecs[i]->CloneL(); + CleanupStack::PushL( amr ); + User::LeaveIfError( + amr->SetAllowedBitrates( KMusEngAllowedAmrBitrates ) ); + User::LeaveIfError( amr->SetBitrate( KMusEngAmrBitRate ) ); + aAudioStream.AddCodecL( amr ); + CleanupStack::Pop( amr ); + break; // We must have only one codec + } + } + + __ASSERT_ALWAYS( amr, User::Leave( KErrNotFound ) ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngClipSession::AddAmrCodecL" ) + } + +// ----------------------------------------------------------------------------- +// Create codec instance, H264 is used only if other end supports it for sure, +// otherwise H263 is used. +// ----------------------------------------------------------------------------- +// +void CMusEngClipSession::AddVideoCodecL( CMceVideoStream& aVideoStream ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngClipSession::AddVideoCodecL" ) + + // Remove old codecs + + while ( aVideoStream.Codecs().Count() > 0 ) + { + aVideoStream.RemoveCodecL( *aVideoStream.Codecs()[0] ); + } + + const RPointerArray< const CMceVideoCodec >& supportedCodecs = + iManager->SupportedVideoCodecs(); + + CMceVideoCodec* addedCodec = NULL; + + TPtrC8 addedCodecName = + IsH264Supported() ? KMceSDPNameH264() : KMceSDPNameH2632000(); + + MUS_LOG_TDESC8( "mus: [ENGINE] adding codec : ", addedCodecName ); + + for ( TInt i = 0; i < supportedCodecs.Count(); ++i ) + { + if ( supportedCodecs[i]->SdpName() == addedCodecName ) + { + addedCodec = supportedCodecs[i]->CloneL(); + CleanupStack::PushL( addedCodec ); + aVideoStream.AddCodecL( addedCodec ); + CleanupStack::Pop( addedCodec ); + break; // We must have only one codec + } + } + + __ASSERT_ALWAYS( addedCodec, User::Leave( KErrNotFound ) ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngClipSession::AddVideoCodecL" ) + } + +// ----------------------------------------------------------------------------- +// If member file contains audio, add appropriate amount of audio streams to +// session structure +// ----------------------------------------------------------------------------- +// +void CMusEngClipSession::ConstructAudioStructureL( + CMceStreamBundle& aLocalBundle ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngClipSession::ConstructAudioStructureL()" ) + + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + // There is no clip audio present in operator variant + if ( iOperatorVariant ) + { + MUS_LOG( " Operator variant, no audio constructed" ) + MUS_LOG( "mus: [ENGINE] <- CMusEngClipSession::ConstructAudioStructureL()" ) + return; + } + + CMceFileSource* fileSource = MusEngMceUtils::GetFileSourceL( *iSession ); + + TInt audioElementCount = fileSource->MediaElementCountL( KMceAudio ); + + MUS_LOG1( "mus: [ENGINE] File contains %d audio elements", + audioElementCount ) + + for ( TInt i = 0; i < audioElementCount; ++i ) + { + fileSource->SetCurrentMediaElementL( KMceAudio, i ); + + MUS_LOG1( "mus: [ENGINE] Current audio element set to : %d ", i ) + + // Set up an audio outstream. + CMceAudioStream* audioOut = CMceAudioStream::NewLC(); + + CMceRtpSink* rtpSink = CMceRtpSink::NewLC(); + audioOut->AddSinkL( rtpSink ); + CleanupStack::Pop( rtpSink ); + + audioOut->SetSourceL( fileSource ); + + iSession->AddStreamL( audioOut ); + CleanupStack::Pop( audioOut ); + + MUS_LOG( "mus: [ENGINE] Audio outstream created" ) + + // Set up an audio stream to local speaker + audioOut = CMceAudioStream::NewLC(); + + MusEngMceUtils::AddSpeakerL( *audioOut ); + + audioOut->SetSourceL( fileSource ); + + iSession->AddStreamL( audioOut ); + CleanupStack::Pop( audioOut ); + + MUS_LOG( "mus: [ENGINE] Local audio stream created" ) + + aLocalBundle.AddStreamL( *audioOut ); + + MUS_LOG( "mus: [ENGINE] Local audio stream added to bundle" ) + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngClipSession::ConstructAudioStructureL()" ) + } + +// ----------------------------------------------------------------------------- +// Calculates how long MCE buffers based on time between buffering and streaming +// events. +// ----------------------------------------------------------------------------- +// +void CMusEngClipSession::DetermineBufferingPeriod( CMceMediaStream& aStream ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngClipSession::DetermineBufferingPeriod()" ) + + // Determine file position modifier from time difference between buffering + // and streaming events + if ( aStream.State() == CMceMediaStream::EBuffering ) + { + iBufferingStartedTime.HomeTime(); + } + + if ( aStream.State() == CMceMediaStream::EStreaming ) + { + if ( iBufferingStartedTime.Int64() != 0 ) + { + TTime currentTime; + currentTime.HomeTime(); + + TTimeIntervalMicroSeconds bufferingPeriod = + currentTime.MicroSecondsFrom( iBufferingStartedTime ); + + const TInt KMusMinimumBufferingPeriod( 500000 ); + if ( bufferingPeriod > KMusMinimumBufferingPeriod ) + { + iClipVideoPlayer->SetBufferingPeriod( bufferingPeriod ); + } + + MUS_LOG1( "mus: [ENGINE] current buffering period:%d", + bufferingPeriod.Int64() ) + + iBufferingStartedTime = 0; + } + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngClipSession::DetermineBufferingPeriod()" ) + } + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/src/musengclipvideoplayer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/src/musengclipvideoplayer.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,535 @@ +/* +* 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: +* +*/ + +// USER +#include "musengclipvideoplayer.h" +#include "musengcamerahandler.h" +#include "musengmceutils.h" +#include "musengdisplayhandler.h" +#include "muslogger.h" + +// SYSTEM +#include +#include +#include +#include + +// CONSTANTS +const TInt64 KMicroSecondsInOneSecond = 1000000; +const TInt KFastWindingFactor = 4; + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngClipVideoPlayer* CMusEngClipVideoPlayer::NewL( + MMusEngDisplayHandler& aDisplayHandler, + MLcAudioControl& aLcAudioControl ) + { + return new( ELeave )CMusEngClipVideoPlayer( + aDisplayHandler, aLcAudioControl ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngClipVideoPlayer::CMusEngClipVideoPlayer( + MMusEngDisplayHandler& aDisplayHandler, + MLcAudioControl& aLcAudioControl ) : + CMusEngLocalVideoPlayer( aDisplayHandler, aLcAudioControl ) + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngClipVideoPlayer::~CMusEngClipVideoPlayer() + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMusEngClipVideoPlayer::HasClipEnded() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngClipVideoPlayer::HasClipEnded" ) + + TBool hasClipEnded( EFalse ); + + if ( iMceSession ) + { + CMceVideoStream* videoOut = NULL; + + TRAPD( err, + videoOut = MusEngMceUtils::GetVideoOutStreamL( *iMceSession ) ); + if ( err != KErrNone ) + { + MUS_LOG1( "mus: [ENGINE] Error in GetVideoOutStreamL %d", err ) + return EFalse; + } + + CMceFileSource* filesource = NULL; + TRAP( err, filesource = MusEngMceUtils::GetFileSourceL( *iMceSession ) ) + + if ( err == KErrNone ) + { + TTimeIntervalMicroSeconds position; + TTimeIntervalMicroSeconds duration; + TRAP( err, position = filesource->PositionL() ); + TRAPD( err2, duration = filesource->DurationL() ); + if ( err != KErrNone || err2 != KErrNone ) + { + return EFalse; + } + + MUS_LOG2( "mus: [ENGINE] position = %Ld, duration = %Ld", + position.Int64(), duration.Int64() ) + + hasClipEnded = + ( position.Int64() == 0 && + !filesource->IsEnabled() && + videoOut->State() == CMceMediaStream::EDisabled ); + } + } + + if ( hasClipEnded ) + { + iDelayFileEndingPos = 0; + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngClipVideoPlayer::HasClipEnded" ) + + return hasClipEnded; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngClipVideoPlayer::SetBufferingPeriod( + const TTimeIntervalMicroSeconds& aPeriod ) + { + iBufferingPeriod = aPeriod; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +TBool CMusEngClipVideoPlayer::LcIsPlayingL() + { + __ASSERT_ALWAYS( iMceSession, User::Leave( KErrNotReady ) ); + return ( MusEngMceUtils::GetFileSourceL( *iMceSession )->IsEnabled() ); + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +void CMusEngClipVideoPlayer::LcPlayL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngClipVideoPlayer::LcPlayL" ) + + __ASSERT_ALWAYS( iMceSession, User::Leave( KErrNotReady ) ); + CMceFileSource* file = MusEngMceUtils::GetFileSourceL( *iMceSession ); + + if ( !file->IsEnabled() ) + { + file->EnableL(); + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngClipVideoPlayer::LcPlayL" ) + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +void CMusEngClipVideoPlayer::LcPauseL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngClipVideoPlayer::LcPauseL" ) + + __ASSERT_ALWAYS( iMceSession, User::Leave( KErrNotReady ) ); + CMceFileSource* file = MusEngMceUtils::GetFileSourceL( *iMceSession ); + + if ( file->IsEnabled() ) + { + file->DisableL(); + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngClipVideoPlayer::LcPauseL" ) + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcSourceFileControl* CMusEngClipVideoPlayer::LcSourceFileControl() + { + return this; + } + +// ----------------------------------------------------------------------------- +// From MLcSourceFileControl +// ----------------------------------------------------------------------------- +// +void CMusEngClipVideoPlayer::SetLcFileNameL( const TFileName& aFileName ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngClipVideoPlayer::SetLcFileNameL" ) + + __ASSERT_ALWAYS( !IsProtectedFileL( aFileName ), + User::Leave( KErrPermissionDenied ) ); + + if ( iMceSession ) + { + CMceFileSource* file = MusEngMceUtils::GetFileSourceL( *iMceSession ); + file->UpdateL( aFileName ); + } + + iFileName = aFileName; + MUS_LOG( "mus: [ENGINE] <- CMusEngClipVideoPlayer::SetLcFileNameL" ) + } + +// ----------------------------------------------------------------------------- +// From MLcSourceFileControl +// ----------------------------------------------------------------------------- +// +TFileName& CMusEngClipVideoPlayer::LcFileName() + { + return iFileName; + } + +// ----------------------------------------------------------------------------- +// From MLcSourceFileControl +// Since MCE does not at the moment support SetFastForwardL function, this +// functionality is implemented by taking a timestamp when forwarding is +// started and calculating a new position when it is ended. +// ----------------------------------------------------------------------------- +// +void CMusEngClipVideoPlayer::LcFastForwardL( TBool aUseFFWD ) + { + MUS_LOG1( "mus: [ENGINE] -> CMusEngClipVideoPlayer::FastForward( %d )", + aUseFFWD ) + + __ASSERT_ALWAYS( iMceSession, User::Leave( KErrNotReady ) ); + + CMceFileSource* file = MusEngMceUtils::GetFileSourceL( *iMceSession ); + + if ( aUseFFWD ) + { + // Ignore if we are already fastforwarding + if ( iFFWDStartTime.Int64() > 0 ) + { + return; + } + + // Stop rewinding if ongoing, else just pause file source + if ( iFRWDStartTime.Int64() > 0 ) + { + LcFastRewindL( EFalse ); + } + else + { + file->DisableL(); + } + + // Get timestamp for starttime + iFFWDStartTime.HomeTime(); + } + else + { + // Leave if we are not fastforwarding + if ( iFFWDStartTime.Int64() == 0 ) + { + User::Leave( KErrAlreadyExists ); + } + + // Set new position + file->SetPositionL( PositionMicroSecondsL( ETrue ) ); + + // Reset timer + iFFWDStartTime = TTime( 0 ); + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngClipVideoPlayer::FastForward" ) + } + +// ----------------------------------------------------------------------------- +// From MLcSourceFileControl +// Since MCE does not at the moment support SetFastRewindL function, this +// functionality is implemented by taking a timestamp when rewinding is +// started and calculating a new position when it is ended. +// ----------------------------------------------------------------------------- +// +void CMusEngClipVideoPlayer::LcFastRewindL( TBool aUseFRWD ) + { + MUS_LOG1( "mus: [ENGINE] -> CMusEngClipVideoPlayer::FastRewind( %d )", + aUseFRWD ) + + __ASSERT_ALWAYS( iMceSession, User::Leave( KErrNotReady ) ); + + CMceFileSource* file = MusEngMceUtils::GetFileSourceL( *iMceSession ); + + if ( aUseFRWD ) + { + // Ignore if we are already fastrewinding + if ( iFRWDStartTime.Int64() > 0 ) + { + return; + } + + // Stop fastforwarding if ongoing, else just pause file source + if ( iFFWDStartTime.Int64() > 0 ) + { + LcFastForwardL( EFalse ); + } + else + { + file->DisableL(); + } + + // Get timestamp for starttime + iFRWDStartTime.HomeTime(); + } + else + { + // Leave if we are not fastrewinding + if ( iFRWDStartTime.Int64() == 0 ) + { + User::Leave( KErrAlreadyExists ); + } + + // Set new position + file->SetPositionL( PositionMicroSecondsL( ETrue ) ); + + // Reset timer + iFRWDStartTime = TTime( 0 ); + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngClipVideoPlayer::FastRewind" ) + } + +// ----------------------------------------------------------------------------- +// From MLcSourceFileControl +// ----------------------------------------------------------------------------- +// +TTimeIntervalSeconds CMusEngClipVideoPlayer::LcFileDurationL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngClipVideoPlayer::DurationL" ) + + __ASSERT_ALWAYS( iMceSession, User::Leave( KErrNotReady ) ); + + CMceFileSource* file = MusEngMceUtils::GetFileSourceL( *iMceSession ); + + TTimeIntervalMicroSeconds duration = file->DurationL(); + + MUS_LOG( "mus: [ENGINE] <- CMusEngClipVideoPlayer::DurationL" ) + + return TTimeIntervalSeconds( static_cast< TInt >( + duration.Int64() / KMicroSecondsInOneSecond ) ); + } + +// ----------------------------------------------------------------------------- +// From MLcSourceFileControl +// ----------------------------------------------------------------------------- +// +TTimeIntervalSeconds CMusEngClipVideoPlayer::LcFilePositionL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngClipVideoPlayer::LcFilePositionL" ) + + TTimeIntervalMicroSeconds currentPosition = PositionMicroSecondsL(); + + MUS_LOG1( "mus: [ENGINE] <- CMusEngClipVideoPlayer::LcFilePositionL, %d", + currentPosition.Int64() ) + + return TTimeIntervalSeconds( static_cast< TInt >( + currentPosition.Int64() / KMicroSecondsInOneSecond ) ); + } + +// ----------------------------------------------------------------------------- +// From MLcSourceFileControl +// ----------------------------------------------------------------------------- +// +void CMusEngClipVideoPlayer::SetLcFilePositionL( + const TTimeIntervalSeconds& aPosition ) + { + MUS_LOG1( "mus: [ENGINE] -> CMusEngClipVideoPlayer::SetPositionL ( %d )", + aPosition.Int() ) + + __ASSERT_ALWAYS( iMceSession, User::Leave( KErrNotReady ) ); + + CMceFileSource* file = MusEngMceUtils::GetFileSourceL( *iMceSession ); + + TTimeIntervalMicroSeconds position( + KMicroSecondsInOneSecond * static_cast< TInt64 >( aPosition.Int() ) ); + + if ( position == 0 ) + { + iRewindedToBeginning = ETrue; + } + + file->SetPositionL( position ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngClipVideoPlayer::SetPositionL ()" ) + } + +// ----------------------------------------------------------------------------- +// Check is file DRM protected. +// ----------------------------------------------------------------------------- +// +TBool CMusEngClipVideoPlayer::IsProtectedFileL( const TDesC& aClipFile ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngClipVideoPlayer::IsProtectedFileL(...)" ) + + TBool isDRMProtected = EFalse; + DRMCommon* drmapi = DRMCommon::NewL(); + CleanupStack::PushL( drmapi ); + + User::LeaveIfError( drmapi->Connect() ); + //Check DRM file protection + User::LeaveIfError( drmapi->IsProtectedFile( aClipFile, isDRMProtected ) ); + drmapi->Disconnect(); + + CleanupStack::PopAndDestroy( drmapi ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngClipVideoPlayer::IsProtectedFileL(...)" ) + return isDRMProtected; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TTimeIntervalMicroSeconds CMusEngClipVideoPlayer::PositionMicroSecondsL( + TBool aActualPosition ) + { + __ASSERT_ALWAYS( iMceSession, User::Leave( KErrNotReady ) ); + + CMceFileSource* file = MusEngMceUtils::GetFileSourceL( *iMceSession ); + + TTimeIntervalMicroSeconds position = file->PositionL(); + TTimeIntervalMicroSeconds duration = file->DurationL(); + + TTimeIntervalMicroSeconds calculatedPosition; + + // Adjust position if we are fastforwarding or -rewinding + if ( iFFWDStartTime.Int64() != 0 ) + { + TTime now; + now.HomeTime(); + calculatedPosition = KFastWindingFactor * + now.MicroSecondsFrom( iFFWDStartTime ).Int64() + + position.Int64(); + if ( calculatedPosition > duration ) + { + calculatedPosition = duration; + } + } + else if ( iFRWDStartTime.Int64() != 0 ) + { + TTime now; + now.HomeTime(); + calculatedPosition = position.Int64() - + KFastWindingFactor * + now.MicroSecondsFrom( iFRWDStartTime ).Int64(); + if ( calculatedPosition < 0 ) + { + calculatedPosition = 0; + } + + if ( calculatedPosition == 0 ) + { + iRewindedToBeginning = ETrue; + } + } + else + { + calculatedPosition = position; + } + + if ( !aActualPosition ) + { + calculatedPosition = + GetVideoSinkRelativeFilePos( calculatedPosition, duration ); + } + + return calculatedPosition; + } + +// ----------------------------------------------------------------------------- +// Modifies file position if position has reached end before clip has ended. +// File position is not going in sync with local video playback as playback +// buffers media before starting playing. +// ----------------------------------------------------------------------------- +// +TTimeIntervalMicroSeconds CMusEngClipVideoPlayer::GetVideoSinkRelativeFilePos( + const TTimeIntervalMicroSeconds& aActualPosition, + const TTimeIntervalMicroSeconds& aDuration ) + { + MUS_LOG1( "mus: [ENGINE] PositionMicroSecondsL, pos before mod:%d", + aActualPosition.Int64() ) + + TTimeIntervalMicroSeconds tempCalculatedPosition( aActualPosition ); + + if ( iDelayFileEndingPos != 0 ) + { + iDelayFileEndingPos = aDuration; + tempCalculatedPosition = iDelayFileEndingPos; + } + else + { + // FRWD can go to zero even if clip has not ended, do not modify + // time in such situation. + if ( aActualPosition == 0 && + !HasClipEnded() && + iFRWDStartTime.Int64() == 0 && + !iRewindedToBeginning ) + { + const TInt KMusDelayEndingModifier = 2; + iDelayFileEndingPos = aDuration.Int64() - + iBufferingPeriod.Int64() / KMusDelayEndingModifier; + tempCalculatedPosition = iDelayFileEndingPos; + if ( iPreviousPos > tempCalculatedPosition ) + { + tempCalculatedPosition = iPreviousPos; + } + } + else + { + iDelayFileEndingPos = 0; + } + + if ( iRewindedToBeginning && aActualPosition > 0 ) + { + iRewindedToBeginning = EFalse; + } + + if ( tempCalculatedPosition < 0 ) + { + tempCalculatedPosition = 0; + } + } + + iPreviousPos = tempCalculatedPosition; + + return tempCalculatedPosition; + } + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/src/musenginepluginentry.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/src/musenginepluginentry.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,41 @@ +/* +* 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 "musengsessionmanager.h" +#include +#include + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +const TImplementationProxy KMusEnginePluginImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( 0x20021341, CMusEngSessionManager::NewL ) + }; + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount ) + { + aTableCount = sizeof( KMusEnginePluginImplementationTable ) / + sizeof( TImplementationProxy ); + + return KMusEnginePluginImplementationTable; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/src/musenglivesession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/src/musenglivesession.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,273 @@ +/* +* Copyright (c) 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: +* +*/ + + +// USER +#include "musenglivesession.h" +#include "musunittesting.h" +#include "musengmceutils.h" +#include "musenglogger.h" +#include "mussessionproperties.h" +#include "musenglivevideoplayer.h" + +// SYSTEM +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngLiveSession* CMusEngLiveSession::NewL() + { + CMusEngLiveSession* self = new( ELeave )CMusEngLiveSession(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngLiveSession::CMusEngLiveSession() + : CMusEngMceOutSession() + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngLiveSession::ConstructL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngLiveSession::ConstructL()" ) + + iCameraHandler.ReadCameraUsageKeyL(); + CMusEngMceOutSession::ConstructL(); + + iLiveVideoPlayer = + CMusEngLiveVideoPlayer::NewL( *this, iCameraHandler, *this ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngLiveSession::ConstructL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngLiveSession::~CMusEngLiveSession() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngLiveSession::~CMusEngLiveSession()" ) + delete iLiveVideoPlayer; + MUS_LOG( "mus: [ENGINE] <- CMusEngLiveSession::~CMusEngLiveSession()" ) + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +MLcVideoPlayer* CMusEngLiveSession::LocalVideoPlayer() + { + return iLiveVideoPlayer; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngLiveSession::CompleteSessionStructureL( + CMceStreamBundle& /*aLocalBundle*/ ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngLiveSession::CompleteSessionStructureL()" ) + + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + iCameraHandler.SetSession( iSession ); + + // Create outgoing video stream + CMceVideoStream* videoStream = CMceVideoStream::NewLC(); + + CMceRtpSink* rtpsink = CMceRtpSink::NewLC(); + videoStream->AddSinkL( rtpsink ); + CleanupStack::Pop( rtpsink ); + + CMceCameraSource* camera = CMceCameraSource::NewLC( *iManager ); + camera->DisableL(); // Start session in pause mode. + + iCameraHandler.InitializeL( *camera ); + + videoStream->SetSourceL( camera ); + CleanupStack::Pop( camera ); + + iSession->AddStreamL( videoStream ); + CleanupStack::Pop( videoStream ); + + // Construct recording stream if needed + if ( iLiveVideoPlayer->LcFileName().Length() > 0 ) + { + CMceVideoStream* streamForRecording = CMceVideoStream::NewLC(); + + CMceFileSink* fileSink = + CMceFileSink::NewLC( iLiveVideoPlayer->LcFileName() ); + fileSink->DisableL(); // Start in not recording mode + streamForRecording->AddSinkL( fileSink ); + CleanupStack::Pop( fileSink ); + + streamForRecording->SetSourceL( camera ); + iSession->AddStreamL( streamForRecording ); + CleanupStack::Pop( streamForRecording ); + } + + iLiveVideoPlayer->SetMceSession( iSession ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngLiveSession::CompleteSessionStructureL()" ) + } + +// ----------------------------------------------------------------------------- +// Sets video codec attributes +// ----------------------------------------------------------------------------- +// +void CMusEngLiveSession::AdjustVideoCodecL( CMceVideoCodec& aVideoCodec, + TMceSourceType aSourceType ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngLiveSession::AdjustVideoCodecL()" ) + + CMusEngMceOutSession::AdjustVideoCodecL( aVideoCodec, aSourceType ); + + // Starting with 80Kbps will give better quality than starting with + // 64kbps.And if network behaves bad than anyhow we will drop down or + // if network is good guy than we climp up to 128. + // Esp in operator variance. No constant defined in MCE so defining + // one here. + const TInt KMushInitialBitrate = 80000; + MUS_LOG1( "mus: [ENGINE] - Intial bit rate set to %d",KMushInitialBitrate); + User::LeaveIfError( aVideoCodec.SetBitrate( KMushInitialBitrate ) ); + + if ( aVideoCodec.SdpName() == KMceSDPNameH263() || + aVideoCodec.SdpName() == KMceSDPNameH2632000() ) + { + // Set H.263 codec to allow all bitrates, set maximum to level 45 and + // start using level 10 and let the rate control raise it if possible + // Label:H263 + User::LeaveIfError( aVideoCodec.SetAllowedBitrates( + KMceAllowedH263BitrateAll ) ); + aVideoCodec.SetMaxBitrateL( KMceH263Level45Bitrate ); + } + else if ( aVideoCodec.SdpName() == KMceSDPNameH264() ) + { + User::LeaveIfError( aVideoCodec.SetAllowedBitrates( + KMceAvcCodecProfileIdBaseline | + KMceAvcCodecProfileIopConstraintSet | + KMceAvcBitrateLevel1b ) ); + } + else + { + // NOP + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngLiveSession::AdjustVideoCodecL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngLiveSession::AdjustAudioCodecL( CMceAudioCodec& aAudioCodec ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngLiveSession::AdjustAudioCodecL()" ) + + CMusEngMceOutSession::AdjustAudioCodecL( aAudioCodec ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngLiveSession::AdjustAudioCodecL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngLiveSession::DoCodecSelectionL( CMceVideoStream& aVideoStream ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngLiveSession::DoCodecSelectionL()" ) + + CMusEngMceSession::DoCodecSelectionL( aVideoStream ); + + if ( iVideoCodecList && !IsH264Supported() ) + { + // We know that recipient doesn't support AVC, so we do not offer it + const RPointerArray& codecs = aVideoStream.Codecs(); + + for ( TInt codecIndex = 0; codecIndex < codecs.Count(); ++codecIndex ) + { + if ( codecs[codecIndex]->SdpName() == KMceSDPNameH264() ) + { + aVideoStream.RemoveCodecL( *codecs[codecIndex] ); + // Since succesfull removal of a codec has changed the + // indexing, we have to reset the index + codecIndex = 0; + } + } + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngLiveSession::DoCodecSelectionL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngLiveSession::StreamStateChanged( CMceMediaStream& aStream, + CMceMediaSink& aSink ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngLiveSession::StreamStateChanged( sink )" ) + + if ( !iSession ) + { + return; + } + + MUS_ENG_LOG_STREAM_STATE( aStream ) + + CMceVideoStream* recordingStream = + MusEngMceUtils::GetRecordingStream( *iSession ); + + if ( recordingStream && + recordingStream == &aStream && + aStream.State() == CMceMediaStream::ENoResources && + aSink.IsEnabled() == EFalse ) + { + InformObserverAboutSessionFailure( MLcSession::EDiskFull ); + } + else + { + // Cannot handle, forward to a base class + CMusEngMceSession::StreamStateChanged( aStream, aSink ); + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngLiveSession::StreamStateChanged( sink )" ) + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/src/musenglivevideoplayer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/src/musenglivevideoplayer.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,198 @@ +/* +* 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: +* +*/ + +// USER +#include "musenglivevideoplayer.h" +#include "musengcamerahandler.h" +#include "musengmceutils.h" +#include "musengdisplayhandler.h" + +// SYSTEM +#include +#include + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngLiveVideoPlayer* CMusEngLiveVideoPlayer::NewL( + MMusEngDisplayHandler& aDisplayHandler, + TMusEngCameraHandler& aCameraHandler, + MLcAudioControl& aLcAudioControl ) + { + return new( ELeave )CMusEngLiveVideoPlayer( + aDisplayHandler, aCameraHandler, aLcAudioControl ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngLiveVideoPlayer::CMusEngLiveVideoPlayer( + MMusEngDisplayHandler& aDisplayHandler, + TMusEngCameraHandler& aCameraHandler, + MLcAudioControl& aLcAudioControl ) : + CMusEngLocalVideoPlayer( aDisplayHandler, aLcAudioControl ), + iCameraHandler( aCameraHandler ) + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngLiveVideoPlayer::~CMusEngLiveVideoPlayer() + { + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +TBool CMusEngLiveVideoPlayer::LcIsPlayingL() + { + return iCameraHandler.IsPlayingL(); + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +void CMusEngLiveVideoPlayer::LcPlayL( TLcVideoPlayerSource /*aSource*/ ) + { + iCameraHandler.PlayL(); + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +void CMusEngLiveVideoPlayer::LcPauseL() + { + iCameraHandler.PauseL(); + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcCameraControl* CMusEngLiveVideoPlayer::LcCameraControl() + { + return &iCameraHandler; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcDestinationFileControl* CMusEngLiveVideoPlayer::LcDestinationFileControl() + { + return this; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcZoomControl* CMusEngLiveVideoPlayer::LcZoomControl() + { + return &iCameraHandler; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcBrightnessControl* CMusEngLiveVideoPlayer::LcBrightnessControl() + { + return &iCameraHandler; + } + +// ----------------------------------------------------------------------------- +// From MLcFileControl +// ----------------------------------------------------------------------------- +// +void CMusEngLiveVideoPlayer::SetLcFileNameL( const TFileName& aFileName ) + { + iFileName = aFileName; + } + +// ----------------------------------------------------------------------------- +// From MLcFileControl +// ----------------------------------------------------------------------------- +// +TFileName& CMusEngLiveVideoPlayer::LcFileName() + { + return iFileName; + } + +// ----------------------------------------------------------------------------- +// From MLcDestinationFileControl +// ----------------------------------------------------------------------------- +// +void CMusEngLiveVideoPlayer::LcRecordL( TBool aRecord ) + { + MUS_LOG1( "mus: [ENGINE] -> CMusEngLiveVideoPlayer::LcRecordL(( %d )", + aRecord ) + + __ASSERT_ALWAYS( iMceSession, User::Leave( KErrNotReady ) ); + + CMceMediaSink* fileSink = + MusEngMceUtils::GetMediaSink( *iMceSession, KMceFileSink ); + + __ASSERT_ALWAYS( fileSink, User::Leave( KErrNotReady ) ); + + if ( aRecord ) + { + if ( !fileSink->IsEnabled() ) + { + fileSink->EnableL(); + } + } + else + { + if ( fileSink->IsEnabled() ) + { + fileSink->DisableL(); + } + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngLiveVideoPlayer::LcRecordL" ) + } + +// ----------------------------------------------------------------------------- +// From MLcDestinationFileControl +// ----------------------------------------------------------------------------- +// +TBool CMusEngLiveVideoPlayer::LcIsRecording() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngLiveVideoPlayer::LcIsRecording()" ) + + TBool isEnabled( EFalse ); + + CMceMediaSink* fileSink = + MusEngMceUtils::GetMediaSink( *iMceSession, KMceFileSink ); + if ( fileSink ) + { + isEnabled = fileSink->IsEnabled(); + } + + MUS_LOG1( "mus: [ENGINE] <- CMusEngLiveVideoPlayer::LcIsRecording( %d )", + isEnabled ) + + return isEnabled; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/src/musenglocalvideoplayer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/src/musenglocalvideoplayer.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,113 @@ +/* +* 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: +* +*/ + +// USER +#include "musenglocalvideoplayer.h" +#include "musengmceutils.h" +#include "musengdisplayhandler.h" + +// SYSTEM +#include +#include + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngLocalVideoPlayer::CMusEngLocalVideoPlayer( + MMusEngDisplayHandler& aDisplayHandler, + MLcAudioControl& aLcAudioControl ) : + CMusEngVideoPlayerBase( aDisplayHandler, aLcAudioControl ) + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngLocalVideoPlayer::~CMusEngLocalVideoPlayer() + { + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcVideoPlayer::TLcVideoPlayerState +CMusEngLocalVideoPlayer::LcVideoPlayerState() const + { + if ( !iMceSession ) + { + return MLcVideoPlayer::EUnavailable; + } + CMceVideoStream* stream = NULL; + TRAPD( err, stream = MusEngMceUtils::GetVideoOutStreamL( *iMceSession ) ) + TLcVideoPlayerState playerState = MLcVideoPlayer::EUnavailable; + if ( err == KErrNone && stream ) + { + switch ( stream->State() ) + { + case CMceMediaStream::EInitialized: + { + playerState = MLcVideoPlayer::EInit; + break; + } + case CMceMediaStream::EBuffering: + { + playerState = MLcVideoPlayer::EBuffering; + break; + } + case CMceMediaStream::EIdle: + case CMceMediaStream::EDisabled: + { + playerState = MLcVideoPlayer::EPaused; + break; + } + case CMceMediaStream::EStreaming: + { + playerState = MLcVideoPlayer::EPlaying; + break; + } + default: // Other MCE stream states: MLcVideoPlayer::EUnavailable + { + break; + } + } + } + return playerState; + } + + +// ----------------------------------------------------------------------------- +// From MLcWindow +// ----------------------------------------------------------------------------- +// +void CMusEngLocalVideoPlayer::SetLcWindowRectL( TRect aRect ) + { + iDisplayHandler.SetSecondaryRectL( aRect ); + } + + +// ----------------------------------------------------------------------------- +// From MLcWindow +// ----------------------------------------------------------------------------- +// +TRect CMusEngLocalVideoPlayer::LcWindowRect() + { + return iDisplayHandler.SecondaryRect(); + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/src/musengmceoutsession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/src/musengmceoutsession.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,860 @@ +/* +* Copyright (c) 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: +* +*/ + + +// USER +#include "musengmceoutsession.h" +#include "mussettings.h" +#include "musengmceutils.h" +#include "musenguriparser.h" +#include "musenglogger.h" +#include "mussipprofilehandler.h" +#include "mussessionproperties.h" +#include "musresourceproperties.h" + +// SYSTEM +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +const TInt KMusEngSipReasonCodeRecipientNotFound = 404; +const TInt KMusEngSipReasonCodeRequestTimeout = 408; +const TInt KMusEngSipReasonCodeUnsupportedMediaType = 415; +const TInt KMusEngSipReasonCodeUnsupportedUriScheme = 416; +const TInt KMusEngSipReasonCodeTemporarilyNotAvailable = 480; +const TInt KMusEngSipReasonCodeBusyHere = 486; +const TInt KMusEngSipReasonCodeRequestCancelled = 487; +const TInt KMusEngSipReasonCodeNotAcceptableHere = 488; +const TInt KMusEngSipReasonCodeDecline = 603; +const TInt KMusEngSipReasonCodeNotAcceptable = 606; +// The next code represents unofficial sip error code +// "479 Regretfuly, we were not able to process the URI (479/SL) +const TInt KMusEngSipReasonCode479NotAbleToProcessURI = 479; + +const TUint8 KMusEngPayloadTypeVideoH263 = 96; +const TUint8 KMusEngPayloadTypeAudio = 97; +const TUint8 KMusEngPayloadTypeVideoAvc = 98; + +const TInt KMusEngSipAddressMaxLength = 256; +const TInt KMusEngSipAddressesMaxAmount = 8; +_LIT( KMusEngCommaSymbol, "," ); + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngMceOutSession::CMusEngMceOutSession() + : CMusEngMceSession(), + iTriedInvitations( 0 ), + iAsyncBrakeCallBack( AsyncBrakeCompleted, this ), + iRegistrationCallBack( RegistrationTimerExpired, this ), + iInvitationResponseCallBack( InvitationResponseTimerExpired, this ) + { + iAsyncBrakeEntry.Set( iAsyncBrakeCallBack ); + iRegistrationEntry.Set( iRegistrationCallBack ); + iInvitationResponseEntry.Set( iInvitationResponseCallBack ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceOutSession::ConstructL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceOutSession::ConstructL()" ) + + CMusEngMceSession::ConstructL(); + TInt sipProfileId; + TInt error = KErrNone; + error = ( RProperty::Get( NMusSessionApi::KCategoryUid, + NMusSessionApi::KSipProfileId, sipProfileId ) ); + if ( error != KErrNone ) + { + sipProfileId = KErrNone; + error = KErrNone; + } + iSipProfileHandler->CreateProfileL( sipProfileId ); + iVideoCodecList = NULL; + TBuf buffer; + error = ( RProperty::Get( NMusSessionApi::KCategoryUid, + NMusSessionApi::KVideoCodecs, buffer ) ); + if ( error == KErrNone && buffer.Length() ) + { + iVideoCodecList = + CnvUtfConverter::ConvertFromUnicodeToUtf8L( buffer ); + } + + iDeltaTimer = CDeltaTimer::NewL( CActive::EPriorityStandard ); + + /* Read the contact name set by availability plugin */ + error = RProperty::Get( NMusSessionApi::KCategoryUid, + NMusSessionApi::KContactName, + buffer ); + iRemoteDisplayName = ( error == KErrNone && buffer.Length() ) + ? buffer.AllocL() : KNullDesC().AllocL(); + + MUS_LOG( "mus: [ENGINE] <- CMusEngMceOutSession::ConstructL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngMceOutSession::~CMusEngMceOutSession() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceOutSession::~CMusEngMceOutSession()" ) + + if ( iAddressQueried && iRecipient ) + { + TRAP_IGNORE( SaveContactL( *iRecipient ) ) + } + + delete iDeltaTimer; + delete iRecipient; + delete iVideoCodecList; + delete iRemoteSipAddressProposal; + delete iRemoteDisplayName; + MUS_LOG( "mus: [ENGINE] <- CMusEngMceOutSession::~CMusEngMceOutSession()" ) + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +void CMusEngMceOutSession::EstablishLcSessionL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceOutSession::EstablishLcSessionL()") + + iAddressQueried = EFalse; + if ( LcUiProvider() && !IsBackgroundStartup() ) + { + LcUiProvider()->HandleForegroundStatus( ETrue ); + } + TRAPD( err, DoInviteL() ); + + // If address is in wrong format, Manual Address Entry Dialog is displayed + if ( ( err == KErrArgument ) && DoSyncRetryL() ) + { + err = KErrNone; // Doing retry + } + + User::LeaveIfError( err ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngMceOutSession::EstablishLcSessionL") + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +void CMusEngMceOutSession::TerminateLcSessionL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceOutSession::TerminateLcSessionL" ) + + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + if( iSession->State() == CMceSession::EOffering ) + { + static_cast< CMceOutSession* >( iSession )->CancelL(); + } + else + { + iSession->TerminateL(); + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngMceOutSession::TerminateLcSessionL" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceOutSession::AddDisplayL( CMceMediaStream& aStream ) + { + MusEngMceUtils::AddDisplayL( aStream, *iManager, Rect() ); + } + +// ----------------------------------------------------------------------------- +// Calls MCE function EstablishL with feature tag in Accept-Contact header. +// Adjusts stream and codec values. +// ----------------------------------------------------------------------------- +// +void CMusEngMceOutSession::EstablishSessionL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceOutSession::EstablishSessionL()" ) + + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + AdjustStreamsAndCodecsL(); + + CDesC8Array* headers = new ( ELeave ) CDesC8ArrayFlat( 1 ); + CleanupStack::PushL( headers ); + headers->AppendL( KMusEngAcceptContactHeader() ); + headers->AppendL( KMusAcceptHeader() ); + if ( iOperatorVariant ) + { + CUri8* originator = iSipProfileHandler->UserFromProfileLC(); + + CSIPExtensionHeader* header = CSIPExtensionHeader::NewLC( + KMusPPreferredIdentity, originator->Uri().UriDes() ); + HBufC8* headInText = header->ToTextL(); + MUS_LOG_TDESC8( " mus: [ENGINE] P-Preferred-Identity header : ", headInText->Des() ); + CleanupStack::PopAndDestroy( header ); + CleanupStack::PopAndDestroy( originator ); + CleanupStack::PushL( headInText ); + headers->AppendL( *headInText ); + CleanupStack::PopAndDestroy( headInText ); + } + + + static_cast( iSession )->EstablishL( 0, headers ); + CleanupStack::Pop( headers ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngMceOutSession::EstablishSessionL()" ) + } + +// ----------------------------------------------------------------------------- +// Handle MCE session termination. Called by MCE observer function of the +// base class. +// ----------------------------------------------------------------------------- +// +void CMusEngMceOutSession::HandleTermination( TInt aStatusCode, + const TDesC8& aReasonPhrase ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceOutSession::HandleTermination()" ) + + switch ( aStatusCode ) + { + case KMusEngSipReasonCodeRecipientNotFound : + //lint -fallthrough + case KMusEngSipReasonCode479NotAbleToProcessURI: + //lint -fallthrough + case KMusEngSipReasonCodeUnsupportedUriScheme : + { + InitRecipientNotFoundHandling(); + break; + } + case KMusEngSipReasonCodeRequestTimeout : + { + InformObserverAboutSessionFailure( MLcSession::ENoAnswer ); + break; + } + case KMusEngSipReasonCodeUnsupportedMediaType : + //lint -fallthrough + case KMusEngSipReasonCodeNotAcceptableHere: + //lint -fallthrough + case KMusEngSipReasonCodeNotAcceptable: + { + InformObserverAboutSessionFailure( MLcSession::ESessionRejected ); + break; + } + case KMusEngSipReasonCodeBusyHere : + { + // Operator variant uses 486 to rejection instead of 603 + if ( iOperatorVariant ) + { + InformObserverAboutSessionFailure( + MLcSession::ESessionRejected ); + } + else + { + InformObserverAboutSessionFailure( + MLcSession::ERecipientBusy ); + } + break; + } + case KMusEngSipReasonCodeRequestCancelled : + { + InformObserverAboutSessionFailure( MLcSession::ESessionCancelled ); + break; + } + case KMusEngSipReasonCodeDecline : + { + InformObserverAboutSessionFailure( MLcSession::ESessionRejected ); + break; + } + case KMusEngSipReasonCodeTemporarilyNotAvailable : + { + InformObserverAboutSessionFailure( + MLcSession::ERecipientTemporarilyNotAvailable ); + break; + } + default: + { + // Termination reason is not outsession specific. + // Let the base class to handle the termination. + CMusEngMceSession::HandleTermination( aStatusCode, aReasonPhrase ); + } + } + + + MUS_LOG( "mus: [ENGINE] <- CMusEngMceOutSession::HandleTermination()" ) + } + +// ----------------------------------------------------------------------------- +// Sets payload type and calls overridden base class version +// ----------------------------------------------------------------------------- +// +void CMusEngMceOutSession::AdjustVideoCodecL( CMceVideoCodec& aVideoCodec, + TMceSourceType aSourceType ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceOutSession::AdjustVideoCodecL()" ) + + CMusEngMceSession::AdjustVideoCodecL( aVideoCodec, aSourceType ); + + if ( aVideoCodec.SdpName() == KMceSDPNameH263() || + aVideoCodec.SdpName() == KMceSDPNameH2632000() ) + { + User::LeaveIfError( + aVideoCodec.SetPayloadType( KMusEngPayloadTypeVideoH263 ) ); + } + else if ( aVideoCodec.SdpName() == KMceSDPNameH264() ) + { + User::LeaveIfError( + aVideoCodec.SetPayloadType( KMusEngPayloadTypeVideoAvc ) ); + } + else + { + // NOP + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngMceOutSession::AdjustVideoCodecL()" ) + } + +// ----------------------------------------------------------------------------- +// Sets payload type and calls overridden base class version +// ----------------------------------------------------------------------------- +// +void CMusEngMceOutSession::AdjustAudioCodecL( CMceAudioCodec& aAudioCodec ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceOutSession::AdjustAudioCodecL()" ) + + CMusEngMceSession::AdjustAudioCodecL( aAudioCodec ); + + User::LeaveIfError( aAudioCodec.SetPayloadType( KMusEngPayloadTypeAudio ) ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngMceOutSession::AdjustAudioCodecL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceOutSession::ProfileRegistered() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceOutSession::ProfileRegistered()" ) + + if ( iRegistrationPending ) + { + iDeltaTimer->Remove( iRegistrationEntry ); + iRegistrationPending = EFalse; + + + HBufC* resolvedRecipient = NULL; + TRAPD( error, resolvedRecipient = RemoteAddressL() ) + if ( error != KErrNone ) + { + InformObserverAboutSessionFailure( error ); + } + else + { + TRAP( error, DoInviteL( *resolvedRecipient ) ) + delete resolvedRecipient; + if ( error != KErrNone ) + { + InformObserverAboutSessionFailure( error ); + } + } + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngMceOutSession::ProfileRegistered()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMusEngMceOutSession::IsH264Supported() const + { + return ( iVideoCodecList && iVideoCodecList->FindF( KMceSDPNameH264() ) >= 0 ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceOutSession::CreateMceSessionStructureL( TBool aForceSdpBandwidth ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceOutSession::CreateMceSessionStructureL()" ) + + CSIPProfile* profile = iSipProfileHandler->Profile(); + __ASSERT_ALWAYS( profile != NULL, User::Leave( KErrNotReady ) ); + + // Create session + iSession = CMceOutSession::NewL( *iManager, *profile, *iRecipient ); + + // Remove QoS-lines if needed + if ( profile->Type().iSIPProfileClass == + TSIPProfileTypeInfo::EInternet || + MultimediaSharingSettings::ForceInternetSignalingSettingL() == + MusSettingsKeys::EForceInternetSignaling || + iOperatorVariant) + { + iSession->SetModifierL( KMcePreconditions, KMcePreconditionsNotUsed ); + MUS_LOG( "mus: [ENGINE] Usage of preconditions denied" ) + } + + SetSessionSdpLinesL( *iSession, aForceSdpBandwidth ); + + // Create bundle for local streams + + CMceStreamBundle* localBundle = + CMceStreamBundle::NewLC( CMceStreamBundle::ELS ); + + // To complete session structure, let the sibling classes add video out + // and possibly needed audio streams + CompleteSessionStructureL( *localBundle ); + + // Create stream to display and share source with video outstream + CMceVideoStream* streamForDisplay = CMceVideoStream::NewLC(); + + CMceVideoStream* videoOut = MusEngMceUtils::GetVideoOutStreamL( *iSession ); + + SetMediaSdpLinesL( *videoOut, aForceSdpBandwidth ); + + streamForDisplay->SetSourceL( videoOut->Source() ); + + AddDisplayL( *streamForDisplay ); + + iSession->AddStreamL( streamForDisplay ); + CleanupStack::Pop( streamForDisplay ); + + // Check if there are audio streams to bundle with + if ( localBundle->Streams().Count() > 0 ) + { + localBundle->AddStreamL( *streamForDisplay ); + iSession->AddBundleL( localBundle ); + CleanupStack::Pop( localBundle ); + } + else + { + CleanupStack::PopAndDestroy( localBundle ); + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngMceOutSession::CreateMceSessionStructureL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceOutSession::DoInviteL( const TDesC& aRecipient ) + { + MUS_LOG_TDESC( "mus: [ENGINE] -> CMusEngMceOutSession::DoInviteL(): ", + aRecipient ) + + HBufC* resolvedRecipient = NULL; + if ( aRecipient.Length() > 0 ) + { + resolvedRecipient = aRecipient.AllocLC(); + } + else + { + resolvedRecipient = ResolveRecipientLC(); + } + + // delete possibly existing recipient + delete iRecipient; + iRecipient = NULL; + + TMusEngUriParser parser( *resolvedRecipient ); + parser.ParseUriL(); + iRecipient = parser.GetUri8L(); + + /* Set the display name to recipient address if displayname is empty */ + if ( !iRemoteDisplayName || iRemoteDisplayName->Length() == 0 ) + { + HBufC* tmp = parser.GetUri16L( ETrue ); + delete iRemoteDisplayName; + iRemoteDisplayName = tmp; + } + + CleanupStack::PopAndDestroy( resolvedRecipient ); + + if ( iSession ) + { + MUS_ENG_LOG_SESSION_STATE( *iSession ) + + if ( iSession->State() == CMceSession::EIdle || + iSession->State() == CMceSession::ETerminated ) + { + // This is the case when last invite has ended up to an error, + // last sharing has ended normally, or construction of the session + // stucture has not been completed. Delete old session and try to + // continue normally. + delete iSession; + iSession = NULL; + MUS_LOG( "mus: [ENGINE] Existing session deleted") + } + else + { + // Session is already ongoing. Leave. + User::Leave( KErrAlreadyExists ); + } + } + + const TUint KMusEngOneMinuteTimeout = 60000000; + if ( iSipProfileHandler->IsRegistered() ) + { + CreateMceSessionStructureL(); + EstablishSessionL(); + // Start one minute expiration timer + TTimeIntervalMicroSeconds32 interval( KMusEngOneMinuteTimeout ); + iDeltaTimer->Remove( iInvitationResponseEntry ); + iDeltaTimer->Queue( interval, iInvitationResponseEntry ); + } + else + { + iRegistrationPending = ETrue; + // Start one minute expiration timer + TTimeIntervalMicroSeconds32 interval( KMusEngOneMinuteTimeout ); + iDeltaTimer->Remove( iRegistrationEntry ); + iDeltaTimer->Queue( interval, iRegistrationEntry ); + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngMceOutSession::DoInviteL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +HBufC* CMusEngMceOutSession::ResolveRecipientLC() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceOutSession::ResolveRecipientLC()" ) + + HBufC* resolvedRecipient = NULL; + TRAPD( err, + resolvedRecipient = + ReadDescPropertyL( NMusSessionApi::KRemoteSipAddress ) ); + if ( err != KErrNone ) + { + __ASSERT_ALWAYS( err != KErrNoMemory, User::Leave( KErrNoMemory ) ); + resolvedRecipient = KNullDesC().AllocL(); + } + CleanupStack::PushL( resolvedRecipient ); + + delete iRemoteSipAddressProposal; + iRemoteSipAddressProposal = NULL; + TRAP( err, + iRemoteSipAddressProposal = + ReadDescPropertyL( NMusSessionApi::KRemoteSipAddressProposal ) ); + if ( err != KErrNone ) + { + __ASSERT_ALWAYS( err != KErrNoMemory, User::Leave( KErrNoMemory ) ); + iRemoteSipAddressProposal = KNullDesC().AllocL(); + } + + if ( resolvedRecipient->Length() > 0 ) + { + if ( resolvedRecipient->Find( KMusEngCommaSymbol ) != KErrNotFound ) + { + // Split the addresses using KMusCommaSymbol as a separator + CDesCArray* addresses = + new( ELeave )CDesCArrayFlat( KMusEngSipAddressesMaxAmount ); + CleanupStack::PushL( addresses ); + SplitL( *resolvedRecipient, KMusEngCommaSymbol, addresses ); + + // Show List Query Dialog + CleanupStack::Pop( addresses ); + CleanupStack::PopAndDestroy( resolvedRecipient ); + CleanupStack::PushL( addresses ); + resolvedRecipient = HBufC::NewLC( KMusEngSipAddressMaxLength ); + TPtr ptrRetryAddr( resolvedRecipient->Des() ); + if ( !LcUiProviderL().SelectRecipient( *addresses, ptrRetryAddr ) ) + { + // Address not selected from provided list + User::Leave( KErrNotFound ); + } + CleanupStack::Pop( resolvedRecipient ); + CleanupStack::PopAndDestroy( addresses ); + CleanupStack::PushL( resolvedRecipient ); + } + } + else + { + __ASSERT_ALWAYS( ++iTriedInvitations < 2, User::Leave( KErrNotFound ) ); + + CleanupStack::PopAndDestroy( resolvedRecipient ); + resolvedRecipient = NULL; + resolvedRecipient = HBufC::NewLC( KMusEngSipAddressMaxLength ); + __ASSERT_ALWAYS( + iRemoteSipAddressProposal->Length() < KMusEngSipAddressMaxLength, + User::Leave( KErrOverflow ) ); + resolvedRecipient->Des().Copy( *iRemoteSipAddressProposal ); + TPtr ptrRetryAddr( resolvedRecipient->Des() ); + InputRecipientL( ptrRetryAddr ); + iAddressQueried = ETrue; + } + + MUS_LOG( "mus: [ENGINE] -> CMusEngMceOutSession::ResolveRecipientLC()" ) + + return resolvedRecipient; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CMusEngMceOutSession::AsyncBrakeCompleted( TAny* aPtr ) + { + if ( aPtr ) + { + reinterpret_cast( aPtr )->HandleRecipientNotFound(); + } + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CMusEngMceOutSession::RegistrationTimerExpired( TAny* aPtr ) + { + if ( aPtr ) + { + CMusEngMceOutSession* session = + reinterpret_cast< CMusEngMceOutSession* >( aPtr ); + session->InformObserverAboutSessionFailure( KErrGeneral ); + } + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CMusEngMceOutSession::InvitationResponseTimerExpired( TAny* aPtr ) + { + if ( aPtr ) + { + CMusEngMceOutSession* session = + reinterpret_cast< CMusEngMceOutSession* >( aPtr ); + if ( !session->IgnoreErrorNote() ) + { + session->InformObserverAboutSessionFailure( MLcSession::ENoAnswer ); + } + } + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMusEngMceOutSession::IgnoreErrorNote() + { + TBool ignore = ETrue; + if ( iSession && + ( iSession->State() == CMceSession::EOffering || + iSession->State() == CMceSession::EProceeding ) ) + { + ignore = EFalse; + } + return ignore; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceOutSession::InitRecipientNotFoundHandling() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceOutSession::InitRecipientNotFoundHandling()" ) + + iDeltaTimer->Remove( iAsyncBrakeEntry ); + const TUint KMusEngAsyncBrakeTimeout = 1; + TTimeIntervalMicroSeconds32 interval( KMusEngAsyncBrakeTimeout ); + iDeltaTimer->Queue( interval, iAsyncBrakeEntry ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngMceOutSession::InitRecipientNotFoundHandling()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceOutSession::HandleRecipientNotFound() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceOutSession::HandleRecipientNotFound()" ) + + TInt err( KErrNotFound ); + + TBool retry( EFalse ); + TRAP( err, retry = DoSyncRetryL() ); + + if ( err != KErrNone || !retry ) + { + InformObserverAboutSessionFailure( MLcSession::ERecipientNotFound ); + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngMceOutSession::HandleRecipientNotFound()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMusEngMceOutSession::DoSyncRetryL() + { + __ASSERT_ALWAYS( iRemoteSipAddressProposal, User::Leave( KErrNotFound ) ); + __ASSERT_ALWAYS( + iRemoteSipAddressProposal->Length() < KMusEngSipAddressMaxLength, + User::Leave( KErrOverflow ) ); + + TBool retry( EFalse ); + + if ( ++iTriedInvitations < 2 ) + { + TBuf retryAddress; + retryAddress.Copy( *iRemoteSipAddressProposal ); + InputRecipientL( retryAddress ); + DoInviteL( retryAddress ); + + retry = ETrue; + iAddressQueried = ETrue; + } + return retry; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceOutSession::SplitL( const TDesC& aDes, + const TDesC& aChar, + CDesCArray* aArray ) + { + TInt charPos( 0 ); + TPtrC ptr( aDes ); + TBool found = EFalse; + while( ( charPos = ptr.Find( aChar ) ) > 0 ) + { + found = ETrue; + TPtrC str = ptr.Left( charPos ); + aArray->AppendL( str ); + ptr.Set( ptr.Right( ptr.Length() - str.Length() - 1 ) ); + } + if ( found && ptr.Length() > 0 ) + { + aArray->AppendL( ptr ); + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +HBufC* CMusEngMceOutSession::ReadDescPropertyL( TUint aKey ) + { + MUS_LOG1( "mus: [ENGINE] -> CMusEngMceOutSession::ReadDescPropertyL: aKey: [%d]", + aKey ); + + TBuf buffer; + + User::LeaveIfError( RProperty::Get( NMusSessionApi::KCategoryUid, + aKey, + buffer ) ); + HBufC* desc = buffer.AllocL(); + MUS_LOG_TDESC( "mus: [ENGINE] <- CMusEngMceOutSession::ReadDescPropertyL: val: ", + (*desc) ); + return desc; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +HBufC* CMusEngMceOutSession::RemoteAddressL() const + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceOutSession::RemoteAddressL()" ) + + __ASSERT_ALWAYS( iRecipient, User::Leave( KErrNotReady ) ); + + HBufC* remoteAddr = HBufC::NewLC( iRecipient->Length() ); + TPtr ptrRemoteAddr( remoteAddr->Des() ); + User::LeaveIfError( + CnvUtfConverter::ConvertToUnicodeFromUtf8( + ptrRemoteAddr, *iRecipient ) ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngMceOutSession::RemoteAddressL()" ) + + CleanupStack::Pop( remoteAddr ); + return remoteAddr; + } + +// ----------------------------------------------------------------------------- +// From MLcSession, Should return the displayname of the remote terminal +// If found in phone book than contactname else user entered sip address +// ----------------------------------------------------------------------------- +// +const TDesC& CMusEngMceOutSession::RemoteDisplayName() + { + if ( !iRemoteDisplayName ) + { + return KNullDesC; + } + return *iRemoteDisplayName; + } + +// ----------------------------------------------------------------------------- +// Query to the user for sip address of the remote party. +// If the user entered a new sip address then reset the displayname +// to user entered sip address. +// ----------------------------------------------------------------------------- +// +void CMusEngMceOutSession::InputRecipientL( TDes& aRecipientAddress ) + { + if ( !LcUiProviderL().InputRecipient( aRecipientAddress ) ) + { + User::Leave( KErrCancel ); + } + /* displayname is no longer valid since user entered a new sip address + * and displayname will be set to sip address when invitation sent. + */ + delete iRemoteDisplayName; + iRemoteDisplayName = NULL; + } + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/src/musengmcesession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/src/musengmcesession.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,2140 @@ +/* +* Copyright (c) 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: +* +*/ + + +// USER +#include "mussettings.h" +#include "musengmcesession.h" +#include "musengsessiondurationtimer.h" +#include "musengmceutils.h" +#include "musuid.hrh" +#include "musenglogger.h" +#include "mussipprofilehandler.h" +#include "mussessionproperties.h" +#include "musenguriparser.h" +#include "musengtelephoneutils.h" + +// SYSTEM +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +const TInt KMusEngTimerInterval = 1000000; // 1 second +const TInt KMusEngRtcpInactivityThreshold = 20; // seconds +const TInt KMusEngArrayGranularity3 = 3; + +const TInt KMusEngSipReasonCodeOk = 200; +const TInt KMusEngSipReasonCodeBusyHere = 486; +_LIT8( KMusEngSipReasonPhraseBusyHere, "Busy Here" ); +_LIT8( KMusEngSipReasonPhraseBusy, "Busy" ); + +const TUint KMusEngDedicatedVideoPort = 49152; +const TUint KMusEngDedicatedAudioPort = 57344; + +#define MUS_CODEC_ARR_CONST_CAST( codecArr ) \ +( const_cast< RPointerArray< CMceVideoCodec >& >( codecArr ) ) + +// Names of AVC levels in string for config keys stored in CenRep +_LIT8( KMusAvcBitrateLevel1, "AvcBrL1=" ); +_LIT8( KMusAvcBitrateLevel1b, "AvcBrL1b=" ); +_LIT8( KMusAvcBitrateLevel1_1, "AvcBrL1_1=" ); +_LIT8( KMusAvcBitrateLevel1_2, "AvcBrL1_2=" ); +_LIT8( KMusAvcBitrateLevel1_3, "AvcBrL1_3=" ); +_LIT8( KMusAvcBitrateLevel2, "AvcBrL2=" ); + +_LIT8( KMusEncoderInfoTokenizer, ";" ); + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngMceSession::CMusEngMceSession() + : iSecondsFromLastRtcpReport ( 0 ), + // Although speaker is constructed as muted, it is not explicitly muted + iExplicitlyMuted( EFalse ), + iBackground( ETrue ) + { + iMceManagerUid.iUid = KMusUiUid; + iBackground = IsBackgroundStartup(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::ConstructL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::ConstructL()" ) + + iTelephoneUtils = CMusEngTelephoneUtils::NewL( *this ); + + // Creating new MCE Manager and set all needed observers to this class. + iManager = CMceManager::NewL( iMceManagerUid, + &iTransactionDataContainer ); + iManager->SetSessionObserver( this ); + iManager->SetInSessionObserver( this ); + iManager->SetMediaObserver( this ); + iManager->SetRtpObserver( this ); + + // Check if operator specific behavior is expected + iOperatorVariant = ( MultimediaSharingSettings::OperatorVariantSettingL() == + MusSettingsKeys::EOperatorSpecific ); + + // Update timer initialization + iUpdateTimer = CMusEngSessionDurationTimer::NewL( *this ); + + iSipProfileHandler = CMusSipProfileHandler::NewL( *this ); + + iRemoteDetails = HBufC::NewL( RProperty::KMaxPropertySize ); + iRemoteDetails->Des().Copy( KNullDesC ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::ConstructL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngMceSession::~CMusEngMceSession() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::~CMusEngMceSession()" ) + + delete iSipProfileHandler; + delete iSession; + delete iManager; + delete iUpdateTimer; + delete iTelephoneUtils; + delete iRemoteDetails; + + RProperty::Set( NMusSessionApi::KCategoryUid, + NMusSessionApi::KFastMode, + MusSettingsKeys::EFastModeDisabled ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::~CMusEngMceSession()" ) + } + +// ----------------------------------------------------------------------------- +// From MMusEngDisplayHandler +// ----------------------------------------------------------------------------- +// +TRect CMusEngMceSession::Rect() const + { + MUS_LOG( "mus: [ENGINE] CMusEngMceSession::Rect()" ) + return iRect; + } + +// ----------------------------------------------------------------------------- +// From MMusEngDisplayHandler +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::SetRectL( const TRect& aRect ) + { + MUS_LOG( "mus: [ENGINE] CMusEngSession::SetRectL()" ) + iRect = aRect; + RectChangedL(); + } + +// ----------------------------------------------------------------------------- +// From MMusEngDisplayHandler +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::SetSecondaryRectL( const TRect& aSecondaryRect ) + { + MUS_LOG( "mus: [ENGINE] CMusEngMceSession::SetSecondaryRectL()" ) + + // Same rect is set by primary and secondary setters + iRect = aSecondaryRect; + RectChangedL(); + } + +// ----------------------------------------------------------------------------- +// From MMusEngDisplayHandler +// ----------------------------------------------------------------------------- +// +TRect CMusEngMceSession::SecondaryRect() const + { + MUS_LOG( "mus: [ENGINE] CMusEngMceSession::SecondaryRect()" ) + return iRect; + } + +// ----------------------------------------------------------------------------- +// From MMusEngDisplayHandler +// ----------------------------------------------------------------------------- +// +MMusEngDisplayHandler::TDisplayOrientation CMusEngMceSession::OrientationL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::RotationL()" ) + + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + CMceDisplaySink* display = MusEngMceUtils::GetDisplayL( *iSession ); + + TDisplayOrientation displayOrientation; + CMceDisplaySink::TRotation rotation( display->RotationL() ); + + MUS_LOG1( "mus: [ENGINE] MCE rotation is %d", rotation ) + + if ( rotation == CMceDisplaySink::ENone ) + { + displayOrientation = CMusEngMceSession::EPortrait; + } + else + { + displayOrientation = CMusEngMceSession::ELandscape; + } + + MUS_LOG1( "mus: [ENGINE] <- CMusEngMceSession::RotationL() %d", + displayOrientation ) + + return displayOrientation; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::SetOrientationL( TDisplayOrientation aOrientation ) + { + MUS_LOG1( "mus: [ENGINE] -> CMusEngMceSession::SetOrientationL() %d", + aOrientation ) + + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + CMceDisplaySink* display = MusEngMceUtils::GetDisplayL( *iSession ); + + if ( aOrientation == EPortrait ) + { + display->SetRotationL( CMceDisplaySink::ENone ); + } + else + { + display->SetRotationL( CMceDisplaySink::EClockwise90Degree ); + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::SetOrientationL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::EnableDisplayL( TBool aEnable ) + { + MUS_LOG1( "mus: [ENGINE] -> CMusEngMceSession::EnableDisplay() %d", + aEnable ) + + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + CMceDisplaySink* display = MusEngMceUtils::GetDisplayL( *iSession ); + + if ( aEnable ) + { + if ( !display->IsEnabled() ) + { + display->EnableL(); + MUS_LOG( " Display enabled" ) + if ( !iExplicitlyMuted ) + { + // Since speaker is not explicitly muted, but disabled as + // a consequence of disabling bundled display, it must be + // unmuted. + DoMuteSpeakerL( EFalse ); + MUS_LOG( " Bundled speaker enabled" ) + } + } + else + { + MUS_LOG( " Display already enabled, ignore" ) + } + } + else + { + if ( display->IsEnabled() ) + { + display->DisableL(); + MUS_LOG( " Display disabled" ) + if ( !iExplicitlyMuted ) + { + // Speaker will not be explicitly muted, but disabled as + // a consequence of disabling bundled display. + DoMuteSpeakerL( ETrue ); + MUS_LOG( " Bundled speaker disabled" ) + } + } + else + { + MUS_LOG( " Display already disabled, ignore" ) + } + } + + + MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::EnableDisplay()") + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMusEngMceSession::IsDisplayEnabled() + { + TBool enabled( EFalse ); + if ( iSession ) + { + CMceDisplaySink* display = + MusEngMceUtils::GetDisplay( *iSession, ETrue ); + if ( display ) + { + enabled = display->IsEnabled(); + } + } + return enabled; + } + +// ----------------------------------------------------------------------------- +// From MMusEngDisplayHandler +// ----------------------------------------------------------------------------- +// +TBool CMusEngMceSession::IsDisplayActive() + { + return ( IsDisplayEnabled() ); + } + +// ----------------------------------------------------------------------------- +// From MMusEngAudioRoutingObserver +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::AudioRoutingChanged() + { + InformObserverAboutPlayerUpdate( LocalVideoPlayer() ); + InformObserverAboutPlayerUpdate( RemoteVideoPlayer() ); + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +MLcSession::TLcSessionState CMusEngMceSession::LcSessionState() const + { + TLcSessionState lcSessionState = MLcSession::EUninitialized; + + if ( iSession ) + { + switch( iSession->State() ) + { + case CMceSession::EIdle: + { + lcSessionState = MLcSession::EInitialized; + break; + } + case CMceSession::EIncoming: + case CMceSession::EProceeding: + case CMceSession::EReserving: + { + lcSessionState = MLcSession::EReceived; + break; + } + + case CMceSession::EOffering: + case CMceSession::EAnswering: + { + lcSessionState = MLcSession::EOpening; + break; + } + case CMceSession::EEstablished: + { + lcSessionState = MLcSession::EOpen; + break; + } + case CMceSession::ECancelling: + case CMceSession::ETerminating: + { + lcSessionState = MLcSession::EClosing; + break; + } + case CMceSession::ETerminated: + { + lcSessionState = MLcSession::EClosed; + break; + } + default: + { + lcSessionState = MLcSession::EUninitialized; + break; + } + } + } + return lcSessionState; + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::SetLcSessionObserver( MLcSessionObserver* aObserver ) + { + iLcSessionObserver = aObserver; + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::SetLcUiProvider( MLcUiProvider* aUiProvider ) + { + iLcUiProvider = aUiProvider; + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +MLcVideoPlayer* CMusEngMceSession::RemoteVideoPlayer() + { + return NULL; + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +MLcVideoPlayer* CMusEngMceSession::LocalVideoPlayer() + { + return NULL; + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +const TDesC& CMusEngMceSession::LocalDisplayName() + { + return KNullDesC; + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +const TDesC& CMusEngMceSession::RemoteDisplayName() + { + return KNullDesC; + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +TInt CMusEngMceSession::SetParameter( TInt /*aId*/, TInt /*aValue*/ ) + { + return KErrNotSupported; + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +TInt CMusEngMceSession::ParameterValue( TInt /*aId*/ ) + { + return KErrNotSupported; + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +TBool CMusEngMceSession::IsBackgroundStartup() + { + TInt fastMode; + TInt error = RProperty::Get( NMusSessionApi::KCategoryUid, + NMusSessionApi::KFastMode, + fastMode ); + + return ( error == KErrNone && + iBackground && + fastMode == MusSettingsKeys::EFastModeOn ); + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +TInt CMusEngMceSession::SetForegroundStatus( TBool aIsForeground ) + { + MUS_LOG1( "mus: [ENGINE] -> CMusEngMceSession::SetForegroundStatus() %d", + aIsForeground ) + + if ( aIsForeground ) + { + // Only clear the bg info, do not ever enable it again + iBackground = EFalse; + } + + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +const TDesC& CMusEngMceSession::RemoteDetails() + { + // Don't care about error, empty value will be used in that case + TPtr ptrDetails( iRemoteDetails->Des() ); + RProperty::Get( NMusSessionApi::KCategoryUid, + NMusSessionApi::KTelNumber, + ptrDetails ); + return *iRemoteDetails; + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::UpdateLcSessionL() + { + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + //In Mus engine, every update of player has immediate effect. Thus, this method + //is empty. + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +TBool CMusEngMceSession::SendDialTone( TChar /*aKey*/) + { + // Handle Key once implemented + return ETrue; + } + +// ----------------------------------------------------------------------------- +// From MLcAudioControl +// ----------------------------------------------------------------------------- +// +TBool CMusEngMceSession::IsLcAudioMutedL() + { + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + TBool containsAudio( EFalse ); + for ( TInt i = 0; i < iSession->Streams().Count(); ++i ) + { + if ( iSession->Streams()[i]->Type() == KMceAudio ) + { + containsAudio = ETrue; + } + } + + if ( containsAudio && !iExplicitlyMuted ) + { + return EFalse; + } + + return ETrue; + } + +// ----------------------------------------------------------------------------- +// From MLcAudioControl +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::MuteLcAudioL( TBool aMute ) + { + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + DoMuteSpeakerL( aMute ); + iExplicitlyMuted = aMute; + } + +// ----------------------------------------------------------------------------- +// From MLcAudioControl +// ----------------------------------------------------------------------------- +// +TBool CMusEngMceSession::IsLcMicMutedL() + { + return iTelephoneUtils->IsMicMutedL(); + } + +// ----------------------------------------------------------------------------- +// From MLcAudioControl +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::MuteLcMicL( TBool aMute ) + { + iTelephoneUtils->MuteMicL( aMute ); + } + +// ----------------------------------------------------------------------------- +// From MLcAudioControl +// ----------------------------------------------------------------------------- +// +TBool CMusEngMceSession::IsEnablingLcLoudspeakerAllowed() + { + return iTelephoneUtils->AudioRoutingCanBeChanged(); + } + +// ----------------------------------------------------------------------------- +// From MLcAudioControl +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::EnableLcLoudspeakerL( TBool aEnabled ) + { + TRAPD( error, iTelephoneUtils->LoudspeakerL( aEnabled ) ) + + if ( error != KErrNone ) + { + // This is writed for emulator use + if ( error != KErrNotSupported ) + { + MUS_LOG1( "mus: [ENGINE] CMusEngSession::EnableLoudspeakerL() Leave: #%d", + error ) + User::Leave( error ); + } + // Not leave in emulator if KErrNotSupported + #if (!defined (__WINS__) && !defined(__WINSCW__)) + User::Leave( error ); + #endif + } + } + +// ----------------------------------------------------------------------------- +// From MLcAudioControl +// ----------------------------------------------------------------------------- +// +TBool CMusEngMceSession::IsLcLoudspeakerEnabled() + { + return iTelephoneUtils->IsLoudSpeakerEnabled(); + } + +// ----------------------------------------------------------------------------- +// From MLcAudioControl +// ----------------------------------------------------------------------------- +// +TInt CMusEngMceSession::LcVolumeL() + { + return iTelephoneUtils->GetVolumeL(); + } + +// ----------------------------------------------------------------------------- +// From MLcAudioControl +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::SetLcVolumeL( TInt aValue ) + { + iTelephoneUtils->SetVolumeL( aValue ); + } + +// ----------------------------------------------------------------------------- +// From MLcAudioControl +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::IncreaseLcVolumeL() + { + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + TInt currentVolume = iTelephoneUtils->GetVolumeL(); + iTelephoneUtils->SetVolumeL( currentVolume + 1 ); + SetSpeakerVolumeL( LcVolumeL() ); + } + +// ----------------------------------------------------------------------------- +// From MLcAudioControl +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::DecreaseLcVolumeL() + { + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + TInt currentVolume = iTelephoneUtils->GetVolumeL(); + iTelephoneUtils->SetVolumeL( currentVolume - 1 ); + SetSpeakerVolumeL( LcVolumeL() ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +MLcSessionObserver* CMusEngMceSession::LcSessionObserver() + { + return iLcSessionObserver; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +MLcUiProvider* CMusEngMceSession::LcUiProvider() + { + return iLcUiProvider; + } + +// ----------------------------------------------------------------------------- +// Returns estabilished session time. If not established return +// value is < 0 +// ----------------------------------------------------------------------------- +// +TTimeIntervalSeconds CMusEngMceSession::GetSessionTime() const + { + if ( iSession && iSession->State() == CMceSession::EEstablished ) + { + TTime time; + TTimeIntervalSeconds seconds; + time.HomeTime(); + + time.SecondsFrom( iStartTime, seconds ); + + return seconds; + } + + return TTimeIntervalSeconds( KErrNotReady ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::RectChangedL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::RectChangedL()" ) + + // If session is not yet created, do nothing + if ( iSession && iSession->State() != CMceSession::ETerminated ) + { + // Rely on having just one display + CMceDisplaySink* display = MusEngMceUtils::GetDisplayL( *iSession ); + display->SetDisplayRectL( Rect() ); + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::RectChangedL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::InformObserverAboutSessionStateChange() + { + if ( iLcSessionObserver ) + { + iLcSessionObserver->StateChanged( *this ); + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::InformObserverAboutSessionUpdate() + { + if ( iLcSessionObserver ) + { + iLcSessionObserver->Updated( *this ); + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::InformObserverAboutSessionFailure( TInt aReason ) + { + if ( iLcSessionObserver ) + { + iLcSessionObserver->Failed( *this, aReason ); + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::InformObserverAboutPlayerStateChange( + MLcVideoPlayer* aPlayer ) + { + if ( iLcSessionObserver && aPlayer ) + { + iLcSessionObserver->StateChanged( *aPlayer ); + } + + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::InformUiProviderAboutReceivingStart() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::InformUiProviderAboutReceivingStart()" ) + if ( iBackground && iLcUiProvider ) + { + MUS_LOG( "mus: [ENGINE] receiving started in BG mode, switching to FG" ) + iLcUiProvider->HandleForegroundStatus( ETrue ); + } + MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::InformUiProviderAboutReceivingStart()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::InformObserverAboutPlayerUpdate( + MLcVideoPlayer* aPlayer ) + { + if ( iLcSessionObserver && aPlayer ) + { + iLcSessionObserver->Updated( *aPlayer ); + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::InformObserverAboutPlayerFailure( + MLcVideoPlayer* aPlayer, + TInt aReason ) + { + if ( iLcSessionObserver && aPlayer ) + { + iLcSessionObserver->Failed( *aPlayer, aReason ); + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +MLcUiProvider& CMusEngMceSession::LcUiProviderL() + { + __ASSERT_ALWAYS( iLcUiProvider, User::Leave( KErrNotReady ) ); + return *iLcUiProvider; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::AddSdpBandwidthAttributesL( CDesC8Array& aSdpLinesArray, + TInt aBandwidthAs ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::AddSdpBandwidthAttributesL()" ) + const TInt KMusNumberMaxLength = 10; + HBufC8* bandwidth = HBufC8::NewLC( + KMusEngSessionSdpLineTiasLine().Length() + KMusNumberMaxLength ); + + bandwidth->Des().Copy( KMusEngSessionSdpLineBandwidthLine() ); + bandwidth->Des().AppendNum( aBandwidthAs ); + bandwidth->Des().Append( KMusEngNewLine() ); + aSdpLinesArray.AppendL( *bandwidth ); + + bandwidth->Des().Copy( KMusEngSessionSdpLineTiasLine() ); + bandwidth->Des().AppendNum( aBandwidthAs * KMusTiasMultiplier ); + bandwidth->Des().Append( KMusEngNewLine() ); + aSdpLinesArray.AppendL( *bandwidth ); + + CleanupStack::PopAndDestroy( bandwidth ); + MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::AddSdpBandwidthAttributesL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMusEngMceSession::IsBandwidthAttributeSet( MDesC8Array* aSdpLinesArray ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::IsBandwidthAttributeSet()" ) + TBool ret = + ContainsText( aSdpLinesArray, KMusEngSessionSdpLineTiasLine() ) || + ContainsText( aSdpLinesArray, KMusEngSessionSdpLineBandwidthLine() ); + MUS_LOG1( "mus: [ENGINE] <- CMusEngMceSession::IsBandwidthAttributeSet(): %d", + ret ) + return ret; + } + +// ----------------------------------------------------------------------------- +// Setting session level sdp lines. Bandwith attribute is always used in +// operator variant mode and at receiver side (using force) when TIAS +// usage is disabled. However, bandwidth attribute is preferred to be used +// at media level (see SetMediaSdpLinesL method). It is set to session level +// only if other side is using also session level bandwidth. Media level +// preference exists because some other manufacturer's videosharing does not +// understand session level bandwidth attribute. +// In non-operator variant mode and when TIAS usage is enabled, both AS and +// TIAS are added to session level only if the other side is using session +// level bandwidth. +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::SetSessionSdpLinesL( + CMceSession& aSession, + TBool aForceBandwidthLine ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::SetSessionSdpLinesL()" ) + + MDesC8Array* oldSessionSdpLines = aSession.SessionSDPLinesL(); + CleanupDeletePushL( oldSessionSdpLines ); + TBool bandwidthAtSessionLevel( ContainsText( oldSessionSdpLines, + KMusEngSessionSdpLineBandwidthLine() ) ); + TBool tiasAtSessionLevel( ContainsText( oldSessionSdpLines, + KMusEngSessionSdpLineTiasLine() ) ); + CleanupStack::PopAndDestroy( oldSessionSdpLines ); + + TInt bandwidthAs = 0; + TRAPD( err, bandwidthAs = + MultimediaSharingSettings::VideoBandwidthSettingL() ); + __ASSERT_ALWAYS( err == KErrNone || err == KErrNotFound, + User::Leave( err ) ); + TBool useTias = ( bandwidthAs > 0 ); + + CDesC8Array* newSessionSDPLines = + new ( ELeave ) CDesC8ArrayFlat( KMusEngArrayGranularity3 ); + CleanupStack::PushL( newSessionSDPLines ); + + if ( iOperatorVariant ) + { + newSessionSDPLines->AppendL( KMusEngSessionSdpLineApplication() ); + newSessionSDPLines->AppendL( KMusEngSessionSdpLineType() ); + } + else + { + newSessionSDPLines->AppendL( KMusEngSessionSdpLineXApplication() ); + } + + if ( bandwidthAtSessionLevel && ( iOperatorVariant || + ( aForceBandwidthLine && !useTias ) ) ) + { + MUS_LOG( "mus: [ENGINE] setting bandwidth to session level" ) + newSessionSDPLines->AppendL( KMusEngSessionSdpLineBandwidthField() ); + } + else if ( !iOperatorVariant && useTias && aForceBandwidthLine && + ( bandwidthAtSessionLevel || tiasAtSessionLevel ) ) + { + MUS_LOG( "mus: [ENGINE] setting b=AS and b=TIAS to session level" ) + AddSdpBandwidthAttributesL( *newSessionSDPLines, bandwidthAs ); + } + + aSession.SetSessionSDPLinesL( newSessionSDPLines ); + + CleanupStack::Pop( newSessionSDPLines ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::SetSessionSdpLinesL()" ) + } + + +// ----------------------------------------------------------------------------- +// Setting media level sdp lines. In operator variant mode or when TIAS usage +// is disabled bandwidth is not set to media level if it is used already at +// session level. In non operator variant and TIAS enabled case both AS and +// TIAS attributes are set to media level if: 1)it is an outcoming sessions +// or 2) incoming session had bandwidth attributes on media level or didn't +// have bandwidth attributes at all +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::SetMediaSdpLinesL( + CMceMediaStream& aStream, + TBool aForceBandwidthLine ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::SetMediaSdpLinesL()" ) + + MDesC8Array* sessionSdpLines = aStream.Session()->SessionSDPLinesL(); + CleanupDeletePushL( sessionSdpLines ); + TBool bandwidthAtSessionLevel( ContainsText( sessionSdpLines, + KMusEngSessionSdpLineBandwidthLine() ) ); + + TInt bandwidthAs = 0; + TRAPD( error, bandwidthAs = + MultimediaSharingSettings::VideoBandwidthSettingL() ); + __ASSERT_ALWAYS( error == KErrNone || error == KErrNotFound, + User::Leave( error ) ); + TBool useTias = ( bandwidthAs > 0 ); + TBool tiasOrAsAtSessionLevel = EFalse; + TBool tiasOrAsAtMediaLevel = EFalse; + if ( useTias ) + { + tiasOrAsAtSessionLevel = IsBandwidthAttributeSet( sessionSdpLines ); + MDesC8Array* mediaSdpLines = aStream.MediaAttributeLinesL(); + tiasOrAsAtMediaLevel = IsBandwidthAttributeSet( mediaSdpLines ); + delete mediaSdpLines; + } + + CleanupStack::PopAndDestroy( sessionSdpLines ); + + TBool setTiasAtMediaLevel = ( tiasOrAsAtMediaLevel || + ( aForceBandwidthLine && + !tiasOrAsAtSessionLevel ) ); + + const TInt KMusMediaSdpLinesGranularity = 2; + CDesC8Array* headers = + new ( ELeave ) CDesC8ArrayFlat( KMusMediaSdpLinesGranularity ); + CleanupStack::PushL( headers ); + + if ( !bandwidthAtSessionLevel && ( iOperatorVariant || + ( aForceBandwidthLine && !useTias ) ) ) + { + MUS_LOG( "mus: [ENGINE] setting bandwidth to media level" ) + headers->AppendL( KMusEngSessionSdpLineBandwidthField() ); + } + else if ( !iOperatorVariant && useTias && setTiasAtMediaLevel ) + { + MUS_LOG( "mus: [ENGINE] setting b=AS and b=TIAS to media level" ) + AddSdpBandwidthAttributesL( *headers, bandwidthAs ); + } + + aStream.SetMediaAttributeLinesL( headers ); + CleanupStack::Pop( headers ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::SetMediaSdpLinesL()" ) + } + +// ----------------------------------------------------------------------------- +// Changes volume of all speaker sinks in the session structure +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::SetSpeakerVolumeL( TInt aNewVolume ) + { + TInt sessionState = iSession->State(); + + if ( sessionState != CMceSession::EIdle && + sessionState != CMceSession::EIncoming ) + { + for ( TInt i = 0; i < iSession->Streams().Count(); ++i ) + { + CMceSpeakerSink* speaker = + MusEngMceUtils::GetSpeaker( *( iSession->Streams()[i] ) ); + + if ( speaker && + aNewVolume >= 1 && + aNewVolume <= speaker->MaxVolumeL() ) + { + speaker->SetVolumeL( aNewVolume ); + } + + } + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::AdjustStreamsAndCodecsL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::AdjustStreamsAndCodecsL" ) + + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + const RPointerArray& streams = iSession->Streams(); + + for ( TInt i = 0; i < streams.Count(); ++i ) + { + if ( streams[i]->Type() == KMceVideo ) + { + CMceVideoStream* videoStream = + static_cast( streams[i] ); + + AdjustVideoStreamL( *videoStream ); + + if ( videoStream->BoundStream() ) + { + AdjustVideoStreamL( static_cast + ( videoStream->BoundStreamL() ) ); + } + } + else // audio + { + CMceAudioStream* audioStream = + static_cast( streams[i] ); + + AdjustAudioStreamL( *audioStream ); + + if ( audioStream->BoundStream() ) + { + AdjustAudioStreamL( static_cast + ( audioStream->BoundStreamL() ) ); + } + + } + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::AdjustStreamsAndCodecsL" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::AdjustVideoStreamL( CMceVideoStream& aVideoStream ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::AdjustVideoStreamL" ) + + aVideoStream.SetLocalMediaPortL( KMusEngDedicatedVideoPort ); + + DoCodecSelectionL( aVideoStream ); + + const RPointerArray& codecs = aVideoStream.Codecs(); + + __ASSERT_ALWAYS( aVideoStream.Source(), User::Leave( KErrArgument ) ); + for ( TInt codecIndex = 0; codecIndex < codecs.Count(); ++codecIndex ) + { + AdjustVideoCodecL( *codecs[codecIndex], aVideoStream.Source()->Type() ); + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::AdjustVideoStreamL" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::AdjustAudioStreamL( CMceAudioStream& aAudioStream ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::AdjustAudioStreamL" ) + + aAudioStream.SetLocalMediaPortL( KMusEngDedicatedAudioPort ); + + const RPointerArray codecs = aAudioStream.Codecs(); + + for ( TInt codecIndex = 0; codecIndex < codecs.Count(); ++codecIndex ) + { + AdjustAudioCodecL( *codecs[codecIndex] ); + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::AdjustAudioStreamL" ) + } + +// ----------------------------------------------------------------------------- +// Calls CMceInSession::RejectL() inside TRAP_IGNORE +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::Reject( CMceInSession& aSession, + const TDesC8& aReason, + TUint32 aCode ) + { + if ( aCode != 0 || aReason != KNullDesC8() ) + { + TRAP_IGNORE( aSession.RejectL( aReason, aCode, NULL, NULL, NULL ) ) + } + else + { + if ( iOperatorVariant ) + { + // In operator variant, session is rejected with 486 instead of 603. + // Also the reason phrase is supposed to be "Busy". + TRAP_IGNORE( aSession.RejectL( KMusEngSipReasonPhraseBusy(), + KMusEngSipReasonCodeBusyHere ) ) + } + else + { + // Normal case + TRAP_IGNORE( aSession.RejectL() ) + } + } + } + +// ----------------------------------------------------------------------------- +// By default rejects all incoming sessions immediately without notifying UI +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::IncomingSession( + CMceInSession* aSession, + TMceTransactionDataContainer* /*aContainer*/ ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::IncomingSession()" ) + + Reject( *aSession, + KMusEngSipReasonPhraseBusyHere(), + KMusEngSipReasonCodeBusyHere ); + + delete aSession; + aSession = NULL; + + MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::IncomingSession()" ) + } + +// ----------------------------------------------------------------------------- +// By default rejects all incoming updates immediately without notifying UI +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::IncomingUpdate( + CMceSession& aOrigSession, + CMceInSession* aUpdatedSession, + TMceTransactionDataContainer* /*aContainer*/ ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::IncomingUpdate()" ) + + if ( iSession && + iSession == &aOrigSession ) + { + // Old session is useless from now on + delete iSession; + iSession = aUpdatedSession; + MUS_LOG( "mus: [ENGINE] Unexpected update, reject" ) + Reject( *aUpdatedSession ); + } + else + { + // This should never happen + MUS_LOG( "mus: [ENGINE] Unknown update, reject and delete" ) + Reject( *aUpdatedSession ); + delete aUpdatedSession; + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::IncomingUpdate()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::StreamStateChanged( CMceMediaStream& aStream ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::StreamStateChanged()" ) + + if ( !iSession ) + { + return; // We cannot do anything + } + + MUS_ENG_LOG_STREAM_STATE( aStream ) + + switch ( aStream.State() ) + { + case CMceMediaStream::EUninitialized: // Stream is created + { + // Unexpected state change + break; + } + case CMceMediaStream::EInitialized: // Stream is initialized + { + // Should be handled in sibling classes if needed + break; + } + case CMceMediaStream::EBuffering: // Stream is buffering + { + // Should be handled in sibling classes if needed + break; + } + case CMceMediaStream::EIdle: // Stream is not receiving RTP + { + // NOP + break; + } + case CMceMediaStream::EStreaming: // Stream is streaming + { + StreamStreaming( aStream ); + break; + } + case CMceMediaStream::EDisabled: // Stream is explicitly disabled + { + break; + } + case CMceMediaStream::ENoResources: + { + // Stream has no needed resources to stream + break; + } + case CMceMediaStream::ETranscodingRequired: + { + // Stream requires non-realtime transcoding + // Should be handled in sibling classes + break; + } + case CMceMediaStream::ETranscoding: + { + // Stream is transcoding in non-realtime + // Should be handled in sibling classes + break; + } + default: + { + break; + } + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::StreamStateChanged()" ) + + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::StreamStateChanged( CMceMediaStream& aStream, + CMceMediaSource& /*aSource*/ ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::StreamStateChanged( src )" ) + // Use default logic + StreamStateChanged( aStream ); + MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::StreamStateChanged( src )" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::StreamStateChanged( CMceMediaStream& aStream, + CMceMediaSink& /*aSink*/ ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::StreamStateChanged( sink )" ) + // Use default logic + StreamStateChanged( aStream ); + MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::StreamStateChanged( sink )" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::SessionStateChanged( + CMceSession& aSession, + TMceTransactionDataContainer* aContainer ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::SessionStateChanged()" ) + + if ( !aContainer ) + { + // Container should never be NULL, but if it is, handle as + // internal error + InformObserverAboutSessionFailure( KErrGeneral ); + return; + } + + // This is the only point to get statuscode and reasonphrase. With this call + // they are zeroed and thus cannot be got anymore. + TInt statusCode = aContainer->GetStatusCode(); + HBufC8* reasonPhrase = aContainer->GetReasonPhrase(); + + if ( reasonPhrase ) + { + HandleSessionStateChanged( aSession, statusCode, *reasonPhrase ); + delete reasonPhrase ; + } + else + { + HandleSessionStateChanged( aSession, statusCode, KNullDesC8() ); + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::SessionStateChanged()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::SessionConnectionStateChanged( CMceSession& aSession, + TBool aActive ) + { + MUS_LOG1( "mus: [ENGINE] CMusEngMceSession::\ + SessionConnectionStateChanged() active = %b", aActive ) + + if ( iSession && iSession == &aSession ) + { + if ( !aActive ) + { + MUS_LOG( "mus: [ENGINE] CMusEngMceSession::\ + SessionConnectionStateChanged: Notify observer" ) + InformObserverAboutSessionFailure( MLcSession::EConnectionLost ); + } + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::\ + SessionConnectionStateChanged()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::Failed( CMceSession& aSession, TInt aError ) + { + MUS_LOG1( "mus: [ENGINE] -> CMusEngMceSession::Failed() error #%d", + aError ) + + if ( iSession && iSession == &aSession ) + { + MUS_LOG( "mus: [ENGINE] CMusEngMceSession::Failed: Notify observer" ) + InformObserverAboutSessionFailure( aError ); + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::Failed()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::UpdateFailed( + CMceSession& aSession, + TMceTransactionDataContainer* aContainer ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::UpdateFailed()" ) + + if ( !aContainer ) + { + // Container should never be NULL, but if it is, handle as + // internal error + InformObserverAboutSessionFailure( KErrGeneral ); + return; + } + + if ( iSession && iSession == &aSession ) + { + MUS_LOG( "mus: [ENGINE] CMusEngMceSession::UpdateFailed: \ + Notify observer" ) + InformObserverAboutSessionFailure( KErrGeneral ); + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::UpdateFailed()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::SRReceived( CMceSession& aSession, + CMceMediaStream& aStream) + { + // No logging because of amount of reports + if ( iSession && + iSession == &aSession ) + { + for ( TInt i = 0; i < iSession->Streams().Count(); ++i ) + { + if ( &aStream == iSession->Streams()[i] ) + { + iSecondsFromLastRtcpReport = 0; + } + } + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::RRReceived( CMceSession& aSession, + CMceMediaStream& aStream) + { + // No logging because of amount of reports + + if ( iSession && + iSession == &aSession ) + { + for ( TInt i = 0; i < iSession->Streams().Count(); ++i ) + { + if ( &aStream == iSession->Streams()[i] ) + { + iSecondsFromLastRtcpReport = 0; + } + } + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::InactivityTimeout( CMceMediaStream& aStream, + CMceRtpSource& /*aSource*/ ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::InactivityTimeout()" ) + // This function may be deprecated in future and after that similar + // functionality can be obtained by observing stream state EIdle. + // Anyway it does not work yet and until then, informing UI about + // RTP inactivity is done in this function. + + if ( aStream.Type() == KMceVideo ) + { + InformObserverAboutPlayerStateChange( RemoteVideoPlayer() ); + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::InactivityTimeout()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::SsrcAdded( CMceMediaStream& /*aStream*/, + CMceRtpSource& /*aSource*/, + TUint /*aSsrc*/ ) + { + MUS_LOG( "mus: [ENGINE] CMusEngMceSession::SsrcAdded( ... )" ) + // NOP, We are not at all interested about SSRCs + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::SsrcRemoved( CMceMediaStream& /*aStream*/, + CMceRtpSource& /*aSource*/, + TUint /*aSsrc*/ ) + { + MUS_LOG( "mus: [ENGINE] CMusEngMceSession::SsrcRemoved(... )" ) + // NOP, We are not at all interested about SSRCs + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMusEngMceSession::IsRoamingBetweenAPsAllowed() + { + TBool allowed( ETrue ); + if ( iSession && + iSession->State() != CMceSession::EIdle && + iSession->State() != CMceSession::ETerminated ) + { + allowed = EFalse; + } + return allowed; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::ProfileRegistered() + { + // NOP in base class + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::HandleSessionStateChanged( CMceSession& aSession, + TInt aStatusCode, + const TDesC8& aReasonPhrase ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::HandleSessionStateChanged" ) + + MUS_ENG_LOG_SESSION_STATE_AND_STATUS( aSession, aStatusCode, aReasonPhrase ) + + if ( iSession && iSession == &aSession ) + { + switch ( aSession.State() ) + { + case CMceSession::EIdle: + case CMceSession::EIncoming: + { + MUS_LOG( "mus: [ENGINE] Unexpected asynchronous \ + state transition, consider session as failed." ) + InformObserverAboutSessionFailure( KErrGeneral ); + break; + } + case CMceSession::EEstablished: + { + if ( iStoreEncoderConfigInfo ) + { + iStoreEncoderConfigInfo = EFalse; + TRAPD( error, StoreEncoderConfigInfoL() ) + if ( error != KErrNone && error != KErrNotFound ) + { + // Only acceptable error is absence of repository entry, + // otherwise we inform user about failed session. + InformObserverAboutSessionFailure( error ); + return; + } + } + + // Check that session timer is not already running, which is + // the case when refreshing the session with session timer + if ( !iUpdateTimer->IsActive() ) + { + iStartTime.HomeTime(); // Start counting session duration + iUpdateTimer->Start( KMusEngTimerInterval ); + InformObserverAboutSessionStateChange(); + } + + break; + } + case CMceSession::EOffering: + case CMceSession::EReserving: + case CMceSession::EAnswering: + case CMceSession::EProceeding: + case CMceSession::ECancelling: + case CMceSession::ETerminating: + { + // NOP + break; + } + case CMceSession::ETerminated: + { + HandleTermination( aStatusCode, aReasonPhrase ); + break; + } + default: + { + MUS_LOG( "mus: [ENGINE] CMusEngMceSession::SessionStateChanged(), \ + default case" ) + break; + } + } + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::HandleSessionStateChanged" ) + } + +// ----------------------------------------------------------------------------- +// This function should be called only if sibling classes cannot handle +// termination reason by themselves. +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::HandleTermination( TInt aStatusCode, + const TDesC8& /*aReasonPhrase*/ ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::HandleTermination()" ) + + iSipProfileHandler->RefreshIapAvailabilities(); + + switch ( aStatusCode ) + { + case 0: + { + // Normal session termination or session by another end. + InformObserverAboutSessionStateChange(); + break; + } + case KMusEngSipReasonCodeOk: + { + // Normal session termination by this end: We have sent BYE + // and now received 200 OK to it. + InformObserverAboutSessionStateChange(); + break; + } + default: + { + // Termination reason cannot be determined, handle as internal + // error. + InformObserverAboutSessionFailure( KErrGeneral ); + break; + } + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::HandleTermination()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::AdjustVideoCodecL( CMceVideoCodec& aVideoCodec, + TMceSourceType aSourceType ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::AdjustVideoCodecL()" ) + + aVideoCodec.SetMMFPriorityL( KAudioPrioritySwisPlayback ); + aVideoCodec.SetMMFPriorityPreferenceL( KAudioPrefSwisPlayback ); + + if ( aVideoCodec.SdpName() == KMceSDPNameH264() && + aSourceType == KMceCameraSource ) + { + SetCodecConfigKeyL( aVideoCodec ); + SetEncodingDeviceL( aVideoCodec ); + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::AdjustVideoCodecL()" ) + } + +// ----------------------------------------------------------------------------- +// 1. Sets MMF audio priority and preference +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::AdjustAudioCodecL( CMceAudioCodec& aAudioCodec ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::AdjustAudioCodecL()" ) + + aAudioCodec.SetMMFPriorityL( KAudioPrioritySwisPlayback ); + aAudioCodec.SetMMFPriorityPreferenceL( KAudioPrefSwisPlayback ); + MUS_LOG( "mus: [ENGINE] Audio MMF priority and preference set" ) + + MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::AdjustAudioCodecL()" ) + } + +// ----------------------------------------------------------------------------- +// Remove multiples of H.263 codec, prefer H263-2000 over H263-1998. +// Additionally select just the one with best quality from selected mode. +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::DoCodecSelectionL( CMceVideoStream& aVideoStream ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::DoCodecSelectionL()" ) + + const RPointerArray& codecs = aVideoStream.Codecs(); + TBool codecModeBasedRemovalNeeded( EFalse ); + // Label:H263 + TBool H2632000CodecFound( EFalse ); + TBool H2631998CodecFound( EFalse ); + for ( TInt codecIndex = 0; codecIndex < codecs.Count(); ++codecIndex ) + { + const CMceVideoCodec& currentCodec = *codecs[codecIndex]; + if ( currentCodec.SdpName().FindF( KMceSDPNameH263 ) != KErrNotFound ) + { + if ( !currentCodec.SdpName().CompareF( KMceSDPNameH2632000 ) ) + { + H2632000CodecFound = ETrue; + codecModeBasedRemovalNeeded = H2631998CodecFound; + } + else if ( !currentCodec.SdpName().CompareF( KMceSDPNameH2631998 ) ) + { + H2631998CodecFound = ETrue; + codecModeBasedRemovalNeeded = H2632000CodecFound; + } + else + { + // NOP + } + } + } + if ( codecModeBasedRemovalNeeded ) + { + DoCodecModeBasedRemovalL( aVideoStream ); + } + + const RPointerArray& codecs2 = aVideoStream.Codecs(); + const CMceVideoCodec* bestBitrateCodec( NULL ); + for ( TInt codecIndex = 0; codecIndex < codecs2.Count(); ++codecIndex ) + { + const CMceVideoCodec& currentCodec = *codecs2[codecIndex]; + if ( currentCodec.SdpName().FindF( KMceSDPNameH263 ) != KErrNotFound ) + { + if ( !bestBitrateCodec || + currentCodec.MaxBitRate() > bestBitrateCodec->MaxBitRate() ) + { + bestBitrateCodec = ¤tCodec; + } + } + } + if ( bestBitrateCodec ) + { + DoBitrateBasedRemovalL( aVideoStream, *bestBitrateCodec ); + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::DoCodecSelectionL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::UpdateTimerEvent() + { + // Update timer is used also to detect RTCP inactivity + ++iSecondsFromLastRtcpReport; + + if ( iSecondsFromLastRtcpReport >= KMusEngRtcpInactivityThreshold ) + { + MUS_LOG( "mus: [ENGINE] CMusEngMceSession::UpdateTimerEvent() ->EMediaInactivityTimeout" ) + InformObserverAboutSessionFailure( MLcSession::EMediaInactivityTimeout ); + // Disable calling multiple times by reseting timer + iSecondsFromLastRtcpReport = 0; + } + + iUpdateTimer->Start( KMusEngTimerInterval ); + } + +// ----------------------------------------------------------------------------- +// Enables or disables all the speaker sinks of all the audio streams +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::DoMuteSpeakerL( TBool aMute ) + { + MUS_LOG1( "mus: [ENGINE] -> CMusEngMceSession::MuteL( %d )", aMute ) + + const RPointerArray& streams = iSession->Streams(); + + for ( TInt i = 0; i < streams.Count(); ++i ) + { + CMceSpeakerSink* speaker = MusEngMceUtils::GetSpeaker( *streams[i] ); + + if ( speaker ) + { + if( aMute ) + { + if ( speaker->IsEnabled() ) + { + speaker->DisableL(); + } + else + { + MUS_LOG( "mus: [ENGINE] Speaker already muted, NOP" ) + } + } + else + { + if ( !speaker->IsEnabled() ) + { + speaker->EnableL(); + } + else + { + MUS_LOG( "mus: [ENGINE] Speaker already unmuted, NOP" ) + } + } + } + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::MuteL( TBool aMute )" ) + } + +// ----------------------------------------------------------------------------- +// Checks if some of array items contains specific text +// (exact match not required) +// ----------------------------------------------------------------------------- +// +TBool CMusEngMceSession::ContainsText( MDesC8Array* aArray, const TDesC8& aItem ) + { + for ( TInt i = 0; aArray && i < aArray->MdcaCount(); i++ ) + { + if ( aArray->MdcaPoint( i ).FindF( aItem ) != KErrNotFound ) + { + return ETrue; + } + } + return EFalse; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::DoBitrateBasedRemovalL( + CMceVideoStream& aVideoStream, + const CMceVideoCodec& aBestBitrateVideoCodec ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::DoBitrateBasedRemovalL()" ) + + RPointerArray& codecs = + MUS_CODEC_ARR_CONST_CAST( aVideoStream.Codecs() ); + + TInt codecIndex = 0; + while ( codecIndex < codecs.Count() ) + { + CMceVideoCodec& currentCodec = *codecs[codecIndex++]; + if ( currentCodec.SdpName().FindF( KMceSDPNameH263 ) != KErrNotFound && + ¤tCodec != &aBestBitrateVideoCodec ) + { + MUS_LOG( "mus: [ENGINE] removing" ) + aVideoStream.RemoveCodecL( currentCodec ); + codecs = MUS_CODEC_ARR_CONST_CAST( aVideoStream.Codecs() ); + codecIndex = 0; + } + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::DoBitrateBasedRemovalL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::DoCodecModeBasedRemovalL( CMceVideoStream& aVideoStream ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::DoCodecModeBasedRemovalL()" ) + + RPointerArray& codecs = + MUS_CODEC_ARR_CONST_CAST( aVideoStream.Codecs() ); + + TInt codecIndex = 0; + while ( codecIndex < codecs.Count() ) + { + CMceVideoCodec& currentCodec = *codecs[codecIndex++]; + if ( !currentCodec.SdpName().CompareF( KMceSDPNameH2631998 ) ) + { + MUS_LOG( "mus: [ENGINE] removing" ) + aVideoStream.RemoveCodecL( currentCodec ); + codecs = MUS_CODEC_ARR_CONST_CAST( aVideoStream.Codecs() ); + codecIndex = 0; + } + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::DoCodecModeBasedRemovalL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::SetEncodingDeviceL( CMceVideoCodec& aVideoCodec ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::SetEncodingDeviceL()" ) + + // We try to read encoding device UID. If we do not succeed, we use default + + const TUid KDefaultEncodingDevice( TUid::Uid( 0x20001C13 ) ); + TUid encodingDevice( KDefaultEncodingDevice ); + TRAPD( error, + encodingDevice = MultimediaSharingSettings::EncodingDeviceL() ) + __ASSERT_ALWAYS( error == KErrNone || error == KErrNotFound, + User::Leave( error ) ); + aVideoCodec.SetPreferredEncodingDecodingDeviceL( encodingDevice ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::SetEncodingDeviceL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::SetCodecConfigKeyL( CMceVideoCodec& aVideoCodec ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::SetCodecConfigKeyL()" ) + + HBufC8* configKey( NULL ); + + // We try to read config key. If we do not succeed, we prepare to + // write keys to CenRep for the next time. + TRAPD( error, configKey = ReadCodecConfigKeyL( aVideoCodec ) ) + + if ( error == KErrNone ) + { + // There is a repository for config keys + if ( configKey ) + { + // ...and key is found. + CleanupStack::PushL( configKey ); + aVideoCodec.SetConfigKeyL( *configKey ); + CleanupStack::PopAndDestroy( configKey ); + } + else + { + // ...but key is not found, so it must be written to CenRep when + // available. + iStoreEncoderConfigInfo = ETrue; + } + } + else if ( error == KErrNotFound ) + { + // There is no repository for config keys so there is no point + // trying to write anything there. Session setup can still continue. + MUS_LOG1( "mus: [ENGINE] No repository for config keys [%d]", error ) + } + else + { + User::Leave( error ); + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::SetCodecConfigKeyL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +HBufC8* CMusEngMceSession::ReadCodecConfigKeyL( + const CMceVideoCodec& aVideoCodec ) const + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::ReadCodecConfigKeyL()" ) + + HBufC8* key( NULL ); + + HBufC8* encoderInfo = MultimediaSharingSettings::EncoderConfigInfoLC(); + __ASSERT_ALWAYS( encoderInfo, User::Leave( KErrNotFound ) ); + + TPtrC8 keyId( ConfigKeyIdL( aVideoCodec ) ); + + TInt tokenStartPosition( encoderInfo->FindC( keyId ) ); + if ( tokenStartPosition > KErrNotFound ) + { + TInt tokenLength( encoderInfo->Mid( tokenStartPosition ).FindC( + KMusEncoderInfoTokenizer ) ); + if ( tokenLength > KErrNotFound ) + { + // Separate key from token by removing keyId + TInt keyStartPosition = tokenStartPosition + keyId.Length(); + TInt keyLength = tokenLength - keyId.Length(); + TPtrC8 keyPtr = encoderInfo->Mid( keyStartPosition, keyLength ); + key = keyPtr.AllocL(); + } + } + + CleanupStack::PopAndDestroy( encoderInfo ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::ReadCodecConfigKeyL()" ) + + return key; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::StoreEncoderConfigInfoL() const + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::StoreEncoderConfigInfoL()" ) + + HBufC8* configInfoInCenRep = MultimediaSharingSettings::EncoderConfigInfoLC(); + __ASSERT_ALWAYS( configInfoInCenRep, User::Leave( KErrNotFound ) ); + + TBuf8 keys; + keys.Append( *configInfoInCenRep ); + + CMceVideoStream* stream = MusEngMceUtils::GetVideoOutStreamL( *iSession ); + const RPointerArray& codecs = stream->Codecs(); + + for ( TInt codecIndex = 0; codecIndex < codecs.Count(); ++codecIndex ) + { + if ( codecs[codecIndex]->SdpName().FindF( KMceSDPNameH264 ) >= 0 ) + { + const TPtrC8 keyId = ConfigKeyIdL( *codecs[codecIndex] ); + HBufC8* configKey = codecs[codecIndex]->ConfigKeyL(); + CleanupStack::PushL( configKey ); + + if ( configKey && + keys.FindF( keyId ) == KErrNotFound && + configInfoInCenRep->FindF( keyId ) == KErrNotFound ) + { + + if ( keys.Length() + + keyId.Length() + + configKey->Length() + + KMusEncoderInfoTokenizer().Length() < + NCentralRepositoryConstants::KMaxBinaryLength ) + { + keys.Append( keyId ); + keys.Append( *configKey ); + keys.Append( KMusEncoderInfoTokenizer ); + } + } + + CleanupStack::PopAndDestroy( configKey ); + } + } + + MultimediaSharingSettings::SetEncoderConfigInfoL( keys ); + + CleanupStack::PopAndDestroy( configInfoInCenRep ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::StoreEncoderConfigInfoL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +const TPtrC8 CMusEngMceSession::ConfigKeyIdL( + const CMceVideoCodec& aVideoCodec ) const + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::ConfigKeyIdL()" ) + + // Currently works only for AVC + __ASSERT_ALWAYS( aVideoCodec.SdpName().FindF( KMceSDPNameH264 ) >= 0, + User::Leave( KErrArgument ) ); + + TPtrC8 configKeyTokenId; + + if ( aVideoCodec.AllowedBitrates() & KMceAvcBitrateLevel1 ) + { + configKeyTokenId.Set( KMusAvcBitrateLevel1() ); + } + else if ( aVideoCodec.AllowedBitrates() & KMceAvcBitrateLevel1b ) + { + configKeyTokenId.Set( KMusAvcBitrateLevel1b() ); + } + else if ( aVideoCodec.AllowedBitrates() & KMceAvcBitrateLevel1_1 ) + { + configKeyTokenId.Set( KMusAvcBitrateLevel1_1() ); + } + else if ( aVideoCodec.AllowedBitrates() & KMceAvcBitrateLevel1_2 ) + { + configKeyTokenId.Set( KMusAvcBitrateLevel1_2() ); + } + else if ( aVideoCodec.AllowedBitrates() & KMceAvcBitrateLevel1_3 ) + { + configKeyTokenId.Set( KMusAvcBitrateLevel1_3() ); + } + else if ( aVideoCodec.AllowedBitrates() & KMceAvcBitrateLevel2 ) + { + configKeyTokenId.Set( KMusAvcBitrateLevel2() ); + } + else + { + User::Leave( KErrNotFound ); + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::ConfigKeyIdL()" ) + + return configKeyTokenId; + } + +// ----------------------------------------------------------------------------- +// Contact address is saved if all following apply: +// - standard variant +// - only one contact entry (mus mgr doesn't provide contact id if multiple +// contact entries for other end is found) +// - no existing sip address info for contact +// - address is valid sip or tel uri +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::SaveContactL( const TDesC8& /*aAddress*/ ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngMceSession::SaveContactL" ); + + + MUS_LOG( "mus: [ENGINE] <- CMusEngMceSession::SaveContactL" ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::StreamStreaming( CMceMediaStream& aStream ) + { + if ( aStream.State() == CMceMediaStream::EStreaming && + aStream.Type() == KMceVideo ) + { + MLcVideoPlayer* videoPlayer = NULL; + if ( aStream.Source() && + aStream.Source()->Type() == KMceRTPSource ) + { + videoPlayer = RemoteVideoPlayer(); + } + else if ( aStream.Sinks().Count() >= 0 && + aStream.Sinks()[0]->Type() == KMceRTPSink ) + { + videoPlayer = LocalVideoPlayer(); + } + else + { + } + InformObserverAboutPlayerStateChange( videoPlayer ); + } + } + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/src/musengmceutils.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/src/musengmceutils.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,600 @@ +/* +* 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: Utilities to get and set profile used with SWIS. +* +*/ + + + +// USER + +#include "musengmceutils.h" +#include "muslogger.h" + +// SYSTEM + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + + + +// ----------------------------------------------------------------------------- +// Tells if parameter stream is a video stream with RTP source +// ----------------------------------------------------------------------------- +// +TBool MusEngMceUtils::IsVideoInStream( CMceMediaStream& aStream ) + { + return ( aStream.Type() == KMceVideo && + aStream.Source() && + aStream.Source()->Type() == KMceRTPSource ); + } + +// ----------------------------------------------------------------------------- +// Tells if parameter stream is a video stream with RTP sink +// ----------------------------------------------------------------------------- +// +TBool MusEngMceUtils::IsVideoOutStream( CMceMediaStream& aStream ) + { + TBool isOutStream( EFalse ); + if ( aStream.Type() == KMceVideo ) + { + CMceMediaSink* rtpSink = MusEngMceUtils::GetMediaSink( + aStream, + KMceRTPSink ); + + isOutStream = ( rtpSink != NULL ); + } + return isOutStream; + } + +// ----------------------------------------------------------------------------- +// Tells if parameter stream is an audio stream with RTP source +// ----------------------------------------------------------------------------- +// +TBool MusEngMceUtils::IsAudioInStream( CMceMediaStream& aStream ) + { + return ( aStream.Type() == KMceAudio && + aStream.Source() && + aStream.Source()->Type() == KMceRTPSource ); + } + + +// ----------------------------------------------------------------------------- +// Gets handle to video stream with RTP sink. +// ----------------------------------------------------------------------------- +// +CMceVideoStream* MusEngMceUtils::GetVideoOutStreamL( CMceSession& aSession ) + { + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::GetVideoOutStreamL()" ) + + const RPointerArray& streams = aSession.Streams(); + + CMceVideoStream* videoOut = NULL; + + for ( TInt i = 0; i < streams.Count(); ++i ) + { + if ( MusEngMceUtils::IsVideoOutStream( *streams[i] ) ) + { + __ASSERT_ALWAYS( !videoOut, User::Leave( KErrOverflow ) ); + + videoOut = static_cast( streams[i] ); + } + + // Check if bound stream is a video stream with RTP sink. + if ( streams[i]->BoundStream() && + MusEngMceUtils::IsVideoOutStream( streams[i]->BoundStreamL() ) ) + { + __ASSERT_ALWAYS( !videoOut, User::Leave( KErrOverflow ) ); + + videoOut = static_cast( + &streams[i]->BoundStreamL() ); + } + } + + __ASSERT_ALWAYS( videoOut, User::Leave( KErrNotFound ) ); + + MUS_LOG( "mus: [ENGINE] <- MusEngMceUtils::GetVideoOutStreamL()" ) + + return videoOut; + } + + +// ----------------------------------------------------------------------------- +// Gets handle to video stream with RTP source. +// ----------------------------------------------------------------------------- +// +CMceVideoStream* MusEngMceUtils::GetVideoInStreamL( CMceSession& aSession ) + { + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::GetVideoInStreamL()" ) + + const RPointerArray& streams = aSession.Streams(); + + CMceVideoStream* videoIn = NULL; + + for ( TInt i = 0; i < streams.Count(); ++i ) + { + if ( MusEngMceUtils::IsVideoInStream( *streams[i] ) ) + + { + __ASSERT_ALWAYS( !videoIn, User::Leave( KErrOverflow ) ); + + videoIn = static_cast( streams[i] ); + } + + // Check if bound stream is a video stream with RTP souce. + if ( streams[i]->BoundStream() && + MusEngMceUtils::IsVideoInStream( streams[i]->BoundStreamL() ) ) + { + __ASSERT_ALWAYS( !videoIn, User::Leave( KErrOverflow ) ); + + videoIn = static_cast( + &streams[i]->BoundStreamL() ); + } + } + + __ASSERT_ALWAYS( videoIn, User::Leave( KErrNotFound ) ); + + MUS_LOG( "mus: [ENGINE] <- MusEngMceUtils::GetVideoInStreamL()" ) + + return videoIn; + } + + +// ----------------------------------------------------------------------------- +// Gets handle to video stream with file sink +// ----------------------------------------------------------------------------- +// +CMceVideoStream* MusEngMceUtils::GetRecordingStream( CMceSession& aSession ) + { + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::GetRecordingStreamL()" ) + + const RPointerArray& streams = aSession.Streams(); + + CMceVideoStream* recordingStream = NULL; + + for ( TInt i = 0; i < streams.Count(); ++i ) + { + if ( streams[i]->Type() == KMceVideo ) + { + if ( MusEngMceUtils::GetMediaSink( *streams[i], KMceFileSink ) ) + { + recordingStream = static_cast( streams[i] ); + } + } + } + + MUS_LOG( "mus: [ENGINE] <- MusEngMceUtils::GetRecordingStreamL()" ) + + return recordingStream; + } + + +// ----------------------------------------------------------------------------- +// Gets handle to a media sink of spesified type contained by a mediastream. +// ----------------------------------------------------------------------------- +// +CMceMediaSink* MusEngMceUtils::GetMediaSink( CMceMediaStream& aStream, + TMceSinkType aType, + TMceSourceType aAssociatedSourceType ) + { + const RPointerArray& sinks = aStream.Sinks(); + for ( TInt i = 0; i < sinks.Count(); ++i ) + { + if ( sinks[i]->Type() == aType && + ( aAssociatedSourceType == KMusEngNoAssociatedSourceType || + aStream.Source()->Type() == aAssociatedSourceType ) ) + { + return sinks[i]; + } + } + + return NULL; + } + + +// ----------------------------------------------------------------------------- +// Gets handle to a media sink of spesified type contained by a mediastream. +// ----------------------------------------------------------------------------- +// +CMceMediaSink* MusEngMceUtils::GetMediaSinkL( CMceMediaStream& aStream, + TMceSinkType aType, + TMceSourceType aAssociatedSourceType ) + { + + CMceMediaSink* sink = MusEngMceUtils::GetMediaSink( aStream, aType, aAssociatedSourceType ); + + __ASSERT_ALWAYS( sink, User::Leave( KErrNotFound ) ); + + return sink; + } + + +// ----------------------------------------------------------------------------- +// Gets handle to a media sink of spesified type contained by a session. +// ----------------------------------------------------------------------------- +// +CMceMediaSink* MusEngMceUtils::GetMediaSink( CMceSession& aSession, + TMceSinkType aType, + TMceSourceType aAssociatedSourceType, + TBool aStrictMatch ) + { + CMceMediaSink* sink = NULL; + + TRAP_IGNORE( sink = MusEngMceUtils::GetMediaSinkL( + aSession, aType, aAssociatedSourceType, aStrictMatch ) ) + + return sink; + } + + +// ----------------------------------------------------------------------------- +// Gets handle to a media sink of spesified type contained by a session. +// ----------------------------------------------------------------------------- +// +CMceMediaSink* MusEngMceUtils::GetMediaSinkL( CMceSession& aSession, + TMceSinkType aType, + TMceSourceType aAssociatedSourceType, + TBool aStrictMatch ) + { + CMceMediaSink* sink = NULL; + + const RPointerArray& streams = aSession.Streams(); + + for ( TInt i = 0; i < streams.Count(); ++i ) + { + sink = MusEngMceUtils::GetMediaSink( *streams[i], aType, aAssociatedSourceType ); + if ( sink ) + { + return sink; + } + + if ( streams[i]->BoundStream() ) + { + sink = MusEngMceUtils::GetMediaSink( streams[i]->BoundStreamL(), + aType, + aAssociatedSourceType ); + if ( sink ) + { + return sink; + } + } + } + + if ( !sink && aAssociatedSourceType != KMusEngNoAssociatedSourceType && !aStrictMatch ) + { + // No preferred match, try without source preference + sink = GetMediaSinkL( aSession, aType ); + } + + __ASSERT_ALWAYS( sink, User::Leave( KErrNotFound ) ); + + return sink; + } + + +// ----------------------------------------------------------------------------- +// Gets handle to a speaker sink contained by specified stream or bound stream. +// ----------------------------------------------------------------------------- +// +CMceSpeakerSink* MusEngMceUtils::GetSpeaker( CMceMediaStream& aStream ) + { + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::GetSpeaker()" ) + + CMceSpeakerSink* speaker = NULL; + + if ( aStream.Type() == KMceAudio ) + { + speaker = static_cast( + MusEngMceUtils::GetMediaSink( aStream, KMceSpeakerSink ) ); + + if ( !speaker && aStream.BoundStream() ) + { + CMceMediaStream* boundStream = NULL; + TRAPD( error, boundStream = &aStream.BoundStreamL() ) + + if ( error == KErrNone ) + { + speaker = static_cast( + MusEngMceUtils::GetMediaSink( *boundStream, + KMceSpeakerSink ) ); + } + } + } + + MUS_LOG( "mus: [ENGINE] <- MusEngMceUtils::GetSpeaker()" ) + + return speaker; + } + + +// ----------------------------------------------------------------------------- +// Gets handle to a camera source. +// ----------------------------------------------------------------------------- +// +CMceCameraSource* MusEngMceUtils::GetCameraL( CMceSession& aSession ) + { + // Camera can be only in out stream + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::GetCameraL()" ) + + CMceVideoStream* videoOut = MusEngMceUtils::GetVideoOutStreamL( aSession ); + + if ( !( videoOut->Source() && + videoOut->Source()->Type() == KMceCameraSource ) ) + { + User::Leave( KErrNotFound ); + } + + MUS_LOG( "mus: [ENGINE] <- MusEngMceUtils::GetCameraL()" ) + return static_cast( videoOut->Source() ); + } + + +// ----------------------------------------------------------------------------- +// Gets handle to a file source. +// ----------------------------------------------------------------------------- +// +CMceFileSource* MusEngMceUtils::GetFileSourceL( CMceSession& aSession ) + { + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::GetFileSourceL()" ) + + CMceVideoStream* videoOut = MusEngMceUtils::GetVideoOutStreamL( aSession ); + + if ( !( videoOut->Source() && + videoOut->Source()->Type() == KMceFileSource ) ) + { + User::Leave( KErrNotFound ); + } + + MUS_LOG( "mus: [ENGINE] <- MusEngMceUtils::GetFileSourceL()" ) + return static_cast( videoOut->Source() ); + } + + +// ----------------------------------------------------------------------------- +// Gets handle to a display sink. +// ----------------------------------------------------------------------------- +// +CMceDisplaySink* MusEngMceUtils::GetDisplay( + CMceSession& aSession, TBool aPreferViewFinder ) + { + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::GetDisplay()" ) + MUS_LOG( "mus: [ENGINE] <- MusEngMceUtils::GetDisplay()" ) + TMceSourceType preferredSource = + aPreferViewFinder ? KMceCameraSource : KMusEngNoAssociatedSourceType; + return static_cast( + MusEngMceUtils::GetMediaSink( aSession, KMceDisplaySink, preferredSource ) ); + + } + + +// ----------------------------------------------------------------------------- +// Gets handle to a display sink. +// ----------------------------------------------------------------------------- +// +CMceDisplaySink* MusEngMceUtils::GetDisplayL( + CMceSession& aSession, TBool aPreferViewFinder ) + { + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::GetDisplayL()" ) + + CMceDisplaySink* display = MusEngMceUtils::GetDisplay( aSession, aPreferViewFinder ); + + __ASSERT_ALWAYS( display, User::Leave( KErrNotFound ) ); + + MUS_LOG( "mus: [ENGINE] <- MusEngMceUtils::GetDisplayL()" ) + return display; + } + +// ----------------------------------------------------------------------------- +// Gets handle to a display sink displaying received video. +// ----------------------------------------------------------------------------- +// +CMceDisplaySink* MusEngMceUtils::GetReceivingDisplay( CMceSession& aSession ) + { + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::GetReceivingDisplay()" ) + MUS_LOG( "mus: [ENGINE] <- MusEngMceUtils::GetReceivingDisplay()" ) + + // Search display which is connected with rtp source + TMceSourceType preferredSource = KMceRTPSource; + return static_cast( MusEngMceUtils::GetMediaSink( + aSession, KMceDisplaySink, preferredSource, ETrue ) ); + } + +// ----------------------------------------------------------------------------- +// Gets handle to a display sink displaying received video. +// ----------------------------------------------------------------------------- +// +CMceDisplaySink* MusEngMceUtils::GetReceivingDisplayL( CMceSession& aSession ) + { + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::GetReceivingDisplayL()" ) + + CMceDisplaySink* display = GetReceivingDisplay( aSession ); + __ASSERT_ALWAYS( display != NULL, User::Leave( KErrNotFound ) ); + + MUS_LOG( "mus: [ENGINE] <- MusEngMceUtils::GetReceivingDisplay()" ) + + return display; + } + +// ----------------------------------------------------------------------------- +// Gets handle to a display sink displaying viewfinder content. +// ----------------------------------------------------------------------------- +// +CMceDisplaySink* MusEngMceUtils::GetVfDisplay( CMceSession& aSession ) + { + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::GetVfDisplay()" ) + MUS_LOG( "mus: [ENGINE] <- MusEngMceUtils::GetVfDisplay()" ) + + // Search display which is connected with camera + TMceSourceType preferredSource = KMceCameraSource; + return static_cast( MusEngMceUtils::GetMediaSink( + aSession, KMceDisplaySink, preferredSource, ETrue ) ); + } + +// ----------------------------------------------------------------------------- +// Adds display sink to specified stream if one does not exist already. +// Display rect is set in both cases. +// ----------------------------------------------------------------------------- +// +void MusEngMceUtils::AddDisplayL( CMceMediaStream& aStream, + CMceManager& aManager, + const TRect& aDisplayRect, + TBool aDisabled ) + { + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::AddDisplayL()" ) + + __ASSERT_ALWAYS( aStream.Type() == KMceVideo, User::Leave( KErrArgument ) ); + + CMceDisplaySink* display = static_cast( + MusEngMceUtils::GetMediaSink( + aStream, + KMceDisplaySink ) ); + + if ( !display ) + { + display = CMceDisplaySink::NewLC( aManager ); + aStream.AddSinkL( display ); + CleanupStack::Pop( display ); + } + + if ( aDisabled ) + { + MUS_LOG( "mus: [ENGINE] Initially disabled display" ) + display->DisableL(); + } + display->SetDisplayRectL( aDisplayRect ); + + MUS_LOG( "mus: [ENGINE] <- MusEngMceUtils::AddDisplayL()" ) + } + + +// ----------------------------------------------------------------------------- +// Adds display sink to specified stream if one does not exist already. +// ----------------------------------------------------------------------------- +// +void MusEngMceUtils::AddSpeakerL( CMceMediaStream& aStream ) + { + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::AddSpeakerL()" ) + + __ASSERT_ALWAYS( aStream.Type() == KMceAudio, User::Leave( KErrArgument ) ); + + CMceSpeakerSink* speaker = static_cast( + MusEngMceUtils::GetMediaSink( + aStream, + KMceSpeakerSink ) ); + + if ( !speaker ) + { + speaker = CMceSpeakerSink::NewLC(); + aStream.AddSinkL( speaker ); + CleanupStack::Pop( speaker ); + } + + MUS_LOG( "mus: [ENGINE] <- MusEngMceUtils::AddSpeakerL()" ) + } + + +// ----------------------------------------------------------------------------- +// Disables parameter stream, its' source and all the sinks. +// ----------------------------------------------------------------------------- +// +void MusEngMceUtils::DisableStreamL( CMceMediaStream& aStream ) + { + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::DisableStreamL()" ) + + aStream.DisableL(); + + if ( aStream.Source() ) + { + aStream.Source()->DisableL(); + } + + for ( TInt sinkIndex = 0; sinkIndex < aStream.Sinks().Count(); ++sinkIndex ) + { + aStream.Sinks()[ sinkIndex ]->DisableL(); + } + + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::DisableStreamL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void MusEngMceUtils::DoEnableDisplayL( CMceDisplaySink& aDisplay, TBool aEnable ) + { + MUS_LOG1( "mus: [ENGINE] -> MusEngMceUtils::DoEnableDisplayL() %d", + aEnable ) + + if ( aEnable ) + { + if ( !aDisplay.IsEnabled() ) + { + aDisplay.EnableL(); + MUS_LOG( " Display enabled" ) + } + else + { + MUS_LOG( " Display already enabled, ignore" ) + } + } + else + { + if ( aDisplay.IsEnabled() ) + { + aDisplay.DisableL(); + MUS_LOG( " Display disabled" ) + } + else + { + MUS_LOG( " Display already disabled, ignore" ) + } + } + + MUS_LOG( "mus: [ENGINE] <- MusEngMceUtils::DoEnableDisplayL()") + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt MusEngMceUtils::EnableInactivityTimer( + CMceSession& aSession, + TUint32 aInactivityTimeout ) + { + TInt err( KErrNotFound ); + CMceVideoStream* stream = NULL; + TRAP_IGNORE( stream = MusEngMceUtils::GetVideoInStreamL( aSession ) ) + if ( stream ) + { + // Instream has always RTP source + err = KErrNone; + CMceRtpSource* rtpSource = static_cast( stream->Source() ); + TRAP( err, rtpSource->EnableInactivityTimerL( aInactivityTimeout ) ) + } + + return err; + } + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/src/musengreceivesession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/src/musengreceivesession.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,848 @@ +/* +* 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: +* +*/ + + + +// USER INCLUDES +#include "musengreceivesession.h" +#include "musengmceutils.h" +#include "musenglogger.h" +#include "mussipprofilehandler.h" +#include "mussessionproperties.h" +#include "musengremotevideoplayer.h" + +// SYSTEM INCLUDES +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +const TInt KMusEngJitterBufferLength = 51; //Must be bigger than treshold +// Using following value increases treshold buffer to 1 second from +// default 100 ms +const TInt KMusEngJitterBufferTreshold = 50; +const TInt KMusEngTresholdToSecondsFactor = 20; +const TInt KMusEngTwoSecondInMilliSeconds = 2000; +// Use inactivity timer value that is a little bigger than treshold in seconds +const TUint KMusEngInactivityTimer = KMusEngTresholdToSecondsFactor * + KMusEngJitterBufferTreshold + + KMusEngTwoSecondInMilliSeconds; + +_LIT8( KMusEngSwisIdentifier, "Require: precondition" ); +_LIT8( KMusEngAssertedIdentity, "P-Asserted-Identity" ); +_LIT8( KMusEngBiggerSign, ">" ); + +const TInt KMusEngSipReasonCodeBusyHere = 486; +_LIT8( KMusEngSipReasonPhraseBusy, "Busy" ); + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngReceiveSession* CMusEngReceiveSession::NewL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngReceiveSession::NewL(...)" ) + + CMusEngReceiveSession* self = new( ELeave )CMusEngReceiveSession(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngReceiveSession::NewL(...)" ) + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngReceiveSession::CMusEngReceiveSession() + : CMusEngMceSession() + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngReceiveSession::ConstructL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngReceiveSession::ConstructL()" ) + + CMusEngMceSession::ConstructL(); + + iOriginator = HBufC8::NewL( KMaxUriLength ); + + iRemoteDisplayName = HBufC::NewL( KMaxUriLength ); + + iRemoteVideoPlayer = CMusEngRemoteVideoPlayer::NewL( *this, *this ); + + iReceivingInactivityTimeout = KMusEngInactivityTimer; + + iKeepaliveTimer = KMusEngRtpKeepAliveTimer; + + MUS_LOG( "mus: [ENGINE] <- CMusEngReceiveSession::ConstructL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngReceiveSession::~CMusEngReceiveSession() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngReceiveSession::~CMusEngReceiveSession()" ) + + if ( iOriginator ) + { + TRAP_IGNORE( SaveContactL( *iOriginator ) ) + } + delete iOriginator; + + delete iRemoteDisplayName; + + delete iRemoteVideoPlayer; + + MUS_LOG( "mus: [ENGINE] <- CMusEngReceiveSession::~CMusEngReceiveSession()" ) + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +MLcSession::TLcSessionState CMusEngReceiveSession::LcSessionState() const + { + TLcSessionState state = CMusEngMceSession::LcSessionState(); + if ( !iSession && state == MLcSession::EUninitialized ) + { + state = MLcSession::EReceived; + } + return state; + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +void CMusEngReceiveSession::EstablishLcSessionL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngReceiveSession::EstablishLcSessionL" ) + + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + InSession()->AcceptL(); + + MUS_LOG( "mus: [ENGINE] <- CMusEngReceiveSession::EstablishLcSessionL" ) + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +void CMusEngReceiveSession::TerminateLcSessionL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngReceiveSession::EstablishLcSessionL" ) + + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + if ( iSession->State() == CMceSession::EIncoming || + iSession->State() == CMceSession::EProceeding ) + { + // Reject + if ( iOperatorVariant ) + { + // In operator variant, session is rejected with 486 instead of 603. + // Also the reason phrase is supposed to be "Busy". + InSession()->RejectL( KMusEngSipReasonPhraseBusy(), + KMusEngSipReasonCodeBusyHere ); + } + else + { + InSession()->RejectL(); + } + } + else + { + iSession->TerminateL(); + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngReceiveSession::EstablishLcSessionL" ) + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +MLcVideoPlayer* CMusEngReceiveSession::RemoteVideoPlayer() + { + return iRemoteVideoPlayer; + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +const TDesC& CMusEngReceiveSession::RemoteDisplayName() + { + TBuf buffer; + + TInt error = RProperty::Get( NMusSessionApi::KCategoryUid, + NMusSessionApi::KContactName, + buffer ); + if ( error == KErrNone && buffer.Length() ) + { + iRemoteDisplayName->Des().Copy( buffer ); + } + + else if ( iOriginator ) + { + iRemoteDisplayName->Des().Copy(*iOriginator); + } + return *iRemoteDisplayName; + } + +// ----------------------------------------------------------------------------- +// When reserving resources is ready, this function reports observer about +// incoming session and signals this also to other end terminal ( 180 ringing ). +// ----------------------------------------------------------------------------- +// +void CMusEngReceiveSession::HandleSessionStateChanged( + CMceSession& aSession, + TInt aStatusCode, + const TDesC8& aReasonPhrase ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngReceiveSession::\ + HandleSessionStateChanged()" ) + + MUS_ENG_LOG_SESSION_STATE_AND_STATUS( aSession, aStatusCode, aReasonPhrase ) + + if ( iSession && + iSession == &aSession && + aSession.State() == CMceSession::EProceeding ) + { + // Indicates that resource reservation is ready, user can be notified + // if we do not have to wait for PRACK + + if ( !iRingLCalled ) + { + // Notify other end terminal + TRAP_IGNORE( InSession()->RingL() ) + iRingLCalled = ETrue; + TPtr8 ptrOriginator( iOriginator->Des() ); + ptrOriginator.Copy( iSession->Originator() ); + InformObserverAboutSessionStateChange(); + } + else + { + MUS_LOG( "mus: [ENGINE] User and remote end already notified." ) + } + + } + else + { + // Forward all other session state changes to base class + CMusEngMceSession::HandleSessionStateChanged( aSession, + aStatusCode, + aReasonPhrase ); + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngReceiveSession::\ + HandleSessionStateChanged()" ) + } + +// ----------------------------------------------------------------------------- +// Sets keepalive timer for video and calls base class variant of this function +// ----------------------------------------------------------------------------- +// +void CMusEngReceiveSession::AdjustVideoCodecL( CMceVideoCodec& aVideoCodec, + TMceSourceType aSourceType ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngReceiveSession::AdjustVideoCodecL()" ) + + CMusEngMceSession::AdjustVideoCodecL( aVideoCodec, aSourceType ); + + MUS_LOG1( "mus: [ENGINE] Keepalive timer:%d", iKeepaliveTimer ) + aVideoCodec.SetKeepAliveTimerL( iKeepaliveTimer ); + if ( aVideoCodec.SdpName() == KMceSDPNameH263() || + aVideoCodec.SdpName() == KMceSDPNameH2632000() ) + { + aVideoCodec.SetKeepAlivePayloadTypeL( KMusEngKeepAlivePayloadTypeVideoH263 ); + } + else if ( aVideoCodec.SdpName() == KMceSDPNameH264() ) + { + aVideoCodec.SetKeepAlivePayloadTypeL( KMusEngKeepAlivePayloadTypeVideoAvc ); + } + else + { + // NOP + } + + aVideoCodec.SetKeepAliveDataL( KNullDesC8() ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngReceiveSession::AdjustVideoCodecL()" ) + } + +// ----------------------------------------------------------------------------- +// Sets keepalive timer for audio and calls base class variant of this function +// ----------------------------------------------------------------------------- +// +void CMusEngReceiveSession::AdjustAudioCodecL( CMceAudioCodec& aAudioCodec ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngReceiveSession::AdjustAudioCodecL()" ) + + CMusEngMceSession::AdjustAudioCodecL( aAudioCodec ); + + aAudioCodec.SetKeepAliveTimerL( iKeepaliveTimer ); + aAudioCodec.SetKeepAlivePayloadTypeL( KMusEngKeepAlivePayloadTypeAudio ); + aAudioCodec.SetKeepAliveDataL( KNullDesC8() ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngReceiveSession::AdjustAudioCodecL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngReceiveSession::DoCodecSelectionL( CMceVideoStream& aVideoStream ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngReceiveSession::DoCodecSelectionL()" ) + + const RPointerArray& codecs = aVideoStream.Codecs(); + + const CMceVideoCodec* avcSingleNal = NULL; + const CMceVideoCodec* avcNonInterleaved = NULL; + + for ( TInt codecIndex = 0; codecIndex < codecs.Count(); ++codecIndex ) + { + if ( codecs[codecIndex]->SdpName() == KMceSDPNameH264() ) + { + if ( codecs[codecIndex]->CodecMode() == KMceAvcModeSingleNal ) + { + // Store a pointer to the Single NAL codec with best bitrate + if ( !avcSingleNal || + ( avcSingleNal && codecs[codecIndex]->MaxBitRate() > + avcSingleNal->MaxBitRate() ) ) + { + avcSingleNal = codecs[codecIndex]; + } + } + else if ( codecs[codecIndex]->CodecMode() == + KMceAvcModeNonInterleaved ) + { + // Store a pointer to the Non-Interleaved codec with best bitrate + if ( !avcNonInterleaved || + ( avcNonInterleaved && codecs[codecIndex]->MaxBitRate() > + avcNonInterleaved->MaxBitRate() ) ) + { + avcNonInterleaved = codecs[codecIndex]; + } + } + else + { + // NOP, we do not care about interleaved AVC + } + } + } + + const CMceVideoCodec* selectedCodec = NULL; + + if ( avcNonInterleaved ) + { + selectedCodec = avcNonInterleaved; + } + else + { + selectedCodec = avcSingleNal; + } + + if ( selectedCodec ) + { + // Remove all other codecs + for ( TInt codecIndex = 0; codecIndex < codecs.Count(); ++codecIndex ) + { + if ( codecs[codecIndex] != selectedCodec ) + { + aVideoStream.RemoveCodecL( *codecs[codecIndex] ); + // Since succesfull removal of a codec has decreased the amount + // of codecs in array by one, we have to reset the index + codecIndex = 0; + } + } + } + else + { + // Let the base class do H.263 selection + CMusEngMceSession::DoCodecSelectionL( aVideoStream ); + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngReceiveSession::DoCodecSelectionL()" ) + } + +// ----------------------------------------------------------------------------- +// If incoming session does not have valid structure and cannot be reconstructed +// as such, session is rejected automatically. +// ----------------------------------------------------------------------------- +// +void CMusEngReceiveSession::IncomingSession( + CMceInSession* aSession, + TMceTransactionDataContainer* aContainer ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngReceiveSession::IncomingSession(...)" ) + + if ( !aContainer || + ( iSession && + iSession->State() != CMceSession::ETerminated ) ) + { + // We already have one session ongoing, or do not have container. + // Reject new session. + Reject( *aSession ); + delete aSession; + aSession = NULL; + MUS_LOG( "mus: [ENGINE] <- CMusEngReceiveSession::IncomingSession( \ + session already exists. New session rejected and deleted. )" ) + return; + } + + delete iSession; // possibly existing terminated session + iSession = aSession; + + if ( iOperatorVariant ) + { + ParseAssertedIdentity( aContainer ); + } + + // Reset variable defined for preparing for multiple state changes to + // EProceeding. This might happen if we set 100rel to be required. + iRingLCalled = EFalse; + + // If preparing fails, session setup with VS2.2 will fail later + TRAP_IGNORE( PrepareToRequire100RelL( aContainer ) ) + + TRAPD( error, CompleteSessionStructureL() ); + + if ( error != KErrNone ) + { + Reject( *InSession() ); + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngReceiveSession::IncomingSession()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngReceiveSession::IncomingUpdate( + CMceSession& aOrigSession, + CMceInSession* aUpdatedSession, + TMceTransactionDataContainer* aContainer ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngReceiveSession::IncomingUpdate(...)" ) + + if ( iSession && + iSession == &aOrigSession ) + { + // Old session is useless from now on + delete iSession; + iSession = aUpdatedSession; + + TRAPD( error, CompleteSessionStructureL() ); + + if ( error != KErrNone ) + { + MUS_LOG( "mus: [ENGINE] Cannot handle update, reject" ) + Reject( *aUpdatedSession ); + } + } + else + { + // Cannot handle, forward to a base class + CMusEngMceSession::IncomingUpdate( aOrigSession, + aUpdatedSession, + aContainer ); + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngReceiveSession::IncomingUpdate(...)" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngReceiveSession::StreamStateChanged( CMceMediaStream& aStream ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngReceiveSession::StreamStateChanged()" ) + + MUS_ENG_LOG_STREAM_STATE( aStream ) + + if ( !iSession ) + { + return; + } + + if ( aStream.Type() == KMceVideo && + aStream.Source() && + aStream.Source()->Type() == KMceRTPSource ) + { + if ( aStream.State() == CMceMediaStream::EBuffering ) + { + iBuffered = ETrue; + InformObserverAboutPlayerStateChange( iRemoteVideoPlayer ); + } + else if ( aStream.State() == CMceMediaStream::EStreaming ) + { + ReceivingStarted(); + } + else + { + // Cannot handle, forward to CMusEngMceSession + CMusEngMceSession::StreamStateChanged( aStream ); + } + } + else + { + // Cannot handle, forward to CMusEngMceSession + CMusEngMceSession::StreamStateChanged( aStream ); + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngReceiveSession::StreamStateChanged()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMceInSession* CMusEngReceiveSession::InSession() + { + return static_cast(iSession); + } + +// ----------------------------------------------------------------------------- +// Check if incoming session is originated from VideoSharing 2.2 client, +// which sends PRACK for 180 Ringing whether it is required or not. In +// order to let MCE handle the PRACK correctly, force 180 Ringing to be +// sent reliably. +// ----------------------------------------------------------------------------- +// +void CMusEngReceiveSession::PrepareToRequire100RelL( + TMceTransactionDataContainer* aContainer) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngReceiveSession::PrepareToRequire100RelL()" ) + + __ASSERT_ALWAYS( aContainer, User::Leave( KErrArgument ) ); + + CDesC8Array* headers = aContainer->GetHeaders(); + CleanupStack::PushL( headers ); + + if ( headers ) + { + for ( TInt i = 0; i < headers->Count(); ++i ) + { + if ( headers->MdcaPoint(i).FindF( KMusEngSwisIdentifier() ) != + KErrNotFound ) + { + iSession->SetModifierL( KMce100Rel, KMce100RelRequired ); + MUS_LOG( "mus: [ENGINE] Forced to require 100rel" ) + } + } + } + + CleanupStack::PopAndDestroy( headers ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngReceiveSession::PrepareToRequire100RelL()" ) + } + +// ----------------------------------------------------------------------------- +// Check that incoming session contains only incoming video and audio +// streams. All the other streams will be removed. If there is no +// display sinks and speakers, they will be created. +// ----------------------------------------------------------------------------- +// +void CMusEngReceiveSession::CompleteSessionStructureL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngReceiveSession::CompleteSessionStructureL()" ) + + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + // Force bandwidth line usage in sdp as it is mandatory + // at MT side based on GSMA VS specification IR.74. Bandwidth is set to + // session or to media level based on sender's way of usage. If other end + // is not using bandwidth attribute at all, media level is preferred. + SetSessionSdpLinesL( *iSession, ETrue ); + + CMceStreamBundle* localBundle = + CMceStreamBundle::NewLC( CMceStreamBundle::ELS ); + + const RPointerArray& streams = iSession->Streams(); + + CMceMediaStream* videoInStream = NULL; + + for( TInt i = 0; i < streams.Count(); ++i ) + { + if ( MusEngMceUtils::IsVideoInStream( *streams[i] ) && + !videoInStream ) + { + videoInStream = streams[i]; + + // Disable possible opposite stream to indicate that sendrecv is + // not allowed. + if ( streams[i]->BoundStream() ) + { + MusEngMceUtils::DisableStreamL( streams[i]->BoundStreamL() ); + } + } + else if ( streams[i]->BoundStream() && + MusEngMceUtils::IsVideoInStream( streams[i]->BoundStreamL() ) && + !videoInStream ) + { + videoInStream = &streams[i]->BoundStreamL(); + + // Disable opposite stream to indicate that sendrecv is not allowed. + MusEngMceUtils::DisableStreamL( *streams[i] ); + } + else if ( MusEngMceUtils::IsAudioInStream( *streams[i] ) && + !iOperatorVariant ) + { + MusEngMceUtils::AddSpeakerL( *streams[i] ); + + localBundle->AddStreamL( *streams[i] ); + + // Disable possible opposite stream to indicate that sendrecv is + // not allowed. + if ( streams[i]->BoundStream() ) + { + MusEngMceUtils::DisableStreamL( streams[i]->BoundStreamL() ); + } + } + else if ( streams[i]->BoundStream() && + MusEngMceUtils::IsAudioInStream( streams[i]->BoundStreamL() ) && + !iOperatorVariant ) + { + MusEngMceUtils::AddSpeakerL( streams[i]->BoundStreamL() ); + + localBundle->AddStreamL( streams[i]->BoundStreamL() ); + + // Disable opposite stream to indicate that sendrecv is not allowed. + MusEngMceUtils::DisableStreamL( *streams[i] ); + } + else + { + // We remove stream because either it + // 1. Is not and does not contain incoming video or audio, or + // 2. We already have one incoming video stream or + // 3. Stream is audio and we run operator variant where audio is + // not allowed. + iSession->RemoveStreamL( *streams[i] ); + + // Since succesfull removal of a stream has decreased the amount + // of streams in array by one, we have to modify the index + --i; + } + } + + if ( videoInStream ) + { + SetMediaSdpLinesL( *videoInStream, ETrue ); + + // Complete stream + MusEngMceUtils::AddDisplayL( *videoInStream, *iManager, Rect() ); + + static_cast(videoInStream->Source())->UpdateL( + KMusEngJitterBufferLength, + KMusEngJitterBufferTreshold ); + + localBundle->AddStreamL( *videoInStream ); + } + else + { + User::Leave( KErrCorrupt ); + } + + // Next line is to cause a leave if there were no incoming video streams + MusEngMceUtils::GetVideoInStreamL( *iSession ); + + // Destroy bundle if it is not needed or transfer ownership + if ( localBundle->Streams().Count() > 1 ) + { + iSession->AddBundleL( localBundle ); + CleanupStack::Pop( localBundle ); + } + else + { + CleanupStack::PopAndDestroy( localBundle ); + } + + AdjustStreamsAndCodecsL(); + + iSession->UpdateL(); + + // Now session state is right to adjust volume + SetSpeakerVolumeL( LcVolumeL() ); + + iSipProfileHandler->CreateProfileL( iSession->Profile() ); + + iRemoteVideoPlayer->SetMceSession( iSession ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngReceiveSession::CompleteSessionStructureL()" ) + } + +// ----------------------------------------------------------------------------- +// Parse P-Asserted-Identity Header +// ----------------------------------------------------------------------------- +// +void CMusEngReceiveSession::ParseAssertedIdentity( + TMceTransactionDataContainer* aContainer ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngReceiveSession::AssertedIdentity()" ) + + iIdentity.Zero(); + + if ( !aContainer ) + { + MUS_LOG( "mus: [ENGINE] Data container is NULL" ) + MUS_LOG( "mus: [ENGINE] <- CMusEngReceiveSession::AssertedIdentity()" ) + return; + } + + CDesC8Array* headers = aContainer->GetHeaders(); + + if ( !headers ) + { + MUS_LOG( "mus: [ENGINE] No headers" ) + MUS_LOG( "mus: [ENGINE] <- CMusEngReceiveSession::AssertedIdentity()" ) + return; + } + + TBool found = EFalse; + TInt length = 0; + for( TInt i = 0; i < headers->Count() && !found; ++i ) + { + TPtrC8 header = (*headers)[i]; + if ( header.FindF( KMusEngAssertedIdentity ) != KErrNotFound ) + { + TInt pos = 0; + // check for sip url, continue if found because maybe tel url exists + if ( ( pos = header.FindF( KMusEngSipPrefix ) ) != KErrNotFound ) + { + TInt atPos = header.FindF( KMusEngAtSign ); + length = atPos - pos - KMusEngSipPrefix().Length(); + if ( length > 0 && length <= KMaxUriLength ) + { + iIdentity.Copy( + header.Mid( pos + KMusEngSipPrefix().Length(), length ) ); + } + } + // check for tel url, exit if found + else if ( ( pos = header.FindF( KMusEngTelPrefix ) ) != KErrNotFound ) + { + length = header.Length() - pos - KMusEngTelPrefix().Length(); + if ( length > 0 && length <= KMaxUriLength ) + { + iIdentity.Copy( header.Right( length ) ); + } + found = ETrue; + } + } + } + + // remove ending '>' if exists and whitespaces + if ( iIdentity.Length() > 0 ) + { + iIdentity.Trim(); + if ( iIdentity.Find( KMusEngBiggerSign ) == iIdentity.Length() - 1 ) + { + iIdentity = iIdentity.Left( iIdentity.Length() - 1 ); + iIdentity.Trim(); + } + } + + delete headers; + MUS_LOG( "mus: [ENGINE] <- CMusEngReceiveSession::AssertedIdentity()" ) + } + +// ----------------------------------------------------------------------------- +// RTP Inactivity timeout event +// Once inactivity timeout occurs, state change is notified and receiving +// and buffering statuses are cleared. That is safe to do as once receiving +// again continues for real, buffering and streaming events will occur always +// sequentially. If buffering status would not be cleared, some unwanted +// sreaming events would be passed towards client when it disables/enables +// display sink of remote stream while inactivity timer has expired. +// ----------------------------------------------------------------------------- +// +void CMusEngReceiveSession::InactivityTimeout( CMceMediaStream& aStream, + CMceRtpSource& /*aSource*/ ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWayRecvSession::InactivityTimeout()" ) + + if ( aStream.Type() == KMceVideo && iReceiving ) + { + iReceiving = EFalse; + iBuffered = EFalse; + InformObserverAboutPlayerStateChange( iRemoteVideoPlayer ); + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWayRecvSession::InactivityTimeout()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngReceiveSession::ReceivingStarted() + { + if ( iSession && iBuffered ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngReceiveSession::ReceivingStarted()" ) + + TInt err = MusEngMceUtils::EnableInactivityTimer( + *iSession, iReceivingInactivityTimeout ); + + if ( err != KErrNone ) + { + MUS_LOG1("mus: [ENGINE] ReceivingStarted failed %d", err) + InformObserverAboutSessionFailure( err ); + } + else + { + iReceiving = ETrue; + InformObserverAboutPlayerStateChange( iRemoteVideoPlayer ); + InformUiProviderAboutReceivingStart(); + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngReceiveSession::ReceivingStarted()" ) + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMusEngReceiveSession::IsDisplayActive() + { + return ( IsDisplayEnabled() && iReceiving ); + } +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/src/musengremotevideoplayer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/src/musengremotevideoplayer.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,130 @@ +/* +* 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: +* +*/ + + +// USER +#include "musengremotevideoplayer.h" +#include "musengmceutils.h" +#include "musengdisplayhandler.h" + +// SYSTEM +#include +#include + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngRemoteVideoPlayer* CMusEngRemoteVideoPlayer::NewL( + MMusEngDisplayHandler& aDisplayHandler, + MLcAudioControl& aLcAudioControl ) + { + return new( ELeave )CMusEngRemoteVideoPlayer( + aDisplayHandler, aLcAudioControl ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngRemoteVideoPlayer::CMusEngRemoteVideoPlayer( + MMusEngDisplayHandler& aDisplayHandler, + MLcAudioControl& aLcAudioControl ) : + CMusEngVideoPlayerBase( aDisplayHandler, aLcAudioControl ) + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngRemoteVideoPlayer::~CMusEngRemoteVideoPlayer() + { + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcVideoPlayer::TLcVideoPlayerState +CMusEngRemoteVideoPlayer::LcVideoPlayerState() const + { + if ( !iMceSession ) + { + return MLcVideoPlayer::EUnavailable; + } + CMceVideoStream* stream = NULL; + TRAPD( err, stream = MusEngMceUtils::GetVideoInStreamL( *iMceSession ) ) + TLcVideoPlayerState playerState = MLcVideoPlayer::EUnavailable; + if ( err == KErrNone && stream ) + { + switch ( stream->State() ) + { + case CMceMediaStream::EInitialized: + { + playerState = MLcVideoPlayer::EInit; + break; + } + case CMceMediaStream::EBuffering: + { + playerState = MLcVideoPlayer::EBuffering; + break; + } + case CMceMediaStream::EIdle: + case CMceMediaStream::EDisabled: + { + playerState = MLcVideoPlayer::EPaused; + break; + } + case CMceMediaStream::EStreaming: + { + // MCE stream state does not contain RTP activity information + playerState = iDisplayHandler.IsDisplayActive() ? + MLcVideoPlayer::EPlaying : MLcVideoPlayer::EPaused; + break; + } + default: // Other MCE stream states: MLcVideoPlayer::EUnavailable + { + break; + } + } + } + return playerState; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +TBool CMusEngRemoteVideoPlayer::LcIsPlayingL() + { + if ( !iMceSession ) + { + return EFalse; + } + CMceMediaStream* stream = MusEngMceUtils::GetVideoInStreamL( *iMceSession ); + TBool isPlaying( EFalse ); + + if ( iMceSession->State() == CMceSession::EEstablished && + stream && + stream->State() == CMceMediaStream::EStreaming ) + { + isPlaying = ETrue; + } + + return isPlaying; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/src/musengsessiondurationtimer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/src/musengsessiondurationtimer.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,112 @@ +/* +* Copyright (c) 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: +* +*/ + + +// USER INCLUDES +#include "musengsessiondurationtimer.h" +#include "musengsessiondurationtimerobserver.h" + + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngSessionDurationTimer* CMusEngSessionDurationTimer::NewL( + MMusEngSessionDurationTimerObserver& aObserver ) + { + CMusEngSessionDurationTimer* self = + new (ELeave) CMusEngSessionDurationTimer( aObserver ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self) ; + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngSessionDurationTimer::~CMusEngSessionDurationTimer() + { + Cancel(); + iTimer.Close(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngSessionDurationTimer::Start(TInt aDelay ) + { + if ( !IsActive() ) + { + iTimer.After( iStatus, aDelay ); + SetActive(); + } + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngSessionDurationTimer::CMusEngSessionDurationTimer( + MMusEngSessionDurationTimerObserver& aObserver ) + : CActive( CActive::EPriorityStandard ), + iObserver( aObserver) + { + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngSessionDurationTimer::ConstructL() + { + CActiveScheduler::Add( this ); + User::LeaveIfError( iTimer.CreateLocal() ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngSessionDurationTimer::RunL() + { + if ( iStatus.Int() == KErrNone ) + { + iObserver.UpdateTimerEvent(); + } + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngSessionDurationTimer::DoCancel() + { + iTimer.Cancel(); + } + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/src/musengsessionmanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/src/musengsessionmanager.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,186 @@ +/* +* 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 "musengsessionmanager.h" +#include "musenglivesession.h" +#include "musengclipsession.h" +#include "musengreceivesession.h" +#include "musengtwowaysession.h" +#include "musengtwowayrecvsession.h" +#include "mussessionproperties.h" +#include "muspropertywatch.h" +#include +#include + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngSessionManager* CMusEngSessionManager::NewL() + { + CMusEngSessionManager* self = new( ELeave )CMusEngSessionManager(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngSessionManager::~CMusEngSessionManager() + { + delete iUseCaseWatch; + delete iSession; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngSessionManager::CMusEngSessionManager() + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngSessionManager::ConstructL() + { + TInt useCase; + User::LeaveIfError( RProperty::Get( NMusSessionApi::KCategoryUid, + NMusSessionApi::KUseCase, + useCase ) ); + iSession = CreateMusSessionL( + static_cast< MultimediaSharing::TMusUseCase >( useCase ) ); + + iUseCaseWatch = CMusPropertyWatch::NewL( + *this, NMusSessionApi::KCategoryUid, NMusSessionApi::KUseCase ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +MLcSession& CMusEngSessionManager::Session() + { + return *iSession; + } + +// ----------------------------------------------------------------------------- +// If usecase changes while background startup is active, client is +// notified about change by bringing it to foreground and changing current +// active session. Old session is terminated immediately after notification. +// ----------------------------------------------------------------------------- +// +void CMusEngSessionManager::PropertyChanged( + const TUint /*aKey*/, + const TInt aValue ) + { + MUS_LOG1( "mus: [ENGINE] -> CMusEngSessionManager::PropertyChanged, val:%d", + aValue ) + + if ( iSession->IsBackgroundStartup() && aValue != iCurrentUseCase ) + { + MUS_LOG( "mus: [ENGINE] Usecase changed!" ) + MLcUiProvider* uiProvider = iSession->LcUiProvider(); + if ( uiProvider ) + { + CMusEngMceSession* newSession = NULL; + TRAP_IGNORE( newSession = CreateMusSessionL( + static_cast< MultimediaSharing::TMusUseCase >( aValue ) ) ); + if ( newSession ) + { + MUS_LOG( "mus: [ENGINE] Set new active session" ) + CMusEngMceSession* oldSession = iSession; + iSession = newSession; + iSession->SetForegroundStatus( ETrue ); + uiProvider->HandleForegroundStatus( ETrue ); + delete oldSession; + } + } + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngSessionManager::PropertyChanged" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngSessionManager::HandlePropertyError( const TInt /*aReason*/ ) + { + // NOP + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMusEngSessionManager::IsFeatureSupported( TLcFeature aLcFeature ) + { + return ( aLcFeature == ELcShowInvitingNote || + aLcFeature == ELcShowWaitingNote || + aLcFeature == ELcShowAcceptQuery ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngMceSession* CMusEngSessionManager::CreateMusSessionL( + MultimediaSharing::TMusUseCase aUseCase ) + { + CMusEngMceSession* session = NULL; + switch ( aUseCase ) + { + case MultimediaSharing::EMusLiveVideo: + { + session = CMusEngLiveSession::NewL(); + break; + } + case MultimediaSharing::EMusClipVideo: + { + session = CMusEngClipSession::NewL(); + break; + } + case MultimediaSharing::EMusReceive: + { + session = CMusEngReceiveSession::NewL(); + break; + } + case MultimediaSharing::EMusTwoWayVideo: + { + session = CMusEngTwoWaySession::NewL(); + break; + } + case MultimediaSharing::EMusReceiveTwoWayVideo: + { + session = CMusEngTwoWayRecvSession::NewL(); + break; + } + default: + User::Leave( KErrNotSupported ); + break; + } + iCurrentUseCase = aUseCase; + return session; + } + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/src/musengtelephoneutils.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/src/musengtelephoneutils.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,380 @@ +/* +* Copyright (c) 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: +* +*/ + + +// USER +#include "musengtelephoneutils.h" +#include "musengaudioroutingobserver.h" +#include "muslogger.h" + +// SYSTEM +#include +#include +#include +#include +#include // for CPhCltCommandHandler + +// Constants +const TInt KMusEngMaxVolume = 10; +const TInt KMusEngMinVolume = 0; + + + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngTelephoneUtils* CMusEngTelephoneUtils::NewL( + MMusEngAudioRoutingObserver& aAudioRoutingObserver ) + { + CMusEngTelephoneUtils* self = + new( ELeave )CMusEngTelephoneUtils( aAudioRoutingObserver ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngTelephoneUtils::CMusEngTelephoneUtils( + MMusEngAudioRoutingObserver& aAudioRoutingObserver ) + : CActive( CActive::EPriorityStandard ), + iAudioRoutingObserver( aAudioRoutingObserver ) + { + iAudioOutputAtStartup = CTelephonyAudioRouting::ENotActive; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTelephoneUtils::ConstructL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTelephoneUtils::ConstructL()" ) + + // Volume control + iRepository = CRepository::NewL( KCRUidInCallVolume ); + + // Audio routing control + iTelephonyAudioRouting = CTelephonyAudioRouting::NewL( *this ); + + iAudioOutputAtStartup = iTelephonyAudioRouting->Output(); + + // Phone + MUS_LOG( "mus: [ENGINE] Use static DLL" ) + iPhoneCommandHandler = CPhCltCommandHandler::NewL(); + + CActiveScheduler::Add( this ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngTelephoneUtils::ConstructL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngTelephoneUtils::~CMusEngTelephoneUtils() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTelephoneUtils::~CMusEngTelephoneUtils()" ) + + Cancel(); + + delete iPhoneCommandHandler; + + if( iTelephonyAudioRouting ) // If 2nd phase construction has succeeded + { + CTelephonyAudioRouting::TAudioOutput currentMode = + iTelephonyAudioRouting->Output(); + if( currentMode != iAudioOutputAtStartup ) + { + // As going down, let audiorouting api to show notification + iTelephonyAudioRouting->SetShowNote( ETrue ); + TRAPD( err, + iTelephonyAudioRouting->SetOutputL( iAudioOutputAtStartup ) ) + MUS_LOG1( "mus: [ENGINE] final route change completed: %d", err ) + err++; + } + } + + delete iRepository; + delete iTelephonyAudioRouting; + MUS_LOG( "mus: [ENGINE] <- CMusEngTelephoneUtils::~CMusEngTelephoneUtils()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMusEngTelephoneUtils::AudioRoutingCanBeChanged() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTelephoneUtils::AudioRoutingCanBeChanged" ) + + TBool retValue = ( iTelephonyAudioRouting->Output() != + CTelephonyAudioRouting::EWiredAudioAccessory && + iTelephonyAudioRouting->Output() != + CTelephonyAudioRouting::EBTAudioAccessory && + iTelephonyAudioRouting->Output() != + CTelephonyAudioRouting::ETTY ); + + MUS_LOG1( "mus: [ENGINE] <- CMusEngTelephoneUtils::AudioRoutingCanBeChanged: %d", + retValue ) + + return retValue; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTelephoneUtils::LoudspeakerL( TBool aEnable ) + { + MUS_LOG1( "mus: [ENGINE] -> CMusEngTelephoneUtils::LoudspeakerL(%d)", + aEnable ) + + // Disable note shown by audiorouting api as it causes + // application going to background for a while. Instead, display + // note by ourselves once setting output completes. This mechanism + // is needed only for loudspeaker enabling as going to background + // causes problems only at beginning of sharing session. + iTelephonyAudioRouting->SetShowNote( EFalse ); + if ( aEnable ) + { + if ( iTelephonyAudioRouting->Output() == + CTelephonyAudioRouting::EHandset ) + { + iTelephonyAudioRouting->SetOutputL( + CTelephonyAudioRouting::ELoudspeaker ); + } + } + else + { + if ( iAudioOutputAtStartup == CTelephonyAudioRouting::ELoudspeaker ) + { + iTelephonyAudioRouting->SetOutputL( + CTelephonyAudioRouting::EHandset ); + } + else + { + iTelephonyAudioRouting->SetOutputL( iAudioOutputAtStartup ); + } + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngTelephoneUtils::LoudspeakerL(...)" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMusEngTelephoneUtils::IsLoudSpeakerEnabled() const + { + return ( iTelephonyAudioRouting->Output() == + CTelephonyAudioRouting::ELoudspeaker ); + } + +// ----------------------------------------------------------------------------- +// Gets the CS call volume level. +// Leaves if error occurs when accessing central repository. +// ----------------------------------------------------------------------------- +// +TInt CMusEngTelephoneUtils::GetVolumeL() const + { + TInt currentVolume = 0; + if ( IsLoudSpeakerEnabled() ) + { + User::LeaveIfError( iRepository->Get( KTelIncallLoudspeakerVolume, + currentVolume ) ); + } + else + { + User::LeaveIfError( iRepository->Get( KTelIncallEarVolume, + currentVolume ) ); + } + return ValidateVolume( currentVolume ); + } + +// ----------------------------------------------------------------------------- +// Sets the CS call volume level. +// Leaves if error occurs when accessing central repository. +// ----------------------------------------------------------------------------- +// +void CMusEngTelephoneUtils::SetVolumeL( TInt aVolume ) + { + TInt newVolume = ValidateVolume( aVolume ); + + if ( GetVolumeL() != newVolume ) + { + if ( IsLoudSpeakerEnabled() ) + { + User::LeaveIfError( iRepository->Set( KTelIncallLoudspeakerVolume, + newVolume ) ); + } + else + { + User::LeaveIfError( iRepository->Set( KTelIncallEarVolume, + newVolume ) ); + } + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTelephoneUtils::MuteMicL( TBool aMute ) + { + MUS_LOG1( "mus: [ENGINE] -> CMusEngTelephoneUtils::MuteMicL(%d)", aMute ) + + if ( IsActive() ) + { + MUS_LOG( "mus: [ENGINE] Cancel pending request" ) + Cancel(); + } + + iPhoneCommandHandler->MuteMicrophone( iStatus, aMute ); + SetActive(); + + MUS_LOG( "mus: [ENGINE] <- CMusEngTelephoneUtils::MuteMicL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMusEngTelephoneUtils::IsMicMutedL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTelephoneUtils::IsMicMutedL()" ) + + TInt psVal; + User::LeaveIfError( RProperty::Get( KPSUidTelMicrophoneMuteStatus, + KTelMicrophoneMuteState, + psVal ) ); + + MUS_LOG1( "mus: [ENGINE] Mute status in PS is (%d)", psVal ) + MUS_LOG( "mus: [ENGINE] <- CMusEngTelephoneUtils::IsMicMutedL()" ) + + return ( psVal == EPSTelMicMuteOn ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTelephoneUtils::RunL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTelephoneUtils::RunL()" ) + + // NOP, since we really cannot do anything but log the result + MUS_LOG1( "mus: [ENGINE] Asynchronous call completed with code %d", + iStatus.Int() ) + + MUS_LOG( "mus: [ENGINE] <- CMusEngTelephoneUtils::RunL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTelephoneUtils::DoCancel() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTelephoneUtils::DoCancel()" ) + + if ( iPhoneCommandHandler ) + { + iPhoneCommandHandler->CancelAsyncRequest( EPhCltCommandMuteMic ); + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngTelephoneUtils::DoCancel()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTelephoneUtils::AvailableOutputsChanged( + CTelephonyAudioRouting& /*aTelephonyAudioRouting*/ ) + { + // NOP + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTelephoneUtils::OutputChanged( + CTelephonyAudioRouting& aTelephonyAudioRouting ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTelephoneUtils::OutputChanged()" ) + + // Some other application has changed audio output routing. We consider + // this as a last will of a user and return to this state after sharing + + iAudioOutputAtStartup = aTelephonyAudioRouting.Output(); + + MUS_LOG1( "mus: [ENGINE] New audio routing is %d", iAudioOutputAtStartup ) + + iAudioRoutingObserver.AudioRoutingChanged(); + + MUS_LOG( "mus: [ENGINE] <- CMusEngTelephoneUtils::OutputChanged()" ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTelephoneUtils::SetOutputComplete( + CTelephonyAudioRouting& /*aTelephonyAudioRouting*/, + TInt aError ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTelephoneUtils::SetOutputComplete()" ) + + if ( aError == KErrNone ) + { + iAudioRoutingObserver.AudioRoutingChanged(); + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngTelephoneUtils::SetOutputComplete()" ) + } + +// ----------------------------------------------------------------------------- +// Validates that requested volume level is valid (between 1-10) and if it is +// not, modifies requested volume level to be valid. Returns validated volume. +// ----------------------------------------------------------------------------- +// +TInt CMusEngTelephoneUtils::ValidateVolume( const TInt aVolume ) const + { + if ( aVolume < KMusEngMinVolume ) + { + return KMusEngMinVolume; + } + else if ( aVolume > KMusEngMaxVolume ) + { + return KMusEngMaxVolume; + } + else + { + // NOP, to keep PC-Lint happy + } + + return aVolume; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/src/musengtwowayrecvsession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/src/musengtwowayrecvsession.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,544 @@ +/* +* Copyright (c) 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: +* +*/ + + +// USER +#include "musengtwowayrecvsession.h" +#include "musunittesting.h" +#include "musengmceutils.h" +#include "musenglogger.h" +#include "mussipprofilehandler.h" +#include "musenglivevideoplayer.h" +#include "musengremotevideoplayer.h" + +// SYSTEM +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +const TInt KMusEngJitterBufferLength = 51; //Must be bigger than treshold +// Using following value increases treshold buffer to 1 second from +// default 100 ms +const TInt KMusEngJitterBufferTreshold = 50; + +const TUint32 KMusEngTwoWayReceivingActivityTimeout = 5000; // 5 seconds +// 6 seconds keepalive timer, needs to be more than receiving timeout +const TUint8 KMusEngTwoWayRtpKeepAliveTimer = 6; + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngTwoWayRecvSession* CMusEngTwoWayRecvSession::NewL() + { + CMusEngTwoWayRecvSession* self = new( ELeave )CMusEngTwoWayRecvSession(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngTwoWayRecvSession::~CMusEngTwoWayRecvSession() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWayRecvSession::~CMusEngTwoWayRecvSession()" ) + + delete iLiveVideoPlayer; + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWayRecvSession::~CMusEngTwoWayRecvSession()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWayRecvSession::EnableDisplayL( TBool aEnable ) + { + MUS_LOG1( "mus: [ENGINE] -> CMusEngTwoWayRecvSession::EnableDisplayL() %d", + aEnable ) + + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + CMceDisplaySink* display = MusEngMceUtils::GetReceivingDisplayL( *iSession ); + MusEngMceUtils::DoEnableDisplayL( *display, aEnable ); + + CMceDisplaySink* vfDisplay = MusEngMceUtils::GetVfDisplay( *iSession ); + if ( vfDisplay ) + { + MusEngMceUtils::DoEnableDisplayL( *vfDisplay, aEnable ); + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWayRecvSession::EnableDisplayL()") + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMusEngTwoWayRecvSession::IsDisplayEnabled() + { + TBool enabled( EFalse ); + if ( iSession ) + { + CMceDisplaySink* display = MusEngMceUtils::GetReceivingDisplay( *iSession ); + if ( display ) + { + enabled = display->IsEnabled(); + } + } + return enabled; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngMceSession::TDisplayOrientation CMusEngTwoWayRecvSession::OrientationL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWayRecvSession::RotationL()" ) + + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + CMceDisplaySink* display = MusEngMceUtils::GetReceivingDisplayL( *iSession ); + + TDisplayOrientation displayOrientation; + CMceDisplaySink::TRotation rotation( display->RotationL() ); + + MUS_LOG1( "mus: [ENGINE] MCE rotation is %d", rotation ) + + if ( rotation == CMceDisplaySink::ENone ) + { + displayOrientation = CMusEngMceSession::EPortrait; + } + else + { + displayOrientation = CMusEngMceSession::ELandscape; + } + + MUS_LOG1( "mus: [ENGINE] <- CMusEngTwoWayRecvSession::RotationL() %d", + displayOrientation ) + + return displayOrientation; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWayRecvSession::SetOrientationL( TDisplayOrientation aOrientation ) + { + MUS_LOG1( "mus: [ENGINE] -> CMusEngTwoWayRecvSession::SetOrientationL() %d", + aOrientation ) + + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + CMceDisplaySink* display = MusEngMceUtils::GetReceivingDisplayL( *iSession ); + + CMceDisplaySink* vfDisplay = MusEngMceUtils::GetVfDisplay( *iSession ); + + CMceDisplaySink::TRotation rotation = ( aOrientation == EPortrait ) ? + CMceDisplaySink::ENone : CMceDisplaySink::EClockwise90Degree; + + display->SetRotationL( rotation ); + if ( vfDisplay ) + { + vfDisplay->SetRotationL( rotation ); + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWayRecvSession::SetOrientationL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWayRecvSession::SetRectsL( + const TRect& aRemoteRect, + const TRect& aLocalRect ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWayRecvSession::SetRectsL()" ) + + iLocalRect = aLocalRect; + iRect = aRemoteRect; + RectChangedL(); + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWayRecvSession::SetRectsL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWayRecvSession::SetSecondaryRectL( const TRect& aSecondaryRect ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWayRecvSession::SetSecondaryRectL()" ) + + iLocalRect = aSecondaryRect; + RectChangedL(); + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWayRecvSession::SetSecondaryRectL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TRect CMusEngTwoWayRecvSession::SecondaryRect() const + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWayRecvSession::SecondaryRect()" ) + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWayRecvSession::SecondaryRect()" ) + return iLocalRect; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TMusEngCameraHandler& CMusEngTwoWayRecvSession::Camera() + { + return iCameraHandler; + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +MLcVideoPlayer* CMusEngTwoWayRecvSession::LocalVideoPlayer() + { + return iLiveVideoPlayer; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// + +void CMusEngTwoWayRecvSession::RectChangedL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWayRecvSession::RectChangedL()" ) + + + // If session is not yet created, do nothing + if ( iSession && iSession->State() != CMceSession::ETerminated ) + { + TRect remoteRect( Rect() ); + MUS_LOG2( "mus: [ENGINE] remote tl.ix=%d tl.iy=%d", + remoteRect.iTl.iX, remoteRect.iTl.iY ) + MUS_LOG2( "mus: [ENGINE] remote brc%d br.iy=%d", + remoteRect.iBr.iX, remoteRect.iBr.iY ) + MUS_LOG2( "mus: [ENGINE] local tl.ix=%d tl.iy=%d", + iLocalRect.iTl.iX, iLocalRect.iTl.iY ) + MUS_LOG2( "mus: [ENGINE] local br.ix=%d br.iy=%d", + iLocalRect.iBr.iX, iLocalRect.iBr.iY ) + + if ( remoteRect != iSetRemoteRect ) + { + CMceDisplaySink* display = MusEngMceUtils::GetReceivingDisplayL( *iSession ); + display->SetDisplayRectL( remoteRect ); + iSetRemoteRect = remoteRect; + } + + if ( iLocalRect != iSetLocalRect ) + { + CMceDisplaySink* vfDisplay = MusEngMceUtils::GetVfDisplay( *iSession ); + if ( vfDisplay ) + { + vfDisplay->SetDisplayRectL( iLocalRect ); + } + iSetLocalRect = iLocalRect; + } + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWayRecvSession::RectChangedL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWayRecvSession::CompleteSessionStructureL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWayRecvSession::CompleteSessionStructureL()" ) + + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + iCameraHandler.SetSession( iSession ); + + // Force bandwidth line usage in sdp as it is mandatory + // at MT side based on GSMA VS specification IR.74. Bandwidth is set to + // session or to media level based on sender's way of usage. If other end + // is not using bandwidth attribute at all, media level is preferred. + SetSessionSdpLinesL( *iSession, ETrue ); + + CMceStreamBundle* localBundle = + CMceStreamBundle::NewLC( CMceStreamBundle::ELS ); + + const RPointerArray& streams = iSession->Streams(); + + CMceMediaStream* videoInStream = NULL; + CMceMediaStream* videoOutStream = NULL; + + // Search interesting video streams, sendrecv is preferred + TBool sendRecvVideoFound( EFalse ); + for( TInt i = 0; i < streams.Count(); ++i ) + { + if ( MusEngMceUtils::IsVideoInStream( *streams[i] ) && + !sendRecvVideoFound ) + { + videoInStream = streams[i]; + + if ( streams[i]->BoundStream() ) + { + videoOutStream = &streams[i]->BoundStreamL(); + } + } + else if ( streams[i]->BoundStream() && + MusEngMceUtils::IsVideoInStream( streams[i]->BoundStreamL() ) && + !sendRecvVideoFound ) + { + videoInStream = &streams[i]->BoundStreamL(); + + videoOutStream = streams[i]; + } + else + { + // NOP + } + + sendRecvVideoFound = ( videoInStream && videoOutStream ); + } + + CompleteSessionStructureAudioPartL( streams, *localBundle, videoInStream, videoOutStream ); + + if ( videoInStream ) + { + CompleteSessionStructureInStreamL( *videoInStream, *localBundle ); + } + else + { + // At least receiving video stream is required + User::Leave( KErrCorrupt ); + } + + if ( videoOutStream ) + { + CompleteSessionStructureOutStreamL( *videoOutStream ); + } + + // Destroy bundle if it is not needed or transfer ownership + if ( localBundle->Streams().Count() > 1 ) + { + iSession->AddBundleL( localBundle ); + CleanupStack::Pop( localBundle ); + } + else + { + CleanupStack::PopAndDestroy( localBundle ); + } + + AdjustStreamsAndCodecsL(); + + iSession->UpdateL(); + + // Now session state is right to adjust volume + SetSpeakerVolumeL( LcVolumeL() ); + + iSipProfileHandler->CreateProfileL( iSession->Profile() ); + + iRemoteVideoPlayer->SetMceSession( iSession ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWayRecvSession::CompleteSessionStructureL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngTwoWayRecvSession::CMusEngTwoWayRecvSession() + : CMusEngReceiveSession() + { + iMceManagerUid.iUid = CMusManager::ESipInviteDesired2WayVideo; + + iSetRemoteRect = TRect( + KMusEngRectNotInit, KMusEngRectNotInit, KMusEngRectNotInit, KMusEngRectNotInit ); + iSetLocalRect = TRect( + KMusEngRectNotInit, KMusEngRectNotInit, KMusEngRectNotInit, KMusEngRectNotInit ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWayRecvSession::ConstructL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWayRecvSession::ConstructL()" ) + + iCameraHandler.ReadCameraUsageKeyL(); + CMusEngReceiveSession::ConstructL(); + + iLiveVideoPlayer = + CMusEngLiveVideoPlayer::NewL( *this, iCameraHandler, *this ); + + // Override receiving timeout and keepalive values of + // normal one-way receiving session + // + iReceivingInactivityTimeout = KMusEngTwoWayReceivingActivityTimeout; + iKeepaliveTimer = KMusEngTwoWayRtpKeepAliveTimer; + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWayRecvSession::ConstructL()" ) + } + +// ----------------------------------------------------------------------------- +// When checking audio streams also not interesting streams are removed from +// session. Stream if removed if one of following apply: +// 1. Is not and does not contain incoming video or audio +// 2. We already have one incoming video stream +// 3. Stream is audio and we run operator variant where audio is +// not allowed. +// 4. Two-way video exists and this one is audio +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWayRecvSession::CompleteSessionStructureAudioPartL( + const RPointerArray& aStreams, + CMceStreamBundle& aLocalBundle, + CMceMediaStream* aVideoInStream, + CMceMediaStream* aVideoOutStream ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWayRecvSession::CompleteSessionStructureAudioPartL()" ) + + // Audio streams not allowed in two-way session or in operator variant + TBool audioAllowed( !( aVideoInStream && aVideoOutStream ) && !iOperatorVariant ); + + for( TInt i = 0; i < aStreams.Count(); ++i ) + { + // Audio supported currently only in recvonly case + if ( audioAllowed && + MusEngMceUtils::IsAudioInStream( *aStreams[i] ) ) + { + MusEngMceUtils::AddSpeakerL( *aStreams[i] ); + + aLocalBundle.AddStreamL( *aStreams[i] ); + + // Disable possible opposite stream to indicate that sendrecv audio is + // not allowed. + if ( aStreams[i]->BoundStream() ) + { + MusEngMceUtils::DisableStreamL( aStreams[i]->BoundStreamL() ); + } + } + else if ( audioAllowed && + aStreams[i]->BoundStream() && + MusEngMceUtils::IsAudioInStream( aStreams[i]->BoundStreamL() ) ) + { + MusEngMceUtils::AddSpeakerL( aStreams[i]->BoundStreamL() ); + + aLocalBundle.AddStreamL( aStreams[i]->BoundStreamL() ); + + // Disable opposite stream to indicate that sendrecv audio is not allowed. + MusEngMceUtils::DisableStreamL( *aStreams[i] ); + } + else if ( aStreams[ i ] != aVideoInStream && aStreams[ i ] != aVideoOutStream ) + { + iSession->RemoveStreamL( *aStreams[i] ); + + // Since succesfull removal of a stream has decreased the amount + // of streams in array by one, we have to modify the index + --i; + } + else + { + // NOP + } + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWayRecvSession::CompleteSessionStructureAudioPartL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWayRecvSession::CompleteSessionStructureInStreamL( + CMceMediaStream& aVideoInStream, CMceStreamBundle& aLocalBundle ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWayRecvSession::CompleteSessionStructureInStreamL()" ) + + SetMediaSdpLinesL( aVideoInStream, ETrue ); + + MusEngMceUtils::AddDisplayL( aVideoInStream, *iManager, Rect() ); + + static_cast(aVideoInStream.Source())->UpdateL( + KMusEngJitterBufferLength, + KMusEngJitterBufferTreshold, + KMusEngTwoWayReceivingActivityTimeout ); + + aLocalBundle.AddStreamL( aVideoInStream ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWayRecvSession::CompleteSessionStructureInStreamL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWayRecvSession::CompleteSessionStructureOutStreamL( + CMceMediaStream& aVideoOutStream ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWayRecvSession::CompleteSessionStructureOutStreamL()" ) + + SetMediaSdpLinesL( aVideoOutStream, ETrue ); + + CMceCameraSource* camera = NULL; + TRAP_IGNORE( camera = MusEngMceUtils::GetCameraL( *iSession ) ) + if ( !camera ) + { + camera = CMceCameraSource::NewLC( *iManager ); + aVideoOutStream.SetSourceL( camera ); + CleanupStack::Pop( camera ); + } + + camera->DisableL(); // Start session in pause mode. + + iCameraHandler.InitializeL( *camera ); + + CMceVideoStream* vfStream = CMceVideoStream::NewLC(); + + vfStream->SetSourceL( aVideoOutStream.Source() ); + + // Complete stream, vf display is disabled at creation phase if doing bg startup + MusEngMceUtils::AddDisplayL( *vfStream, *iManager, SecondaryRect(), IsBackgroundStartup() ); + + iSession->AddStreamL( vfStream ); + CleanupStack::Pop( vfStream ); + + iLiveVideoPlayer->SetMceSession( iSession ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWayRecvSession::CompleteSessionStructureOutStreamL()" ) + } + + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/src/musengtwowaysession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/src/musengtwowaysession.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,530 @@ +/* +* Copyright (c) 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: +* +*/ + + +// USER +#include "musengtwowaysession.h" +#include "musunittesting.h" +#include "musengmceutils.h" +#include "musenglogger.h" +#include "musengremotevideoplayer.h" +#include "musenglivevideoplayer.h" + +// SYSTEM +#include +#include +#include +#include +#include +#include +#include +#include +#include + +const TInt KMusEngJitterBufferLength = 51; //Must be bigger than treshold +// Using following value increases treshold buffer to 1 second from +// default 100 ms +const TInt KMusEngJitterBufferTreshold = 50; + +const TUint32 KMusEngTwoWayReceivingActivityTimeout = 5000; // 5 seconds +// 6 seconds keepalive timer, needs to be more than receiving timeout +const TUint8 KMusEngTwoWayRtpKeepAliveTimer = 6; + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngTwoWaySession* CMusEngTwoWaySession::NewL() + { + CMusEngTwoWaySession* self = new( ELeave )CMusEngTwoWaySession(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngTwoWaySession::~CMusEngTwoWaySession() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWaySession::~CMusEngTwoWaySession()" ) + + delete iRemoteVideoPlayer; + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWaySession::~CMusEngTwoWaySession()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWaySession::EnableDisplayL( TBool aEnable ) + { + MUS_LOG1( "mus: [ENGINE] -> CMusEngTwoWaySession::EnableDisplayL() %d", + aEnable ) + + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + CMceDisplaySink* display = MusEngMceUtils::GetReceivingDisplay( *iSession ); + if ( display ) + { + MusEngMceUtils::DoEnableDisplayL( *display, aEnable ); + } + CMceDisplaySink* vfDisplay = MusEngMceUtils::GetDisplayL( *iSession, ETrue ); + MusEngMceUtils::DoEnableDisplayL( *vfDisplay, aEnable ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWaySession::EnableDisplayL()") + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWaySession::SetOrientationL( TDisplayOrientation aOrientation ) + { + MUS_LOG1( "mus: [ENGINE] -> CMusEngTwoWaySession::SetOrientationL() %d", + aOrientation ) + + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + CMceDisplaySink* display = MusEngMceUtils::GetReceivingDisplay( *iSession ); + CMceDisplaySink* vfDisplay = MusEngMceUtils::GetDisplayL( *iSession, ETrue ); + + CMceDisplaySink::TRotation rotation = ( aOrientation == EPortrait ) ? + CMceDisplaySink::ENone : CMceDisplaySink::EClockwise90Degree; + + vfDisplay->SetRotationL( rotation ); + if ( display ) + { + display->SetRotationL( rotation ); + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWaySession::SetOrientationL()" ) + } + +// ----------------------------------------------------------------------------- +// From MLcFileControl +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWaySession::EnableLcFileL( TBool /*aEnable*/ ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWaySession::EnableLcFileL" ) + + User::Leave( KErrNotSupported ); + + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWaySession::EnableLcFileL" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWaySession::SetRectsL( + const TRect& aRemoteRect, + const TRect& aLocalRect ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWaySession::SetRectsL()" ) + + iLocalRect = aLocalRect; + iRect = aRemoteRect; + RectChangedL(); + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWaySession::SetRectsL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWaySession::SetSecondaryRectL( const TRect& aSecondaryRect ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWaySession::SetSecondaryRectL()" ) + + iLocalRect = aSecondaryRect; + RectChangedL(); + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWaySession::SetSecondaryRectL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TRect CMusEngTwoWaySession::SecondaryRect() const + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWaySession::SecondaryRect()" ) + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWaySession::SecondaryRect()" ) + return iLocalRect; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMusEngTwoWaySession::IsDisplayEnabled() + { + TBool enabled( EFalse ); + if ( iSession ) + { + CMceDisplaySink* display = MusEngMceUtils::GetReceivingDisplay( *iSession ); + if ( !display ) + { + display = MusEngMceUtils::GetVfDisplay( *iSession ); + } + if ( display ) + { + enabled = display->IsEnabled(); + } + } + return enabled; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMusEngTwoWaySession::IsDisplayActive() + { + return ( IsDisplayEnabled() && iReceiving ); + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +MLcVideoPlayer* CMusEngTwoWaySession::RemoteVideoPlayer() + { + return iRemoteVideoPlayer; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWaySession::RectChangedL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWaySession::RectChangedL()" ) + + // If session is not yet created, do nothing + if ( iSession && iSession->State() != CMceSession::ETerminated ) + { + TRect remoteRect( Rect() ); + MUS_LOG2( "mus: [ENGINE] remote tl.ix=%d tl.iy=%d", + remoteRect.iTl.iX, remoteRect.iTl.iY ) + MUS_LOG2( "mus: [ENGINE] remote br.ix=%d br.iy=%d", + remoteRect.iBr.iX, remoteRect.iBr.iY ) + MUS_LOG2( "mus: [ENGINE] local tl.ix=%d tl.iy=%d", + iLocalRect.iTl.iX, iLocalRect.iTl.iY ) + MUS_LOG2( "mus: [ENGINE] local br.ix=%d br.iy=%d", + iLocalRect.iBr.iX, iLocalRect.iBr.iY ) + + if ( remoteRect != iSetRemoteRect ) + { + CMceDisplaySink* display = MusEngMceUtils::GetReceivingDisplay( *iSession ); + if ( display ) + { + MUS_LOG( "mus: [ENGINE] set remote rect" ) + display->SetDisplayRectL( remoteRect ); + iSetRemoteRect = remoteRect; + } + } + + if ( iLocalRect != iSetLocalRect ) + { + MUS_LOG( "mus: [ENGINE] set local rect" ) + CMceDisplaySink* vfDisplay = MusEngMceUtils::GetDisplayL( *iSession, ETrue ); + vfDisplay->SetDisplayRectL( iLocalRect ); + iSetLocalRect = iLocalRect; + } + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWaySession::RectChangedL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWaySession::CompleteSessionStructureL( + CMceStreamBundle& /*aLocalBundle*/ ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWaySession::CompleteSessionStructureL()" ) + + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + iCameraHandler.SetSession( iSession ); + + // Create outgoing video stream + CMceVideoStream* videoStream = CMceVideoStream::NewLC(); + + CMceRtpSink* rtpsink = CMceRtpSink::NewLC(); + videoStream->AddSinkL( rtpsink ); + CleanupStack::Pop( rtpsink ); + + CMceCameraSource* camera = CMceCameraSource::NewLC( *iManager ); + camera->DisableL(); // Start session in pause mode. + + iCameraHandler.InitializeL( *camera ); + + videoStream->SetSourceL( camera ); + CleanupStack::Pop( camera ); + + // Create incoming video stream + CMceVideoStream* videoInStream = CMceVideoStream::NewL(); + CleanupStack::PushL( videoInStream ); + + MusEngMceUtils::AddDisplayL( *videoInStream, *iManager, Rect() ); + + CMceRtpSource* rtpSource = CMceRtpSource::NewLC( KMusEngJitterBufferLength, + KMusEngJitterBufferTreshold, + KMusEngTwoWayReceivingActivityTimeout ); + videoInStream->SetSourceL( rtpSource ); + CleanupStack::Pop( rtpSource ); + + videoStream->BindL( videoInStream ); + CleanupStack::Pop( videoInStream ); + + iSession->AddStreamL( videoStream ); + CleanupStack::Pop( videoStream ); + + iLiveVideoPlayer->SetMceSession( iSession ); + iRemoteVideoPlayer->SetMceSession( iSession ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWaySession::CompleteSessionStructureL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWaySession::CreateMceSessionStructureL( + TBool /*aForceSdpBandwidth*/ ) + { + //Force SDP bandwidth attributes to be included in the INVITE + CMusEngMceOutSession::CreateMceSessionStructureL( ETrue ); + } + +// ----------------------------------------------------------------------------- +// Sets video codec attributes +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWaySession::AdjustVideoCodecL( CMceVideoCodec& aVideoCodec, + TMceSourceType aSourceType ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWaySession::AdjustVideoCodecL()" ) + + CMusEngLiveSession::AdjustVideoCodecL( aVideoCodec, aSourceType ); + + aVideoCodec.SetKeepAliveTimerL( KMusEngTwoWayRtpKeepAliveTimer ); + if ( aVideoCodec.SdpName() == KMceSDPNameH263() || + aVideoCodec.SdpName() == KMceSDPNameH2632000() ) + { + aVideoCodec.SetKeepAlivePayloadTypeL( KMusEngKeepAlivePayloadTypeVideoH263 ); + } + else if ( aVideoCodec.SdpName() == KMceSDPNameH264() ) + { + aVideoCodec.SetKeepAlivePayloadTypeL( KMusEngKeepAlivePayloadTypeVideoAvc ); + } + else + { + // NOP + } + + aVideoCodec.SetKeepAliveDataL( KNullDesC8() ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWaySession::AdjustVideoCodecL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWaySession::AddDisplayL( CMceMediaStream& aStream ) + { + // Vf display is disabled at creation phase if doing bg startup + MusEngMceUtils::AddDisplayL( aStream, + *iManager, + iLocalRect, + IsBackgroundStartup() ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWaySession::StreamStateChanged( CMceMediaStream& aStream ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWaySession::StreamStateChanged()" ) + if ( !iSession ) + { + return; + } + + if ( aStream.Type() == KMceVideo && + aStream.Source() && + aStream.Source()->Type() == KMceRTPSource ) + { + if ( aStream.State() == CMceMediaStream::EStreaming ) + { + ReceivingStarted(); + } + else if ( aStream.State() == CMceMediaStream::EBuffering ) + { + MUS_LOG( "mus: [ENGINE] CMusEngTwoWaySession buffered" ) + + iBuffered = ETrue; + } + else + { + // NOP + } + } + + CMusEngMceSession::StreamStateChanged( aStream ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWaySession::StreamStateChanged()" ) + } + +// ----------------------------------------------------------------------------- +// Once inactivity timeout occurs, state change is notified and receiving +// and buffering statuses are cleared. That is safe to do as once receiving +// again continues for real, buffering and streaming events will occur always +// sequentially. If buffering status would not be cleared, some unwanted +// sreaming events would be passed towards client when it disables/enables +// display sink of remote stream while inactivity timer has expired. +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWaySession::InactivityTimeout( CMceMediaStream& aStream, + CMceRtpSource& /*aSource*/ ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWaySession::InactivityTimeout()" ) + + if ( aStream.Type() == KMceVideo && iReceiving ) + { + iReceiving = EFalse; + iBuffered = EFalse; + if ( iRemoteVideoPlayer ) + { + InformObserverAboutPlayerStateChange( iRemoteVideoPlayer ); + } + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWaySession::InactivityTimeout()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWaySession::HandleSessionStateChanged( + CMceSession& aSession, + TInt aStatusCode, + const TDesC8& aReasonPhrase ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWaySession::HandleSessionStateChanged" ) + + MUS_ENG_LOG_SESSION_STATE_AND_STATUS( aSession, aStatusCode, aReasonPhrase ) + + TBool consumed( EFalse ); + if ( iSession && + iSession == &aSession && + aSession.State() == CMceSession::EEstablished ) + { + CMceVideoStream* stream = NULL; + CMceVideoStream* streamout = NULL; + TRAPD( err, stream = MusEngMceUtils::GetVideoInStreamL( *iSession ) ) + if ( err == KErrNone && stream && stream->IsEnabled() ) + { + TRAP( err, streamout = MusEngMceUtils::GetVideoOutStreamL( *iSession ) ) + if ( err != KErrNone || !streamout || !streamout->IsEnabled() ) + { + MUS_LOG( "mus: [ENGINE] sendrecv downgraded to recvonly, terminate!" ) + consumed = ETrue; + InformObserverAboutSessionFailure( err ); + } + } + } + + if ( !consumed ) + { + CMusEngLiveSession::HandleSessionStateChanged( aSession, + aStatusCode, + aReasonPhrase ); + } + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWaySession::HandleSessionStateChanged" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngTwoWaySession::CMusEngTwoWaySession() + : CMusEngLiveSession() + { + iSetRemoteRect = TRect( + KMusEngRectNotInit, KMusEngRectNotInit, KMusEngRectNotInit, KMusEngRectNotInit ); + iSetLocalRect = TRect( + KMusEngRectNotInit, KMusEngRectNotInit, KMusEngRectNotInit, KMusEngRectNotInit ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWaySession::ConstructL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWaySession::ConstructL()" ) + + CMusEngLiveSession::ConstructL(); + + iRemoteVideoPlayer = CMusEngRemoteVideoPlayer::NewL( *this, *this ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWaySession::ConstructL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWaySession::ReceivingStarted() + { + if ( iSession && iBuffered ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWaySession::ReceivingStarted()" ) + + TInt err = MusEngMceUtils::EnableInactivityTimer( + *iSession, KMusEngTwoWayReceivingActivityTimeout ); + + if ( err != KErrNone ) + { + MUS_LOG1("mus: [ENGINE] ReceivingStarted failed %d", err) + InformObserverAboutSessionFailure( err ); + } + else + { + iReceiving = ETrue; + InformObserverAboutPlayerStateChange( iRemoteVideoPlayer ); + InformUiProviderAboutReceivingStart(); + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWaySession::ReceivingStarted()" ) + } + } + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/src/musenguriparser.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/src/musenguriparser.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,273 @@ +/* +* 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: Parser for recipient's address +* +*/ + + +#include "musenguriparser.h" +#include "mussettings.h" +#include "muslogger.h" + +#include +#include +#include +#include + + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// UTF7 is not working, since it converts + as +- +// ----------------------------------------------------------------------------- +// +TMusEngUriParser::TMusEngUriParser( const TDesC16& aUri ) + :iUriType( ENotParsed ) + { + TBuf8 buf; + + if ( CnvUtfConverter::ConvertFromUnicodeToUtf8( buf, aUri ) == 0 ) + { + iUri = buf; + } + else + { + iUri = KNullDesC8(); + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TMusEngUriParser::TMusEngUriType TMusEngUriParser::UriType() + { + return iUriType; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +HBufC8* TMusEngUriParser::GetUri8L() + { + MUS_LOG( "mus: [ENGINE] -> TMusEngUriParser::GetUri8L()" ) + + __ASSERT_ALWAYS( UriType() != TMusEngUriParser::ENotParsed, + User::Leave( KErrNotReady ) ); + + HBufC8* uri8 = iUri.AllocL(); + + MUS_LOG( "mus: [ENGINE] <- TMusEngUriParser::GetUri8L()" ) + + return uri8; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +HBufC16* TMusEngUriParser::GetUri16L( TBool aPrefix ) + { + MUS_LOG( "mus: [ENGINE] -> TMusEngUriParser::GetUri16L()" ) + + __ASSERT_ALWAYS( UriType() != TMusEngUriParser::ENotParsed, + User::Leave( KErrNotReady ) ); + + HBufC16* uri16 = NULL; + + if ( aPrefix ) + { + uri16 = CnvUtfConverter::ConvertToUnicodeFromUtf8L( iUri ); + } + else + { + uri16 = CnvUtfConverter::ConvertToUnicodeFromUtf8L( + iUri.Mid( KMusEngTelPrefix().Length() ) ); + } + + MUS_LOG( "mus: [ENGINE] <- TMusEngUriParser::GetUri16L()" ) + + return uri16; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void TMusEngUriParser::ParseUriL() + { + MUS_LOG( "mus: [ENGINE] -> TMusEngUriParser::ParseUriL()" ) + + if ( iUri.Find( KMusEngAtSign ) >= 0 ) // Sip uri + { + HandleSipUriL(); + } + else if ( iUri.Find( KMusEngPlusSign ) >= 0 ) // Tel uri + { + HandleTelUriL(); + } + else + { + // check for variant + if ( MultimediaSharingSettings::OperatorVariantSettingL() + != MusSettingsKeys::EOperatorSpecific ) + {// basic behaviour + MUS_LOG( "mus: [ENGINE] -> TMusEngUriParser::ParseUriL() \ + normal behaviour" ) + User::Leave( KErrArgument ); + } + else + { // variant behaviour(local tel uri) + HandleLocalTelUriL(); + } + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void TMusEngUriParser::HandleSipUriL() + { + if ( iUri.FindF( KMusEngTelPrefix() ) == 0 ) + { + // SIP uri with prefix "tel:" + User::Leave( KErrCorrupt ); + } + else if ( iUri.FindF( KMusEngSipsPrefix ) == 0 ) + { + // Secure SIP uri with prefix + iUri.Replace( 0, KMusEngSipsPrefix().Length(), KMusEngSipsPrefix() ); + } + else if ( iUri.FindF( KMusEngSipPrefix() ) != 0 ) + { + // SIP uri without prefix + if ( iUri.Length() + KMusEngSipPrefix().Length() <= + KMaxUriLength ) + { + iUri.Insert( 0, KMusEngSipPrefix() ); + } + else + { + User::Leave( KErrCorrupt ); + } + } + else + { + // SIP uri with prefix + iUri.Replace( 0, KMusEngSipPrefix().Length(), KMusEngSipPrefix() ); + } + + TUriParser8 parser; + + User::LeaveIfError( parser.Parse( iUri ) ); + + User::LeaveIfError( parser.Validate() ); + + iUriType = TMusEngUriParser::ESip; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void TMusEngUriParser::HandleTelUriL() + { + iUri.TrimAll(); + if ( iUri.FindF( KMusEngTelPrefix() ) != 0 ) + { + // Tel uri without prefix + if ( iUri.Length() + KMusEngTelPrefix().Length() <= + KMaxUriLength ) + { + iUri.Insert( 0, KMusEngTelPrefix() ); + } + else + { + User::Leave( KErrCorrupt ); + } + } + else + { + //Tel uri with prefix + iUri.Replace( 0, KMusEngTelPrefix().Length(), KMusEngTelPrefix() ); + } + + TInt index = KMusEngTelPrefix().Length() + KMusEngPlusSign().Length(); + + while ( index < iUri.Length() ) + { + TChar character = iUri[ index ]; + if ( character.IsAlpha() ) + { + User::Leave( KErrCorrupt ); // letters will not be accepted + } + else if ( !character.IsDigit() ) + { + iUri.Delete( index, 1 ); // extra characters will be removed + } + else + { + ++index; // Valid tel URI so far + } + } + + iUriType = TMusEngUriParser::ETel; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void TMusEngUriParser::HandleLocalTelUriL() + { + MUS_LOG( "mus: [ENGINE] -> TMusEngUriParser::ParseUriL() \ + variant behaviour" ) + if ( iUri.FindF( KMusEngTelPrefix() ) != 0 ) + { + // local tel uri without prefix + if ( iUri.Length() + KMusEngTelPrefix().Length() <= KMaxUriLength ) + { + iUri.Insert( 0, KMusEngTelPrefix() ); + } + else + { + User::Leave( KErrCorrupt ); + } + } + else + { + //Tel uri with prefix + iUri.Replace( 0, KMusEngTelPrefix().Length(), KMusEngTelPrefix() ); + } + + TInt index = KMusEngTelPrefix().Length(); + + // check if all chars are digits + while ( index < iUri.Length() ) + { + TChar character = iUri[ index ]; + if ( !character.IsDigit() ) + { + User::Leave( KErrCorrupt ); + } + ++index; + } + + iUriType = TMusEngUriParser::ETel; + } + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/src/musengvideoplayerbase.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/src/musengvideoplayerbase.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,210 @@ +/* +* 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: +* +*/ + +// USER +#include "musenglocalvideoplayer.h" +#include "musengcamerahandler.h" +#include "musengmceutils.h" +#include "musengdisplayhandler.h" + +// SYSTEM +#include +#include + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngVideoPlayerBase::CMusEngVideoPlayerBase( + MMusEngDisplayHandler& aDisplayHandler, + MLcAudioControl& aLcAudioControl ) : + iDisplayHandler( aDisplayHandler ), + iLcAudioControl( aLcAudioControl ) + { + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngVideoPlayerBase::~CMusEngVideoPlayerBase() + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngVideoPlayerBase::SetMceSession( CMceSession* aMceSession ) + { + iMceSession = aMceSession; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +void CMusEngVideoPlayerBase::LcPlayL( TLcVideoPlayerSource /*aSource*/ ) + { + // NOP + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +void CMusEngVideoPlayerBase::LcPauseL() + { + // NOP + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcWindow* CMusEngVideoPlayerBase::LcWindow() + { + return this; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcCameraControl* CMusEngVideoPlayerBase::LcCameraControl() + { + return NULL; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcSourceFileControl* CMusEngVideoPlayerBase::LcSourceFileControl() + { + return NULL; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcDestinationFileControl* CMusEngVideoPlayerBase::LcDestinationFileControl() + { + return NULL; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcAudioControl* CMusEngVideoPlayerBase::LcAudioControl() + { + return &iLcAudioControl; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcZoomControl* CMusEngVideoPlayerBase::LcZoomControl() + { + return NULL; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcBrightnessControl* CMusEngVideoPlayerBase::LcBrightnessControl() + { + return NULL; + } + +// ----------------------------------------------------------------------------- +// From MLcWindow +// ----------------------------------------------------------------------------- +// +void CMusEngVideoPlayerBase::EnableLcWindowL( TBool aEnable ) + { + iDisplayHandler.EnableDisplayL( aEnable ); + } + +// ----------------------------------------------------------------------------- +// From MLcWindow +// ----------------------------------------------------------------------------- +// +TBool CMusEngVideoPlayerBase::IsLcWindowEnabled() + { + return iDisplayHandler.IsDisplayEnabled(); + } + +// ----------------------------------------------------------------------------- +// From MLcWindow +// ----------------------------------------------------------------------------- +// +void CMusEngVideoPlayerBase::SetLcWindowRectL( TRect aRect ) + { + iDisplayHandler.SetRectL( aRect ); + } + + +// ----------------------------------------------------------------------------- +// From MLcWindow +// ----------------------------------------------------------------------------- +// +TRect CMusEngVideoPlayerBase::LcWindowRect() + { + return iDisplayHandler.Rect(); + } + +// ----------------------------------------------------------------------------- +// From MLcWindow +// ----------------------------------------------------------------------------- +// +void CMusEngVideoPlayerBase::SetLcWindowOrientationL( + TLcWindowOrientation aOrientation ) + { + if ( aOrientation == MLcWindow::ELandscape ) + { + iDisplayHandler.SetOrientationL( MMusEngDisplayHandler::ELandscape ); + } + else + { + iDisplayHandler.SetOrientationL( MMusEngDisplayHandler::EPortrait ); + } + } + +// ----------------------------------------------------------------------------- +// From MLcWindow +// ----------------------------------------------------------------------------- +// +MLcWindow::TLcWindowOrientation CMusEngVideoPlayerBase::LcWindowOrientationL() + { + MLcWindow::TLcWindowOrientation orientation; + if ( iDisplayHandler.OrientationL() == MMusEngDisplayHandler::ELandscape ) + { + orientation = MLcWindow::ELandscape; + } + else + { + orientation = MLcWindow::EPortrait; + } + return orientation; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/src/mussipprofilehandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/src/mussipprofilehandler.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,448 @@ +/* +* 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: Utilities to get and set profile used with SWIS. +* Part of : Mus For S60 v3.2 +* Description : Utilities to get and set profile used with SWIS. +* Version : %version: 11.1.5 % << Don't touch! Updated by Synergy at check-out. +* +*/ + + +// USER +#include "mussipprofilehandler.h" +#include "musuid.hrh" +#include "muslogger.h" +#include "mussipprofileuser.h" + +// SYSTEM +#include +#include +#include +#include +#include +#include +#include + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusSipProfileHandler* CMusSipProfileHandler::NewL( MMusSipProfileUser& aUser ) + { + CMusSipProfileHandler* self = + new (ELeave) CMusSipProfileHandler( aUser ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusSipProfileHandler::CMusSipProfileHandler( MMusSipProfileUser& aUser ) + : iUser( aUser ) + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusSipProfileHandler::ConstructL() + { + MUS_LOG( "mus: [ENGINE] -> CMusSipProfileHandler::ConstructL()" ) + + // Use NULL Uid since we do not want to receive any requests. + // All requests should be handled by MCE. + iSip = CSIP::NewL( TUid::Null(), *this ); + iProfileRegistry = CSIPProfileRegistry::NewL( *iSip, *this ); + iProfileAlrController = + CSipProfileAlrController::NewL( *iProfileRegistry , *this ); + + MUS_LOG( "mus: [ENGINE] <- CMusSipProfileHandler::ConstructL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusSipProfileHandler::~CMusSipProfileHandler() + { + delete iProfileAlrController; + delete iSipProfile; + delete iProfileRegistry; + delete iSip; + MUS_LOG( "mus: [ENGINE] CMusSipProfileHandler::~CMusSipProfileHandler()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusSipProfileHandler::CreateProfileL( TUint32 aSipProfileId ) + { + CSIPProfile* profile( NULL ); + if ( aSipProfileId != 0 ) + { + profile = iProfileRegistry->ProfileL( aSipProfileId ); + } + else + { + profile = iProfileRegistry->DefaultProfileL(); + } + + delete iSipProfile; + iSipProfile = profile; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CSIPProfile* CMusSipProfileHandler::Profile() + { + return iSipProfile; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CUri8* CMusSipProfileHandler::UserFromProfileLC() + { + MUS_LOG( "mus: [ENGINE] -> CMusSipProfileHandler::UserFromProfileLC()" ); + + __ASSERT_ALWAYS( iSipProfile != NULL, User::Leave( KErrNotReady ) ); + + const MDesC8Array* aors = NULL; + User::LeaveIfError( iSipProfile->GetParameter( KSIPRegisteredAors, aors ) ); + __ASSERT_ALWAYS( aors && aors->MdcaCount() > 0, + User::Leave( KErrArgument ) ); + + TUriParser8 parser; + User::LeaveIfError( parser.Parse( aors->MdcaPoint( 0 ) ) ); + MUS_LOG( "mus: [ENGINE] <- CMusSipProfileHandler::UserFromProfileLC()" ) + + return CUri8::NewLC( parser ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusSipProfileHandler::RefreshIapAvailabilities() + { + TRAP_IGNORE( iProfileAlrController->RefreshIapAvailabilityL( ProfileId() ) ) + } + + +// ----------------------------------------------------------------------------- +// This function should never be called before creating a profile, but such +// a situation will be considered as pending registration. +// ----------------------------------------------------------------------------- +// +TBool CMusSipProfileHandler::IsRegistered() + { + MUS_LOG( "mus: [ENGINE] -> CMusSipProfileHandler::IsRegistered()" ) + + TBool profileRegistered = EFalse; + if ( iSipProfile ) + { + iSipProfile->GetParameter( KSIPProfileRegistered, profileRegistered ); + } + + MUS_LOG1( "mus: [ENGINE] <- CMusSipProfileHandler::IsRegistered( %d )", + profileRegistered ) + + return profileRegistered; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusSipProfileHandler::ProfileRegistryEventOccurred( + TUint32 aProfileId, + MSIPProfileRegistryObserver::TEvent aEvent ) + { + if ( iSipProfile && aProfileId == ProfileId() ) + { + switch ( aEvent ) + { + case MSIPProfileRegistryObserver::EProfileRegistered: + { + iUser.ProfileRegistered(); + break; + } + default: + { + break; + } + } + } + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusSipProfileHandler::ProfileRegistryErrorOccurred( + TUint32 /*aProfileId*/, + TInt /*aError*/) + { + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusSipProfileHandler::IncomingRequest( + TUint32 /*aIapId*/, + CSIPServerTransaction* aTransaction ) + { + // Ownership transferred, should not ever be called by SIP though + delete aTransaction; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusSipProfileHandler::TimedOut( + CSIPServerTransaction& /*aTransaction*/ ) + { + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusSipProfileHandler::IncomingRequest( + CSIPServerTransaction* aTransaction ) + { + // Ownership transferred, should not ever be called by SIP though + delete aTransaction; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusSipProfileHandler::IncomingRequest( + CSIPServerTransaction* aTransaction, + CSIPDialog& /*aDialog*/) + { + // Ownership transferred, should not ever be called by SIP though + delete aTransaction; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusSipProfileHandler::IncomingResponse( + CSIPClientTransaction& /*aTransaction*/) + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusSipProfileHandler::IncomingResponse( + CSIPClientTransaction& /*aTransaction*/, + CSIPDialogAssocBase& /*aDialogAssoc*/) + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusSipProfileHandler::IncomingResponse( + CSIPClientTransaction& /*aTransaction*/, + CSIPInviteDialogAssoc* aDialogAssoc) + { + // Ownership transferred, should not ever be called by SIP though + delete aDialogAssoc; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusSipProfileHandler::IncomingResponse( + CSIPClientTransaction& /*aTransaction*/, + CSIPRegistrationBinding& /*aRegistration*/ ) + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusSipProfileHandler::ErrorOccured( + TInt /*aError*/, + CSIPTransactionBase& /*aTransaction*/ ) + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusSipProfileHandler::ErrorOccured( + TInt /*aError*/, + CSIPClientTransaction& /*aTransaction*/, + CSIPRegistrationBinding& /*aRegistration*/ ) + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusSipProfileHandler::ErrorOccured( + TInt /*aError*/, + CSIPTransactionBase& /*aTransaction*/, + CSIPDialogAssocBase& /*aDialogAssoc*/ ) + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusSipProfileHandler::ErrorOccured( + TInt /*aError*/, + CSIPRefresh& /*aSIPRefresh*/ ) + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusSipProfileHandler::ErrorOccured( + TInt /*aError*/, + CSIPRegistrationBinding& /*aRegistration*/ ) + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusSipProfileHandler::ErrorOccured( + TInt /*aError*/, + CSIPDialogAssocBase& /*aDialogAssoc*/ ) + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusSipProfileHandler::InviteCompleted( + CSIPClientTransaction& /*aTransaction*/ ) + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusSipProfileHandler::InviteCanceled( + CSIPServerTransaction& /*aTransaction*/ ) + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusSipProfileHandler::ConnectionStateChanged( + CSIPConnection::TState /*aState*/ ) + { + } + +// ----------------------------------------------------------------------------- +// CMusSipProfileHandler::AlrEvent +// From MSipProfileAlrObserver +// ----------------------------------------------------------------------------- +// +void CMusSipProfileHandler::AlrEvent( + MSipProfileAlrObserver::TEvent aEvent, + TUint32 aProfileId, + TUint32 /*aSnapId*/, + TUint32 aIapId ) + { + if ( aEvent == MSipProfileAlrObserver::EIapAvailable ) + { + if ( iSipProfile && + aProfileId == ProfileId() && + !iUser.IsRoamingBetweenAPsAllowed() ) + { + // Disallow roaming only if the profile is used by MuS and + // the MuS has an ongoing session + TRAP_IGNORE( + iProfileAlrController->DisallowMigrationL( aProfileId, aIapId ) ) + } + else + { + // In all other cases allow roaming + TRAP_IGNORE( + iProfileAlrController->AllowMigrationL( aProfileId, aIapId ) ) + } + } + } + +// ----------------------------------------------------------------------------- +// CMusSipProfileHandler::AlrError +// From MSipProfileAlrObserver +// ----------------------------------------------------------------------------- +// +void CMusSipProfileHandler::AlrError( + TInt /*aError*/, + TUint32 /*aProfileId*/, + TUint32 /*aSnapId*/, + TUint32 /*aIapId*/ ) + { + // Ignore ALR related errors as they should not happen + // as migration is not allowed when + // the instance of CMusSipProfileHandler exists + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TUint32 CMusSipProfileHandler::ProfileId() const + { + TUint32 sipProfileId( 0 ); + if ( iSipProfile ) + { + iSipProfile->GetParameter( KSIPProfileId, sipProfileId ); + } + return sipProfileId; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/tsrc/ut_engine/BWINS/ut_musengineU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/tsrc/ut_engine/BWINS/ut_musengineU.DEF Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,3 @@ +EXPORTS + ?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 1 NONAME ; class MEUnitTest * CreateTestSuiteL(void) + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/tsrc/ut_engine/eabi/ut_musengineu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/tsrc/ut_engine/eabi/ut_musengineu.def Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,2 @@ +EXPORTS + _Z16CreateTestSuiteLv @ 1 NONAME diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/tsrc/ut_engine/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/tsrc/ut_engine/group/bld.inf Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,20 @@ +/* +* 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: +* +*/ + +PRJ_MMPFILES +../../../../../tsrc/mceclientstub/group/mceclientstub.mmp +ut_musengine.mmp diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/tsrc/ut_engine/group/ut_musengine.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/tsrc/ut_engine/group/ut_musengine.mmp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,164 @@ +/* +* 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 + +TARGET ut_musengine.dll +TARGETTYPE dll +EPOCALLOWDLLDATA +TARGETPATH /DigiaEUnit/Tests +UID 0x1000af5a 0x10282394 + +CAPABILITY EUNIT_CAPS +VENDORID VID_DEFAULT + + +MACRO UNIT_TESTING +EPOCSTACKSIZE 0x14000 +EPOCHEAPSIZE 0x020000 0x800000 + +// Test suite classes +SOURCEPATH ../src +SOURCE ut_musenginedllmain.cpp + +// Defines, stubs and other test helpers +SOURCEPATH ../src +SOURCE musengstubs.cpp + +SOURCEPATH ../../../../../tsrc/sipprofilestub/src +SOURCE sipstub.cpp +SOURCE sipprofileregistrybasestub.cpp +SOURCE sipprofileregistrystub.cpp +SOURCE sipprofilestub.cpp + +SOURCEPATH ../../../../../tsrc/telephonyaudioroutingstub/src +SOURCE telephonyaudioroutingstub.cpp + +SOURCEPATH ../../../../../tsrc/centralrepositorystub/src +SOURCE centralrepositorystub.cpp + +SOURCEPATH ../../../../../tsrc/drmstub/src +SOURCE drmcommonstub.cpp + +SOURCEPATH ../../../../../tsrc/mceclientstub/src +SOURCE mcecamerasource.cpp +SOURCE mcemediasource.cpp + +SOURCEPATH ../../../../../tsrc/propertystub/src +SOURCE e32property.cpp + +SOURCEPATH ../../../../../tsrc/contactenginestub/src +SOURCE contactenginestub.cpp + +// Test classes +SOURCEPATH ../src +SOURCE ut_musengsessionmanager.cpp +SOURCE ut_musengmcesession.cpp +SOURCE ut_musengoutsession.cpp +SOURCE ut_musenglivesession.cpp +SOURCE ut_musengclipsession.cpp +SOURCE ut_musengreceivesession.cpp +SOURCE ut_musengtwowaysession.cpp +SOURCE ut_musengtwowayrecvsession.cpp +SOURCE ut_musengcamerahandler.cpp +SOURCE ut_musengsipprofilehandler.cpp +SOURCE ut_musengmceutils.cpp +SOURCE ut_musengtelephoneutils.cpp +SOURCE ut_musengsessiondurationtimer.cpp +SOURCE ut_musenguriparser.cpp +SOURCE ut_musenglivevideoplayer.cpp +SOURCE ut_musengremotevideoplayer.cpp +SOURCE ut_musengclipvideoplayer.cpp +SOURCE ut_muspropertywatch.cpp + +// Tested classes +SOURCEPATH ../../../src +SOURCE musengsessionmanager.cpp +SOURCE musengmcesession.cpp +SOURCE musengmceoutsession.cpp +SOURCE musenglivesession.cpp +SOURCE musengclipsession.cpp +SOURCE musengreceivesession.cpp +SOURCE musengtwowaysession.cpp +SOURCE musengtwowayrecvsession.cpp +SOURCE mussipprofilehandler.cpp +SOURCE musengtelephoneutils.cpp +SOURCE musengsessiondurationtimer.cpp +SOURCE musengmceutils.cpp +SOURCE musenguriparser.cpp +SOURCE musengcamerahandler.cpp +SOURCE musengvideoplayerbase.cpp +SOURCE musenglocalvideoplayer.cpp +SOURCE musenglivevideoplayer.cpp +SOURCE musengremotevideoplayer.cpp +SOURCE musengclipvideoplayer.cpp + +SOURCEPATH ../../../../mmshshared/src +SOURCE muspropertywatch.cpp + +// Includes + +USERINCLUDE ../inc +USERINCLUDE ../../../inc +USERINCLUDE ../../../../mmshshared/inc +USERINCLUDE ../../../../inc +USERINCLUDE ../../../../../inc +USERINCLUDE ../../../../../tsrc/sipprofilestub/inc +USERINCLUDE ../../../../../tsrc/centralrepositorystub/inc +USERINCLUDE ../../../../../tsrc/propertystub/inc +USERINCLUDE ../../../../../tsrc/telephonyaudioroutingstub/inc + +// to replace SIP profiles with a stub +SYSTEMINCLUDE ../inc +SYSTEMINCLUDE ../../../../../tsrc/sipprofilestub/inc +// to replace cenrep with a stub +SYSTEMINCLUDE ../../../../../tsrc/centralrepositorystub/inc +// to replace MCE API with a stub +SYSTEMINCLUDE ../../../../../tsrc/mceclientstub/inc +// to replace telephony audio routing with a stub +SYSTEMINCLUDE ../../../../../tsrc/telephonyaudioroutingstub/inc +// to replace DRMCommon with a stub +SYSTEMINCLUDE ../../../../../tsrc/drmstub/inc +// to replace RProperty with a stub +SYSTEMINCLUDE ../../../../../tsrc/propertystub/inc +// to replace certain parts of contact engine with a stub +SYSTEMINCLUDE ../../../../../tsrc/contactenginestub/inc + +APP_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/ecom +SYSTEMINCLUDE /epoc32/include/platform/digia/EUnit + + +LIBRARY euser.lib +LIBRARY bafl.lib +LIBRARY phoneclient.lib +LIBRARY eunit.lib +LIBRARY charconv.lib +LIBRARY inetprotutil.lib +LIBRARY sipcodec.lib + +LIBRARY mceclientstub.lib + +LIBRARY cntmodel.lib +LIBRARY estor.lib + +DEBUGLIBRARY flogger.lib + +//EXPORTUNFROZEN + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/tsrc/ut_engine/inc/musengstubs.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/tsrc/ut_engine/inc/musengstubs.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,355 @@ +/* +* 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: +* +*/ + + + +#ifndef UT_MUSSTUBS_H +#define UT_MUSSTUBS_H + +#include "musengsessiondurationtimerobserver.h" +#include "musengaudioroutingobserver.h" +#include "musengdisplayhandler.h" +#include "mussipprofileuser.h" +#include "muspropertyobserver.h" + +#include +#include +#include +#include +#include +#include + +// DUMMY CLASSES + +class CSIPTransactionBase + { + }; + +class CSIPServerTransaction + { + }; + +class CSIPDialog + { + }; + +class CSIPClientTransaction + { + }; + +class CSIPDialogAssocBase + { + }; + +class CSIPRegistrationBinding + { + }; + +class CSIPRefresh + { + }; + +/** +* Class to implement all the interfaces provided by MusEngine +*/ +class CMusEngObserverStub : public CBase, + public MMusEngSessionDurationTimerObserver, + public MMusEngAudioRoutingObserver, + public MMusSipProfileUser + { + public: // Constructors and destructor + + CMusEngObserverStub(); + ~CMusEngObserverStub(); + + public: // From MMusEngSessionDurationTimerObserver + + void UpdateTimerEvent(); + + public: // From MMusEngAudioRoutingObserver + + void AudioRoutingChanged(); + + public: // From MMusSipProfileUser + + TBool IsRoamingBetweenAPsAllowed(); + void ProfileRegistered(); + + public: // Helper + + /** + * ETrue if all boolean member variables are set to EFalse and all the + * pointers are NULL + */ + TBool IsReseted(); + + /** + * Resets all the boolean member variable values to EFalse and deletes + * and nullifies all the pointer variables. + */ + void Reset(); + + public: // Data + + TBool iUpdateTimerEventCalled; + TBool iAudioRoutingChangedCalled; + TBool iRoamingBetweenAPsAllowed; + TBool iProfileRegisteredCalled; + }; + +class TMusEngDisplayHandlerStub : public MMusEngDisplayHandler + { +public: + + TMusEngDisplayHandlerStub(); + + void Reset(); + +public: // From MMusEngDisplayHandler + + TRect Rect() const; + + void SetRectL( const TRect& aRect ); + + void SetSecondaryRectL( const TRect& aSecondaryRect ); + + TRect SecondaryRect() const; + + void EnableDisplayL( TBool aEnable ); + + TBool IsDisplayEnabled(); + + TDisplayOrientation OrientationL(); + + void SetOrientationL( TDisplayOrientation aOrientation ); + + TBool IsDisplayActive(); + +public: + + TRect iRect; + TRect iSecondaryRect; + TBool iIsEnabled; + TDisplayOrientation iOrientation; + TBool iIsActive; + }; + +class CLcSessionObserverStub : public CBase, public MLcSessionObserver + { + public: // Constructors and destructor + + CLcSessionObserverStub(); + ~CLcSessionObserverStub(); + + public: // From MLcSessionObserver + + void StateChanged( MLcSession& aSession ); + + void StateChanged( MLcVideoPlayer& aPlayer ); + + void Updated( MLcSession& aSession ); + + void Updated( MLcVideoPlayer& aPlayer ); + + void Failed( + MLcSession& aSession, + TInt aError ); + + void Failed( + MLcVideoPlayer& aPlayer, + TInt aError ); + + void SessionTimeChanged( + MLcSession& aSession, + const TTimeIntervalSeconds& aSeconds ); + + public: // New functions + + void Reset(); + TBool IsReseted(); + + public: // Data + + enum TCalledFunction + { + EUnknown, + ESessionStateChanged, + EPlayerStateChanged, + ESessionUpdated, + EPlayerUpdated, + ESessionFailed, + EPlayerFailed, + ESessionTimeChanged + }; + + TInt iCalledFunction; + MLcSession* iCurrentSession; + MLcVideoPlayer* iCurrentPlayer; + TInt iSessionTime; + TInt iError; + }; + + +class CLcUiProviderStub : public CBase, public MLcUiProvider + { + public: // Constructors and destructor + + CLcUiProviderStub(); + ~CLcUiProviderStub(); + + public: // From MLcUiProvider + + TBool SelectRecipient( + MDesCArray& aRecipientAddresses, + TDes& aSelectedRecipientAddress ); + + TBool InputRecipient( TDes& aRecipientAddress ); + + void HandleForegroundStatus( TBool aForeground ); + + void BlockUi( TBool aBlocked ); + + public: // New functions + + void Reset(); + + public: // Data + + enum TCalledFunction + { + EUnknown, + ESelectRecipient, + EInputRecipient, + EHandleForegroundStatus + }; + + TInt iForeground; + TInt iCalledFunction; + TPtrC iRecipient; + TBool iSimulatedReturnValue; + }; + + +class TLcWindowStub : public MLcWindow + { + public: // Constructor + TLcWindowStub(); + + public: // From MLcWindow + void EnableLcWindowL( TBool aEnable ); + TBool IsLcWindowEnabled(); + void SetLcWindowRectL( TRect aRect ); + TRect LcWindowRect(); + void SetLcWindowOrientationL( TLcWindowOrientation aOrientation ); + TLcWindowOrientation LcWindowOrientationL(); + + public: // New functions + + void Reset(); + + private: // Data + TBool iEnabled; + TRect iRect; + TLcWindowOrientation iOrientation; + }; + + +class TLcAudioControlStub : public MLcAudioControl + { + public: // Constructor + TLcAudioControlStub(); + + public: + 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: // New functions + + void Reset(); + + private: // Data + TBool iAudioMuted; + TBool iMicMuted; + TBool iEnablingLoudspeakerAllowed; + TBool iLoudspeakerEnabled; + TInt iVolume; + }; + +class TMusPropertyObserverStub : public MMusPropertyObserver + { + public: + + enum TMusPropertyObserverFunction + { + ENone, // default value + EPropertyChanged, + EHandlePropertyError + }; + + + TMusPropertyObserverStub() + { + iCalledFunction = ENone; + iKey = 0; + iValue = 0; + iReason = 0; + } + + void PropertyChanged( const TUint aKey, const TInt aValue ) + { + iCalledFunction = EPropertyChanged; + iKey = aKey; + iValue = aValue; + } + + + void HandlePropertyError( const TInt aReason ) + { + iCalledFunction = EHandlePropertyError; + iReason = aReason; + } + + public: // data + + TMusPropertyObserverFunction iCalledFunction; + TInt iKey; + TInt iValue; + TInt iReason; + }; + + +// Dummy implementations +inline void CActiveScheduler::Start() + { + } + +inline void CActiveScheduler::Stop() + { + } + + +#endif // UT_MUSSTUBS_H + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/tsrc/ut_engine/inc/musengtestdefs.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/tsrc/ut_engine/inc/musengtestdefs.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,172 @@ +/* +* Copyright (c) 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: +* +*/ + + + +#ifndef MUSENGTESTDEFS_H +#define MUSENGTESTDEFS_H + +#include +#include + +#include +// Next row is to disable warning emerging from EUnit code. +// Placement is due to a fact that most test case files +// include this file. Directive can be removed when +// EUnit is fixed. +#pragma warn_illtokenpasting off + +// Test values + +_LIT( KTestRecipientSipUri, "sip:TestRecipient@host.domain" ); +_LIT( KTestRecipient2SipUri, "sip:TestRecipient2@host.domain" ); +_LIT( KTestRecipientSipUriPrefixUpperCase, "SIP:TestRecipient@host.domain" ); +_LIT( KTestRecipientSipUriNoSipPrefix, "TestRecipient@host.domain" ); +_LIT( KTestRecipientTelUri, "tel:+3581111111"); +_LIT( KTestRecipientTelUriNoTelPrefix, "+3581111111" ); + +_LIT8( KTestRecipientSipUri8, "sip:TestRecipient@host.domain" ); +_LIT8( KTestRecipient2SipUri8, "sip:TestRecipient2@host.domain" ); +_LIT8( KTestRecipientSipUriPrefixUpperCase8, "SIP:TestRecipient@host.domain" ); +_LIT8( KTestRecipientSipUriNoSipPrefix8, "TestRecipient@host.domain" ); +_LIT8( KTestRecipientTelUri8, "tel:+3581111111"); +_LIT8( KTestRecipientTelUriNoTelPrefix8, "+3581111111" ); + +_LIT8( KTestRecipientRandomText8, "sfjsfjklsjdkfsj" ); +_LIT8( KTestRecipientSipUriWithSpace8, "s:re cipi ent@" ); +_LIT8( KTestRecipientTelUriWithAtSign8, "tel:+3581111111@host.domain" ); //invalid +_LIT8( KTestRecipientTelUriWithXCharAtEnd8, "tel:+3581111111X" ); //invalid +_LIT8( KTestRecipientTelUriWithXCharAtStart8, "tel:+X3581111111" ); //invalid + +_LIT8( KTestRecipientLocalTelUriNoTelPrefix8, "3581111111" ); +_LIT8( KTestRecipientLocalTelUriNoTelPrefixWithXCharAtEnd8, "3581111111X" ); //invalid +_LIT8( KTestRecipientLocalTelUriNoTelPrefixWithXCharAtStart8, "X3581111111" ); //invalid +_LIT8( KTestRecipientLocalTelUriNoTelPrefixWithXCharAtMiddle8, "35811X11111" ); //invalid + +_LIT8( KTestRecipientLocalTelUri8, "tel:3581111111"); +_LIT8( KTestRecipientLocalTelUriPrefixUpperCase8, "TEL:3581111111"); +_LIT8( KTestRecipientLocalTelUriWithXCharAtEnd8, "tel:3581111111X" ); //invalid +_LIT8( KTestRecipientLocalTelUriWithXCharAtStart8, "tel:X3581111111" ); //invalid +_LIT8( KTestRecipientLocalTelUriWithXCharAtMiddle8, "tel:35811X11111" ); //invalid +_LIT8( KTestRecipientLocalTelUriTelPrefixAtMiddle8, "358tel:11X11111" ); //invalid + +_LIT8( KTestOriginator, "Frank Swis" ); + +_LIT( KTestAudioFileName, "audiofile" ); +_LIT( KTestVideoFileName, "H263videofile" ); +_LIT( KTestAvcVideoFileName, "H264videofile" ); + +const TInt KSipStatusCodeNoCodeSet = 0; +const TInt KSipStatusCode200OK = 200; +const TInt KSipStatusCode400BadRequest = 400; +const TInt KSipStatusCode401Unauthorized = 401; +const TInt KSipStatusCode402PaymentRequired = 402; +const TInt KSipStatusCode404RecipientNotFound = 404; +const TInt KSipStatusCode407ProxyAuthenticationRequired = 407; +const TInt KSipStatusCode408ConnectionTimeOut = 408; +const TInt KSipStatusCode415UnsupportedMediaType = 415; +const TInt KSipStatusCode416UnsupportedUriScheme = 416; +const TInt KSipStatusCode479NotAbleToProcessURI = 479; +const TInt KSipStatusCode480TemporarilyNotAvailable = 480; +const TInt KSipStatusCode486BusyHere = 486; +const TInt KSipStatusCode487RequestCancelled = 487; +const TInt KSipStatusCode488NotAcceptableHere = 488; +const TInt KSipStatusCode603Decline = 603; +const TInt KSipStatusCode606NotAcceptable = 606; +const TInt KSipStatusCodeUnknown = 10000; + +const TInt KTelephonyVolumeMinValue = 1; +const TInt KTelephonyVolumeDefaultValue = 4; +const TInt KTelephonyVolumeMaxValue = 1; + +const TTimeIntervalMicroSeconds KMusEngTestFileDuration( 120000000 ); // 2 min +const TTimeIntervalMicroSeconds KMusEngTestFilePosition( 60000000 ); // 2 min + +const TInt KTestMaxBrightness = 100; +const TInt KTestMoreThanMaxBrightness = 101; +const TInt KTestDefaultBrightness = 0; +const TInt KTestMinBrightness = -100; +const TInt KTestLessThanMinBrightness = -101; +const TInt KTestSomeBrightness = 25; +const TInt KTestBrightnessStepSize = 10; + + +// Values originally introduced in telephonydomaincrkeys.h + +const TUid KCRUidInCallVolume = {0x102828B1}; +const TUint32 KTelIncallEarVolume = 0x00000001; +const TUint32 KTelIncallLoudspeakerVolume = 0x00000002; + + +// Helper macros + +#define MUS_TEST_FORWARD_ALLOC_FAILURE( error )\ + if ( error == KErrNoMemory )\ + {\ + User::Leave( error );\ + } + +// NOTE! NMusSessionApi::KCategoryUid, NMusSessionApi::KRemoteSipAddress p&s property +// should contain recipient address to be used for invitation. +// +#define ESTABLISH_OUT_SESSION( outSession )\ + outSession->EstablishLcSessionL();\ + outSession->iSession->iState = CMceSession::EEstablished;\ + for ( TInt i = 0; i < outSession->iSession->Streams().Count(); ++i )\ + {\ + outSession->iSession->Streams()[i]->iState =\ + CMceMediaStream::EStreaming;\ + }\ + if ( outSession->iSession->iManager &&\ + outSession->iSession->iManager->iSessionObserver )\ + {\ + outSession->iSession->iManager->iSessionObserver->SessionStateChanged(\ + *(outSession->iSession),\ + outSession->iSession->iManager->iContainer );\ + } + +#define ESTABLISH_OUT_SESSION_AND_START_STREAMING( outSession )\ + ESTABLISH_OUT_SESSION( outSession );\ + outSession->EnableDisplayL( ETrue );\ + outSession->LocalVideoPlayer()->LcPlayL(); + + +#define MUSENG_EUNIT_ASSERT_EQUALS( func, val ) \ +{\ +TInt musUnitTestRetVal = func;\ +if ( musUnitTestRetVal != KErrNoMemory ){\ + EUNIT_ASSERT_EQUALS( musUnitTestRetVal, val );\ + }\ +else{\ + User::Leave( KErrNoMemory );\ + }\ +} + +#define MUSENG_EUNIT_ASSERT_SPECIFIC_LEAVE( func, val ) \ +{\ +TRAPD( musUnitTestRetVal, func );\ +if ( val != KErrNoMemory && musUnitTestRetVal == KErrNoMemory ){\ + User::Leave( KErrNoMemory );\ + }\ +else{\ + EUNIT_ASSERT_EQUALS( musUnitTestRetVal, val );\ + }\ +} + +#endif // MUSENGTESTDEFS_H + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/tsrc/ut_engine/inc/sipprofilealrcontroller.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/tsrc/ut_engine/inc/sipprofilealrcontroller.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,130 @@ +/* +* Copyright (c) 2005-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: +* +*/ + + +#ifndef CSIPPROFILEALRCONTROLLER_H +#define CSIPPROFILEALRCONTROLLER_H + +// INCLUDES +#include + +// FORWARD DECLARATIONS +class CSIPProfileRegistryBase; +class MSipProfileAlrObserver; + +// CLASS DECLARATION +/** +* @publishedAll +* @released +* +* This class provides functions to control +* ALR (Application Level Roaming) for SIP profiles that have +* a SNAP (Service Network Access Point) ID configured. +* By default the clients allow automatic roaming between +* IAPs (Internet Access Point) for a SIP profile. +* The clients wanting to control the roaming must instantiate this class. +* After that all the IAP availability events received through +* MSipProfileAlrObserver::AlrEvent must be allowed or disallowed. +* +* @lib sipprofilecli.lib +*/ +class CSipProfileAlrController : public CBase + { + public: // Data only in MuS Engine's unit testing stub + + TBool iAllowMigrationCalled; + TBool iDisallowMigrationCalled; + TUint32 iLastUsedIap; + + public: // Constructors and destructor + + /** + * Two-phased constructor. + * @param aRegistry a SIP profile registry instance. + * @param aObserver a observer for IAP migration events. + */ + IMPORT_C static CSipProfileAlrController* NewL( + CSIPProfileRegistryBase& aRegistry, + MSipProfileAlrObserver& aObserver ); + + /** + * Two-phased constructor. + * Constructs an object and adds the pointer to the cleanup stack. + * @param aRegistry a SIP profile registry instance. + * @param aObserver a observer for IAP migration events. + */ + IMPORT_C static CSipProfileAlrController* NewLC( + CSIPProfileRegistryBase& aRegistry, + MSipProfileAlrObserver& aObserver ); + + /** + * Destructor. + */ + ~CSipProfileAlrController(); + + public: // New functions + + /** + * Allows SIP Profile Agent to start the migration + * to a new IAP for the profile. + * If also all the other clients allow the migration, + * migration will be started and all the clients are informed + * with MSipProfileAlrObserver::AlrEvent(EMigrationStarted,...). + * When MSipProfileAlrObserver::AlrEvent(EMigrationCompleted,...) + * gets called the migration has been completed and + * the related SIP profile has been registered via the new IAP. + * @param aProfileId the SIP profile id + * @param aIapId the new IAP id. + */ + IMPORT_C void AllowMigrationL( TUint32 aProfileId, + TUint32 aIapId ); + + /** + * Disallows SIP Profile Agent to migrate + * to a new IAP for the profile. + * After the client calls this function all the clients are informed + * with MSipProfileAlrObserver::AlrError(...). + * @param aProfileId the SIP profile id + * @param aIapId the new IAP id. + */ + IMPORT_C void DisallowMigrationL( TUint32 aProfileId, + TUint32 aIapId ); + + /** + * Refreshes the list of available IAPs for + * the SNAP configured for the profile. + * If a new better IAP is available, it is offered via + * MSipProfileAlrObserver::AlrEvent(EIapAvailable,...). + * This function should be called if migration + * to a IAP has been previously disallowed and the client wants to + * check whether the better IAP is still available. + * @param aProfileId the SIP profile id + */ + IMPORT_C void RefreshIapAvailabilityL( TUint32 aProfileId ); + + + private: // Constructors: + + CSipProfileAlrController( CSIPProfileRegistryBase& aRegistry ); + void ConstructL( MSipProfileAlrObserver& aObserver ); + + private: // Data + + CSIPProfileRegistryBase& iRegistry; + }; + +#endif // CSIPPROFILEALRCONTROLLER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/tsrc/ut_engine/inc/ut_musengcamerahandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/tsrc/ut_engine/inc/ut_musengcamerahandler.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,104 @@ +/* +* 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_MUSENGCAMERAHANDLER_H__ +#define __UT_MUSENGCAMERAHANDLER_H__ + + +// EXTERNAL INCLUDES +#include +#include + +#include "musengcamerahandler.h" + +// FORWARD DECLARATIONS +class CMceManager; +class CMusSipProfileHandler; +class CMceSession; +class CMusEngObserverStub; +class CMceDisplaySink; + + +// CLASS DEFINITION +/** + * Tester class for CMusEngLiveSession. + * Tests only implementations that are not tested in ancestor classes. + * + */ +NONSHARABLE_CLASS( UT_TMusEngCameraHandler ): public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static UT_TMusEngCameraHandler* NewL(); + static UT_TMusEngCameraHandler* NewLC(); + + /** + * Destructor + */ + ~UT_TMusEngCameraHandler(); + + private: // Constructors and destructors + + UT_TMusEngCameraHandler(); + void ConstructL(); + + private: // Test case setup and teardown + + void SetupL(); + void Teardown(); + + private: // Test methdods + + void UT_LcCameraCountL(); + void UT_ToggleLcCameraL(); + void UT_SetLcBrightnessL(); + void UT_LcBrightnessL(); + void UT_MaxLcBrightnessL(); + void UT_MinLcBrightnessL(); + void UT_IncreaseLcBrightnessL(); + void UT_DecreaseLcBrightnessL(); + void UT_MinLcZoomL(); + void UT_MaxLcZoomL(); + void UT_LcZoomValueL(); + void UT_SetLcZoomValueL(); + void UT_LcZoomInL(); + void UT_LcZoomOutL(); + void UT_PlayL(); + void UT_PauseL(); + void UT_IsPlayingL(); + void UT_InitializeZoomStepSizeL(); + void UT_ChangeCameraL(); + void UT_ChangeActiveCameraL(); + + private: // Data + + TMusEngCameraHandler iCameraHandler; + CMceManager* iManager; + CMusSipProfileHandler* iProfileHandler; + CMusEngObserverStub* iObserver; + CMceSession* iSession; + + EUNIT_DECLARE_TEST_TABLE; + }; + +#endif // __UT_MUSENGLIVESESSION_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/tsrc/ut_engine/inc/ut_musengclipsession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/tsrc/ut_engine/inc/ut_musengclipsession.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,92 @@ +/* +* 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_MUSENGCLIPSESSION_H__ +#define __UT_MUSENGCLIPSESSION_H__ + + +// EXTERNAL INCLUDES +#include +#include + +// FORWARD DECLARATIONS +class CMusEngClipSession; +class CLcSessionObserverStub; +class CLcUiProviderStub; +class CMusEngObserverStub; + +// CONSTANTS +_LIT8( KMusSipUri, "sip:user@domain.com" ); + +// CLASS DEFINITION +/** + * Tester class for CMusEngClipSession. + * Tests only implementations that are not tested in ancestor classes. + * + */ +NONSHARABLE_CLASS( UT_CMusEngClipSession ): public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static UT_CMusEngClipSession* NewL(); + static UT_CMusEngClipSession* NewLC(); + + /** + * Destructor + */ + ~UT_CMusEngClipSession(); + + private: // Constructors and destructors + + UT_CMusEngClipSession(); + void ConstructL(); + + private: // Test case setup and teardown + + void SetupL(); + void Teardown(); + + private: // Test methdods + + void UT_NewLL(); + void UT_CompleteSessionStructureLL(); + void UT_StreamStateChangedL(); + void UT_StreamStateChangedWithSourceL(); + void UT_StreamStateChangedWithSinkL(); + void UT_AddAmrCodecLL(); + void UT_AddVideoCodecLL(); + void UT_ConstructAudioStructureLL(); + void UT_ConstructAudioStructureL_OperatorVariantL(); + void UT_EstablishSessionLL(); + + private: // Data + + CMusEngClipSession* iClipSession; + CLcSessionObserverStub* iLcSessionObserver; + CLcUiProviderStub* iLcUiProvider; + CMusEngObserverStub* iAudioRoutingObserver; + + EUNIT_DECLARE_TEST_TABLE; + }; + +#endif // __UT_MUSENGCLIPSESSION_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/tsrc/ut_engine/inc/ut_musengclipvideoplayer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/tsrc/ut_engine/inc/ut_musengclipvideoplayer.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,93 @@ +/* +* 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_MUSENGCLIPVIDEOPLAYER_H +#define UT_MUSENGCLIPVIDEOPLAYER_H + + +// INCLUDES +#include +#include +#include "musengstubs.h" + +// FORWARD DECLARATIONS +class CMceSession; +class CMusEngClipVideoPlayer; + + +// CLASS DEFINITION +/** + * + */ +NONSHARABLE_CLASS( UT_CMusEngClipVideoPlayer ): public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static UT_CMusEngClipVideoPlayer* NewL(); + static UT_CMusEngClipVideoPlayer* NewLC(); + + /** + * Destructor + */ + ~UT_CMusEngClipVideoPlayer(); + + private: // Constructors and destructors + + UT_CMusEngClipVideoPlayer(); + void ConstructL(); + + private: // Test case setup and teardown + + void SetupL(); + void Teardown(); + + private: // Test methdods + + void UT_HasClipEndedL(); + void UT_LcVideoPlayerStateL(); + void UT_LcPlayL(); + void UT_LcPauseL(); + void UT_LcIsPlayingL(); + void UT_SetLcFileNameL(); + void UT_LcFastForwardL(); + void UT_LcFastRewindL(); + void UT_LcFilePositionL(); + void UT_LcFileDurationL(); + void UT_SetLcFilePositionL(); + void UT_LcWindowL(); + void UT_LcCameraControlL(); + void UT_LcSourceFileControlL(); + void UT_LcDestinationFileControlL(); + void UT_LcAudioControlL(); + void UT_LcZoomControlL(); + void UT_LcBrightnessControlL(); + + private: // Data + + TLcAudioControlStub iLcAudioControlStub; + CMceSession* iMceSession; + CMusEngClipVideoPlayer* iClipVideoPlayer; + TMusEngDisplayHandlerStub iDisplayHandlerStub; + EUNIT_DECLARE_TEST_TABLE; + }; + +#endif // UT_MUSENGCLIPVIDEOPLAYER_H + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/tsrc/ut_engine/inc/ut_musenglivesession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/tsrc/ut_engine/inc/ut_musenglivesession.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,93 @@ +/* +* 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_MUSENGLIVESESSION_H__ +#define __UT_MUSENGLIVESESSION_H__ + + +// EXTERNAL INCLUDES +#include +#include + +// FORWARD DECLARATIONS +class CMusEngLiveSession; +class CLcSessionObserverStub; +class CLcUiProviderStub; +class CMusEngObserverStub; + + +// CLASS DEFINITION +/** + * Tester class for CMusEngLiveSession. + * Tests only implementations that are not tested in ancestor classes. + * + */ +NONSHARABLE_CLASS( UT_CMusEngLiveSession ): public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static UT_CMusEngLiveSession* NewL(); + static UT_CMusEngLiveSession* NewLC(); + + /** + * Destructor + */ + ~UT_CMusEngLiveSession(); + + private: // Constructors and destructors + + UT_CMusEngLiveSession(); + void ConstructL(); + + private: // Test case setup and teardown + + void SetupL(); + + void Teardown(); + + private: // Test methdods + + void UT_NewLL(); + void UT_CompleteSessionStructureLL(); + void UT_HandleSessionStateChangedL(); + void UT_AdjustVideoCodecLL(); + void UT_AdjustAudioCodecLL(); + void UT_DoCodecSelectionLL(); + void UT_StreamStateChangedL(); + void UT_StreamStateChangedWithSourceL(); + void UT_StreamStateChangedWithSinkL(); + void UT_EstablishLcSessionL(); + void UT_LocalVideoPlayerL(); + + private: // Data + + CMusEngLiveSession* iLiveSession; + CMusEngLiveSession* iRecordedLiveSession; + CLcSessionObserverStub* iLcSessionObserver; + CLcUiProviderStub* iLcUiProvider; + CMusEngObserverStub* iAudioRoutingObserver; + + EUNIT_DECLARE_TEST_TABLE; + }; + +#endif // __UT_MUSENGLIVESESSION_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/tsrc/ut_engine/inc/ut_musenglivevideoplayer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/tsrc/ut_engine/inc/ut_musenglivevideoplayer.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,92 @@ +/* +* 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_MUSENGLIVEVIDEOPLAYER_H +#define UT_MUSENGLIVEVIDEOPLAYER_H + + +// INCLUDES +#include +#include +#include "musengcamerahandler.h" +#include "musengstubs.h" + +// FORWARD DECLARATIONS +class CMceSession; +class CMusEngLiveVideoPlayer; + + +// CLASS DEFINITION +/** + * + */ +NONSHARABLE_CLASS( UT_CMusEngLiveVideoPlayer ): public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static UT_CMusEngLiveVideoPlayer* NewL(); + static UT_CMusEngLiveVideoPlayer* NewLC(); + + /** + * Destructor + */ + ~UT_CMusEngLiveVideoPlayer(); + + private: // Constructors and destructors + + UT_CMusEngLiveVideoPlayer(); + void ConstructL(); + + private: // Test case setup and teardown + + void SetupL(); + void Teardown(); + + private: // Test methdods + + void UT_NewLL(); + void UT_LcVideoPlayerStateL(); + void UT_LcPlayL(); + void UT_LcWindowL(); + void UT_LcCameraControlL(); + void UT_LcSourceFileControlL(); + void UT_LcDestinationFileControlL(); + void UT_LcAudioControlL(); + void UT_LcZoomControlL(); + void UT_LcBrightnessControlL(); + void UT_EnableLcWindowL(); + void UT_LcWindowRectL(); + void UT_LcWindowOrientationL(); + void UT_SetLcFileNameL(); + void UT_LcRecordL(); + + private: // Data + + TLcAudioControlStub iLcAudioControlStub; + CMceSession* iMceSession; + TMusEngCameraHandler iCameraHandler; + CMusEngLiveVideoPlayer* iLiveVideoPlayer; + TMusEngDisplayHandlerStub iDisplayHandlerStub; + EUNIT_DECLARE_TEST_TABLE; + }; + +#endif // UT_MUSENGLIVEVIDEOPLAYER_H + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/tsrc/ut_engine/inc/ut_musengmcesession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/tsrc/ut_engine/inc/ut_musengmcesession.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,147 @@ +/* +* 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_MUSENGMCESESSION_H__ +#define __UT_MUSENGMCESESSION_H__ + + +// EXTERNAL INCLUDES +#include +#include +#include + +// FORWARD DECLARATIONS +class CMusEngLiveSession; +class CMusEngReceiveSession; +class CMusEngClipSession; +class CLcSessionObserverStub; +class CLcUiProviderStub; + +// CLASS DEFINITION +/** +* Tester class for CMusEngMceSession. +* Since CMusEngMceSession is abstract, it is tested via object of its' +* concrete descendant class CMusEngLiveSession. Only concrete +* implementations are tested in this tester class. +* +*/ +NONSHARABLE_CLASS( UT_CMusEngMceSession ): public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static UT_CMusEngMceSession* NewL(); + static UT_CMusEngMceSession* NewLC(); + + /** + * Destructor + */ + ~UT_CMusEngMceSession(); + + private: // Constructors and destructors + + UT_CMusEngMceSession(); + void ConstructL(); + + private: // Test case setup and teardown + + void SetupL(); + void Teardown(); + + private: // Test methdods + + void UT_LcSessionStateL(); + void UT_RemoteVideoPlayerL(); + void UT_LocalVideoPlayerL(); + void UT_LocalDisplayNameL(); + void UT_RemoteDisplayNameL(); + void UT_RemoteDetailsL(); + void UT_SetParameterL(); + void UT_ParameterValueL(); + void UT_IsLcAudioMutedL(); + void UT_MuteLcAudioL(); + void UT_MuteLcMicL(); + void UT_EnableLcLoudspeakerL(); + void UT_SetLcVolumeL(); + void UT_GetSessionTimeL(); + void UT_HandleTerminationL(); + void UT_AdjustVideoCodecL(); + void UT_AdjustAudioCodecL(); + void UT_RectChangedL(); + void UT_SetSessionSdpLinesL(); + void UT_SetSessionSdpLines_OperatorL(); + void UT_SetMediaSdpLinesL(); + void UT_SetMediaSdpLines_OperatorL(); + void UT_AdjustStreamsAndCodecsL(); + void UT_IncomingSessionL(); + void UT_IncomingUpdateL(); + void UT_StreamStateChangedL(); + void UT_StreamStateChangedWithSourceL(); + void UT_StreamStateChangedWithSinkL(); + void UT_SessionStateChangedL(); + void UT_HandleSessionStateChanged_EncoderKeyStoringL(); + void UT_SessionConnectionStateChangedL(); + void UT_FailedL(); + void UT_UpdateFailedL(); + void UT_SRReceivedL(); + void UT_RRReceivedL(); + void UT_SsrcAddedL(); + void UT_SsrcRemovedL(); + void UT_UpdateTimerEventL(); + void UT_IsRoamingBetweenAPsAllowedL(); + void UT_SaveContactL(); + void UT_RectL(); + void UT_SetRectLL(); + void UT_SecondaryRectL(); + void UT_SetSecondaryRectLL(); + void UT_EnableDisplayLL(); + void UT_CMusEngMceSession_SetOrientationLL(); + void UT_SetEncodingDeviceLL(); + void UT_SetCodecConfigKeyLL(); + void UT_ReadCodecConfigKeyLL(); + void UT_StoreEncoderConfigInfoLL(); + void UT_StreamStreamingL(); + void UT_InformObserverAboutSessionStateChangeL(); + void UT_InformObserverAboutSessionUpdateL(); + void UT_InformObserverAboutSessionFailureL(); + void UT_InformObserverAboutPlayerStateChangeL(); + void UT_InformObserverAboutPlayerUpdateL(); + void UT_InformObserverAboutPlayerFailureL(); + void UT_LcUiProviderL(); + void UI_IsBackgroundStartupL(); + void UT_InformUiProviderAboutReceivingStartL(); + void UT_SetForegroundStatusL(); + void UT_UpdateLcSessionLL(); + + private: // Data + + CMusEngLiveSession* iLiveSession; + CMusEngReceiveSession* iReceiveSession; + CMusEngClipSession* iClipSession; + CMusEngLiveSession* iSomeOtherSession; + CLcSessionObserverStub* iLcSessionObserver; + CLcUiProviderStub* iLcUiProvider; + TMceTransactionDataContainer iContainer; + EUNIT_DECLARE_TEST_TABLE; + }; + +#endif // __UT_MUSENGMCESESSION_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/tsrc/ut_engine/inc/ut_musengmceutils.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/tsrc/ut_engine/inc/ut_musengmceutils.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,114 @@ +/* +* 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_MUSENGMCEUTILS_H__ +#define __UT_MUSENGMCEUTILS_H__ + + +// EXTERNAL INCLUDES +#include +#include + + +// FORWARD DECLARATIONS +class CMceManager; +class CMusSipProfileHandler; +class CMceSession; +class CMusEngObserverStub; +class CMceDisplaySink; + +#ifndef NONSHARABLE_CLASS + #define NONSHARABLE_CLASS(x) class x +#endif + +// CLASS DEFINITION +/** + * Tester class for MusEngMceUtils. + * + */ +NONSHARABLE_CLASS( UT_MusEngMceUtils ): + public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static UT_MusEngMceUtils* NewL(); + static UT_MusEngMceUtils* NewLC(); + + /** + * Destructor + */ + ~UT_MusEngMceUtils(); + + + private: // Constructors and destructors + + UT_MusEngMceUtils(); + void ConstructL(); + + private: // Test case setup and teardown + + void SetupL(); + void Setup2L(); + + void Teardown(); + + private: // Test methdods + + void UT_IsVideoInStreamL(); + void UT_IsVideoOutStreamL(); + void UT_IsAudioInStreamL(); + void UT_GetVideoOutStreamLL(); + void UT_GetVideoInStreamLL(); + void UT_GetRecordingStreamL(); + void UT_GetMediaSinkFromStreamL(); + void UT_GetMediaSinkLFromStreamL(); + void UT_GetMediaSinkFromSessionL(); + void UT_GetMediaSinkLFromSessionL(); + void UT_GetCameraLL(); + void UT_GetFileSourceLL(); + void UT_GetDisplayL(); + void UT_GetDisplayLL(); + void UT_AddDisplayLL(); + void UT_AddSpeakerLL(); + void UT_DisableStreamLL(); + void UT_GetReceivingDisplayL(); + void UT_GetReceivingDisplayLL(); + void UT_GetVfDisplayL(); + void UT_EnableInactivityTimerL(); + + private: // Data + + CMceManager* iManager; + CMusSipProfileHandler* iProfileHandler; + CMusEngObserverStub* iObserver; + CMceSession* iEmptySession; + CMceSession* iVideoOutSession; + CMceSession* iVideoInSession; + + CMceDisplaySink* iReceivingDisplay; // Not owned + + EUNIT_DECLARE_TEST_TABLE; + + }; + +#endif // __UT_MUSENGMCEUTILS_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/tsrc/ut_engine/inc/ut_musengoutsession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/tsrc/ut_engine/inc/ut_musengoutsession.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,101 @@ +/* +* 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_MUSENGOUTSESSION_H__ +#define __UT_MUSENGOUTSESSION_H__ + + +// EXTERNAL INCLUDES +#include +#include + +// FORWARD DECLARATIONS +class CMusEngLiveSession; +class CLcSessionObserverStub; +class CLcUiProviderStub; +class CMusEngObserverStub; + +// CONSTANTS +_LIT8( KMusPPreferredIdentityTestHeader, "P-Preferred-Identity: sip:user@domain.com" ); +_LIT8( KMusTestUri, "sip:user@domain.com" ); + + +// CLASS DEFINITION +/** + * Tester class for CMusEngOutSession. + * Since CMusEngOutSession is abstract, it is tested via object of its' + * concrete child class CMusEngLiveSession. Only concrete implementations + * are tested in this tester class. + * + */ +NONSHARABLE_CLASS( UT_CMusEngOutSession ): public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static UT_CMusEngOutSession* NewL(); + static UT_CMusEngOutSession* NewLC(); + + /** + * Destructor + */ + ~UT_CMusEngOutSession(); + + private: // Constructors and destructors + + UT_CMusEngOutSession(); + void ConstructL(); + + private: // Test case setup and teardown + + void SetupL(); + + void Teardown(); + + private: // Test methdods + + void UT_EstablishLcSessionL(); + void UT_EstablishLcSession_RecipientResolvingL(); + void UT_EstablishLcSession_RegistrationPendingL(); + void UT_TerminateLcSessionL(); + void UT_EstablishSessionLL(); + void UT_HandleTerminationL(); + void UT_HandleRecipientNotFoundTerminationL(); + void UT_AdjustVideoCodecLL(); + void UT_AdjustAudioCodecLL(); + void UT_CreateMceSessionStructureLL(); + void UT_ConstructLL(); + void UT_ContactSavingLL(); + void UT_RemoteAddressLL(); + void UT_RemoteDisplayNameL(); + + private: // Data + + CMusEngLiveSession* iLiveSession; + CLcSessionObserverStub* iLcSessionObserver; + CLcUiProviderStub* iLcUiProvider; + CMusEngObserverStub* iAudioRoutingObserver; + + EUNIT_DECLARE_TEST_TABLE; + }; + +#endif // __UT_MUSENGOUTSESSION_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/tsrc/ut_engine/inc/ut_musengreceivesession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/tsrc/ut_engine/inc/ut_musengreceivesession.h Thu Jul 22 16:32:26 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: +* +*/ + + +#ifndef __UT_MUSENGRECEIVESESSION_H__ +#define __UT_MUSENGRECEIVESESSION_H__ + + +// EXTERNAL INCLUDES +#include +#include + +// FORWARD DECLARATIONS +class CMceInSession; +class CMusEngReceiveSession; +class CLcSessionObserverStub; +class CMceVideoStream; +class CMceAudioStream; +class CLcUiProviderStub; + +#include +#ifndef NONSHARABLE_CLASS + #define NONSHARABLE_CLASS(x) class x +#endif + +// CLASS DEFINITION +/** + * + */ +NONSHARABLE_CLASS( UT_CMusEngReceiveSession ): public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static UT_CMusEngReceiveSession* NewL(); + static UT_CMusEngReceiveSession* NewLC(); + + /** + * Destructor + */ + ~UT_CMusEngReceiveSession(); + + private: // Constructors and destructors + + UT_CMusEngReceiveSession(); + void ConstructL(); + + private: // Test case setup and teardown + + void SetupL(); + + void Teardown(); + + private: // Test helpers + + CMceVideoStream* ConstructVideoInStreamLC(); + CMceVideoStream* ConstructVideoOutStreamLC(); + CMceAudioStream* ConstructAudioInStreamLC(); + CMceAudioStream* ConstructAudioOutStreamLC(); + CMceInSession* ConstructInSessionLC( TInt aVideoStreamCount, + TInt aAudioStreamCount, + TBool aConstructSinks = ETrue ); + + private: // Test methdods + + void UT_NewLL(); + void UT_LcSessionStateL(); + void UT_EstablishLcSessionL(); + void UT_TerminateLcSessionL(); + void UT_RemoteVideoPlayerL(); + void UT_RemoteDisplayName(); + void UT_HandleSessionStateChangedL(); + void UT_AdjustVideoCodecLL(); + void UT_AdjustAudioCodecLL(); + void UT_DoCodecSelectionLL(); + void UT_IncomingSessionL(); + void UT_IncomingUpdateL(); + void UT_StreamStateChangedL(); + void UT_CompleteSessionStructureL_WithoutSessionL(); + void UT_CompleteSessionStructureL_WithoutStreamsL(); + void UT_CompleteSessionStructureL_WithOutgoingStreamL(); + void UT_CompleteSessionStructureL_WithVideoInL(); + void UT_CompleteSessionStructureL_WithVideoOutBoundToVideoInL(); + void UT_CompleteSessionStructureL_WithVideoInBoundToVideoOutL(); + void UT_CompleteSessionStructureL_WithMultipleVideoInsL(); + void UT_CompleteSessionStructureL_WithVideoAndMultipleAudioInsL(); + void UT_CompleteSessionStructureL_OperatorVariant(); + void UT_CompleteSessionStructureL_SdpBandwidthAttributesL(); + void UT_ParseAssertedIdentityL(); + void UT_ContactSavingLL(); + void UT_IsDisplayActive(); + void UT_InactivityTimeoutL(); + + private: // Data + + CMusEngReceiveSession* iReceiveSession; + CLcSessionObserverStub* iLcSessionObserver; + CLcUiProviderStub* iLcUiProvider; + + EUNIT_DECLARE_TEST_TABLE; + + }; + +#endif // __UT_MUSENGRECEIVESESSION_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/tsrc/ut_engine/inc/ut_musengremotevideoplayer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/tsrc/ut_engine/inc/ut_musengremotevideoplayer.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,88 @@ +/* +* 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_MUSENGREMOTEVIDEOPLAYER_H +#define UT_MUSENGREMOTEVIDEOPLAYER_H + + +// INCLUDES +#include +#include +#include "musengstubs.h" + +// FORWARD DECLARATIONS +class CMceSession; +class CMusEngRemoteVideoPlayer; + + +// CLASS DEFINITION +/** + * + */ +NONSHARABLE_CLASS( UT_CMusEngRemoteVideoPlayer ): public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static UT_CMusEngRemoteVideoPlayer* NewL(); + static UT_CMusEngRemoteVideoPlayer* NewLC(); + + /** + * Destructor + */ + ~UT_CMusEngRemoteVideoPlayer(); + + private: // Constructors and destructors + + UT_CMusEngRemoteVideoPlayer(); + void ConstructL(); + + private: // Test case setup and teardown + + void SetupL(); + void Teardown(); + + private: // Test methdods + + void UT_NewLL(); + void UT_LcVideoPlayerStateL(); + void UT_LcPlayL(); + void UT_LcWindowL(); + void UT_LcCameraControlL(); + void UT_LcSourceFileControlL(); + void UT_LcDestinationFileControlL(); + void UT_LcAudioControlL(); + void UT_LcZoomControlL(); + void UT_LcBrightnessControlL(); + void UT_EnableLcWindowL(); + void UT_LcWindowRectL(); + void UT_LcWindowOrientationL(); + + private: // Data + + TLcAudioControlStub iLcAudioControlStub; + CMceSession* iMceSession; + CMusEngRemoteVideoPlayer* iRemoteVideoPlayer; + TMusEngDisplayHandlerStub iDisplayHandlerStub; + EUNIT_DECLARE_TEST_TABLE; + }; + +#endif // UT_MUSENGREMOTEVIDEOPLAYER_H + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/tsrc/ut_engine/inc/ut_musengsessiondurationtimer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/tsrc/ut_engine/inc/ut_musengsessiondurationtimer.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,81 @@ +/* +* 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_MUSENGSESSIONDURATIONTIMER_H__ +#define __UT_MUSENGSESSIONDURATIONTIMER_H__ + + +// EXTERNAL INCLUDES +#include +#include + +// FORWARD DECLARATIONS +class CMusEngSessionDurationTimer; +class CMusEngObserverStub; + + +// CLASS DEFINITION +/** + * Tester class for CMusEngSessionDurationTimer. + * + * + */ +NONSHARABLE_CLASS( UT_CMusEngSessionDurationTimer ): public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static UT_CMusEngSessionDurationTimer* NewL(); + static UT_CMusEngSessionDurationTimer* NewLC(); + + /** + * Destructor + */ + ~UT_CMusEngSessionDurationTimer(); + + private: // Constructors and destructors + + UT_CMusEngSessionDurationTimer(); + void ConstructL(); + + private: // Test case setup and teardown + + void SetupL(); + + void Teardown(); + + private: // Test methods + + void UT_CMusEngSessionDurationTimer_StartL(); + void UT_CMusEngSessionDurationTimer_RunLL(); + void UT_CMusEngSessionDurationTimer_DoCancelL(); + + private: // Data + + CMusEngSessionDurationTimer* iDurationTimer; + CMusEngObserverStub* iObserver; + + EUNIT_DECLARE_TEST_TABLE; + + }; + +#endif // __UT_MUSENGSESSIONDURATIONTIMER_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/tsrc/ut_engine/inc/ut_musengsessionmanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/tsrc/ut_engine/inc/ut_musengsessionmanager.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,79 @@ +/* +* 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_MUSENGSESSIONMANAGER_H +#define UT_MUSENGSESSIONMANAGER_H + +// EXTERNAL INCLUDES +#include +#include + +// FORWARD DECLARATIONS +class CMusEngSessionManager; +class CLcUiProviderStub; + + +// CLASS DEFINITION +/** + * Tester class for CMusEngSessionManager. + * + */ +NONSHARABLE_CLASS( UT_CMusEngSessionManager ): public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static UT_CMusEngSessionManager* NewL(); + static UT_CMusEngSessionManager* NewLC(); + + /** + * Destructor + */ + ~UT_CMusEngSessionManager(); + + private: // Constructors and destructors + + UT_CMusEngSessionManager(); + void ConstructL(); + + private: // Test case setup and teardown + + void SetupL(); + + void Teardown(); + + private: // Test methdods + + void UT_NewL(); + void UT_SessionL(); + void UT_IsFeatureSupportedL(); + void UT_CreateMusSessionL(); + void UT_PropertyChangedL(); + + private: // Data + + CMusEngSessionManager* iSessionManager; + CLcUiProviderStub* iLcUiProvider; + + EUNIT_DECLARE_TEST_TABLE; + }; + +#endif // UT_MUSENGSESSIONMANAGER_H + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/tsrc/ut_engine/inc/ut_musengsipprofilehandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/tsrc/ut_engine/inc/ut_musengsipprofilehandler.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,84 @@ +/* +* 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_MUSENGSIPPROFILEHANDLER_H__ +#define __UT_MUSENGSIPPROFILEHANDLER_H__ + + +// INCLUDES +#include +#include + +// FORWARD DECLARATIONS +class CMusSipProfileHandler; +class CMusEngObserverStub; + + +// CLASS DEFINITION +/** + * Tester class for CMusSipProfileHandler. + * + */ +NONSHARABLE_CLASS( UT_CMusEngSipProfileHandler ): + public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static UT_CMusEngSipProfileHandler* NewL(); + static UT_CMusEngSipProfileHandler* NewLC(); + + /** + * Destructor + */ + ~UT_CMusEngSipProfileHandler(); + + private: // Constructors and destructors + + UT_CMusEngSipProfileHandler(); + void ConstructL(); + + private: // Test case setup and teardown + + void SetupL(); + + void Teardown(); + + private: // Test methdods + + void UT_CreateSipProfileLL(); + void UT_ProfileIdL(); + void UT_AlrEventL(); + void UT_NullTestsL(); + void UT_UserFromProfileLCL(); + void UT_IsRegisteredL(); + void UT_ProfileRegistryEventOccurredL(); + + private: // Data + + CMusSipProfileHandler* iProfileHandler; + CMusEngObserverStub* iObserver; + + EUNIT_DECLARE_TEST_TABLE; + }; + +#endif // __UT_MUSENGSIPPROFILEHANDLER_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/tsrc/ut_engine/inc/ut_musengtelephoneutils.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/tsrc/ut_engine/inc/ut_musengtelephoneutils.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,87 @@ +/* +* 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_MUSENGTELEPHONEUTILS_H__ +#define __UT_MUSENGTELEPHONEUTILS_H__ + + +// EXTERNAL INCLUDES +#include +#include + +// FORWARD DECLARATIONS +class CMusEngTelephoneUtils; +class CMusEngObserverStub; + +// CLASS DEFINITION +/** + * Tester class for CMusEngTelephoneUtils. + * + */ +NONSHARABLE_CLASS( UT_CMusEngTelephoneUtils ): public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static UT_CMusEngTelephoneUtils* NewL(); + static UT_CMusEngTelephoneUtils* NewLC(); + + /** + * Destructor + */ + ~UT_CMusEngTelephoneUtils(); + + private: // Constructors and destructors + + UT_CMusEngTelephoneUtils(); + void ConstructL(); + + private: // Test case setup and teardown + + void SetupL(); + + void Teardown(); + + private: // Test methods + + void UT_NewLL(); + void UT_AudioRoutingCanBeChangedL(); + void UT_LoudspeakerLL(); + void UT_IsLoudSpeakerEnabledL(); + void UT_GetVolumeLL(); + void UT_SetVolumeLL(); + void UT_AvailableOutputsChangedL(); + void UT_OutputChangedL(); + void UT_SetOutputCompleteL(); + void UT_ValidateVolumeL(); + void UT_DestructorL(); + + private: // Data + + CMusEngTelephoneUtils* iTelephoneUtils; + CMusEngObserverStub* iObserver; + + EUNIT_DECLARE_TEST_TABLE; + + }; + +#endif // __UT_MUSENGTELEPHONEUTILS_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/tsrc/ut_engine/inc/ut_musengtwowayrecvsession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/tsrc/ut_engine/inc/ut_musengtwowayrecvsession.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,117 @@ +/* +* 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_MUSENGTWOWAYRECVSESSION_H__ +#define __UT_MUSENGTWOWAYRECVSESSION_H__ + + +// EXTERNAL INCLUDES +#include +#include + +// FORWARD DECLARATIONS +class CMceInSession; +class CMusEngTwoWayRecvSession; +class CMusEngReceiveSession; +class CMceVideoStream; +class CMceAudioStream; +class CLcSessionObserverStub; + +#include +#ifndef NONSHARABLE_CLASS + #define NONSHARABLE_CLASS(x) class x +#endif + +// CLASS DEFINITION +/** + * + */ +NONSHARABLE_CLASS( UT_CMusEngTwoWayRecvSession ): public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static UT_CMusEngTwoWayRecvSession* NewL(); + static UT_CMusEngTwoWayRecvSession* NewLC(); + + /** + * Destructor + */ + ~UT_CMusEngTwoWayRecvSession(); + + private: // Constructors and destructors + + UT_CMusEngTwoWayRecvSession(); + void ConstructL(); + + private: // Test case setup and teardown + + void SetupL(); + + void Teardown(); + + private: // Test helpers + + CMceVideoStream* ConstructVideoInStreamLC(); + CMceVideoStream* ConstructVideoOutStreamLC(); + CMceAudioStream* ConstructAudioInStreamLC(); + CMceAudioStream* ConstructAudioOutStreamLC(); + CMceInSession* ConstructInSessionLC( TInt aVideoStreamCount, + TInt aAudioStreamCount, + TBool aConstructSinks = ETrue ); + + CMceInSession* ConstructTwoWayInSessionLC( TBool aConstructSinks = ETrue ); + + private: // Test methdods + + void UT_NewLL(); + void UT_EnableDisplayLL(); + void UT_SetOrientationLL(); + void UT_OrientationLL(); + void UT_SetLocalRectLL(); + void UT_SetRectsLL(); + void UT_CameraL(); + void UT_LocalVideoPlayerL(); + void UT_HandleSessionStateChangedL(); + void UT_AdjustVideoCodecLL(); + void UT_AdjustAudioCodecLL(); + void UT_DoCodecSelectionLL(); + void UT_IncomingSessionL(); + void UT_CompleteSessionStructureL_WithoutSessionL(); + void UT_CompleteSessionStructureL_WithoutStreamsL(); + void UT_CompleteSessionStructureL_WithOutgoingStreamL(); + void UT_CompleteSessionStructureL_WithVideoInL(); + void UT_CompleteSessionStructureL_WithVideoOutBoundToVideoInL(); + void UT_CompleteSessionStructureL_WithVideoInBoundToVideoOutL(); + void UT_CompleteSessionStructureL_WithMultipleVideoInsL(); + void UT_CompleteSessionStructureL_WithVideoAndMultipleAudioInsL(); + void UT_CompleteSessionStructureL_OperatorVariant(); + + private: // Data + + CMusEngTwoWayRecvSession* iReceiveSession; + CLcSessionObserverStub* iLcSessionObserver; + + EUNIT_DECLARE_TEST_TABLE; + }; + +#endif // __UT_MUSENGRECEIVESESSION_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/tsrc/ut_engine/inc/ut_musengtwowaysession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/tsrc/ut_engine/inc/ut_musengtwowaysession.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,99 @@ +/* +* 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_MUSENGTWOWAYSESSION_H__ +#define __UT_MUSENGTWOWAYSESSION_H__ + + +// EXTERNAL INCLUDES +#include +#include + +// FORWARD DECLARATIONS +class CMusEngTwoWaySession; +class CLcSessionObserverStub; +class CLcUiProviderStub; + + +// CLASS DEFINITION +/** + * Tester class for CMusEngLiveSession. + * Tests only implementations that are not tested in ancestor classes. + * + */ +NONSHARABLE_CLASS( UT_CMusEngTwoWaySession ): public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static UT_CMusEngTwoWaySession* NewL(); + static UT_CMusEngTwoWaySession* NewLC(); + + /** + * Destructor + */ + ~UT_CMusEngTwoWaySession(); + + private: // Constructors and destructors + + UT_CMusEngTwoWaySession(); + void ConstructL(); + + private: // Test case setup and teardown + + void SetupL(); + + void Teardown(); + + private: // Test methdods + + void UT_NewLL(); + void UT_EstablishLcSessionLL(); + void UT_EnableDisplayLL(); + void UT_SetOrientationLL(); + void UT_SetLocalRectLL(); + void UT_SetRectsLL(); + void UT_CompleteSessionStructureLL(); + void UT_HandleSessionStateChangedL(); + void UT_AdjustVideoCodecLL(); + void UT_AdjustAudioCodecLL(); + void UT_DoCodecSelectionLL(); + void UT_StreamStateChangedL(); + void UT_StreamStateChangedWithSourceL(); + void UT_SetEncodingDeviceLL(); + void UT_SetCodecConfigKeyLL(); + void UT_ReadCodecConfigKeyLL(); + void UT_StoreEncoderConfigInfoLL(); + void UT_RemoteVideoPlayerL(); + void UT_EnableLcFileL(); + void UT_InactivityTimeoutL(); + + private: // Data + + CMusEngTwoWaySession* iLiveSession; + CLcSessionObserverStub* iLcSessionObserver; + CLcUiProviderStub* iLcUiProvider; + + EUNIT_DECLARE_TEST_TABLE; + }; + +#endif // __UT_MUSENGTWOWAYSESSION_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/tsrc/ut_engine/inc/ut_musenguriparser.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/tsrc/ut_engine/inc/ut_musenguriparser.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,82 @@ +/* +* 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_MUSENGURIPARSER_H__ +#define __UT_MUSENGURIPARSER_H__ + + +// EXTERNAL INCLUDES +#include +#include + +// FORWARD DECLARATIONS + + +#ifndef NONSHARABLE_CLASS + #define NONSHARABLE_CLASS(x) class x +#endif + +// CLASS DEFINITION +/** + * Tester class for TMusEngUriParser. + * + */ +NONSHARABLE_CLASS( UT_TMusEngUriParser ): public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static UT_TMusEngUriParser* NewL(); + static UT_TMusEngUriParser* NewLC(); + + /** + * Destructor + */ + ~UT_TMusEngUriParser(); + + private: // Constructors and destructors + + UT_TMusEngUriParser(); + void ConstructL(); + + private: // Test case setup and teardown + + void SetupL(); + + void Teardown(); + + private: // Test methdods + + void UT_TMusEngUriParser_TMusEngUriParserL(); + void UT_TMusEngUriParser_GetUri8LL(); + void UT_TMusEngUriParser_GetUri16LL(); + void UT_TMusEngUriParser_ParseUriLL(); + + private: // Data + + + + EUNIT_DECLARE_TEST_TABLE; + + }; + +#endif // __UT_MUSENGURIPARSER_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/tsrc/ut_engine/inc/ut_muspropertywatch.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/tsrc/ut_engine/inc/ut_muspropertywatch.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,88 @@ +/* +* 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_MUSPROPERYWATCH_H__ +#define __UT_MUSPROPERYWATCH_H__ + + +// EXTERNAL INCLUDES +#include +#include + +#include "musengstubs.h" + +// FORWARD DECLARATIONS +class CMusPropertyWatch; +class TMusUiPropertyObserverStub; + +// CLASS DEFINITION +/** + * Tester class for CMusEngSession. + * Since CMusEngSession is abstract, it is tested via object of its' + * concrete descendant class CMusEngLiveSession. Only concrete + * implementations are tested in this tester class. + * + */ +NONSHARABLE_CLASS( UT_CMusPropertyWatch ): public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static UT_CMusPropertyWatch* NewL(); + static UT_CMusPropertyWatch* NewLC(); + + /** + * Destructor + */ + ~UT_CMusPropertyWatch(); + + private: // Constructors and destructors + + UT_CMusPropertyWatch(); + void ConstructL(); + + private: // Test case setup and teardown + + void SetupL(); + + void Teardown(); + + private: // Test methods + + void UT_CMusPropertyWatch_ReadIntPropertyLL(); + void UT_CMusPropertyWatch_ReadDescPropertyLL(); + void UT_CMusPropertyWatch_DoCancelL(); + void UT_CMusPropertyWatch_RunLL(); + void UT_CMusPropertyWatch_RunErrorL(); + + + private: // Data + + + TMusPropertyObserverStub iPropertyObserver; + CMusPropertyWatch* iPropertyWatch; + + EUNIT_DECLARE_TEST_TABLE; + + }; + +#endif // __UT_MUSPROPERYWATCH_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/tsrc/ut_engine/src/musengstubs.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/tsrc/ut_engine/src/musengstubs.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,617 @@ +/* +* Copyright (c) 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: +* +*/ + + + +#include "musengstubs.h" +#include "musengtestdefs.h" +#include + + +// ---- MEMBER FUNCTIONS OF CMusEngObserverStub -------------------------------- + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngObserverStub::CMusEngObserverStub() + { + Reset(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngObserverStub::~CMusEngObserverStub() + { + } + +// ----------------------------------------------------------------------------- +// From MMusEngSessionDurationTimerObserver +// ----------------------------------------------------------------------------- +// +void CMusEngObserverStub::UpdateTimerEvent() + { + iUpdateTimerEventCalled = ETrue; + } + +// ----------------------------------------------------------------------------- +// From MMusEngAudioRoutingObserver +// ----------------------------------------------------------------------------- +// +void CMusEngObserverStub::AudioRoutingChanged() + { + iAudioRoutingChangedCalled = ETrue; + } + +// ----------------------------------------------------------------------------- +// From MMusSipProfileUser +// ----------------------------------------------------------------------------- +// +TBool CMusEngObserverStub::IsRoamingBetweenAPsAllowed() + { + return iRoamingBetweenAPsAllowed; + } + +// ----------------------------------------------------------------------------- +// From MMusSipProfileUser +// ----------------------------------------------------------------------------- +// +void CMusEngObserverStub::ProfileRegistered() + { + iProfileRegisteredCalled = ETrue; + } + +// ----- HELPERS --------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMusEngObserverStub::IsReseted() + { + return ( iUpdateTimerEventCalled == EFalse && + iAudioRoutingChangedCalled == EFalse && + iRoamingBetweenAPsAllowed == EFalse && + iProfileRegisteredCalled == EFalse ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngObserverStub::Reset() + { + iUpdateTimerEventCalled = EFalse; + iAudioRoutingChangedCalled = EFalse; + iRoamingBetweenAPsAllowed = EFalse; + iProfileRegisteredCalled = EFalse; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TMusEngDisplayHandlerStub::TMusEngDisplayHandlerStub() + { + Reset(); + } + +void TMusEngDisplayHandlerStub::Reset() + { + iRect = TRect( 0, 0, 0, 0 ); + iSecondaryRect = TRect( 0, 0, 0, 0 ); + iIsEnabled = EFalse; + iOrientation = EPortrait; + iIsActive = ETrue; + } + +TRect TMusEngDisplayHandlerStub::Rect() const + { + return iRect; + } + +void TMusEngDisplayHandlerStub::SetRectL( const TRect& aRect ) + { + iRect = aRect; + } + +void TMusEngDisplayHandlerStub::SetSecondaryRectL( const TRect& aSecondaryRect ) + { + iSecondaryRect = aSecondaryRect; + } + +TRect TMusEngDisplayHandlerStub::SecondaryRect() const + { + return iSecondaryRect; + } + +void TMusEngDisplayHandlerStub::EnableDisplayL( TBool aEnable ) + { + iIsEnabled = aEnable; + } + +TBool TMusEngDisplayHandlerStub::IsDisplayEnabled() + { + return iIsEnabled; + } + +MMusEngDisplayHandler::TDisplayOrientation TMusEngDisplayHandlerStub::OrientationL() + { + return iOrientation; + } + +void TMusEngDisplayHandlerStub::SetOrientationL( TDisplayOrientation aOrientation ) + { + iOrientation = aOrientation; + } + +TBool TMusEngDisplayHandlerStub::IsDisplayActive() + { + return iIsActive; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CLcSessionObserverStub::CLcSessionObserverStub() + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CLcSessionObserverStub::~CLcSessionObserverStub() + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CLcSessionObserverStub::StateChanged( MLcSession& aSession ) + { + iCalledFunction = ESessionStateChanged; + iCurrentSession = &aSession; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CLcSessionObserverStub::StateChanged( MLcVideoPlayer& aPlayer ) + { + iCalledFunction = EPlayerStateChanged; + iCurrentPlayer = &aPlayer; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CLcSessionObserverStub::Updated( MLcSession& aSession ) + { + iCalledFunction = ESessionUpdated; + iCurrentSession = &aSession; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CLcSessionObserverStub::Updated( MLcVideoPlayer& aPlayer ) + { + iCalledFunction = EPlayerUpdated; + iCurrentPlayer = &aPlayer; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CLcSessionObserverStub::Failed( MLcSession& aSession, TInt aError ) + { + iCalledFunction = ESessionFailed; + iCurrentSession = &aSession; + iError = aError; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CLcSessionObserverStub::Failed( MLcVideoPlayer& aPlayer, TInt aError ) + { + iCalledFunction = EPlayerFailed; + iCurrentPlayer = &aPlayer; + iError = aError; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CLcSessionObserverStub::SessionTimeChanged( + MLcSession& aSession, + const TTimeIntervalSeconds& aSeconds ) + { + iCalledFunction = ESessionTimeChanged; + iCurrentSession = &aSession; + iSessionTime = aSeconds.Int(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CLcSessionObserverStub::Reset() + { + iCalledFunction = EUnknown; + iCurrentSession = NULL; + iCurrentPlayer = NULL; + iSessionTime = 0; + iError = KErrNone; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CLcSessionObserverStub::IsReseted() + { + return ( iCalledFunction == EUnknown && + iCurrentSession == NULL && + iCurrentPlayer == NULL && + iSessionTime == 0 && + iError == KErrNone ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CLcUiProviderStub::CLcUiProviderStub() + { + + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CLcUiProviderStub::~CLcUiProviderStub() + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CLcUiProviderStub::SelectRecipient( + MDesCArray& aRecipientAddresses, + TDes& aSelectedRecipientAddress ) + { + iCalledFunction = ESelectRecipient; + if ( aRecipientAddresses.MdcaCount() > 0 ) + { + aSelectedRecipientAddress = aRecipientAddresses.MdcaPoint( 0 ); + } + return iSimulatedReturnValue; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CLcUiProviderStub::InputRecipient( TDes& aRecipientAddress ) + { + iCalledFunction = EInputRecipient; + aRecipientAddress = iRecipient; + return iSimulatedReturnValue; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CLcUiProviderStub::HandleForegroundStatus( TBool aForeground ) + { + iCalledFunction = EHandleForegroundStatus; + iForeground = aForeground; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CLcUiProviderStub::BlockUi( TBool /*aBlocked*/ ) + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CLcUiProviderStub::Reset() + { + iCalledFunction = EUnknown; + iRecipient.Set( KNullDesC ); + iSimulatedReturnValue = EFalse; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TLcWindowStub::TLcWindowStub() : + iEnabled( EFalse ), + iRect(), + iOrientation( MLcWindow::EPortrait ) + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void TLcWindowStub::EnableLcWindowL( TBool aEnable ) + { + iEnabled = aEnable; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool TLcWindowStub::IsLcWindowEnabled() + { + return iEnabled; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void TLcWindowStub::SetLcWindowRectL( TRect aRect ) + { + iRect = aRect; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TRect TLcWindowStub::LcWindowRect() + { + delete HBufC::NewL( 1 ); + return iRect; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void TLcWindowStub::SetLcWindowOrientationL( TLcWindowOrientation aOrientation ) + { + delete HBufC::NewL( 1 ); + iOrientation = aOrientation; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void TLcWindowStub::Reset() + { + iEnabled = EFalse; + iOrientation = MLcWindow::EPortrait; + iRect.SetSize( TSize() ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +MLcWindow::TLcWindowOrientation TLcWindowStub::LcWindowOrientationL() + { + delete HBufC::NewL( 1 ); + return iOrientation; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TLcAudioControlStub::TLcAudioControlStub() + { + Reset(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool TLcAudioControlStub::IsLcAudioMutedL() + { + delete HBufC::NewL( 1 ); + return iAudioMuted; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void TLcAudioControlStub::MuteLcAudioL( TBool aMute ) + { + delete HBufC::NewL( 1 ); + iAudioMuted = aMute; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool TLcAudioControlStub::IsLcMicMutedL() + { + delete HBufC::NewL( 1 ); + return iMicMuted; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void TLcAudioControlStub::MuteLcMicL( TBool aMute ) + { + delete HBufC::NewL( 1 ); + iMicMuted = aMute; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool TLcAudioControlStub::IsEnablingLcLoudspeakerAllowed() + { + return iEnablingLoudspeakerAllowed; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void TLcAudioControlStub::EnableLcLoudspeakerL( TBool aEnabled ) + { + delete HBufC::NewL( 1 ); + iLoudspeakerEnabled = aEnabled; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool TLcAudioControlStub::IsLcLoudspeakerEnabled() + { + return iLoudspeakerEnabled; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt TLcAudioControlStub::LcVolumeL() + { + delete HBufC::NewL( 1 ); + return iVolume; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void TLcAudioControlStub::SetLcVolumeL( TInt aValue ) + { + delete HBufC::NewL( 1 ); + iVolume = aValue; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void TLcAudioControlStub::IncreaseLcVolumeL() + { + delete HBufC::NewL( 1 ); + iVolume++; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void TLcAudioControlStub::DecreaseLcVolumeL() + { + delete HBufC::NewL( 1 ); + iVolume--; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void TLcAudioControlStub::Reset() + { + iAudioMuted = EFalse; + iMicMuted = EFalse; + iEnablingLoudspeakerAllowed = EFalse; + iLoudspeakerEnabled = ETrue; + iVolume = 0; + } + + +// CSipProfileAlrController STUB +CSipProfileAlrController* CSipProfileAlrController::NewL( + CSIPProfileRegistryBase& aRegistry, + MSipProfileAlrObserver& /*aObserver*/ ) + { + return new( ELeave )CSipProfileAlrController( aRegistry ); + } + +CSipProfileAlrController::~CSipProfileAlrController() + { + } + +void CSipProfileAlrController::AllowMigrationL( + TUint32 /*aProfileId*/, + TUint32 aIapId ) + { + delete HBufC::NewL( 1 ); + iAllowMigrationCalled = ETrue; + iLastUsedIap = aIapId; + } + +void CSipProfileAlrController::DisallowMigrationL( + TUint32 /*aProfileId*/, + TUint32 aIapId ) + { + delete HBufC::NewL( 1 ); + iDisallowMigrationCalled = ETrue; + iLastUsedIap = aIapId; + } + +void CSipProfileAlrController::RefreshIapAvailabilityL( + TUint32 /*aProfileId*/ ) + { + delete HBufC::NewL( 1 ); + } + +CSipProfileAlrController::CSipProfileAlrController( + CSIPProfileRegistryBase& aRegistry ) + : iRegistry( aRegistry ) + { + } + +void REComSession::DestroyedImplementation(TUid /*aDtorIDKey*/) + { + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/tsrc/ut_engine/src/ut_musengcamerahandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/tsrc/ut_engine/src/ut_musengcamerahandler.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,956 @@ +/* +* 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: +* +*/ + + +// INTERNAL INCLUDES +#include "ut_musengcamerahandler.h" +#include "musengstubs.h" +#include "musengtestdefs.h" +#include "musenglivesession.h" +#include "mussipprofilehandler.h" +#include "musengmceutils.h" +#include "mussettings.h" +#include "mussessionproperties.h" + +// SYSTEM INCLUDES +#include +#include +#include +#include +#include +#include +#include +#include + +const TUint KSipProfileId( 1 ); + +//use step in different time period +const TInt KZoomBigStepCount = 15; +const TInt KZoomSmallStepCount = KZoomBigStepCount*2; +const TInt KZoomStepMinSize = 1; + +// 0.4 second +const TInt64 KZoomFasterTime = 400000;//must bigger than 1/3 second + +//insure that step is 1 +#define USER_SLEEP User::After(KZoomFasterTime) + + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_TMusEngCameraHandler* UT_TMusEngCameraHandler::NewL() + { + UT_TMusEngCameraHandler* self = UT_TMusEngCameraHandler::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_TMusEngCameraHandler* UT_TMusEngCameraHandler::NewLC() + { + UT_TMusEngCameraHandler* self = new( ELeave ) UT_TMusEngCameraHandler(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_TMusEngCameraHandler::~UT_TMusEngCameraHandler() + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// Default constructor +// ----------------------------------------------------------------------------- +// +UT_TMusEngCameraHandler::UT_TMusEngCameraHandler() + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// Second phase construct +// ----------------------------------------------------------------------------- +// +void UT_TMusEngCameraHandler::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_TMusEngCameraHandler::SetupL() + { + iManager = CMceManager::NewL( TUid::Null(), NULL ); + iObserver = new( ELeave ) CMusEngObserverStub; + iObserver->iRoamingBetweenAPsAllowed = ETrue; + iProfileHandler = CMusSipProfileHandler::NewL( *iObserver ); + + iProfileHandler->CreateProfileL( KSipProfileId ); + + iSession = CMceOutSession::NewL( *iManager, + *iProfileHandler->Profile(), + KTestRecipientSipUri8() ); + + + CMceVideoStream* videoOut = CMceVideoStream::NewLC(); + + videoOut->AddSinkL( CMceRtpSink::NewLC() ); + CleanupStack::Pop(); + + videoOut->AddSinkL( CMceDisplaySink::NewLC( *iManager ) ); + CleanupStack::Pop(); + + videoOut->SetSourceL( CMceCameraSource::NewLC( *iManager ) ); + CleanupStack::Pop(); + + CMceVideoStream* videoIn = CMceVideoStream::NewLC(); + + CMceDisplaySink* receivingDisplay = CMceDisplaySink::NewLC( *iManager ); + videoIn->AddSinkL( receivingDisplay ); + CleanupStack::Pop(); + + videoIn->SetSourceL( CMceRtpSource::NewLC() ); + CleanupStack::Pop(); + + videoOut->BindL( videoIn ); + CleanupStack::Pop( videoIn ); + + iSession->AddStreamL( videoOut ); + CleanupStack::Pop( videoOut ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_TMusEngCameraHandler::Teardown() + { + delete iSession; + iSession = NULL; + iCameraHandler.SetSession( NULL ); + delete iProfileHandler; + delete iObserver; + delete iManager; + } + + + +// TEST CASES + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_TMusEngCameraHandler::UT_LcCameraCountL() + { + // Call without setting the MCE session + EUNIT_ASSERT_SPECIFIC_LEAVE( iCameraHandler.LcCameraCountL(), KErrNotReady ) + + iCameraHandler.SetSession( iSession ); + CMceCameraSource* camera = + MusEngMceUtils::GetCameraL( *( iSession ) ); + iCameraHandler.iCameraUsage = MusSettingsKeys::EUseCameraSwapping; + camera->iCameraCount = 2; + camera->iCameraIndex = TMusEngCameraHandler::EBackCamera; + + // Two cameras + EUNIT_ASSERT_EQUALS( 2, iCameraHandler.LcCameraCountL() ) + + // Two cameras, swapping cameras not allowed, use only main camera + iCameraHandler.iCameraUsage = MusSettingsKeys::EUseOnlyMainCamera; + camera->iCameraCount = 2; + EUNIT_ASSERT_EQUALS( 1, iCameraHandler.LcCameraCountL() ) + + // Two cameras, swapping cameras not allowed, use only main camera + iCameraHandler.iCameraUsage = MusSettingsKeys::EUseOnlySecondaryCamera; + camera->iCameraCount = 2; + EUNIT_ASSERT_EQUALS( 1, iCameraHandler.LcCameraCountL() ) + + // Only one camera available + iCameraHandler.iCameraUsage = MusSettingsKeys::EUseCameraSwapping; + camera->iCameraCount = 1; + EUNIT_ASSERT_EQUALS( 1, iCameraHandler.LcCameraCountL() ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_TMusEngCameraHandler::UT_ToggleLcCameraL() + { + EUNIT_ASSERT_EQUALS( TInt( TMusEngCameraHandler::ECameraNotAvailable ), + iCameraHandler.CurrentLcCameraIndex() ) + + iCameraHandler.SetSession( iSession ); + iCameraHandler.iCameraUsage = MusSettingsKeys::EUseCameraSwapping; + iCameraHandler.iCurrentCamera = TMusEngCameraHandler::EBackCamera; + + // Switch from back to front + iCameraHandler.ToggleLcCameraL(); + EUNIT_ASSERT_EQUALS( TInt( TMusEngCameraHandler::EFrontCamera ), + iCameraHandler.CurrentLcCameraIndex() ) + + // Switch from front to back + iCameraHandler.ToggleLcCameraL(); + EUNIT_ASSERT_EQUALS( TInt( TMusEngCameraHandler::EBackCamera ), + iCameraHandler.CurrentLcCameraIndex() ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_TMusEngCameraHandler::UT_MinLcZoomL() + { + // MCE Session has not been set + EUNIT_ASSERT_SPECIFIC_LEAVE( iCameraHandler.MinLcZoomL(), KErrNotReady ) + + // MCE Session has been set + iCameraHandler.SetSession( iSession ); + EUNIT_ASSERT_EQUALS( + iCameraHandler.iCameraInfo.iMinZoom, + iCameraHandler.MinLcZoomL() ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_TMusEngCameraHandler::UT_MaxLcZoomL() + { + // MCE Session has not been set + EUNIT_ASSERT_SPECIFIC_LEAVE( iCameraHandler.MaxLcZoomL(), KErrNotReady ) + + // MCE Session has been set + iCameraHandler.SetSession( iSession ); + EUNIT_ASSERT_EQUALS( + iCameraHandler.iCameraInfo.iMaxZoom + + iCameraHandler.iCameraInfo.iMaxDigitalZoom, + iCameraHandler.MaxLcZoomL() ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_TMusEngCameraHandler::UT_LcZoomValueL() + { + // MCE Session has not been set + EUNIT_ASSERT_SPECIFIC_LEAVE( iCameraHandler.LcZoomValueL(), KErrNotReady ) + + // Check that originally current and default zoom are the same + iCameraHandler.SetSession( iSession ); + CMceCameraSource* camera = MusEngMceUtils::GetCameraL( *( iSession ) ); + + // Zoom to maximum optical value + while ( camera->iZoomFactor < iCameraHandler.iCameraInfo.iMaxZoom ) + { + iCameraHandler.LcZoomInL(); + } + EUNIT_ASSERT_EQUALS( + iCameraHandler.iCameraInfo.iMaxZoom, + iCameraHandler.LcZoomValueL() ) + + // Zoom using digital zoom + iCameraHandler.LcZoomInL(); + EUNIT_ASSERT_EQUALS( + iCameraHandler.iCameraInfo.iMaxZoom + camera->iDigitalZoomFactor, + iCameraHandler.LcZoomValueL() ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_TMusEngCameraHandler::UT_SetLcZoomValueL() + { + // MCE Session has not been set + EUNIT_ASSERT_SPECIFIC_LEAVE( + iCameraHandler.SetLcZoomValueL( 1 ), + KErrNotReady ) + + // Value above the maximum zoom + iCameraHandler.SetSession( iSession ); + EUNIT_ASSERT_SPECIFIC_LEAVE( + iCameraHandler.SetLcZoomValueL( iCameraHandler.MaxLcZoomL() + 1 ), + KErrArgument ) + + // Value below the minimum zoom + EUNIT_ASSERT_SPECIFIC_LEAVE( + iCameraHandler.SetLcZoomValueL( iCameraHandler.MinLcZoomL() - 1 ), + KErrArgument ) + + // OK: set zoom factor + CMceCameraSource* camera = MusEngMceUtils::GetCameraL( *iSession ); + TInt zoomValue = iCameraHandler.iCameraInfo.iMaxZoom - 1; + iCameraHandler.SetLcZoomValueL( zoomValue ); + EUNIT_ASSERT_EQUALS( zoomValue, camera->ZoomFactorL() ) + + // OK: set digital zoom factor + zoomValue = iCameraHandler.iCameraInfo.iMaxZoom + 1; + iCameraHandler.SetLcZoomValueL( zoomValue ); + EUNIT_ASSERT_EQUALS( 1, camera->DigitalZoomFactorL() ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_TMusEngCameraHandler::UT_LcZoomInL() + { + // Check that zooming is not possible before invite + TRAPD( error, iCameraHandler.LcZoomInL() ); + MUS_TEST_FORWARD_ALLOC_FAILURE( error ); + EUNIT_ASSERT( error == KErrNotReady ); + + iCameraHandler.SetSession( iSession ); + + CMceCameraSource* camera = MusEngMceUtils::GetCameraL( *( iSession ) ); + + TInt oldZoomFactor = camera->iZoomFactor; + + // Check that zoom factor can be increased + USER_SLEEP; //insure that small step is used + iCameraHandler.LcZoomInL(); + EUNIT_ASSERT( camera->iZoomFactor == oldZoomFactor + + iCameraHandler.iSmallZoomStep ); + + //Check the "burst" mode (immediate second ZoomIn), big step should be used + TInt nZoom = camera->iZoomFactor + camera->iDigitalZoomFactor; + iCameraHandler.LcZoomInL(); + TInt nStep = camera->iZoomFactor + camera->iDigitalZoomFactor - nZoom; + EUNIT_ASSERT( nStep == iCameraHandler.iBigZoomStep ); + + // Zoom to maximum optical value + while ( camera->iZoomFactor < iCameraHandler.iCameraInfo.iMaxZoom ) + { + iCameraHandler.LcZoomInL(); + } + + TInt maxOpticalZoomFactor = camera->ZoomFactorL(); + + // Check that digital zoom is used instead of optical + iCameraHandler.LcZoomInL(); + EUNIT_ASSERT( camera->iZoomFactor == maxOpticalZoomFactor ); + EUNIT_ASSERT( camera->iDigitalZoomFactor > 0 ); + + // Zoom to maximum digital value + while ( camera->iDigitalZoomFactor < + iCameraHandler.iCameraInfo.iMaxDigitalZoom ) + { + iCameraHandler.LcZoomInL(); + } + + TInt maxDigitalZoomFactor = camera->DigitalZoomFactorL(); + + // Check that further zooming is impossible + iCameraHandler.LcZoomInL(); + EUNIT_ASSERT( camera->iZoomFactor == maxOpticalZoomFactor ); + EUNIT_ASSERT( camera->iDigitalZoomFactor == maxDigitalZoomFactor ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_TMusEngCameraHandler::UT_LcZoomOutL() + { + // Check that zooming is not possible before invite + TRAPD( error, iCameraHandler.LcZoomOutL() ); + MUS_TEST_FORWARD_ALLOC_FAILURE( error ); + EUNIT_ASSERT( error == KErrNotReady ); + + iCameraHandler.SetSession( iSession ); + + CMceCameraSource* camera = + MusEngMceUtils::GetCameraL( *(iSession) ); + + // Simulate maximum zoom + camera->iZoomFactor = iCameraHandler.iCameraInfo.iMaxZoom; + camera->iDigitalZoomFactor = iCameraHandler.iCameraInfo.iMaxDigitalZoom; + + // Check that digital zoom factor can be decreased + USER_SLEEP; //insure that small step is used + iCameraHandler.LcZoomOutL(); + EUNIT_ASSERT( camera->iZoomFactor == iCameraHandler.iCameraInfo.iMaxZoom ); + EUNIT_ASSERT( camera->iDigitalZoomFactor == + iCameraHandler.iCameraInfo.iMaxDigitalZoom - + iCameraHandler.iSmallZoomStep ); + + //Check the "burst" mode (immediate second ZoomOut), big step should be used + TInt nZoom = camera->iZoomFactor + camera->iDigitalZoomFactor; + iCameraHandler.LcZoomOutL(); + TInt nStep; + nStep = nZoom - (camera->iZoomFactor + camera->iDigitalZoomFactor ); + EUNIT_ASSERT( nStep == iCameraHandler.iBigZoomStep ); + + // Simulate maximum zoom again + camera->iZoomFactor = iCameraHandler.iCameraInfo.iMaxZoom; + camera->iDigitalZoomFactor = iCameraHandler.iCameraInfo.iMaxDigitalZoom; + + // Zoom to minimum digital zoom + while ( camera->iDigitalZoomFactor > 0 ) + { + iCameraHandler.LcZoomOutL(); + } + + EUNIT_ASSERT( camera->iZoomFactor == iCameraHandler.iCameraInfo.iMaxZoom ); + EUNIT_ASSERT( camera->iDigitalZoomFactor == 0 ); + + // Check that optical zoom is decreased instead of digital + USER_SLEEP; //insure that step is the small one + iCameraHandler.LcZoomOutL(); + EUNIT_ASSERT( camera->iZoomFactor == + iCameraHandler.iCameraInfo.iMaxZoom - + iCameraHandler.iSmallZoomStep ); + EUNIT_ASSERT( camera->iDigitalZoomFactor == 0 ); + + // Zoom to minimum optical zoom + while ( camera->iZoomFactor > iCameraHandler.iCameraInfo.iMinZoom ) + { + iCameraHandler.LcZoomOutL(); + } + + // Check that further zooming is impossible + iCameraHandler.LcZoomOutL(); + EUNIT_ASSERT( camera->iZoomFactor == iCameraHandler.iCameraInfo.iMinZoom ); + EUNIT_ASSERT( camera->iDigitalZoomFactor == 0 ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_TMusEngCameraHandler::UT_SetLcBrightnessL() + { + // Check that setting brightness is not possible before invite + EUNIT_ASSERT_SPECIFIC_LEAVE( + iCameraHandler.SetLcBrightnessL( KTestSomeBrightness ), + KErrNotReady ) + + iCameraHandler.SetSession( iSession ); + CMceCameraSource* camera = MusEngMceUtils::GetCameraL( *( iSession ) ); + + camera->iCameraInfo.iOptionsSupported = + camera->iCameraInfo.iOptionsSupported|TCameraInfo::EBrightnessSupported; + + // Check that originally current and default brightness are the same + EUNIT_ASSERT_EQUALS( iCameraHandler.iDefaultBrightness, + iCameraHandler.LcBrightnessL() ) + + // Test setting brightness + iCameraHandler.SetLcBrightnessL( KTestSomeBrightness ); + EUNIT_ASSERT_EQUALS( KTestSomeBrightness, iCameraHandler.LcBrightnessL() ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_TMusEngCameraHandler::UT_LcBrightnessL() + { + // Check that checking current brightness is not possible before invite + EUNIT_ASSERT_SPECIFIC_LEAVE( iCameraHandler.LcBrightnessL(), + KErrNotReady ) + + // All the other stuff checked in tests of SetBrightnessL + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_TMusEngCameraHandler::UT_MaxLcBrightnessL() + { + // MaxBrightness should return a constant + EUNIT_ASSERT_EQUALS( KTestMaxBrightness, iCameraHandler.MaxLcBrightnessL() ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_TMusEngCameraHandler::UT_MinLcBrightnessL() + { + // MinBrightness should return a constant + + EUNIT_ASSERT_EQUALS( KTestMinBrightness, iCameraHandler.MinLcBrightnessL() ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_TMusEngCameraHandler::UT_IncreaseLcBrightnessL() + { + // Check that increasing brightness is not possible before invite + EUNIT_ASSERT_SPECIFIC_LEAVE( iCameraHandler.IncreaseLcBrightnessL(), + KErrNotReady ) + + iCameraHandler.SetSession( iSession ); + CMceCameraSource* camera = MusEngMceUtils::GetCameraL( *(iSession) ); + + camera->iCameraInfo.iOptionsSupported = + camera->iCameraInfo.iOptionsSupported|TCameraInfo::EBrightnessSupported; + + // Check that originally current and default brightness are the same + EUNIT_ASSERT_EQUALS( iCameraHandler.iDefaultBrightness, + iCameraHandler.LcBrightnessL() ) + + // Check that brightness can be increased... + iCameraHandler.IncreaseLcBrightnessL(); + EUNIT_ASSERT_EQUALS( iCameraHandler.iDefaultBrightness + KTestBrightnessStepSize, + iCameraHandler.LcBrightnessL() ) + + // ... but only to maximum + iCameraHandler.SetLcBrightnessL( KTestMaxBrightness ); + iCameraHandler.IncreaseLcBrightnessL(); + + EUNIT_ASSERT_EQUALS( KTestMaxBrightness, + iCameraHandler.LcBrightnessL() ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_TMusEngCameraHandler::UT_DecreaseLcBrightnessL() + { + // Check that decreasing brightness is not possible before invite + EUNIT_ASSERT_SPECIFIC_LEAVE( iCameraHandler.DecreaseLcBrightnessL(), + KErrNotReady ) + + iCameraHandler.SetSession( iSession ); + CMceCameraSource* camera = MusEngMceUtils::GetCameraL( *(iSession) ); + + camera->iCameraInfo.iOptionsSupported = + camera->iCameraInfo.iOptionsSupported|TCameraInfo::EBrightnessSupported; + + // Check that originally current and default brightness are the same + EUNIT_ASSERT_EQUALS( iCameraHandler.iDefaultBrightness, + iCameraHandler.LcBrightnessL() ) + + // Check that brightness can be decreased... + iCameraHandler.DecreaseLcBrightnessL(); + + EUNIT_ASSERT_EQUALS( + iCameraHandler.iDefaultBrightness - KTestBrightnessStepSize, + iCameraHandler.LcBrightnessL() ) + + // ... but only to minimum + iCameraHandler.SetLcBrightnessL( KTestMinBrightness ); + iCameraHandler.DecreaseLcBrightnessL(); + EUNIT_ASSERT_EQUALS( KTestMinBrightness, + iCameraHandler.LcBrightnessL() ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_TMusEngCameraHandler::UT_PlayL() + { + // Check that resuming is not possible before invite + EUNIT_ASSERT_SPECIFIC_LEAVE( iCameraHandler.PlayL(), KErrNotReady ) + + iCameraHandler.SetSession( iSession ); + + iCameraHandler.PauseL(); + + CMceCameraSource* camera = MusEngMceUtils::GetCameraL( *(iSession) ); + iCameraHandler.PlayL(); + EUNIT_ASSERT( camera->IsEnabled() ) + + // Try to enable camera again, request should be ignored + iCameraHandler.PlayL(); + EUNIT_ASSERT( camera->IsEnabled() ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_TMusEngCameraHandler::UT_PauseL() + { + // Check that pausing is not possible before invite + EUNIT_ASSERT_SPECIFIC_LEAVE( iCameraHandler.PauseL(), KErrNotReady ) + + iCameraHandler.SetSession( iSession ); + + iCameraHandler.PlayL(); + + CMceCameraSource* camera = MusEngMceUtils::GetCameraL( *(iSession) ); + + iCameraHandler.PauseL(); + + EUNIT_ASSERT( !camera->IsEnabled() ) + + // Try to disable camera again, request should be ignored + iCameraHandler.PauseL(); + EUNIT_ASSERT( !camera->IsEnabled() ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_TMusEngCameraHandler::UT_IsPlayingL() + { + // Try without a session + EUNIT_ASSERT_SPECIFIC_LEAVE( iCameraHandler.IsPlayingL(), KErrNotReady ) + + // Normal cases + iCameraHandler.SetSession( iSession ); + + iCameraHandler.PlayL(); + EUNIT_ASSERT( iCameraHandler.IsPlayingL() ) + + iCameraHandler.PauseL(); + EUNIT_ASSERT( !iCameraHandler.IsPlayingL() ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_TMusEngCameraHandler::UT_InitializeZoomStepSizeL() + { + //Check that zooming steps have defualt values before session establishment + iCameraHandler.InitializeZoomStepSize(); + EUNIT_ASSERT( iCameraHandler.iSmallZoomStep == KZoomStepMinSize ); + EUNIT_ASSERT( iCameraHandler.iBigZoomStep == KZoomStepMinSize ); + + iCameraHandler.SetSession( iSession ); + CMceCameraSource* camera = MusEngMceUtils::GetCameraL( *(iSession) ); + + //Check that zooming step sizes have default value KZoomStepMinSize + //in case of zooming values range is smaller than KZoomBigStepCount + iCameraHandler.iCameraInfo.iMinZoom = 0; + iCameraHandler.iCameraInfo.iMaxZoom = 0; + iCameraHandler.iCameraInfo.iMaxDigitalZoom = KZoomBigStepCount / 2; + iCameraHandler.InitializeZoomStepSize(); + EUNIT_ASSERT( iCameraHandler.iSmallZoomStep == KZoomStepMinSize ); + EUNIT_ASSERT( iCameraHandler.iBigZoomStep == KZoomStepMinSize ); + + //Check that zooming step sizes have default value KZoomStepMinSize + //in case of zooming values range is bigger than KZoomBigStepCount, + //but smaller than 2*KZoomBigStepCount (KZoomSmallStepCount) + iCameraHandler.iCameraInfo.iMaxDigitalZoom = 2*KZoomBigStepCount - 1; + iCameraHandler.InitializeZoomStepSize(); + EUNIT_ASSERT( iCameraHandler.iSmallZoomStep == KZoomStepMinSize ); + EUNIT_ASSERT( iCameraHandler.iBigZoomStep == KZoomStepMinSize ); + + //Check zooming steps sizes in case of zooming values range is + //bigger than 2*KZoomBigStepCount and smaller than 2*KZoomSmallStepCount + iCameraHandler.iCameraInfo.iMinZoom = - KZoomBigStepCount; + iCameraHandler.iCameraInfo.iMaxZoom = KZoomBigStepCount; + iCameraHandler.iCameraInfo.iMaxDigitalZoom = KZoomBigStepCount; + //zooming range is (-KZoomBigStepCount, 2*KZoomBigStepCount) + iCameraHandler.InitializeZoomStepSize(); + EUNIT_ASSERT( iCameraHandler.iSmallZoomStep == KZoomStepMinSize ); + EUNIT_ASSERT( iCameraHandler.iBigZoomStep == 3 ); + + //Check zooming steps sizes in case of zooming values range is + //bigger than 2*KZoomSmallStepCount + iCameraHandler.iCameraInfo.iMaxZoom = KZoomSmallStepCount; + iCameraHandler.iCameraInfo.iMaxDigitalZoom = KZoomSmallStepCount; + iCameraHandler.iCameraInfo.iMinZoom = - KZoomSmallStepCount; + //zooming range is (-KZoomSmallStepCount, 2*KZoomSmallStepCount) + iCameraHandler.InitializeZoomStepSize(); + EUNIT_ASSERT( iCameraHandler.iSmallZoomStep == 3 ); + EUNIT_ASSERT( iCameraHandler.iBigZoomStep == 6 ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_TMusEngCameraHandler::UT_ChangeActiveCameraL() + { + iCameraHandler.SetSession( iSession ); + + CMceCameraSource* camera = + MusEngMceUtils::GetCameraL( *(iSession) ); + + //Camera is not enabled + camera->iIsEnabled = ETrue; + camera->iCameraCount = 2; + camera->iCameraIndex = 1; + iCameraHandler.ChangeActiveCameraL( TMusEngCameraHandler::EFrontCamera ); + EUNIT_ASSERT( camera->iCameraIndex == 1 ); + EUNIT_ASSERT( camera->iIsEnabled == ETrue ); + + //Camera is not enabled + camera->iIsEnabled = EFalse; + camera->iCameraCount = 2; + camera->iCameraIndex = 1; + iCameraHandler.ChangeActiveCameraL( TMusEngCameraHandler::EFrontCamera ); + EUNIT_ASSERT( camera->iCameraIndex == 1 ); + EUNIT_ASSERT( camera->iIsEnabled == EFalse ); + + //Check that iCameraInfo get updated after camera change + EUNIT_PRINT(_L("Check that iCameraInfo get updated after camera change")); + + //Check that iCameraInfo get updated after camera change + EUNIT_PRINT(_L("Check that iCameraInfo get updated after camera change")); + camera->iIsEnabled = ETrue; + camera->iCameraCount = 2; + camera->iCameraIndex = 0; + iCameraHandler.ChangeActiveCameraL( TMusEngCameraHandler::EBackCamera ); + EUNIT_ASSERT( camera->iCameraIndex == 0 ); + TCameraInfo infoBack = iCameraHandler.iCameraInfo; + iCameraHandler.ChangeActiveCameraL( TMusEngCameraHandler::EFrontCamera ); + EUNIT_ASSERT( camera->iCameraIndex == 1 ); + TCameraInfo infoFront = iCameraHandler.iCameraInfo; + + EUNIT_ASSERT( infoBack.iMaxZoom != infoFront.iMaxZoom ); + EUNIT_ASSERT( infoBack.iMaxDigitalZoom != infoFront.iMaxDigitalZoom ); + camera->iIsEnabled = ETrue; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_TMusEngCameraHandler::UT_ChangeCameraL() + { + TRAPD( error, iCameraHandler.ChangeCameraL( TMusEngCameraHandler::EFrontCamera ) ); + MUS_TEST_FORWARD_ALLOC_FAILURE( error ); + EUNIT_ASSERT( error == KErrNotReady ); + + iCameraHandler.SetSession( iSession ); + + CMceCameraSource* camera = + MusEngMceUtils::GetCameraL( *(iSession) ); + //Only one camera is supported + camera->iCameraCount = 0; + camera->iCameraIndex = 0; + + iCameraHandler.ChangeCameraL( TMusEngCameraHandler::EFrontCamera ); + //EUNIT_ASSERT( camera->iCameraIndex == 0 ); + + // Front camera is supported. + camera->iCameraCount = 2; + camera->iCameraIndex = 1; + iCameraHandler.ChangeCameraL( TMusEngCameraHandler::EFrontCamera ); + EUNIT_ASSERT( camera->iCameraIndex == 1 ); + + //No change + camera->iCameraCount = 2; + camera->iCameraIndex = 0; + camera->iIsEnabled = EFalse; + iCameraHandler.ChangeCameraL( TMusEngCameraHandler::EFrontCamera ); + EUNIT_ASSERT( camera->iIsEnabled == EFalse ); + + // Back camera is supported. + camera->iCameraCount = 2; + camera->iCameraIndex = 1; + iCameraHandler.ChangeCameraL( TMusEngCameraHandler::EBackCamera ); + EUNIT_ASSERT( camera->iCameraIndex == 0 ); + + //No change + camera->iCameraCount = 2; + camera->iCameraIndex = 0; + camera->iIsEnabled = EFalse; + iCameraHandler.ChangeCameraL( TMusEngCameraHandler::EBackCamera ); + EUNIT_ASSERT( camera->iIsEnabled == EFalse ); + + // Next camera. + camera->iCameraCount = 2; + camera->iCameraIndex = 0; + iCameraHandler.ChangeCameraL( TMusEngCameraHandler::ECameraNotAvailable ); + EUNIT_ASSERT( camera->iCameraIndex == 1 ); + + camera->iCameraCount = 2; + camera->iCameraIndex = 1; + iCameraHandler.ChangeCameraL( TMusEngCameraHandler::ECameraNotAvailable ); + EUNIT_ASSERT( camera->iCameraIndex == 0 ); + } + + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_TMusEngCameraHandler, + "UT_TMusEngCameraHandler", + "UNIT" ) + +EUNIT_TEST( + "LcCameraCountL - test ", + "TMusEngCameraHandler", + "LcCameraCountL", + "FUNCTIONALITY", + SetupL, UT_LcCameraCountL, Teardown) + +EUNIT_TEST( + "ToggleLcCameraL - test ", + "TMusEngCameraHandler", + "ToggleLcCameraL", + "FUNCTIONALITY", + SetupL, UT_ToggleLcCameraL, Teardown) + +EUNIT_TEST( + "MinLcZoomL - test ", + "TMusEngCameraHandler", + "MinLcZoomL", + "FUNCTIONALITY", + SetupL, UT_MinLcZoomL, Teardown) + +EUNIT_TEST( + "MaxLcZoomL - test ", + "TMusEngCameraHandler", + "MaxLcZoomL", + "FUNCTIONALITY", + SetupL, UT_MaxLcZoomL, Teardown) + +EUNIT_TEST( + "LcZoomValueL - test ", + "TMusEngCameraHandler", + "LcZoomValueL", + "FUNCTIONALITY", + SetupL, UT_LcZoomValueL, Teardown) + +EUNIT_TEST( + "SetLcZoomValueL - test ", + "TMusEngCameraHandler", + "SetLcZoomValueL", + "FUNCTIONALITY", + SetupL, UT_SetLcZoomValueL, Teardown) + +EUNIT_TEST( + "LcZoomInL - test ", + "TMusEngCameraHandler", + "LcZoomInL", + "FUNCTIONALITY", + SetupL, UT_LcZoomInL, Teardown) + +EUNIT_TEST( + "LcZoomOutL - test ", + "TMusEngCameraHandler", + "LcZoomOutL", + "FUNCTIONALITY", + SetupL, UT_LcZoomOutL, Teardown) + +EUNIT_TEST( + "SetLcBrightnessL - test ", + "TMusEngCameraHandler", + "SetLcBrightnessL", + "FUNCTIONALITY", + SetupL, UT_SetLcBrightnessL, Teardown) + +EUNIT_TEST( + "LcBrightnessL - test ", + "TMusEngCameraHandler", + "LcBrightnessL", + "FUNCTIONALITY", + SetupL, UT_LcBrightnessL, Teardown) + +EUNIT_TEST( + "MaxLcBrightnessL - test ", + "TMusEngCameraHandler", + "MaxLcBrightnessL", + "FUNCTIONALITY", + SetupL, UT_MaxLcBrightnessL, Teardown) + +EUNIT_TEST( + "MinLcBrightnessL - test ", + "TMusEngCameraHandler", + "MinLcBrightnessL", + "FUNCTIONALITY", + SetupL, UT_MinLcBrightnessL, Teardown) + +EUNIT_TEST( + "IncreaseLcBrightnessL - test ", + "TMusEngCameraHandler", + "IncreaseLcBrightnessL", + "FUNCTIONALITY", + SetupL, UT_IncreaseLcBrightnessL, Teardown) + +EUNIT_TEST( + "DecreaseLcBrightnessL - test ", + "TMusEngCameraHandler", + "DecreaseLcBrightnessL", + "FUNCTIONALITY", + SetupL, UT_DecreaseLcBrightnessL, Teardown) + +EUNIT_TEST( + "PlayL - test ", + "TMusEngCameraHandler", + "PlayL", + "FUNCTIONALITY", + SetupL, UT_PlayL, Teardown) + +EUNIT_TEST( + "PauseL - test ", + "TMusEngCameraHandler", + "PauseL", + "FUNCTIONALITY", + SetupL, UT_PauseL, Teardown) + +EUNIT_TEST( + "IsPlayingL - test ", + "TMusEngCameraHandler", + "IsPlayingL", + "FUNCTIONALITY", + SetupL, UT_IsPlayingL, Teardown) + +EUNIT_TEST( + "InitializeZoomStepSize - test ", + "TMusEngCameraHandler", + "InitializeZoomStepSize", + "FUNCTIONALITY", + SetupL, UT_InitializeZoomStepSizeL, Teardown) + +EUNIT_TEST( + "ChangeCameraL - test ", + "TMusEngCameraHandler", + "ChangeCameraL", + "FUNCTIONALITY", + SetupL, UT_ChangeCameraL, Teardown) + +EUNIT_TEST( + "UT_ChangeActiveCameraL - test ", + "TMusEngCameraHandler", + "DisableAndEnableBeforeChangingCamera", + "FUNCTIONALITY", + SetupL, UT_ChangeActiveCameraL, Teardown) + +EUNIT_END_TEST_TABLE + +// END OF FILE + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/tsrc/ut_engine/src/ut_musengclipsession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/tsrc/ut_engine/src/ut_musengclipsession.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,784 @@ +/* +* 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: +* +*/ + + +// INTERNAL INCLUDES +#include "ut_musengClipsession.h" +#include "musengstubs.h" +#include "musengtestdefs.h" +#include "musengclipsession.h" +#include "mussipprofilehandler.h" +#include "musengmceutils.h" +#include "mussessionproperties.h" + +// SYSTEM INCLUDES +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusEngClipSession* UT_CMusEngClipSession::NewL() + { + UT_CMusEngClipSession* self = UT_CMusEngClipSession::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusEngClipSession* UT_CMusEngClipSession::NewLC() + { + UT_CMusEngClipSession* self = new( ELeave ) UT_CMusEngClipSession(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusEngClipSession::~UT_CMusEngClipSession() + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// Default constructor +// ----------------------------------------------------------------------------- +// +UT_CMusEngClipSession::UT_CMusEngClipSession() + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// Second phase construct +// ----------------------------------------------------------------------------- +// +void UT_CMusEngClipSession::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngClipSession::SetupL() + { + iLcSessionObserver = new( ELeave )CLcSessionObserverStub; + iLcUiProvider = new( ELeave )CLcUiProviderStub; + iAudioRoutingObserver = new( ELeave )CMusEngObserverStub; + + iClipSession = CMusEngClipSession::NewL(); + iClipSession->SetLcSessionObserver( iLcSessionObserver ); + iClipSession->SetLcUiProvider( iLcUiProvider ); + iClipSession->LocalVideoPlayer()->LcSourceFileControl()->SetLcFileNameL( + KTestVideoFileName() ); + delete iClipSession->iVideoCodecList; + iClipSession->iVideoCodecList = NULL; + iClipSession->iVideoCodecList = KMceSDPNameH264().AllocL(); + + SIPStrings::OpenL(); + + User::LeaveIfError( RProperty::Set( NMusSessionApi::KCategoryUid, + NMusSessionApi::KRemoteSipAddress, + KTestRecipientSipUri ) ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngClipSession::Teardown() + { + SIPStrings::Close(); + delete iClipSession; + delete iLcSessionObserver; + delete iLcUiProvider; + delete iAudioRoutingObserver; + PropertyHelper::Close(); + } + + + +// TEST CASES + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngClipSession::UT_NewLL() + { + EUNIT_ASSERT( iClipSession ) + EUNIT_ASSERT( !iClipSession->iSession ) + EUNIT_ASSERT( iClipSession->iMceManagerUid == TUid::Uid( KMusUiUid ) ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngClipSession::UT_CompleteSessionStructureLL() + { + CMceStreamBundle* localBundle = + CMceStreamBundle::NewLC( CMceStreamBundle::ELS ); + + // Check that structure cannot be completed before creating the session + EUNIT_ASSERT_SPECIFIC_LEAVE( + iClipSession->CompleteSessionStructureL( *localBundle ), + KErrNotReady ) + + // Normal case + CSIPProfile* profile = iClipSession->iSipProfileHandler->Profile(); + iClipSession->iSession = CMceOutSession::NewL( + *iClipSession->iManager, *profile, KTestRecipientSipUri8() ); + + iClipSession->CompleteSessionStructureL( *localBundle ); + EUNIT_ASSERT( iClipSession->iSession->Streams().Count() == 3 ) + EUNIT_ASSERT( iClipSession->iSession->Streams()[0]->Type() == KMceVideo ) + EUNIT_ASSERT( iClipSession->iSession->Streams()[0]->Source() ) + EUNIT_ASSERT( iClipSession->iSession->Streams()[0]->Source()->Type() == + KMceFileSource ) + EUNIT_ASSERT( iClipSession->iSession->Streams()[0]->Sinks().Count() == 1 ) + EUNIT_ASSERT( iClipSession->iSession->Streams()[0]->Sinks()[0]->Type() == + KMceRTPSink ) + + // Check that only stream with speaker has been added to a bundle + EUNIT_ASSERT( localBundle->Streams().Count() == 1 ) + EUNIT_ASSERT( localBundle->Streams()[0]->Type() == KMceAudio ) + EUNIT_ASSERT( localBundle->Streams()[0]->Sinks().Count() > 0 ) + EUNIT_ASSERT( localBundle->Streams()[0]->Sinks()[0]->Type() == + KMceSpeakerSink ) + + CleanupStack::PopAndDestroy( localBundle ); + } + + +// ----------------------------------------------------------------------------- +// Although all states are not meaningfull for LiveSession, all states are +// tested in order to force the updating of unit tests when behavior is changed +// ----------------------------------------------------------------------------- +// +void UT_CMusEngClipSession::UT_StreamStateChangedL() + { + // Try without a session, nothing happens + CMceVideoStream* videoStream = CMceVideoStream::NewLC(); + static_cast(iClipSession)->StreamStateChanged( + *videoStream ); + CleanupStack::PopAndDestroy( videoStream ); + + // Simulate sending invite + iClipSession->EstablishLcSessionL(); + + // Try all the stream states + CMceMediaStream* changedStream = iClipSession->iSession->Streams()[0]; + + // EUninitialized, stream is created, unexpected change, nothing happens + changedStream->iState = CMceMediaStream::EUninitialized; + static_cast(iClipSession)->StreamStateChanged( + *changedStream ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ) + + // EInitialized, stream is initialized + changedStream->iState = CMceMediaStream::EInitialized; + static_cast(iClipSession)->StreamStateChanged( + *changedStream ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ) + + // EBuffering, stream is buffering + changedStream->iState = CMceMediaStream::EBuffering; + static_cast(iClipSession)->StreamStateChanged( + *changedStream ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ) + + // EIdle, stream is not receiving RTP + changedStream->iState = CMceMediaStream::EIdle; + static_cast(iClipSession)->StreamStateChanged( + *changedStream ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ) + + // EStreaming, stream is streaming + changedStream->iState = CMceMediaStream::EStreaming; + static_cast(iClipSession)->StreamStateChanged( + *changedStream ); + EUNIT_ASSERT_EQUALS( TInt( iLcSessionObserver->iCalledFunction ), + TInt( CLcSessionObserverStub::EPlayerStateChanged ) ) + iLcSessionObserver->Reset(); + + // EDisabled, stream is explicitly disabled + changedStream->iState = CMceMediaStream::EDisabled; + static_cast(iClipSession)->StreamStateChanged( + *changedStream ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ) + + // ENoResources, stream has no needed resources to stream + changedStream->iState = CMceMediaStream::ENoResources; + static_cast(iClipSession)->StreamStateChanged( + *changedStream ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ) + + // ETranscodingRequired, stream requires non-realtime transcoding + changedStream->iState = CMceMediaStream::ETranscodingRequired; + static_cast(iClipSession)->StreamStateChanged( + *changedStream ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ) + + // ETranscoding, stream is transcoding in non-realtime + changedStream->iState = CMceMediaStream::ETranscoding; + static_cast(iClipSession)->StreamStateChanged( + *changedStream ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ) + } + + +// ----------------------------------------------------------------------------- +// Although all states are not meaningfull for ClipSession, all states are +// tested in order to force the updating of unit tests when behavior is changed +// ----------------------------------------------------------------------------- +// +void UT_CMusEngClipSession::UT_StreamStateChangedWithSourceL() + { + // Try without a session, nothing happens + CMceVideoStream* videoStream = CMceVideoStream::NewLC(); + CMceRtpSource* rtpSource = CMceRtpSource::NewLC(); + static_cast(iClipSession)->StreamStateChanged( + *videoStream, + *rtpSource ); + CleanupStack::PopAndDestroy( rtpSource ); + CleanupStack::PopAndDestroy( videoStream ); + + // Simulate sending invite + iClipSession->EstablishLcSessionL(); + + // Try all the non-default stream states + CMceMediaStream* changedStream = iClipSession->iSession->Streams()[0]; + CMceMediaSource* changedSource = changedStream->Source(); + + // EDisabled, end of clip + changedStream->iState = CMceMediaStream::EDisabled; + changedSource->iIsEnabled = EFalse; + iClipSession->StreamStateChanged( *changedStream, *changedSource ); + + // TODO: EUNIT_ASSERT( iLcSessionObserver->iEndOfClipCalled ) + changedSource->iIsEnabled = ETrue; + iLcSessionObserver->Reset(); + + // Test default stream state change behavior, remove or change when + // behavior changes + + + // EUninitialized, stream is created, unexpected change, nothing happens + changedStream->iState = CMceMediaStream::EUninitialized; + static_cast(iClipSession)->StreamStateChanged( + *changedStream, *changedSource ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ) + + // EInitialized, stream is initialized + changedStream->iState = CMceMediaStream::EInitialized; + static_cast(iClipSession)->StreamStateChanged( + *changedStream, *changedSource ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ) + + // Special meaning (Transcoding ready), tested separately + + // EBuffering, stream is buffering + changedStream->iState = CMceMediaStream::EBuffering; + static_cast(iClipSession)->StreamStateChanged( + *changedStream, *changedSource ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ) + + // EIdle, stream is not receiving RTP + changedStream->iState = CMceMediaStream::EIdle; + static_cast(iClipSession)->StreamStateChanged( + *changedStream, *changedSource ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ) + + // EStreaming, stream is streaming + changedStream->iState = CMceMediaStream::EStreaming; + static_cast(iClipSession)->StreamStateChanged( + *changedStream, *changedSource ); + EUNIT_ASSERT_EQUALS( TInt( iLcSessionObserver->iCalledFunction ), + TInt( CLcSessionObserverStub::EPlayerStateChanged ) ) + iLcSessionObserver->Reset(); + + // EDisabled, stream is explicitly disabled + // This state has non-default meaning, tested before defaults + + // ENoResources, stream has no needed resources to stream + changedStream->iState = CMceMediaStream::ENoResources; + static_cast(iClipSession)->StreamStateChanged( + *changedStream, *changedSource ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ) + } + + +// ----------------------------------------------------------------------------- +// Although all states are not meaningfull for LiveSession, all states are +// tested in order to force the updating of unit tests when behavior is changed +// ----------------------------------------------------------------------------- +// +void UT_CMusEngClipSession::UT_StreamStateChangedWithSinkL() + { + // Try without a session, nothing happens + CMceVideoStream* videoStream = CMceVideoStream::NewLC(); + static_cast(iClipSession)->StreamStateChanged( + *videoStream, + *CMceRtpSink::NewLC() ); + CleanupStack::PopAndDestroy(); // rtp + CleanupStack::PopAndDestroy( videoStream ); + + // Simulate sending invite + iClipSession->EstablishLcSessionL(); + + // Test default stream state change behavior + CMceMediaStream* changedStream = iClipSession->iSession->Streams()[0]; + CMceMediaSink* changedSink = changedStream->Sinks()[0]; + + // EUninitialized, stream is created, unexpected change, nothing happens + changedStream->iState = CMceMediaStream::EUninitialized; + static_cast(iClipSession)->StreamStateChanged( + *changedStream, + *changedSink ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ) + + // EInitialized, stream is initialized + changedStream->iState = CMceMediaStream::EInitialized; + static_cast(iClipSession)->StreamStateChanged( + *changedStream, + *changedSink ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ) + + // EBuffering, stream is buffering + changedStream->iState = CMceMediaStream::EBuffering; + static_cast(iClipSession)->StreamStateChanged( + *changedStream, + *changedSink ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ) + + // EIdle, stream is not receiving RTP + changedStream->iState = CMceMediaStream::EIdle; + static_cast(iClipSession)->StreamStateChanged( + *changedStream, + *changedSink ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ) + + // EStreaming, stream is streaming + changedStream->iState = CMceMediaStream::EStreaming; + static_cast(iClipSession)->StreamStateChanged( + *changedStream, + *changedSink ); + EUNIT_ASSERT_EQUALS( TInt( iLcSessionObserver->iCalledFunction ), + TInt( CLcSessionObserverStub::EPlayerStateChanged ) ) + iLcSessionObserver->Reset(); + + // EDisabled, stream is explicitly disabled + changedStream->iState = CMceMediaStream::EDisabled; + static_cast(iClipSession)->StreamStateChanged( + *changedStream, + *changedSink ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ) + + // ENoResources, stream has no needed resources to stream + changedStream->iState = CMceMediaStream::ENoResources; + static_cast(iClipSession)->StreamStateChanged( + *changedStream, + *changedSink ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ) + + // ETranscodingRequired, stream requires non-realtime transcoding + changedStream->iState = CMceMediaStream::ETranscodingRequired; + static_cast(iClipSession)->StreamStateChanged( + *changedStream, + *changedSink ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ) + + // ETranscoding, stream is transcoding in non-realtime + changedStream->iState = CMceMediaStream::ETranscoding; + static_cast(iClipSession)->StreamStateChanged( + *changedStream, + *changedSink ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngClipSession::UT_AddAmrCodecLL() + { + // Check that all the codecs are replaced with AMR codec + CMceAudioStream* audioStream = CMceAudioStream::NewLC(); + + audioStream->InitializeL( iClipSession->iManager ); + + EUNIT_ASSERT( audioStream->Codecs().Count() == 2 ) + + iClipSession->AddAmrCodecL( *audioStream ); + + EUNIT_ASSERT( audioStream->Codecs().Count() == 1 ) + EUNIT_ASSERT( audioStream->Codecs()[0]->SdpName() == KMceSDPNameAMR() ) + EUNIT_ASSERT( audioStream->Codecs()[0]->AllowedBitrates() == + KMceAllowedAmrNbBitrate475 ) + EUNIT_ASSERT( audioStream->Codecs()[0]->Bitrate() == + KMceAmrNbBitrate475 ) + + // Check that function leaves if there is no AMR codec + + iClipSession->iManager->iSupportedAudioCodecs.ResetAndDestroy(); + + EUNIT_ASSERT_SPECIFIC_LEAVE( iClipSession->AddAmrCodecL( *audioStream ), + KErrNotFound ) + + CleanupStack::PopAndDestroy( audioStream ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngClipSession::UT_AddVideoCodecLL() + { + // Check that all the codecs are replaced with H263 codec if other end + // does not support H264 + // + delete iClipSession->iVideoCodecList; + iClipSession->iVideoCodecList = NULL; + iClipSession->iVideoCodecList = KMceSDPNameH263().AllocL(); + + CMceVideoStream* videoStream = CMceVideoStream::NewLC(); + + videoStream->InitializeL( iClipSession->iManager ); + + EUNIT_ASSERT( videoStream->Codecs().Count() > 1 ) + + iClipSession->AddVideoCodecL( *videoStream ); + + EUNIT_ASSERT( videoStream->Codecs().Count() == 1 ) + EUNIT_ASSERT( videoStream->Codecs()[0]->SdpName() == KMceSDPNameH2632000() ) + + // Check that all codecs are replaced with H264 codec if other end + // supports it + // + _LIT8( KMusTestCodecListDelim, ";" ); + delete iClipSession->iVideoCodecList; + iClipSession->iVideoCodecList = NULL; + iClipSession->iVideoCodecList = + HBufC8::NewL( KMceSDPNameH263().Length() + + KMceSDPNameH264().Length() + + KMusTestCodecListDelim().Length() ); + iClipSession->iVideoCodecList->Des().Copy( KMceSDPNameH263() ); + iClipSession->iVideoCodecList->Des().Append( KMusTestCodecListDelim() ); + iClipSession->iVideoCodecList->Des().Append( KMceSDPNameH264() ); + iClipSession->AddVideoCodecL( *videoStream ); + + EUNIT_ASSERT( videoStream->Codecs().Count() == 1 ) + EUNIT_ASSERT( videoStream->Codecs()[0]->SdpName() == KMceSDPNameH264() ) + + // Check that function leaves if there is no H264 codec + // + iClipSession->iManager->iSupportedVideoCodecs.ResetAndDestroy(); + + EUNIT_ASSERT_SPECIFIC_LEAVE( iClipSession->AddVideoCodecL( *videoStream ), + KErrNotFound ) + + CleanupStack::PopAndDestroy( videoStream ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngClipSession::UT_ConstructAudioStructureLL() + { + + CMceStreamBundle* localBundle = + CMceStreamBundle::NewLC( CMceStreamBundle::ELS ); + + // Check that audio structure cannot be constructed before + // creating the session + EUNIT_ASSERT_SPECIFIC_LEAVE( + iClipSession->ConstructAudioStructureL( *localBundle ), + KErrNotReady ) + + // Try without a file source + + CSIPProfile* profile = iClipSession->iSipProfileHandler->Profile(); + + iClipSession->iSession = CMceOutSession::NewL( + *(iClipSession->iManager), + *profile, + KTestRecipientSipUri8() ); + + EUNIT_ASSERT_SPECIFIC_LEAVE( + iClipSession->ConstructAudioStructureL( *localBundle ), + KErrNotFound ) + + // Normal case + + CMceVideoStream* videoOut = CMceVideoStream::NewLC(); + + videoOut->AddSinkL( CMceRtpSink::NewLC() ); + CleanupStack::Pop(); + + videoOut->SetSourceL( CMceFileSource::NewLC( + *iClipSession->iManager, + iClipSession->LocalVideoPlayer()->LcSourceFileControl()->LcFileName() ) ); + CleanupStack::Pop(); + + iClipSession->iSession->AddStreamL( videoOut ); + CleanupStack::Pop( videoOut ); + + iClipSession->ConstructAudioStructureL( *localBundle ); + + EUNIT_ASSERT( iClipSession->iSession->Streams().Count() == 3 ) + EUNIT_ASSERT( iClipSession->iSession->Streams()[1]->Type() == KMceAudio ) + EUNIT_ASSERT( iClipSession->iSession->Streams()[2]->Type() == KMceAudio ) + EUNIT_ASSERT( iClipSession->iSession->Streams()[1]->Source() == + videoOut->Source() ) + EUNIT_ASSERT( iClipSession->iSession->Streams()[2]->Source() == + videoOut->Source() ) + EUNIT_ASSERT( iClipSession->iSession->Streams()[1]->Sinks().Count() == 1 ) + EUNIT_ASSERT( iClipSession->iSession->Streams()[2]->Sinks().Count() == 1 ) + EUNIT_ASSERT( iClipSession->iSession->Streams()[1]->Sinks()[0]->Type() == + KMceRTPSink ) + EUNIT_ASSERT( iClipSession->iSession->Streams()[2]->Sinks()[0]->Type() == + KMceSpeakerSink ) + + // Check that only stream with speaker has been added to a bundle + EUNIT_ASSERT( localBundle->Streams().Count() == 1 ) + EUNIT_ASSERT( localBundle->Streams()[0]->Type() == KMceAudio ) + EUNIT_ASSERT( localBundle->Streams()[0]->Sinks().Count() == 1 ) + EUNIT_ASSERT( localBundle->Streams()[0]->Sinks()[0]->Type() == + KMceSpeakerSink ) + + CleanupStack::PopAndDestroy( localBundle ); + } + + +// ----------------------------------------------------------------------------- +// Check that audio is not constructed in operator variant +// ----------------------------------------------------------------------------- +// +void UT_CMusEngClipSession::UT_ConstructAudioStructureL_OperatorVariantL() + { + iClipSession->iOperatorVariant = ETrue; + CSIPProfile* profile = iClipSession->iSipProfileHandler->Profile(); + delete profile->iArray; + profile->iArray = NULL; + profile->iArray = new ( ELeave ) CDesC8ArrayFlat( 1 ); + profile->iArray->AppendL( KMusSipUri ); + + // Establish session, ConstructAudioStructureL gets called + ESTABLISH_OUT_SESSION( iClipSession ); + + // Check that only two video streams has been constructed + EUNIT_ASSERT_EQUALS( iClipSession->iSession->Streams().Count(), 2 ) + EUNIT_ASSERT_EQUALS( iClipSession->iSession->Streams()[0]->Type(), + KMceVideo ) + EUNIT_ASSERT_EQUALS( iClipSession->iSession->Streams()[1]->Type(), + KMceVideo ) + + // Check that no bundles has been constructed + EUNIT_ASSERT_EQUALS( iClipSession->iSession->Bundles().Count(), 0 ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngClipSession::UT_EstablishSessionLL() + { + iClipSession->LocalVideoPlayer()->LcSourceFileControl()->SetLcFileNameL( + KTestAvcVideoFileName() ); + + // Try to establish, must fail, because of missing session + TRAPD( error, iClipSession->EstablishSessionL() ); + MUS_TEST_FORWARD_ALLOC_FAILURE( error ); + EUNIT_ASSERT( error == KErrNotReady ); + + EUNIT_ASSERT( iClipSession->iVideoCodecList ); + + /////// + // 1.Test that in case the peer party supports H264, no transcoding is needed + + // Call to CMusEngOutMceSession::InviteL leads to call to EstablishL + iClipSession->EstablishLcSessionL(); + + const RPointerArray& streams = iClipSession->iSession->Streams(); + + for ( TInt i = 0; i < streams.Count(); ++i ) + { + if ( streams[i]->Type() == KMceVideo ) + { + + CMceVideoStream* videoStream = static_cast( streams[i] ); + const RPointerArray codecs = videoStream->Codecs(); + EUNIT_ASSERT_EQUALS( codecs.Count(), 1 ) + EUNIT_ASSERT( codecs[0]->SdpName().FindF( KMceSDPNameH264() ) >= 0 ) + + } + } + + /////// + // 2.Test the case when we don't know whether peer supports H264, + // transcoding is needed => function will leave with KErrNotSupported + + delete iClipSession->iSession; + iClipSession->iSession = NULL; + + delete iClipSession->iVideoCodecList; + iClipSession->iVideoCodecList = NULL; + + MUSENG_EUNIT_ASSERT_SPECIFIC_LEAVE( + iClipSession->EstablishLcSessionL(), + KErrNotSupported ) + + + /////// + // 3.Test that if peer doesn't supports H264, transcoding is needed + // => function will leave with KErrNotSupported + + delete iClipSession->iSession; + iClipSession->iSession = NULL; + + iClipSession->iVideoCodecList = KMceSDPNameH263().AllocL(); + + MUSENG_EUNIT_ASSERT_SPECIFIC_LEAVE( + iClipSession->EstablishLcSessionL(), + KErrNotSupported ) + } + + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusEngClipSession, + "UT_CMusEngClipSesssion", + "UNIT" ) + +EUNIT_TEST( + "NewL - test ", + "CMusEngClipSession", + "NewL", + "FUNCTIONALITY", + SetupL, UT_NewLL, Teardown) + +EUNIT_TEST( + "CompleteSessionStructureL - test ", + "CMusEngClipSession", + "CompleteSessionStructureL", + "FUNCTIONALITY", + SetupL, UT_CompleteSessionStructureLL, Teardown) + +EUNIT_TEST( + "StreamStateChangedL() - test ", + "CMusEngClipSession", + "StreamStateChangedL()", + "FUNCTIONALITY", + SetupL, UT_StreamStateChangedL, Teardown) + +EUNIT_TEST( + "StreamStateChangedL( source ) - test ", + "CMusEngClipSession", + "StreamStateChangedL( source )", + "FUNCTIONALITY", + SetupL, UT_StreamStateChangedWithSourceL, Teardown) + +EUNIT_TEST( + "StreamStateChangedL( sink ) - test ", + "CMusEngClipSession", + "StreamStateChangedL( sink )", + "FUNCTIONALITY", + SetupL, UT_StreamStateChangedWithSinkL, Teardown) + +EUNIT_TEST( + "AddAmrCodecL - test ", + "CMusEngClipSession", + "AddAmrCodecL", + "FUNCTIONALITY", + SetupL, UT_AddAmrCodecLL, Teardown) + +EUNIT_TEST( + "AddVideoCodecL - test ", + "CMusEngClipSession", + "AddVideoCodecL", + "FUNCTIONALITY", + SetupL, UT_AddVideoCodecLL, Teardown) + +EUNIT_TEST( + "ConstructAudioStructureL - test ", + "CMusEngClipSession", + "ConstructAudioStructureL", + "FUNCTIONALITY", + SetupL, UT_ConstructAudioStructureLL, Teardown) + +EUNIT_TEST( + "ConstructAudioStructureL - test operator specific behavior ", + "CMusEngClipSession", + "ConstructAudioStructureL", + "FUNCTIONALITY", + SetupL, UT_ConstructAudioStructureL_OperatorVariantL, Teardown) + +EUNIT_TEST( + "EstablishSessionL - test ", + "CMusEngClipSession", + "EstablishSessionL", + "FUNCTIONALITY", + SetupL, UT_EstablishSessionLL, Teardown) + + +EUNIT_END_TEST_TABLE + +// END OF FILE + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/tsrc/ut_engine/src/ut_musengclipvideoplayer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/tsrc/ut_engine/src/ut_musengclipvideoplayer.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,805 @@ +/* +* 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: +* +*/ + + +// INTERNAL INCLUDES +#include "ut_musengclipvideoplayer.h" +#include "musengtestdefs.h" +#include "musengmceutils.h" +#include "musengclipvideoplayer.h" +#include "mceoutsession.h" +#include "mcevideostream.h" +#include "mcertpsink.h" +#include "mcefilesource.h" +#include "drmcommon.h" + +// SYSTEM INCLUDES +#include + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusEngClipVideoPlayer* UT_CMusEngClipVideoPlayer::NewL() + { + UT_CMusEngClipVideoPlayer* self = UT_CMusEngClipVideoPlayer::NewLC(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusEngClipVideoPlayer* UT_CMusEngClipVideoPlayer::NewLC() + { + UT_CMusEngClipVideoPlayer* self = new( ELeave ) UT_CMusEngClipVideoPlayer(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusEngClipVideoPlayer::~UT_CMusEngClipVideoPlayer() + { + // NOP + } + +// ----------------------------------------------------------------------------- +// Default constructor +// ----------------------------------------------------------------------------- +// +UT_CMusEngClipVideoPlayer::UT_CMusEngClipVideoPlayer() + { + // NOP + } + +// ----------------------------------------------------------------------------- +// Second phase construct +// ----------------------------------------------------------------------------- +// +void UT_CMusEngClipVideoPlayer::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngClipVideoPlayer::SetupL() + { + iMceSession = CMceOutSession::NewL(); + CMceVideoStream* videoStream = CMceVideoStream::NewLC(); + CMceRtpSink* rtpsink = CMceRtpSink::NewLC(); + videoStream->AddSinkL( rtpsink ); + CleanupStack::Pop( rtpsink ); + CMceFileSource* fileSource = + CMceFileSource::NewLC( *iMceSession->iManager, KTestVideoFileName() ); + fileSource->DisableL(); + videoStream->SetSourceL( fileSource ); + CleanupStack::Pop( fileSource ); + iMceSession->AddStreamL( videoStream ); + CleanupStack::Pop( videoStream ); + iClipVideoPlayer = + CMusEngClipVideoPlayer::NewL( + iDisplayHandlerStub, + iLcAudioControlStub ); + iClipVideoPlayer->SetMceSession( iMceSession ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngClipVideoPlayer::Teardown() + { + delete iClipVideoPlayer; + delete iMceSession; + iLcAudioControlStub.Reset(); + } + + +// TEST CASES + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngClipVideoPlayer::UT_HasClipEndedL() + { + CMceSession* invalidMceSession = CMceOutSession::NewL(); + CleanupStack::PushL( invalidMceSession ); + + // Try before establishing the session + iClipVideoPlayer->SetMceSession( NULL ); + EUNIT_ASSERT( !iClipVideoPlayer->HasClipEnded() ) + + // Try with session, but without video out stream + iClipVideoPlayer->SetMceSession( invalidMceSession ); + EUNIT_ASSERT( !iClipVideoPlayer->HasClipEnded() ) + + // Try with video out stream without source... + CMceVideoStream* videoStream = CMceVideoStream::NewLC(); + videoStream->AddSinkL( CMceRtpSink::NewLC() ); + CleanupStack::Pop(); + invalidMceSession->AddStreamL( videoStream ); + CleanupStack::Pop( videoStream ); + EUNIT_ASSERT( !iClipVideoPlayer->HasClipEnded() ) + + // And with enabled source and stream + CMceFileSource* fileSource = + CMceFileSource::NewLC( + *invalidMceSession->iManager, KTestVideoFileName() ); + videoStream->SetSourceL( fileSource ); + CleanupStack::Pop( fileSource ); + EUNIT_ASSERT( !iClipVideoPlayer->HasClipEnded() ) + + // try with different position and duration + fileSource->iPosition = 90; + fileSource->iDuration = 111; + EUNIT_ASSERT( !iClipVideoPlayer->HasClipEnded() ) + + // Disabled source + fileSource->DisableL(); + EUNIT_ASSERT( !iClipVideoPlayer->HasClipEnded() ) + + // Disabled stream + videoStream->iState = CMceMediaStream::EDisabled; + EUNIT_ASSERT( !iClipVideoPlayer->HasClipEnded() ) + + // and finaly try with "real" end of clip + fileSource->iPosition = 0; + fileSource->iDuration = 111; + + EUNIT_ASSERT( iClipVideoPlayer->HasClipEnded() ) + + CleanupStack::PopAndDestroy( invalidMceSession ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngClipVideoPlayer::UT_LcVideoPlayerStateL() + { + // iMceSession not set + iClipVideoPlayer->SetMceSession( NULL ); + EUNIT_ASSERT_EQUALS( TInt( MLcVideoPlayer::EUnavailable ), + TInt( iClipVideoPlayer->LcVideoPlayerState() ) ) + iClipVideoPlayer->SetMceSession( iMceSession ); + + // Establish Session and simulate media playing. + iMceSession->iState = CMceSession::EEstablished; + for ( TInt i = 0; i < iMceSession->Streams().Count(); i++ ) + { + iMceSession->Streams()[i]->iState = CMceMediaStream::EStreaming; + } + + EUNIT_ASSERT_EQUALS( TInt( MLcVideoPlayer::EPlaying ), + TInt( iClipVideoPlayer->LcVideoPlayerState() ) ) + + // Media streams unavailable + iMceSession->Streams()[0]->iState = CMceMediaStream::EUninitialized; + EUNIT_ASSERT_EQUALS( TInt( MLcVideoPlayer::EUnavailable ), + TInt( iClipVideoPlayer->LcVideoPlayerState() ) ) + + // All other stream states + iMceSession->Streams()[0]->iState = CMceMediaStream::EInitialized; + EUNIT_ASSERT_EQUALS( TInt( MLcVideoPlayer::EInit ), + TInt( iClipVideoPlayer->LcVideoPlayerState() ) ) + + iMceSession->Streams()[0]->iState = CMceMediaStream::EBuffering; + EUNIT_ASSERT_EQUALS( TInt( MLcVideoPlayer::EBuffering ), + TInt( iClipVideoPlayer->LcVideoPlayerState() ) ) + + iMceSession->Streams()[0]->iState = CMceMediaStream::EIdle; + EUNIT_ASSERT_EQUALS( TInt( MLcVideoPlayer::EPaused ), + TInt( iClipVideoPlayer->LcVideoPlayerState() ) ) + + iMceSession->Streams()[0]->iState = CMceMediaStream::EDisabled; + EUNIT_ASSERT_EQUALS( TInt( MLcVideoPlayer::EPaused ), + TInt( iClipVideoPlayer->LcVideoPlayerState() ) ) + + iMceSession->Streams()[0]->iState = CMceMediaStream::EStreaming; + EUNIT_ASSERT_EQUALS( TInt( MLcVideoPlayer::EPlaying ), + TInt( iClipVideoPlayer->LcVideoPlayerState() ) ) + + iMceSession->Streams()[0]->iState = CMceMediaStream::ENoResources; + EUNIT_ASSERT_EQUALS( TInt( MLcVideoPlayer::EUnavailable ), + TInt( iClipVideoPlayer->LcVideoPlayerState() ) ) + + iMceSession->Streams()[0]->iState = CMceMediaStream::ETranscodingRequired; + EUNIT_ASSERT_EQUALS( TInt( MLcVideoPlayer::EUnavailable ), + TInt( iClipVideoPlayer->LcVideoPlayerState() ) ) + + iMceSession->Streams()[0]->iState = CMceMediaStream::ETranscoding; + EUNIT_ASSERT_EQUALS( TInt( MLcVideoPlayer::EUnavailable ), + TInt( iClipVideoPlayer->LcVideoPlayerState() ) ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngClipVideoPlayer::UT_LcPlayL() + { + // MCE session not set + iClipVideoPlayer->SetMceSession( NULL ); + EUNIT_ASSERT_SPECIFIC_LEAVE( iClipVideoPlayer->LcPlayL(), KErrNotReady ) + + // File source does not exist + iClipVideoPlayer->SetMceSession( iMceSession ); + iMceSession->Streams()[ 0 ]->SetSourceL( NULL ); + EUNIT_ASSERT_SPECIFIC_LEAVE( iClipVideoPlayer->LcPlayL(), KErrNotFound ) + + // Play + CMceFileSource* fileSource = + CMceFileSource::NewLC( *iMceSession->iManager, KTestVideoFileName() ); + fileSource->DisableL(); + iMceSession->Streams()[ 0 ]->SetSourceL( fileSource ); + CleanupStack::Pop( fileSource ); + EUNIT_ASSERT( !iClipVideoPlayer->LcIsPlayingL() ) + iClipVideoPlayer->LcPlayL(); + EUNIT_ASSERT( iClipVideoPlayer->LcIsPlayingL() ) + + // Try to play again + iClipVideoPlayer->LcPlayL(); + EUNIT_ASSERT( iClipVideoPlayer->LcIsPlayingL() ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngClipVideoPlayer::UT_LcPauseL() + { + // MCE session not set + iClipVideoPlayer->SetMceSession( NULL ); + EUNIT_ASSERT_SPECIFIC_LEAVE( iClipVideoPlayer->LcPauseL(), KErrNotReady ) + + // File source does not exist + iClipVideoPlayer->SetMceSession( iMceSession ); + iMceSession->Streams()[ 0 ]->SetSourceL( NULL ); + EUNIT_ASSERT_SPECIFIC_LEAVE( iClipVideoPlayer->LcPauseL(), KErrNotFound ) + + // Pause + CMceFileSource* fileSource = + CMceFileSource::NewLC( *iMceSession->iManager, KTestVideoFileName() ); + fileSource->EnableL(); + iMceSession->Streams()[ 0 ]->SetSourceL( fileSource ); + CleanupStack::Pop( fileSource ); + EUNIT_ASSERT( iClipVideoPlayer->LcIsPlayingL() ) + iClipVideoPlayer->LcPauseL(); + EUNIT_ASSERT( !iClipVideoPlayer->LcIsPlayingL() ) + + // Try to pause already paused clip + iClipVideoPlayer->LcPauseL(); + EUNIT_ASSERT( !iClipVideoPlayer->LcIsPlayingL() ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngClipVideoPlayer::UT_LcIsPlayingL() + { + // MCE session not set + iClipVideoPlayer->SetMceSession( NULL ); + EUNIT_ASSERT_SPECIFIC_LEAVE( iClipVideoPlayer->LcIsPlayingL(), KErrNotReady ) + + // Player is not playing when file source is disabled + iClipVideoPlayer->SetMceSession( iMceSession ); + CMceFileSource* file = MusEngMceUtils::GetFileSourceL( *iMceSession ); + file->DisableL(); + EUNIT_ASSERT( !iClipVideoPlayer->LcIsPlayingL() ) + + // Player is playing when file source is enabled + file->EnableL(); + EUNIT_ASSERT( iClipVideoPlayer->LcIsPlayingL() ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngClipVideoPlayer::UT_SetLcFileNameL() + { + // Set file before iMceSession is set + CMceFileSource* file = MusEngMceUtils::GetFileSourceL( *iMceSession ); + iClipVideoPlayer->SetMceSession( NULL ); + iClipVideoPlayer->SetLcFileNameL( KTestAvcVideoFileName() ); + EUNIT_ASSERT_EQUALS( iClipVideoPlayer->LcFileName(), KTestAvcVideoFileName() ) + EUNIT_ASSERT_EQUALS( file->iFileName, KTestVideoFileName() ) + + // Set file after session is set + iClipVideoPlayer->SetMceSession( iMceSession ); + file->iFileName = KTestAvcVideoFileName(); + iClipVideoPlayer->SetLcFileNameL( KTestVideoFileName() ); + EUNIT_ASSERT_EQUALS( iClipVideoPlayer->LcFileName(), KTestVideoFileName() ) + EUNIT_ASSERT_EQUALS( file->iFileName, KTestVideoFileName() ) + + // Set DRM protected file, file names not changed + MUSENG_EUNIT_ASSERT_SPECIFIC_LEAVE( + iClipVideoPlayer->SetLcFileNameL( KMusDrmProtectedFileName() ), + KErrPermissionDenied ) + EUNIT_ASSERT_EQUALS( iClipVideoPlayer->LcFileName(), KTestVideoFileName() ) + EUNIT_ASSERT_EQUALS( file->iFileName, KTestVideoFileName() ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngClipVideoPlayer::UT_LcFastForwardL() + { + // Try before establishment + iClipVideoPlayer->SetMceSession( NULL ); + EUNIT_ASSERT_SPECIFIC_LEAVE( + iClipVideoPlayer->LcFastForwardL( ETrue ), KErrNotReady ) + + // Establish session, simulate position and duration and try again + iClipVideoPlayer->SetMceSession( iMceSession ); + CMceFileSource* file = MusEngMceUtils::GetFileSourceL( *iMceSession ); + file->iDuration = KMusEngTestFileDuration; + file->iPosition = KMusEngTestFilePosition; + iClipVideoPlayer->LcFastForwardL( ETrue ); + EUNIT_ASSERT( !file->iIsEnabled ) + EUNIT_ASSERT( iClipVideoPlayer->iFFWDStartTime.Int64() > 0 ) + EUNIT_ASSERT( iClipVideoPlayer->iFRWDStartTime.Int64() == 0 ) + + // Simulate fastforwarding for a while + User::After( 1000 ); + + // Try to fastforward when already fastforwarding, will be ignored + iClipVideoPlayer->LcFastForwardL( ETrue ); + EUNIT_ASSERT( !file->iIsEnabled ) + EUNIT_ASSERT( iClipVideoPlayer->iFFWDStartTime.Int64() > 0 ) + EUNIT_ASSERT( iClipVideoPlayer->iFRWDStartTime.Int64() == 0 ) + + // Stop fastforwarding + iClipVideoPlayer->LcFastForwardL( EFalse ); + EUNIT_ASSERT( file->iPosition > KMusEngTestFilePosition ) + EUNIT_ASSERT( file->iPosition != file->iDuration ) + EUNIT_ASSERT( !file->iIsEnabled ) + EUNIT_ASSERT( iClipVideoPlayer->iFFWDStartTime.Int64() == 0 ) + EUNIT_ASSERT( iClipVideoPlayer->iFRWDStartTime.Int64() == 0 ) + + // Try to stop fastforwarding again, leaves + EUNIT_ASSERT_SPECIFIC_LEAVE( + iClipVideoPlayer->LcFastForwardL( EFalse ), KErrAlreadyExists ) + + // Start fastrewinding + iClipVideoPlayer->LcFastRewindL( ETrue ); + EUNIT_ASSERT( !file->iIsEnabled ) + EUNIT_ASSERT( iClipVideoPlayer->iFFWDStartTime.Int64() == 0 ) + EUNIT_ASSERT( iClipVideoPlayer->iFRWDStartTime.Int64() > 0 ) + + // Start fastforwarding, rewinding should be stopped and FFWD started + iClipVideoPlayer->LcFastForwardL( ETrue ); + EUNIT_ASSERT( !file->iIsEnabled ) + EUNIT_ASSERT( iClipVideoPlayer->iFFWDStartTime.Int64() > 0 ) + EUNIT_ASSERT( iClipVideoPlayer->iFRWDStartTime.Int64() == 0 ) + + // Simulate fastforwarding for a while + User::After( 1000 ); + + // Simulate that clip is almost in end and fastforwarding would have + // continued over end, position should be set to duration. + file->iPosition = TTimeIntervalMicroSeconds( file->iDuration.Int64() - 1 ); + iClipVideoPlayer->LcFastForwardL( EFalse ); + EUNIT_ASSERT( file->iPosition == file->iDuration ) + EUNIT_ASSERT( !file->iIsEnabled ) + EUNIT_ASSERT_EQUALS( 0, iClipVideoPlayer->iFFWDStartTime.Int64() ) + EUNIT_ASSERT_EQUALS( 0, iClipVideoPlayer->iFRWDStartTime.Int64() ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngClipVideoPlayer::UT_LcFastRewindL() + { + // Try before establishment + iClipVideoPlayer->SetMceSession( NULL ); + EUNIT_ASSERT_SPECIFIC_LEAVE( + iClipVideoPlayer->LcFastRewindL( ETrue ), KErrNotReady ) + + // Establish session, simulate position and duration and try again + iClipVideoPlayer->SetMceSession( iMceSession ); + CMceFileSource* file = MusEngMceUtils::GetFileSourceL( *iMceSession ); + file->iDuration = KMusEngTestFileDuration; + file->iPosition = KMusEngTestFilePosition; + iClipVideoPlayer->LcFastRewindL( ETrue ); + EUNIT_ASSERT( !file->iIsEnabled ) + EUNIT_ASSERT( iClipVideoPlayer->iFFWDStartTime.Int64() == 0 ) + EUNIT_ASSERT( iClipVideoPlayer->iFRWDStartTime.Int64() > 0 ) + + // Simulate fastrewinding for a while + User::After( 1000 ); + + // Try to fastrewind when already fastrewinding, will be ignored + iClipVideoPlayer->LcFastRewindL( ETrue ); + EUNIT_ASSERT( !file->iIsEnabled ) + EUNIT_ASSERT( iClipVideoPlayer->iFFWDStartTime.Int64() == 0 ) + EUNIT_ASSERT( iClipVideoPlayer->iFRWDStartTime.Int64() > 0 ) + + // Stop fastrewinding + iClipVideoPlayer->LcFastRewindL( EFalse ); + EUNIT_ASSERT( file->iPosition < KMusEngTestFilePosition ) + EUNIT_ASSERT( file->iPosition != TTimeIntervalMicroSeconds( 0 ) ) + EUNIT_ASSERT( !file->iIsEnabled ) + EUNIT_ASSERT( iClipVideoPlayer->iFFWDStartTime.Int64() == 0 ) + EUNIT_ASSERT( iClipVideoPlayer->iFRWDStartTime.Int64() == 0 ) + + // Try to stop fastrewinding again, leaves + EUNIT_ASSERT_SPECIFIC_LEAVE( + iClipVideoPlayer->LcFastRewindL( EFalse ), KErrAlreadyExists ) + + // Start fastforwarding + iClipVideoPlayer->LcFastForwardL( ETrue ); + EUNIT_ASSERT( !file->iIsEnabled ) + EUNIT_ASSERT( iClipVideoPlayer->iFFWDStartTime.Int64() >= 0 ) + EUNIT_ASSERT( iClipVideoPlayer->iFRWDStartTime.Int64() == 0 ) + + // Start fastrewinding, forwarding should be stopped and FFWD started + iClipVideoPlayer->LcFastRewindL( ETrue ); + EUNIT_ASSERT( !file->iIsEnabled ); + EUNIT_ASSERT( iClipVideoPlayer->iFFWDStartTime.Int64() == 0 ) + EUNIT_ASSERT( iClipVideoPlayer->iFRWDStartTime.Int64() >= 0 ) + + // Simulate that clip has just begun and fastrewinding would have + // continued over beginning, position should be set to zero. + + file->iPosition = TTimeIntervalMicroSeconds( 1 ); + + // Simulate fastrewinding for a while + User::After( 1000 ); + + iClipVideoPlayer->LcFastRewindL( EFalse ); + EUNIT_ASSERT( file->iPosition == TTimeIntervalMicroSeconds( 0 ) ) + EUNIT_ASSERT( !file->iIsEnabled ) + EUNIT_ASSERT( iClipVideoPlayer->iFFWDStartTime.Int64() == 0 ) + EUNIT_ASSERT( iClipVideoPlayer->iFRWDStartTime.Int64() == 0 ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngClipVideoPlayer::UT_LcFilePositionL() + { + // Try before establishment + iClipVideoPlayer->SetMceSession( NULL ); + EUNIT_ASSERT_SPECIFIC_LEAVE( + iClipVideoPlayer->LcFilePositionL(), KErrNotReady ) + + // Establish session and try again + iClipVideoPlayer->SetMceSession( iMceSession ); + CMceFileSource* file = MusEngMceUtils::GetFileSourceL( *iMceSession ); + file->iPosition = 2000000; + EUNIT_ASSERT( iClipVideoPlayer->LcFilePositionL().Int() * 1000000 == + file->iPosition.Int64() ) + + // Ask position while fastforwarding, it should be bigger than real position + iClipVideoPlayer->LcFastForwardL( ETrue ); + User::After( 1000000 ); // We have to wait since dividing in LcFilePositionL and + // multiplying before comparison loses difference + EUNIT_ASSERT( iClipVideoPlayer->LcFilePositionL().Int() * 1000000 > + file->iPosition.Int64() ) + + // Ask position while fastforwarding beyond end of clip, clip duration is + // returned + file->iPosition = file->iDuration; + EUNIT_ASSERT( iClipVideoPlayer->LcFilePositionL().Int() * 1000000 == + file->iDuration.Int64() ) + + // Stop fastforwarding, start fastrewinding, position is set to the end clip + iClipVideoPlayer->LcFastForwardL( EFalse ); + iClipVideoPlayer->LcFastRewindL( ETrue ); + User::After( 1000000 ); // We have to wait since dividing in LcFilePositionL and + // multiplying before comparison loses difference + + // Ask position while fastrewinding, it should be smaller than real + // position + EUNIT_ASSERT( iClipVideoPlayer->LcFilePositionL().Int() * 1000000 < + file->iPosition.Int64() ) + + // Ask position while fastrewinding beyond the beginning of clip, zero + // returned + file->iPosition = 0; + EUNIT_ASSERT( iClipVideoPlayer->LcFilePositionL().Int() * 1000000 == 0 ) + + // Asking position when rewinded to beginning but rewinding has ended + // and clip has not ended (position should not be altered in that case) + iClipVideoPlayer->iRewindedToBeginning = ETrue; + file->iPosition = 0; + iClipVideoPlayer->iFRWDStartTime = TTime( 0 ); + EUNIT_ASSERT( iClipVideoPlayer->LcFilePositionL().Int() * 1000000 == 0 ) + + // Position has proceeded from beginning, rewinding to beginning info + // is cleared. + file->iPosition = 10000000; + iClipVideoPlayer->iFRWDStartTime = TTime( 0 ); + EUNIT_ASSERT( iClipVideoPlayer->LcFilePositionL().Int() * 1000000 == 10000000 ) + EUNIT_ASSERT( iClipVideoPlayer->iRewindedToBeginning == EFalse ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngClipVideoPlayer::UT_LcFileDurationL() + { + // Try before establishment + iClipVideoPlayer->SetMceSession( NULL ); + EUNIT_ASSERT_SPECIFIC_LEAVE( + iClipVideoPlayer->LcFileDurationL(), KErrNotReady ) + + // Establish session and try again + iClipVideoPlayer->SetMceSession( iMceSession ); + CMceFileSource* file = MusEngMceUtils::GetFileSourceL( *iMceSession ); + file->iDuration = 2000000; + EUNIT_ASSERT( iClipVideoPlayer->LcFileDurationL().Int() * 1000000 == + file->iDuration.Int64() ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngClipVideoPlayer::UT_SetLcFilePositionL() + { + TTimeIntervalSeconds time( 20 ); + + // Try before establishment + iClipVideoPlayer->SetMceSession( NULL ); + EUNIT_ASSERT_SPECIFIC_LEAVE( + iClipVideoPlayer->SetLcFilePositionL( time ), KErrNotReady ) + + // Normal case with already disabled file source + iClipVideoPlayer->SetMceSession( iMceSession ); + CMceFileSource* file = MusEngMceUtils::GetFileSourceL( *iMceSession ); + file->iIsEnabled = EFalse; + iClipVideoPlayer->SetLcFilePositionL( time ); + EUNIT_ASSERT( file->iPosition.Int64() == + static_cast< TInt64 >( time.Int() ) * 1000000 ) + EUNIT_ASSERT( !file->iIsEnabled ) + + // Normal case with enabled file source + TTimeIntervalSeconds anotherTime( 30 ); + file->iIsEnabled = ETrue; + iClipVideoPlayer->SetLcFilePositionL( anotherTime ); + EUNIT_ASSERT( file->iPosition.Int64() == + static_cast< TInt64 >( anotherTime.Int() ) * 1000000 ) + EUNIT_ASSERT( file->iIsEnabled ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngClipVideoPlayer::UT_LcWindowL() + { + EUNIT_ASSERT( iClipVideoPlayer->LcWindow() == iClipVideoPlayer ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngClipVideoPlayer::UT_LcCameraControlL() + { + EUNIT_ASSERT( iClipVideoPlayer->LcCameraControl() == NULL ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngClipVideoPlayer::UT_LcSourceFileControlL() + { + EUNIT_ASSERT( iClipVideoPlayer->LcSourceFileControl() == iClipVideoPlayer ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngClipVideoPlayer::UT_LcDestinationFileControlL() + { + EUNIT_ASSERT( iClipVideoPlayer->LcDestinationFileControl() == NULL ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngClipVideoPlayer::UT_LcAudioControlL() + { + EUNIT_ASSERT( iClipVideoPlayer->LcAudioControl() == &iLcAudioControlStub ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngClipVideoPlayer::UT_LcZoomControlL() + { + EUNIT_ASSERT( iClipVideoPlayer->LcZoomControl() == NULL ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngClipVideoPlayer::UT_LcBrightnessControlL() + { + EUNIT_ASSERT( iClipVideoPlayer->LcBrightnessControl() == NULL ) + } + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusEngClipVideoPlayer, + "UT_CMusEngClipVideoPlayer", + "UNIT" ) + +EUNIT_TEST( + "HasClipEnded - test ", + "CMusEngClipVideoPlayer", + "HasClipEnded", + "FUNCTIONALITY", + SetupL, UT_HasClipEndedL, Teardown) + +EUNIT_TEST( + "LcVideoPlayerState - test ", + "CMusEngClipVideoPlayer", + "LcVideoPlayerState", + "FUNCTIONALITY", + SetupL, UT_LcVideoPlayerStateL, Teardown) + +EUNIT_TEST( + "LcPlayL - test ", + "CMusEngClipVideoPlayer", + "LcPlayL", + "FUNCTIONALITY", + SetupL, UT_LcPlayL, Teardown) + +EUNIT_TEST( + "LcPauseL - test ", + "CMusEngClipVideoPlayer", + "LcPauseL", + "FUNCTIONALITY", + SetupL, UT_LcPauseL, Teardown) + +EUNIT_TEST( + "LcIsPlayingL - test ", + "CMusEngClipVideoPlayer", + "LcIsPlayingL", + "FUNCTIONALITY", + SetupL, UT_LcIsPlayingL, Teardown) + +EUNIT_TEST( + "SetLcFileNameL - test ", + "CMusEngClipVideoPlayer", + "SetLcFileNameL", + "FUNCTIONALITY", + SetupL, UT_SetLcFileNameL, Teardown) + +EUNIT_TEST( + "LcFastForwardL - test ", + "CMusEngClipVideoPlayer", + "LcFastForwardL", + "FUNCTIONALITY", + SetupL, UT_LcFastForwardL, Teardown) + +EUNIT_TEST( + "LcFastRewindL - test ", + "CMusEngClipVideoPlayer", + "LcFastRewindL", + "FUNCTIONALITY", + SetupL, UT_LcFastRewindL, Teardown) + +EUNIT_TEST( + "LcFilePositionL - test ", + "CMusEngClipVideoPlayer", + "LcFilePositionL", + "FUNCTIONALITY", + SetupL, UT_LcFilePositionL, Teardown) + +EUNIT_TEST( + "LcFileDurationL - test ", + "CMusEngClipVideoPlayer", + "LcFileDurationL", + "FUNCTIONALITY", + SetupL, UT_LcFileDurationL, Teardown) + +EUNIT_TEST( + "SetLcFilePositionL - test ", + "CMusEngClipVideoPlayer", + "SetLcFilePositionL", + "FUNCTIONALITY", + SetupL, UT_SetLcFilePositionL, Teardown) + +EUNIT_TEST( + "LcWindow - test ", + "CMusEngClipVideoPlayer", + "LcWindow", + "FUNCTIONALITY", + SetupL, UT_LcWindowL, Teardown) + +EUNIT_TEST( + "LcCameraControl - test ", + "CMusEngClipVideoPlayer", + "LcCameraControl", + "FUNCTIONALITY", + SetupL, UT_LcCameraControlL, Teardown) + +EUNIT_TEST( + "LcSourceFileControl - test ", + "CMusEngClipVideoPlayer", + "LcSourceFileControl", + "FUNCTIONALITY", + SetupL, UT_LcSourceFileControlL, Teardown) + +EUNIT_TEST( + "LcDestinationFileControl - test ", + "CMusEngClipVideoPlayer", + "LcDestinationFileControl", + "FUNCTIONALITY", + SetupL, UT_LcDestinationFileControlL, Teardown) + +EUNIT_TEST( + "LcAudioControl - test ", + "CMusEngClipVideoPlayer", + "LcAudioControl", + "FUNCTIONALITY", + SetupL, UT_LcAudioControlL, Teardown) + +EUNIT_TEST( + "LcZoomControl - test ", + "CMusEngClipVideoPlayer", + "LcZoomControl", + "FUNCTIONALITY", + SetupL, UT_LcZoomControlL, Teardown) + +EUNIT_TEST( + "LcBrightnessControl - test ", + "CMusEngClipVideoPlayer", + "LcBrightnessControl", + "FUNCTIONALITY", + SetupL, UT_LcBrightnessControlL, Teardown) + +EUNIT_END_TEST_TABLE + +// END OF FILE + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/tsrc/ut_engine/src/ut_musenginedllmain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/tsrc/ut_engine/src/ut_musenginedllmain.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,108 @@ +/* +* 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: +* +*/ + +// USER INCLUDES +#include "ut_musengmcesession.h" +#include "ut_musengoutsession.h" +#include "ut_musenglivesession.h" +#include "ut_musengclipsession.h" +#include "ut_musengreceivesession.h" +#include "ut_musengsessiondurationtimer.h" +#include "ut_musengmceutils.h" +#include "ut_musengtelephoneutils.h" +#include "ut_musenguriparser.h" +#include "ut_musengsipprofilehandler.h" +#include "ut_musengsessionmanager.h" +#include "ut_musengtwowaysession.h" +#include "ut_musengtwowayrecvsession.h" +#include "ut_musengcamerahandler.h" +#include "ut_musenglivevideoplayer.h" +#include "ut_musengremotevideoplayer.h" +#include "ut_musengclipvideoplayer.h" +#include "ut_muspropertywatch.h" + + +// SYSTEM INCLUDES +#include + + +// ----------------------------------------------------------------------------- +// Test suite factory function. +// ----------------------------------------------------------------------------- +// +EXPORT_C MEUnitTest* CreateTestSuiteL() + { + CEUnitTestSuite* rootSuite = CEUnitTestSuite::NewLC( _L( "Mush Engine" ) ); + + rootSuite->AddL( UT_CMusEngClipVideoPlayer::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusEngSipProfileHandler::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusEngLiveVideoPlayer::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusEngRemoteVideoPlayer::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_MusEngMceUtils::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusEngSessionDurationTimer::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusEngMceSession::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusEngOutSession::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusEngLiveSession::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusEngReceiveSession::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusEngClipSession::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusEngTwoWaySession::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusEngTwoWayRecvSession::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_TMusEngCameraHandler::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusEngTelephoneUtils::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_TMusEngUriParser::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusEngSessionManager::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusPropertyWatch::NewLC() ); + CleanupStack::Pop(); + + CleanupStack::Pop( rootSuite ); + + return rootSuite; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/tsrc/ut_engine/src/ut_musenglivesession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/tsrc/ut_engine/src/ut_musenglivesession.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,775 @@ +/* +* 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: +* +*/ + + +// INTERNAL INCLUDES +#include "ut_musenglivesession.h" +#include "musengstubs.h" +#include "musengtestdefs.h" +#include "musenglivesession.h" +#include "mussipprofilehandler.h" +#include "musengmceutils.h" +#include "mussettings.h" +#include "mussessionproperties.h" +#include "musenglivevideoplayer.h" + +// SYSTEM INCLUDES +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +//use step in different time period +const TInt KZoomBigStepCount = 15; +const TInt KZoomSmallStepCount = KZoomBigStepCount*2; +const TInt KZoomStepMinSize = 1; + +// 0.4 second +const TInt64 KZoomFasterTime = 400000;//must bigger than 1/3 second + +//insure that step is 1 +#define USER_SLEEP User::After(KZoomFasterTime) + + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusEngLiveSession* UT_CMusEngLiveSession::NewL() + { + UT_CMusEngLiveSession* self = UT_CMusEngLiveSession::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusEngLiveSession* UT_CMusEngLiveSession::NewLC() + { + UT_CMusEngLiveSession* self = new( ELeave ) UT_CMusEngLiveSession(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusEngLiveSession::~UT_CMusEngLiveSession() + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// Default constructor +// ----------------------------------------------------------------------------- +// +UT_CMusEngLiveSession::UT_CMusEngLiveSession() + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// Second phase construct +// ----------------------------------------------------------------------------- +// +void UT_CMusEngLiveSession::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngLiveSession::SetupL() + { + iLcSessionObserver = new( ELeave )CLcSessionObserverStub; + iLcUiProvider = new( ELeave )CLcUiProviderStub; + iAudioRoutingObserver = new( ELeave )CMusEngObserverStub; + + iLiveSession = CMusEngLiveSession::NewL(); + iLiveSession->SetLcSessionObserver( iLcSessionObserver ); + iLiveSession->SetLcUiProvider( iLcUiProvider ); + + iRecordedLiveSession = CMusEngLiveSession::NewL(); + iRecordedLiveSession->SetLcSessionObserver( iLcSessionObserver ); + iRecordedLiveSession->SetLcUiProvider( iLcUiProvider ); + MLcDestinationFileControl* destinationFileControl = + iRecordedLiveSession->LocalVideoPlayer()->LcDestinationFileControl(); + destinationFileControl->SetLcFileNameL( KTestVideoFileName() ); + + User::LeaveIfError( RProperty::Set( NMusSessionApi::KCategoryUid, + NMusSessionApi::KRemoteSipAddress, + KTestRecipientSipUri ) ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngLiveSession::Teardown() + { + delete iLiveSession; + delete iRecordedLiveSession; + delete iLcSessionObserver; + delete iLcUiProvider; + delete iAudioRoutingObserver; + PropertyHelper::Close(); + // Delete static data from CenRep stub + CRepository::iStaticWriteAvcKeysToStaticData = EFalse; + CRepository::DeleteStubAvcConfigKeys(); + CRepository::ResetStubGlobal(); + CRepository::iForceFailWithCode = KErrNone; + } + + + +// TEST CASES + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngLiveSession::UT_NewLL() + { + EUNIT_ASSERT( iLiveSession ) + EUNIT_ASSERT( iRecordedLiveSession ) + EUNIT_ASSERT( iLiveSession->iCameraHandler.iCameraUsage == MusSettingsKeys::EUseCameraSwapping ); + EUNIT_ASSERT( iLiveSession->iMceManagerUid == TUid::Uid( KMusUiUid ) ); + + delete iLiveSession; + iLiveSession = NULL; + CRepository::SetStubGlobal( MusSettingsKeys::KCameraUsage, + MusSettingsKeys::EUseOnlySecondaryCamera ); + + iLiveSession = CMusEngLiveSession::NewL(); + + EUNIT_ASSERT_EQUALS( TInt( iLiveSession->iCameraHandler.iCameraUsage ), + TInt( MusSettingsKeys::EUseOnlySecondaryCamera ) ); + + delete iLiveSession; + iLiveSession = NULL; + CRepository::SetStubGlobal( MusSettingsKeys::KCameraUsage, + MusSettingsKeys::EUseOnlyMainCamera ); + + iLiveSession = CMusEngLiveSession::NewL(); + + EUNIT_ASSERT_EQUALS( TInt( iLiveSession->iCameraHandler.iCameraUsage ), + TInt( MusSettingsKeys::EUseOnlyMainCamera ) ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngLiveSession::UT_CompleteSessionStructureLL() + { + CMceStreamBundle* localBundle = + CMceStreamBundle::NewLC( CMceStreamBundle::ELS ); + + // Check that structure cannot be completed before creating the session + TRAPD( error, iLiveSession->CompleteSessionStructureL( *localBundle ) ); + MUS_TEST_FORWARD_ALLOC_FAILURE( error ); + EUNIT_ASSERT( error == KErrNotReady ); + + // Normal case + + CSIPProfile* profile = iLiveSession->iSipProfileHandler->Profile(); + + iLiveSession->iSession = CMceOutSession::NewL( + *(iLiveSession->iManager), + *profile, + KTestRecipientSipUri8() ); + + iLiveSession->CompleteSessionStructureL( *localBundle ); + + EUNIT_ASSERT( localBundle->Streams().Count() == 0 ) + + EUNIT_ASSERT( iLiveSession->iSession->Streams().Count() == 1 ); + EUNIT_ASSERT( iLiveSession->iSession->Streams()[0]->Type() == KMceVideo ); + EUNIT_ASSERT( iLiveSession->iSession->Streams()[0]->Source() ); + EUNIT_ASSERT( iLiveSession->iSession->Streams()[0]->Source()->Type() == + KMceCameraSource ); + EUNIT_ASSERT( iLiveSession->iSession->Streams()[0]->Sinks().Count() == 1 ); + EUNIT_ASSERT( iLiveSession->iSession->Streams()[0]->Sinks()[0]->Type() == + KMceRTPSink ); + + // Test that also recording stream is constructed if needed + + iRecordedLiveSession->iSession = CMceOutSession::NewL( + *(iLiveSession->iManager), + *profile, + KTestRecipientSipUri8() ); + + iRecordedLiveSession->CompleteSessionStructureL( *localBundle ); + + EUNIT_ASSERT( localBundle->Streams().Count() == 0 ) + + CMceCameraSource* camera = + MusEngMceUtils::GetCameraL( *(iRecordedLiveSession->iSession) ); + + // Check that there is recorded stream and that source is same camera + CMceMediaSink* file = NULL; + const RPointerArray& streams = + iRecordedLiveSession->iSession->Streams(); + + for ( TInt i = 0; i < streams.Count(); ++i ) + { + if ( streams[i]->Type() == KMceVideo ) + { + if ( streams[i]->Sinks()[0]->Type() == KMceFileSink ) + { + file = streams[i]->Sinks()[0]; + } + EUNIT_ASSERT( streams[i]->Source() == camera ) + } + } + + EUNIT_ASSERT( file ) + + + + EUNIT_ASSERT( iLiveSession->iCameraHandler.iCurrentCamera == + TMusEngCameraHandler::EBackCamera ); + + delete iLiveSession->iSession; + iLiveSession->iSession = NULL; + + iLiveSession->iSession = CMceOutSession::NewL( + *(iLiveSession->iManager), + *profile, + KTestRecipientSipUri8() ); + + iLiveSession->iCameraHandler.iCameraUsage = MusSettingsKeys::EUseOnlySecondaryCamera; + iLiveSession->CompleteSessionStructureL( *localBundle ); + + EUNIT_ASSERT( iLiveSession->iCameraHandler.iCurrentCamera == + TMusEngCameraHandler::EFrontCamera ); + + + CleanupStack::PopAndDestroy( localBundle ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngLiveSession::UT_AdjustVideoCodecLL() + { + CRepository::SetStubAvcConfigKeysL( KNullDesC8() ); + + CMceVideoCodec* codecH263 = CMceH263Codec::NewLC( KMceSDPNameH263() ); + CMceVideoCodec* codecH2632000 = CMceH263Codec::NewLC( KMceSDPNameH2632000() ); + CMceVideoCodec* codecAvc = CMceAvcCodec::NewLC( KMceSDPNameH264() ); + CMceVideoCodec* codecUnknown = CMceH263Codec::NewLC( KNullDesC8() ); + + iLiveSession->AdjustVideoCodecL( *codecH263, KMceCameraSource ); + iLiveSession->AdjustVideoCodecL( *codecH2632000, KMceCameraSource ); + iLiveSession->AdjustVideoCodecL( *codecAvc, KMceCameraSource ); + iLiveSession->AdjustVideoCodecL( *codecUnknown, KMceCameraSource ); + + // Test that bit rates has been set to H263 & AVC codecs + EUNIT_ASSERT( codecH263->iAllowedBitrates == KMceAllowedH263BitrateAll ) + EUNIT_ASSERT( codecH263->iMaxBitRate == KMceH263Level45Bitrate ) + EUNIT_ASSERT( codecH263->iBitrate == 80000 ) + + EUNIT_ASSERT( codecH2632000->iAllowedBitrates == + KMceAllowedH263BitrateAll ) + EUNIT_ASSERT( codecH2632000->iMaxBitRate == KMceH263Level45Bitrate ) + EUNIT_ASSERT( codecH2632000->iBitrate == 80000 ) + + EUNIT_ASSERT( codecAvc->iAllowedBitrates == + KMceAvcCodecProfileIdBaseline | + KMceAvcCodecProfileIopConstraintSet | + KMceAvcBitrateLevel1b ) + EUNIT_ASSERT( iLiveSession->iStoreEncoderConfigInfo ) + + + // Test that bitrates has not been set to unknown codecs + EUNIT_ASSERT( codecUnknown->iAllowedBitrates != + KMceAllowedH263BitrateAll ) + EUNIT_ASSERT( codecUnknown->iMaxBitRate != KMceH263Level45Bitrate ) + EUNIT_ASSERT( codecUnknown->iBitrate != KMceH263Level10Bitrate ) + + // Test that base class has been called to all codecs + EUNIT_ASSERT( codecH263->iPayloadType == 96 ) + EUNIT_ASSERT( codecH2632000->iPayloadType == 96 ) + EUNIT_ASSERT( codecAvc->iPayloadType == 98 ) + EUNIT_ASSERT( codecUnknown->iPayloadType == 0 ) + + CleanupStack::PopAndDestroy( codecUnknown ); + CleanupStack::PopAndDestroy( codecAvc ); + CleanupStack::PopAndDestroy( codecH2632000 ); + CleanupStack::PopAndDestroy( codecH263 ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngLiveSession::UT_AdjustAudioCodecLL() + { + CMceAudioCodec* codec = + iLiveSession->iManager->SupportedAudioCodecs()[0]->CloneL(); + CleanupStack::PushL( codec ); + iLiveSession->AdjustAudioCodecL( *codec ); + + // Does nothing so just test that base class has been called + + EUNIT_ASSERT( codec->iPayloadType == 97 ) + + CleanupStack::PopAndDestroy( codec ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngLiveSession::UT_DoCodecSelectionLL() + { + CMceVideoStream* stream = CMceVideoStream::NewLC(); + + CMceVideoCodec* codecH263 = CMceH263Codec::NewLC( _L8( "Foo" ) ); + stream->AddCodecL( codecH263 ); + CleanupStack::Pop( codecH263 ); + + CMceVideoCodec* codecH2632000 = CMceH263Codec::NewLC( _L8( "Bar" ) ); + stream->AddCodecL( codecH2632000 ); + CleanupStack::Pop( codecH2632000 ); + + CMceVideoCodec* codecAvc = CMceAvcCodec::NewLC( KMceSDPNameH264() ); + stream->AddCodecL( codecAvc ); + CleanupStack::Pop( codecAvc ); + + // No assumptions so all the codecs are left to stream + iLiveSession->DoCodecSelectionL( *stream ); + EUNIT_ASSERT_EQUALS( stream->Codecs().Count(), 3 ) + + // Check that AVC codecs are removed if they are known to be not supported + delete iLiveSession->iVideoCodecList; + iLiveSession->iVideoCodecList = NULL; + iLiveSession->iVideoCodecList = _L8("SomethingThatIsNotAVC").AllocL(); + iLiveSession->DoCodecSelectionL( *stream ); + EUNIT_ASSERT_EQUALS( stream->Codecs().Count(), 2 ) + EUNIT_ASSERT( stream->Codecs()[0]->SdpName() != KMceSDPNameH264() ) + EUNIT_ASSERT( stream->Codecs()[1]->SdpName() != KMceSDPNameH264() ) + + CleanupStack::PopAndDestroy( stream ); + } + +// ----------------------------------------------------------------------------- +// Although all states are not meaningfull for LiveSession, all states are +// tested in order to force the updating of unit tests when behavior is changed +// ----------------------------------------------------------------------------- +// +void UT_CMusEngLiveSession::UT_StreamStateChangedL() + { + // Try without a session, nothing happens + CMceVideoStream* videoStream = CMceVideoStream::NewLC(); + static_cast(iLiveSession)->StreamStateChanged( + *videoStream ); + CleanupStack::PopAndDestroy( videoStream ); + + // Simulate sending invite + iLiveSession->EstablishLcSessionL(); + + // Try all the stream states + CMceMediaStream* changedStream = iLiveSession->iSession->Streams()[0]; + + // EUninitialized, stream is created, unexpected change, nothing happens + changedStream->iState = CMceMediaStream::EUninitialized; + static_cast(iLiveSession)->StreamStateChanged( + *changedStream ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + // EInitialized, stream is initialized + changedStream->iState = CMceMediaStream::EInitialized; + static_cast(iLiveSession)->StreamStateChanged( + *changedStream ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + // EBuffering, stream is buffering + changedStream->iState = CMceMediaStream::EBuffering; + static_cast(iLiveSession)->StreamStateChanged( + *changedStream ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + // EIdle, stream is not receiving RTP + changedStream->iState = CMceMediaStream::EIdle; + static_cast(iLiveSession)->StreamStateChanged( + *changedStream ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + // EStreaming, stream is streaming + changedStream->iState = CMceMediaStream::EStreaming; + static_cast(iLiveSession)->StreamStateChanged( *changedStream ); + EUNIT_ASSERT_EQUALS( TInt( iLcSessionObserver->iCalledFunction ), + TInt( CLcSessionObserverStub::EPlayerStateChanged ) ) + iLcSessionObserver->Reset(); + + // EDisabled, stream is explicitly disabled + changedStream->iState = CMceMediaStream::EDisabled; + static_cast(iLiveSession)->StreamStateChanged( + *changedStream ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + // ENoResources, stream has no needed resources to stream + changedStream->iState = CMceMediaStream::ENoResources; + static_cast(iLiveSession)->StreamStateChanged( + *changedStream ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + // ETranscodingRequired, stream requires non-realtime transcoding + changedStream->iState = CMceMediaStream::ETranscodingRequired; + static_cast(iLiveSession)->StreamStateChanged( + *changedStream ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + // ETranscoding, stream is transcoding in non-realtime + changedStream->iState = CMceMediaStream::ETranscoding; + static_cast(iLiveSession)->StreamStateChanged( + *changedStream ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + } + +// ----------------------------------------------------------------------------- +// Although all states are not meaningfull for LiveSession, all states are +// tested in order to force the updating of unit tests when behavior is changed +// ----------------------------------------------------------------------------- +// +void UT_CMusEngLiveSession::UT_StreamStateChangedWithSourceL() + { + // Try without a session, nothing happens + CMceVideoStream* videoStream = CMceVideoStream::NewLC(); + static_cast(iLiveSession)->StreamStateChanged( + *videoStream, + *CMceCameraSource::NewLC( *iLiveSession->iManager ) ); + CleanupStack::PopAndDestroy(); // camera + CleanupStack::PopAndDestroy( videoStream ); + + // Simulate sending invite + iLiveSession->EstablishLcSessionL(); + + // Try all the stream states + CMceMediaStream* changedStream = iLiveSession->iSession->Streams()[0]; + CMceMediaSource* changedSource = changedStream->Source(); + + // EUninitialized, stream is created, unexpected change, nothing happens + changedStream->iState = CMceMediaStream::EUninitialized; + static_cast(iLiveSession)->StreamStateChanged( + *changedStream, *changedSource ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + // EInitialized, stream is initialized + changedStream->iState = CMceMediaStream::EInitialized; + static_cast(iLiveSession)->StreamStateChanged( + *changedStream, *changedSource );; + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + // EBuffering, stream is buffering + changedStream->iState = CMceMediaStream::EBuffering; + static_cast(iLiveSession)->StreamStateChanged( + *changedStream, *changedSource ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + // EIdle, stream is not receiving RTP + changedStream->iState = CMceMediaStream::EIdle; + static_cast(iLiveSession)->StreamStateChanged( + *changedStream, *changedSource ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + // EStreaming, stream is streaming + changedStream->iState = CMceMediaStream::EStreaming; + static_cast(iLiveSession)->StreamStateChanged( + *changedStream, *changedSource ); + EUNIT_ASSERT_EQUALS( TInt( iLcSessionObserver->iCalledFunction ), + TInt( CLcSessionObserverStub::EPlayerStateChanged ) ) + iLcSessionObserver->Reset(); + + // EDisabled, stream is explicitly disabled + changedStream->iState = CMceMediaStream::EDisabled; + static_cast(iLiveSession)->StreamStateChanged( + *changedStream, *changedSource ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + // ENoResources, stream has no needed resources to stream + changedStream->iState = CMceMediaStream::ENoResources; + static_cast(iLiveSession)->StreamStateChanged( + *changedStream, *changedSource ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + // ETranscodingRequired, stream requires non-realtime transcoding + changedStream->iState = CMceMediaStream::ETranscodingRequired; + static_cast(iLiveSession)->StreamStateChanged( + *changedStream, *changedSource ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + // ETranscoding, stream is transcoding in non-realtime + changedStream->iState = CMceMediaStream::ETranscoding; + static_cast(iLiveSession)->StreamStateChanged( + *changedStream, *changedSource ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + } + +// ----------------------------------------------------------------------------- +// Although all states are not meaningfull for LiveSession, all states are +// tested in order to force the updating of unit tests when behavior is changed +// ----------------------------------------------------------------------------- +// +void UT_CMusEngLiveSession::UT_StreamStateChangedWithSinkL() + { + // Try without a session, nothing happens + ESTABLISH_OUT_SESSION( iLiveSession ) + + iRecordedLiveSession->StreamStateChanged( + *iLiveSession->iSession->Streams()[0], + *iLiveSession->iSession->Streams()[0]->Sinks()[0] ); + + // Try with session + + ESTABLISH_OUT_SESSION( iRecordedLiveSession ) + MLcDestinationFileControl* destinationFileControl = + iRecordedLiveSession->LocalVideoPlayer()->LcDestinationFileControl(); + destinationFileControl->LcRecordL( ETrue ); + + // Test state CMceMediaStream::ENoResources + + // Try without recording stream, nothing happens + + iLiveSession->StreamStateChanged( + *iLiveSession->iSession->Streams()[0], + *iLiveSession->iSession->Streams()[0]->Sinks()[0] ); + EUNIT_ASSERT_EQUALS( TInt( iLcSessionObserver->iCalledFunction ), + TInt( CLcSessionObserverStub::EPlayerStateChanged ) ) + iLcSessionObserver->Reset(); + + // Try again with recording stream, but indicate change in another stream, + // nothing happens + iRecordedLiveSession->StreamStateChanged( + *iLiveSession->iSession->Streams()[0], + *iLiveSession->iSession->Streams()[0]->Sinks()[0] ); + + // Try again with recording stream, but with stream state != ENoResources, + // nothing happens + CMceVideoStream* recordingStream = + MusEngMceUtils::GetRecordingStream( *iRecordedLiveSession->iSession ); + + EUNIT_ASSERT( recordingStream ) + EUNIT_ASSERT( recordingStream->State() != CMceMediaStream::ENoResources ) + + iRecordedLiveSession->StreamStateChanged( *recordingStream, + *recordingStream->Sinks()[0] ); + + // Try again with recording stream and stream state == ENoResources, + // but with enabled sink, nothing happens + + recordingStream->iState = CMceMediaStream::ENoResources; + EUNIT_ASSERT( recordingStream->Sinks()[0]->iIsEnabled ) + + iRecordedLiveSession->StreamStateChanged( *recordingStream, + *recordingStream->Sinks()[0] ); + + // Disk full case + + recordingStream->Sinks()[0]->iIsEnabled = EFalse; + + iRecordedLiveSession->StreamStateChanged( *recordingStream, + *recordingStream->Sinks()[0] ); + + EUNIT_ASSERT_EQUALS( TInt( iLcSessionObserver->iCalledFunction ), + TInt( CLcSessionObserverStub::ESessionFailed ) ) + EUNIT_ASSERT_EQUALS( iLcSessionObserver->iError, + TInt( MLcSession::EDiskFull ) ) + iLcSessionObserver->Reset(); + + + // Test default stream state change behavior + + CMceMediaStream* changedStream = iLiveSession->iSession->Streams()[0]; + CMceMediaSink* changedSink = changedStream->Sinks()[0]; + + // EUninitialized, stream is created, unexpected change, nothing happens + changedStream->iState = CMceMediaStream::EUninitialized; + iLiveSession->StreamStateChanged( *changedStream, *changedSink ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ) + + // EInitialized, stream is initialized + changedStream->iState = CMceMediaStream::EInitialized; + iLiveSession->StreamStateChanged( *changedStream, *changedSink ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ) + + // EBuffering, stream is buffering + changedStream->iState = CMceMediaStream::EBuffering; + iLiveSession->StreamStateChanged( *changedStream, *changedSink ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ) + + // EIdle, stream is not receiving RTP + changedStream->iState = CMceMediaStream::EIdle; + iLiveSession->StreamStateChanged( *changedStream, *changedSink ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ) + + // EStreaming, stream is streaming + changedStream->iState = CMceMediaStream::EStreaming; + iLiveSession->StreamStateChanged( *changedStream, *changedSink ); + EUNIT_ASSERT_EQUALS( TInt( iLcSessionObserver->iCalledFunction ), + TInt( CLcSessionObserverStub::EPlayerStateChanged ) ) + iLcSessionObserver->Reset(); + + // EDisabled, stream is explicitly disabled + changedStream->iState = CMceMediaStream::EDisabled; + iLiveSession->StreamStateChanged( *changedStream, *changedSink ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ) + + // ENoResources, stream has no needed resources to stream + // This state has non-default meaning, tested before defaults + + // ETranscodingRequired, stream requires non-realtime transcoding + changedStream->iState = CMceMediaStream::ETranscodingRequired; + iLiveSession->StreamStateChanged( *changedStream, *changedSink ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ) + + // ETranscoding, stream is transcoding in non-realtime + changedStream->iState = CMceMediaStream::ETranscoding; + iLiveSession->StreamStateChanged( *changedStream, *changedSink ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ) + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngLiveSession::UT_EstablishLcSessionL() + { + iLiveSession->EstablishLcSessionL(); + EUNIT_ASSERT_EQUALS( TInt( CMceSession::EOffering ), + TInt( iLiveSession->iSession->iState ) ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngLiveSession::UT_LocalVideoPlayerL() + { + EUNIT_ASSERT( iLiveSession->LocalVideoPlayer() == + iLiveSession->iLiveVideoPlayer ) + } + +// TEST TABLE +EUNIT_BEGIN_TEST_TABLE( + UT_CMusEngLiveSession, + "UT_CMusEngLiveSesssion", + "UNIT" ) + +EUNIT_TEST( + "NewL - test ", + "CMusEngLiveSession", + "NewL", + "FUNCTIONALITY", + SetupL, UT_NewLL, Teardown) + +EUNIT_TEST( + "CompleteSessionStructureL - test ", + "CMusEngLiveSession", + "CompleteSessionStructureL", + "FUNCTIONALITY", + SetupL, UT_CompleteSessionStructureLL, Teardown) + +EUNIT_TEST( + "AdjustVideoCodecL - test ", + "CMusEngLiveSession", + "AdjustVideoCodecL", + "FUNCTIONALITY", + SetupL, UT_AdjustVideoCodecLL, Teardown) + +EUNIT_TEST( + "AdjustAudioCodecL - test ", + "CMusEngLiveSession", + "AdjustAudioCodecL", + "FUNCTIONALITY", + SetupL, UT_AdjustAudioCodecLL, Teardown) + +EUNIT_TEST( + "DoCodecSelectionL- test ", + "CMusEngLiveSession", + "DoCodecSelectionL", + "FUNCTIONALITY", + SetupL, UT_DoCodecSelectionLL, Teardown) + +EUNIT_TEST( + "StreamStateChangedL() - test ", + "CMusEngLiveSession", + "StreamStateChangedL()", + "FUNCTIONALITY", + SetupL, UT_StreamStateChangedL, Teardown) + +EUNIT_TEST( + "StreamStateChangedL( src ) - test ", + "CMusEngLiveSession", + "StreamStateChangedL( src )", + "FUNCTIONALITY", + SetupL, UT_StreamStateChangedWithSourceL, Teardown) + +EUNIT_TEST( + "StreamStateChangedL( sink ) - test ", + "CMusEngLiveSession", + "StreamStateChangedL( sink )", + "FUNCTIONALITY", + SetupL, UT_StreamStateChangedWithSinkL, Teardown) + +EUNIT_TEST( + "EstablishLcSessionL - test ", + "CMusEngLiveSession", + "EstablishLcSessionL", + "FUNCTIONALITY", + SetupL, UT_EstablishLcSessionL, Teardown) + +EUNIT_TEST( + "LocalVideoPlayer - test ", + "CMusEngLiveSession", + "LocalVideoPlayer", + "FUNCTIONALITY", + SetupL, UT_LocalVideoPlayerL, Teardown) + +EUNIT_END_TEST_TABLE + +// END OF FILE + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/tsrc/ut_engine/src/ut_musenglivevideoplayer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/tsrc/ut_engine/src/ut_musenglivevideoplayer.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,490 @@ +/* +* 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: +* +*/ + + +// INTERNAL INCLUDES +#include "ut_musenglivevideoplayer.h" +#include "musenglivevideoplayer.h" +#include "musengtestdefs.h" + +// SYSTEM INCLUDES +#include +#include +#include +#include +#include +#include + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusEngLiveVideoPlayer* UT_CMusEngLiveVideoPlayer::NewL() + { + UT_CMusEngLiveVideoPlayer* self = UT_CMusEngLiveVideoPlayer::NewLC(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusEngLiveVideoPlayer* UT_CMusEngLiveVideoPlayer::NewLC() + { + UT_CMusEngLiveVideoPlayer* self = new( ELeave ) UT_CMusEngLiveVideoPlayer(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusEngLiveVideoPlayer::~UT_CMusEngLiveVideoPlayer() + { + // NOP + } + +// ----------------------------------------------------------------------------- +// Default constructor +// ----------------------------------------------------------------------------- +// +UT_CMusEngLiveVideoPlayer::UT_CMusEngLiveVideoPlayer() + { + // NOP + } + +// ----------------------------------------------------------------------------- +// Second phase construct +// ----------------------------------------------------------------------------- +// +void UT_CMusEngLiveVideoPlayer::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngLiveVideoPlayer::SetupL() + { + iMceSession = CMceOutSession::NewL(); + CMceVideoStream* videoStream = CMceVideoStream::NewLC(); + CMceRtpSink* rtpsink = CMceRtpSink::NewLC(); + videoStream->AddSinkL( rtpsink ); + CleanupStack::Pop( rtpsink ); + CMceCameraSource* camera = CMceCameraSource::NewLC(); + iCameraHandler.InitializeL( *camera ); + videoStream->SetSourceL( camera ); + CleanupStack::Pop( camera ); + iMceSession->AddStreamL( videoStream ); + CleanupStack::Pop( videoStream ); + + iCameraHandler.SetSession( iMceSession ); + iLiveVideoPlayer = + CMusEngLiveVideoPlayer::NewL( + iDisplayHandlerStub, + iCameraHandler, + iLcAudioControlStub ); + iLiveVideoPlayer->SetMceSession( iMceSession ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngLiveVideoPlayer::Teardown() + { + delete iLiveVideoPlayer; + delete iMceSession; + iLcAudioControlStub.Reset(); + } + + + +// TEST CASES + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngLiveVideoPlayer::UT_NewLL() + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngLiveVideoPlayer::UT_LcVideoPlayerStateL() + { + // iMceSession not set + iLiveVideoPlayer->SetMceSession( NULL ); + EUNIT_ASSERT_EQUALS( TInt( MLcVideoPlayer::EUnavailable ), + TInt( iLiveVideoPlayer->LcVideoPlayerState() ) ) + iLiveVideoPlayer->SetMceSession( iMceSession ); + + // Establish Session and simulate media playing. + iMceSession->iState = CMceSession::EEstablished; + for ( TInt i = 0; i < iMceSession->Streams().Count(); i++ ) + { + iMceSession->Streams()[i]->iState = CMceMediaStream::EStreaming; + } + + EUNIT_ASSERT_EQUALS( TInt( MLcVideoPlayer::EPlaying ), + TInt( iLiveVideoPlayer->LcVideoPlayerState() ) ) + + // Media streams unavailable + iMceSession->Streams()[0]->iState = CMceMediaStream::EUninitialized; + EUNIT_ASSERT_EQUALS( TInt( MLcVideoPlayer::EUnavailable ), + TInt( iLiveVideoPlayer->LcVideoPlayerState() ) ) + + // All other stream states + iMceSession->Streams()[0]->iState = CMceMediaStream::EInitialized; + EUNIT_ASSERT_EQUALS( TInt( MLcVideoPlayer::EInit ), + TInt( iLiveVideoPlayer->LcVideoPlayerState() ) ) + + iMceSession->Streams()[0]->iState = CMceMediaStream::EBuffering; + EUNIT_ASSERT_EQUALS( TInt( MLcVideoPlayer::EBuffering ), + TInt( iLiveVideoPlayer->LcVideoPlayerState() ) ) + + iMceSession->Streams()[0]->iState = CMceMediaStream::EIdle; + EUNIT_ASSERT_EQUALS( TInt( MLcVideoPlayer::EPaused ), + TInt( iLiveVideoPlayer->LcVideoPlayerState() ) ) + + iMceSession->Streams()[0]->iState = CMceMediaStream::EDisabled; + EUNIT_ASSERT_EQUALS( TInt( MLcVideoPlayer::EPaused ), + TInt( iLiveVideoPlayer->LcVideoPlayerState() ) ) + + iMceSession->Streams()[0]->iState = CMceMediaStream::EStreaming; + EUNIT_ASSERT_EQUALS( TInt( MLcVideoPlayer::EPlaying ), + TInt( iLiveVideoPlayer->LcVideoPlayerState() ) ) + + iMceSession->Streams()[0]->iState = CMceMediaStream::ENoResources; + EUNIT_ASSERT_EQUALS( TInt( MLcVideoPlayer::EUnavailable ), + TInt( iLiveVideoPlayer->LcVideoPlayerState() ) ) + + iMceSession->Streams()[0]->iState = CMceMediaStream::ETranscodingRequired; + EUNIT_ASSERT_EQUALS( TInt( MLcVideoPlayer::EUnavailable ), + TInt( iLiveVideoPlayer->LcVideoPlayerState() ) ) + + iMceSession->Streams()[0]->iState = CMceMediaStream::ETranscoding; + EUNIT_ASSERT_EQUALS( TInt( MLcVideoPlayer::EUnavailable ), + TInt( iLiveVideoPlayer->LcVideoPlayerState() ) ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngLiveVideoPlayer::UT_LcPlayL() + { + // Play + iLiveVideoPlayer->LcPlayL(); + EUNIT_ASSERT( iLiveVideoPlayer->LcIsPlayingL() ); + + // Pause + iLiveVideoPlayer->LcPauseL(); + EUNIT_ASSERT( !iLiveVideoPlayer->LcIsPlayingL() ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngLiveVideoPlayer::UT_LcWindowL() + { + EUNIT_ASSERT( iLiveVideoPlayer->LcWindow() == iLiveVideoPlayer ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngLiveVideoPlayer::UT_LcCameraControlL() + { + EUNIT_ASSERT( iLiveVideoPlayer->LcCameraControl() == &iCameraHandler ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngLiveVideoPlayer::UT_LcSourceFileControlL() + { + EUNIT_ASSERT( iLiveVideoPlayer->LcSourceFileControl() == NULL ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngLiveVideoPlayer::UT_LcDestinationFileControlL() + { + EUNIT_ASSERT( + iLiveVideoPlayer->LcDestinationFileControl() == iLiveVideoPlayer ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngLiveVideoPlayer::UT_LcAudioControlL() + { + EUNIT_ASSERT( iLiveVideoPlayer->LcAudioControl() == &iLcAudioControlStub ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngLiveVideoPlayer::UT_LcZoomControlL() + { + EUNIT_ASSERT( iLiveVideoPlayer->LcZoomControl() == &iCameraHandler ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngLiveVideoPlayer::UT_LcBrightnessControlL() + { + EUNIT_ASSERT( iLiveVideoPlayer->LcBrightnessControl() == &iCameraHandler ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngLiveVideoPlayer::UT_EnableLcWindowL() + { + EUNIT_ASSERT( !iLiveVideoPlayer->IsLcWindowEnabled() ) + + // Enable + iLiveVideoPlayer->EnableLcWindowL( ETrue ); + EUNIT_ASSERT( iLiveVideoPlayer->IsLcWindowEnabled() ) + + // Disable + iLiveVideoPlayer->EnableLcWindowL( EFalse ); + EUNIT_ASSERT( !iLiveVideoPlayer->IsLcWindowEnabled() ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngLiveVideoPlayer::UT_LcWindowRectL() + { + TRect rect( 12, 34, 56, 78 ); + iLiveVideoPlayer->SetLcWindowRectL( rect ); + EUNIT_ASSERT( iLiveVideoPlayer->LcWindowRect() == rect ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngLiveVideoPlayer::UT_LcWindowOrientationL() + { + iLiveVideoPlayer->SetLcWindowOrientationL( MLcWindow::EPortrait ); + EUNIT_ASSERT_EQUALS( TInt( MLcWindow::EPortrait ), + TInt( iLiveVideoPlayer->LcWindowOrientationL() ) ) + + iLiveVideoPlayer->SetLcWindowOrientationL( MLcWindow::ELandscape ); + EUNIT_ASSERT_EQUALS( TInt( MLcWindow::ELandscape ), + TInt( iLiveVideoPlayer->LcWindowOrientationL() ) ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngLiveVideoPlayer::UT_SetLcFileNameL() + { + EUNIT_ASSERT_EQUALS( KNullDesC(), iLiveVideoPlayer->LcFileName() ) + + _LIT( KFileName, "my_clip.format"); + TFileName fileName( KFileName ); + iLiveVideoPlayer->SetLcFileNameL( fileName ); + EUNIT_ASSERT_EQUALS( fileName, iLiveVideoPlayer->LcFileName() ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngLiveVideoPlayer::UT_LcRecordL() + { + // No MCE session + iLiveVideoPlayer->SetMceSession( NULL ); + EUNIT_ASSERT_SPECIFIC_LEAVE( + iLiveVideoPlayer->LcRecordL( ETrue ), KErrNotReady ) + + // No file sink in the session + iLiveVideoPlayer->SetMceSession( iMceSession ); + EUNIT_ASSERT_SPECIFIC_LEAVE( + iLiveVideoPlayer->LcRecordL( ETrue ), KErrNotReady ) + + // Record, not yet recording + EUNIT_ASSERT( !iLiveVideoPlayer->LcIsRecording() ) + CMceVideoStream* streamForRecording = CMceVideoStream::NewLC(); + CMceFileSink* fileSink = CMceFileSink::NewLC( KTestVideoFileName() ); + fileSink->DisableL(); + streamForRecording->AddSinkL( fileSink ); + CleanupStack::Pop( fileSink ); + iMceSession->AddStreamL( streamForRecording ); + CleanupStack::Pop( streamForRecording ); + iLiveVideoPlayer->LcRecordL( ETrue ); + EUNIT_ASSERT( iLiveVideoPlayer->LcIsRecording() ) + + // Record, already recording + iLiveVideoPlayer->LcRecordL( ETrue ); + EUNIT_ASSERT( iLiveVideoPlayer->LcIsRecording() ) + + // Stop recording + iLiveVideoPlayer->LcRecordL( EFalse ); + EUNIT_ASSERT( !iLiveVideoPlayer->LcIsRecording() ) + + // Stop recording, not anymore recording + iLiveVideoPlayer->LcRecordL( EFalse ); + EUNIT_ASSERT( !iLiveVideoPlayer->LcIsRecording() ) + } + + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusEngLiveVideoPlayer, + "UT_CMusEngLiveVideoPlayer", + "UNIT" ) + +EUNIT_TEST( + "NewL - test ", + "CMusEngLiveVideoPlayer", + "NewL", + "FUNCTIONALITY", + SetupL, UT_NewLL, Teardown) + +EUNIT_TEST( + "LcVideoPlayerState - test ", + "CMusEngLiveVideoPlayer", + "LcVideoPlayerState", + "FUNCTIONALITY", + SetupL, UT_LcVideoPlayerStateL, Teardown) + +EUNIT_TEST( + "LcPlayL - test ", + "CMusEngLiveVideoPlayer", + "LcPlayL", + "FUNCTIONALITY", + SetupL, UT_LcPlayL, Teardown) + +EUNIT_TEST( + "LcWindow - test ", + "CMusEngLiveVideoPlayer", + "LcWindow", + "FUNCTIONALITY", + SetupL, UT_LcWindowL, Teardown) + +EUNIT_TEST( + "LcCameraControl - test ", + "CMusEngLiveVideoPlayer", + "LcCameraControl", + "FUNCTIONALITY", + SetupL, UT_LcCameraControlL, Teardown) + +EUNIT_TEST( + "LcSourceFileControl - test ", + "CMusEngLiveVideoPlayer", + "LcSourceFileControl", + "FUNCTIONALITY", + SetupL, UT_LcSourceFileControlL, Teardown) + +EUNIT_TEST( + "LcDestinationFileControl - test ", + "CMusEngLiveVideoPlayer", + "LcDestinationFileControl", + "FUNCTIONALITY", + SetupL, UT_LcDestinationFileControlL, Teardown) + +EUNIT_TEST( + "LcAudioControl - test ", + "CMusEngLiveVideoPlayer", + "LcAudioControl", + "FUNCTIONALITY", + SetupL, UT_LcAudioControlL, Teardown) + +EUNIT_TEST( + "LcZoomControl - test ", + "CMusEngLiveVideoPlayer", + "LcZoomControl", + "FUNCTIONALITY", + SetupL, UT_LcZoomControlL, Teardown) + +EUNIT_TEST( + "LcBrightnessControl - test ", + "CMusEngLiveVideoPlayer", + "LcBrightnessControl", + "FUNCTIONALITY", + SetupL, UT_LcBrightnessControlL, Teardown) + +EUNIT_TEST( + "EnableLcWindowL - test ", + "CMusEngLiveVideoPlayer", + "EnableLcWindowL", + "FUNCTIONALITY", + SetupL, UT_EnableLcWindowL, Teardown) + +EUNIT_TEST( + "LcWindowRect - test ", + "CMusEngLiveVideoPlayer", + "LcWindowRect", + "FUNCTIONALITY", + SetupL, UT_LcWindowRectL, Teardown) + +EUNIT_TEST( + "LcWindowOrientation - test ", + "CMusEngLiveVideoPlayer", + "LcWindowOrientation", + "FUNCTIONALITY", + SetupL, UT_LcWindowOrientationL, Teardown) + +EUNIT_TEST( + "SetLcFileNameL - test ", + "CMusEngLiveVideoPlayer", + "SetLcFileNameL", + "FUNCTIONALITY", + SetupL, UT_SetLcFileNameL, Teardown) + +EUNIT_TEST( + "LcRecordL - test ", + "CMusEngLiveVideoPlayer", + "LcRecordL", + "FUNCTIONALITY", + SetupL, UT_LcRecordL, Teardown) + +EUNIT_END_TEST_TABLE + +// END OF FILE + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/tsrc/ut_engine/src/ut_musengmcesession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/tsrc/ut_engine/src/ut_musengmcesession.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,2919 @@ +/* +* 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: +* +*/ + + +// INTERNAL INCLUDES +#include "ut_musengmcesession.h" +#include "musengstubs.h" +#include "musengtestdefs.h" + +#include "mussettings.h" +#include "musenglivesession.h" +#include "musengclipsession.h" +#include "musengreceivesession.h" +#include "musengsessiondurationtimer.h" +#include "musengtelephoneutils.h" +#include "musengmceutils.h" +#include "mussessionproperties.h" +#include "contactenginestub.h" +#include "musenglivevideoplayer.h" + +// SYSTEM INCLUDES +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// CONSTANTS + +_LIT8( KMusAvcBitrateLevel1TestText, "TestTextForAvcBrL1Level" ); +_LIT8( KMusAvcBitrateLevel1bTestText, "TestTextForAvcBrL1bLevel" ); +_LIT8( KMusAvcBitrateLevel1_1TestText, "TestTextForAvcBrL1_1Level" ); +_LIT8( KMusAvcBitrateLevel1_2TestText, "TestTextForAvcBrL1_2Level" ); +_LIT8( KMusAvcBitrateLevel1_3TestText, "TestTextForAvcBrL1_3Level" ); +_LIT8( KMusAvcBitrateLevel2TestText, "TestTextForAvcBrL2Level" ); + +_LIT8( KMusAvcBitrateLevel_1b_ConfigKey, "AvcBrL1b=TestTextForAvcBrL1bLevel;" ); + +_LIT8( KMusAvcBitrateLevel_1_1_ConfigKey, +"AvcBrL1_1=TestTextForAvcBrL1_1Level;"); + +_LIT8( KMusAvcBitrateLevels_1_1_And_1b_ConfigKeys, +"AvcBrL1_1=TestTextForAvcBrL1_1Level;\ +AvcBrL1b=TestTextForAvcBrL1bLevel;" ); + +_LIT8( KMusAvcAllLevelsConcatenation, +"AvcBrL1=TestTextForAvcBrL1Level;\ +AvcBrL1b=TestTextForAvcBrL1bLevel;\ +AvcBrL1_1=TestTextForAvcBrL1_1Level;\ +AvcBrL1_2=TestTextForAvcBrL1_2Level;\ +AvcBrL1_3=TestTextForAvcBrL1_3Level;\ +AvcBrL2=TestTextForAvcBrL2Level;" ); + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusEngMceSession* UT_CMusEngMceSession::NewL() + { + UT_CMusEngMceSession* self = UT_CMusEngMceSession::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusEngMceSession* UT_CMusEngMceSession::NewLC() + { + UT_CMusEngMceSession* self = new( ELeave ) UT_CMusEngMceSession(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusEngMceSession::~UT_CMusEngMceSession() + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// Default constructor +// ----------------------------------------------------------------------------- +// +UT_CMusEngMceSession::UT_CMusEngMceSession() + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// Second phase construct +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::SetupL( ) + { + iLcSessionObserver = new( ELeave )CLcSessionObserverStub; + iLcUiProvider = new( ELeave )CLcUiProviderStub; + + User::LeaveIfError( RProperty::Set( NMusSessionApi::KCategoryUid, + NMusSessionApi::KRemoteSipAddress, + KTestRecipientSipUri ) ); + + iLiveSession = CMusEngLiveSession::NewL(); + iLiveSession->SetLcSessionObserver( iLcSessionObserver ); + iLiveSession->SetLcUiProvider( iLcUiProvider ); + + iSomeOtherSession = CMusEngLiveSession::NewL(); + iSomeOtherSession->SetLcSessionObserver( iLcSessionObserver ); + iSomeOtherSession->SetLcUiProvider( iLcUiProvider ); + + ESTABLISH_OUT_SESSION( iSomeOtherSession ); + + iClipSession = CMusEngClipSession::NewL(); + iClipSession->SetLcSessionObserver( iLcSessionObserver ); + iClipSession->SetLcUiProvider( iLcUiProvider ); + MLcSourceFileControl* sourceFileControl = + iClipSession->LocalVideoPlayer()->LcSourceFileControl(); + sourceFileControl->SetLcFileNameL( KTestAvcVideoFileName() ); + + delete iClipSession->iVideoCodecList; + iClipSession->iVideoCodecList = NULL; + iClipSession->iVideoCodecList = KMceSDPNameH264().AllocL(); + + // Construct and establish an incoming session + iReceiveSession = CMusEngReceiveSession::NewL(); + iReceiveSession->SetLcSessionObserver( iLcSessionObserver ); + CMceInSession* inSession = CMceInSession::NewL( *iReceiveSession->iManager, + KTestOriginator() ); + + CMceVideoStream* videoStream = CMceVideoStream::NewLC(); + + videoStream->SetSourceL( CMceRtpSource::NewLC() ); + CleanupStack::Pop(); + + inSession->AddStreamL( videoStream ); + CleanupStack::Pop( videoStream ); + + iReceiveSession->iManager->iInSessionObserver->IncomingSession( + inSession, + &iContainer ); + iReceiveSession->iSession->iState = CMceSession::EProceeding; + iReceiveSession->EstablishLcSessionL(); + + iLcSessionObserver->Reset(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::Teardown( ) + { + delete iLiveSession; + delete iClipSession; + delete iReceiveSession; + delete iLcSessionObserver; + delete iLcUiProvider; + delete iSomeOtherSession; + PropertyHelper::Close(); + // Delete static data from CenRep stub + CRepository::iStaticWriteAvcKeysToStaticData = EFalse; + CRepository::DeleteStubAvcConfigKeys(); + CRepository::ResetStubGlobal(); + CRepository::iForceFailWithCode = KErrNone; + } + + + +// TEST CASES + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_LcSessionStateL() + { + // No MCE session -> MLcSession::EUninitialized + EUNIT_ASSERT_EQUALS( MLcSession::EUninitialized, + iLiveSession->LcSessionState() ) + + // MLcSession::EOpen + ESTABLISH_OUT_SESSION( iLiveSession ) + EUNIT_ASSERT_EQUALS( TInt( CMceSession::EEstablished ), + TInt( iLiveSession->iSession->iState ) ) + EUNIT_ASSERT_EQUALS( TInt( MLcSession::EOpen ), + TInt( iLiveSession->LcSessionState() ) ) + + // MLcSession::EInitialized + iLiveSession->iSession->iState = CMceSession::EIdle; + EUNIT_ASSERT_EQUALS( TInt( MLcSession::EInitialized ), + TInt( iLiveSession->LcSessionState() ) ) + + // MLcSession::EReceived + iLiveSession->iSession->iState = CMceSession::EIncoming; + EUNIT_ASSERT_EQUALS( TInt( MLcSession::EReceived ), + TInt( iLiveSession->LcSessionState() ) ) + + iLiveSession->iSession->iState = CMceSession::EProceeding; + EUNIT_ASSERT_EQUALS( TInt( MLcSession::EReceived ), + TInt( iLiveSession->LcSessionState() ) ) + + iLiveSession->iSession->iState = CMceSession::EReserving; + EUNIT_ASSERT_EQUALS( TInt( MLcSession::EReceived ), + TInt( iLiveSession->LcSessionState() ) ) + + // MLcSession::EOpening + iLiveSession->iSession->iState = CMceSession::EOffering; + EUNIT_ASSERT_EQUALS( TInt( MLcSession::EOpening ), + TInt( iLiveSession->LcSessionState() ) ) + + iLiveSession->iSession->iState = CMceSession::EAnswering; + EUNIT_ASSERT_EQUALS( TInt( MLcSession::EOpening ), + TInt( iLiveSession->LcSessionState() ) ) + + // MLcSession::EClosing + iLiveSession->iSession->iState = CMceSession::ECancelling; + EUNIT_ASSERT_EQUALS( TInt( MLcSession::EClosing ), + TInt( iLiveSession->LcSessionState() ) ) + + iLiveSession->iSession->iState = CMceSession::ETerminating; + EUNIT_ASSERT_EQUALS( TInt( MLcSession::EClosing ), + TInt( iLiveSession->LcSessionState() ) ) + + // MLcSession::EClosed + iLiveSession->iSession->iState = CMceSession::ETerminated; + EUNIT_ASSERT_EQUALS( TInt( MLcSession::EClosed ), + TInt( iLiveSession->LcSessionState() ) ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_RemoteVideoPlayerL() + { + EUNIT_ASSERT( iLiveSession->CMusEngMceSession::RemoteVideoPlayer() == NULL ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_LocalVideoPlayerL() + { + EUNIT_ASSERT( iLiveSession->CMusEngMceSession::LocalVideoPlayer() == NULL ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_LocalDisplayNameL() + { + EUNIT_ASSERT_EQUALS( KNullDesC(), iLiveSession->LocalDisplayName() ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_RemoteDisplayNameL() + { + // Clear the thread common storage to ensrue its not polluted. + User::LeaveIfError( RProperty::Set( NMusSessionApi::KCategoryUid, + NMusSessionApi::KContactName, + KNullDesC) ); + + EUNIT_ASSERT_EQUALS( KNullDesC(), iLiveSession->RemoteDisplayName() ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_RemoteDetailsL() + { + // Clear the thread common storage to ensrue its not polluted. + User::LeaveIfError( RProperty::Set( NMusSessionApi::KCategoryUid, + NMusSessionApi::KTelNumber, + KNullDesC) ); + + EUNIT_ASSERT_EQUALS( KNullDesC(), iLiveSession->RemoteDetails() ) + + _LIT( KMusTestDetails, "1222233499" ); + User::LeaveIfError( RProperty::Set( NMusSessionApi::KCategoryUid, + NMusSessionApi::KTelNumber, + KMusTestDetails) ); + EUNIT_ASSERT_EQUALS( KMusTestDetails(), iLiveSession->RemoteDetails() ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_SetParameterL() + { + const TInt dummy( 0 ); + EUNIT_ASSERT_EQUALS( KErrNotSupported, + iLiveSession->SetParameter( dummy, dummy ) ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_ParameterValueL() + { + const TInt dummy( 0 ); + EUNIT_ASSERT_EQUALS( KErrNotSupported, + iLiveSession->ParameterValue( dummy ) ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_IsLcAudioMutedL() + { + // No MCE session + EUNIT_ASSERT_SPECIFIC_LEAVE( iLiveSession->IsLcAudioMutedL(), KErrNotReady ) + + ESTABLISH_OUT_SESSION( iLiveSession ) + + // No audio + EUNIT_ASSERT( iLiveSession->IsLcAudioMutedL() ) + + // Contains audio, but explicitly muted + CMceAudioStream* audioStream = CMceAudioStream::NewLC(); + iLiveSession->iSession->AddStreamL( audioStream ); + CleanupStack::Pop( audioStream ); + iLiveSession->iExplicitlyMuted = ETrue; + EUNIT_ASSERT( iLiveSession->IsLcAudioMutedL() ) + + // Contains audio, not muted + iLiveSession->iExplicitlyMuted = EFalse; + EUNIT_ASSERT( !iLiveSession->IsLcAudioMutedL() ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_MuteLcAudioL() + { + // No MCE session + EUNIT_ASSERT_SPECIFIC_LEAVE( iLiveSession->IsLcAudioMutedL(), KErrNotReady ) + + ESTABLISH_OUT_SESSION( iLiveSession ) + + // Mute + iLiveSession->MuteLcAudioL( ETrue ); + EUNIT_ASSERT( iLiveSession->iExplicitlyMuted ) + EUNIT_ASSERT( iLiveSession->IsLcAudioMutedL() ) + + // Unmute + iLiveSession->MuteLcAudioL( EFalse ); + EUNIT_ASSERT( !iLiveSession->iExplicitlyMuted ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_MuteLcMicL() + { + // Mute + iLiveSession->MuteLcMicL( ETrue ); + User::LeaveIfError( RProperty::Set( KPSUidTelMicrophoneMuteStatus, + KTelMicrophoneMuteState, + EPSTelMicMuteOn ) ); + EUNIT_ASSERT( iLiveSession->IsLcMicMutedL() ) + + // Unmute + iLiveSession->MuteLcMicL( EFalse ); + User::LeaveIfError( RProperty::Set( KPSUidTelMicrophoneMuteStatus, + KTelMicrophoneMuteState, + EPSTelMicMuteOff ) ); + EUNIT_ASSERT( !iLiveSession->IsLcMicMutedL() ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_EnableLcLoudspeakerL() + { + // Check that enabling the loudspeaker is allowed + EUNIT_ASSERT( iLiveSession->IsEnablingLcLoudspeakerAllowed() ) + + // Disable + iLiveSession->EnableLcLoudspeakerL( EFalse ); + EUNIT_ASSERT( !iLiveSession->IsLcLoudspeakerEnabled() ) + + // Enable + iLiveSession->EnableLcLoudspeakerL( ETrue ); + EUNIT_ASSERT( iLiveSession->IsLcLoudspeakerEnabled() ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_SetLcVolumeL() + { + ESTABLISH_OUT_SESSION( iLiveSession ) + + // Set volume + const TInt volume( 5 ); + iLiveSession->SetLcVolumeL( volume ); + EUNIT_ASSERT_EQUALS( volume, iLiveSession->LcVolumeL() ); + + // Increase volume + iLiveSession->IncreaseLcVolumeL(); + EUNIT_ASSERT_EQUALS( volume+1, iLiveSession->LcVolumeL() ); + + // Decrease volume + iLiveSession->DecreaseLcVolumeL(); + EUNIT_ASSERT_EQUALS( volume, iLiveSession->LcVolumeL() ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_GetSessionTimeL() + { + EUNIT_ASSERT( iLiveSession->GetSessionTime() < TTimeIntervalSeconds( 0 ) ); + + // Invite + iLiveSession->EstablishLcSessionL(); + + EUNIT_ASSERT( iLiveSession->GetSessionTime() < TTimeIntervalSeconds( 0 ) ); + + // Simulate establishment + iLiveSession->iSession->iState = CMceSession::EEstablished; + iLiveSession->iStartTime.HomeTime(); + + TTimeIntervalSeconds sessionTime = iLiveSession->GetSessionTime(); + EUNIT_ASSERT( sessionTime >= TTimeIntervalSeconds( 0 ) ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_HandleTerminationL() + { + // Try different values + iLiveSession->CMusEngMceSession::HandleTermination( KSipStatusCodeNoCodeSet, + KNullDesC8() ); + EUNIT_ASSERT_EQUALS( TInt( iLcSessionObserver->iCalledFunction ), + TInt( CLcSessionObserverStub::ESessionStateChanged ) ) + iLcSessionObserver->Reset(); + + iLiveSession->CMusEngMceSession::HandleTermination( KSipStatusCode200OK, + KNullDesC8() ); + EUNIT_ASSERT_EQUALS( TInt( iLcSessionObserver->iCalledFunction ), + TInt( CLcSessionObserverStub::ESessionStateChanged ) ) + iLcSessionObserver->Reset(); + + iLiveSession->CMusEngMceSession::HandleTermination( KSipStatusCodeUnknown, + KNullDesC8() ); + EUNIT_ASSERT_EQUALS( TInt( iLcSessionObserver->iCalledFunction ), + TInt( CLcSessionObserverStub::ESessionFailed ) ) + EUNIT_ASSERT_EQUALS( iLcSessionObserver->iError, KErrGeneral ) + iLcSessionObserver->Reset(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_AdjustVideoCodecL() + { + CRepository::SetStubAvcConfigKeysL( KNullDesC8() ); + + CMceVideoCodec* codecH263 = CMceH263Codec::NewLC( KMceSDPNameH263() ); + CMceVideoCodec* codecAvc = CMceAvcCodec::NewLC( KMceSDPNameH264() ); + CMceVideoCodec* codecAvcFromFile = CMceAvcCodec::NewLC( KMceSDPNameH264() ); + + iLiveSession->CMusEngMceSession::AdjustVideoCodecL( *codecH263, + KMceCameraSource ); + EUNIT_ASSERT( !iLiveSession->iStoreEncoderConfigInfo ) + + iLiveSession->CMusEngMceSession::AdjustVideoCodecL( *codecAvcFromFile, + KMceFileSource); + EUNIT_ASSERT( !iLiveSession->iStoreEncoderConfigInfo ) + + iLiveSession->CMusEngMceSession::AdjustVideoCodecL( *codecAvc, + KMceCameraSource ); + EUNIT_ASSERT( iLiveSession->iStoreEncoderConfigInfo ) + + CleanupStack::PopAndDestroy( codecAvcFromFile ); + CleanupStack::PopAndDestroy( codecAvc ); + CleanupStack::PopAndDestroy( codecH263 ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_AdjustAudioCodecL() + { + CMceAudioCodec* codec = + iLiveSession->iManager->SupportedAudioCodecs()[0]->CloneL(); + CleanupStack::PushL( codec ); + iLiveSession->CMusEngMceSession::AdjustAudioCodecL( *codec ); + + EUNIT_ASSERT( codec->iMMFPriority == KAudioPrioritySwisPlayback ) + EUNIT_ASSERT( codec->iMMFPriorityPreference == KAudioPrefSwisPlayback ) + + CleanupStack::PopAndDestroy( codec ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_RectChangedL() + { + // Does nothing before session establishment + + iLiveSession->RectChangedL(); + + ESTABLISH_OUT_SESSION( iLiveSession ); + + // Next leads to a call to RectChangedL() + iLiveSession->SetRectL( TRect( 100, 200, 300, 400 ) ); + + // Display size has been updated + + CMceDisplaySink* display = + MusEngMceUtils::GetDisplayL( *( iLiveSession->iSession ) ); + + EUNIT_ASSERT( display->DisplayRectL() == iLiveSession->Rect() ) + + // Terminate session and try again, rect must not be changed + + iLiveSession->iSession->iState = CMceSession::ETerminated; + + TRect newRect( 200, 300, 400, 500 ); + + iLiveSession->SetRectL( newRect ); + + EUNIT_ASSERT( display->DisplayRectL() != newRect ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_SetSessionSdpLinesL() + { + // set operator variant off + iReceiveSession->iOperatorVariant = EFalse; + CRepository::SetStubGlobal( MusSettingsKeys::KVideoBandwidth, + 128 ); + + // 1. There is b=AS line at session level + // => Xapplication, b=AS and b=TIAS set to session level + CMceInSession* inSession = CMceInSession::NewL( *iReceiveSession->iManager, + KTestOriginator ); + CleanupStack::PushL( inSession ); + EUNIT_ASSERT( !inSession->iSessionSDPLines ); + inSession->iSessionSDPLines = new ( ELeave ) CDesC8ArrayFlat( 1 ); + inSession->iSessionSDPLines->AppendL( KMusEngSessionSdpLineBandwidthField() ); + + iReceiveSession->SetSessionSdpLinesL( *inSession, ETrue ); + + MDesC8Array* sdpLines = inSession->iSessionSDPLines; + EUNIT_ASSERT( sdpLines ); + EUNIT_ASSERT( sdpLines->MdcaCount() == 3 ); + EUNIT_ASSERT( sdpLines->MdcaPoint( 0 ) == KMusEngSessionSdpLineXApplication() ); + EUNIT_ASSERT( sdpLines->MdcaPoint( 1 ).Find( + KMusEngSessionSdpLineBandwidthLine() ) == 0 ); + EUNIT_ASSERT( sdpLines->MdcaPoint( 2 ).Find( + KMusEngSessionSdpLineTiasLine() ) == 0 ); + + + // 2. There are b=TIAS sdp line at session + // => Xapplication, b=AS and b=TIAS set to session level + delete inSession->iSessionSDPLines; + inSession->iSessionSDPLines = NULL; + inSession->iSessionSDPLines = new ( ELeave ) CDesC8ArrayFlat( 1 ); + inSession->iSessionSDPLines->AppendL( KMusEngSessionSdpLineTiasLine() ); + + iReceiveSession->SetSessionSdpLinesL( *inSession, ETrue ); + + sdpLines = inSession->iSessionSDPLines; + EUNIT_ASSERT( sdpLines ); + EUNIT_ASSERT( sdpLines->MdcaCount() == 3 ); + EUNIT_ASSERT( sdpLines->MdcaPoint( 0 ) == KMusEngSessionSdpLineXApplication() ); + EUNIT_ASSERT( sdpLines->MdcaPoint( 1 ).Find( + KMusEngSessionSdpLineBandwidthLine() ) == 0 ); + EUNIT_ASSERT( sdpLines->MdcaPoint( 2 ).Find( + KMusEngSessionSdpLineTiasLine() ) == 0 ); + + // 3. Simulating outcoming session, i.e. 2d param aForceBandwidthLine is EFalse + // => only Xapplication SDP line is set + delete inSession->iSessionSDPLines; + inSession->iSessionSDPLines = NULL; + + iReceiveSession->SetSessionSdpLinesL( *inSession, EFalse ); + + sdpLines = inSession->iSessionSDPLines; + EUNIT_ASSERT( sdpLines ); + EUNIT_ASSERT( sdpLines->MdcaCount() == 1 ); + EUNIT_ASSERT( sdpLines->MdcaPoint( 0 ) == KMusEngSessionSdpLineXApplication() ); + + // 4. No KVideoBandwidth entry in CenRep => TIAS usage should be disabled + // There is AS and TIAS at session level => AS is taken at session level + CRepository::iForceFailWithCode = KErrNotFound; + delete inSession->iSessionSDPLines; + inSession->iSessionSDPLines = NULL; + inSession->iSessionSDPLines = new ( ELeave ) CDesC8ArrayFlat( 1 ); + inSession->iSessionSDPLines->AppendL( KMusEngSessionSdpLineTiasLine() ); + inSession->iSessionSDPLines->AppendL( KMusEngSessionSdpLineBandwidthField() ); + + iReceiveSession->SetSessionSdpLinesL( *inSession, ETrue ); + + sdpLines = inSession->iSessionSDPLines; + EUNIT_ASSERT( sdpLines ); + EUNIT_ASSERT( sdpLines->MdcaCount() == 2 ); + EUNIT_ASSERT( sdpLines->MdcaPoint( 0 ) == KMusEngSessionSdpLineXApplication() ); + EUNIT_ASSERT( sdpLines->MdcaPoint( 1 ) == KMusEngSessionSdpLineBandwidthField() ); + + CleanupStack::PopAndDestroy( inSession ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_SetSessionSdpLines_OperatorL() + { + // set operator variant + iReceiveSession->iOperatorVariant = ETrue; + + // 1. There is b=TIAS sdp line in session => only application and + // type lines are set, no bandwidth related attributes + CMceInSession* inSession = CMceInSession::NewL( *iReceiveSession->iManager, + KTestOriginator ); + CleanupStack::PushL( inSession ); + + EUNIT_ASSERT( !inSession->iSessionSDPLines ); + inSession->iSessionSDPLines = new ( ELeave ) CDesC8ArrayFlat( 1 ); + inSession->iSessionSDPLines->AppendL( KMusEngSessionSdpLineTiasLine() ); + + iReceiveSession->SetSessionSdpLinesL( *inSession, ETrue ); + + MDesC8Array* sdpLines = inSession->iSessionSDPLines; + EUNIT_ASSERT( sdpLines ); + EUNIT_ASSERT( sdpLines->MdcaCount() == 2 ); + EUNIT_ASSERT( sdpLines->MdcaPoint( 0 ) == KMusEngSessionSdpLineApplication() ); + EUNIT_ASSERT( sdpLines->MdcaPoint( 1 ) == KMusEngSessionSdpLineType() ); + + // 2. There are b=AS and b=TIAS sdp lines in session => application and + // type SDP lines as well as b=AS bandwidth attributes are set + delete inSession->iSessionSDPLines; + inSession->iSessionSDPLines = NULL; + inSession->iSessionSDPLines = new ( ELeave ) CDesC8ArrayFlat( 2 ); + inSession->iSessionSDPLines->AppendL( KMusEngSessionSdpLineBandwidthField() ); + inSession->iSessionSDPLines->AppendL( KMusEngSessionSdpLineTiasLine() ); + + iReceiveSession->SetSessionSdpLinesL( *inSession, ETrue ); + + sdpLines = inSession->iSessionSDPLines; + EUNIT_ASSERT( sdpLines ); + EUNIT_ASSERT( sdpLines->MdcaCount() == 3 ); + EUNIT_ASSERT( sdpLines->MdcaPoint( 0 ) == KMusEngSessionSdpLineApplication() ); + EUNIT_ASSERT( sdpLines->MdcaPoint( 1 ) == KMusEngSessionSdpLineType() ); + EUNIT_ASSERT( sdpLines->MdcaPoint( 2 ) == KMusEngSessionSdpLineBandwidthField() ); + + + // 3. Simulating outcoming session, i.e. 2d param aForceBandwidthLine is EFalse + // => only application and type SDP lines are set + delete inSession->iSessionSDPLines; + inSession->iSessionSDPLines = NULL; + + iReceiveSession->SetSessionSdpLinesL( *inSession, EFalse ); + + sdpLines = inSession->iSessionSDPLines; + EUNIT_ASSERT( sdpLines ); + EUNIT_ASSERT( sdpLines->MdcaCount() == 2 ); + EUNIT_ASSERT( sdpLines->MdcaPoint( 0 ) == KMusEngSessionSdpLineApplication() ); + EUNIT_ASSERT( sdpLines->MdcaPoint( 1 ) == KMusEngSessionSdpLineType() ); + + CleanupStack::PopAndDestroy( inSession ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_SetMediaSdpLinesL() + { + // set operator variant off + iReceiveSession->iOperatorVariant = EFalse; + CRepository::SetStubGlobal( MusSettingsKeys::KVideoBandwidth, + 128 ); + + // 1. There is no b=AS, b=TIAS sdp lines at session level + // => b=AS and b=TIAS are taken at media level + CMceInSession* inSession = CMceInSession::NewL( *iReceiveSession->iManager, + KTestOriginator ); + CleanupStack::PushL( inSession ); + + CMceVideoStream* videoStream = CMceVideoStream::NewLC(); + videoStream->SetSourceL( CMceRtpSource::NewLC() ); + CleanupStack::Pop(); //rtpSource + videoStream->AddSinkL( CMceDisplaySink::NewLC( *iReceiveSession->iManager ) ); + CleanupStack::Pop(); //displaySink + + inSession->AddStreamL( videoStream ); + CleanupStack::Pop( videoStream ); + + iReceiveSession->SetMediaSdpLinesL( *videoStream, ETrue ); + + MDesC8Array* sdpLines = inSession->Streams()[ 0 ]->iMediaSDPLines; + EUNIT_ASSERT( sdpLines ); + EUNIT_ASSERT( sdpLines->MdcaCount() == 2 ); + EUNIT_ASSERT( sdpLines->MdcaPoint( 0 ).Find( + KMusEngSessionSdpLineBandwidthLine() ) == 0 ); + EUNIT_ASSERT( sdpLines->MdcaPoint( 1 ).Find( + KMusEngSessionSdpLineTiasLine() ) == 0 ); + + + // 2. There is b=AS sdp line at session and media level + // => b=AS and b=TIAS are taken at media level + delete inSession->iSessionSDPLines; + inSession->iSessionSDPLines = NULL; + inSession->iSessionSDPLines = new ( ELeave ) CDesC8ArrayFlat( 1 ); + inSession->iSessionSDPLines->AppendL( KMusEngSessionSdpLineBandwidthField() ); + + iReceiveSession->SetMediaSdpLinesL( *videoStream, ETrue ); + + sdpLines = inSession->Streams()[ 0 ]->iMediaSDPLines; + EUNIT_ASSERT( sdpLines ); + EUNIT_ASSERT( sdpLines->MdcaCount() == 2 ); + EUNIT_ASSERT( sdpLines->MdcaPoint( 0 ).Find( + KMusEngSessionSdpLineBandwidthLine() ) == 0 ); + EUNIT_ASSERT( sdpLines->MdcaPoint( 1 ).Find( + KMusEngSessionSdpLineTiasLine() ) == 0 ); + + // 3. Simulating outcoming session, i.e. 2d param aForceBandwidthLine is EFalse + // => no bandwidth attributes at media level + delete inSession->iSessionSDPLines; + inSession->iSessionSDPLines = NULL; + + delete inSession->Streams()[ 0 ]->iMediaSDPLines; + inSession->Streams()[ 0 ]->iMediaSDPLines = NULL; + + iReceiveSession->SetMediaSdpLinesL( *videoStream, EFalse ); + + sdpLines = inSession->Streams()[ 0 ]->iMediaSDPLines; + EUNIT_ASSERT( sdpLines ); + EUNIT_ASSERT( sdpLines->MdcaCount() == 0 ); + + // 4. No KVideoBandwidth entry in CenRep => TIAS usage should be disabled + // There is no bandwidth attributes in session => AS is taken at meida level + CRepository::iForceFailWithCode = KErrNotFound; + delete inSession->iSessionSDPLines; + inSession->iSessionSDPLines = NULL; + + iReceiveSession->SetMediaSdpLinesL( *videoStream, ETrue ); + + sdpLines = inSession->Streams()[ 0 ]->iMediaSDPLines; + EUNIT_ASSERT( sdpLines ); + EUNIT_ASSERT( sdpLines->MdcaCount() == 1 ); + EUNIT_ASSERT( sdpLines->MdcaPoint( 0 ) == KMusEngSessionSdpLineBandwidthField() ); + + CleanupStack::PopAndDestroy( inSession ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_SetMediaSdpLines_OperatorL() + { + // set operator variant + iReceiveSession->iOperatorVariant = ETrue; + + // 1. There is no b=AS sdp line at session level + // => b=AS is taken at media level + CMceInSession* inSession = CMceInSession::NewL( *iReceiveSession->iManager, + KTestOriginator ); + CleanupStack::PushL( inSession ); + + CMceVideoStream* videoStream = CMceVideoStream::NewLC(); + videoStream->SetSourceL( CMceRtpSource::NewLC() ); + CleanupStack::Pop(); //rtpSource + videoStream->AddSinkL( CMceDisplaySink::NewLC( *iReceiveSession->iManager ) ); + CleanupStack::Pop(); //displaySink + + inSession->AddStreamL( videoStream ); + CleanupStack::Pop( videoStream ); + + EUNIT_ASSERT( !inSession->iSessionSDPLines ); + inSession->iSessionSDPLines = new ( ELeave ) CDesC8ArrayFlat( 1 ); + inSession->iSessionSDPLines->AppendL( KMusEngSessionSdpLineTiasLine() ); + + iReceiveSession->SetMediaSdpLinesL( *videoStream, ETrue ); + + MDesC8Array* sdpLines = inSession->Streams()[ 0 ]->iMediaSDPLines; + EUNIT_ASSERT( sdpLines ); + EUNIT_ASSERT( sdpLines->MdcaCount() == 1 ); + EUNIT_ASSERT( sdpLines->MdcaPoint( 0 ) == KMusEngSessionSdpLineBandwidthField() ); + + + // 2. There is b=AS sdp line at session and media level + // => b=AS is not taken at media level + delete inSession->iSessionSDPLines; + inSession->iSessionSDPLines = NULL; + inSession->iSessionSDPLines = new ( ELeave ) CDesC8ArrayFlat( 1 ); + inSession->iSessionSDPLines->AppendL( KMusEngSessionSdpLineBandwidthField() ); + + delete inSession->Streams()[ 0 ]->iMediaSDPLines; + inSession->Streams()[ 0 ]->iMediaSDPLines = NULL; + inSession->Streams()[ 0 ]->iMediaSDPLines = + new ( ELeave ) CDesC8ArrayFlat( 1 ); + inSession->Streams()[ 0 ]->iMediaSDPLines->AppendL( + KMusEngSessionSdpLineBandwidthField() ); + + iReceiveSession->SetMediaSdpLinesL( *videoStream, ETrue ); + + EUNIT_ASSERT( inSession->Streams()[ 0 ]->iMediaSDPLines ); + EUNIT_ASSERT( inSession->Streams()[ 0 ]->iMediaSDPLines->MdcaCount() == 0 ); + + + // 3. Simulating outcoming session, i.e. 2d param aForceBandwidthLine is EFalse + // => b=AS is taken at media level + delete inSession->iSessionSDPLines; + inSession->iSessionSDPLines = NULL; + + delete inSession->Streams()[ 0 ]->iMediaSDPLines; + inSession->Streams()[ 0 ]->iMediaSDPLines = NULL; + + iReceiveSession->SetMediaSdpLinesL( *videoStream, EFalse ); + + sdpLines = inSession->Streams()[ 0 ]->iMediaSDPLines; + EUNIT_ASSERT( sdpLines ); + EUNIT_ASSERT( sdpLines->MdcaCount() == 1 ); + EUNIT_ASSERT( sdpLines->MdcaPoint( 0 ) == KMusEngSessionSdpLineBandwidthField() ); + + CleanupStack::PopAndDestroy( inSession ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_AdjustStreamsAndCodecsL() + { + // Check that function cannot be called before creating the session + TRAPD( error, iClipSession->AdjustStreamsAndCodecsL() ); + MUS_TEST_FORWARD_ALLOC_FAILURE( error ); + EUNIT_ASSERT( error == KErrNotReady ); + + // Establishing a clip session leads to call to AdjustStreamsAndCodecsL + ESTABLISH_OUT_SESSION( iClipSession ) + + const RPointerArray& streams = + iClipSession->iSession->Streams(); + + TBool videoCodecFound = EFalse; + TBool audioCodecFound = EFalse; + + // Test that AdjustVideoCodecL and AdjustAudioCodecL have been called + CMceVideoStream* videoStream = NULL; + for ( TInt i = 0; i < streams.Count(); ++i ) + { + if ( streams[i]->Type() == KMceAudio ) + { + CMceAudioStream* audioStream = + static_cast( streams[i] ); + + const RPointerArray& codecs = audioStream->Codecs(); + + for ( TInt i = 0; i < codecs.Count(); ++i ) + { + audioCodecFound = ETrue; + + EUNIT_ASSERT( codecs[i]->MMFPriority() == + KAudioPrioritySwisPlayback ) + EUNIT_ASSERT( codecs[i]->MMFPriorityPreference() == + KAudioPrefSwisPlayback ) + } + } + else + { + videoStream = static_cast( streams[i] ); + + const RPointerArray& codecs = videoStream->Codecs(); + + for ( TInt i = 0; i < codecs.Count(); ++i ) + { + videoCodecFound = ETrue; + + EUNIT_ASSERT( codecs[i]->iPayloadType == 96 || + codecs[i]->iPayloadType == 98 ) + } + } + + } + + EUNIT_ASSERT( audioCodecFound ) // At least one audiocodec found + EUNIT_ASSERT( videoCodecFound ) // At least one videocodec found + + // Test removing of H.263 multiples (mode 2000 preferred) + EUNIT_ASSERT( videoStream != NULL ) + for ( TInt i = videoStream->Codecs().Count() - 1; i >= 0; i-- ) + { + videoStream->RemoveCodecL( + *const_cast( videoStream->Codecs()[ i ] ) ); + } + CMceH263Codec* codecH2632000 = CMceH263Codec::NewLC( KMceSDPNameH2632000() ); + videoStream->AddCodecL( codecH2632000 ); + CleanupStack::Pop( codecH2632000 ); + + CMceH263Codec* codecH2631998 = CMceH263Codec::NewLC( KMceSDPNameH2631998() ); + videoStream->AddCodecL( codecH2631998 ); + CleanupStack::Pop( codecH2631998 ); + + iClipSession->AdjustStreamsAndCodecsL(); + + // 1998 version should have been removed + for ( TInt i = 0; i < videoStream->Codecs().Count(); i++ ) + { + EUNIT_ASSERT( + !videoStream->Codecs()[ i ]->SdpName().CompareF( KMceSDPNameH2632000() ) ); + } + + // Test removing of multiples with different bitrates + for ( TInt i = videoStream->Codecs().Count() - 1; i >= 0; i-- ) + { + videoStream->RemoveCodecL( + *const_cast( videoStream->Codecs()[ i ] ) ); + } + codecH2632000 = CMceH263Codec::NewLC( KMceSDPNameH2632000() ); + codecH2632000->SetMaxBitrateL( 64000 ); + videoStream->AddCodecL( codecH2632000 ); + CleanupStack::Pop( codecH2632000 ); + + codecH2632000 = CMceH263Codec::NewLC( KMceSDPNameH2632000() ); + codecH2632000->SetMaxBitrateL( 128000 ); + videoStream->AddCodecL( codecH2632000 ); + CleanupStack::Pop( codecH2632000 ); + + iClipSession->AdjustStreamsAndCodecsL(); + + // Lower bitrate version should have been removed + for ( TInt i = 0; i < videoStream->Codecs().Count(); i++ ) + { + EUNIT_ASSERT( + videoStream->Codecs()[ i ]->MaxBitRate() == 128000 ); + } + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_IncomingSessionL() + { + // New session should get rejected and deleted in any case, first failure + CMceInSession* inSession = CMceInSession::NewL( + *iLiveSession->iManager, KNullDesC8 ); + CleanupStack::PushL( inSession ); + iLiveSession->IncomingSession( inSession, NULL ); + CleanupStack::Pop( inSession ); + + // And then succesfull case, this would leak memory if session was not + // deleted + inSession = CMceInSession::NewL( *iLiveSession->iManager, KNullDesC8 ); + CleanupStack::PushL( inSession ); + iLiveSession->IncomingSession( inSession, NULL ); + CleanupStack::Pop( inSession ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_IncomingUpdateL() + { + CMceInSession* inSession = CMceInSession::NewL( + *iLiveSession->iManager, KNullDesC8 ); + + // Try to update before having a session, session gets rejected and deleted + CleanupStack::PushL( inSession ); + iLiveSession->IncomingUpdate( *inSession, inSession, NULL ); + CleanupStack::Pop( inSession ); + + + // Try to update with unknown session, session gets rejected and deleted + ESTABLISH_OUT_SESSION( iLiveSession ) + + inSession = CMceInSession::NewL( + *iLiveSession->iManager, KNullDesC8 ); + CleanupStack::PushL( inSession ); + iLiveSession->IncomingUpdate( *inSession, inSession, NULL ); + CleanupStack::Pop( inSession ); + + // Normal case, old session gets deleted. New session gets rejected. + + inSession = CMceInSession::NewL( + *iLiveSession->iManager, KNullDesC8 ); + CleanupStack::PushL( inSession ); + iLiveSession->IncomingUpdate( *iLiveSession->iSession, inSession, NULL ); + CleanupStack::Pop( inSession ); + + EUNIT_ASSERT( iLiveSession->iSession == inSession ) + EUNIT_ASSERT( iLiveSession->iSession->iState == CMceSession::ETerminated ) + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_StreamStateChangedL() + { + // Try without a session, nothing happens + CMceAudioStream* audioStream = CMceAudioStream::NewLC(); + iLiveSession->CMusEngMceSession::StreamStateChanged( *audioStream ); + CleanupStack::PopAndDestroy( audioStream ); + + // Simulate sending invite + iLiveSession->EstablishLcSessionL(); + + // No observer set, so expect nothing to be done, cannot be asserted + CMceMediaStream* changedStream = iLiveSession->iSession->Streams()[0]; + + // Try all the stream states + + // EUninitialized, stream is created, unexpected change, nothing happens + changedStream->iState = CMceMediaStream::EUninitialized; + iLiveSession->CMusEngMceSession::StreamStateChanged( *changedStream ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + // EInitialized, stream is initialized + changedStream->iState = CMceMediaStream::EInitialized; + iLiveSession->CMusEngMceSession::StreamStateChanged( *changedStream ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + // EBuffering, stream is buffering + changedStream->iState = CMceMediaStream::EBuffering; + iLiveSession->CMusEngMceSession::StreamStateChanged( *changedStream ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + // EIdle, stream is not receiving RTP + changedStream->iState = CMceMediaStream::EIdle; + iLiveSession->CMusEngMceSession::StreamStateChanged( *changedStream ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + // EStreaming, stream is streaming + changedStream->iState = CMceMediaStream::EStreaming; + iLiveSession->CMusEngMceSession::StreamStateChanged( *changedStream ); + EUNIT_ASSERT_EQUALS( TInt( iLcSessionObserver->iCalledFunction ), + TInt( CLcSessionObserverStub::EPlayerStateChanged ) ) + iLcSessionObserver->Reset(); + + // EStreaming, stream is streaming, other than video out- or instream + changedStream->iState = CMceMediaStream::EStreaming; + iLiveSession->CMusEngMceSession::StreamStateChanged( + *iLiveSession->iSession->Streams()[1] ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + iLcSessionObserver->Reset(); + + // EDisabled, stream is explicitly disabled + changedStream->iState = CMceMediaStream::EDisabled; + iLiveSession->CMusEngMceSession::StreamStateChanged( *changedStream ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + // ENoResources, stream has no needed resources to stream + changedStream->iState = CMceMediaStream::ENoResources; + iLiveSession->CMusEngMceSession::StreamStateChanged( *changedStream ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + // ETranscodingRequired, stream requires non-realtime transcoding + changedStream->iState = CMceMediaStream::ETranscodingRequired; + iLiveSession->CMusEngMceSession::StreamStateChanged( *changedStream ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + // ETranscoding, stream is transcoding in non-realtime + changedStream->iState = CMceMediaStream::ETranscoding; + iLiveSession->CMusEngMceSession::StreamStateChanged( *changedStream ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + } + + +// ----------------------------------------------------------------------------- +// All the possibilities are tested in order to make sure unit tests are changed +// when function is changed +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_StreamStateChangedWithSourceL() + { + // Try without a session, nothing happens + iLiveSession->CMusEngMceSession::StreamStateChanged( + *CMceAudioStream::NewLC(), + *CMceRtpSource::NewLC() ); + + CleanupStack::PopAndDestroy(); // rtp + CleanupStack::PopAndDestroy(); // audiostream + + // Simulate sending invite + iLiveSession->EstablishLcSessionL(); + + // Try all the stream states + CMceMediaStream* changedStream = iLiveSession->iSession->Streams()[0]; + + // EUninitialized, stream is created, unexpected change, nothing happens + changedStream->iState = CMceMediaStream::EUninitialized; + iLiveSession->CMusEngMceSession::StreamStateChanged( *changedStream ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + // EInitialized, stream is initialized + changedStream->iState = CMceMediaStream::EInitialized; + iLiveSession->CMusEngMceSession::StreamStateChanged( *changedStream ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + // EBuffering, stream is buffering + changedStream->iState = CMceMediaStream::EBuffering; + iLiveSession->CMusEngMceSession::StreamStateChanged( *changedStream ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + // EIdle, stream is not receiving RTP + changedStream->iState = CMceMediaStream::EIdle; + iLiveSession->CMusEngMceSession::StreamStateChanged( *changedStream ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + // EStreaming, stream is streaming + changedStream->iState = CMceMediaStream::EStreaming; + iLiveSession->CMusEngMceSession::StreamStateChanged( *changedStream ); + EUNIT_ASSERT_EQUALS( TInt( iLcSessionObserver->iCalledFunction ), + TInt( CLcSessionObserverStub::EPlayerStateChanged ) ) + iLcSessionObserver->Reset(); + + // EDisabled, stream is explicitly disabled + changedStream->iState = CMceMediaStream::EDisabled; + iLiveSession->CMusEngMceSession::StreamStateChanged( *changedStream ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + // ENoResources, stream has no needed resources to stream + changedStream->iState = CMceMediaStream::ENoResources; + iLiveSession->CMusEngMceSession::StreamStateChanged( *changedStream ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + // ETranscodingRequired, stream requires non-realtime transcoding + changedStream->iState = CMceMediaStream::ETranscodingRequired; + iLiveSession->CMusEngMceSession::StreamStateChanged( *changedStream ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + // ETranscoding, stream is transcoding in non-realtime + changedStream->iState = CMceMediaStream::ETranscoding; + iLiveSession->CMusEngMceSession::StreamStateChanged( *changedStream ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + } + + +// ----------------------------------------------------------------------------- +// All the possibilities are tested in order to make sure unit tests are changed +// when function is changed +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_StreamStateChangedWithSinkL() + { + // Try without a session, nothing happens + CMceAudioStream* audioStream = CMceAudioStream::NewLC(); + iLiveSession->CMusEngMceSession::StreamStateChanged( *audioStream ); + CleanupStack::PopAndDestroy( audioStream ); + + // Simulate sending invite + iLiveSession->EstablishLcSessionL(); + + // Try all the stream states + CMceMediaStream* changedStream = iLiveSession->iSession->Streams()[0]; + + // EUninitialized, stream is created, unexpected change, nothing happens + changedStream->iState = CMceMediaStream::EUninitialized; + iLiveSession->CMusEngMceSession::StreamStateChanged( *changedStream ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + // EInitialized, stream is initialized + changedStream->iState = CMceMediaStream::EInitialized; + iLiveSession->CMusEngMceSession::StreamStateChanged( *changedStream ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + // EBuffering, stream is buffering + changedStream->iState = CMceMediaStream::EBuffering; + iLiveSession->CMusEngMceSession::StreamStateChanged( *changedStream ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + // EIdle, stream is not receiving RTP + changedStream->iState = CMceMediaStream::EIdle; + iLiveSession->CMusEngMceSession::StreamStateChanged( *changedStream ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + // EStreaming, stream is streaming + changedStream->iState = CMceMediaStream::EStreaming; + iLiveSession->CMusEngMceSession::StreamStateChanged( *changedStream ); + EUNIT_ASSERT_EQUALS( TInt( iLcSessionObserver->iCalledFunction ), + TInt( CLcSessionObserverStub::EPlayerStateChanged ) ) + iLcSessionObserver->Reset(); + + // EDisabled, stream is explicitly disabled + changedStream->iState = CMceMediaStream::EDisabled; + iLiveSession->CMusEngMceSession::StreamStateChanged( *changedStream ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + // ENoResources, stream has no needed resources to stream + changedStream->iState = CMceMediaStream::ENoResources; + iLiveSession->CMusEngMceSession::StreamStateChanged( *changedStream ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + // ETranscodingRequired, stream requires non-realtime transcoding + changedStream->iState = CMceMediaStream::ETranscodingRequired; + iLiveSession->CMusEngMceSession::StreamStateChanged( *changedStream ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + // ETranscoding, stream is transcoding in non-realtime + changedStream->iState = CMceMediaStream::ETranscoding; + iLiveSession->CMusEngMceSession::StreamStateChanged( *changedStream ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_SessionStateChangedL() + { + // Simulate sending invite + iLiveSession->EstablishLcSessionL(); + + // No container, so expect to be handled as internal error + iLiveSession->SessionStateChanged( *iLiveSession->iSession, NULL ); + EUNIT_ASSERT_EQUALS( TInt( iLcSessionObserver->iCalledFunction ), + TInt( CLcSessionObserverStub::ESessionFailed ) ) + EUNIT_ASSERT_EQUALS( iLcSessionObserver->iError, KErrGeneral ) + iLcSessionObserver->Reset(); + + // Try to tell session about some other session's state transition + + TMceTransactionDataContainer container; + + iLiveSession->SessionStateChanged( *iSomeOtherSession->iSession, &container ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + // Try all the normal cases: + + // EIdle + iLiveSession->iSession->iState = CMceSession::EIdle; + container.SetStatusCode( KSipStatusCodeNoCodeSet ); + // Set up any text to simulate reasonphrase + HBufC8* anyReasonPhrase = KTestOriginator().AllocL(); + container.SetReasonPhrase( anyReasonPhrase ); + iLiveSession->SessionStateChanged( *iLiveSession->iSession, + &container ); + EUNIT_ASSERT_EQUALS( TInt( iLcSessionObserver->iCalledFunction ), + TInt( CLcSessionObserverStub::ESessionFailed ) ) + EUNIT_ASSERT_EQUALS( iLcSessionObserver->iError, KErrGeneral ) + iLcSessionObserver->Reset(); + container.Clear(); + + // EOffering + iLiveSession->iSession->iState = CMceSession::EOffering; + container.SetStatusCode( KSipStatusCodeNoCodeSet ); + iLiveSession->SessionStateChanged( *iLiveSession->iSession, + &container ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + // EIncoming + iLiveSession->iSession->iState = CMceSession::EIncoming; + container.SetStatusCode( KSipStatusCodeNoCodeSet ); + iLiveSession->SessionStateChanged( *iLiveSession->iSession, + &container ); + EUNIT_ASSERT_EQUALS( TInt( iLcSessionObserver->iCalledFunction ), + TInt( CLcSessionObserverStub::ESessionFailed ) ) + EUNIT_ASSERT_EQUALS( iLcSessionObserver->iError, KErrGeneral ) + iLcSessionObserver->Reset(); + + // EReserving + iLiveSession->iSession->iState = CMceSession::EReserving; + container.SetStatusCode( KSipStatusCodeNoCodeSet ); + iLiveSession->SessionStateChanged( *iLiveSession->iSession, + &container ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + // EAnswering + iLiveSession->iSession->iState = CMceSession::EAnswering; + container.SetStatusCode( KSipStatusCodeNoCodeSet ); + iLiveSession->SessionStateChanged( *iLiveSession->iSession, + &container ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + // EProceeding + iLiveSession->iSession->iState = CMceSession::EProceeding; + container.SetStatusCode( KSipStatusCodeNoCodeSet ); + iLiveSession->SessionStateChanged( *iLiveSession->iSession, + &container ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + // EEstablished + iLiveSession->iSession->iState = CMceSession::EEstablished; + container.SetStatusCode( KSipStatusCode200OK ); + iLiveSession->SessionStateChanged( *iLiveSession->iSession, + &container ); + EUNIT_ASSERT_EQUALS( TInt( iLcSessionObserver->iCalledFunction ), + TInt( CLcSessionObserverStub::ESessionStateChanged ) ) + iLcSessionObserver->Reset(); + + // EEstablished again (meaning expiration of session timer + // and refresment of session ) + iLiveSession->iSession->iState = CMceSession::EEstablished; + container.SetStatusCode( KSipStatusCode200OK ); + iLiveSession->SessionStateChanged( *iLiveSession->iSession, + &container ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + // ECancelling + iLiveSession->iSession->iState = CMceSession::ECancelling; + container.SetStatusCode( KSipStatusCodeNoCodeSet ); + iLiveSession->SessionStateChanged( *iLiveSession->iSession, + &container ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + iLcSessionObserver->Reset(); + + // ETerminating + iLiveSession->iSession->iState = CMceSession::ETerminating; + container.SetStatusCode( KSipStatusCodeNoCodeSet ); + iLiveSession->SessionStateChanged( *iLiveSession->iSession, + &container ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + iLcSessionObserver->Reset(); + + // ETerminated + iLiveSession->iSession->iState = CMceSession::ETerminated; + container.SetStatusCode( KSipStatusCode200OK ); + iLiveSession->SessionStateChanged( *iLiveSession->iSession, + &container ); + EUNIT_ASSERT_EQUALS( TInt( iLcSessionObserver->iCalledFunction ), + TInt( CLcSessionObserverStub::ESessionStateChanged ) ) + iLcSessionObserver->Reset(); + + // Default case + iLiveSession->iSession->iState = static_cast( 10 ); + container.SetStatusCode( KSipStatusCodeNoCodeSet ); + iLiveSession->SessionStateChanged( *iLiveSession->iSession, &container ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_HandleSessionStateChanged_EncoderKeyStoringL() + { + // Make repository empty, config keys must be written + CRepository::SetStubAvcConfigKeysL( KNullDesC8() ); + + // Invite + iLiveSession->EstablishLcSessionL(); + iLiveSession->iSession->iState = CMceSession::EEstablished; + + // Force failure on CenRep + CRepository::iForceFailWithCode = KErrNoMemory; + + // Simulate session state transition notification + iLiveSession->HandleSessionStateChanged( + *iLiveSession->iSession, 200, KNullDesC8() ); + EUNIT_ASSERT_EQUALS( TInt( iLcSessionObserver->iCalledFunction ), + TInt( CLcSessionObserverStub::ESessionFailed ) ) + EUNIT_ASSERT_EQUALS( iLcSessionObserver->iError, KErrNoMemory ) + + // Normal case, something will be written to CenRep + iClipSession->EstablishLcSessionL(); + iClipSession->iSession->iState = CMceSession::EEstablished; + iClipSession->HandleSessionStateChanged( + *iClipSession->iSession, 200, KNullDesC8() ); + HBufC8* info = MultimediaSharingSettings::EncoderConfigInfoLC(); + EUNIT_ASSERT_NOT_EQUALS( *info, KMusAvcBitrateLevel_1b_ConfigKey() ) + CleanupStack::PopAndDestroy( info ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_SessionConnectionStateChangedL() + { + + // Try to tell session about another session's connection state change + + iLiveSession->SessionConnectionStateChanged( *iSomeOtherSession->iSession, + ETrue ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); // No session yet, nothing happened + + // Simulate sending invite + iLiveSession->EstablishLcSessionL(); + + // Now try again to notify session about session connection state change + // of an another session + iLiveSession->SessionConnectionStateChanged( *iSomeOtherSession->iSession, + ETrue ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); // Wrong session, nothing happened + + // Try tell session connection state is active + iLiveSession->SessionConnectionStateChanged( *iLiveSession->iSession, + ETrue ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); // Session active, nothing happened + + // Try tell session connection state is inactive + iLiveSession->SessionConnectionStateChanged( *iLiveSession->iSession, + EFalse ); + EUNIT_ASSERT_EQUALS( TInt( iLcSessionObserver->iCalledFunction ), + TInt( CLcSessionObserverStub::ESessionFailed ) ) + EUNIT_ASSERT_EQUALS( iLcSessionObserver->iError, + TInt( MLcSession::EConnectionLost ) ) + iLcSessionObserver->Reset(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_FailedL() + { + // Try to tell session about failure of another session + + iLiveSession->Failed( *iSomeOtherSession->iSession, 0 ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); // No session yet, nothing happened + + // Simulate sending invite + iLiveSession->EstablishLcSessionL(); + + // Now try again to notify session about failure of an another session + iLiveSession->Failed( *iSomeOtherSession->iSession, 0 ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); // Wrong session, nothing happened + + // Tell session that it has failed + iLiveSession->Failed( *iLiveSession->iSession, KErrNotFound ); + EUNIT_ASSERT_EQUALS( TInt( iLcSessionObserver->iCalledFunction ), + TInt( CLcSessionObserverStub::ESessionFailed ) ) + EUNIT_ASSERT_EQUALS( iLcSessionObserver->iError, KErrNotFound ) + iLcSessionObserver->Reset(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_UpdateFailedL() + { + // Try to tell session about update failure of another session + iLiveSession->UpdateFailed( *iSomeOtherSession->iSession, NULL ); + EUNIT_ASSERT_EQUALS( TInt( iLcSessionObserver->iCalledFunction ), + TInt( CLcSessionObserverStub::ESessionFailed ) ) + EUNIT_ASSERT_EQUALS( iLcSessionObserver->iError, KErrGeneral ) + iLcSessionObserver->Reset(); + + // Try again with container + TMceTransactionDataContainer container; + iLiveSession->UpdateFailed( *iSomeOtherSession->iSession, &container ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); // No session yet, nothing happened + + // Invite and try again. + iLiveSession->EstablishLcSessionL(); + iLiveSession->UpdateFailed( *iSomeOtherSession->iSession, &container ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); // Wrong session, nothing happened¨ + + // Try with right session + iLiveSession->UpdateFailed( *iLiveSession->iSession, &container ); + EUNIT_ASSERT_EQUALS( TInt( iLcSessionObserver->iCalledFunction ), + TInt( CLcSessionObserverStub::ESessionFailed ) ) + EUNIT_ASSERT_EQUALS( iLcSessionObserver->iError, KErrGeneral ) + iLcSessionObserver->Reset(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_SRReceivedL() + { + EUNIT_ASSERT( iLiveSession->iSecondsFromLastRtcpReport == 0 ); + + // No session yet, nothing happens + iLiveSession->SRReceived( *iSomeOtherSession->iSession, + *(iSomeOtherSession->iSession->Streams()[0]) ); + + EUNIT_ASSERT( iLiveSession->iSecondsFromLastRtcpReport == 0 ); + + ESTABLISH_OUT_SESSION( iLiveSession ); + + // Simulate bigger value + iLiveSession->iSecondsFromLastRtcpReport = 10; + + // We have session, but informing concearn wrong session, timer is + // not nullified + iLiveSession->SRReceived( *iSomeOtherSession->iSession, + *(iSomeOtherSession->iSession->Streams()[0]) ); + + EUNIT_ASSERT( iLiveSession->iSecondsFromLastRtcpReport == 10 ); + + // Right session but wrong stream, timer should not be nullified + iLiveSession->SRReceived( *iLiveSession->iSession, + *(iSomeOtherSession->iSession->Streams()[0]) ); + + EUNIT_ASSERT( iLiveSession->iSecondsFromLastRtcpReport == 10 ); + + // Right stream and established session, timer should be nullified + + + iLiveSession->SRReceived( *iLiveSession->iSession, + *(iLiveSession->iSession->Streams()[0]) ); + + EUNIT_ASSERT( iLiveSession->iSecondsFromLastRtcpReport == 0 ); + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_RRReceivedL() + { + EUNIT_ASSERT( iLiveSession->iSecondsFromLastRtcpReport == 0 ); + + // No session yet, nothing happens + iLiveSession->RRReceived( *iSomeOtherSession->iSession, + *(iSomeOtherSession->iSession->Streams()[0]) ); + + EUNIT_ASSERT( iLiveSession->iSecondsFromLastRtcpReport == 0 ); + + ESTABLISH_OUT_SESSION( iLiveSession ); + + // Simulate bigger value + iLiveSession->iSecondsFromLastRtcpReport = 10; + + // We have session, but informing concearn wrong session, timer is + // not nullified + iLiveSession->RRReceived( *iSomeOtherSession->iSession, + *(iSomeOtherSession->iSession->Streams()[0]) ); + + EUNIT_ASSERT( iLiveSession->iSecondsFromLastRtcpReport == 10 ); + + // Right session but wrong stream, timer should not be nullified + iLiveSession->RRReceived( *iLiveSession->iSession, + *(iSomeOtherSession->iSession->Streams()[0]) ); + + EUNIT_ASSERT( iLiveSession->iSecondsFromLastRtcpReport == 10 ); + + // Right stream and established session, timer should be nullified + + + iLiveSession->RRReceived( *iLiveSession->iSession, + *(iLiveSession->iSession->Streams()[0]) ); + + EUNIT_ASSERT( iLiveSession->iSecondsFromLastRtcpReport == 0 ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_SsrcAddedL() + { + // As CMusEngMceSession::SsrcAdded is expected to do nothing, just call + // it to make sure it does not weaken the test coverage + + CMceRtpSource* rtpSource = static_cast( + iReceiveSession->iSession->Streams()[0]->Source() ); + iReceiveSession->SsrcAdded( + *iReceiveSession->iSession->Streams()[0], + *rtpSource, + 0 ); + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_SsrcRemovedL() + { + // As CMusEngMceSession::SsrcRemoved is expected to do nothing, just call + // it to make sure it does not weaken the test coverage + + CMceRtpSource* rtpSource = static_cast( + iReceiveSession->iSession->Streams()[0]->Source() ); + + iReceiveSession->SsrcRemoved( + *iReceiveSession->iSession->Streams()[0], + *rtpSource, + 0 ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_UpdateTimerEventL() + { + iLcSessionObserver->Reset(); + iLiveSession->UpdateTimerEvent(); + EUNIT_ASSERT_EQUALS( TInt( iLcSessionObserver->iCalledFunction ), + TInt( CLcSessionObserverStub::EUnknown ) ) + EUNIT_ASSERT( iLiveSession->iUpdateTimer->IsActive() ) + iLiveSession->iUpdateTimer->Cancel(); + iLcSessionObserver->Reset(); + + iLiveSession->iSecondsFromLastRtcpReport = 25; // >KMusEngRtcpInactivityThreshold + iLiveSession->UpdateTimerEvent(); + EUNIT_ASSERT_EQUALS( TInt( iLcSessionObserver->iCalledFunction ), + TInt( CLcSessionObserverStub::ESessionFailed ) ) + EUNIT_ASSERT_EQUALS( iLcSessionObserver->iError, + TInt( MLcSession::EMediaInactivityTimeout ) ) + EUNIT_ASSERT( iLiveSession->iUpdateTimer->IsActive() ) + iLiveSession->iUpdateTimer->Cancel(); + iLcSessionObserver->Reset(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_IsRoamingBetweenAPsAllowedL() + { + // No session + EUNIT_ASSERT( iLiveSession->IsRoamingBetweenAPsAllowed() ) + + // Session idle + iLiveSession->EstablishLcSessionL(); + iLiveSession->iSession->iState = CMceSession::EIdle; + EUNIT_ASSERT( iLiveSession->IsRoamingBetweenAPsAllowed() ) + + // Session established + iLiveSession->iSession->iState = CMceSession::EEstablished; + EUNIT_ASSERT( !iLiveSession->IsRoamingBetweenAPsAllowed() ) + + // Session terminated + iLiveSession->iSession->iState = CMceSession::ETerminated; + EUNIT_ASSERT( iLiveSession->IsRoamingBetweenAPsAllowed() ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_SaveContactL() + { + _LIT8( KTestSaveContactAddr, "sip:abc@10.10.10.10"); + + User::LeaveIfError( RProperty::Set( NMusSessionApi::KCategoryUid, + NMusSessionApi::KTelNumber, + _L("12341234") ) ); + + // Operator variant + iLiveSession->iOperatorVariant = ETrue; + MUSENG_EUNIT_ASSERT_SPECIFIC_LEAVE( + iLiveSession->SaveContactL( KTestSaveContactAddr ), KErrNotSupported ) + + // No address to save + iLiveSession->iOperatorVariant = EFalse; + MUSENG_EUNIT_ASSERT_SPECIFIC_LEAVE( + iLiveSession->SaveContactL( KNullDesC8 ), KErrArgument ) + + // Contact id KErrNotSupported (multiple matching contacts) + User::LeaveIfError( RProperty::Set( NMusSessionApi::KCategoryUid, + NMusSessionApi::KContactId, + KErrNotSupported ) ); + + MUSENG_EUNIT_ASSERT_SPECIFIC_LEAVE( + iLiveSession->SaveContactL( KTestSaveContactAddr ), KErrNotFound ) + + // SIP field exists already + User::LeaveIfError( RProperty::Set( NMusSessionApi::KCategoryUid, + NMusSessionApi::KContactId, + 2 ) ); + + ContactEngineStubHelper::SetSIPFieldFound( ETrue ); + MUSENG_EUNIT_ASSERT_SPECIFIC_LEAVE( + iLiveSession->SaveContactL( KTestSaveContactAddr ), KErrAlreadyExists ) + + // No correct field in fields info + ContactEngineStubHelper::Reset(); + ContactEngineStubHelper::SetSIPFieldInfoFound( EFalse ); + MUSENG_EUNIT_ASSERT_SPECIFIC_LEAVE( + iLiveSession->SaveContactL( KTestSaveContactAddr ), KErrNotFound ) + + // Success + ContactEngineStubHelper::Reset(); + iLiveSession->SaveContactL( KTestSaveContactAddr ); + EUNIT_ASSERT( ContactEngineStubHelper::GetCalledFunction() == EContactEngineStubSetText ); + + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_RectL() + { + iLiveSession->SetRectL( TRect( 0, 0, 100, 100 ) ); + TRect rect = iLiveSession->Rect(); + + // Initial values + EUNIT_ASSERT( rect.iTl.iX == 0 ); + EUNIT_ASSERT( rect.iTl.iY == 0 ); + EUNIT_ASSERT( rect.iBr.iX == 100 ); + EUNIT_ASSERT( rect.iBr.iY == 100 ); + + iLiveSession->iRect.iTl.iX = 100; + iLiveSession->iRect.iTl.iY = 200; + iLiveSession->iRect.iBr.iX = 300; + iLiveSession->iRect.iBr.iY = 400; + + rect = iLiveSession->Rect(); + + EUNIT_ASSERT( rect.iTl.iX == 100 ); + EUNIT_ASSERT( rect.iTl.iY == 200 ); + EUNIT_ASSERT( rect.iBr.iX == 300 ); + EUNIT_ASSERT( rect.iBr.iY == 400 ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_SetRectLL() + { + TRect rect; + + rect.iTl.iX = 100; + rect.iTl.iY = 200; + rect.iBr.iX = 300; + rect.iBr.iY = 400; + + iLiveSession->SetRectL( rect ); + + EUNIT_ASSERT( iLiveSession->iRect.iTl.iX == 100 ); + EUNIT_ASSERT( iLiveSession->iRect.iTl.iY == 200 ); + EUNIT_ASSERT( iLiveSession->iRect.iBr.iX == 300 ); + EUNIT_ASSERT( iLiveSession->iRect.iBr.iY == 400 ); + + ESTABLISH_OUT_SESSION( iLiveSession ); + + CMceDisplaySink* display = + MusEngMceUtils::GetDisplayL( *( iLiveSession->iSession ) ); + TRect displayRect = display->DisplayRectL(); + + EUNIT_ASSERT( displayRect.iTl.iX == 100 ); + EUNIT_ASSERT( displayRect.iTl.iY == 200 ); + EUNIT_ASSERT( displayRect.iBr.iX == 300 ); + EUNIT_ASSERT( displayRect.iBr.iY == 400 ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_SecondaryRectL() + { + iLiveSession->SetSecondaryRectL( TRect( 0, 0, 100, 100 ) ); + TRect rect = iLiveSession->SecondaryRect(); + + // Initial values + EUNIT_ASSERT( rect.iTl.iX == 0 ); + EUNIT_ASSERT( rect.iTl.iY == 0 ); + EUNIT_ASSERT( rect.iBr.iX == 100 ); + EUNIT_ASSERT( rect.iBr.iY == 100 ); + + iLiveSession->iRect.iTl.iX = 100; + iLiveSession->iRect.iTl.iY = 200; + iLiveSession->iRect.iBr.iX = 300; + iLiveSession->iRect.iBr.iY = 400; + + rect = iLiveSession->SecondaryRect(); + + EUNIT_ASSERT( rect.iTl.iX == 100 ); + EUNIT_ASSERT( rect.iTl.iY == 200 ); + EUNIT_ASSERT( rect.iBr.iX == 300 ); + EUNIT_ASSERT( rect.iBr.iY == 400 ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_SetSecondaryRectLL() + { + TRect rect; + + rect.iTl.iX = 100; + rect.iTl.iY = 200; + rect.iBr.iX = 300; + rect.iBr.iY = 400; + + iLiveSession->SetSecondaryRectL( rect ); + + EUNIT_ASSERT( iLiveSession->iRect.iTl.iX == 100 ); + EUNIT_ASSERT( iLiveSession->iRect.iTl.iY == 200 ); + EUNIT_ASSERT( iLiveSession->iRect.iBr.iX == 300 ); + EUNIT_ASSERT( iLiveSession->iRect.iBr.iY == 400 ); + + ESTABLISH_OUT_SESSION( iLiveSession ); + + CMceDisplaySink* display = + MusEngMceUtils::GetDisplayL( *( iLiveSession->iSession ) ); + TRect displayRect = display->DisplayRectL(); + + EUNIT_ASSERT( displayRect.iTl.iX == 100 ); + EUNIT_ASSERT( displayRect.iTl.iY == 200 ); + EUNIT_ASSERT( displayRect.iBr.iX == 300 ); + EUNIT_ASSERT( displayRect.iBr.iY == 400 ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_EnableDisplayLL() + { + TRAPD( error, iLiveSession->EnableDisplayL( ETrue ) ); + MUS_TEST_FORWARD_ALLOC_FAILURE( error ); + EUNIT_ASSERT( error == KErrNotReady ); + + ESTABLISH_OUT_SESSION( iLiveSession ); + + CMceDisplaySink* display = + MusEngMceUtils::GetDisplayL( *(iLiveSession->iSession) ); + + // Disable + iLiveSession->EnableDisplayL( EFalse ); + + EUNIT_ASSERT( !display->iIsEnabled ); + + // Try to disable again, request should be ignored + + iLiveSession->EnableDisplayL( EFalse ); + + EUNIT_ASSERT( !display->iIsEnabled ); + + // Enable + + iLiveSession->EnableDisplayL( ETrue ); + + EUNIT_ASSERT( display->iIsEnabled ); + + // Try to enable again, request should be ignored + + iLiveSession->EnableDisplayL( ETrue ); + + EUNIT_ASSERT( display->iIsEnabled ); + + EUNIT_ASSERT( iLiveSession->IsDisplayEnabled() ) + EUNIT_ASSERT( iLiveSession->IsDisplayActive() ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_CMusEngMceSession_SetOrientationLL() + { + // Try without session, fails + EUNIT_ASSERT_SPECIFIC_LEAVE( iLiveSession->SetOrientationL( + CMusEngMceSession::EPortrait ), + KErrNotReady ) + + // Establish a session + ESTABLISH_OUT_SESSION( iLiveSession ) + + CMceDisplaySink* display = + MusEngMceUtils::GetDisplayL( *iLiveSession->iSession ); + + // Check the initial state + display->iRotation = CMceDisplaySink::ENone; + EUNIT_ASSERT_EQUALS( iLiveSession->OrientationL(), + CMusEngMceSession::EPortrait ) + + // Successfully change orientation + + iLiveSession->SetOrientationL( CMusEngMceSession::ELandscape ); + EUNIT_ASSERT_EQUALS( iLiveSession->OrientationL(), + CMusEngMceSession::ELandscape ) + + iLiveSession->SetOrientationL( CMusEngMceSession::EPortrait ); + EUNIT_ASSERT_EQUALS( iLiveSession->OrientationL(), + CMusEngMceSession::EPortrait ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_SetEncodingDeviceLL() + { + CMceAvcCodec* codec = CMceAvcCodec::NewLC( KMceSDPNameH264() ); + + // Generic error in CenRep, leave expected + CRepository::iForceFailWithCode = KErrNotReady; + EUNIT_ASSERT_LEAVE( iLiveSession->SetEncodingDeviceL( *codec ) ) + EUNIT_ASSERT_EQUALS( codec->iEncodingDecodingDevice, TUid::Uid( 0 ) ) + + // No entry in CenRep, default value expected + CRepository::iForceFailWithCode = KErrNotFound; + const TUid KDefaultEncodingDevice( TUid::Uid( 0x20001C13 ) ); + iLiveSession->SetEncodingDeviceL( *codec ); + EUNIT_ASSERT_EQUALS( codec->iEncodingDecodingDevice, + KDefaultEncodingDevice ) + + // Entry in CenRep + const TInt KSomeEncodingDevice( 0x20001C15 ); + CRepository::iStaticEncoderUid = KSomeEncodingDevice; + iLiveSession->SetEncodingDeviceL( *codec ); + EUNIT_ASSERT_EQUALS( codec->iEncodingDecodingDevice, + TUid::Uid( KSomeEncodingDevice ) ) + + CleanupStack::PopAndDestroy( codec ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_SetCodecConfigKeyLL() + { + CMceAvcCodec* codec = CMceAvcCodec::NewLC( KMceSDPNameH264() ); + codec->SetAllowedBitrates( KMceAvcBitrateLevel1b ); + + // Generic error in CenRep, leave expected + CRepository::iForceFailWithCode = KErrNotReady; + EUNIT_ASSERT_LEAVE( iLiveSession->SetCodecConfigKeyL( *codec ) ); + EUNIT_ASSERT( !codec->iConfigKey ) + EUNIT_ASSERT( !iLiveSession->iStoreEncoderConfigInfo ) + CRepository::iForceFailWithCode = KErrNone; + + // No entry in CenRep, nothing happens + iLiveSession->SetCodecConfigKeyL( *codec ); + EUNIT_ASSERT( !codec->iConfigKey ) + EUNIT_ASSERT( !iLiveSession->iStoreEncoderConfigInfo ) + + // Empty entry in CenRep + CRepository::SetStubAvcConfigKeysL( KNullDesC8() ); + iLiveSession->SetCodecConfigKeyL( *codec ); + EUNIT_ASSERT( !codec->iConfigKey ) + EUNIT_ASSERT( iLiveSession->iStoreEncoderConfigInfo ) + iLiveSession->iStoreEncoderConfigInfo = EFalse; // emulate original situation + + // Entry in CenRep + CRepository::SetStubAvcConfigKeysL( KMusAvcBitrateLevel_1b_ConfigKey ); + iLiveSession->SetCodecConfigKeyL( *codec ); + EUNIT_ASSERT( codec->iConfigKey ) + HBufC8* key = codec->ConfigKeyL(); + CleanupStack::PushL( key ); + EUNIT_ASSERT_EQUALS( *key, KMusAvcBitrateLevel1bTestText() ) + CleanupStack::PopAndDestroy( key ); + EUNIT_ASSERT( !iLiveSession->iStoreEncoderConfigInfo ) + + CleanupStack::PopAndDestroy( codec ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_ReadCodecConfigKeyLL() + { + HBufC8* key( NULL ); + + // Try with H263, leave expected + CMceVideoCodec* codecH263 = CMceH263Codec::NewLC( KMceSDPNameH263() ); + EUNIT_ASSERT_LEAVE( key = iLiveSession->ReadCodecConfigKeyL( *codecH263 ) ) + CleanupStack::PopAndDestroy( codecH263 ); + + // Try without an entry in CenRep, leave expected + CMceVideoCodec* codec = CMceAvcCodec::NewLC( KMceSDPNameH264() ); + codec->SetAllowedBitrates( 0 | KMceAvcBitrateLevel1 ); + EUNIT_ASSERT_LEAVE( key = iLiveSession->ReadCodecConfigKeyL( *codec ) ) + + // Create CenRep entry which does not include wanted bitrate, NULL value + // expected + CRepository::SetStubAvcConfigKeysL( KMusAvcBitrateLevel1bTestText() ); + key = iLiveSession->ReadCodecConfigKeyL( *codec ); + EUNIT_ASSERT( !key ) + + // Create entry with all AVC keys and try with all the values + CRepository::SetStubAvcConfigKeysL( KMusAvcAllLevelsConcatenation() ); + + // KMceAvcBitrateLevel1 + key = iLiveSession->ReadCodecConfigKeyL( *codec ); + EUNIT_ASSERT( key ); + CleanupStack::PushL( key ); + EUNIT_ASSERT_EQUALS( *key, KMusAvcBitrateLevel1TestText ); + CleanupStack::PopAndDestroy( key ); + + // KMceAvcBitrateLevel1b + codec->SetAllowedBitrates( KMceAvcBitrateLevel1b ); + key = iLiveSession->ReadCodecConfigKeyL( *codec ); + EUNIT_ASSERT( key ); + CleanupStack::PushL( key ); + EUNIT_ASSERT_EQUALS( *key, KMusAvcBitrateLevel1bTestText ); + CleanupStack::PopAndDestroy( key ); + + // KMceAvcBitrateLevel1_1 + codec->SetAllowedBitrates( KMceAvcBitrateLevel1_1 ); + key = iLiveSession->ReadCodecConfigKeyL( *codec ); + EUNIT_ASSERT( key ); + CleanupStack::PushL( key ); + EUNIT_ASSERT_EQUALS( *key, KMusAvcBitrateLevel1_1TestText ); + CleanupStack::PopAndDestroy( key ); + + // KMceAvcBitrateLevel1_2 + codec->SetAllowedBitrates( KMceAvcBitrateLevel1_2 ); + key = iLiveSession->ReadCodecConfigKeyL( *codec ); + EUNIT_ASSERT( key ); + CleanupStack::PushL( key ); + EUNIT_ASSERT_EQUALS( *key, KMusAvcBitrateLevel1_2TestText ); + CleanupStack::PopAndDestroy( key ); + + // KMceAvcBitrateLevel1_3 + codec->SetAllowedBitrates( KMceAvcBitrateLevel1_3 ); + key = iLiveSession->ReadCodecConfigKeyL( *codec ); + EUNIT_ASSERT( key ); + CleanupStack::PushL( key ); + EUNIT_ASSERT_EQUALS( *key, KMusAvcBitrateLevel1_3TestText ); + CleanupStack::PopAndDestroy( key ); + + // KMceAvcBitrateLevel2 + codec->SetAllowedBitrates( KMceAvcBitrateLevel2 ); + key = iLiveSession->ReadCodecConfigKeyL( *codec ); + EUNIT_ASSERT( key ); + CleanupStack::PushL( key ); + EUNIT_ASSERT_EQUALS( *key, KMusAvcBitrateLevel2TestText ); + CleanupStack::PopAndDestroy( key ); + + CleanupStack::PopAndDestroy( codec ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_StoreEncoderConfigInfoLL() + { + CRepository::iStaticWriteAvcKeysToStaticData = ETrue; + + // Try with clean CenRep + MultimediaSharingSettings::SetEncoderConfigInfoL( KNullDesC8() ); + + ESTABLISH_OUT_SESSION( iLiveSession ) // calls StoreEncoderConfigInfoL + // If StoreEncoderConfigInfoL leaves with KErrNoMemory, + // MMusEngSessionObserver::SessionFailed will be called. + if ( iLcSessionObserver->iCalledFunction == CLcSessionObserverStub::ESessionFailed ) + { + User::Leave( KErrNoMemory ); + } + + HBufC8* keys = MultimediaSharingSettings::EncoderConfigInfoLC(); + EUNIT_ASSERT_EQUALS( *keys, KMusAvcBitrateLevel_1b_ConfigKey() ) + CleanupStack::PopAndDestroy( keys ); + + // Try without a clean CenRep + MultimediaSharingSettings::SetEncoderConfigInfoL( + KMusAvcBitrateLevel_1_1_ConfigKey() ); + + delete iLiveSession; + iLiveSession = NULL; + iLiveSession = CMusEngLiveSession::NewL(); + iLiveSession->SetLcSessionObserver( iLcSessionObserver ); + iLiveSession->SetLcUiProvider( iLcUiProvider ); + + ESTABLISH_OUT_SESSION( iLiveSession ) // calls StoreEncoderConfigInfoL + // If StoreEncoderConfigInfoL leaves with KErrNoMemory, + // MMusEngSessionObserver::SessionFailed will be called. + if ( iLcSessionObserver->iCalledFunction == CLcSessionObserverStub::ESessionFailed ) + { + User::Leave( KErrNoMemory ); + } + + keys = MultimediaSharingSettings::EncoderConfigInfoLC(); + EUNIT_ASSERT_EQUALS( *keys, + KMusAvcBitrateLevels_1_1_And_1b_ConfigKeys() ) + CleanupStack::PopAndDestroy( keys ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_StreamStreamingL() + { + // Wrong stream type, no callbacks to MLcSessionObserver + CMceAudioStream* audioStream = CMceAudioStream::NewLC(); + iLiveSession->StreamStreaming( *audioStream ); + CleanupStack::PopAndDestroy( audioStream ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ) + + // Wrong state, no callbacks to MLcSessionObserver + CMceVideoStream* videoStream = CMceVideoStream::NewLC(); + videoStream->iState = CMceMediaStream::EIdle; + iLiveSession->StreamStreaming( *videoStream ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ) + + // Receive session, RTP source and remote player present + iLcSessionObserver->Reset(); + videoStream->iState = CMceMediaStream::EStreaming; + CMceRtpSource* rtpSource = CMceRtpSource::NewLC(); + videoStream->SetSourceL( rtpSource ); + CleanupStack::Pop( rtpSource ); + iReceiveSession->StreamStreaming( *videoStream ); + EUNIT_ASSERT_EQUALS( + TInt( CLcSessionObserverStub::EPlayerStateChanged ), + iLcSessionObserver->iCalledFunction ) + EUNIT_ASSERT_EQUALS( + iReceiveSession->RemoteVideoPlayer(), + iLcSessionObserver->iCurrentPlayer ) + + // Live session, RTP sink and local player present + iLcSessionObserver->Reset(); + videoStream->SetSourceL( NULL ); + CMceRtpSink* rtpSink = CMceRtpSink::NewLC(); + videoStream->AddSinkL( rtpSink ); + CleanupStack::Pop( rtpSink ); + iLiveSession->StreamStreaming( *videoStream ); + EUNIT_ASSERT_EQUALS( + TInt( CLcSessionObserverStub::EPlayerStateChanged ), + iLcSessionObserver->iCalledFunction ) + EUNIT_ASSERT_EQUALS( + iLiveSession->LocalVideoPlayer(), + iLcSessionObserver->iCurrentPlayer ) + + // Live session, RTP sink present, but no local player + iLcSessionObserver->Reset(); + delete iLiveSession->iLiveVideoPlayer; + iLiveSession->iLiveVideoPlayer = NULL; + iLiveSession->StreamStreaming( *videoStream ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ) + + CleanupStack::PopAndDestroy( videoStream ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_InformObserverAboutSessionStateChangeL() + { + // Observer does not exist + iLiveSession->SetLcSessionObserver( NULL ); + iLiveSession->InformObserverAboutSessionStateChange(); + EUNIT_ASSERT_EQUALS( + CLcSessionObserverStub::EUnknown, + iLcSessionObserver->iCalledFunction ) + + // Observer exists + iLiveSession->SetLcSessionObserver( iLcSessionObserver ); + iLiveSession->InformObserverAboutSessionStateChange(); + EUNIT_ASSERT_EQUALS( + CLcSessionObserverStub::ESessionStateChanged, + iLcSessionObserver->iCalledFunction ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_InformObserverAboutSessionUpdateL() + { + // Observer does not exist + iLiveSession->SetLcSessionObserver( NULL ); + iLiveSession->InformObserverAboutSessionUpdate(); + EUNIT_ASSERT_EQUALS( + CLcSessionObserverStub::EUnknown, + iLcSessionObserver->iCalledFunction ) + + // Observer exists + iLiveSession->SetLcSessionObserver( iLcSessionObserver ); + iLiveSession->InformObserverAboutSessionUpdate(); + EUNIT_ASSERT_EQUALS( + CLcSessionObserverStub::ESessionUpdated, + iLcSessionObserver->iCalledFunction ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_InformObserverAboutSessionFailureL() + { + // Observer does not exist + iLiveSession->SetLcSessionObserver( NULL ); + iLiveSession->InformObserverAboutSessionFailure( KErrGeneral ); + EUNIT_ASSERT_EQUALS( + CLcSessionObserverStub::EUnknown, + iLcSessionObserver->iCalledFunction ) + EUNIT_ASSERT_EQUALS( KErrNone, iLcSessionObserver->iError ) + + // Observer exists + iLiveSession->SetLcSessionObserver( iLcSessionObserver ); + iLiveSession->InformObserverAboutSessionFailure( KErrGeneral ); + EUNIT_ASSERT_EQUALS( + CLcSessionObserverStub::ESessionFailed, + iLcSessionObserver->iCalledFunction ) + EUNIT_ASSERT_EQUALS( KErrGeneral, iLcSessionObserver->iError ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_InformObserverAboutPlayerStateChangeL() + { + // Observer does not exist + iLiveSession->SetLcSessionObserver( NULL ); + iLiveSession->InformObserverAboutPlayerStateChange( NULL ); + EUNIT_ASSERT_EQUALS( + CLcSessionObserverStub::EUnknown, + iLcSessionObserver->iCalledFunction ) + + // Observer exists, but the player is NULL + iLiveSession->SetLcSessionObserver( iLcSessionObserver ); + iLiveSession->InformObserverAboutPlayerStateChange( NULL ); + EUNIT_ASSERT_EQUALS( + CLcSessionObserverStub::EUnknown, + iLcSessionObserver->iCalledFunction ) + + // Both observer and player exist + iLiveSession->InformObserverAboutPlayerStateChange( + iLiveSession->LocalVideoPlayer() ); + EUNIT_ASSERT_EQUALS( + CLcSessionObserverStub::EPlayerStateChanged, + iLcSessionObserver->iCalledFunction ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_InformObserverAboutPlayerUpdateL() + { + // Observer does not exist + iLiveSession->SetLcSessionObserver( NULL ); + iLiveSession->InformObserverAboutPlayerUpdate( NULL ); + EUNIT_ASSERT_EQUALS( + CLcSessionObserverStub::EUnknown, + iLcSessionObserver->iCalledFunction ) + + // Observer exists, but the player is NULL + iLiveSession->SetLcSessionObserver( iLcSessionObserver ); + iLiveSession->InformObserverAboutPlayerUpdate( NULL ); + EUNIT_ASSERT_EQUALS( + CLcSessionObserverStub::EUnknown, + iLcSessionObserver->iCalledFunction ) + + // Both observer and player exist + iLiveSession->InformObserverAboutPlayerUpdate( + iLiveSession->LocalVideoPlayer() ); + EUNIT_ASSERT_EQUALS( + CLcSessionObserverStub::EPlayerUpdated, + iLcSessionObserver->iCalledFunction ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_InformObserverAboutPlayerFailureL() + { + // Observer does not exist + iLiveSession->SetLcSessionObserver( NULL ); + iLiveSession->InformObserverAboutPlayerFailure( NULL, KErrGeneral ); + EUNIT_ASSERT_EQUALS( + CLcSessionObserverStub::EUnknown, + iLcSessionObserver->iCalledFunction ) + EUNIT_ASSERT_EQUALS( KErrNone, iLcSessionObserver->iError ) + + // Observer exists, but the player is NULL + iLiveSession->SetLcSessionObserver( iLcSessionObserver ); + iLiveSession->InformObserverAboutPlayerFailure( NULL, KErrGeneral ); + EUNIT_ASSERT_EQUALS( + CLcSessionObserverStub::EUnknown, + iLcSessionObserver->iCalledFunction ) + EUNIT_ASSERT_EQUALS( KErrNone, iLcSessionObserver->iError ) + + // Both observer and player exist + iLiveSession->InformObserverAboutPlayerFailure( + iLiveSession->LocalVideoPlayer(), KErrGeneral ); + EUNIT_ASSERT_EQUALS( + CLcSessionObserverStub::EPlayerFailed, + iLcSessionObserver->iCalledFunction ) + EUNIT_ASSERT_EQUALS( KErrGeneral, iLcSessionObserver->iError ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_LcUiProviderL() + { + // Provider does not exist + iLiveSession->SetLcUiProvider( NULL ); + EUNIT_ASSERT_SPECIFIC_LEAVE( iLiveSession->LcUiProviderL(), KErrNotReady ) + + // Provider exists + iLiveSession->SetLcUiProvider( iLcUiProvider ); + EUNIT_ASSERT( &iLiveSession->LcUiProviderL() == iLcUiProvider ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UI_IsBackgroundStartupL() + { + // fast mode is not defined + EUNIT_ASSERT( !iLiveSession->IsBackgroundStartup() ) + + // fast mode is Off + User::LeaveIfError( RProperty::Set( NMusSessionApi::KCategoryUid, + NMusSessionApi::KFastMode, + 1 ) ); + + EUNIT_ASSERT( !iLiveSession->IsBackgroundStartup() ) + + // fast mode is On + // Bg value would be set to true at session contruct phase if property + // is set to EFastModeOn at that time. + iLiveSession->iBackground = ETrue; + User::LeaveIfError( RProperty::Set( NMusSessionApi::KCategoryUid, + NMusSessionApi::KFastMode, + 0 ) ); + + EUNIT_ASSERT( iLiveSession->IsBackgroundStartup() ) + + // Ensure after session recreation fast mode is off + delete iLiveSession; + iLiveSession = NULL; + iLiveSession = CMusEngLiveSession::NewL(); + EUNIT_ASSERT( !iLiveSession->IsBackgroundStartup() ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_InformUiProviderAboutReceivingStartL() + { + // Observer does not exist + iLiveSession->SetLcUiProvider( NULL ); + iLiveSession->InformUiProviderAboutReceivingStart(); + EUNIT_ASSERT_EQUALS( TInt( CLcUiProviderStub::EUnknown ), + iLcUiProvider->iCalledFunction ) + + // Observer exists, but we are on foreground (fast mode is off) + iLiveSession->SetLcUiProvider( iLcUiProvider ); + iLiveSession->InformUiProviderAboutReceivingStart(); + EUNIT_ASSERT_EQUALS( TInt( CLcUiProviderStub::EUnknown ), + iLcUiProvider->iCalledFunction ) + + // Observer exists, we are on background + iLiveSession->iBackground = ETrue; + EUNIT_ASSERT( !iLcUiProvider->iForeground ) + iLiveSession->InformUiProviderAboutReceivingStart(); + EUNIT_ASSERT_EQUALS( TInt( CLcUiProviderStub::EHandleForegroundStatus ), + iLcUiProvider->iCalledFunction ) + EUNIT_ASSERT( iLcUiProvider->iForeground ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_SetForegroundStatusL() + { + iLiveSession->iBackground = ETrue; + EUNIT_ASSERT( iLiveSession->SetForegroundStatus( ETrue ) == KErrNone ); + EUNIT_ASSERT( !iLiveSession->iBackground ); + EUNIT_ASSERT( iLiveSession->SetForegroundStatus( EFalse ) == KErrNone ); + EUNIT_ASSERT( !iLiveSession->iBackground ); // Still bg + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngMceSession::UT_UpdateLcSessionLL() + { + // No MCE session + EUNIT_ASSERT_SPECIFIC_LEAVE( iLiveSession->UpdateLcSessionL(), KErrNotReady ) + + ESTABLISH_OUT_SESSION( iLiveSession ); + + iLiveSession->UpdateLcSessionL(); + + } + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusEngMceSession, + "UT_CMusEngMceSesssion", + "UNIT" ) + +EUNIT_TEST( + "LcSessionState - test ", + "CMusEngMceSession", + "LcSessionState", + "FUNCTIONALITY", + SetupL, UT_LcSessionStateL, Teardown) + +EUNIT_TEST( + "RemoteVideoPlayer - test ", + "CMusEngMceSession", + "RemoteVideoPlayer", + "FUNCTIONALITY", + SetupL, UT_RemoteVideoPlayerL, Teardown) + +EUNIT_TEST( + "LocalVideoPlayer - test ", + "CMusEngMceSession", + "LocalVideoPlayer", + "FUNCTIONALITY", + SetupL, UT_LocalVideoPlayerL, Teardown) + +EUNIT_TEST( + "LocalDisplayNameL - test ", + "CMusEngMceSession", + "LocalDisplayNameL", + "FUNCTIONALITY", + SetupL, UT_LocalDisplayNameL, Teardown) + +EUNIT_TEST( + "RemoteDisplayName - test ", + "CMusEngMceSession", + "RemoteDisplayName", + "FUNCTIONALITY", + SetupL, UT_RemoteDisplayNameL, Teardown) + +EUNIT_TEST( + "RemoteDetails - test ", + "CMusEngMceSession", + "RemoteDetails", + "FUNCTIONALITY", + SetupL, UT_RemoteDetailsL, Teardown) + +EUNIT_TEST( + "SetParameter - test ", + "CMusEngMceSession", + "SetParameter", + "FUNCTIONALITY", + SetupL, UT_SetParameterL, Teardown) + +EUNIT_TEST( + "ParameterValue - test ", + "CMusEngMceSession", + "ParameterValue", + "FUNCTIONALITY", + SetupL, UT_ParameterValueL, Teardown) + +EUNIT_TEST( + "IsLcAudioMutedL - test ", + "CMusEngMceSession", + "IsLcAudioMutedL", + "FUNCTIONALITY", + SetupL, UT_IsLcAudioMutedL, Teardown) + +EUNIT_TEST( + "MuteLcAudioL - test ", + "CMusEngMceSession", + "MuteLcAudioL", + "FUNCTIONALITY", + SetupL, UT_MuteLcAudioL, Teardown) + +EUNIT_TEST( + "MuteLcMicL - test ", + "CMusEngMceSession", + "MuteLcMicL", + "FUNCTIONALITY", + SetupL, UT_MuteLcMicL, Teardown) + +EUNIT_TEST( + "EnableLcLoudspeakerL - test ", + "CMusEngMceSession", + "EnableLcLoudspeakerL", + "FUNCTIONALITY", + SetupL, UT_EnableLcLoudspeakerL, Teardown) + +EUNIT_TEST( + "SetLcVolumeL - test ", + "CMusEngMceSession", + "SetLcVolumeL", + "FUNCTIONALITY", + SetupL, UT_SetLcVolumeL, Teardown) + +EUNIT_TEST( + "GetSessionTime - test ", + "CMusEngMceSession", + "GetSessionTime", + "FUNCTIONALITY", + SetupL, UT_GetSessionTimeL, Teardown) + +EUNIT_TEST( + "HandleTermination - test ", + "CMusEngMceSession", + "HandleTermination", + "FUNCTIONALITY", + SetupL, UT_HandleTerminationL, Teardown) + +EUNIT_TEST( + "AdjustVideoCodecL - test ", + "CMusEngMceSession", + "AdjustVideoCodecL", + "FUNCTIONALITY", + SetupL, UT_AdjustVideoCodecL, Teardown) + +EUNIT_TEST( + "AdjustAudioCodecL - test ", + "CMusEngMceSession", + "AdjustAudioCodecL", + "FUNCTIONALITY", + SetupL, UT_AdjustAudioCodecL, Teardown) + +EUNIT_TEST( + "RectChangedL - test ", + "CMusEngMceSession", + "RectChangedL", + "FUNCTIONALITY", + SetupL, UT_RectChangedL, Teardown) + +EUNIT_TEST( + "SetSessionSdpLinesL - test ", + "CMusEngMceSession", + "SetSessionSdpLinesL", + "FUNCTIONALITY", + SetupL, UT_SetSessionSdpLinesL, Teardown) + +EUNIT_TEST( + "SetSessionSdpLinesL - operator variant test ", + "CMusEngMceSession", + "SetSessionSdpLinesL", + "FUNCTIONALITY", + SetupL, UT_SetSessionSdpLines_OperatorL, Teardown) + +EUNIT_TEST( + "SetMediaSdpLinesL - test ", + "CMusEngMceSession", + "SetMediaSdpLinesL", + "FUNCTIONALITY", + SetupL, UT_SetMediaSdpLinesL, Teardown) + +EUNIT_TEST( + "SetMediaSdpLinesL - operator variant test ", + "CMusEngMceSession", + "SetMediaSdpLinesL", + "FUNCTIONALITY", + SetupL, UT_SetMediaSdpLines_OperatorL, Teardown) + +EUNIT_TEST( + "AdjustStreamsAndCodecsL - test ", + "CMusEngMceSession", + "AdjustStreamsAndCodecsL", + "FUNCTIONALITY", + SetupL, UT_AdjustStreamsAndCodecsL, Teardown) + +EUNIT_TEST( + "IncomingSession - test ", + "CMusEngMceSession", + "IncomingSession", + "FUNCTIONALITY", + SetupL, UT_IncomingSessionL, Teardown) + +EUNIT_TEST( + "IncomingUpdate - test ", + "CMusEngMceSession", + "IncomingUpdate", + "FUNCTIONALITY", + SetupL, UT_IncomingUpdateL, Teardown) + +EUNIT_TEST( + "StreamStateChangedL( source ) - test ", + "CMusEngMceSession", + "StreamStateChangedL( source )", + "FUNCTIONALITY", + SetupL, UT_StreamStateChangedWithSourceL, Teardown) + +EUNIT_TEST( + "SessionStateChanged - test ", + "CMusEngMceSession", + "SessionStateChanged", + "FUNCTIONALITY", + SetupL, UT_SessionStateChangedL, Teardown) + +EUNIT_TEST( + "HandleSessionStateChanged - encoder key storing ", + "CMusEngMceSession", + "HandleSessionStateChanged", + "FUNCTIONALITY", + SetupL, UT_HandleSessionStateChanged_EncoderKeyStoringL, Teardown) + +EUNIT_TEST( + "SessionConnectionStateChanged - test ", + "CMusEngMceSession", + "SessionConnectionStateChanged", + "FUNCTIONALITY", + SetupL, UT_SessionConnectionStateChangedL, Teardown) + +EUNIT_TEST( + "Failed - test ", + "CMusEngMceSession", + "Failed", + "FUNCTIONALITY", + SetupL, UT_FailedL, Teardown) + +EUNIT_TEST( + "UpdateFailed - test ", + "CMusEngMceSession", + "UpdateFailed", + "FUNCTIONALITY", + SetupL, UT_UpdateFailedL, Teardown) + +EUNIT_TEST( + "StreamStateChanged - test ", + "CMusEngMceSession", + "StreamStateChanged", + "FUNCTIONALITY", + SetupL, UT_StreamStateChangedL, Teardown) + +EUNIT_TEST( + "StreamStateChangedL (sink ) - test ", + "CMusEngMceSession", + "StreamStateChangedL( sink )", + "FUNCTIONALITY", + SetupL, UT_StreamStateChangedWithSinkL, Teardown) + +EUNIT_TEST( + "SRReceived - test ", + "CMusEngMceSession", + "SRReceived", + "FUNCTIONALITY", + SetupL, UT_SRReceivedL, Teardown) + +EUNIT_TEST( + "RRReceived - test ", + "CMusEngMceSession", + "RRReceived", + "FUNCTIONALITY", + SetupL, UT_RRReceivedL, Teardown) + +EUNIT_TEST( + "SsrcAdded - test ", + "CMusEngMceSession", + "SsrcAdded", + "FUNCTIONALITY", + SetupL, UT_SsrcAddedL, Teardown) + +EUNIT_TEST( + "SsrcRemoved - test ", + "CMusEngMceSession", + "SsrcRemoved", + "FUNCTIONALITY", + SetupL, UT_SsrcRemovedL, Teardown) + +EUNIT_TEST( + "UpdateTimerEvent - test ", + "CMusEngMceSession", + "UpdateTimerEvent", + "FUNCTIONALITY", + SetupL, UT_UpdateTimerEventL, Teardown) + +EUNIT_TEST( + "IsRoamingBetweenAPsAllowed - test ", + "CMusEngMceSession", + "IsRoamingBetweenAPsAllowed", + "FUNCTIONALITY", + SetupL, UT_IsRoamingBetweenAPsAllowedL, Teardown) + +EUNIT_TEST( + "SaveContactL - test ", + "CMusEngMceSession", + "SaveContactL", + "FUNCTIONALITY", + SetupL, UT_SaveContactL, Teardown) + +EUNIT_TEST( + "Rect - test ", + "CMusEngMceSession", + "Rect", + "FUNCTIONALITY", + SetupL, UT_RectL, Teardown) + +EUNIT_TEST( + "SetRectL - test ", + "CMusEngMceSession", + "SetRectL", + "FUNCTIONALITY", + SetupL, UT_SetRectLL, Teardown) + +EUNIT_TEST( + "SecondaryRect - test ", + "CMusEngMceSession", + "SecondaryRect", + "FUNCTIONALITY", + SetupL, UT_SecondaryRectL, Teardown) + +EUNIT_TEST( + "SetSecondaryRectL - test ", + "CMusEngMceSession", + "SetSecondaryRectL", + "FUNCTIONALITY", + SetupL, UT_SetSecondaryRectLL, Teardown) + +EUNIT_TEST( + "EnableDisplayL - test ", + "CMusEngMceSession", + "EnableDisplayL", + "FUNCTIONALITY", + SetupL, UT_EnableDisplayLL, Teardown) + +EUNIT_TEST( + "SetOrientationL - test ", + "CMusEngMceSession", + "SetOrientationL", + "FUNCTIONALITY", + SetupL, UT_CMusEngMceSession_SetOrientationLL, Teardown) + +EUNIT_TEST( + "SetEncodingDeviceL - test ", + "CMusEngMceSession", + "SetEncodingDeviceL", + "FUNCTIONALITY", + SetupL, UT_SetEncodingDeviceLL, Teardown) + +EUNIT_TEST( + "SetCodecConfigKeyL - test ", + "CMusEngMceSession", + "SetCodecConfigKeyL", + "FUNCTIONALITY", + SetupL, UT_SetCodecConfigKeyLL, Teardown) + +EUNIT_TEST( + "ReadCodecConfigKeyL - test ", + "CMusEngMceSession", + "ReadCodecConfigKeyL", + "FUNCTIONALITY", + SetupL, UT_ReadCodecConfigKeyLL, Teardown) + +EUNIT_TEST( + "StoreEncoderConfigInfoL - test ", + "CMusEngMceSession", + "StoreEncoderConfigInfoL", + "FUNCTIONALITY", + SetupL, UT_StoreEncoderConfigInfoLL, Teardown) + +EUNIT_TEST( + "StreamStreaming - test ", + "CMusEngMceSession", + "StreamStreaming", + "FUNCTIONALITY", + SetupL, UT_StreamStreamingL, Teardown) + +EUNIT_TEST( + "InformObserverAboutSessionStateChange - test ", + "CMusEngMceSession", + "InformObserverAboutSessionStateChange", + "FUNCTIONALITY", + SetupL, UT_InformObserverAboutSessionStateChangeL, Teardown) + +EUNIT_TEST( + "InformObserverAboutSessionUpdate - test ", + "CMusEngMceSession", + "InformObserverAboutSessionUpdate", + "FUNCTIONALITY", + SetupL, UT_InformObserverAboutSessionUpdateL, Teardown) + +EUNIT_TEST( + "InformObserverAboutSessionFailure - test ", + "CMusEngMceSession", + "InformObserverAboutSessionFailure", + "FUNCTIONALITY", + SetupL, UT_InformObserverAboutSessionFailureL, Teardown) + +EUNIT_TEST( + "InformObserverAboutPlayerStateChange - test ", + "CMusEngMceSession", + "InformObserverAboutPlayerStateChange", + "FUNCTIONALITY", + SetupL, UT_InformObserverAboutPlayerStateChangeL, Teardown) + +EUNIT_TEST( + "InformObserverAboutPlayerUpdate - test ", + "CMusEngMceSession", + "InformObserverAboutPlayerUpdate", + "FUNCTIONALITY", + SetupL, UT_InformObserverAboutPlayerUpdateL, Teardown) + +EUNIT_TEST( + "InformObserverAboutPlayerFailure - test ", + "CMusEngMceSession", + "InformObserverAboutPlayerFailure", + "FUNCTIONALITY", + SetupL, UT_InformObserverAboutPlayerFailureL, Teardown) + +EUNIT_TEST( + "LcUiProviderL - test ", + "CMusEngMceSession", + "LcUiProviderL", + "FUNCTIONALITY", + SetupL, UT_LcUiProviderL, Teardown) + +EUNIT_TEST( + "IsBackgroundStartup - test ", + "CMusEngMceSession", + "IsBackgroundStartup", + "FUNCTIONALITY", + SetupL, UI_IsBackgroundStartupL, Teardown) + +EUNIT_TEST( + "InformUiProviderAboutReceivingStart - test ", + "CMusEngMceSession", + "InformUiProviderAboutReceivingStart", + "FUNCTIONALITY", + SetupL, UT_InformUiProviderAboutReceivingStartL, Teardown) + +EUNIT_TEST( + "SetForegroundStatus - test ", + "CMusEngMceSession", + "SetForegroundStatus", + "FUNCTIONALITY", + SetupL, UT_SetForegroundStatusL, Teardown) + +EUNIT_TEST( + "UpdateLcSessionL - test ", + "CMusEngMceSession", + "UpdateL", + "FUNCTIONALITY", + SetupL, UT_UpdateLcSessionLL, Teardown) + + +EUNIT_END_TEST_TABLE + +// END OF FILE + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/tsrc/ut_engine/src/ut_musengmceutils.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/tsrc/ut_engine/src/ut_musengmceutils.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,1028 @@ +/* +* 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: +* +*/ + + +// INTERNAL INCLUDES +#include "ut_musengmceutils.h" +#include "musengmceutils.h" +#include "mussipprofilehandler.h" +#include "musengstubs.h" +#include "musengtestdefs.h" + + +// SYSTEM INCLUDES +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +const TUint KSipProfileId( 1 ); + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_MusEngMceUtils* UT_MusEngMceUtils::NewL() + { + UT_MusEngMceUtils* self = UT_MusEngMceUtils::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_MusEngMceUtils* UT_MusEngMceUtils::NewLC() + { + UT_MusEngMceUtils* self = new( ELeave ) UT_MusEngMceUtils(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_MusEngMceUtils::~UT_MusEngMceUtils() + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// Default constructor +// ----------------------------------------------------------------------------- +// +UT_MusEngMceUtils::UT_MusEngMceUtils() + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// Second phase construct +// ----------------------------------------------------------------------------- +// +void UT_MusEngMceUtils::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_MusEngMceUtils::SetupL() + { + iManager = CMceManager::NewL( TUid::Null(), NULL ); + iObserver = new( ELeave ) CMusEngObserverStub; + iObserver->iRoamingBetweenAPsAllowed = ETrue; + iProfileHandler = CMusSipProfileHandler::NewL( *iObserver ); + + iProfileHandler->CreateProfileL( KSipProfileId ); + iEmptySession = CMceOutSession::NewL( *iManager, + *iProfileHandler->Profile(), + KTestRecipientSipUri8() ); + + // Contruct an outgoing video sesssion + iVideoOutSession = CMceOutSession::NewL( *iManager, + *iProfileHandler->Profile(), + KTestRecipientSipUri8() ); + + + CMceVideoStream* videoOut = CMceVideoStream::NewLC(); + + videoOut->AddSinkL( CMceRtpSink::NewLC() ); + CleanupStack::Pop(); + + videoOut->AddSinkL( CMceDisplaySink::NewLC( *iManager ) ); + CleanupStack::Pop(); + + videoOut->SetSourceL( CMceCameraSource::NewLC( *iManager ) ); + CleanupStack::Pop(); + + iVideoOutSession->AddStreamL( videoOut ); + CleanupStack::Pop( videoOut ); + + // Consruct a video session with incoming video and audio stream + // Audio part + iVideoInSession = CMceOutSession::NewL( *iManager, + *iProfileHandler->Profile(), + KTestRecipientSipUri8() ); + + CMceAudioStream* audioIn = CMceAudioStream::NewLC(); + + audioIn->AddSinkL( CMceSpeakerSink::NewLC() ); + CleanupStack::Pop(); + + audioIn->SetSourceL( CMceRtpSource::NewLC() ); + CleanupStack::Pop(); + + iVideoInSession->AddStreamL( audioIn ); + CleanupStack::Pop( audioIn ); + + // Video part + CMceVideoStream* videoIn = CMceVideoStream::NewLC(); + + CMceDisplaySink* receivingDisplay = CMceDisplaySink::NewLC( *iManager ); + videoIn->AddSinkL( receivingDisplay ); + CleanupStack::Pop(); + iReceivingDisplay = receivingDisplay; + + videoIn->SetSourceL( CMceRtpSource::NewLC() ); + CleanupStack::Pop(); + + iVideoInSession->AddStreamL( videoIn ); + CleanupStack::Pop( videoIn ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_MusEngMceUtils::Setup2L() + { + iManager = CMceManager::NewL( TUid::Null(), NULL ); + iObserver = new( ELeave ) CMusEngObserverStub; + iObserver->iRoamingBetweenAPsAllowed = ETrue; + iProfileHandler = CMusSipProfileHandler::NewL( *iObserver ); + + iProfileHandler->CreateProfileL( KSipProfileId ); + iEmptySession = CMceOutSession::NewL( *iManager, + *iProfileHandler->Profile(), + KTestRecipientSipUri8() ); + + // Contruct an outgoing video sesssion + iVideoOutSession = CMceOutSession::NewL( *iManager, + *iProfileHandler->Profile(), + KTestRecipientSipUri8() ); + + + CMceVideoStream* videoOut = CMceVideoStream::NewLC(); + + videoOut->AddSinkL( CMceRtpSink::NewLC() ); + CleanupStack::Pop(); + + videoOut->AddSinkL( CMceDisplaySink::NewLC( *iManager ) ); + CleanupStack::Pop(); + + videoOut->SetSourceL( CMceCameraSource::NewLC( *iManager ) ); + CleanupStack::Pop(); + + // Video part + CMceVideoStream* videoIn = CMceVideoStream::NewLC(); + + CMceDisplaySink* receivingDisplay = CMceDisplaySink::NewLC( *iManager ); + videoIn->AddSinkL( receivingDisplay ); + CleanupStack::Pop(); + iReceivingDisplay = receivingDisplay; + + videoIn->SetSourceL( CMceRtpSource::NewLC() ); + CleanupStack::Pop(); + + videoOut->BindL( videoIn ); + CleanupStack::Pop( videoIn ); + + iVideoOutSession->AddStreamL( videoOut ); + CleanupStack::Pop( videoOut ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_MusEngMceUtils::Teardown() + { + delete iEmptySession; + delete iVideoOutSession; + delete iVideoInSession; + iVideoInSession = NULL; + delete iProfileHandler; + delete iObserver; + delete iManager; + iReceivingDisplay = NULL; // Not owned + } + + + +// TEST CASES + + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_MusEngMceUtils::UT_IsVideoInStreamL() + { + // Stream 0 is audio stream + EUNIT_ASSERT( !MusEngMceUtils::IsVideoInStream( + *iVideoInSession->Streams()[0] ) ) + + // No source + CMceVideoStream* videoStream = CMceVideoStream::NewLC(); + EUNIT_ASSERT( !MusEngMceUtils::IsVideoInStream( *videoStream ) ) + CleanupStack::PopAndDestroy( videoStream ); + + // Camera source + EUNIT_ASSERT( !MusEngMceUtils::IsVideoInStream( + *iVideoOutSession->Streams()[0] ) ) + + // Video in stream + EUNIT_ASSERT( MusEngMceUtils::IsVideoInStream( + *iVideoInSession->Streams()[1] ) ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_MusEngMceUtils::UT_IsVideoOutStreamL() + { + // Stream 0 is audio stream + EUNIT_ASSERT( !MusEngMceUtils::IsVideoOutStream( + *iVideoInSession->Streams()[0] ) ) + + // No sink + CMceVideoStream* videoStream = CMceVideoStream::NewLC(); + EUNIT_ASSERT( !MusEngMceUtils::IsVideoOutStream( *videoStream ) ) + CleanupStack::PopAndDestroy( videoStream ); + + // display sink + EUNIT_ASSERT( !MusEngMceUtils::IsVideoOutStream( + *iVideoInSession->Streams()[1] ) ) + + // Video outstream + EUNIT_ASSERT( MusEngMceUtils::IsVideoOutStream( + *iVideoOutSession->Streams()[0] ) ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_MusEngMceUtils::UT_IsAudioInStreamL() + { + // Stream 0 is video stream + EUNIT_ASSERT( !MusEngMceUtils::IsAudioInStream( + *iVideoOutSession->Streams()[0] ) ) + + // No source + CMceAudioStream* audioStream = CMceAudioStream::NewLC(); + EUNIT_ASSERT( !MusEngMceUtils::IsAudioInStream( *audioStream ) ) + + // File source + audioStream->SetSourceL( CMceFileSource::NewLC( *iManager, KNullDesC() ) ); + CleanupStack::Pop(); + + EUNIT_ASSERT( !MusEngMceUtils::IsAudioInStream( *audioStream ) ) + CleanupStack::PopAndDestroy( audioStream ); + + // Audio in stream + EUNIT_ASSERT( MusEngMceUtils::IsAudioInStream( + *iVideoInSession->Streams()[0] ) ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_MusEngMceUtils::UT_GetVideoOutStreamLL() + { + // No streams, must fail + EUNIT_ASSERT_SPECIFIC_LEAVE( + MusEngMceUtils::GetVideoOutStreamL( *iEmptySession ), + KErrNotFound ) + + // Add an audio out stream to empty sessionand and try again, still fails + CMceAudioStream* audioStream = CMceAudioStream::NewLC(); + + audioStream->AddSinkL( CMceRtpSink::NewLC() ); + CleanupStack::Pop(); + + iEmptySession->AddStreamL( audioStream ); + CleanupStack::Pop(audioStream); + + EUNIT_ASSERT_SPECIFIC_LEAVE( + MusEngMceUtils::GetVideoOutStreamL( *iEmptySession ), + KErrNotFound ) + + // Incoming video stream, fails + EUNIT_ASSERT_SPECIFIC_LEAVE( + MusEngMceUtils::GetVideoOutStreamL( *iVideoInSession ), + KErrNotFound ) + + // One incoming video stream with bound outstream, must find bound stream + CMceVideoStream* boundVideoOut = CMceVideoStream::NewLC(); + boundVideoOut->AddSinkL( CMceRtpSink::NewLC() ); + CleanupStack::Pop(); + boundVideoOut->SetSourceL( CMceCameraSource::NewLC( *iManager ) ); + CleanupStack::Pop(); + reinterpret_cast( + iVideoInSession->Streams()[ 1 ] )->BindL( boundVideoOut ); + CleanupStack::Pop( boundVideoOut ); + CMceVideoStream* videoStream = MusEngMceUtils::GetVideoOutStreamL( + *iVideoInSession ); + EUNIT_ASSERT( videoStream ) + EUNIT_ASSERT( videoStream->Type() == KMceVideo ) + EUNIT_ASSERT( videoStream->Sinks().Count() == 1 ) // Rtp + EUNIT_ASSERT( videoStream->Sinks()[0]->Type() == KMceRTPSink ) + + // One outgoing video stream, succeeds + videoStream = MusEngMceUtils::GetVideoOutStreamL( *iVideoOutSession ); + EUNIT_ASSERT( videoStream ) + EUNIT_ASSERT( videoStream->Type() == KMceVideo ) + EUNIT_ASSERT( videoStream->Sinks().Count() == 2 ) // Rtp, Display + EUNIT_ASSERT( videoStream->Sinks()[0]->Type() == KMceRTPSink ) + EUNIT_ASSERT( videoStream->Sinks()[1]->Type() == KMceDisplaySink ) + + // Add another stream + CMceVideoStream* videoOut = CMceVideoStream::NewLC(); + + videoOut->AddSinkL( CMceRtpSink::NewLC() ); + CleanupStack::Pop(); + + videoOut->SetSourceL( CMceFileSource::NewLC( *iManager, + KTestVideoFileName() ) ); + CleanupStack::Pop(); + + iVideoOutSession->AddStreamL( videoOut ); + CleanupStack::Pop( videoOut ); + + // Now there are two outgoing video streams, must fail + EUNIT_ASSERT_SPECIFIC_LEAVE( + MusEngMceUtils::GetVideoOutStreamL( *iVideoOutSession ), + KErrOverflow ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_MusEngMceUtils::UT_GetVideoInStreamLL() + { + // No streams, must fail + EUNIT_ASSERT_SPECIFIC_LEAVE( + MusEngMceUtils::GetVideoInStreamL( *iEmptySession ), + KErrNotFound ) + + // Outgoing video stream, fails + EUNIT_ASSERT_SPECIFIC_LEAVE( + MusEngMceUtils::GetVideoInStreamL( *iVideoOutSession ), + KErrNotFound ) + + // Add stream without source and try again, still fails + CMceVideoStream* newVideoStream = CMceVideoStream::NewLC(); + iVideoOutSession->AddStreamL( newVideoStream ); + CleanupStack::Pop( newVideoStream ); + + EUNIT_ASSERT_SPECIFIC_LEAVE( + MusEngMceUtils::GetVideoInStreamL( *iVideoOutSession ), + KErrNotFound ) + + // One incoming video stream, succeeds + CMceVideoStream* videoStream = MusEngMceUtils::GetVideoInStreamL( + *iVideoInSession ); + + EUNIT_ASSERT( videoStream ) + EUNIT_ASSERT( videoStream->Type() == KMceVideo ) + EUNIT_ASSERT( videoStream->Sinks().Count() == 1 ) // Display + EUNIT_ASSERT( videoStream->Sinks()[0]->Type() == KMceDisplaySink ) + EUNIT_ASSERT( videoStream->Source() ) + EUNIT_ASSERT( videoStream->Source()->Type() == KMceRTPSource ) + + // Add another video in stream + + CMceVideoStream* videoIn = CMceVideoStream::NewLC(); + + videoIn->AddSinkL( CMceDisplaySink::NewLC( *iManager ) ); + CleanupStack::Pop(); + + videoIn->SetSourceL( CMceRtpSource::NewLC() ); + CleanupStack::Pop(); + + iVideoInSession->AddStreamL( videoIn ); + CleanupStack::Pop( videoIn ); + + // Now there are two incoming video streams, must fail + EUNIT_ASSERT_SPECIFIC_LEAVE( + MusEngMceUtils::GetVideoInStreamL( *iVideoInSession ), + KErrOverflow ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_MusEngMceUtils::UT_GetRecordingStreamL() + { + CMceVideoStream* recordingStream = + MusEngMceUtils::GetRecordingStream( *iVideoInSession ); + EUNIT_ASSERT( !recordingStream ) + + recordingStream = MusEngMceUtils::GetRecordingStream( *iVideoOutSession ); + EUNIT_ASSERT( !recordingStream ) + + // Create recording stream + CMceVideoStream* streamForRecording = CMceVideoStream::NewLC(); + + CMceFileSink* fileSink = CMceFileSink::NewLC( KTestVideoFileName() ); + streamForRecording->AddSinkL( fileSink ); + CleanupStack::Pop( fileSink ); + + iVideoOutSession->AddStreamL( streamForRecording ); + CleanupStack::Pop( streamForRecording ); + + // Test that it is found + recordingStream = MusEngMceUtils::GetRecordingStream( *iVideoOutSession ); + EUNIT_ASSERT( recordingStream ) + EUNIT_ASSERT( recordingStream == streamForRecording ) + } + + +// ----------------------------------------------------------------------------- +// From stream +// ----------------------------------------------------------------------------- +// +void UT_MusEngMceUtils::UT_GetMediaSinkFromStreamL() + { + CMceMediaSink* sink = MusEngMceUtils::GetMediaSink( + *(iVideoInSession->Streams()[0]), + KMceRTPSink ); + EUNIT_ASSERT( !sink ) + + sink = MusEngMceUtils::GetMediaSink( *(iVideoOutSession->Streams()[0]), + KMceRTPSink ); + + EUNIT_ASSERT( sink ) + EUNIT_ASSERT( sink->Type() == KMceRTPSink ) + + } + + +// ----------------------------------------------------------------------------- +// From stream +// ----------------------------------------------------------------------------- +// +void UT_MusEngMceUtils::UT_GetMediaSinkLFromStreamL() + { + CMceMediaSink* sink = NULL; + EUNIT_ASSERT_SPECIFIC_LEAVE( + MusEngMceUtils::GetMediaSinkL( *(iVideoInSession->Streams()[0]), + KMceRTPSink ), + KErrNotFound ) + + sink = MusEngMceUtils::GetMediaSinkL( *(iVideoOutSession->Streams()[0]), + KMceRTPSink ); + EUNIT_ASSERT( sink->Type() == KMceRTPSink ) + } + + +// ----------------------------------------------------------------------------- +// From session +// ----------------------------------------------------------------------------- +// +void UT_MusEngMceUtils::UT_GetMediaSinkFromSessionL() + { + CMceMediaSink* sink = MusEngMceUtils::GetMediaSink( *iEmptySession, + KMceRTPSink ); + EUNIT_ASSERT( !sink ) + + sink = MusEngMceUtils::GetMediaSink( *iVideoOutSession, KMceRTPSink ); + + EUNIT_ASSERT( sink ) + EUNIT_ASSERT( sink->Type() == KMceRTPSink ) + } + + +// ----------------------------------------------------------------------------- +// From session +// ----------------------------------------------------------------------------- +// +void UT_MusEngMceUtils::UT_GetMediaSinkLFromSessionL() + { + CMceMediaSink* sink = NULL; + EUNIT_ASSERT_SPECIFIC_LEAVE( MusEngMceUtils::GetMediaSinkL( *iEmptySession, + KMceRTPSink ), + KErrNotFound ) + + sink = MusEngMceUtils::GetMediaSinkL( *iVideoOutSession, KMceRTPSink ); + EUNIT_ASSERT( sink->Type() == KMceRTPSink ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_MusEngMceUtils::UT_GetCameraLL() + { + // empty session fails + EUNIT_ASSERT_SPECIFIC_LEAVE( MusEngMceUtils::GetCameraL( *iEmptySession ), + KErrNotFound ) + + // succeed + CMceCameraSource* camera = MusEngMceUtils::GetCameraL( *iVideoOutSession ); + + EUNIT_ASSERT( camera ) + EUNIT_ASSERT( camera->Type() == KMceCameraSource ) + + // delete source from video out stream and try without it, fails + iVideoOutSession->Streams()[0]->SetSourceL( NULL ); + + EUNIT_ASSERT_SPECIFIC_LEAVE( + MusEngMceUtils::GetCameraL( *iVideoOutSession ), + KErrNotFound ) + + // Add file source and try again, still fails + iVideoOutSession->Streams()[0]->SetSourceL( + CMceFileSource::NewLC( *iManager, KTestVideoFileName() ) ); + CleanupStack::Pop(); + + EUNIT_ASSERT_SPECIFIC_LEAVE( + MusEngMceUtils::GetCameraL( *iVideoOutSession ), + KErrNotFound ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_MusEngMceUtils::UT_GetFileSourceLL() + { + // empty session fails + EUNIT_ASSERT_SPECIFIC_LEAVE( + MusEngMceUtils::GetFileSourceL( *iEmptySession ), + KErrNotFound ) + + // delete source from video out stream and try without it, fails + iVideoOutSession->Streams()[0]->SetSourceL( NULL ); + + EUNIT_ASSERT_SPECIFIC_LEAVE( + MusEngMceUtils::GetFileSourceL( *iVideoOutSession ), + KErrNotFound ) + + // Add camera source and try again, still fails + iVideoOutSession->Streams()[0]->SetSourceL( + CMceCameraSource::NewLC( *iManager ) ); + CleanupStack::Pop(); + + EUNIT_ASSERT_SPECIFIC_LEAVE( + MusEngMceUtils::GetFileSourceL( *iVideoOutSession ), + KErrNotFound ) + + // Replace camera with file source, now succeeds + iVideoOutSession->Streams()[0]->SetSourceL( + CMceFileSource::NewLC( *iManager, KTestVideoFileName() ) ); + CleanupStack::Pop(); + + CMceFileSource* file = MusEngMceUtils::GetFileSourceL( *iVideoOutSession ); + + EUNIT_ASSERT( file ) + EUNIT_ASSERT( file->Type() == KMceFileSource ) + + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_MusEngMceUtils::UT_GetDisplayL() + { + CMceDisplaySink* display = MusEngMceUtils::GetDisplay( *iEmptySession ); + + EUNIT_ASSERT( !display ) + + display = MusEngMceUtils::GetDisplay( *iVideoOutSession ); + + EUNIT_ASSERT( display ) + EUNIT_ASSERT( display->Type() == KMceDisplaySink ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_MusEngMceUtils::UT_GetDisplayLL() + { + CMceDisplaySink* display = NULL; + + EUNIT_ASSERT_SPECIFIC_LEAVE( MusEngMceUtils::GetDisplayL( *iEmptySession ), + KErrNotFound ) + + display = MusEngMceUtils::GetDisplayL( *iVideoOutSession ); + + EUNIT_ASSERT( display ) + EUNIT_ASSERT( display->Type() == KMceDisplaySink ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_MusEngMceUtils::UT_AddDisplayLL() + { + + TRect rect( 110, 111, 112, 113 ); + + // Check that display cannot be added to audio stream + + CMceAudioStream* audioStream = CMceAudioStream::NewLC(); + EUNIT_ASSERT_SPECIFIC_LEAVE ( + MusEngMceUtils::AddDisplayL( *audioStream, *iManager, rect ), + KErrArgument ) + CleanupStack::PopAndDestroy( audioStream ); + + // Check that display can be added to video stream + CMceVideoStream* videoStream = CMceVideoStream::NewLC(); + + MusEngMceUtils::AddDisplayL( *videoStream, *iManager, rect ); + + EUNIT_ASSERT_EQUALS( videoStream->Sinks().Count(), 1 ) + EUNIT_ASSERT_EQUALS( videoStream->Sinks()[0]->Type(), KMceDisplaySink ) + EUNIT_ASSERT( videoStream->Sinks()[0]->IsEnabled() ) + + // Check the rect + CMceDisplaySink* display = + static_cast(videoStream->Sinks()[0]); + + EUNIT_ASSERT_EQUALS( display->DisplayRectL(), rect ); + + // Enable display and check that another display is not added on request. + // Still existing display must be enabled and new rect set + display->EnableL(); + TRect newRect( 115, 116, 117, 118 ); + MusEngMceUtils::AddDisplayL( *videoStream, *iManager, newRect ); + + EUNIT_ASSERT_EQUALS( videoStream->Sinks().Count(), 1 ) + EUNIT_ASSERT_EQUALS( videoStream->Sinks()[0]->Type(), KMceDisplaySink ) + EUNIT_ASSERT( videoStream->Sinks()[0]->IsEnabled() ) + + EUNIT_ASSERT( videoStream->Sinks()[0] == display ) + + // Check that rect is still changed + EUNIT_ASSERT_EQUALS( display->DisplayRectL(), newRect ); + + CleanupStack::PopAndDestroy( videoStream ); + + // Add disabled display + CMceVideoStream* videoStream2 = CMceVideoStream::NewLC(); + MusEngMceUtils::AddDisplayL( *videoStream2, *iManager, rect, ETrue ); + EUNIT_ASSERT_EQUALS( videoStream2->Sinks().Count(), 1 ) + EUNIT_ASSERT_EQUALS( videoStream2->Sinks()[0]->Type(), KMceDisplaySink ) + EUNIT_ASSERT( !videoStream2->Sinks()[0]->IsEnabled() ); + CleanupStack::PopAndDestroy( videoStream2 ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_MusEngMceUtils::UT_AddSpeakerLL() + { + // Check that speaker cannot be added to video stream + + CMceVideoStream* videoStream = CMceVideoStream::NewLC(); + EUNIT_ASSERT_SPECIFIC_LEAVE ( + MusEngMceUtils::AddSpeakerL( *videoStream ), + KErrArgument ) + CleanupStack::PopAndDestroy( videoStream ); + + // Check that speaker can be added to audio stream + CMceAudioStream* audioStream = CMceAudioStream::NewLC(); + + MusEngMceUtils::AddSpeakerL( *videoStream ); + + EUNIT_ASSERT_EQUALS( audioStream->Sinks().Count(), 1 ) + EUNIT_ASSERT_EQUALS( audioStream->Sinks()[0]->Type(), KMceSpeakerSink ) + EUNIT_ASSERT( audioStream->Sinks()[0]->IsEnabled() ) + + // Enable speaker and check that another speaker is not added on request + // Still existing speaker must be enabled + CMceSpeakerSink* speaker = + static_cast(videoStream->Sinks()[0]); + + speaker->EnableL(); + + MusEngMceUtils::AddSpeakerL( *audioStream ); + + EUNIT_ASSERT_EQUALS( audioStream->Sinks().Count(), 1 ) + EUNIT_ASSERT_EQUALS( audioStream->Sinks()[0]->Type(), KMceSpeakerSink ) + EUNIT_ASSERT( audioStream->Sinks()[0]->IsEnabled() ) + + EUNIT_ASSERT( audioStream->Sinks()[0] == speaker ) + + CleanupStack::PopAndDestroy( audioStream ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_MusEngMceUtils::UT_DisableStreamLL() + { + CMceAudioStream* audioStream = CMceAudioStream::NewLC(); + + // Disable only stream + EUNIT_ASSERT( audioStream->IsEnabled() ) + MusEngMceUtils::DisableStreamL( *audioStream ); + EUNIT_ASSERT( !audioStream->IsEnabled() ) + + audioStream->EnableL(); + + // Disable stream and source + CMceRtpSource* rtpSource = CMceRtpSource::NewLC(); + audioStream->SetSourceL( rtpSource ); + CleanupStack::Pop( rtpSource ); + + EUNIT_ASSERT( audioStream->IsEnabled() ) + EUNIT_ASSERT( rtpSource->IsEnabled() ) + MusEngMceUtils::DisableStreamL( *audioStream ); + EUNIT_ASSERT( !audioStream->IsEnabled() ) + EUNIT_ASSERT( !rtpSource->IsEnabled() ) + + audioStream->EnableL(); + rtpSource->EnableL(); + + // Disable stream, source and sinks + CMceSpeakerSink* speaker = CMceSpeakerSink::NewLC(); + audioStream->AddSinkL( speaker ); + CleanupStack::Pop( speaker ); + + EUNIT_ASSERT( audioStream->IsEnabled() ) + EUNIT_ASSERT( rtpSource->IsEnabled() ) + EUNIT_ASSERT( speaker->IsEnabled() ) + MusEngMceUtils::DisableStreamL( *audioStream ); + EUNIT_ASSERT( !audioStream->IsEnabled() ) + EUNIT_ASSERT( !rtpSource->IsEnabled() ) + EUNIT_ASSERT( !speaker->IsEnabled() ) + + CleanupStack::PopAndDestroy( audioStream ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_MusEngMceUtils::UT_GetReceivingDisplayL() + { + CMceDisplaySink* display = MusEngMceUtils::GetReceivingDisplay( *iEmptySession ); + + EUNIT_ASSERT( !display ) + + display = MusEngMceUtils::GetReceivingDisplay( *iVideoOutSession ); + + EUNIT_ASSERT( display ) + EUNIT_ASSERT( display->Type() == KMceDisplaySink ) + EUNIT_ASSERT( display == iReceivingDisplay ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_MusEngMceUtils::UT_GetReceivingDisplayLL() + { + CMceDisplaySink* display = NULL; + + EUNIT_ASSERT_SPECIFIC_LEAVE( MusEngMceUtils::GetReceivingDisplayL( *iEmptySession ), + KErrNotFound ) + + display = MusEngMceUtils::GetReceivingDisplayL( *iVideoOutSession ); + + EUNIT_ASSERT( display ) + EUNIT_ASSERT( display->Type() == KMceDisplaySink ) + EUNIT_ASSERT( display == iReceivingDisplay ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_MusEngMceUtils::UT_GetVfDisplayL() + { + CMceDisplaySink* display = MusEngMceUtils::GetVfDisplay( *iEmptySession ); + + EUNIT_ASSERT( !display ) + + display = MusEngMceUtils::GetVfDisplay( *iVideoOutSession ); + + EUNIT_ASSERT( display ) + EUNIT_ASSERT( display->Type() == KMceDisplaySink ) + EUNIT_ASSERT( display != iReceivingDisplay ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_MusEngMceUtils::UT_EnableInactivityTimerL() + { + // Instream not found, nothing is done + EUNIT_ASSERT_EQUALS( MusEngMceUtils::EnableInactivityTimer( *iEmptySession, 1000 ), KErrNotFound ); + + // In stream found + EUNIT_ASSERT_EQUALS( MusEngMceUtils::EnableInactivityTimer( *iVideoOutSession, 1000 ), KErrNone ); + } + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_MusEngMceUtils, + "UT_MusEngMceUtils", + "UNIT" ) + +EUNIT_TEST( + "IsVideoInStream - test ", + "MusEngMceUtils", + "IsVideoInStream", + "FUNCTIONALITY", + SetupL, UT_IsVideoInStreamL, Teardown) + +EUNIT_TEST( + "IsVideoOutStream - test ", + "MusEngMceUtils", + "IsVideoOutStream", + "FUNCTIONALITY", + SetupL, UT_IsVideoOutStreamL, Teardown) + +EUNIT_TEST( + "IsAudioInStream - test ", + "MusEngMceUtils", + "IsAudioInStream", + "FUNCTIONALITY", + SetupL, UT_IsAudioInStreamL, Teardown) + +EUNIT_TEST( + "GetVideoOutStreamL - test ", + "MusEngMceUtils", + "GetVideoOutStreamL", + "FUNCTIONALITY", + SetupL, UT_GetVideoOutStreamLL, Teardown) + +EUNIT_TEST( + "GetVideoInStreamL - test ", + "MusEngMceUtils", + "GetVideoInStreamL", + "FUNCTIONALITY", + SetupL, UT_GetVideoInStreamLL, Teardown) + +EUNIT_TEST( + "GetRecordingStream - test ", + "MusEngMceUtils", + "GetRecordingStream", + "FUNCTIONALITY", + SetupL, UT_GetRecordingStreamL, Teardown) + +EUNIT_TEST( + "GetMediaSink - test ", + "MusEngMceUtils", + "GetMediaSink", + "FUNCTIONALITY", + SetupL, UT_GetMediaSinkFromStreamL, Teardown) + +EUNIT_TEST( + "GetMediaSinkL - test ", + "MusEngMceUtils", + "GetMediaSinkL", + "FUNCTIONALITY", + SetupL, UT_GetMediaSinkLFromStreamL, Teardown) + +EUNIT_TEST( + "GetMediaSink2 - test ", + "MusEngMceUtils", + "GetMediaSink2", + "FUNCTIONALITY", + SetupL, UT_GetMediaSinkFromSessionL, Teardown) + +EUNIT_TEST( + "GetMediaSinkL2 - test ", + "MusEngMceUtils", + "GetMediaSinkL2", + "FUNCTIONALITY", + SetupL, UT_GetMediaSinkLFromSessionL, Teardown) + +EUNIT_TEST( + "GetCameraL - test ", + "MusEngMceUtils", + "GetCameraL", + "FUNCTIONALITY", + SetupL, UT_GetCameraLL, Teardown) + +EUNIT_TEST( + "GetFileSourceL - test ", + "MusEngMceUtils", + "GetFileSourceL", + "FUNCTIONALITY", + SetupL, UT_GetFileSourceLL, Teardown) + +EUNIT_TEST( + "GetDisplay - test ", + "MusEngMceUtils", + "GetDisplay", + "FUNCTIONALITY", + SetupL, UT_GetDisplayL, Teardown) + +EUNIT_TEST( + "GetDisplayL - test ", + "MusEngMceUtils", + "GetDisplayL", + "FUNCTIONALITY", + SetupL, UT_GetDisplayLL, Teardown) + +EUNIT_TEST( + "AddDisplayL - test ", + "MusEngMceUtils", + "AddDisplayL", + "FUNCTIONALITY", + SetupL, UT_AddDisplayLL, Teardown) + +EUNIT_TEST( + "AddSpeakerL - test ", + "MusEngMceUtils", + "AddSpeakerL", + "FUNCTIONALITY", + SetupL, UT_AddSpeakerLL, Teardown) + +EUNIT_TEST( + "DisableStreamL - test ", + "MusEngMceUtils", + "DisableStreamL", + "FUNCTIONALITY", + SetupL, UT_DisableStreamLL, Teardown) + +EUNIT_TEST( + "GetReceivingDisplay - test ", + "MusEngMceUtils", + "GetReceivingDisplay", + "FUNCTIONALITY", + Setup2L, UT_GetReceivingDisplayL, Teardown) + +EUNIT_TEST( + "GetReceivingDisplayL - test ", + "MusEngMceUtils", + "GetReceivingDisplayL", + "FUNCTIONALITY", + Setup2L, UT_GetReceivingDisplayLL, Teardown) + +EUNIT_TEST( + "GetVfDisplay - test ", + "MusEngMceUtils", + "GetVfDisplay", + "FUNCTIONALITY", + Setup2L, UT_GetVfDisplayL, Teardown) + +EUNIT_TEST( + "EnableInactivityTimer - test ", + "MusEngMceUtils", + "EnableInactivityTimer", + "FUNCTIONALITY", + Setup2L, UT_EnableInactivityTimerL, Teardown) + +EUNIT_END_TEST_TABLE + +// END OF FILE + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/tsrc/ut_engine/src/ut_musengoutsession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/tsrc/ut_engine/src/ut_musengoutsession.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,1096 @@ +/* +* 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: +* +*/ + + +// INTERNAL INCLUDES +#include "ut_musengoutsession.h" +#include "musengstubs.h" +#include "musengtestdefs.h" +#include "sipprofile.h" +#include "musenglivesession.h" +#include "musengclipsession.h" +#include "mussipprofilehandler.h" +#include "mussessionproperties.h" +#include "contactenginestub.h" + +// SYSTEM INCLUDES +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#include + +#include +#include + +_LIT( KTestContactName, "nokia" ); + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusEngOutSession* UT_CMusEngOutSession::NewL() + { + UT_CMusEngOutSession* self = UT_CMusEngOutSession::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusEngOutSession* UT_CMusEngOutSession::NewLC() + { + UT_CMusEngOutSession* self = new( ELeave ) UT_CMusEngOutSession(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusEngOutSession::~UT_CMusEngOutSession() + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// Default constructor +// ----------------------------------------------------------------------------- +// +UT_CMusEngOutSession::UT_CMusEngOutSession() + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// Second phase construct +// ----------------------------------------------------------------------------- +// +void UT_CMusEngOutSession::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngOutSession::SetupL() + { + + PropertyHelper::SetErrorCode( KErrNone ); + + iLcSessionObserver = new( ELeave )CLcSessionObserverStub; + iLcUiProvider = new( ELeave )CLcUiProviderStub; + iAudioRoutingObserver = new( ELeave )CMusEngObserverStub; + // Name is published using publish/subscribe key by Availblity + User::LeaveIfError( RProperty::Set( NMusSessionApi::KCategoryUid, + NMusSessionApi::KContactName, + KTestContactName ) ); + iLiveSession = CMusEngLiveSession::NewL(); + iLiveSession->SetLcSessionObserver( iLcSessionObserver ); + iLiveSession->SetLcUiProvider( iLcUiProvider ); + + SIPStrings::OpenL(); + + User::LeaveIfError( RProperty::Set( NMusSessionApi::KCategoryUid, + NMusSessionApi::KRemoteSipAddress, + KTestRecipientSipUri ) ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngOutSession::Teardown() + { + SIPStrings::Close(); + delete iLiveSession; + delete iLcSessionObserver; + delete iLcUiProvider; + delete iAudioRoutingObserver; + PropertyHelper::SetErrorCode( KErrNone ); + PropertyHelper::Close(); + } + + +// TEST CASES + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngOutSession::UT_EstablishLcSessionL() + { + // Initial state + EUNIT_ASSERT( !iLiveSession->iSession ); + + /////////////////////////////////////////////////////////////////////////// + // 1. Simulate failing session structure construction. + iLiveSession->EstablishLcSessionL(); + + iLiveSession->iSession->iState = CMceSession::EIdle; + delete iLiveSession->iSession->Streams()[0]; + const RPointerArray& constStreams = + iLiveSession->iSession->Streams(); + const_cast&>(constStreams)[0] = NULL; + + /////////////////////////////////////////////////////////////////////////// + // 2. Normal invite + iLiveSession->EstablishLcSessionL(); + + EUNIT_ASSERT( iLiveSession->iSession ); + // Next assertion ensures that session structure is new + EUNIT_ASSERT( iLiveSession->iSession->Streams().Count() > 0 ); + EUNIT_ASSERT( iLiveSession->iSession->Streams()[0] ); + EUNIT_ASSERT( *(iLiveSession->iRecipient) == KTestRecipientSipUri8() ); + EUNIT_ASSERT( iLiveSession->iSession->State() == CMceSession::EOffering ); + + EUNIT_ASSERT( iLiveSession->iSession->iHeaders ); + EUNIT_ASSERT( iLiveSession->iSession->iHeaders->Count() == 2 ); + EUNIT_ASSERT( iLiveSession->iSession->iHeaders->MdcaPoint( 0 ) == + KMusEngAcceptContactHeader() ); + EUNIT_ASSERT( iLiveSession->iSession->iHeaders->MdcaPoint( 1 ) == + KMusAcceptHeader() ); + EUNIT_ASSERT( iLiveSession->iSession->iSessionSDPLines ); + EUNIT_ASSERT( iLiveSession->iSession->iSessionSDPLines->Count() == 1 ); + EUNIT_ASSERT( iLiveSession->iSession->iSessionSDPLines->MdcaPoint( 0 ) == + KMusEngSessionSdpLineXApplication() ); + + // Ensure there is no SDP lines at media level + MDesC8Array* mediaSdpLines = + iLiveSession->iSession->Streams()[0]->iMediaSDPLines; + EUNIT_ASSERT( mediaSdpLines ); + EUNIT_ASSERT( mediaSdpLines->MdcaCount() == 0 ); + + /////////////////////////////////////////////////////////////////////////// + // 3. Normal operator invite + delete iLiveSession; + iLiveSession = NULL; + iLiveSession = CMusEngLiveSession::NewL(); + iLiveSession->SetLcSessionObserver( iLcSessionObserver ); + iLiveSession->SetLcUiProvider( iLcUiProvider ); + iLiveSession->iOperatorVariant = ETrue; + CSIPProfile* profile = iLiveSession->iSipProfileHandler->Profile(); + delete profile->iArray; + profile->iArray = NULL; + profile->iArray = new ( ELeave ) CDesC8ArrayFlat( 1 ); + profile->iArray->AppendL( KMusTestUri ); + + iLiveSession->EstablishLcSessionL(); + + EUNIT_ASSERT( iLiveSession->iSession ); + // Next assertion ensures that session structure is new + EUNIT_ASSERT( *(iLiveSession->iRecipient) == KTestRecipientSipUri8() ); + EUNIT_ASSERT( iLiveSession->iSession->State() == CMceSession::EOffering ); + + EUNIT_ASSERT( iLiveSession->iSession->iHeaders ); + EUNIT_ASSERT( iLiveSession->iSession->iHeaders->Count() == 3 ); + EUNIT_ASSERT( iLiveSession->iSession->iHeaders->MdcaPoint( 0 ) == + KMusEngAcceptContactHeader() ); + EUNIT_ASSERT( iLiveSession->iSession->iHeaders->MdcaPoint( 1 ) == + KMusAcceptHeader() ); + + EUNIT_ASSERT( iLiveSession->iSession->iHeaders->MdcaPoint( 2 ) == + KMusPPreferredIdentityTestHeader() ); + + // Ensure there is only a=type and a=application attributes (and no b=TIAS) + // at session level for operator variant + EUNIT_ASSERT( iLiveSession->iSession->iSessionSDPLines ); + EUNIT_ASSERT( iLiveSession->iSession->iSessionSDPLines->Count() == 2 ); + EUNIT_ASSERT( iLiveSession->iSession->iSessionSDPLines->MdcaPoint( 0 ) == + KMusEngSessionSdpLineApplication() ) + EUNIT_ASSERT( iLiveSession->iSession->iSessionSDPLines->MdcaPoint( 1 ) == + KMusEngSessionSdpLineType() ) + + EUNIT_ASSERT( iLiveSession->iSession->Streams().Count() > 0 ); + EUNIT_ASSERT( iLiveSession->iSession->Streams()[0] ); + EUNIT_ASSERT( iLiveSession->iSession->Streams()[0]->Type() == KMceVideo ); + + // Ensure there is only b=AS and no b=TIAS present at media level + // for operator variant + mediaSdpLines = iLiveSession->iSession->Streams()[0]->iMediaSDPLines; + EUNIT_ASSERT( mediaSdpLines ); + EUNIT_ASSERT( mediaSdpLines->MdcaCount() == 1 ); + EUNIT_ASSERT( mediaSdpLines->MdcaPoint( 0 ) == + KMusEngSessionSdpLineBandwidthField() ); + + /////////////////////////////////////////////////////////////////////////// + // 4. Try invite again, must fail + TRAPD( error, iLiveSession->EstablishLcSessionL() ); + MUS_TEST_FORWARD_ALLOC_FAILURE( error ); + EUNIT_ASSERT( error == KErrAlreadyExists ); + + // 5. Simulate normal session ending, no need for observer call in this case + iLiveSession->iSession->iState = CMceSession::ETerminated; + + // Try again. Establishment must be OK with new MceSession object + iLiveSession->EstablishLcSessionL(); + EUNIT_ASSERT( iLiveSession->iSession->State() == CMceSession::EOffering ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngOutSession::UT_EstablishLcSession_RecipientResolvingL() + { + // Manual query from user, + // the user cancels the query (MLcUiProvider::Query returns EFalse) + PropertyHelper::SetErrorCode( KErrNotFound ); + TRAPD( err, iLiveSession->EstablishLcSessionL() ) + if ( err == KErrNoMemory ) + { + User::Leave( err ); + } + EUNIT_ASSERT_EQUALS( KErrCancel, err ) + + // Manual query from user succeeds + iLcSessionObserver->Reset(); + iLcUiProvider->Reset(); + delete iLiveSession; + iLiveSession = NULL; + iLiveSession = CMusEngLiveSession::NewL(); + iLiveSession->SetLcSessionObserver( iLcSessionObserver ); + iLiveSession->SetLcUiProvider( iLcUiProvider ); + iLcUiProvider->iSimulatedReturnValue = ETrue; + iLcUiProvider->iRecipient.Set( KTestRecipient2SipUri ); + PropertyHelper::SetErrorCode( KErrNotFound ); + iLiveSession->EstablishLcSessionL(); + EUNIT_ASSERT_EQUALS( 1, iLiveSession->iTriedInvitations ) + EUNIT_ASSERT_EQUALS( + TInt( CLcUiProviderStub::EInputRecipient ), + iLcUiProvider->iCalledFunction ) + EUNIT_ASSERT_EQUALS( + KTestRecipient2SipUri8(), + *( iLiveSession->iRecipient ) ) + EUNIT_ASSERT_EQUALS( KTestRecipient2SipUri(),iLiveSession->RemoteDisplayName() ) + + // Multiple resolved recipients + iLcSessionObserver->Reset(); + iLcUiProvider->Reset(); + iLcUiProvider->iSimulatedReturnValue = ETrue; + PropertyHelper::SetErrorCode( KErrNone ); + TBuf<200> multipleAddr; + multipleAddr.Append( KTestRecipient2SipUri ); + multipleAddr.Append( _L(",") ); + multipleAddr.Append( KTestRecipientSipUri ); + + User::LeaveIfError( RProperty::Set( NMusSessionApi::KCategoryUid, + NMusSessionApi::KRemoteSipAddress, + multipleAddr ) ); + delete iLiveSession; + iLiveSession = NULL; + iLiveSession = CMusEngLiveSession::NewL(); + iLiveSession->SetLcSessionObserver( iLcSessionObserver ); + iLiveSession->SetLcUiProvider( iLcUiProvider ); + iLiveSession->EstablishLcSessionL(); + + EUNIT_ASSERT_EQUALS( 0, iLiveSession->iTriedInvitations ) + EUNIT_ASSERT_EQUALS( + TInt( CLcUiProviderStub::ESelectRecipient ), + iLcUiProvider->iCalledFunction ) + // Stub selected first one from multiple addresses list + EUNIT_ASSERT_EQUALS( + KTestRecipient2SipUri8(), + *( iLiveSession->iRecipient ) ) + + // Multiple resolved recipient, user doesn't select any + iLcSessionObserver->Reset(); + iLcUiProvider->Reset(); + delete iLiveSession; + iLiveSession = NULL; + iLiveSession = CMusEngLiveSession::NewL(); + iLiveSession->SetLcSessionObserver( iLcSessionObserver ); + iLiveSession->SetLcUiProvider( iLcUiProvider ); + TRAP( err, iLiveSession->EstablishLcSessionL() ); + if ( err == KErrNoMemory ) + { + User::Leave( err ); + } + EUNIT_ASSERT_EQUALS( KErrNotFound, err ) + EUNIT_ASSERT_EQUALS( 0, iLiveSession->iTriedInvitations ) + EUNIT_ASSERT_EQUALS( + TInt( CLcUiProviderStub::ESelectRecipient ), + iLcUiProvider->iCalledFunction ) + + // Malformed multiple addresses, selection fails, manual entry is launched + iLcSessionObserver->Reset(); + iLcUiProvider->Reset(); + iLcUiProvider->iSimulatedReturnValue = ETrue; + iLcUiProvider->iRecipient.Set( KTestRecipient2SipUri ); + PropertyHelper::SetErrorCode( KErrNone ); + multipleAddr.Copy( _L(",") ); + User::LeaveIfError( RProperty::Set( NMusSessionApi::KCategoryUid, + NMusSessionApi::KRemoteSipAddress, + multipleAddr ) ); + delete iLiveSession; + iLiveSession = NULL; + iLiveSession = CMusEngLiveSession::NewL(); + iLiveSession->SetLcSessionObserver( iLcSessionObserver ); + iLiveSession->SetLcUiProvider( iLcUiProvider ); + TRAP( err, iLiveSession->EstablishLcSessionL() ); + if ( err == KErrNoMemory ) + { + User::Leave( err ); + } + EUNIT_ASSERT_EQUALS( + TInt( CLcUiProviderStub::EInputRecipient ), + iLcUiProvider->iCalledFunction ) + EUNIT_ASSERT_EQUALS( KErrNone, err ); + EUNIT_ASSERT_EQUALS( 1, iLiveSession->iTriedInvitations ) + EUNIT_ASSERT_EQUALS( + KTestRecipient2SipUri8(), + *( iLiveSession->iRecipient ) ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngOutSession::UT_EstablishLcSession_RegistrationPendingL() + { + // Set registration as pending + iLiveSession->iSipProfileHandler->Profile()->iTBoolValue = EFalse; + + iLiveSession->EstablishLcSessionL(); + EUNIT_ASSERT( !iLiveSession->iSession ) + EUNIT_ASSERT( iLiveSession->iRegistrationPending ) + + // Fake registration, session starts + iLiveSession->iSipProfileHandler->Profile()->iTBoolValue = ETrue; + iLiveSession->ProfileRegistered(); + + if ( iLcSessionObserver->iCalledFunction == CLcSessionObserverStub::ESessionFailed ) + { + // Session didn't start because of running out of memory + User::Leave( KErrNoMemory ); + } + + iLiveSession->iDeltaTimer->Remove( iLiveSession->iInvitationResponseEntry ); + CMusEngMceOutSession::InvitationResponseTimerExpired( iLiveSession ); + EUNIT_ASSERT_EQUALS( TInt( iLcSessionObserver->iCalledFunction ), + TInt( CLcSessionObserverStub::ESessionFailed ) ) + EUNIT_ASSERT_EQUALS( iLcSessionObserver->iError, + TInt( MLcSession::ENoAnswer ) ) + iLcSessionObserver->Reset(); + + EUNIT_ASSERT( iLiveSession->iSession ) + EUNIT_ASSERT_EQUALS( iLiveSession->iSession->State(), + CMceSession::EOffering ) + EUNIT_ASSERT( !iLiveSession->iRegistrationPending ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngOutSession::UT_TerminateLcSessionL() + { + // No MCE session + EUNIT_ASSERT_SPECIFIC_LEAVE( + iLiveSession->TerminateLcSessionL(), KErrNotReady ) + + // Cancel a session that is in offering state + iLiveSession->EstablishLcSessionL(); + EUNIT_ASSERT_EQUALS( TInt( CMceSession::EOffering ), + TInt( iLiveSession->iSession->iState ) ) + iLiveSession->TerminateLcSessionL(); + EUNIT_ASSERT_EQUALS( TInt( CMceSession::ECancelling ), + TInt( iLiveSession->iSession->iState ) ) + + // Terminate an established session + iLiveSession->iSession->iState = CMceSession::ETerminated; + iLiveSession->EstablishLcSessionL(); + iLiveSession->iSession->iState = CMceSession::EEstablished; + iLiveSession->TerminateLcSessionL(); + EUNIT_ASSERT_EQUALS( TInt( CMceSession::ETerminating ), + TInt( iLiveSession->iSession->iState ) ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngOutSession::UT_EstablishSessionLL() + { + // Try to establish, must fail, because of missing session + TRAPD( error, iLiveSession->EstablishSessionL() ); + MUS_TEST_FORWARD_ALLOC_FAILURE( error ); + EUNIT_ASSERT( error == KErrNotReady ); + + // Call to CMusEngOutMceSession::InviteL leads to call to EstablishL + iLiveSession->EstablishLcSessionL(); + + // Check that ports are correct + + for ( TInt i = 0; i < iLiveSession->iSession->Streams().Count(); ++i ) + { + CMceMediaStream* stream = iLiveSession->iSession->Streams()[i]; + if ( stream->Type() == KMceAudio ) + { + EUNIT_ASSERT( stream->iLocalMediaPort == 57344 ) + } + else + { + EUNIT_ASSERT( stream->iLocalMediaPort == 49152 ) + } + } + + // Check Accept-Contact -header + + EUNIT_ASSERT( iLiveSession->iSession->iHeaders ) + EUNIT_ASSERT( iLiveSession->iSession->iHeaders->Count() == 2 ) + EUNIT_ASSERT( iLiveSession->iSession->iHeaders->MdcaPoint( 0 ) == + KMusEngAcceptContactHeader() ) + EUNIT_ASSERT( iLiveSession->iSession->iHeaders->MdcaPoint( 1 ) == + KMusAcceptHeader() ); + EUNIT_ASSERT( iLiveSession->iSession->State() == CMceSession::EOffering ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngOutSession::UT_HandleTerminationL() + { + // Try different values + iLiveSession->HandleTermination( KSipStatusCode408ConnectionTimeOut, + KNullDesC8() ); + EUNIT_ASSERT_EQUALS( TInt( iLcSessionObserver->iCalledFunction ), + TInt( CLcSessionObserverStub::ESessionFailed ) ) + EUNIT_ASSERT_EQUALS( iLcSessionObserver->iError, + TInt( MLcSession::ENoAnswer ) ) + iLcSessionObserver->Reset(); + + iLiveSession->HandleTermination( KSipStatusCode415UnsupportedMediaType, + KNullDesC8() ); + EUNIT_ASSERT_EQUALS( TInt( iLcSessionObserver->iCalledFunction ), + TInt( CLcSessionObserverStub::ESessionFailed ) ) + EUNIT_ASSERT_EQUALS( iLcSessionObserver->iError, + TInt( MLcSession::ESessionRejected ) ) + iLcSessionObserver->Reset(); + + iLiveSession->HandleTermination( KSipStatusCode488NotAcceptableHere, + KNullDesC8() ); + EUNIT_ASSERT_EQUALS( TInt( iLcSessionObserver->iCalledFunction ), + TInt( CLcSessionObserverStub::ESessionFailed ) ) + EUNIT_ASSERT_EQUALS( iLcSessionObserver->iError, + TInt( MLcSession::ESessionRejected ) ) + iLcSessionObserver->Reset(); + + iLiveSession->HandleTermination( KSipStatusCode606NotAcceptable, + KNullDesC8() ); + EUNIT_ASSERT_EQUALS( TInt( iLcSessionObserver->iCalledFunction ), + TInt( CLcSessionObserverStub::ESessionFailed ) ) + EUNIT_ASSERT_EQUALS( iLcSessionObserver->iError, + TInt( MLcSession::ESessionRejected ) ) + iLcSessionObserver->Reset(); + + iLiveSession->HandleTermination( KSipStatusCode486BusyHere, + KNullDesC8() ); + EUNIT_ASSERT_EQUALS( TInt( iLcSessionObserver->iCalledFunction ), + TInt( CLcSessionObserverStub::ESessionFailed ) ) + EUNIT_ASSERT_EQUALS( iLcSessionObserver->iError, + TInt( MLcSession::ERecipientBusy ) ) + iLcSessionObserver->Reset(); + + iLiveSession->HandleTermination( KSipStatusCode487RequestCancelled, + KNullDesC8() ); + EUNIT_ASSERT_EQUALS( TInt( iLcSessionObserver->iCalledFunction ), + TInt( CLcSessionObserverStub::ESessionFailed ) ) + EUNIT_ASSERT_EQUALS( iLcSessionObserver->iError, + TInt( MLcSession::ESessionCancelled ) ) + iLcSessionObserver->Reset(); + + iLiveSession->HandleTermination( KSipStatusCode603Decline, KNullDesC8() ); + EUNIT_ASSERT_EQUALS( TInt( iLcSessionObserver->iCalledFunction ), + TInt( CLcSessionObserverStub::ESessionFailed ) ) + EUNIT_ASSERT_EQUALS( iLcSessionObserver->iError, + TInt( MLcSession::ESessionRejected ) ) + iLcSessionObserver->Reset(); + + iLiveSession->HandleTermination( KSipStatusCode480TemporarilyNotAvailable, + KNullDesC8() ); + EUNIT_ASSERT_EQUALS( TInt( iLcSessionObserver->iCalledFunction ), + TInt( CLcSessionObserverStub::ESessionFailed ) ) + EUNIT_ASSERT_EQUALS( iLcSessionObserver->iError, + TInt( MLcSession::ERecipientTemporarilyNotAvailable ) ) + iLcSessionObserver->Reset(); + + // Receive 486 with operator variant + iLiveSession->iOperatorVariant = ETrue; + iLiveSession->HandleTermination( KSipStatusCode486BusyHere, KNullDesC8() ); + EUNIT_ASSERT_EQUALS( TInt( iLcSessionObserver->iCalledFunction ), + TInt( CLcSessionObserverStub::ESessionFailed ) ) + EUNIT_ASSERT_EQUALS( iLcSessionObserver->iError, + TInt( MLcSession::ESessionRejected ) ) + iLcSessionObserver->Reset(); + iLiveSession->iOperatorVariant = EFalse; + + // Normal termination, let the base class handle + iLiveSession->HandleTermination( KSipStatusCode200OK, KNullDesC8() ); + EUNIT_ASSERT_EQUALS( TInt( iLcSessionObserver->iCalledFunction ), + TInt( CLcSessionObserverStub::ESessionStateChanged ) ) + iLcSessionObserver->Reset(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngOutSession::UT_HandleRecipientNotFoundTerminationL() + { + EUNIT_ASSERT_EQUALS( iLiveSession->iTriedInvitations, 0 ); + + // Retry possible when 404 is received but fails because of recipient + // proposal is missing for some reason, recipient not found callback + // is called instead of retry + delete iLiveSession->iRemoteSipAddressProposal; + iLiveSession->iRemoteSipAddressProposal = NULL; + iLcSessionObserver->Reset(); + iLiveSession->HandleTermination( KSipStatusCode404RecipientNotFound, + KNullDesC8() ); + + EUNIT_ASSERT( iLiveSession->iDeltaTimer->IsActive() == ETrue ) + iLiveSession->AsyncBrakeCompleted( iLiveSession ); + EUNIT_ASSERT_EQUALS( TInt( iLcSessionObserver->iCalledFunction ), + TInt( CLcSessionObserverStub::ESessionFailed ) ) + EUNIT_ASSERT_EQUALS( iLcSessionObserver->iError, + TInt( MLcSession::ERecipientNotFound ) ) + + // Retry possible when 404 is received + delete iLiveSession->iRemoteSipAddressProposal; + iLiveSession->iRemoteSipAddressProposal = NULL; + iLiveSession->iRemoteSipAddressProposal = KTestRecipient2SipUri().AllocL(); + iLcSessionObserver->Reset(); + iLcUiProvider->iRecipient.Set( KTestRecipient2SipUri ); + iLcUiProvider->iSimulatedReturnValue = ETrue; + iLiveSession->HandleTermination( KSipStatusCode404RecipientNotFound, + KNullDesC8() ); + + EUNIT_ASSERT( iLiveSession->iDeltaTimer->IsActive() == ETrue ); + iLiveSession->AsyncBrakeCompleted( iLiveSession ); + + // Memory running out might cause that retry is not done + if ( iLcSessionObserver->iCalledFunction == CLcSessionObserverStub::ESessionFailed ) + { + User::Leave( KErrNoMemory ); + } + EUNIT_ASSERT_EQUALS( 1, iLiveSession->iTriedInvitations ) + EUNIT_ASSERT_EQUALS( + KTestRecipient2SipUri8(), + *( iLiveSession->iRecipient ) ) + + // Retry not anymore possible when 404 received (e.g. manual address query + // was done for invite). + iLcSessionObserver->Reset(); + iLiveSession->HandleTermination( KSipStatusCode404RecipientNotFound, + KNullDesC8() ); + EUNIT_ASSERT( iLiveSession->iDeltaTimer->IsActive() == ETrue ) + iLiveSession->AsyncBrakeCompleted( iLiveSession ); + EUNIT_ASSERT_EQUALS( TInt( iLcSessionObserver->iCalledFunction ), + TInt( CLcSessionObserverStub::ESessionFailed ) ) + EUNIT_ASSERT_EQUALS( iLcSessionObserver->iError, + TInt( MLcSession::ERecipientNotFound ) ) + + // 416 has identical handling + iLcSessionObserver->Reset(); + iLiveSession->HandleTermination( KSipStatusCode416UnsupportedUriScheme, + KNullDesC8() ); + EUNIT_ASSERT( iLiveSession->iDeltaTimer->IsActive() == ETrue ); + iLiveSession->AsyncBrakeCompleted( iLiveSession ); + EUNIT_ASSERT_EQUALS( TInt( iLcSessionObserver->iCalledFunction ), + TInt( CLcSessionObserverStub::ESessionFailed ) ) + EUNIT_ASSERT_EQUALS( iLcSessionObserver->iError, + TInt( MLcSession::ERecipientNotFound ) ) + + // 479 has identical handling + iLcSessionObserver->Reset(); + iLiveSession->HandleTermination( KSipStatusCode479NotAbleToProcessURI, + KNullDesC8() ); + EUNIT_ASSERT( iLiveSession->iDeltaTimer->IsActive() == ETrue ); + iLiveSession->AsyncBrakeCompleted( iLiveSession ); + EUNIT_ASSERT_EQUALS( TInt( iLcSessionObserver->iCalledFunction ), + TInt( CLcSessionObserverStub::ESessionFailed ) ) + EUNIT_ASSERT_EQUALS( iLcSessionObserver->iError, + TInt( MLcSession::ERecipientNotFound ) ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngOutSession::UT_AdjustVideoCodecLL() + { + //H263 + CMceH263Codec* codecH263 = CMceH263Codec::NewLC( KMceSDPNameH2632000() ); + iLiveSession->CMusEngMceOutSession::AdjustVideoCodecL( *codecH263, + KMceCameraSource ); + // Test payloadtype + EUNIT_ASSERT( codecH263->iPayloadType == 96 ) + CleanupStack::PopAndDestroy( codecH263 ); + + //H264 + CMceAvcCodec* codecAvc = CMceAvcCodec::NewLC( KMceSDPNameH264() ); + iLiveSession->CMusEngMceOutSession::AdjustVideoCodecL( *codecAvc, + KMceCameraSource ); + // Test payloadtype + EUNIT_ASSERT( codecAvc->iPayloadType == 98 ) + CleanupStack::PopAndDestroy( codecAvc ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngOutSession::UT_AdjustAudioCodecLL() + { + CMceAudioCodec* codec = + iLiveSession->iManager->SupportedAudioCodecs()[0]->CloneL(); + CleanupStack::PushL( codec ); + iLiveSession->CMusEngMceOutSession::AdjustAudioCodecL( *codec ); + + // Test payloadtype + + EUNIT_ASSERT( codec->iPayloadType == 97 ) + + // Test that base class has been called + + EUNIT_ASSERT( codec->iMMFPriority == KAudioPrioritySwisPlayback ) + EUNIT_ASSERT( codec->iMMFPriorityPreference == KAudioPrefSwisPlayback ) + + CleanupStack::PopAndDestroy( codec ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngOutSession::UT_CreateMceSessionStructureLL() + { + // Test removal of QoS-lines + + iLiveSession->iRecipient = KTestRecipientSipUri8().AllocL(); + + // IETF profile + iLiveSession->CreateMceSessionStructureL(); + TUint modifierValue = 500; //Just some value that is not used + iLiveSession->iSession->GetModifierL( KMcePreconditions, modifierValue ); + EUNIT_ASSERT( modifierValue == KMcePreconditionsNotUsed ); + + delete iLiveSession->iSession; + iLiveSession->iSession = NULL; + + // IMS profile + CSIPProfile* profile = iLiveSession->iSipProfileHandler->Profile(); + profile->iTypeInfo.iSIPProfileClass = TSIPProfileTypeInfo::EIms; + iLiveSession->CreateMceSessionStructureL(); + modifierValue = 0; + iLiveSession->iSession->GetModifierL( KMcePreconditions, modifierValue ); + EUNIT_ASSERT( modifierValue == KMcePreconditionsSupported ); + + // IMS profile with force internet signaling + + // TODO: Stub MultimediaSharingSettings, set ForceInternetSignalingSettingL + // to return EForceInternetSignaling and test again + + // Test bundling + + EUNIT_ASSERT( iLiveSession->iSession->Bundles().Count() == 0 ) + + CMusEngClipSession* clipSession = CMusEngClipSession::NewL(); + CleanupStack::PushL( clipSession ); + clipSession->SetLcSessionObserver( iLcSessionObserver ); + clipSession->SetLcUiProvider( iLcUiProvider ); + clipSession->LocalVideoPlayer()->LcSourceFileControl()->SetLcFileNameL( + KTestVideoFileName() ); + + clipSession->iRecipient = KTestRecipientSipUri8().AllocL(); + + clipSession->CreateMceSessionStructureL(); + + CMceSession* session = clipSession->iSession; + + EUNIT_ASSERT( session->Bundles().Count() == 1 ) + EUNIT_ASSERT( session->Bundles()[0]->Streams().Count() == 2 ) + EUNIT_ASSERT( session->Bundles()[0]->Streams()[0]->Type() == KMceAudio ) + EUNIT_ASSERT( session->Bundles()[0]->Streams()[0]->Sinks()[0]->Type() == + KMceSpeakerSink ) + EUNIT_ASSERT( session->Bundles()[0]->Streams()[1]->Type() == KMceVideo ) + EUNIT_ASSERT( session->Bundles()[0]->Streams()[1]->Sinks()[0]->Type() == + KMceDisplaySink ) + + CleanupStack::PopAndDestroy( clipSession ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngOutSession::UT_ConstructLL() + { + TUint32 profileid = 0; + CSIPProfile* profile = iLiveSession->iSipProfileHandler->Profile(); + profile->GetParameter( KSIPProfileId, profileid ); + //stub creates defaultprofile if profileid is zero + //stub does not care if the profileid is given or not + //profileid of new profile is always 1 + EUNIT_ASSERT(profile->iIsDefaultProfile) + + TInt error = NULL; + const TUint KSipProfileId2( 2 ); + TRAP( error, RProperty::Set( NMusSessionApi::KCategoryUid, + NMusSessionApi::KSipProfileId, + KSipProfileId2 ) ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT ( error == KErrNone ); + profile = NULL; + profileid = 0; + + SIPStrings::Close(); + delete iLcSessionObserver; + iLcSessionObserver = NULL; + delete iLiveSession; + iLiveSession = NULL; + + iLcSessionObserver = new( ELeave )CLcSessionObserverStub; + iLiveSession = CMusEngLiveSession::NewL(); + iLiveSession->SetLcSessionObserver( iLcSessionObserver ); + iLiveSession->SetLcUiProvider( iLcUiProvider ); + + SIPStrings::OpenL(); + + profile = iLiveSession->iSipProfileHandler->Profile(); + profile->GetParameter( KSIPProfileId, profileid ); + EUNIT_ASSERT( !profile->iIsDefaultProfile ) + + + TRAP( error, RProperty::Delete( NMusSessionApi::KCategoryUid, + NMusSessionApi::KSipProfileId ) ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT ( error == KErrNone ); + profile = NULL; + profileid = 0; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngOutSession::UT_ContactSavingLL() + { + ContactEngineStubHelper::Reset(); + + // Saving of contact is done at destruction phase only if recipient + // has been queried from client + // + CMusEngLiveSession* liveSession = CMusEngLiveSession::NewL(); + liveSession->SetLcSessionObserver( iLcSessionObserver ); + liveSession->SetLcUiProvider( iLcUiProvider ); + delete liveSession; + liveSession = NULL; + EUNIT_ASSERT( ContactEngineStubHelper::GetCalledFunction() == EContactEngineStubNone ); + + + User::LeaveIfError( RProperty::Set( NMusSessionApi::KCategoryUid, + NMusSessionApi::KContactId, + 2 ) ); + User::LeaveIfError( RProperty::Set( NMusSessionApi::KCategoryUid, + NMusSessionApi::KTelNumber, + _L("12341234") ) ); + + liveSession = CMusEngLiveSession::NewL(); + CleanupStack::PushL( liveSession ); + liveSession->SetLcSessionObserver( iLcSessionObserver ); + liveSession->SetLcUiProvider( iLcUiProvider ); + + delete liveSession->iRecipient; + liveSession->iRecipient = NULL; + liveSession->iRecipient = _L8("sip:yep@10.10.10.10").AllocL(); + liveSession->iAddressQueried = ETrue; + CleanupStack::PopAndDestroy( liveSession ); + if ( ContactEngineStubHelper::GetCalledFunction() != EContactEngineStubSetText ) + { + // out-of-memory was trap ignored and saving failed because of that + User::Leave( KErrNoMemory ); + } + EUNIT_ASSERT( ContactEngineStubHelper::GetCalledFunction() == EContactEngineStubSetText ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngOutSession::UT_RemoteAddressLL() + { + delete iLiveSession->iRecipient; + iLiveSession->iRecipient = NULL; + EUNIT_ASSERT_SPECIFIC_LEAVE( iLiveSession->RemoteAddressL(), KErrNotReady ) + + iLiveSession->iRecipient = KTestRecipient2SipUri8().AllocL(); + + HBufC* remoteAddr = iLiveSession->RemoteAddressL(); + CleanupStack::PushL( remoteAddr ); + EUNIT_ASSERT_EQUALS( KTestRecipient2SipUri(), *remoteAddr ) + CleanupStack::PopAndDestroy( remoteAddr ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngOutSession::UT_RemoteDisplayNameL() + { + // Test 1 : Default setting, contact name set + EUNIT_ASSERT_EQUALS ( KTestContactName(), iLiveSession->RemoteDisplayName() ) + + // Test 2 : Contact name set to null descriptor + User::LeaveIfError( RProperty::Set( NMusSessionApi::KCategoryUid, + NMusSessionApi::KContactName, + KNullDesC) ); + delete iLiveSession; + iLiveSession = NULL; + iLiveSession = CMusEngLiveSession::NewL(); + iLiveSession->SetLcSessionObserver( iLcSessionObserver ); + iLiveSession->SetLcUiProvider( iLcUiProvider ); + EUNIT_ASSERT( iLiveSession->RemoteDisplayName().Length() == 0 ); + + // Test 3 : Manual address entered + PropertyHelper::SetErrorCode( KErrNone ); + delete iLiveSession; + iLiveSession = NULL; + iLcSessionObserver->Reset(); + iLcUiProvider->Reset(); + User::LeaveIfError( RProperty::Set( NMusSessionApi::KCategoryUid, + NMusSessionApi::KContactName, + KTestContactName ) ); + iLcUiProvider->iSimulatedReturnValue = ETrue; + iLcUiProvider->iRecipient.Set( KTestRecipientSipUri ); + iLiveSession = CMusEngLiveSession::NewL(); + iLiveSession->SetLcSessionObserver( iLcSessionObserver ); + iLiveSession->SetLcUiProvider( iLcUiProvider ); + PropertyHelper::SetErrorCode( KErrNotFound ); + iLiveSession->EstablishLcSessionL(); + EUNIT_ASSERT_EQUALS( 1, iLiveSession->iTriedInvitations ) + EUNIT_ASSERT_EQUALS( KTestRecipientSipUri(),iLiveSession->RemoteDisplayName() ) + + // Test 4 : Contact name has zero lenth and multiple address entry query. + // Displayname should have user selected address. + // Rare scenario. + PropertyHelper::SetErrorCode( KErrNone ); + iLcSessionObserver->Reset(); + iLcUiProvider->Reset(); + User::LeaveIfError( RProperty::Set( NMusSessionApi::KCategoryUid, + NMusSessionApi::KContactName, + KNullDesC) ); + delete iLiveSession; + iLiveSession = NULL; + iLiveSession = CMusEngLiveSession::NewL(); + iLiveSession->SetLcSessionObserver( iLcSessionObserver ); + iLiveSession->SetLcUiProvider( iLcUiProvider ); + iLcUiProvider->iSimulatedReturnValue = ETrue; + PropertyHelper::SetErrorCode( KErrNone ); + TBuf<200> multipleAddr; + multipleAddr.Append( KTestRecipientTelUri ); + multipleAddr.Append( _L(",") ); + multipleAddr.Append( KTestRecipientSipUri ); + User::LeaveIfError( RProperty::Set( NMusSessionApi::KCategoryUid, + NMusSessionApi::KRemoteSipAddress, + multipleAddr ) ); + iLiveSession->EstablishLcSessionL(); + /* Stub selects the first one automatically */ + EUNIT_ASSERT_EQUALS( KTestRecipientTelUri(),iLiveSession->RemoteDisplayName() ); + + // Test 5 : Contact name has zero lenth and no manual entry queried. + // Recipient has only teluri. So displayname should have tel uri address. + PropertyHelper::SetErrorCode( KErrNone ); + User::LeaveIfError( RProperty::Set( NMusSessionApi::KCategoryUid, + NMusSessionApi::KContactName, + KNullDesC) ); + delete iLiveSession; + iLiveSession = NULL; + iLiveSession = CMusEngLiveSession::NewL(); + iLiveSession->SetLcSessionObserver( iLcSessionObserver ); + iLiveSession->SetLcUiProvider( iLcUiProvider ); + iLcUiProvider->iSimulatedReturnValue = ETrue; + TBuf<200> singleAddr; + singleAddr.Append( KTestRecipientTelUri ); + User::LeaveIfError( RProperty::Set( NMusSessionApi::KCategoryUid, + NMusSessionApi::KRemoteSipAddress, + singleAddr ) ); + PropertyHelper::SetErrorCode( KErrNone ); + iLiveSession->EstablishLcSessionL(); + EUNIT_ASSERT_EQUALS( KTestRecipientTelUri(),iLiveSession->RemoteDisplayName() ); + + // Test 6 : Contact name has zero lenth and recipient has teluri + // and invitation fails to teluri. + // Manual address query entered and now display should have entered + // manual address. + PropertyHelper::SetErrorCode( KErrNone ); + User::LeaveIfError( RProperty::Set( NMusSessionApi::KCategoryUid, + NMusSessionApi::KContactName, + KNullDesC) ); + delete iLiveSession; + iLiveSession = NULL; + iLiveSession = CMusEngLiveSession::NewL(); + iLiveSession->SetLcSessionObserver( iLcSessionObserver ); + iLiveSession->SetLcUiProvider( iLcUiProvider ); + iLcUiProvider->iRecipient.Set( KTestRecipientSipUri ); + iLcUiProvider->iSimulatedReturnValue = ETrue; + singleAddr.Copy( KTestRecipientTelUri ); + User::LeaveIfError( RProperty::Set( NMusSessionApi::KCategoryUid, + NMusSessionApi::KRemoteSipAddress, + singleAddr ) ); + PropertyHelper::SetErrorCode( KErrNotFound ); + iLiveSession->EstablishLcSessionL(); + EUNIT_ASSERT_EQUALS( 1, iLiveSession->iTriedInvitations ) + EUNIT_ASSERT_EQUALS( KTestRecipientSipUri(),iLiveSession->RemoteDisplayName() ); + } + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusEngOutSession, + "UT_CMusEngOutSesssion", + "UNIT" ) + +EUNIT_TEST( + "EstablishLcSessionL - test ", + "CMusEngOutSession", + "EstablishLcSessionL", + "FUNCTIONALITY", + SetupL, UT_EstablishLcSessionL, Teardown) + +EUNIT_TEST( + "TerminateLcSessionL - test ", + "CMusEngOutSession", + "TerminateLcSessionL", + "FUNCTIONALITY", + SetupL, UT_TerminateLcSessionL, Teardown) + +EUNIT_TEST( + "EstablishLcSessionL recipient resolving - test ", + "CMusEngOutSession", + "EstablishLcSessionL", + "FUNCTIONALITY", + SetupL, UT_EstablishLcSession_RecipientResolvingL, Teardown) + +EUNIT_TEST( + "EstablishLcSessionL registration pending - test ", + "CMusEngOutSession", + "EstablishLcSessionL", + "FUNCTIONALITY", + SetupL, UT_EstablishLcSession_RegistrationPendingL, Teardown) + +EUNIT_TEST( + "EstablishSessionL - test ", + "CMusEngOutSession", + "EstablishSessionL", + "FUNCTIONALITY", + SetupL, UT_EstablishSessionLL, Teardown) + +EUNIT_TEST( + "HandleTermination - test ", + "CMusEngOutSession", + "HandleTermination", + "FUNCTIONALITY", + SetupL, UT_HandleTerminationL, Teardown) + +EUNIT_TEST( + "HandleTermination recipient not found - test ", + "CMusEngOutSession", + "HandleTermination recipient not found", + "FUNCTIONALITY", + SetupL, UT_HandleRecipientNotFoundTerminationL, Teardown) + +EUNIT_TEST( + "AdjustVideoCodecL - test ", + "CMusEngOutSession", + "AdjustVideoCodecL", + "FUNCTIONALITY", + SetupL, UT_AdjustVideoCodecLL, Teardown) + +EUNIT_TEST( + "AdjustAudioCodecL - test ", + "CMusEngOutSession", + "AdjustAudioCodecL", + "FUNCTIONALITY", + SetupL, UT_AdjustAudioCodecLL, Teardown) + +EUNIT_TEST( + "CreateMceSessionStructureL - test ", + "CMusEngOutSession", + "CreateMceSessionStructureL", + "FUNCTIONALITY", + SetupL, UT_CreateMceSessionStructureLL, Teardown) + +EUNIT_TEST( + "ConstructLL - test ", + "CMusEngOutSession", + "ConstructLL", + "FUNCTIONALITY", + SetupL, UT_ConstructLL, Teardown) + +EUNIT_TEST( + "ContactSavingL - test ", + "CMusEngOutSession", + "ContactSavingL", + "FUNCTIONALITY", + SetupL, UT_ContactSavingLL, Teardown) + +EUNIT_TEST( + "RemoteAddressLL - test ", + "CMusEngOutSession", + "RemoteAddressLL", + "FUNCTIONALITY", + SetupL, UT_RemoteAddressLL, Teardown) + +EUNIT_TEST( + "RemoteDisplayName - test ", + "CMusEngOutSession", + "RemoteDisplayName", + "FUNCTIONALITY", + SetupL, UT_RemoteDisplayNameL, Teardown) + +EUNIT_END_TEST_TABLE + +// END OF FILE + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/tsrc/ut_engine/src/ut_musengreceivesession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/tsrc/ut_engine/src/ut_musengreceivesession.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,1873 @@ +/* +* 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: +* +*/ + + +// INTERNAL INCLUDES +#include "ut_musengreceivesession.h" +#include "musengstubs.h" +#include "musengtestdefs.h" +#include "musengreceivesession.h" +#include "mussessionproperties.h" +#include "contactenginestub.h" +#include "musengremotevideoplayer.h" + +// SYSTEM INCLUDES +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + + +// Using following value increases treshold buffer to 1 second from +// default 100 ms +const TInt KMusEngJitterBufferTreshold = 50; +const TInt KMusEngTresholdToSecondsFactor = 20; +const TInt KMusEngTwoSecondInMilliSeconds = 2000; +// Use inactivity timer value that is a little bigger than treshold in seconds +const TUint KMusEngInactivityTimer = KMusEngTresholdToSecondsFactor * + KMusEngJitterBufferTreshold + + KMusEngTwoSecondInMilliSeconds; + +_LIT( KTestContactName, "nokia" ); + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusEngReceiveSession* UT_CMusEngReceiveSession::NewL() + { + UT_CMusEngReceiveSession* self = UT_CMusEngReceiveSession::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusEngReceiveSession* UT_CMusEngReceiveSession::NewLC() + { + UT_CMusEngReceiveSession* self = new( ELeave ) UT_CMusEngReceiveSession(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusEngReceiveSession::~UT_CMusEngReceiveSession() + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// Default constructor +// ----------------------------------------------------------------------------- +// +UT_CMusEngReceiveSession::UT_CMusEngReceiveSession() + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// Second phase construct +// ----------------------------------------------------------------------------- +// +void UT_CMusEngReceiveSession::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngReceiveSession::SetupL( ) + { + // set fast mode ON + User::LeaveIfError( RProperty::Set( NMusSessionApi::KCategoryUid, + NMusSessionApi::KFastMode, + 0 ) ); + iLcSessionObserver = new( ELeave )CLcSessionObserverStub; + iLcUiProvider = new( ELeave )CLcUiProviderStub; + iReceiveSession = CMusEngReceiveSession::NewL(); + iReceiveSession->SetLcSessionObserver( iLcSessionObserver ); + iReceiveSession->SetLcUiProvider( iLcUiProvider ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngReceiveSession::Teardown( ) + { + PropertyHelper::Close(); + delete iReceiveSession; + delete iLcUiProvider; + delete iLcSessionObserver; + PropertyHelper::Close(); + // Delete static data from CenRep stub + CRepository::ResetStubGlobal(); + CRepository::iForceFailWithCode = KErrNone; + } + + +// TEST HELPERS + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMceVideoStream* UT_CMusEngReceiveSession::ConstructVideoInStreamLC() + { + CMceVideoStream* videoStream = CMceVideoStream::NewLC(); + + videoStream->SetSourceL( CMceRtpSource::NewLC() ); + CleanupStack::Pop(); + + videoStream->AddSinkL( + CMceDisplaySink::NewLC( *iReceiveSession->iManager ) ); + CleanupStack::Pop(); + + return videoStream; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMceVideoStream* UT_CMusEngReceiveSession::ConstructVideoOutStreamLC() + { + CMceVideoStream* videoStream = CMceVideoStream::NewLC(); + + videoStream->SetSourceL( + CMceCameraSource::NewLC( *iReceiveSession->iManager ) ); + CleanupStack::Pop(); + + videoStream->AddSinkL( CMceRtpSink::NewLC() ); + CleanupStack::Pop(); + + return videoStream; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMceAudioStream* UT_CMusEngReceiveSession::ConstructAudioInStreamLC() + { + CMceAudioStream* audioStream = CMceAudioStream::NewLC(); + + audioStream->SetSourceL( CMceRtpSource::NewLC() ); + CleanupStack::Pop(); + + audioStream->AddSinkL( CMceSpeakerSink::NewLC() ); + CleanupStack::Pop(); + + return audioStream; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMceAudioStream* UT_CMusEngReceiveSession::ConstructAudioOutStreamLC() + { + CMceAudioStream* audioStream = CMceAudioStream::NewLC(); + + audioStream->SetSourceL( + CMceFileSource::NewLC( *iReceiveSession->iManager, KNullDesC() ) ); + CleanupStack::Pop(); + + audioStream->AddSinkL( CMceRtpSink::NewLC() ); + CleanupStack::Pop(); + + return audioStream; + + } + + +// ----------------------------------------------------------------------------- +// Helper to construct incoming sessions. +// ----------------------------------------------------------------------------- +// +CMceInSession* UT_CMusEngReceiveSession::ConstructInSessionLC( + TInt aVideoStreamCount, + TInt aAudioStreamCount, + TBool aConstructSinks ) + { + CMceInSession* inSession = CMceInSession::NewL( + *(iReceiveSession->iManager), + KTestOriginator() ); + CleanupStack::PushL( inSession ); + + for ( TInt i = 0; i < aVideoStreamCount; ++i ) + { + CMceVideoStream* videoStream = CMceVideoStream::NewLC(); + + CMceRtpSource* rtpSource = CMceRtpSource::NewLC(); + videoStream->SetSourceL( rtpSource ); + CleanupStack::Pop( rtpSource ); + + if ( aConstructSinks ) + { + CMceDisplaySink* display = CMceDisplaySink::NewLC( + *(iReceiveSession->iManager) ); + videoStream->AddSinkL( display ); + CleanupStack::Pop( display ); + } + + inSession->AddStreamL( videoStream ); + CleanupStack::Pop( videoStream ); + } + + for ( TInt i = 0; i < aAudioStreamCount; ++i ) + { + CMceAudioStream* audioStream = CMceAudioStream::NewLC(); + + CMceRtpSource* rtpSource = CMceRtpSource::NewLC(); + audioStream->SetSourceL( rtpSource ); + CleanupStack::Pop( rtpSource ); + + if ( aConstructSinks ) + { + CMceSpeakerSink* speaker = CMceSpeakerSink::NewLC(); + audioStream->AddSinkL( speaker ); + CleanupStack::Pop( speaker ); + } + + inSession->AddStreamL( audioStream ); + CleanupStack::Pop( audioStream ); + } + + return inSession; + } + + + + +// TEST CASES + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngReceiveSession::UT_NewLL( ) + { + EUNIT_ASSERT( iReceiveSession ); + EUNIT_ASSERT( !iReceiveSession->iSession ); + EUNIT_ASSERT( iReceiveSession->iMceManagerUid == TUid::Uid( KMusUiUid ) ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngReceiveSession::UT_LcSessionStateL() + { + // No MCE session -> Convert to MLcSession::EReceived + EUNIT_ASSERT_EQUALS( TInt( MLcSession::EReceived ), + TInt( iReceiveSession->LcSessionState() ) ) + + // Some other state -> State returned from the base class + TMceTransactionDataContainer container; + CMceInSession* inSession = ConstructInSessionLC( 1, 0 ); + iReceiveSession->IncomingSession( inSession, &container ); + CleanupStack::Pop( inSession ); + iReceiveSession->iSession->iState = CMceSession::EProceeding; + iReceiveSession->EstablishLcSessionL(); + EUNIT_ASSERT_EQUALS( TInt( MLcSession::EOpening ), + TInt( iReceiveSession->LcSessionState() ) ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngReceiveSession::UT_EstablishLcSessionL() + { + // No MCE session + EUNIT_ASSERT_SPECIFIC_LEAVE( + iReceiveSession->EstablishLcSessionL(), KErrNotReady ) + + // Construct a new session and accept it + TMceTransactionDataContainer container; + CMceInSession* inSession = ConstructInSessionLC( 1, 0 ); + iReceiveSession->IncomingSession( inSession, &container ); + CleanupStack::Pop( inSession ); + iReceiveSession->iSession->iState = CMceSession::EProceeding; + iReceiveSession->EstablishLcSessionL(); + EUNIT_ASSERT( iReceiveSession->iSession ) + EUNIT_ASSERT_EQUALS( inSession, iReceiveSession->iSession ); + EUNIT_ASSERT_EQUALS( TInt( CMceSession::EAnswering ), + TInt( iReceiveSession->iSession->iState ) ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngReceiveSession::UT_TerminateLcSessionL() + { + // No MCE session + EUNIT_ASSERT_SPECIFIC_LEAVE( + iReceiveSession->TerminateLcSessionL(), KErrNotReady ) + + // Reject session, session state incoming, no operator variant + TMceTransactionDataContainer container; + CMceInSession* inSession = ConstructInSessionLC( 1, 0 ); + iReceiveSession->IncomingSession( inSession, &container ); + CleanupStack::Pop( inSession ); + iReceiveSession->iSession->iState = CMceSession::EIncoming; + iReceiveSession->iOperatorVariant = EFalse; + iReceiveSession->TerminateLcSessionL(); + EUNIT_ASSERT_EQUALS( TInt( CMceSession::ETerminated ), + TInt( iReceiveSession->iSession->iState ) ) + + // Reject session, session state proceeding, no operator variant + inSession = ConstructInSessionLC( 1, 0 ); + iReceiveSession->IncomingSession( inSession, &container ); + CleanupStack::Pop( inSession ); + iReceiveSession->iSession->iState = CMceSession::EProceeding; + iReceiveSession->iOperatorVariant = EFalse; + iReceiveSession->TerminateLcSessionL(); + EUNIT_ASSERT_EQUALS( TInt( CMceSession::ETerminated ), + TInt( iReceiveSession->iSession->iState ) ) + + // Reject session, operator variant + inSession = ConstructInSessionLC( 1, 0 ); + iReceiveSession->IncomingSession( inSession, &container ); + CleanupStack::Pop( inSession ); + iReceiveSession->iSession->iState = CMceSession::EProceeding; + iReceiveSession->iOperatorVariant = ETrue; + iReceiveSession->TerminateLcSessionL(); + EUNIT_ASSERT_EQUALS( TInt( CMceSession::ETerminated ), + TInt( iReceiveSession->iSession->iState ) ) + + // Terminate an established session + inSession = ConstructInSessionLC( 1, 0 ); + iReceiveSession->IncomingSession( inSession, &container ); + CleanupStack::Pop( inSession ); + iReceiveSession->iSession->iState = CMceSession::EEstablished; + iReceiveSession->iOperatorVariant = EFalse; + iReceiveSession->TerminateLcSessionL(); + EUNIT_ASSERT_EQUALS( TInt( CMceSession::ETerminating ), + TInt( iReceiveSession->iSession->iState ) ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngReceiveSession::UT_RemoteVideoPlayerL() + { + EUNIT_ASSERT( iReceiveSession->RemoteVideoPlayer() == + iReceiveSession->iRemoteVideoPlayer ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngReceiveSession::UT_RemoteDisplayName() + { + + // Creating Valid Session + CMceInSession* inSession = ConstructInSessionLC( 1, 0 ); + iReceiveSession->iSession = inSession; // Transfers ownership + CleanupStack::Pop( inSession ); + iReceiveSession->CompleteSessionStructureL(); + EUNIT_ASSERT( inSession->Streams().Count() == 1 ); + + + // Name is published using publish/subscribe key by Availblity + User::LeaveIfError( RProperty::Set( NMusSessionApi::KCategoryUid, + NMusSessionApi::KContactName, + KTestContactName ) ); + + EUNIT_ASSERT_EQUALS ( KTestContactName(), iReceiveSession->RemoteDisplayName() ) + + + User::LeaveIfError( RProperty::Set( NMusSessionApi::KCategoryUid, + NMusSessionApi::KContactName, + KNullDesC) ); + + // Ensure its not null and its not equal + EUNIT_ASSERT( KTestContactName() != iReceiveSession->RemoteDisplayName() ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngReceiveSession::UT_HandleSessionStateChangedL() + { + // Unknown session, let the base class handle + CMceInSession* inSession = ConstructInSessionLC( 1, 1 ); + + iReceiveSession->HandleSessionStateChanged( *inSession, 0, KNullDesC8() ); + + // Simulate incoming session + TMceTransactionDataContainer container; + + iReceiveSession->IncomingSession( inSession, &container ); + CleanupStack::Pop( inSession ); + + // Session is in state EReserving, let the base class handle + iReceiveSession->HandleSessionStateChanged( *inSession, 0, KNullDesC8() ); + + // The normal cases: + + // 1 ) First transition to state EProceeding, user and remote end should + // be notified + inSession->iState = CMceSession::EProceeding; + iReceiveSession->HandleSessionStateChanged( *inSession, 0, KNullDesC8() ); + EUNIT_ASSERT_EQUALS( TInt( iLcSessionObserver->iCalledFunction ), + TInt( CLcSessionObserverStub::ESessionStateChanged ) ) + EUNIT_ASSERT( iReceiveSession->iRingLCalled ) + + // Ensure Originator is taken from the incoming session + EUNIT_ASSERT_EQUALS ( KTestOriginator(), *iReceiveSession->iOriginator ) + + iLcSessionObserver->Reset(); + + // 2 ) Now simulate second transition to EProceeding state which can happen + // if we force 100rel to be used. User and remote end should not be + // notified anymore but change should be ignored. + inSession->iState = CMceSession::EProceeding; + iReceiveSession->HandleSessionStateChanged( *inSession, 0, KNullDesC8() ); + EUNIT_ASSERT_EQUALS( TInt( CLcSessionObserverStub::EUnknown ), + TInt( iLcSessionObserver->iCalledFunction ) ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngReceiveSession::UT_AdjustVideoCodecLL() + { + CMceVideoCodec* codecH263 = CMceH263Codec::NewLC( KMceSDPNameH263() ); + CMceVideoCodec* codecH2632000 = CMceH263Codec::NewLC( KMceSDPNameH2632000() ); + CMceVideoCodec* codecAvc = CMceAvcCodec::NewLC( KMceSDPNameH264() ); + CMceVideoCodec* codecUnknown = CMceH263Codec::NewLC( KNullDesC8() ); + + iReceiveSession->AdjustVideoCodecL( *codecH263, KMceRTPSource ); + iReceiveSession->AdjustVideoCodecL( *codecH2632000, KMceRTPSource ); + iReceiveSession->AdjustVideoCodecL( *codecAvc, KMceRTPSource ); + iReceiveSession->AdjustVideoCodecL( *codecUnknown, KMceRTPSource ); + + EUNIT_ASSERT_EQUALS( codecH263->KeepAliveTimer(), 5 ) + EUNIT_ASSERT_EQUALS( codecH263->KeepAlivePayloadType(), 96 ) + EUNIT_ASSERT_EQUALS( codecH263->KeepAliveData(), KNullDesC8() ) + + EUNIT_ASSERT_EQUALS( codecH2632000->KeepAliveTimer(), 5 ) + EUNIT_ASSERT_EQUALS( codecH2632000->KeepAlivePayloadType(), 96 ) + EUNIT_ASSERT_EQUALS( codecH2632000->KeepAliveData(), KNullDesC8() ) + + EUNIT_ASSERT_EQUALS( codecAvc->KeepAliveTimer(), 5 ) + EUNIT_ASSERT_EQUALS( codecAvc->KeepAlivePayloadType(), 98 ) + EUNIT_ASSERT_EQUALS( codecAvc->KeepAliveData(), KNullDesC8() ) + + EUNIT_ASSERT_EQUALS( codecUnknown->KeepAliveTimer(), 5 ) + EUNIT_ASSERT_EQUALS( codecUnknown->KeepAlivePayloadType(), 0 ) + EUNIT_ASSERT_EQUALS( codecUnknown->KeepAliveData(), KNullDesC8() ) + + CleanupStack::PopAndDestroy( codecUnknown ); + CleanupStack::PopAndDestroy( codecAvc ); + CleanupStack::PopAndDestroy( codecH2632000 ); + CleanupStack::PopAndDestroy( codecH263 ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngReceiveSession::UT_AdjustAudioCodecLL() + { + CMceAudioCodec* codec = + iReceiveSession->iManager->SupportedAudioCodecs()[0]->CloneL(); + CleanupStack::PushL( codec ); + iReceiveSession->AdjustAudioCodecL( *codec ); + + // Test keepalive timer + + TUint8 keepAliveTimer = codec->KeepAliveTimer(); + EUNIT_ASSERT( codec->KeepAliveTimer() == 5 ) + EUNIT_ASSERT( codec->KeepAlivePayloadType() == 97 ) + EUNIT_ASSERT( codec->KeepAliveData() == KNullDesC8() ) + + // Test that base class has been called + + EUNIT_ASSERT( codec->iMMFPriority == KAudioPrioritySwisPlayback ) + EUNIT_ASSERT( codec->iMMFPriorityPreference == KAudioPrefSwisPlayback ) + + CleanupStack::PopAndDestroy( codec ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngReceiveSession::UT_DoCodecSelectionLL() + { + // Check that Non-Interleaved AVC is preferred over single NAL + CMceVideoStream* videoStream = CMceVideoStream::NewLC(); + + CMceVideoCodec* codecAvcSingleNal = CMceAvcCodec::NewLC( KMceSDPNameH264() ); + codecAvcSingleNal->iCodecMode = KMceAvcModeSingleNal; + videoStream->AddCodecL( codecAvcSingleNal ); + CleanupStack::Pop( codecAvcSingleNal ); + + CMceVideoCodec* codecAvcNonInterleaved = CMceAvcCodec::NewLC( KMceSDPNameH264() ); + codecAvcNonInterleaved->iCodecMode = KMceAvcModeNonInterleaved; + videoStream->AddCodecL( codecAvcNonInterleaved ); + CleanupStack::Pop( codecAvcNonInterleaved ); + + iReceiveSession->DoCodecSelectionL( *videoStream ); + + EUNIT_ASSERT_EQUALS( videoStream->Codecs().Count(), 1 ) + EUNIT_ASSERT_EQUALS( videoStream->Codecs()[0]->SdpName(), KMceSDPNameH264() ) + EUNIT_ASSERT_EQUALS( videoStream->Codecs()[0]->CodecMode(), + KMceAvcModeNonInterleaved ) + + CleanupStack::PopAndDestroy( videoStream ); + + // Check that Single NAL AVC is preferred over H263 + videoStream = CMceVideoStream::NewLC(); + + CMceVideoCodec* codecH263 = CMceH263Codec::NewLC( KMceSDPNameH263() ); + videoStream->AddCodecL( codecH263 ); + CleanupStack::Pop( codecH263 ); + + codecAvcSingleNal = CMceAvcCodec::NewLC( KMceSDPNameH264() ); + codecAvcSingleNal->iCodecMode = KMceAvcModeSingleNal; + videoStream->AddCodecL( codecAvcSingleNal ); + CleanupStack::Pop( codecAvcSingleNal ); + + iReceiveSession->DoCodecSelectionL( *videoStream ); + + EUNIT_ASSERT_EQUALS( videoStream->Codecs().Count(), 1 ) + EUNIT_ASSERT_EQUALS( videoStream->Codecs()[0]->SdpName(), KMceSDPNameH264() ) + EUNIT_ASSERT_EQUALS( videoStream->Codecs()[0]->CodecMode(), + KMceAvcModeSingleNal ) + + CleanupStack::PopAndDestroy( videoStream ); + + // Check that H263 codecs without AVC are handled correctly (in base class) + videoStream = CMceVideoStream::NewLC(); + + codecH263 = CMceH263Codec::NewLC( KMceSDPNameH263() ); + videoStream->AddCodecL( codecH263 ); + CleanupStack::Pop( codecH263 ); + + CMceVideoCodec* codecH2632000 = CMceH263Codec::NewLC( KMceSDPNameH2632000() ); + videoStream->AddCodecL( codecH2632000 ); + CleanupStack::Pop( codecH2632000 ); + + iReceiveSession->DoCodecSelectionL( *videoStream ); + + EUNIT_ASSERT_EQUALS( videoStream->Codecs().Count(), 1 ) + + CleanupStack::PopAndDestroy( videoStream ); + + // Check that AVC non-interleaved with best bitrate is preferred + videoStream = CMceVideoStream::NewLC(); + + codecAvcNonInterleaved = CMceAvcCodec::NewLC( KMceSDPNameH264() ); + codecAvcNonInterleaved->iCodecMode = KMceAvcModeNonInterleaved; + codecAvcNonInterleaved->SetMaxBitrateL( 80000 ); + videoStream->AddCodecL( codecAvcNonInterleaved ); + CleanupStack::Pop( codecAvcNonInterleaved ); + + CMceVideoCodec* codecAvcNonInterleaved128 = CMceAvcCodec::NewLC( KMceSDPNameH264() ); + codecAvcNonInterleaved128->iCodecMode = KMceAvcModeNonInterleaved; + codecAvcNonInterleaved128->SetMaxBitrateL( 128000 ); + videoStream->AddCodecL( codecAvcNonInterleaved128 ); + CleanupStack::Pop( codecAvcNonInterleaved128 ); + + iReceiveSession->DoCodecSelectionL( *videoStream ); + + EUNIT_ASSERT_EQUALS( videoStream->Codecs().Count(), 1 ) + EUNIT_ASSERT( videoStream->Codecs()[0] == codecAvcNonInterleaved128 ) + + CleanupStack::PopAndDestroy( videoStream ); + + // Check that in case of several AVC single NALs, the best bitrate is preferred + videoStream = CMceVideoStream::NewLC(); + + codecAvcSingleNal = CMceAvcCodec::NewLC( KMceSDPNameH264() ); + codecAvcSingleNal->iCodecMode = KMceAvcModeSingleNal; + codecAvcSingleNal->SetMaxBitrateL( 80000 ); + videoStream->AddCodecL( codecAvcSingleNal ); + CleanupStack::Pop( codecAvcSingleNal ); + + CMceVideoCodec* codecAvcSingleNal128 = CMceAvcCodec::NewLC( KMceSDPNameH264() ); + codecAvcSingleNal128->iCodecMode = KMceAvcModeSingleNal; + codecAvcSingleNal128->SetMaxBitrateL( 128000 ); + videoStream->AddCodecL( codecAvcSingleNal128 ); + CleanupStack::Pop( codecAvcSingleNal128 ); + + iReceiveSession->DoCodecSelectionL( *videoStream ); + + EUNIT_ASSERT_EQUALS( videoStream->Codecs().Count(), 1 ) + EUNIT_ASSERT( videoStream->Codecs()[0] == codecAvcSingleNal128 ) + + CleanupStack::PopAndDestroy( videoStream ); + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngReceiveSession::UT_IncomingSessionL() + { + _LIT8( KMusEngSwisTestIdentifier, "Require: precondition" ); + _LIT8( KMusEngTestHeader, "Some header" ); + + TMceTransactionDataContainer container; + + // Simulate SWIS 2.2 invite. There are no streams, so completion fails and + // session gets rejected. Still prenotification has been given. + CMceInSession* inSession = ConstructInSessionLC( 0, 0 ); + CDesC8Array* headers = new ( ELeave ) CDesC8ArrayFlat( 2 ); + CleanupStack::PushL( headers ); + headers->AppendL( KMusEngTestHeader() ); + headers->AppendL( KMusEngSwisTestIdentifier() ); + container.SetHeaders( headers ); + CleanupStack::Pop( headers ); + iReceiveSession->IncomingSession( inSession, &container ); + CleanupStack::Pop( inSession ); + container.Clear(); + + EUNIT_ASSERT( iReceiveSession->iSession ); + EUNIT_ASSERT( iReceiveSession->iSession->iState == + CMceSession::ETerminated ); + + EUNIT_ASSERT( iReceiveSession->iSession->i100RelUsage == + KMce100RelRequired ) + EUNIT_ASSERT( !iReceiveSession->iRingLCalled ) + + // Try again with valid session, normal case + inSession = ConstructInSessionLC( 1, 0 ); + iReceiveSession->IncomingSession( inSession, &container ); + CleanupStack::Pop( inSession ); + + EUNIT_ASSERT( iReceiveSession->iSession ); + // Next state depends on success of completion of session structure. + // When using alloc failure state is ETerminated, in succesfull case it is + // EReserving. However it is set to "normal" state EReserving after + // assertion + EUNIT_ASSERT( iReceiveSession->iSession->iState == + CMceSession::EReserving || + iReceiveSession->iSession->iState == + CMceSession::ETerminated ); + iReceiveSession->iSession->iState = CMceSession::EReserving; + + // Try again without container, new session gets terminated and deleted + inSession = ConstructInSessionLC( 1, 0 ); + iReceiveSession->IncomingSession( inSession, NULL ); + CleanupStack::Pop( inSession ); + + EUNIT_ASSERT( iReceiveSession->iSession ); + EUNIT_ASSERT( iReceiveSession->iSession != inSession ); + EUNIT_ASSERT( iReceiveSession->iSession->iState == + CMceSession::EReserving ); + + // Try again when there is session pending, new session gets terminated + // and deleted + inSession = ConstructInSessionLC( 1, 0 ); + iReceiveSession->IncomingSession( inSession, &container ); + CleanupStack::Pop( inSession ); + + EUNIT_ASSERT( iReceiveSession->iSession ); + EUNIT_ASSERT( iReceiveSession->iSession != inSession ); + EUNIT_ASSERT( iReceiveSession->iSession->iState == + CMceSession::EReserving ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngReceiveSession::UT_IncomingUpdateL() + { + TMceTransactionDataContainer container; + + // We do not have session and thus cannot have an update, new session gets + // rejected and deleted. + CMceInSession* oldSession = ConstructInSessionLC( 0, 0 ); + CMceInSession* newSession = ConstructInSessionLC( 0, 0 ); + iReceiveSession->IncomingUpdate( *oldSession, newSession, NULL ); + CleanupStack::Pop( newSession ); + CleanupStack::PopAndDestroy( oldSession ); + + // Start establishing a session + CMceInSession* inSession = ConstructInSessionLC( 1, 0 ); + iReceiveSession->IncomingSession( inSession, &container ); + CleanupStack::Pop( inSession ); + + iReceiveSession->iSession->iState = CMceSession::EProceeding; + iReceiveSession->EstablishLcSessionL(); + + // Now we have an insession, try to update session that is not ours, + // new one gets rejected and deleted. + oldSession = ConstructInSessionLC( 0, 0 ); + newSession = ConstructInSessionLC( 0, 0 ); + iReceiveSession->IncomingUpdate( *oldSession, newSession, NULL ); + CleanupStack::Pop( newSession ); + CleanupStack::PopAndDestroy( oldSession ); + + // Try to update our insession before it is established. New session gets + // rejected and deleted. + newSession = ConstructInSessionLC( 0, 0 ); + iReceiveSession->IncomingUpdate( *iReceiveSession->iSession, + newSession, + NULL ); + CleanupStack::Pop( newSession ); + + // Finish establishing insession + iReceiveSession->iSession->iState = CMceSession::EEstablished; + + // Try to update the established session with invalid session, it gets + // rejected and deleted + newSession = ConstructInSessionLC( 0, 0 ); + iReceiveSession->IncomingUpdate( *iReceiveSession->iSession, + newSession, + NULL ); + CleanupStack::Pop( newSession ); + + // Succeed in update + newSession = ConstructInSessionLC( 1, 0 ); + iReceiveSession->IncomingUpdate( *iReceiveSession->iSession, + newSession, + NULL ); + CleanupStack::Pop( newSession ); + EUNIT_ASSERT( iReceiveSession->iSession ); + EUNIT_ASSERT( iReceiveSession->iSession == newSession ); + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngReceiveSession::UT_StreamStateChangedL() + { + TMceTransactionDataContainer container; + + CMceInSession* inSession = ConstructInSessionLC( 1, 1 ); + + CMceMediaStream* videoStream = inSession->Streams()[0]; + CMceMediaStream* audioStream = inSession->Streams()[1]; + + // Try without a session, nothing happens + iReceiveSession->StreamStateChanged( *audioStream ); + + // Establish session + iReceiveSession->IncomingSession( inSession, &container ); + CleanupStack::Pop( inSession ); + iLcSessionObserver->Reset(); + + // Try with audiostream, nothing happens + audioStream->iState = CMceMediaStream::EBuffering; + iReceiveSession->StreamStateChanged( *audioStream ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ) + + // Try with videostream, but without a source, nothing happens + CMceRtpSource* rtpSource = + static_cast( videoStream->Source() ); //hack + videoStream->iSource = NULL; + iReceiveSession->StreamStateChanged( *videoStream ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ) + + // Try with videostream and a camera source, nothing happens + videoStream->iSource = + CMceCameraSource::NewL( *iReceiveSession->iManager ); //hack + iReceiveSession->StreamStateChanged( *videoStream ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ) + + // Remove hacks + delete videoStream->iSource; + videoStream->iSource = rtpSource; + + // Buffering, normal case + videoStream->iState = CMceMediaStream::EBuffering; + iReceiveSession->StreamStateChanged( *videoStream ); + EUNIT_ASSERT_EQUALS( TInt( iLcSessionObserver->iCalledFunction ), + TInt( CLcSessionObserverStub::EPlayerStateChanged ) ) + EUNIT_ASSERT( iReceiveSession->iBuffered ) + iLcSessionObserver->Reset(); + + // Streaming, normal case + videoStream->iState = CMceMediaStream::EStreaming; + iReceiveSession->iReceiving = EFalse; + iReceiveSession->iBuffered = ETrue; + iReceiveSession->StreamStateChanged( *videoStream ); + EUNIT_ASSERT_EQUALS( TInt( iLcSessionObserver->iCalledFunction ), + TInt( CLcSessionObserverStub::EPlayerStateChanged ) ) + EUNIT_ASSERT_EQUALS( KMusEngInactivityTimer, rtpSource->iInactivityTimer ) + iLcSessionObserver->Reset(); + EUNIT_ASSERT_EQUALS( TInt( iLcUiProvider->iCalledFunction ), + TInt( CLcUiProviderStub::EHandleForegroundStatus ) ) + iLcUiProvider->Reset(); + // Normally background info will be cleared once ui comes to foreground and + // notifies engine about it + iReceiveSession->iBackground = EFalse; + + // Streaming, event is received even when already receiving. Streaming + // event is anyway notified. + videoStream->iState = CMceMediaStream::EStreaming; + iReceiveSession->iReceiving = ETrue; + iReceiveSession->iBuffered = ETrue; + iReceiveSession->StreamStateChanged( *videoStream ); + EUNIT_ASSERT_EQUALS( TInt( iLcSessionObserver->iCalledFunction ), + TInt( CLcSessionObserverStub::EPlayerStateChanged ) ) + EUNIT_ASSERT_EQUALS( KMusEngInactivityTimer, rtpSource->iInactivityTimer ) + iLcSessionObserver->Reset(); + EUNIT_ASSERT_EQUALS( TInt( iLcUiProvider->iCalledFunction ), + TInt( CLcUiProviderStub::EUnknown ) ) + + // Streaming and receiving started already. Streaming is not notified because + // of buffering event hasn't been received + videoStream->iState = CMceMediaStream::EStreaming; + iReceiveSession->iReceiving = ETrue; + iReceiveSession->iBuffered = EFalse; + iReceiveSession->StreamStateChanged( *videoStream ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ) + iLcSessionObserver->Reset(); + + // Streaming, receiving not started and buffering not happened ( means no packet + // received yet. Ignore this event too. + videoStream->iState = CMceMediaStream::EStreaming; + iReceiveSession->iReceiving = EFalse; + iReceiveSession->iBuffered = EFalse; + iReceiveSession->StreamStateChanged( *videoStream ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ) + iLcSessionObserver->Reset(); + + // Streaming, receiving not started and buffering happened. + // Enabling RTP timer leaves. Should be a failure case. + videoStream->iState = CMceMediaStream::EStreaming; + iReceiveSession->iReceiving = EFalse; + iReceiveSession->iBuffered = ETrue; + iReceiveSession->StreamStateChanged( *videoStream ); + EUNIT_ASSERT_NOT_EQUALS( TInt( iLcSessionObserver->iCalledFunction ), + TInt( CLcSessionObserverStub::EPlayerFailed ) ) + iLcSessionObserver->Reset(); + + // Try default behaviors + videoStream->iState = CMceMediaStream::EIdle; + iReceiveSession->StreamStateChanged( *videoStream ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngReceiveSession::UT_CompleteSessionStructureL_WithoutSessionL() + { + TRAPD( error, iReceiveSession->CompleteSessionStructureL() ); + MUS_TEST_FORWARD_ALLOC_FAILURE( error ); + EUNIT_ASSERT( error == KErrNotReady ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngReceiveSession::UT_CompleteSessionStructureL_WithoutStreamsL() + { + CMceInSession* inSession = ConstructInSessionLC( 0, 0 ); + iReceiveSession->iSession = inSession; // Transfers ownership + CleanupStack::Pop( inSession ); + + TRAPD( error, iReceiveSession->CompleteSessionStructureL() ); + MUS_TEST_FORWARD_ALLOC_FAILURE( error ); + EUNIT_ASSERT( error == KErrCorrupt ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngReceiveSession::UT_CompleteSessionStructureL_WithOutgoingStreamL() + { + // Stream will be removed. + CMceInSession* inSession = ConstructInSessionLC( 0, 0 ); + + inSession->AddStreamL( ConstructVideoOutStreamLC() ); + CleanupStack::Pop(); + + iReceiveSession->iSession = inSession; // Transfers ownership + CleanupStack::Pop( inSession ); + + TRAPD( error, iReceiveSession->CompleteSessionStructureL() ) + MUS_TEST_FORWARD_ALLOC_FAILURE( error ); + EUNIT_ASSERT( error == KErrCorrupt ); + EUNIT_ASSERT( inSession->Streams().Count() == 0 ); + EUNIT_ASSERT( inSession->Bundles().Count() == 0 ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngReceiveSession::UT_CompleteSessionStructureL_WithVideoInL() + { + CMceInSession* inSession = ConstructInSessionLC( 1, 0 ); + + iReceiveSession->iSession = inSession; // Transfers ownership + CleanupStack::Pop( inSession ); + + iReceiveSession->CompleteSessionStructureL(); + + EUNIT_ASSERT( inSession->Streams().Count() == 1 ); + EUNIT_ASSERT( inSession->Streams()[0]->IsEnabled() ) + EUNIT_ASSERT( inSession->Streams()[0]->Type() == KMceVideo ) + EUNIT_ASSERT( inSession->Streams()[0]->Sinks().Count() == 1 ) + EUNIT_ASSERT( inSession->Streams()[0]->Sinks()[0]->Type() == + KMceDisplaySink ) + + // No audio, bundle is not constructed + EUNIT_ASSERT( inSession->Bundles().Count() == 0 ) + } + + +// ----------------------------------------------------------------------------- +// Video out is bound stream, it gets disabled +// ----------------------------------------------------------------------------- +// +void UT_CMusEngReceiveSession::UT_CompleteSessionStructureL_WithVideoOutBoundToVideoInL() + { + CMceInSession* inSession = ConstructInSessionLC( 1, 0 ); + + CMceVideoStream* videoOut = ConstructVideoOutStreamLC(); + inSession->Streams()[0]->BindL( videoOut ); + CleanupStack::Pop( videoOut ); + + iReceiveSession->iSession = inSession; // Transfers ownership + CleanupStack::Pop( inSession ); + + iReceiveSession->CompleteSessionStructureL(); + + EUNIT_ASSERT( inSession->Streams().Count() == 1 ); + + CMceMediaStream* videoIn = inSession->Streams()[0]; + + EUNIT_ASSERT( videoIn->IsEnabled() ) + EUNIT_ASSERT( videoIn->Type() == KMceVideo ) + EUNIT_ASSERT( videoIn->Sinks().Count() == 1 ) + EUNIT_ASSERT( videoIn->Sinks()[0]->Type() == KMceDisplaySink ) + + EUNIT_ASSERT( videoIn->BoundStream() ) + EUNIT_ASSERT( !videoIn->BoundStreamL().IsEnabled() ) + + // No audio, bundle is not constructed + EUNIT_ASSERT( inSession->Bundles().Count() == 0 ) + } + + +// ----------------------------------------------------------------------------- +// Video in is bound stream, another one gets disabled +// ----------------------------------------------------------------------------- +// +void UT_CMusEngReceiveSession::UT_CompleteSessionStructureL_WithVideoInBoundToVideoOutL() + { + CMceInSession* inSession = ConstructInSessionLC( 0, 0 ); + + CMceVideoStream* videoOut = ConstructVideoOutStreamLC(); + + CMceVideoStream* videoIn = ConstructVideoInStreamLC(); + videoOut->BindL( videoIn ); + CleanupStack::Pop( videoIn ); + + inSession->AddStreamL( videoOut ); + CleanupStack::Pop( videoOut ); + + iReceiveSession->iSession = inSession; // Transfers ownership + CleanupStack::Pop( inSession ); + + iReceiveSession->CompleteSessionStructureL(); + + EUNIT_ASSERT( inSession->Streams().Count() == 1 ); + EUNIT_ASSERT( !videoOut->IsEnabled() ) + EUNIT_ASSERT( videoOut->Type() == KMceVideo ) + EUNIT_ASSERT( videoOut->Sinks().Count() == 1 ) + EUNIT_ASSERT( videoOut->Sinks()[0]->Type() == KMceRTPSink ) + EUNIT_ASSERT( !videoOut->Sinks()[0]->IsEnabled() ) + + EUNIT_ASSERT( videoOut->BoundStream() ) + EUNIT_ASSERT( videoOut->BoundStreamL().IsEnabled() ) + EUNIT_ASSERT( videoOut->BoundStreamL().Type() == KMceVideo ) + EUNIT_ASSERT( videoOut->BoundStreamL().Sinks().Count() == 1 ) + EUNIT_ASSERT( videoOut->BoundStreamL().Sinks()[0]->Type() == + KMceDisplaySink ) + EUNIT_ASSERT( videoOut->BoundStreamL().Sinks()[0]->IsEnabled() ) + + // No audio, bundle is not constructed + EUNIT_ASSERT( inSession->Bundles().Count() == 0 ) + } + + +// ----------------------------------------------------------------------------- +// Construct 3 video instreams: +// 0. Without bound stream +// 1. Bounds video out stream +// 2. Bounded by video out stream +// ----------------------------------------------------------------------------- +// +void UT_CMusEngReceiveSession::UT_CompleteSessionStructureL_WithMultipleVideoInsL() + { + // construct session and stream 0 + CMceInSession* inSession = ConstructInSessionLC( 2, 0 ); + + // finish constructing stream 1 + CMceVideoStream* videoOut = ConstructVideoOutStreamLC(); + inSession->Streams()[1]->BindL( videoOut ); + CleanupStack::Pop( videoOut ); + + // finish constructing stream 2 + videoOut = ConstructVideoOutStreamLC(); + + CMceVideoStream* videoIn = ConstructVideoInStreamLC(); + videoOut->BindL( videoIn ); + CleanupStack::Pop( videoIn ); + + inSession->AddStreamL( videoOut ); + CleanupStack::Pop( videoOut ); + + // Transfers ownership + iReceiveSession->iSession = inSession; + CleanupStack::Pop( inSession ); + + // complete + iReceiveSession->CompleteSessionStructureL(); + + // First should be used, 4 other streams should be deleted + + EUNIT_ASSERT( inSession->Streams().Count() == 1 ); + + // First stream + EUNIT_ASSERT( inSession->Streams()[0]->IsEnabled() ) + EUNIT_ASSERT( inSession->Streams()[0]->Type() == KMceVideo ) + EUNIT_ASSERT( inSession->Streams()[0]->Sinks().Count() == 1 ) + EUNIT_ASSERT( inSession->Streams()[0]->Sinks()[0]->Type() == KMceDisplaySink ) + EUNIT_ASSERT( inSession->Streams()[0]->Sinks()[0]->IsEnabled() ) + + // No audio, bundle is not constructed + EUNIT_ASSERT( inSession->Bundles().Count() == 0 ) + } + + +// ----------------------------------------------------------------------------- +// Streams in this test case +// 0. Video in +// 1. Audio in +// 2. Audio out bound to audio in +// 3. Audio in bound to audio out +// ----------------------------------------------------------------------------- +// +void UT_CMusEngReceiveSession:: + UT_CompleteSessionStructureL_WithVideoAndMultipleAudioInsL() + { + // Construct session and streams 0 and 1 + CMceInSession* inSession = inSession = ConstructInSessionLC( 1, 2 ); + + // Construct stream 2 + CMceAudioStream* audioOut = ConstructAudioOutStreamLC(); + inSession->Streams()[2]->BindL( audioOut ); + CleanupStack::Pop( audioOut ); + + // Construct stream 3 + + audioOut = ConstructAudioOutStreamLC(); + + CMceAudioStream* audioIn = ConstructAudioInStreamLC(); + audioOut->BindL( audioIn ); + CleanupStack::Pop( audioIn ); + + inSession->AddStreamL( audioOut ); + CleanupStack::Pop( audioOut ); + + // Transfers ownership + iReceiveSession->iSession = inSession; + CleanupStack::Pop( inSession ); + + // Complete + iReceiveSession->CompleteSessionStructureL(); + EUNIT_ASSERT( inSession->Streams().Count() == 4 ); + + // Stream 0 + EUNIT_ASSERT( inSession->Streams()[0]->Type() == KMceVideo ) + EUNIT_ASSERT( inSession->Streams()[0]->IsEnabled() ) + EUNIT_ASSERT( inSession->Streams()[0]->Sinks().Count() == 1 ) + EUNIT_ASSERT( inSession->Streams()[0]->Sinks()[0]->Type() == + KMceDisplaySink ) + + // Stream 1 + EUNIT_ASSERT( inSession->Streams()[1]->Type() == KMceAudio ) + EUNIT_ASSERT( inSession->Streams()[1]->IsEnabled() ) + EUNIT_ASSERT( inSession->Streams()[1]->Sinks().Count() == 1 ) + EUNIT_ASSERT( inSession->Streams()[1]->Sinks()[0]->Type() == + KMceSpeakerSink ); + CMceSpeakerSink* speaker = + static_cast(inSession->Streams()[1]->Sinks()[0]); + EUNIT_ASSERT( speaker->VolumeL() == iReceiveSession->LcVolumeL() ) + + // Stream 2 and bound stream + EUNIT_ASSERT( inSession->Streams()[2]->Type() == KMceAudio ) + EUNIT_ASSERT( inSession->Streams()[2]->IsEnabled() ) + EUNIT_ASSERT( inSession->Streams()[2]->Sinks().Count() == 1 ) + EUNIT_ASSERT( inSession->Streams()[2]->Sinks()[0]->Type() == + KMceSpeakerSink ); + speaker = static_cast(inSession->Streams()[2]->Sinks()[0]); + EUNIT_ASSERT( speaker->VolumeL() == iReceiveSession->LcVolumeL() ) + + EUNIT_ASSERT( inSession->Streams()[2]->BoundStream() ) + EUNIT_ASSERT( !inSession->Streams()[2]->BoundStreamL().IsEnabled() ) + EUNIT_ASSERT( inSession->Streams()[2]->BoundStreamL().Type() == KMceAudio ) + + EUNIT_ASSERT( inSession->Streams()[2]->BoundStreamL().Sinks().Count() == 1 ) + EUNIT_ASSERT( inSession->Streams()[2]->BoundStreamL().Sinks()[0]->Type() == + KMceRTPSink ); + + // Stream 3 and bound stream + EUNIT_ASSERT( inSession->Streams()[3]->Type() == KMceAudio ) + EUNIT_ASSERT( !inSession->Streams()[3]->IsEnabled() ) + EUNIT_ASSERT( inSession->Streams()[3]->Sinks().Count() == 1 ) + EUNIT_ASSERT( inSession->Streams()[3]->Sinks()[0]->Type() == KMceRTPSink ) + EUNIT_ASSERT( !inSession->Streams()[3]->Sinks()[0]->IsEnabled() ) + + EUNIT_ASSERT( inSession->Streams()[3]->BoundStream() ) + EUNIT_ASSERT( inSession->Streams()[3]->BoundStreamL().IsEnabled() ) + EUNIT_ASSERT( inSession->Streams()[3]->BoundStreamL().Type() == KMceAudio ) + EUNIT_ASSERT( inSession->Streams()[3]->BoundStreamL().Sinks().Count() == 1 ) + EUNIT_ASSERT( inSession->Streams()[3]->BoundStreamL().Sinks()[0]->Type() == + KMceSpeakerSink ) + speaker = static_cast + (inSession->Streams()[3]->BoundStreamL().Sinks()[0]); + EUNIT_ASSERT( speaker->VolumeL() == iReceiveSession->LcVolumeL() ) + + // Check for bundles + EUNIT_ASSERT( inSession->Bundles().Count() == 1 ) + EUNIT_ASSERT( inSession->Bundles()[0]->Streams().Count() == 4 ) + EUNIT_ASSERT( inSession->Bundles()[0]->Streams()[0]->Type() == KMceAudio ) + EUNIT_ASSERT( inSession->Bundles()[0]->Streams()[0]->Sinks()[0]->Type() == + KMceSpeakerSink ) + EUNIT_ASSERT( inSession->Bundles()[0]->Streams()[1]->Type() == KMceAudio ) + EUNIT_ASSERT( inSession->Bundles()[0]->Streams()[1]->Sinks()[0]->Type() == + KMceSpeakerSink ) + EUNIT_ASSERT( inSession->Bundles()[0]->Streams()[2]->Type() == KMceAudio ) + EUNIT_ASSERT( inSession->Bundles()[0]->Streams()[2]->Sinks()[0]->Type() == + KMceSpeakerSink ) + EUNIT_ASSERT( inSession->Bundles()[0]->Streams()[3]->Type() == KMceVideo ) + EUNIT_ASSERT( inSession->Bundles()[0]->Streams()[3]->Sinks()[0]->Type() == + KMceDisplaySink ) + } + + +// ----------------------------------------------------------------------------- +// Streams in this test case +// 0. Video in +// 1. Audio in +// 2. Audio out bound to audio in +// 3. Audio in bound to audio out +// All audio will be removed because of operator variant +// ----------------------------------------------------------------------------- +// +void UT_CMusEngReceiveSession::UT_CompleteSessionStructureL_OperatorVariant() + { + iReceiveSession->iOperatorVariant = ETrue; + + // Construct session and streams 0 and 1 + CMceInSession* inSession = inSession = ConstructInSessionLC( 1, 2 ); + + // Construct stream 2 + CMceAudioStream* audioOut = ConstructAudioOutStreamLC(); + inSession->Streams()[2]->BindL( audioOut ); + CleanupStack::Pop( audioOut ); + + // Construct stream 3 + + audioOut = ConstructAudioOutStreamLC(); + + CMceAudioStream* audioIn = ConstructAudioInStreamLC(); + audioOut->BindL( audioIn ); + CleanupStack::Pop( audioIn ); + + inSession->AddStreamL( audioOut ); + CleanupStack::Pop( audioOut ); + + // Transfers ownership + iReceiveSession->iSession = inSession; + CleanupStack::Pop( inSession ); + + // Complete + iReceiveSession->CompleteSessionStructureL(); + + // Check that all audio has been removed and no bundles has been + // constructed + EUNIT_ASSERT_EQUALS( inSession->Streams().Count(), 1 ) + EUNIT_ASSERT_EQUALS( inSession->Streams()[0]->Type(), KMceVideo ) + EUNIT_ASSERT_EQUALS( inSession->Bundles().Count(), 0 ) + + + // Session with bandwidth attributes b=AS and b=TIAS at session and media + // levels -> b=AS is taken in use at session level (b=TIAS is ignored) + // + delete iReceiveSession->iSession; + iReceiveSession->iSession = NULL; + + inSession = ConstructInSessionLC( 1, 0 ); + //setting session level SDP attributes + CDesC8Array* sdpLines = new ( ELeave ) CDesC8ArrayFlat( 2 ); + CleanupStack::PushL( sdpLines ); + sdpLines->AppendL( KMusEngSessionSdpLineBandwidthField() ); + sdpLines->AppendL( KMusEngSessionSdpLineTiasLine() ); + inSession->SetSessionSDPLinesL( sdpLines ); + CleanupStack::Pop( sdpLines ); + + //setting media level SDP attributes + sdpLines = new ( ELeave ) CDesC8ArrayFlat( 2 ); + CleanupStack::PushL( sdpLines ); + sdpLines->AppendL( KMusEngSessionSdpLineBandwidthField() ); + sdpLines->AppendL( KMusEngSessionSdpLineTiasLine() ); + inSession->Streams()[ 0 ]->SetMediaAttributeLinesL( sdpLines ); + CleanupStack::Pop( sdpLines ); + + // Transfers ownership + iReceiveSession->iSession = inSession; + CleanupStack::Pop( inSession ); + + iReceiveSession->CompleteSessionStructureL(); + + // Ensure there is only b=AS and no b=TIAS present at session level + MDesC8Array* newSdpLines = iReceiveSession->iSession->iSessionSDPLines; + TBool bandwidthFoundFromSessionLevel = EFalse; + TBool tiasFoundFromSessionLevel = EFalse; + for ( TInt i = 0; newSdpLines && i < newSdpLines->MdcaCount(); i++ ) + { + if ( newSdpLines->MdcaPoint( i ).Compare( + KMusEngSessionSdpLineBandwidthField() ) == 0 ) + { + bandwidthFoundFromSessionLevel = ETrue; + } + else if ( newSdpLines->MdcaPoint( i ).Find( + KMusEngSessionSdpLineTiasLine() ) == 0 ) + { + tiasFoundFromSessionLevel = ETrue; + } + } + EUNIT_ASSERT( bandwidthFoundFromSessionLevel ); + EUNIT_ASSERT( !tiasFoundFromSessionLevel ); + + // Ensure there is no bandwidth attributes at media level + newSdpLines = iReceiveSession->iSession->Streams()[ 0 ]->iMediaSDPLines; + EUNIT_ASSERT( !newSdpLines->MdcaCount() ); + + + // Session with bandwidth AS and TIAS attributes at media level + // -> bandwidth AS is taken in use at media level + // + delete iReceiveSession->iSession; + iReceiveSession->iSession = NULL; + + inSession = ConstructInSessionLC( 1, 0 ); + + sdpLines = new ( ELeave ) CDesC8ArrayFlat( 2 ); + CleanupStack::PushL( sdpLines ); + sdpLines->AppendL( KMusEngSessionSdpLineBandwidthField() ); + sdpLines->AppendL( KMusEngSessionSdpLineTiasLine() ); + inSession->Streams()[ 0 ]->SetMediaAttributeLinesL( sdpLines ); + CleanupStack::Pop( sdpLines ); + + // Transfers ownership + iReceiveSession->iSession = inSession; + CleanupStack::Pop( inSession ); + + iReceiveSession->CompleteSessionStructureL(); + + // Ensure there is no bandwidth attribute at session level + newSdpLines = iReceiveSession->iSession->iSessionSDPLines; + bandwidthFoundFromSessionLevel = EFalse; + for ( TInt i = 0; newSdpLines && i < newSdpLines->MdcaCount(); i++ ) + { + if ( newSdpLines->MdcaPoint( i ).Compare( + KMusEngSessionSdpLineBandwidthField() ) == 0 + || newSdpLines->MdcaPoint( i ).Find( + KMusEngSessionSdpLineTiasLine() ) == 0 ) + { + bandwidthFoundFromSessionLevel = ETrue; + } + } + EUNIT_ASSERT( !bandwidthFoundFromSessionLevel ); + + // Ensure media level has only b=AS attribute + newSdpLines = iReceiveSession->iSession->Streams()[ 0 ]->iMediaSDPLines; + EUNIT_ASSERT( newSdpLines ); + EUNIT_ASSERT( newSdpLines->MdcaCount() == 1 ); + EUNIT_ASSERT( newSdpLines->MdcaPoint( 0 ) == KMusEngSessionSdpLineBandwidthField() ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngReceiveSession::UT_CompleteSessionStructureL_SdpBandwidthAttributesL() + { + CRepository::SetStubGlobal( MusSettingsKeys::KVideoBandwidth, + 128 ); + + // 1. Session without bandwidth attributes. => b=AS and b=TIAS will be + // taken at media level + CMceInSession* inSession = ConstructInSessionLC( 1, 0 ); + + iReceiveSession->iSession = inSession; // Transfers ownership + CleanupStack::Pop( inSession ); + + iReceiveSession->CompleteSessionStructureL(); + + // Ensure b=AS and b=TIAS present at media level only + MDesC8Array* newSdpLines = iReceiveSession->iSession->iSessionSDPLines; + EUNIT_ASSERT( newSdpLines->MdcaCount() == 1 ); + EUNIT_ASSERT( newSdpLines->MdcaPoint( 0 ) == KMusEngSessionSdpLineXApplication() ); + + // Ensure b=AS and b=TIAS present at media level + EUNIT_ASSERT( iReceiveSession->iSession->Streams().Count() > 0 ); + newSdpLines = iReceiveSession->iSession->Streams()[ 0 ]->iMediaSDPLines; + EUNIT_ASSERT( newSdpLines ); + EUNIT_ASSERT( newSdpLines->MdcaCount() == 2 ); + EUNIT_ASSERT( newSdpLines->MdcaPoint( 0 ).Find( + KMusEngSessionSdpLineBandwidthLine() ) == 0 ); + EUNIT_ASSERT( newSdpLines->MdcaPoint( 1 ).Find( + KMusEngSessionSdpLineTiasLine() ) == 0 ); + + + // 2. Session with b=AS bandwidth attribute at session level + // => b=AS and b=TIAS will be taken at session level + delete iReceiveSession->iSession; + iReceiveSession->iSession = NULL; + + inSession = ConstructInSessionLC( 1, 0 ); + //setting session level SDP attributes + CDesC8Array* sdpLines = new ( ELeave ) CDesC8ArrayFlat( 1 ); + CleanupStack::PushL( sdpLines ); + sdpLines->AppendL( KMusEngSessionSdpLineBandwidthField() ); + inSession->SetSessionSDPLinesL( sdpLines ); + CleanupStack::Pop( sdpLines ); + + // Transfers ownership + iReceiveSession->iSession = inSession; + CleanupStack::Pop( inSession ); + + iReceiveSession->CompleteSessionStructureL(); + + // Ensure b=AS and b=TIAS present at session level only + newSdpLines = iReceiveSession->iSession->iSessionSDPLines; + EUNIT_ASSERT( newSdpLines ); + EUNIT_ASSERT( newSdpLines->MdcaCount() == 3 ); + EUNIT_ASSERT( newSdpLines->MdcaPoint( 0 ) == KMusEngSessionSdpLineXApplication() ); + EUNIT_ASSERT( newSdpLines->MdcaPoint( 1 ).Find ( + KMusEngSessionSdpLineBandwidthLine() ) == 0 ); + EUNIT_ASSERT( newSdpLines->MdcaPoint( 2 ).Find( + KMusEngSessionSdpLineTiasLine() ) == 0 ); + + EUNIT_ASSERT( iReceiveSession->iSession->Streams().Count() > 0 ); + newSdpLines = iReceiveSession->iSession->Streams()[ 0 ]->iMediaSDPLines; + EUNIT_ASSERT( newSdpLines ); + EUNIT_ASSERT( newSdpLines->MdcaCount() == 0 ); + + // 3. Session with b=AS bandwidth attribute at media level + // => b=AS and b=TIAS will be taken at media level + delete iReceiveSession->iSession; + iReceiveSession->iSession = NULL; + + inSession = ConstructInSessionLC( 1, 0 ); + //setting media level SDP attributes + sdpLines = new ( ELeave ) CDesC8ArrayFlat( 1 ); + CleanupStack::PushL( sdpLines ); + sdpLines->AppendL( KMusEngSessionSdpLineBandwidthField() ); + inSession->Streams()[ 0 ]->SetMediaAttributeLinesL( sdpLines ); + CleanupStack::Pop( sdpLines ); + + // Transfers ownership + iReceiveSession->iSession = inSession; + CleanupStack::Pop( inSession ); + + iReceiveSession->CompleteSessionStructureL(); + + // Ensure b=AS and b=TIAS present only at media level + newSdpLines = iReceiveSession->iSession->iSessionSDPLines; + EUNIT_ASSERT( newSdpLines ); + EUNIT_ASSERT( newSdpLines->MdcaCount() == 1 ); + EUNIT_ASSERT( newSdpLines->MdcaPoint( 0 ) == KMusEngSessionSdpLineXApplication() ); + + EUNIT_ASSERT( iReceiveSession->iSession->Streams().Count() > 0 ); + newSdpLines = iReceiveSession->iSession->Streams()[ 0 ]->iMediaSDPLines; + EUNIT_ASSERT( newSdpLines ); + EUNIT_ASSERT( newSdpLines->MdcaCount() == 2 ); + EUNIT_ASSERT( newSdpLines->MdcaPoint( 0 ).Find ( + KMusEngSessionSdpLineBandwidthLine() ) == 0 ); + EUNIT_ASSERT( newSdpLines->MdcaPoint( 1 ).Find( + KMusEngSessionSdpLineTiasLine() ) == 0 ); + + + // 4. Session with b=AS attribute at session level and + // b=AS and b=TIAS at media level + // => b=AS and b=TIAS will be taken at session and media level + delete iReceiveSession->iSession; + iReceiveSession->iSession = NULL; + + inSession = ConstructInSessionLC( 1, 0 ); + //setting session level SDP attributes + sdpLines = new ( ELeave ) CDesC8ArrayFlat( 1 ); + CleanupStack::PushL( sdpLines ); + sdpLines->AppendL( KMusEngSessionSdpLineBandwidthField() ); + inSession->SetSessionSDPLinesL( sdpLines ); + CleanupStack::Pop( sdpLines ); + + //setting media level SDP attributes + sdpLines = new ( ELeave ) CDesC8ArrayFlat( 2 ); + CleanupStack::PushL( sdpLines ); + sdpLines->AppendL( KMusEngSessionSdpLineBandwidthField() ); + sdpLines->AppendL( KMusEngSessionSdpLineTiasLine() ); + inSession->Streams()[ 0 ]->SetMediaAttributeLinesL( sdpLines ); + CleanupStack::Pop( sdpLines ); + + // Transfers ownership + iReceiveSession->iSession = inSession; + CleanupStack::Pop( inSession ); + + iReceiveSession->CompleteSessionStructureL(); + + // Ensure b=AS and b=TIAS present at session and media level + newSdpLines = iReceiveSession->iSession->iSessionSDPLines; + EUNIT_ASSERT( newSdpLines ); + EUNIT_ASSERT( newSdpLines->MdcaCount() == 3 ); + EUNIT_ASSERT( newSdpLines->MdcaPoint( 0 ) == KMusEngSessionSdpLineXApplication() ); + EUNIT_ASSERT( newSdpLines->MdcaPoint( 1 ).Find ( + KMusEngSessionSdpLineBandwidthLine() ) == 0 ); + EUNIT_ASSERT( newSdpLines->MdcaPoint( 2 ).Find( + KMusEngSessionSdpLineTiasLine() ) == 0 ); + + EUNIT_ASSERT( iReceiveSession->iSession->Streams().Count() > 0 ); + newSdpLines = iReceiveSession->iSession->Streams()[ 0 ]->iMediaSDPLines; + EUNIT_ASSERT( newSdpLines ); + EUNIT_ASSERT( newSdpLines->MdcaCount() == 2 ); + EUNIT_ASSERT( newSdpLines->MdcaPoint( 0 ).Find ( + KMusEngSessionSdpLineBandwidthLine() ) == 0 ); + EUNIT_ASSERT( newSdpLines->MdcaPoint( 1 ).Find( + KMusEngSessionSdpLineTiasLine() ) == 0 ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngReceiveSession::UT_ParseAssertedIdentityL() + { + _LIT8( KMusEngAssertedIdentitySip, "P-Asserted-Identity: sip:fluffy@cisco.com" ); + _LIT8( KMusEngIdentitySip, "fluffy" ); + _LIT8( KMusEngAssertedIdentityTel, "P-Asserted-Identity: tel:+14085264000" ); + _LIT8( KMusEngAssertedIdentityTelBrace, "P-Asserted-Identity: " ); + _LIT8( KMusEngIdentityTel, "+14085264000" ); + _LIT8( KMusEngTestHeader, "Some header" ); + + _LIT8( KMusEngAssertedIdentityInvalid, "P-Asserted-Identity: sip:fluffy cisco.com" ); + + TMceTransactionDataContainer container; + CDesC8Array* headers; + + // only sip uri in asserted identity header + headers = new ( ELeave ) CDesC8ArrayFlat( 2 ); + CleanupStack::PushL( headers ); + headers->AppendL( KMusEngTestHeader ); + headers->AppendL( KMusEngAssertedIdentitySip ); + container.SetHeaders( headers ); + CleanupStack::Pop( headers ); + iReceiveSession->ParseAssertedIdentity( &container ); + container.Clear(); + EUNIT_ASSERT_EQUALS( iReceiveSession->iIdentity, KMusEngIdentitySip ) + + // sip && tel uris in asserted identity headers + headers = new ( ELeave ) CDesC8ArrayFlat( 3 ); + CleanupStack::PushL( headers ); + headers->AppendL( KMusEngTestHeader ); + headers->AppendL( KMusEngAssertedIdentitySip ); + headers->AppendL( KMusEngAssertedIdentityTel ); + container.SetHeaders( headers ); + CleanupStack::Pop( headers ); + iReceiveSession->ParseAssertedIdentity( &container ); + container.Clear(); + EUNIT_ASSERT_EQUALS( iReceiveSession->iIdentity, KMusEngIdentityTel ) + + // tel uri with braces in asserted identity header + headers = new ( ELeave ) CDesC8ArrayFlat( 2 ); + CleanupStack::PushL( headers ); + headers->AppendL( KMusEngTestHeader ); + headers->AppendL( KMusEngAssertedIdentityTelBrace ); + container.SetHeaders( headers ); + CleanupStack::Pop( headers ); + iReceiveSession->ParseAssertedIdentity( &container ); + container.Clear(); + EUNIT_ASSERT_EQUALS( iReceiveSession->iIdentity, KMusEngIdentityTel ) + + // invalid uri in asserted identity header + headers = new ( ELeave ) CDesC8ArrayFlat( 2 ); + CleanupStack::PushL( headers ); + headers->AppendL( KMusEngTestHeader ); + headers->AppendL( KMusEngAssertedIdentityInvalid ); + container.SetHeaders( headers ); + CleanupStack::Pop( headers ); + iReceiveSession->ParseAssertedIdentity( &container ); + container.Clear(); + EUNIT_ASSERT_EQUALS( iReceiveSession->iIdentity, KNullDesC8 ) + + // null container + iReceiveSession->ParseAssertedIdentity( NULL ); + EUNIT_ASSERT_EQUALS( iReceiveSession->iIdentity, KNullDesC8 ) + + // null header + iReceiveSession->ParseAssertedIdentity( &container ); + EUNIT_ASSERT_EQUALS( iReceiveSession->iIdentity, KNullDesC8 ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngReceiveSession::UT_ContactSavingLL() + { + ContactEngineStubHelper::Reset(); + + // Saving of contact is done at destruction phase only if originator value + // exists + // + CMusEngReceiveSession* receiveSession = CMusEngReceiveSession::NewL(); + receiveSession->SetLcSessionObserver( iLcSessionObserver ); + delete receiveSession; + receiveSession = NULL; + EUNIT_ASSERT( ContactEngineStubHelper::GetCalledFunction() == EContactEngineStubNone ); + + + User::LeaveIfError( RProperty::Set( NMusSessionApi::KCategoryUid, + NMusSessionApi::KContactId, + 2 ) ); + User::LeaveIfError( RProperty::Set( NMusSessionApi::KCategoryUid, + NMusSessionApi::KTelNumber, + _L("12341234") ) ); + + receiveSession = CMusEngReceiveSession::NewL(); + CleanupStack::PushL( receiveSession ); + receiveSession->SetLcSessionObserver( iLcSessionObserver ); + delete receiveSession->iOriginator; + receiveSession->iOriginator = NULL; + receiveSession->iOriginator = _L8("sip:yep@10.10.10.10").AllocL(); + CleanupStack::PopAndDestroy( receiveSession ); + if ( ContactEngineStubHelper::GetCalledFunction() != EContactEngineStubSetText ) + { + // out-of-memory was trap ignored and saving failed because of that + User::Leave( KErrNoMemory ); + } + EUNIT_ASSERT( ContactEngineStubHelper::GetCalledFunction() == EContactEngineStubSetText ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngReceiveSession::UT_IsDisplayActive() + { + // Display is active only if receiving and display is explicitly enabled + CMceInSession* inSession = ConstructInSessionLC( 1, 1 ); + iReceiveSession->iSession = inSession; // Transfers ownership + CleanupStack::Pop( inSession ); + iReceiveSession->EnableDisplayL( ETrue ); + EUNIT_ASSERT( !iReceiveSession->IsDisplayActive() ) + iReceiveSession->iReceiving = ETrue; + EUNIT_ASSERT( iReceiveSession->IsDisplayActive() ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngReceiveSession::UT_InactivityTimeoutL() + { + // Not receiving, no effect + iReceiveSession->iReceiving = EFalse; + CMceVideoStream* videoStream = CMceVideoStream::NewLC(); + CMceRtpSource* rtpSource = CMceRtpSource::NewLC(); + iReceiveSession->InactivityTimeout( *videoStream, *rtpSource ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + // Receiving, state change is notified and + // receiving and buffering status are cleared + iReceiveSession->iBuffered = ETrue; + iReceiveSession->iReceiving = ETrue; + iReceiveSession->InactivityTimeout( *videoStream, *rtpSource ); + EUNIT_ASSERT_EQUALS( iLcSessionObserver->iCalledFunction, + CLcSessionObserverStub::EPlayerStateChanged ); + EUNIT_ASSERT( !iReceiveSession->iReceiving ); + EUNIT_ASSERT( !iReceiveSession->iBuffered ); + CleanupStack::PopAndDestroy( rtpSource ); + CleanupStack::PopAndDestroy( videoStream ); + } + + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusEngReceiveSession, + "UT_CMusEngReceiveSesssion", + "UNIT" ) + +EUNIT_TEST( + "NewL - test ", + "CMusEngReceiveSession", + "NewL", + "FUNCTIONALITY", + SetupL, UT_NewLL, Teardown) + +EUNIT_TEST( + "LcSessionState - test ", + "CMusEngReceiveSession", + "LcSessionState", + "FUNCTIONALITY", + SetupL, UT_LcSessionStateL, Teardown) + +EUNIT_TEST( + "EstablishLcSessionL - test ", + "CMusEngReceiveSession", + "EstablishLcSessionL", + "FUNCTIONALITY", + SetupL, UT_EstablishLcSessionL, Teardown) + +EUNIT_TEST( + "TerminateLcSessionL - test ", + "CMusEngReceiveSession", + "TerminateLcSessionL", + "FUNCTIONALITY", + SetupL, UT_TerminateLcSessionL, Teardown) + +EUNIT_TEST( + "RemoteVideoPlayer - test ", + "CMusEngReceiveSession", + "RemoteVideoPlayer", + "FUNCTIONALITY", + SetupL, UT_RemoteVideoPlayerL, Teardown) + +EUNIT_TEST( + "RemoteDisplayName - test ", + "CMusEngReceiveSession", + "RemoteDisplayName", + "FUNCTIONALITY", + SetupL, UT_RemoteDisplayName, Teardown) + +EUNIT_TEST( + "HandleSessionStateChanged - test ", + "CMusEngReceiveSession", + "HandleSessionStateChanged", + "FUNCTIONALITY", + SetupL, UT_HandleSessionStateChangedL, Teardown) + +EUNIT_TEST( + "AdjustVideoCodecL - test ", + "CMusEngReceiveSession", + "AdjustVideoCodecL", + "FUNCTIONALITY", + SetupL, UT_AdjustVideoCodecLL, Teardown) + +EUNIT_TEST( + "AdjustAudioCodecL - test ", + "CMusEngReceiveSession", + "AdjustAudioCodecL", + "FUNCTIONALITY", + SetupL, UT_AdjustAudioCodecLL, Teardown) + +EUNIT_TEST( + "DoCodecSelectionL - test ", + "CMusEngReceiveSession", + "DoCodecSelectionL", + "FUNCTIONALITY", + SetupL, UT_DoCodecSelectionLL, Teardown) + +EUNIT_TEST( + "IncomingSession - test ", + "CMusEngReceiveSession", + "IncomingSession", + "FUNCTIONALITY", + SetupL, UT_IncomingSessionL, Teardown) + +EUNIT_TEST( + "IncomingUpdate - test ", + "CMusEngReceiveSession", + "IncomingUpdate", + "FUNCTIONALITY", + SetupL, UT_IncomingUpdateL, Teardown) + +EUNIT_TEST( + "StreamStateChanged - test ", + "CMusEngReceiveSession", + "StreamStateChanged", + "FUNCTIONALITY", + SetupL, UT_StreamStateChangedL, Teardown) + +EUNIT_TEST( + "UT_CompleteSessionStructureL_WithoutSessionL - test without a session", + "CMusEngReceiveSession", + "CompleteSessionStructureL", + "FUNCTIONALITY", + SetupL, UT_CompleteSessionStructureL_WithoutSessionL, Teardown) + +EUNIT_TEST( + "UT_CompleteSessionStructureL_WithoutStreamsL - without streams", + "CMusEngReceiveSession", + "CompleteSessionStructureL", + "FUNCTIONALITY", + SetupL, UT_CompleteSessionStructureL_WithoutStreamsL, Teardown) + +EUNIT_TEST( + "UT_CompleteSessionStructureL_WithOutgoingStreamL - with outgoing stream", + "CMusEngReceiveSession", + "CompleteSessionStructureL", + "FUNCTIONALITY", + SetupL, UT_CompleteSessionStructureL_WithOutgoingStreamL, Teardown) + +EUNIT_TEST( + "UT_CompleteSessionStructureL_WithVideoInL - with video in stream", + "CMusEngReceiveSession", + "CompleteSessionStructureL", + "FUNCTIONALITY", + SetupL, UT_CompleteSessionStructureL_WithVideoInL, Teardown) + +EUNIT_TEST( + "UT_CompleteSessionStructureL_WithVideoOutBoundToVideoInL - with sendrecv video, video out bound to video in", + "CMusEngReceiveSession", + "CompleteSessionStructureL", + "FUNCTIONALITY", + SetupL, UT_CompleteSessionStructureL_WithVideoOutBoundToVideoInL, Teardown) + +EUNIT_TEST( + "UT_CompleteSessionStructureL_WithVideoInBoundToVideoOutL - with sendrecv video, video in bound to video out", + "CMusEngReceiveSession", + "CompleteSessionStructureL", + "FUNCTIONALITY", + SetupL, UT_CompleteSessionStructureL_WithVideoInBoundToVideoOutL, Teardown) + +EUNIT_TEST( + "UT_CompleteSessionStructureL_WithMultipleVideoInsL - with multiple video in streams", + "CMusEngReceiveSession", + "CompleteSessionStructureL", + "FUNCTIONALITY", + SetupL, UT_CompleteSessionStructureL_WithMultipleVideoInsL, Teardown) + +EUNIT_TEST( + "CompleteSessionStructureL - test one video and multiple audio streams", + "CMusEngReceiveSession", + "CompleteSessionStructureL", + "FUNCTIONALITY", + SetupL, UT_CompleteSessionStructureL_WithVideoAndMultipleAudioInsL, Teardown) + +EUNIT_TEST( + "CompleteSessionStructureL - test operator variant", + "CMusEngReceiveSession", + "CompleteSessionStructureL", + "FUNCTIONALITY", + SetupL, UT_CompleteSessionStructureL_OperatorVariant, Teardown) + +EUNIT_TEST( + "CompleteSessionStructureL - test SDP bandwidth attributes handling", + "CMusEngReceiveSession", + "CompleteSessionStructureL", + "FUNCTIONALITY", + SetupL, UT_CompleteSessionStructureL_SdpBandwidthAttributesL, Teardown) + +EUNIT_TEST( + "ParseAssertedIdentity", + "CMusEngReceiveSession", + "ParseAssertedIdentity", + "FUNCTIONALITY", + SetupL, UT_ParseAssertedIdentityL, Teardown) + +EUNIT_TEST( + "ContactSavingL - test", + "CMusEngReceiveSession", + "ContactSavingL", + "FUNCTIONALITY", + SetupL, UT_ContactSavingLL, Teardown) + +EUNIT_TEST( + "IsDisplayActive - test", + "CMusEngReceiveSession", + "IsDisplayActive", + "FUNCTIONALITY", + SetupL, UT_IsDisplayActive, Teardown) + +EUNIT_TEST( + "InactivityTimeout - test ", + "CMusEngReceiveSession", + "InactivityTimeout", + "FUNCTIONALITY", + SetupL, UT_InactivityTimeoutL, Teardown) + +EUNIT_END_TEST_TABLE + +// END OF FILE + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/tsrc/ut_engine/src/ut_musengremotevideoplayer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/tsrc/ut_engine/src/ut_musengremotevideoplayer.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,440 @@ +/* +* 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: +* +*/ + + +// INTERNAL INCLUDES +#include "ut_musengremotevideoplayer.h" +#include "musengremotevideoplayer.h" +#include "mceinsession.h" +#include "mcevideostream.h" +#include "mcertpsource.h" +#include "mcedisplaysink.h" + +// SYSTEM INCLUDES +#include + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusEngRemoteVideoPlayer* UT_CMusEngRemoteVideoPlayer::NewL() + { + UT_CMusEngRemoteVideoPlayer* self = UT_CMusEngRemoteVideoPlayer::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusEngRemoteVideoPlayer* UT_CMusEngRemoteVideoPlayer::NewLC() + { + UT_CMusEngRemoteVideoPlayer* self = new( ELeave ) UT_CMusEngRemoteVideoPlayer(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusEngRemoteVideoPlayer::~UT_CMusEngRemoteVideoPlayer() + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// Default constructor +// ----------------------------------------------------------------------------- +// +UT_CMusEngRemoteVideoPlayer::UT_CMusEngRemoteVideoPlayer() + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// Second phase construct +// ----------------------------------------------------------------------------- +// +void UT_CMusEngRemoteVideoPlayer::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngRemoteVideoPlayer::SetupL() + { + iMceSession = CMceInSession::NewL(); + CMceVideoStream* videoStream = CMceVideoStream::NewLC(); + CMceRtpSource* source = CMceRtpSource::NewLC(); + videoStream->SetSourceL( source ); + CleanupStack::Pop( source ); + CMceDisplaySink* sink = CMceDisplaySink::NewLC(); + videoStream->AddSinkL( sink ); + CleanupStack::Pop( sink ); + iMceSession->AddStreamL( videoStream ); + CleanupStack::Pop( videoStream ); + + iRemoteVideoPlayer = CMusEngRemoteVideoPlayer::NewL( + iDisplayHandlerStub, + iLcAudioControlStub ); + iRemoteVideoPlayer->SetMceSession( iMceSession ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngRemoteVideoPlayer::Teardown() + { + delete iRemoteVideoPlayer; + delete iMceSession; + iLcAudioControlStub.Reset(); + } + + + +// TEST CASES + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngRemoteVideoPlayer::UT_NewLL() + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngRemoteVideoPlayer::UT_LcVideoPlayerStateL() + { + // iMceSession not set + iRemoteVideoPlayer->SetMceSession( NULL ); + EUNIT_ASSERT_EQUALS( TInt( MLcVideoPlayer::EUnavailable ), + TInt( iRemoteVideoPlayer->LcVideoPlayerState() ) ) + iRemoteVideoPlayer->SetMceSession( iMceSession ); + + // Establish Session and simulate media playing. + iMceSession->iState = CMceSession::EEstablished; + for ( TInt i = 0; i < iMceSession->Streams().Count(); i++ ) + { + iMceSession->Streams()[i]->iState = CMceMediaStream::EStreaming; + } + + EUNIT_ASSERT_EQUALS( TInt( MLcVideoPlayer::EPlaying ), + TInt( iRemoteVideoPlayer->LcVideoPlayerState() ) ) + + // Media streams unavailable + iMceSession->Streams()[0]->iState = CMceMediaStream::EUninitialized; + EUNIT_ASSERT_EQUALS( TInt( MLcVideoPlayer::EUnavailable ), + TInt( iRemoteVideoPlayer->LcVideoPlayerState() ) ) + + // All other stream states + iMceSession->Streams()[0]->iState = CMceMediaStream::EInitialized; + EUNIT_ASSERT_EQUALS( TInt( MLcVideoPlayer::EInit ), + TInt( iRemoteVideoPlayer->LcVideoPlayerState() ) ) + + iMceSession->Streams()[0]->iState = CMceMediaStream::EBuffering; + EUNIT_ASSERT_EQUALS( TInt( MLcVideoPlayer::EBuffering ), + TInt( iRemoteVideoPlayer->LcVideoPlayerState() ) ) + + iMceSession->Streams()[0]->iState = CMceMediaStream::EIdle; + EUNIT_ASSERT_EQUALS( TInt( MLcVideoPlayer::EPaused ), + TInt( iRemoteVideoPlayer->LcVideoPlayerState() ) ) + + iMceSession->Streams()[0]->iState = CMceMediaStream::EDisabled; + EUNIT_ASSERT_EQUALS( TInt( MLcVideoPlayer::EPaused ), + TInt( iRemoteVideoPlayer->LcVideoPlayerState() ) ) + + iDisplayHandlerStub.iIsActive = ETrue; + iMceSession->Streams()[0]->iState = CMceMediaStream::EStreaming; + EUNIT_ASSERT_EQUALS( TInt( MLcVideoPlayer::EPlaying ), + TInt( iRemoteVideoPlayer->LcVideoPlayerState() ) ) + + iDisplayHandlerStub.iIsActive = EFalse; + iMceSession->Streams()[0]->iState = CMceMediaStream::EStreaming; + EUNIT_ASSERT_EQUALS( TInt( MLcVideoPlayer::EPaused ), + TInt( iRemoteVideoPlayer->LcVideoPlayerState() ) ) + + iMceSession->Streams()[0]->iState = CMceMediaStream::ENoResources; + EUNIT_ASSERT_EQUALS( TInt( MLcVideoPlayer::EUnavailable ), + TInt( iRemoteVideoPlayer->LcVideoPlayerState() ) ) + + iMceSession->Streams()[0]->iState = CMceMediaStream::ETranscodingRequired; + EUNIT_ASSERT_EQUALS( TInt( MLcVideoPlayer::EUnavailable ), + TInt( iRemoteVideoPlayer->LcVideoPlayerState() ) ) + + iMceSession->Streams()[0]->iState = CMceMediaStream::ETranscoding; + EUNIT_ASSERT_EQUALS( TInt( MLcVideoPlayer::EUnavailable ), + TInt( iRemoteVideoPlayer->LcVideoPlayerState() ) ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngRemoteVideoPlayer::UT_LcPlayL() + { + // iMceSession not set + iRemoteVideoPlayer->SetMceSession( NULL ); + EUNIT_ASSERT( !iRemoteVideoPlayer->LcIsPlayingL() ) + iRemoteVideoPlayer->SetMceSession( iMceSession ); + + iMceSession->iState = CMceSession::EEstablished; + for ( TInt i = 0; i < iMceSession->Streams().Count(); i++ ) + { + iMceSession->Streams()[i]->iState = CMceMediaStream::EStreaming; + } + + // Play Test + iRemoteVideoPlayer->LcPlayL(); + EUNIT_ASSERT( iRemoteVideoPlayer->LcIsPlayingL() ) + + // Pause Test + iMceSession->Streams()[0]->iState = CMceMediaStream::EDisabled; + iRemoteVideoPlayer->LcPauseL(); + EUNIT_ASSERT( !iRemoteVideoPlayer->LcIsPlayingL() ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngRemoteVideoPlayer::UT_LcWindowL() + { + EUNIT_ASSERT( iRemoteVideoPlayer->LcWindow() == iRemoteVideoPlayer ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngRemoteVideoPlayer::UT_LcCameraControlL() + { + EUNIT_ASSERT( iRemoteVideoPlayer->LcCameraControl() == NULL ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngRemoteVideoPlayer::UT_LcSourceFileControlL() + { + EUNIT_ASSERT( iRemoteVideoPlayer->LcSourceFileControl() == NULL ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngRemoteVideoPlayer::UT_LcDestinationFileControlL() + { + EUNIT_ASSERT( iRemoteVideoPlayer->LcDestinationFileControl() == NULL ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngRemoteVideoPlayer::UT_LcAudioControlL() + { + EUNIT_ASSERT( iRemoteVideoPlayer->LcAudioControl() == &iLcAudioControlStub ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngRemoteVideoPlayer::UT_LcZoomControlL() + { + EUNIT_ASSERT( iRemoteVideoPlayer->LcZoomControl() == NULL ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngRemoteVideoPlayer::UT_LcBrightnessControlL() + { + EUNIT_ASSERT( iRemoteVideoPlayer->LcBrightnessControl() == NULL ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngRemoteVideoPlayer::UT_EnableLcWindowL() + { + EUNIT_ASSERT( !iRemoteVideoPlayer->IsLcWindowEnabled() ) + + // Enable + iRemoteVideoPlayer->EnableLcWindowL( ETrue ); + EUNIT_ASSERT( iRemoteVideoPlayer->IsLcWindowEnabled() ) + + // Disable + iRemoteVideoPlayer->EnableLcWindowL( EFalse ); + EUNIT_ASSERT( !iRemoteVideoPlayer->IsLcWindowEnabled() ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngRemoteVideoPlayer::UT_LcWindowRectL() + { + TRect rect( 12, 34, 56, 78 ); + iRemoteVideoPlayer->SetLcWindowRectL( rect ); + EUNIT_ASSERT( iRemoteVideoPlayer->LcWindowRect() == rect ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngRemoteVideoPlayer::UT_LcWindowOrientationL() + { + iRemoteVideoPlayer->SetLcWindowOrientationL( MLcWindow::EPortrait ); + EUNIT_ASSERT_EQUALS( TInt( MLcWindow::EPortrait ), + TInt( iRemoteVideoPlayer->LcWindowOrientationL() ) ) + + iRemoteVideoPlayer->SetLcWindowOrientationL( MLcWindow::ELandscape ); + EUNIT_ASSERT_EQUALS( TInt( MLcWindow::ELandscape ), + TInt( iRemoteVideoPlayer->LcWindowOrientationL() ) ) + } + + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusEngRemoteVideoPlayer, + "UT_CMusEngRemoteVideoPlayer", + "UNIT" ) + +EUNIT_TEST( + "NewL - test ", + "CMusEngRemoteVideoPlayer", + "NewL", + "FUNCTIONALITY", + SetupL, UT_NewLL, Teardown) + +EUNIT_TEST( + "LcVideoPlayerState - test ", + "CMusEngRemoteVideoPlayer", + "LcVideoPlayerState", + "FUNCTIONALITY", + SetupL, UT_LcVideoPlayerStateL, Teardown) + +EUNIT_TEST( + "LcPlayL - test ", + "CMusEngRemoteVideoPlayer", + "LcPlayL", + "FUNCTIONALITY", + SetupL, UT_LcPlayL, Teardown) + +EUNIT_TEST( + "LcWindow - test ", + "CMusEngRemoteVideoPlayer", + "LcWindow", + "FUNCTIONALITY", + SetupL, UT_LcWindowL, Teardown) + +EUNIT_TEST( + "LcCameraControl - test ", + "CMusEngRemoteVideoPlayer", + "LcCameraControl", + "FUNCTIONALITY", + SetupL, UT_LcCameraControlL, Teardown) + +EUNIT_TEST( + "LcSourceFile - test ", + "CMusEngRemoteVideoPlayer", + "LcSourceFile", + "FUNCTIONALITY", + SetupL, UT_LcSourceFileControlL, Teardown) + +EUNIT_TEST( + "LcDestinationFile - test ", + "CMusEngRemoteVideoPlayer", + "LcDestinationFile", + "FUNCTIONALITY", + SetupL, UT_LcDestinationFileControlL, Teardown) + +EUNIT_TEST( + "LcAudioControl - test ", + "CMusEngRemoteVideoPlayer", + "LcAudioControl", + "FUNCTIONALITY", + SetupL, UT_LcAudioControlL, Teardown) + +EUNIT_TEST( + "LcZoomControl - test ", + "CMusEngRemoteVideoPlayer", + "LcZoomControl", + "FUNCTIONALITY", + SetupL, UT_LcZoomControlL, Teardown) + +EUNIT_TEST( + "LcBrightnessControl - test ", + "CMusEngRemoteVideoPlayer", + "LcBrightnessControl", + "FUNCTIONALITY", + SetupL, UT_LcBrightnessControlL, Teardown) + +EUNIT_TEST( + "EnableLcWindowL - test ", + "CMusEngRemoteVideoPlayer", + "EnableLcWindowL", + "FUNCTIONALITY", + SetupL, UT_EnableLcWindowL, Teardown) + +EUNIT_TEST( + "LcWindowRect - test ", + "CMusEngRemoteVideoPlayer", + "LcWindowRect", + "FUNCTIONALITY", + SetupL, UT_LcWindowRectL, Teardown) + +EUNIT_TEST( + "LcWindowOrientation - test ", + "CMusEngRemoteVideoPlayer", + "LcWindowOrientation", + "FUNCTIONALITY", + SetupL, UT_LcWindowOrientationL, Teardown) + + +EUNIT_END_TEST_TABLE + +// END OF FILE + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/tsrc/ut_engine/src/ut_musengsessiondurationtimer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/tsrc/ut_engine/src/ut_musengsessiondurationtimer.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,197 @@ +/* +* 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: +* +*/ + + +// INTERNAL INCLUDES +#include "ut_musengsessiondurationtimer.h" +#include "musengsessiondurationtimer.h" +#include "musengstubs.h" +#include "musengtestdefs.h" + + +// SYSTEM INCLUDES +#include + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusEngSessionDurationTimer* UT_CMusEngSessionDurationTimer::NewL() + { + UT_CMusEngSessionDurationTimer* self = UT_CMusEngSessionDurationTimer::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusEngSessionDurationTimer* UT_CMusEngSessionDurationTimer::NewLC() + { + UT_CMusEngSessionDurationTimer* self = + new( ELeave ) UT_CMusEngSessionDurationTimer(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusEngSessionDurationTimer::~UT_CMusEngSessionDurationTimer() + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// Default constructor +// ----------------------------------------------------------------------------- +// +UT_CMusEngSessionDurationTimer::UT_CMusEngSessionDurationTimer() + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// Second phase construct +// ----------------------------------------------------------------------------- +// +void UT_CMusEngSessionDurationTimer::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngSessionDurationTimer::SetupL() + { + iObserver = new( ELeave ) CMusEngObserverStub; + iDurationTimer = CMusEngSessionDurationTimer::NewL( *iObserver ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngSessionDurationTimer::Teardown() + { + delete iDurationTimer; + delete iObserver; + } + + + +// TEST CASES + + + + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngSessionDurationTimer::UT_CMusEngSessionDurationTimer_StartL() + { + TInt delay = 30; // For not calling RunL by itself + iDurationTimer->Start( delay ); + EUNIT_ASSERT( iDurationTimer->IsActive() ); + + iDurationTimer->Start( delay ); // Second call does nothing + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngSessionDurationTimer::UT_CMusEngSessionDurationTimer_RunLL() + { + // Fail + iDurationTimer->iStatus = KErrGeneral; + iDurationTimer->RunL(); + EUNIT_ASSERT( iObserver->IsReseted() ); + + // Success + iDurationTimer->iStatus = KErrNone; + iDurationTimer->RunL(); + EUNIT_ASSERT( iObserver->iUpdateTimerEventCalled ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngSessionDurationTimer::UT_CMusEngSessionDurationTimer_DoCancelL() + { + // Cannot assert, so dummy case + iDurationTimer->Cancel(); + } + + + + + + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusEngSessionDurationTimer, + "UT_CMusEngSesssionDurationTimer", + "UNIT" ) + +EUNIT_TEST( + "StartL - test ", + "CMusEngSessionDurationTimer", + "StartL", + "FUNCTIONALITY", + SetupL, UT_CMusEngSessionDurationTimer_StartL, Teardown) + +EUNIT_TEST( + "RunL - test ", + "CMusEngSessionDurationTimer", + "RunL", + "FUNCTIONALITY", + SetupL, UT_CMusEngSessionDurationTimer_RunLL, Teardown) + +EUNIT_TEST( + "DoCancel - test ", + "CMusEngSessionDurationTimer", + "DoCancel", + "FUNCTIONALITY", + SetupL, UT_CMusEngSessionDurationTimer_DoCancelL, Teardown) + + +EUNIT_END_TEST_TABLE + +// END OF FILE + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/tsrc/ut_engine/src/ut_musengsessionmanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/tsrc/ut_engine/src/ut_musengsessionmanager.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,293 @@ +/* +* 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: +* +*/ + + +// INTERNAL INCLUDES +#include "musengstubs.h" +#include "ut_musengsessionmanager.h" +#include "musengsessionmanager.h" +#include "musengmcesession.h" +#include "musengmceoutsession.h" +#include "mussessionproperties.h" +#include "centralrepository.h" +#include "e32property.h" +#include "musengtestdefs.h" + +// SYSTEM INCLUDES +#include + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusEngSessionManager* UT_CMusEngSessionManager::NewL() + { + UT_CMusEngSessionManager* self = UT_CMusEngSessionManager::NewLC(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusEngSessionManager* UT_CMusEngSessionManager::NewLC() + { + UT_CMusEngSessionManager* self = new( ELeave )UT_CMusEngSessionManager(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusEngSessionManager::~UT_CMusEngSessionManager() + { + // NOP + } + +// ----------------------------------------------------------------------------- +// Default constructor +// ----------------------------------------------------------------------------- +// +UT_CMusEngSessionManager::UT_CMusEngSessionManager() + { + } + +// ----------------------------------------------------------------------------- +// Second phase construct +// ----------------------------------------------------------------------------- +// +void UT_CMusEngSessionManager::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngSessionManager::SetupL() + { + User::LeaveIfError( + RProperty::Set( + NMusSessionApi::KCategoryUid, + NMusSessionApi::KUseCase, + MultimediaSharing::EMusLiveVideo ) ); + iSessionManager = CMusEngSessionManager::NewL(); + + iLcUiProvider = new( ELeave )CLcUiProviderStub; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngSessionManager::Teardown() + { + delete iSessionManager; + delete iLcUiProvider; + // The Central Repository stub is using RProperty stub to store global data. + // The global data must be freed here. + PropertyHelper::Close(); + } + +// TEST CASES + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngSessionManager::UT_NewL() + { + EUNIT_ASSERT( iSessionManager->iSession != NULL ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngSessionManager::UT_SessionL() + { + EUNIT_ASSERT( iSessionManager->iSession == &( iSessionManager->Session() ) ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngSessionManager::UT_IsFeatureSupportedL() + { + EUNIT_ASSERT( + iSessionManager->IsFeatureSupported( CLcEngine::ELcShowAcceptQuery ) ) + + EUNIT_ASSERT( + iSessionManager->IsFeatureSupported( CLcEngine::ELcShowInvitingNote ) ) + + EUNIT_ASSERT( + iSessionManager->IsFeatureSupported( CLcEngine::ELcShowWaitingNote ) ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngSessionManager::UT_CreateMusSessionL() + { + CMusEngMceSession* session = NULL; + + // Live session + session = + iSessionManager->CreateMusSessionL( + MultimediaSharing::EMusLiveVideo ); + EUNIT_ASSERT( session != NULL ) + delete session; + + // Clip session + session = + iSessionManager->CreateMusSessionL( + MultimediaSharing::EMusClipVideo ); + EUNIT_ASSERT( session != NULL ) + delete session; + + // Receive session + session = + iSessionManager->CreateMusSessionL( + MultimediaSharing::EMusReceive ); + EUNIT_ASSERT( session != NULL ) + delete session; + + // Two way session + session = + iSessionManager->CreateMusSessionL( + MultimediaSharing::EMusTwoWayVideo ); + EUNIT_ASSERT( session != NULL ) + delete session; + + // Two way receive session + session = + iSessionManager->CreateMusSessionL( + MultimediaSharing::EMusReceiveTwoWayVideo ); + EUNIT_ASSERT( session != NULL ) + delete session; + + // Other session types + EUNIT_ASSERT_SPECIFIC_LEAVE( + iSessionManager->CreateMusSessionL( MultimediaSharing::EMusStillImage ), + KErrNotSupported ) + + EUNIT_ASSERT_SPECIFIC_LEAVE( + iSessionManager->CreateMusSessionL( MultimediaSharing::EMusContinue ), + KErrNotSupported ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngSessionManager::UT_PropertyChangedL() + { + iSessionManager->Session().SetLcUiProvider( iLcUiProvider ); + + // Background startup not active, property change ignored + MLcSession* origSession = &iSessionManager->Session(); + iSessionManager->PropertyChanged( + NMusSessionApi::KUseCase, MultimediaSharing::EMusReceiveTwoWayVideo ); + + EUNIT_ASSERT( origSession == &iSessionManager->Session() ); + EUNIT_ASSERT( iLcUiProvider->iCalledFunction != CLcUiProviderStub::EHandleForegroundStatus ); + + // Background startup active, usecase not changed, no effect + User::LeaveIfError( RProperty::Set( NMusSessionApi::KCategoryUid, + NMusSessionApi::KFastMode, + MusSettingsKeys::EFastModeOn ) ); + iSessionManager->iSession->iBackground = ETrue; + origSession = &iSessionManager->Session(); + iSessionManager->PropertyChanged( + NMusSessionApi::KUseCase, iSessionManager->iCurrentUseCase ); + + EUNIT_ASSERT( origSession == &iSessionManager->Session() ); + EUNIT_ASSERT( iLcUiProvider->iCalledFunction != CLcUiProviderStub::EHandleForegroundStatus ); + + // Background startup active, usecase changed, uiprovider informed and + // new session replaces old one + origSession = &iSessionManager->Session(); + iSessionManager->PropertyChanged( + NMusSessionApi::KUseCase, MultimediaSharing::EMusClipVideo ); + if ( origSession == &iSessionManager->Session() ) + { + // Couldn't create new session because running out of memory + User::Leave( KErrNoMemory ); + } + EUNIT_ASSERT( origSession != &iSessionManager->Session() ); + EUNIT_ASSERT( iLcUiProvider->iCalledFunction == CLcUiProviderStub::EHandleForegroundStatus ); + EUNIT_ASSERT( iLcUiProvider->iForeground ); + } + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusEngSessionManager, + "UT_CMusEngSessionManager", + "UNIT" ) + +EUNIT_TEST( + "NewL - test ", + "CMusEngSessionManager", + "NewL", + "FUNCTIONALITY", + SetupL, UT_NewL, Teardown) + +EUNIT_TEST( + "Session - test ", + "CMusEngSessionManager", + "Session", + "FUNCTIONALITY", + SetupL, UT_SessionL, Teardown) + +EUNIT_TEST( + "IsFeatureSupported - test ", + "CMusEngSessionManager", + "IsFeatureSupported", + "FUNCTIONALITY", + SetupL, UT_IsFeatureSupportedL, Teardown) + +EUNIT_TEST( + "CreateMusSessionL - test ", + "CMusEngSessionManager", + "CreateMusSessionL", + "FUNCTIONALITY", + SetupL, UT_CreateMusSessionL, Teardown) + +EUNIT_TEST( + "PropertyChanged - test ", + "CMusEngSessionManager", + "PropertyChanged", + "FUNCTIONALITY", + SetupL, UT_PropertyChangedL, Teardown) + +EUNIT_END_TEST_TABLE + + +// END OF FILE + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/tsrc/ut_engine/src/ut_musengsipprofilehandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/tsrc/ut_engine/src/ut_musengsipprofilehandler.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,417 @@ +/* +* 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: +* +*/ + + +// INTERNAL INCLUDES +#include "ut_musengsipprofilehandler.h" +#include "mussipprofilehandler.h" +#include "musengstubs.h" +#include "musengtestdefs.h" +#include "sipprofilealrcontroller.h" + +// SYSTEM INCLUDES +#include +#include +#include + +const TUint KSipProfileId( 1 ); + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusEngSipProfileHandler* UT_CMusEngSipProfileHandler::NewL() + { + UT_CMusEngSipProfileHandler* self = UT_CMusEngSipProfileHandler::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusEngSipProfileHandler* UT_CMusEngSipProfileHandler::NewLC() + { + UT_CMusEngSipProfileHandler* self = new( ELeave ) UT_CMusEngSipProfileHandler(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusEngSipProfileHandler::~UT_CMusEngSipProfileHandler() + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// Default constructor +// ----------------------------------------------------------------------------- +// +UT_CMusEngSipProfileHandler::UT_CMusEngSipProfileHandler() + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// Second phase construct +// ----------------------------------------------------------------------------- +// +void UT_CMusEngSipProfileHandler::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngSipProfileHandler::SetupL() + { + iObserver = new( ELeave ) CMusEngObserverStub; + iProfileHandler = CMusSipProfileHandler::NewL( *iObserver ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngSipProfileHandler::Teardown() + { + delete iProfileHandler; + delete iObserver; + } + + + +// TEST CASES + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngSipProfileHandler::UT_CreateSipProfileLL() + { + // SIP profile ID zero + iProfileHandler->CreateProfileL( 0 ); + EUNIT_ASSERT( iProfileHandler->iSipProfile != NULL ) + EUNIT_ASSERT( iProfileHandler->iSipProfile == iProfileHandler->Profile() ) + EUNIT_ASSERT( iProfileHandler->iSipProfile->iIsDefaultProfile ) + + // SIP profile ID non-zero + delete iProfileHandler->iSipProfile; + iProfileHandler->iSipProfile = NULL; + iProfileHandler->CreateProfileL( KSipProfileId ); + EUNIT_ASSERT( iProfileHandler->iSipProfile != NULL ) + EUNIT_ASSERT( iProfileHandler->iSipProfile == iProfileHandler->Profile() ) + EUNIT_ASSERT( !iProfileHandler->iSipProfile->iIsDefaultProfile ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngSipProfileHandler::UT_ProfileIdL() + { + // SIP profile does not yet exist + EUNIT_ASSERT_EQUALS( 0, iProfileHandler->ProfileId() ) + + // SIP profile exists + iProfileHandler->CreateProfileL( KSipProfileId ); + EUNIT_ASSERT_EQUALS( KSipProfileId, iProfileHandler->ProfileId() ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngSipProfileHandler::UT_AlrEventL() + { + const TUint32 KSnapId( 1 ); + const TUint32 KIapId( 1 ); + + // Event is other that EIapAvailable + iProfileHandler->AlrEvent( + MSipProfileAlrObserver::EMigrationCompleted, + KSipProfileId, KSnapId, KIapId ); + EUNIT_ASSERT( + !iProfileHandler->iProfileAlrController->iAllowMigrationCalled ) + EUNIT_ASSERT( + !iProfileHandler->iProfileAlrController->iDisallowMigrationCalled ) + + // Event is EIapAvailable, SIP profile does not exist + iProfileHandler->AlrEvent( + MSipProfileAlrObserver::EIapAvailable, + KSipProfileId, KSnapId, KIapId ); + if ( !iProfileHandler->iProfileAlrController->iAllowMigrationCalled ) + { + User::Leave( KErrNoMemory ); + } + EUNIT_ASSERT( + iProfileHandler->iProfileAlrController->iAllowMigrationCalled ) + iProfileHandler->iProfileAlrController->iAllowMigrationCalled = EFalse; + EUNIT_ASSERT( + !iProfileHandler->iProfileAlrController->iDisallowMigrationCalled ) + EUNIT_ASSERT_EQUALS( + KIapId, iProfileHandler->iProfileAlrController->iLastUsedIap ) + iProfileHandler->iProfileAlrController->iLastUsedIap = 0; + + // Event is EIapAvailable, SIP profile ID does not match + iProfileHandler->CreateProfileL( KSipProfileId ); + iProfileHandler->AlrEvent( + MSipProfileAlrObserver::EIapAvailable, + KSipProfileId+1, KSnapId, KIapId ); + if ( !iProfileHandler->iProfileAlrController->iAllowMigrationCalled ) + { + User::Leave( KErrNoMemory ); + } + EUNIT_ASSERT( + iProfileHandler->iProfileAlrController->iAllowMigrationCalled ) + iProfileHandler->iProfileAlrController->iAllowMigrationCalled = EFalse; + EUNIT_ASSERT( + !iProfileHandler->iProfileAlrController->iDisallowMigrationCalled ) + EUNIT_ASSERT_EQUALS( + KIapId, iProfileHandler->iProfileAlrController->iLastUsedIap ) + iProfileHandler->iProfileAlrController->iLastUsedIap = 0; + + // Event is EIapAvailable, SIP profile ID matches, roaming not allowed + iProfileHandler->AlrEvent( + MSipProfileAlrObserver::EIapAvailable, + KSipProfileId, KSnapId, KIapId ); + if ( !iProfileHandler->iProfileAlrController->iDisallowMigrationCalled ) + { + User::Leave( KErrNoMemory ); + } + EUNIT_ASSERT( + !iProfileHandler->iProfileAlrController->iAllowMigrationCalled ) + EUNIT_ASSERT( + iProfileHandler->iProfileAlrController->iDisallowMigrationCalled ) + iProfileHandler->iProfileAlrController->iDisallowMigrationCalled = EFalse; + EUNIT_ASSERT_EQUALS( + KIapId, iProfileHandler->iProfileAlrController->iLastUsedIap ) + iProfileHandler->iProfileAlrController->iLastUsedIap = 0; + + // Event is EIapAvailable, SIP profile ID matches, roaming not allowed + iObserver->iRoamingBetweenAPsAllowed = ETrue; + iProfileHandler->AlrEvent( + MSipProfileAlrObserver::EIapAvailable, + KSipProfileId, KSnapId, KIapId ); + if ( !iProfileHandler->iProfileAlrController->iAllowMigrationCalled ) + { + User::Leave( KErrNoMemory ); + } + EUNIT_ASSERT( + iProfileHandler->iProfileAlrController->iAllowMigrationCalled ) + iProfileHandler->iProfileAlrController->iAllowMigrationCalled = EFalse; + EUNIT_ASSERT( + !iProfileHandler->iProfileAlrController->iDisallowMigrationCalled ) + EUNIT_ASSERT_EQUALS( + KIapId, iProfileHandler->iProfileAlrController->iLastUsedIap ) + iProfileHandler->iProfileAlrController->iLastUsedIap = 0; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngSipProfileHandler::UT_NullTestsL() + { + // Dummies + + CSIPTransactionBase transactionBase; + CSIPServerTransaction serverTransaction; + CSIPDialog dialog; + CSIPClientTransaction clientTransaction; + CSIPDialogAssocBase dialogAssocBase; + CSIPRegistrationBinding registrationBinding; + CSIPRefresh refresh; + + // Tests + + iProfileHandler->ProfileRegistryErrorOccurred( 0, 0 ); + iProfileHandler->IncomingRequest( 0, NULL ); + iProfileHandler->TimedOut( serverTransaction ); + iProfileHandler->IncomingRequest( NULL ); + iProfileHandler->IncomingRequest( NULL, dialog ); + iProfileHandler->IncomingResponse( clientTransaction ); + iProfileHandler->IncomingResponse( clientTransaction, dialogAssocBase ); + iProfileHandler->IncomingResponse( clientTransaction, NULL ); + iProfileHandler->IncomingResponse( clientTransaction, registrationBinding ); + iProfileHandler->ErrorOccured( 0, transactionBase ); + iProfileHandler->ErrorOccured( 0, clientTransaction, registrationBinding ); + iProfileHandler->ErrorOccured( 0, transactionBase, dialogAssocBase ); + iProfileHandler->ErrorOccured( 0, refresh ); + iProfileHandler->ErrorOccured( 0, registrationBinding ); + iProfileHandler->ErrorOccured( 0, dialogAssocBase ); + iProfileHandler->InviteCompleted( clientTransaction ); + iProfileHandler->InviteCanceled( serverTransaction ); + iProfileHandler->ConnectionStateChanged( CSIPConnection::EInit ); + iProfileHandler->AlrError( KErrGeneral, 0, 0, 0 ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngSipProfileHandler::UT_UserFromProfileLCL() + { + iProfileHandler->CreateProfileL( KSipProfileId ); + CSIPProfile* profile = iProfileHandler->Profile(); + delete profile->iArray; + profile->iArray = NULL; + + // no aors -> leave with KErrArgument + TRAPD( err, iProfileHandler->UserFromProfileLC() ) + EUNIT_ASSERT_EQUALS( KErrArgument, err ) + + // create aors -> user found + _LIT8( KUserUri, "sip:user@domain.com" ); + profile->iArray = new ( ELeave ) CDesC8ArrayFlat( 1 ); + profile->iArray->AppendL( KUserUri ); + + CUri8* user = iProfileHandler->UserFromProfileLC(); + + EUNIT_ASSERT_EQUALS( KUserUri(), user->Uri().UriDes() ) + + CleanupStack::PopAndDestroy( user ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngSipProfileHandler::UT_IsRegisteredL() + { + EUNIT_ASSERT( !iProfileHandler->IsRegistered( ) ) + iProfileHandler->CreateProfileL( KSipProfileId ); + EUNIT_ASSERT( iProfileHandler->IsRegistered( ) ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngSipProfileHandler::UT_ProfileRegistryEventOccurredL() + { + // No profile yet + iProfileHandler->ProfileRegistryEventOccurred( 0, + MSIPProfileRegistryObserver::EProfileRegistered ); + EUNIT_ASSERT( iObserver->IsReseted() ) + + // Create profile, but notify about registration of some other profile + iProfileHandler->CreateProfileL( 1 ); + iProfileHandler->ProfileRegistryEventOccurred( 2, + MSIPProfileRegistryObserver::EProfileRegistered ); + EUNIT_ASSERT( iObserver->IsReseted() ) + + // Normal case + iProfileHandler->ProfileRegistryEventOccurred( 1, + MSIPProfileRegistryObserver::EProfileRegistered ); + EUNIT_ASSERT( iObserver->iProfileRegisteredCalled ) + iObserver->Reset(); + + // React exclusively to EProfileRegistered + iProfileHandler->ProfileRegistryEventOccurred( 1, + MSIPProfileRegistryObserver::EProfileCreated ); + EUNIT_ASSERT( iObserver->IsReseted() ) + iProfileHandler->ProfileRegistryEventOccurred( 1, + MSIPProfileRegistryObserver::EProfileUpdated ); + EUNIT_ASSERT( iObserver->IsReseted() ) + iProfileHandler->ProfileRegistryEventOccurred( 1, + MSIPProfileRegistryObserver::EProfileDeregistered ); + EUNIT_ASSERT( iObserver->IsReseted() ) + iProfileHandler->ProfileRegistryEventOccurred( 1, + MSIPProfileRegistryObserver::EProfileDestroyed ); + EUNIT_ASSERT( iObserver->IsReseted() ) + } + + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusEngSipProfileHandler, + "UT_CMusEngSipProfileHandler", + "UNIT" ) + +EUNIT_TEST( + "CreateSipProfileL - test ", + "CMusSipProfileHandler", + "CreateSipProfileL", + "FUNCTIONALITY", + SetupL, UT_CreateSipProfileLL, Teardown) + +EUNIT_TEST( + "ProfileId - test ", + "CMusSipProfileHandler", + "ProfileId", + "FUNCTIONALITY", + SetupL, UT_ProfileIdL, Teardown) + +EUNIT_TEST( + "AlrEventL - test ", + "CMusEngSipProfileHandler", + "AlrEventL", + "FUNCTIONALITY", + SetupL, UT_AlrEventL, Teardown) + +EUNIT_TEST( + "Null tests for NOP functions", + "CMusEngSipProfileHandler", + "Several NOP functions", + "FUNCTIONALITY", + SetupL, UT_NullTestsL, Teardown) + +EUNIT_TEST( + "UserFromProfileLC - test ", + "CMusEngSipProfileHandler", + "UserFromProfileLC", + "FUNCTIONALITY", + SetupL, UT_UserFromProfileLCL, Teardown) + +EUNIT_TEST( + "IsRegistered - test ", + "CMusEngSipProfileHandler", + "IsRegistered", + "FUNCTIONALITY", + SetupL, UT_IsRegisteredL, Teardown) + +EUNIT_TEST( + "ProfileRegistryEventOccurred - test ", + "CMusEngSipProfileHandler", + "ProfileRegistryEventOccurred", + "FUNCTIONALITY", + SetupL, UT_ProfileRegistryEventOccurredL, Teardown) + +EUNIT_END_TEST_TABLE + +// END OF FILE + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/tsrc/ut_engine/src/ut_musengtelephoneutils.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/tsrc/ut_engine/src/ut_musengtelephoneutils.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,511 @@ +/* +* 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: +* +*/ + + +// INTERNAL INCLUDES +#include "telephonyaudiorouting.h" +#include "ut_musengtelephoneutils.h" +#include "musengstubs.h" +#include "musengtestdefs.h" + +#include "musengtelephoneutils.h" + +// SYSTEM INCLUDES +#include +#include +#include + + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusEngTelephoneUtils* UT_CMusEngTelephoneUtils::NewL() + { + UT_CMusEngTelephoneUtils* self = UT_CMusEngTelephoneUtils::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusEngTelephoneUtils* UT_CMusEngTelephoneUtils::NewLC() + { + UT_CMusEngTelephoneUtils* self = new( ELeave ) UT_CMusEngTelephoneUtils(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusEngTelephoneUtils::~UT_CMusEngTelephoneUtils() + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// Default constructor +// ----------------------------------------------------------------------------- +// +UT_CMusEngTelephoneUtils::UT_CMusEngTelephoneUtils() + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// Second phase construct +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTelephoneUtils::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTelephoneUtils::SetupL() + { + iObserver = new( ELeave ) CMusEngObserverStub; + iTelephoneUtils = CMusEngTelephoneUtils::NewL( *iObserver ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTelephoneUtils::Teardown() + { + delete iTelephoneUtils; + iTelephoneUtils = NULL; + delete iObserver; + iObserver = NULL; + PropertyHelper::Close(); + } + + +// TEST CASES + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTelephoneUtils::UT_NewLL() + { + EUNIT_ASSERT( iTelephoneUtils ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTelephoneUtils::UT_AudioRoutingCanBeChangedL() + { + iTelephoneUtils->iTelephonyAudioRouting->iCurrentOutput = + CTelephonyAudioRouting::ENotActive; + EUNIT_ASSERT( iTelephoneUtils->AudioRoutingCanBeChanged() ); + + iTelephoneUtils->iTelephonyAudioRouting->iCurrentOutput = + CTelephonyAudioRouting::ENone; + EUNIT_ASSERT( iTelephoneUtils->AudioRoutingCanBeChanged() ); + + iTelephoneUtils->iTelephonyAudioRouting->iCurrentOutput = + CTelephonyAudioRouting::EHandset; + EUNIT_ASSERT( iTelephoneUtils->AudioRoutingCanBeChanged() ); + + iTelephoneUtils->iTelephonyAudioRouting->iCurrentOutput = + CTelephonyAudioRouting::ELoudspeaker; + EUNIT_ASSERT( iTelephoneUtils->AudioRoutingCanBeChanged() ); + + iTelephoneUtils->iTelephonyAudioRouting->iCurrentOutput = + CTelephonyAudioRouting::EWiredAudioAccessory; + EUNIT_ASSERT( !iTelephoneUtils->AudioRoutingCanBeChanged() ); + + iTelephoneUtils->iTelephonyAudioRouting->iCurrentOutput = + CTelephonyAudioRouting::EBTAudioAccessory; + EUNIT_ASSERT( !iTelephoneUtils->AudioRoutingCanBeChanged() ); + + iTelephoneUtils->iTelephonyAudioRouting->iCurrentOutput = + CTelephonyAudioRouting::ETTY; + EUNIT_ASSERT( !iTelephoneUtils->AudioRoutingCanBeChanged() ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTelephoneUtils::UT_LoudspeakerLL() + { + // Precondition of test + iTelephoneUtils->iTelephonyAudioRouting->iCurrentOutput = + CTelephonyAudioRouting::EHandset; + + // Set loudspeaker on, succeeds + iTelephoneUtils->LoudspeakerL( ETrue ); + EUNIT_ASSERT( iTelephoneUtils->iTelephonyAudioRouting->iCurrentOutput == + CTelephonyAudioRouting::ELoudspeaker ); + EUNIT_ASSERT( iTelephoneUtils->iTelephonyAudioRouting->iShowNoteMode == + EFalse ); + + // Change conditions + iTelephoneUtils->iTelephonyAudioRouting->iCurrentOutput = + CTelephonyAudioRouting::EWiredAudioAccessory; + + // Try to set loudspeaker on, fails because current set is not handset + iTelephoneUtils->LoudspeakerL( ETrue ); + EUNIT_ASSERT( iTelephoneUtils->iTelephonyAudioRouting->iCurrentOutput == + CTelephonyAudioRouting::EWiredAudioAccessory ); + + // Change conditions + iTelephoneUtils->iTelephonyAudioRouting->iCurrentOutput = + CTelephonyAudioRouting::ELoudspeaker; + iTelephoneUtils->iAudioOutputAtStartup = + CTelephonyAudioRouting::ELoudspeaker; + + // Try to set loudspeaker off, goes to handset + iTelephoneUtils->LoudspeakerL( EFalse ); + EUNIT_ASSERT( iTelephoneUtils->iTelephonyAudioRouting->iCurrentOutput == + CTelephonyAudioRouting::EHandset ); + + // Change conditions + iTelephoneUtils->iTelephonyAudioRouting->iCurrentOutput = + CTelephonyAudioRouting::ELoudspeaker; + iTelephoneUtils->iAudioOutputAtStartup = + CTelephonyAudioRouting::EWiredAudioAccessory; + + // Try to set loudspeaker off, goes to wired + iTelephoneUtils->LoudspeakerL( EFalse ); + EUNIT_ASSERT( iTelephoneUtils->iTelephonyAudioRouting->iCurrentOutput == + CTelephonyAudioRouting::EWiredAudioAccessory ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTelephoneUtils::UT_IsLoudSpeakerEnabledL() + { + iTelephoneUtils->iTelephonyAudioRouting->iCurrentOutput = + CTelephonyAudioRouting::ELoudspeaker; + EUNIT_ASSERT( iTelephoneUtils->IsLoudSpeakerEnabled() ); + + iTelephoneUtils->iTelephonyAudioRouting->iCurrentOutput = + CTelephonyAudioRouting::EHandset; + EUNIT_ASSERT( !iTelephoneUtils->IsLoudSpeakerEnabled() ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTelephoneUtils::UT_GetVolumeLL() + { + TInt volume = 0; + + volume = iTelephoneUtils->GetVolumeL(); + EUNIT_ASSERT( volume == 4 ); + + iTelephoneUtils->iTelephonyAudioRouting->iCurrentOutput = + CTelephonyAudioRouting::ELoudspeaker; + iTelephoneUtils->iRepository->Set( KTelIncallLoudspeakerVolume, 8 ); + + volume = iTelephoneUtils->GetVolumeL(); + EUNIT_ASSERT( volume == 8 ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTelephoneUtils::UT_SetVolumeLL() + { + TInt handsetVolume = 0; + TInt loudSpeakerVolume = 0; + + // Try with current value, does nothing + iTelephoneUtils->SetVolumeL( 4 ); + + iTelephoneUtils->iRepository->Get( KTelIncallEarVolume, + handsetVolume ); + EUNIT_ASSERT( handsetVolume == 4 ); + + // Try to change handset volume + iTelephoneUtils->SetVolumeL( 5 ); + + iTelephoneUtils->iRepository->Get( KTelIncallEarVolume, + handsetVolume ); + EUNIT_ASSERT( handsetVolume == 5 ); + + iTelephoneUtils->iRepository->Get( KTelIncallLoudspeakerVolume, + loudSpeakerVolume ); + EUNIT_ASSERT( loudSpeakerVolume == 4 ); + + // Try to change loudspeaker volume + iTelephoneUtils->iTelephonyAudioRouting->iCurrentOutput = + CTelephonyAudioRouting::ELoudspeaker; + + iTelephoneUtils->SetVolumeL( 3 ); + + iTelephoneUtils->iRepository->Get( KTelIncallEarVolume, + handsetVolume ); + EUNIT_ASSERT( handsetVolume == 5 ); + + iTelephoneUtils->iRepository->Get( KTelIncallLoudspeakerVolume, + loudSpeakerVolume ); + EUNIT_ASSERT( loudSpeakerVolume == 3 ); + + // Check that volume gets validated + + iTelephoneUtils->SetVolumeL( 100 ); + + iTelephoneUtils->iRepository->Get( KTelIncallLoudspeakerVolume, + loudSpeakerVolume ); + EUNIT_ASSERT( loudSpeakerVolume == 10 ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTelephoneUtils::UT_AvailableOutputsChangedL() + { + // At the monent function is expected to do nothing so just + // call it to avoid coverage loss. + iTelephoneUtils->AvailableOutputsChanged( + *iTelephoneUtils->iTelephonyAudioRouting ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTelephoneUtils::UT_OutputChangedL() + { + // Loudspeaker + iTelephoneUtils->iAudioOutputAtStartup = CTelephonyAudioRouting::EHandset; + + iTelephoneUtils->iTelephonyAudioRouting->iCurrentOutput = + CTelephonyAudioRouting::ELoudspeaker; + + iTelephoneUtils->OutputChanged( *iTelephoneUtils->iTelephonyAudioRouting ); + + EUNIT_ASSERT_EQUALS( iTelephoneUtils->iAudioOutputAtStartup, + CTelephonyAudioRouting::ELoudspeaker ) + EUNIT_ASSERT( iObserver->iAudioRoutingChangedCalled ) + + // Handset + iTelephoneUtils->iTelephonyAudioRouting->iCurrentOutput = + CTelephonyAudioRouting::EHandset; + + iTelephoneUtils->OutputChanged( *iTelephoneUtils->iTelephonyAudioRouting ); + + EUNIT_ASSERT_EQUALS( iTelephoneUtils->iAudioOutputAtStartup, + CTelephonyAudioRouting::EHandset ) + + EUNIT_ASSERT( iObserver->iAudioRoutingChangedCalled ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTelephoneUtils::UT_SetOutputCompleteL() + { + // Setoutput fails + iTelephoneUtils->SetOutputComplete( + *iTelephoneUtils->iTelephonyAudioRouting, + KErrGeneral ); + EUNIT_ASSERT( !iObserver->iAudioRoutingChangedCalled ) + iObserver->Reset(); + + // Setoutput ok + iTelephoneUtils->SetOutputComplete( + *iTelephoneUtils->iTelephonyAudioRouting, + KErrNone ); + EUNIT_ASSERT( iObserver->iAudioRoutingChangedCalled ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTelephoneUtils::UT_ValidateVolumeL() + { + EUNIT_ASSERT( iTelephoneUtils->ValidateVolume( 0 ) == 0 ); + EUNIT_ASSERT( iTelephoneUtils->ValidateVolume( 11 ) == 10 ); + EUNIT_ASSERT( iTelephoneUtils->ValidateVolume( 5 ) == 5 ); + } + +// ----------------------------------------------------------------------------- +// We cannot assert anything after destruction. All we can do is to make +// such condition before destruction that coverage will be achieved. +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTelephoneUtils::UT_DestructorL() + { + // Simulate that 2nd phase construction has not succeeded + CMusEngTelephoneUtils* utils = CMusEngTelephoneUtils::NewL( *iObserver ); + CleanupStack::PushL( utils ); + delete utils->iTelephonyAudioRouting; + utils->iTelephonyAudioRouting = NULL; + CleanupStack::PopAndDestroy( utils ); + + // Simulate that current audio output mode is same as original + utils = CMusEngTelephoneUtils::NewL( *iObserver ); + CleanupStack::PushL( utils ); + utils->iAudioOutputAtStartup = CTelephonyAudioRouting::EHandset; + utils->iTelephonyAudioRouting->iCurrentOutput = + CTelephonyAudioRouting::EHandset; + CleanupStack::PopAndDestroy( utils ); + + // Simulate that current audio output mode is not the same as original, + // Setting fails + utils = CMusEngTelephoneUtils::NewL( *iObserver ); + CleanupStack::PushL( utils ); + utils->iAudioOutputAtStartup = CTelephonyAudioRouting::EHandset; + utils->iTelephonyAudioRouting->iCurrentOutput = + CTelephonyAudioRouting::ELoudspeaker; + utils->iTelephonyAudioRouting->iForceFailWithCode = KErrGeneral; + CleanupStack::PopAndDestroy( utils ); + + // Simulate that current audio output mode is not the same as original, + // Setting succeeds + utils = CMusEngTelephoneUtils::NewL( *iObserver ); + CleanupStack::PushL( utils ); + utils->iAudioOutputAtStartup = CTelephonyAudioRouting::EHandset; + utils->iTelephonyAudioRouting->iCurrentOutput = + CTelephonyAudioRouting::ELoudspeaker; + CleanupStack::PopAndDestroy( utils ); + + // Simulate that current audio output mode is not the same as original, + // Setting does not succeed as observer does not allow changes anymore + utils = CMusEngTelephoneUtils::NewL( *iObserver ); + CleanupStack::PushL( utils ); + utils->iAudioOutputAtStartup = CTelephonyAudioRouting::EHandset; + utils->iTelephonyAudioRouting->iCurrentOutput = + CTelephonyAudioRouting::ELoudspeaker; + CleanupStack::PopAndDestroy( utils ); + // Cannot really assert anything + } + + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusEngTelephoneUtils, + "UT_CMusEngTelephoneUtils", + "UNIT" ) + +EUNIT_TEST( + "NewL - test ", + "CMusEngTelephoneUtils", + "NewL", + "FUNCTIONALITY", + SetupL, UT_NewLL, Teardown) + +EUNIT_TEST( + "AudioRoutingCanBeChanged - test ", + "CMusEngTelephoneUtils", + "AudioRoutingCanBeChanged", + "FUNCTIONALITY", + SetupL, UT_AudioRoutingCanBeChangedL, Teardown) + +EUNIT_TEST( + "LoudspeakerL - test ", + "CMusEngTelephoneUtils", + "LoudspeakerL", + "FUNCTIONALITY", + SetupL, UT_LoudspeakerLL, Teardown) + +EUNIT_TEST( + "IsLoudSpeakerEnabled - test ", + "CMusEngTelephoneUtils", + "IsLoudSpeakerEnabled", + "FUNCTIONALITY", + SetupL, UT_IsLoudSpeakerEnabledL, Teardown) + +EUNIT_TEST( + "GetVolumeL - test ", + "CMusEngTelephoneUtils", + "GetVolumeL", + "FUNCTIONALITY", + SetupL, UT_GetVolumeLL, Teardown) + +EUNIT_TEST( + "SetVolumeL - test ", + "CMusEngTelephoneUtils", + "SetVolumeL", + "FUNCTIONALITY", + SetupL, UT_SetVolumeLL, Teardown) + +EUNIT_TEST( + "AvailableOutputsChanged - test ", + "CMusEngTelephoneUtils", + "AvailableOutputsChanged", + "FUNCTIONALITY", + SetupL, UT_AvailableOutputsChangedL, Teardown) + +EUNIT_TEST( + "OutputChanged - test ", + "CMusEngTelephoneUtils", + "OutputChanged", + "FUNCTIONALITY", + SetupL, UT_OutputChangedL, Teardown) + +EUNIT_TEST( + "SetOutputComplete - test ", + "CMusEngTelephoneUtils", + "SetOutputComplete", + "FUNCTIONALITY", + SetupL, UT_SetOutputCompleteL, Teardown) + +EUNIT_TEST( + "ValidateVolume - test ", + "CMusEngTelephoneUtils", + "ValidateVolume", + "FUNCTIONALITY", + SetupL, UT_ValidateVolumeL, Teardown) + +EUNIT_TEST( + "Destructor - test ", + "CMusEngTelephoneUtils", + "Destructor", + "FUNCTIONALITY", + SetupL, UT_DestructorL, Teardown) + + + +EUNIT_END_TEST_TABLE + +// END OF FILE + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/tsrc/ut_engine/src/ut_musengtwowayrecvsession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/tsrc/ut_engine/src/ut_musengtwowayrecvsession.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,1582 @@ +/* +* 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: +* +*/ + + +// INTERNAL INCLUDES +#include "ut_musengtwowayrecvsession.h" +#include "musengstubs.h" +#include "musengtestdefs.h" +#include "musengtwowayrecvsession.h" +#include "musengmceutils.h" +#include "mussessionproperties.h" +#include "contactenginestub.h" +#include "musenglivevideoplayer.h" + +// SYSTEM INCLUDES +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +// Incoming session may be rejected silently due memory running out. Ensure that +// incoming session was handled fully by using this macro. +#define MUSENG_TEST_ASSERT_INCOMING_SESSION_ALLOC_FAILURE_L \ +__ASSERT_ALWAYS( iReceiveSession->iSession && \ +iReceiveSession->iSession->iState != CMceSession::ETerminated, User::Leave( KErrNoMemory ) ); + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusEngTwoWayRecvSession* UT_CMusEngTwoWayRecvSession::NewL() + { + UT_CMusEngTwoWayRecvSession* self = UT_CMusEngTwoWayRecvSession::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusEngTwoWayRecvSession* UT_CMusEngTwoWayRecvSession::NewLC() + { + UT_CMusEngTwoWayRecvSession* self = new( ELeave ) UT_CMusEngTwoWayRecvSession(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusEngTwoWayRecvSession::~UT_CMusEngTwoWayRecvSession() + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// Default constructor +// ----------------------------------------------------------------------------- +// +UT_CMusEngTwoWayRecvSession::UT_CMusEngTwoWayRecvSession() + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// Second phase construct +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTwoWayRecvSession::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTwoWayRecvSession::SetupL( ) + { + iLcSessionObserver = new( ELeave )CLcSessionObserverStub; + iReceiveSession = CMusEngTwoWayRecvSession::NewL(); + iReceiveSession->SetLcSessionObserver( iLcSessionObserver ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTwoWayRecvSession::Teardown( ) + { + delete iReceiveSession; + delete iLcSessionObserver; + PropertyHelper::Close(); + } + + +// TEST HELPERS + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMceVideoStream* UT_CMusEngTwoWayRecvSession::ConstructVideoInStreamLC() + { + CMceVideoStream* videoStream = CMceVideoStream::NewLC(); + + videoStream->SetSourceL( CMceRtpSource::NewLC() ); + CleanupStack::Pop(); + + videoStream->AddSinkL( + CMceDisplaySink::NewLC( *iReceiveSession->iManager ) ); + CleanupStack::Pop(); + + return videoStream; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMceVideoStream* UT_CMusEngTwoWayRecvSession::ConstructVideoOutStreamLC() + { + CMceVideoStream* videoStream = CMceVideoStream::NewLC(); + + videoStream->SetSourceL( + CMceCameraSource::NewLC( *iReceiveSession->iManager ) ); + CleanupStack::Pop(); + + videoStream->AddSinkL( CMceRtpSink::NewLC() ); + CleanupStack::Pop(); + + return videoStream; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMceAudioStream* UT_CMusEngTwoWayRecvSession::ConstructAudioInStreamLC() + { + CMceAudioStream* audioStream = CMceAudioStream::NewLC(); + + audioStream->SetSourceL( CMceRtpSource::NewLC() ); + CleanupStack::Pop(); + + audioStream->AddSinkL( CMceSpeakerSink::NewLC() ); + CleanupStack::Pop(); + + return audioStream; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMceAudioStream* UT_CMusEngTwoWayRecvSession::ConstructAudioOutStreamLC() + { + CMceAudioStream* audioStream = CMceAudioStream::NewLC(); + + audioStream->SetSourceL( + CMceFileSource::NewLC( *iReceiveSession->iManager, KNullDesC() ) ); + CleanupStack::Pop(); + + audioStream->AddSinkL( CMceRtpSink::NewLC() ); + CleanupStack::Pop(); + + return audioStream; + + } + + +// ----------------------------------------------------------------------------- +// Helper to construct incoming sessions. +// ----------------------------------------------------------------------------- +// +CMceInSession* UT_CMusEngTwoWayRecvSession::ConstructInSessionLC( + TInt aVideoStreamCount, + TInt aAudioStreamCount, + TBool aConstructSinks ) + { + CMceInSession* inSession = CMceInSession::NewL( + *(iReceiveSession->iManager), + KTestOriginator() ); + CleanupStack::PushL( inSession ); + + for ( TInt i = 0; i < aVideoStreamCount; ++i ) + { + CMceVideoStream* videoStream = CMceVideoStream::NewLC(); + + CMceRtpSource* rtpSource = CMceRtpSource::NewLC(); + videoStream->SetSourceL( rtpSource ); + CleanupStack::Pop( rtpSource ); + + if ( aConstructSinks ) + { + CMceDisplaySink* display = CMceDisplaySink::NewLC( + *(iReceiveSession->iManager) ); + videoStream->AddSinkL( display ); + CleanupStack::Pop( display ); + } + + inSession->AddStreamL( videoStream ); + CleanupStack::Pop( videoStream ); + } + + for ( TInt i = 0; i < aAudioStreamCount; ++i ) + { + CMceAudioStream* audioStream = CMceAudioStream::NewLC(); + + CMceRtpSource* rtpSource = CMceRtpSource::NewLC(); + audioStream->SetSourceL( rtpSource ); + CleanupStack::Pop( rtpSource ); + + if ( aConstructSinks ) + { + CMceSpeakerSink* speaker = CMceSpeakerSink::NewLC(); + audioStream->AddSinkL( speaker ); + CleanupStack::Pop( speaker ); + } + + inSession->AddStreamL( audioStream ); + CleanupStack::Pop( audioStream ); + } + + return inSession; + } + +// ----------------------------------------------------------------------------- +// Helper to construct incoming two-way video session. +// ----------------------------------------------------------------------------- +// +CMceInSession* UT_CMusEngTwoWayRecvSession::ConstructTwoWayInSessionLC( TBool aConstructSinks ) + { + CMceInSession* inSession = CMceInSession::NewL( + *(iReceiveSession->iManager), + KTestOriginator() ); + CleanupStack::PushL( inSession ); + + CMceVideoStream* videoStream = CMceVideoStream::NewLC(); + + CMceRtpSource* rtpSource = CMceRtpSource::NewLC(); + videoStream->SetSourceL( rtpSource ); + CleanupStack::Pop( rtpSource ); + + if ( aConstructSinks ) + { + CMceDisplaySink* display = CMceDisplaySink::NewLC( + *(iReceiveSession->iManager) ); + videoStream->AddSinkL( display ); + CleanupStack::Pop( display ); + } + + CMceVideoStream* videoOutStream = CMceVideoStream::NewLC(); + + CMceCameraSource* cameraSource = CMceCameraSource::NewLC( *(iReceiveSession->iManager) ); + videoOutStream->SetSourceL( cameraSource ); + CleanupStack::Pop( cameraSource ); + + if ( aConstructSinks ) + { + CMceRtpSink* rtpSink = CMceRtpSink::NewLC(); + videoOutStream->AddSinkL( rtpSink ); + CleanupStack::Pop( rtpSink ); + } + videoStream->BindL( videoOutStream ); + CleanupStack::Pop( videoOutStream ); + + inSession->AddStreamL( videoStream ); + CleanupStack::Pop( videoStream ); + + return inSession; + } + + +// TEST CASES + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTwoWayRecvSession::UT_NewLL( ) + { + EUNIT_ASSERT( iReceiveSession ); + EUNIT_ASSERT( !iReceiveSession->iSession ); + EUNIT_ASSERT( iReceiveSession->iMceManagerUid == + TUid::Uid(CMusManager::ESipInviteDesired2WayVideo) ); + } + + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTwoWayRecvSession::UT_EnableDisplayLL() + { + TRAPD( error, iReceiveSession->EnableDisplayL( ETrue ) ); + MUS_TEST_FORWARD_ALLOC_FAILURE( error ); + EUNIT_ASSERT( error == KErrNotReady ); + + TMceTransactionDataContainer container; + CMceInSession* inSession = ConstructTwoWayInSessionLC(); + iReceiveSession->IncomingSession( inSession, &container ); + CleanupStack::Pop( inSession ); + MUSENG_TEST_ASSERT_INCOMING_SESSION_ALLOC_FAILURE_L + + CMceDisplaySink* display = + MusEngMceUtils::GetDisplayL( *(iReceiveSession->iSession) ); + + CMceDisplaySink* receivingDisplay = + MusEngMceUtils::GetReceivingDisplayL( *iReceiveSession->iSession ); + + // Disable + iReceiveSession->EnableDisplayL( EFalse ); + + EUNIT_ASSERT( !display->iIsEnabled ); + EUNIT_ASSERT( !receivingDisplay->iIsEnabled ); + + // Try to disable again, request should be ignored + + iReceiveSession->EnableDisplayL( EFalse ); + + EUNIT_ASSERT( !display->iIsEnabled ); + EUNIT_ASSERT( !receivingDisplay->iIsEnabled ); + + // Enable + + iReceiveSession->EnableDisplayL( ETrue ); + + EUNIT_ASSERT( display->iIsEnabled ); + EUNIT_ASSERT( receivingDisplay->iIsEnabled ); + + // Try to enable again, request should be ignored + + iReceiveSession->EnableDisplayL( ETrue ); + + EUNIT_ASSERT( display->iIsEnabled ); + EUNIT_ASSERT( receivingDisplay->iIsEnabled ); + + // Session does not have sending stream (viewfinder does not exist) + // + delete iReceiveSession->iSession; + iReceiveSession->iSession = NULL; + inSession = ConstructInSessionLC( 1, 0 ); + iReceiveSession->IncomingSession( inSession, &container ); + CleanupStack::Pop( inSession ); + display = MusEngMceUtils::GetVfDisplay( *(iReceiveSession->iSession) ); + EUNIT_ASSERT( display == NULL ); + receivingDisplay = MusEngMceUtils::GetReceivingDisplayL( *iReceiveSession->iSession ); + iReceiveSession->EnableDisplayL( EFalse ); + EUNIT_ASSERT( !receivingDisplay->iIsEnabled ); + + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTwoWayRecvSession::UT_SetOrientationLL() + { + // Try without session, fails + EUNIT_ASSERT_SPECIFIC_LEAVE( iReceiveSession->SetOrientationL( + CMusEngMceSession::EPortrait ), + KErrNotReady ) + + TMceTransactionDataContainer container; + CMceInSession* inSession = ConstructTwoWayInSessionLC(); + iReceiveSession->IncomingSession( inSession, &container ); + CleanupStack::Pop( inSession ); + MUSENG_TEST_ASSERT_INCOMING_SESSION_ALLOC_FAILURE_L + + CMceDisplaySink* display = + MusEngMceUtils::GetDisplayL( *iReceiveSession->iSession ); + + CMceDisplaySink* receivingDisplay = + MusEngMceUtils::GetReceivingDisplayL( *iReceiveSession->iSession ); + + + // Check the initial state + display->iRotation = CMceDisplaySink::ENone; + receivingDisplay->iRotation = CMceDisplaySink::ENone; + EUNIT_ASSERT_EQUALS( iReceiveSession->OrientationL(), + CMusEngMceSession::EPortrait ) + + // Successfully change orientation + + iReceiveSession->SetOrientationL( CMusEngMceSession::ELandscape ); + EUNIT_ASSERT_EQUALS( iReceiveSession->OrientationL(), + CMusEngMceSession::ELandscape ) + + EUNIT_ASSERT_EQUALS( display->iRotation, CMceDisplaySink::EClockwise90Degree ); + EUNIT_ASSERT_EQUALS( receivingDisplay->iRotation, CMceDisplaySink::EClockwise90Degree ); + + iReceiveSession->SetOrientationL( CMusEngMceSession::EPortrait ); + EUNIT_ASSERT_EQUALS( iReceiveSession->OrientationL(), + CMusEngMceSession::EPortrait ) + + EUNIT_ASSERT_EQUALS( display->iRotation, CMceDisplaySink::ENone ); + EUNIT_ASSERT_EQUALS( receivingDisplay->iRotation, CMceDisplaySink::ENone ); + + // Session does not have sending stream (viewfinder does not exist) + delete iReceiveSession->iSession; + iReceiveSession->iSession = NULL; + inSession = ConstructInSessionLC( 1, 0 ); + iReceiveSession->IncomingSession( inSession, &container ); + CleanupStack::Pop( inSession ); + MUSENG_TEST_ASSERT_INCOMING_SESSION_ALLOC_FAILURE_L + display = MusEngMceUtils::GetVfDisplay( *(iReceiveSession->iSession) ); + EUNIT_ASSERT( display == NULL ); + receivingDisplay = MusEngMceUtils::GetReceivingDisplayL( *iReceiveSession->iSession ); + iReceiveSession->SetOrientationL( CMusEngMceSession::ELandscape ); + EUNIT_ASSERT_EQUALS( receivingDisplay->iRotation, CMceDisplaySink::EClockwise90Degree ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTwoWayRecvSession::UT_OrientationLL() + { + // Try without session, fails + EUNIT_ASSERT_SPECIFIC_LEAVE( iReceiveSession->OrientationL(), + KErrNotReady ) + + TMceTransactionDataContainer container; + CMceInSession* inSession = ConstructTwoWayInSessionLC(); + iReceiveSession->IncomingSession( inSession, &container ); + CleanupStack::Pop( inSession ); + MUSENG_TEST_ASSERT_INCOMING_SESSION_ALLOC_FAILURE_L + + CMceDisplaySink* receivingDisplay = + MusEngMceUtils::GetReceivingDisplayL( *iReceiveSession->iSession ); + receivingDisplay->iRotation = CMceDisplaySink::ENone; + + EUNIT_ASSERT_EQUALS( iReceiveSession->OrientationL(), + CMusEngMceSession::EPortrait ) + + receivingDisplay->iRotation = CMceDisplaySink::EClockwise90Degree; + + EUNIT_ASSERT_EQUALS( iReceiveSession->OrientationL(), + CMusEngMceSession::ELandscape ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTwoWayRecvSession::UT_SetLocalRectLL() + { + // Does nothing real before session establishment + TRect rect1( 100, 200, 300, 500 ); + iReceiveSession->SetSecondaryRectL( rect1 ); + + EUNIT_ASSERT( rect1 == iReceiveSession->iLocalRect ); + + // Local rect changing affects to viewfinder display sink not to receiving video + // + TMceTransactionDataContainer container; + CMceInSession* inSession = ConstructTwoWayInSessionLC(); + iReceiveSession->IncomingSession( inSession, &container ); + CleanupStack::Pop( inSession ); + MUSENG_TEST_ASSERT_INCOMING_SESSION_ALLOC_FAILURE_L + + CMceDisplaySink* vfDisplay = + MusEngMceUtils::GetDisplayL( *( iReceiveSession->iSession ) ); + CMceDisplaySink* receivingDisplay = + MusEngMceUtils::GetReceivingDisplayL( *( iReceiveSession->iSession ) ); + + EUNIT_ASSERT( vfDisplay->DisplayRectL() == iReceiveSession->iLocalRect ); + EUNIT_ASSERT( receivingDisplay->DisplayRectL() != iReceiveSession->iLocalRect ); + + TRect rect2( 200, 200, 300, 500 ); + iReceiveSession->SetSecondaryRectL( rect2 ); + EUNIT_ASSERT( rect2 == iReceiveSession->iLocalRect ); + EUNIT_ASSERT( vfDisplay->DisplayRectL() == iReceiveSession->iLocalRect ); + EUNIT_ASSERT( receivingDisplay->DisplayRectL() != iReceiveSession->iLocalRect ); + + // Terminate session and try again, rect must not be changed + + iReceiveSession->iSession->iState = CMceSession::ETerminated; + + TRect rect3( 300, 300, 400, 600 ); + + iReceiveSession->SetSecondaryRectL( rect3 ); + + EUNIT_ASSERT( vfDisplay->DisplayRectL() != rect3 ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTwoWayRecvSession::UT_SetRectsLL() + { + // Does nothing real before session establishment + TRect localrect1( 100, 200, 300, 400 ); + TRect remoterect1( 100, 200, 300, 500 ); + iReceiveSession->SetRectsL( remoterect1, localrect1 ); + + EUNIT_ASSERT( localrect1 == iReceiveSession->iLocalRect ); + EUNIT_ASSERT( remoterect1 == iReceiveSession->iRect ); + + // Local rect changing affects to viewfinder display sink and remote rect to + // receiving video display sink + // + TMceTransactionDataContainer container; + CMceInSession* inSession = ConstructTwoWayInSessionLC(); + iReceiveSession->IncomingSession( inSession, &container ); + CleanupStack::Pop( inSession ); + MUSENG_TEST_ASSERT_INCOMING_SESSION_ALLOC_FAILURE_L + + CMceDisplaySink* vfDisplay = + MusEngMceUtils::GetDisplayL( *( iReceiveSession->iSession ) ); + CMceDisplaySink* receivingDisplay = + MusEngMceUtils::GetReceivingDisplayL( *( iReceiveSession->iSession ) ); + + TRect localrect2( 200, 200, 300, 400 ); + TRect remoterect2( 200, 200, 300, 500 ); + EUNIT_ASSERT( vfDisplay->DisplayRectL() != localrect2 ); + EUNIT_ASSERT( receivingDisplay->DisplayRectL() != remoterect2 ); + + iReceiveSession->SetRectsL( remoterect2, localrect2 ); + EUNIT_ASSERT( localrect2 == iReceiveSession->iLocalRect ); + EUNIT_ASSERT( remoterect2 == iReceiveSession->iRect ); + EUNIT_ASSERT( vfDisplay->DisplayRectL() == iReceiveSession->iLocalRect ); + EUNIT_ASSERT( receivingDisplay->DisplayRectL() == iReceiveSession->iRect ); + + // Terminate session and try again, rect must not be changed + + iReceiveSession->iSession->iState = CMceSession::ETerminated; + + TRect localrect3( 300, 200, 300, 400 ); + TRect remoterect3( 300, 200, 300, 500 ); + + iReceiveSession->SetRectsL( remoterect3, localrect3 ); + + EUNIT_ASSERT( vfDisplay->DisplayRectL() != localrect3 ) + EUNIT_ASSERT( receivingDisplay->DisplayRectL() != remoterect3 ); + + // Session does not have sending stream (viewfinder does not exist) + + TRect localrect4( 400, 200, 300, 400 ); + TRect remoterect4( 400, 200, 300, 500 ); + delete iReceiveSession->iSession; + iReceiveSession->iSession = NULL; + inSession = ConstructInSessionLC( 1, 0 ); + iReceiveSession->IncomingSession( inSession, &container ); + CleanupStack::Pop( inSession ); + MUSENG_TEST_ASSERT_INCOMING_SESSION_ALLOC_FAILURE_L + vfDisplay = MusEngMceUtils::GetVfDisplay( *(iReceiveSession->iSession) ); + EUNIT_ASSERT( vfDisplay == NULL ); + receivingDisplay = MusEngMceUtils::GetReceivingDisplayL( *iReceiveSession->iSession ); + iReceiveSession->SetRectsL( remoterect4, localrect4 ); + EUNIT_ASSERT( localrect4 == iReceiveSession->iLocalRect ); + EUNIT_ASSERT( remoterect4 == iReceiveSession->iRect ); + EUNIT_ASSERT( receivingDisplay->DisplayRectL() == iReceiveSession->iRect ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTwoWayRecvSession::UT_CameraL() + { + // Camera cannot be used without MCE session + // + EUNIT_ASSERT_LEAVE( iReceiveSession->Camera().ChangeCameraL( + TMusEngCameraHandler::EFrontCamera ) ); + + // Camera cannot be used without video out stream + // + TMceTransactionDataContainer container; + CMceInSession* inSession = ConstructInSessionLC( 1, 0 ); + iReceiveSession->IncomingSession( inSession, &container ); + CleanupStack::Pop( inSession ); + MUSENG_TEST_ASSERT_INCOMING_SESSION_ALLOC_FAILURE_L + EUNIT_ASSERT_LEAVE( iReceiveSession->Camera().ChangeCameraL( + TMusEngCameraHandler::EFrontCamera ) ); + + // Camera can be used when video out stream exists + // + delete iReceiveSession->iSession; + iReceiveSession->iSession = NULL; + inSession = ConstructTwoWayInSessionLC(); + iReceiveSession->IncomingSession( inSession, &container ); + CleanupStack::Pop( inSession ); + MUSENG_TEST_ASSERT_INCOMING_SESSION_ALLOC_FAILURE_L + iReceiveSession->Camera().ChangeCameraL( + TMusEngCameraHandler::EFrontCamera ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTwoWayRecvSession::UT_LocalVideoPlayerL() + { + EUNIT_ASSERT( iReceiveSession->LocalVideoPlayer() == + iReceiveSession->iLiveVideoPlayer ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTwoWayRecvSession::UT_HandleSessionStateChangedL() + { + // Unknown session, let the base class handle + CMceInSession* inSession = ConstructInSessionLC( 1, 1 ); + + iReceiveSession->HandleSessionStateChanged( *inSession, 0, KNullDesC8() ); + + // Simulate incoming session + TMceTransactionDataContainer container; + + iReceiveSession->IncomingSession( inSession, &container ); + CleanupStack::Pop( inSession ); + + // Session is in state EReserving, let the base class handle + iReceiveSession->HandleSessionStateChanged( *inSession, 0, KNullDesC8() ); + + // The normal cases: + + // 1 ) First transition to state EProceeding, user and remote end should + // be notified + inSession->iState = CMceSession::EProceeding; + iReceiveSession->HandleSessionStateChanged( *inSession, 0, KNullDesC8() ); + EUNIT_ASSERT_EQUALS( TInt( iLcSessionObserver->iCalledFunction ), + TInt( CLcSessionObserverStub::ESessionStateChanged ) ) + EUNIT_ASSERT( iReceiveSession->iRingLCalled ) + iLcSessionObserver->Reset(); + + // 2 ) Now simulate second transition to EProceeding state which can happen + // if we force 100rel to be used. User and remote end should not be + // notified anymore but change should be ignored. + inSession->iState = CMceSession::EProceeding; + iReceiveSession->HandleSessionStateChanged( *inSession, 0, KNullDesC8() ); + EUNIT_ASSERT_EQUALS( TInt( CLcSessionObserverStub::EUnknown ), + TInt( iLcSessionObserver->iCalledFunction ) ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTwoWayRecvSession::UT_AdjustVideoCodecLL() + { + CMceVideoCodec* codecH263 = CMceH263Codec::NewLC( KMceSDPNameH263() ); + CMceVideoCodec* codecH2632000 = CMceH263Codec::NewLC( KMceSDPNameH2632000() ); + CMceVideoCodec* codecAvc = CMceAvcCodec::NewLC( KMceSDPNameH264() ); + CMceVideoCodec* codecUnknown = CMceH263Codec::NewLC( KNullDesC8() ); + + iReceiveSession->AdjustVideoCodecL( *codecH263, KMceRTPSource ); + iReceiveSession->AdjustVideoCodecL( *codecH2632000, KMceRTPSource ); + iReceiveSession->AdjustVideoCodecL( *codecAvc, KMceRTPSource ); + iReceiveSession->AdjustVideoCodecL( *codecUnknown, KMceRTPSource ); + + EUNIT_ASSERT_EQUALS( codecH263->KeepAliveTimer(), 6 ) + EUNIT_ASSERT_EQUALS( codecH263->KeepAlivePayloadType(), 96 ) + EUNIT_ASSERT_EQUALS( codecH263->KeepAliveData(), KNullDesC8() ) + + EUNIT_ASSERT_EQUALS( codecH2632000->KeepAliveTimer(), 6 ) + EUNIT_ASSERT_EQUALS( codecH2632000->KeepAlivePayloadType(), 96 ) + EUNIT_ASSERT_EQUALS( codecH2632000->KeepAliveData(), KNullDesC8() ) + + EUNIT_ASSERT_EQUALS( codecAvc->KeepAliveTimer(), 6 ) + EUNIT_ASSERT_EQUALS( codecAvc->KeepAlivePayloadType(), 98 ) + EUNIT_ASSERT_EQUALS( codecAvc->KeepAliveData(), KNullDesC8() ) + + EUNIT_ASSERT_EQUALS( codecUnknown->KeepAliveTimer(), 6 ) + EUNIT_ASSERT_EQUALS( codecUnknown->KeepAlivePayloadType(), 0 ) + EUNIT_ASSERT_EQUALS( codecUnknown->KeepAliveData(), KNullDesC8() ) + + CleanupStack::PopAndDestroy( codecUnknown ); + CleanupStack::PopAndDestroy( codecAvc ); + CleanupStack::PopAndDestroy( codecH2632000 ); + CleanupStack::PopAndDestroy( codecH263 ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTwoWayRecvSession::UT_AdjustAudioCodecLL() + { + CMceAudioCodec* codec = + iReceiveSession->iManager->SupportedAudioCodecs()[0]->CloneL(); + CleanupStack::PushL( codec ); + iReceiveSession->AdjustAudioCodecL( *codec ); + + // Test keepalive timer + + TUint8 keepAliveTimer = codec->KeepAliveTimer(); + EUNIT_ASSERT( codec->KeepAliveTimer() == 6 ) + EUNIT_ASSERT( codec->KeepAlivePayloadType() == 97 ) + EUNIT_ASSERT( codec->KeepAliveData() == KNullDesC8() ) + + // Test that base class has been called + + EUNIT_ASSERT( codec->iMMFPriority == KAudioPrioritySwisPlayback ) + EUNIT_ASSERT( codec->iMMFPriorityPreference == KAudioPrefSwisPlayback ) + + CleanupStack::PopAndDestroy( codec ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTwoWayRecvSession::UT_DoCodecSelectionLL() + { + // Check that Non-Interleaved AVC is preferred over single NAL + CMceVideoStream* videoStream = CMceVideoStream::NewLC(); + + CMceVideoCodec* codecAvcSingleNal = CMceAvcCodec::NewLC( KMceSDPNameH264() ); + codecAvcSingleNal->iCodecMode = KMceAvcModeSingleNal; + videoStream->AddCodecL( codecAvcSingleNal ); + CleanupStack::Pop( codecAvcSingleNal ); + + CMceVideoCodec* codecAvcNonInterleaved = CMceAvcCodec::NewLC( KMceSDPNameH264() ); + codecAvcNonInterleaved->iCodecMode = KMceAvcModeNonInterleaved; + videoStream->AddCodecL( codecAvcNonInterleaved ); + CleanupStack::Pop( codecAvcNonInterleaved ); + + iReceiveSession->DoCodecSelectionL( *videoStream ); + + EUNIT_ASSERT_EQUALS( videoStream->Codecs().Count(), 1 ) + EUNIT_ASSERT_EQUALS( videoStream->Codecs()[0]->SdpName(), KMceSDPNameH264() ) + EUNIT_ASSERT_EQUALS( videoStream->Codecs()[0]->CodecMode(), + KMceAvcModeNonInterleaved ) + + CleanupStack::PopAndDestroy( videoStream ); + + // Check that Single NAL AVC is preferred over H263 + videoStream = CMceVideoStream::NewLC(); + + CMceVideoCodec* codecH263 = CMceH263Codec::NewLC( KMceSDPNameH263() ); + videoStream->AddCodecL( codecH263 ); + CleanupStack::Pop( codecH263 ); + + codecAvcSingleNal = CMceAvcCodec::NewLC( KMceSDPNameH264() ); + codecAvcSingleNal->iCodecMode = KMceAvcModeSingleNal; + videoStream->AddCodecL( codecAvcSingleNal ); + CleanupStack::Pop( codecAvcSingleNal ); + + iReceiveSession->DoCodecSelectionL( *videoStream ); + + EUNIT_ASSERT_EQUALS( videoStream->Codecs().Count(), 1 ) + EUNIT_ASSERT_EQUALS( videoStream->Codecs()[0]->SdpName(), KMceSDPNameH264() ) + EUNIT_ASSERT_EQUALS( videoStream->Codecs()[0]->CodecMode(), + KMceAvcModeSingleNal ) + + CleanupStack::PopAndDestroy( videoStream ); + + // Check that H263 codecs without AVC are handled correctly (in base class) + videoStream = CMceVideoStream::NewLC(); + + codecH263 = CMceH263Codec::NewLC( KMceSDPNameH263() ); + videoStream->AddCodecL( codecH263 ); + CleanupStack::Pop( codecH263 ); + + CMceVideoCodec* codecH2632000 = CMceH263Codec::NewLC( KMceSDPNameH2632000() ); + videoStream->AddCodecL( codecH2632000 ); + CleanupStack::Pop( codecH2632000 ); + + iReceiveSession->DoCodecSelectionL( *videoStream ); + + EUNIT_ASSERT_EQUALS( videoStream->Codecs().Count(), 1 ) + + CleanupStack::PopAndDestroy( videoStream ); + + // Check that AVC non-interleaved with best bitrate is preferred + videoStream = CMceVideoStream::NewLC(); + + codecAvcNonInterleaved = CMceAvcCodec::NewLC( KMceSDPNameH264() ); + codecAvcNonInterleaved->iCodecMode = KMceAvcModeNonInterleaved; + codecAvcNonInterleaved->SetMaxBitrateL( 80000 ); + videoStream->AddCodecL( codecAvcNonInterleaved ); + CleanupStack::Pop( codecAvcNonInterleaved ); + + CMceVideoCodec* codecAvcNonInterleaved128 = CMceAvcCodec::NewLC( KMceSDPNameH264() ); + codecAvcNonInterleaved128->iCodecMode = KMceAvcModeNonInterleaved; + codecAvcNonInterleaved128->SetMaxBitrateL( 128000 ); + videoStream->AddCodecL( codecAvcNonInterleaved128 ); + CleanupStack::Pop( codecAvcNonInterleaved128 ); + + iReceiveSession->DoCodecSelectionL( *videoStream ); + + EUNIT_ASSERT_EQUALS( videoStream->Codecs().Count(), 1 ) + EUNIT_ASSERT( videoStream->Codecs()[0] == codecAvcNonInterleaved128 ) + + CleanupStack::PopAndDestroy( videoStream ); + + // Check that in case of several AVC single NALs, the best bitrate is preferred + videoStream = CMceVideoStream::NewLC(); + + codecAvcSingleNal = CMceAvcCodec::NewLC( KMceSDPNameH264() ); + codecAvcSingleNal->iCodecMode = KMceAvcModeSingleNal; + codecAvcSingleNal->SetMaxBitrateL( 80000 ); + videoStream->AddCodecL( codecAvcSingleNal ); + CleanupStack::Pop( codecAvcSingleNal ); + + CMceVideoCodec* codecAvcSingleNal128 = CMceAvcCodec::NewLC( KMceSDPNameH264() ); + codecAvcSingleNal128->iCodecMode = KMceAvcModeSingleNal; + codecAvcSingleNal128->SetMaxBitrateL( 128000 ); + videoStream->AddCodecL( codecAvcSingleNal128 ); + CleanupStack::Pop( codecAvcSingleNal128 ); + + iReceiveSession->DoCodecSelectionL( *videoStream ); + + EUNIT_ASSERT_EQUALS( videoStream->Codecs().Count(), 1 ) + EUNIT_ASSERT( videoStream->Codecs()[0] == codecAvcSingleNal128 ) + + CleanupStack::PopAndDestroy( videoStream ); + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTwoWayRecvSession::UT_IncomingSessionL() + { + _LIT8( KMusEngSwisTestIdentifier, "Require: precondition" ); + _LIT8( KMusEngTestHeader, "Some header" ); + + TMceTransactionDataContainer container; + + // Simulate SWIS 2.2 invite. There are no streams, so completion fails and + // session gets rejected. Still prenotification has been given. + CMceInSession* inSession = ConstructInSessionLC( 0, 0 ); + CDesC8Array* headers = new ( ELeave ) CDesC8ArrayFlat( 2 ); + CleanupStack::PushL( headers ); + headers->AppendL( KMusEngTestHeader() ); + headers->AppendL( KMusEngSwisTestIdentifier() ); + container.SetHeaders( headers ); + CleanupStack::Pop( headers ); + iReceiveSession->IncomingSession( inSession, &container ); + CleanupStack::Pop( inSession ); + container.Clear(); + + EUNIT_ASSERT( iReceiveSession->iSession ); + EUNIT_ASSERT( iReceiveSession->iSession->iState == + CMceSession::ETerminated ); + + EUNIT_ASSERT( iReceiveSession->iSession->i100RelUsage == + KMce100RelRequired ) + EUNIT_ASSERT( !iReceiveSession->iRingLCalled ) + + // Try again with valid session, normal case + inSession = ConstructInSessionLC( 1, 0 ); + iReceiveSession->IncomingSession( inSession, &container ); + CleanupStack::Pop( inSession ); + + EUNIT_ASSERT( iReceiveSession->iSession ); + // Next state depends on success of completion of session structure. + // When using alloc failure state is ETerminated, in succesfull case it is + // EReserving. However it is set to "normal" state EReserving after + // assertion + EUNIT_ASSERT( iReceiveSession->iSession->iState == + CMceSession::EReserving || + iReceiveSession->iSession->iState == + CMceSession::ETerminated ); + iReceiveSession->iSession->iState = CMceSession::EReserving; + + // Try again without container, new session gets terminated and deleted + inSession = ConstructInSessionLC( 1, 0 ); + iReceiveSession->IncomingSession( inSession, NULL ); + CleanupStack::Pop( inSession ); + + EUNIT_ASSERT( iReceiveSession->iSession ); + EUNIT_ASSERT( iReceiveSession->iSession != inSession ); + EUNIT_ASSERT( iReceiveSession->iSession->iState == + CMceSession::EReserving ); + + // Try again when there is session pending, new session gets terminated + // and deleted + inSession = ConstructInSessionLC( 1, 0 ); + iReceiveSession->IncomingSession( inSession, &container ); + CleanupStack::Pop( inSession ); + + EUNIT_ASSERT( iReceiveSession->iSession ); + EUNIT_ASSERT( iReceiveSession->iSession != inSession ); + EUNIT_ASSERT( iReceiveSession->iSession->iState == + CMceSession::EReserving ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTwoWayRecvSession::UT_CompleteSessionStructureL_WithoutSessionL() + { + TRAPD( error, iReceiveSession->CompleteSessionStructureL() ); + MUS_TEST_FORWARD_ALLOC_FAILURE( error ); + EUNIT_ASSERT( error == KErrNotReady ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTwoWayRecvSession::UT_CompleteSessionStructureL_WithoutStreamsL() + { + CMceInSession* inSession = ConstructInSessionLC( 0, 0 ); + iReceiveSession->iSession = inSession; // Transfers ownership + CleanupStack::Pop( inSession ); + + TRAPD( error, iReceiveSession->CompleteSessionStructureL() ); + MUS_TEST_FORWARD_ALLOC_FAILURE( error ); + EUNIT_ASSERT( error == KErrCorrupt ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTwoWayRecvSession::UT_CompleteSessionStructureL_WithOutgoingStreamL() + { + // Stream will be removed. + CMceInSession* inSession = ConstructInSessionLC( 0, 0 ); + + inSession->AddStreamL( ConstructVideoOutStreamLC() ); + CleanupStack::Pop(); + + iReceiveSession->iSession = inSession; // Transfers ownership + CleanupStack::Pop( inSession ); + + TRAPD( error, iReceiveSession->CompleteSessionStructureL() ) + MUS_TEST_FORWARD_ALLOC_FAILURE( error ); + EUNIT_ASSERT( error == KErrCorrupt ); + EUNIT_ASSERT( inSession->Streams().Count() == 0 ); + EUNIT_ASSERT( inSession->Bundles().Count() == 0 ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTwoWayRecvSession::UT_CompleteSessionStructureL_WithVideoInL() + { + CMceInSession* inSession = ConstructInSessionLC( 1, 0 ); + + iReceiveSession->iSession = inSession; // Transfers ownership + CleanupStack::Pop( inSession ); + + iReceiveSession->CompleteSessionStructureL(); + + EUNIT_ASSERT( inSession->Streams().Count() == 1 ); + EUNIT_ASSERT( inSession->Streams()[0]->IsEnabled() ) + EUNIT_ASSERT( inSession->Streams()[0]->Type() == KMceVideo ) + EUNIT_ASSERT( inSession->Streams()[0]->Sinks().Count() == 1 ) + EUNIT_ASSERT( inSession->Streams()[0]->Sinks()[0]->Type() == + KMceDisplaySink ) + + // No audio, bundle is not constructed + EUNIT_ASSERT( inSession->Bundles().Count() == 0 ) + + } + + +// ----------------------------------------------------------------------------- +// Two-way video in incoming session. Incoming stream is the main stream. +// Both directions are enabled. Local viewfinder stream is added to display +// outgoing video locally +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTwoWayRecvSession::UT_CompleteSessionStructureL_WithVideoOutBoundToVideoInL() + { + CMceInSession* inSession = ConstructInSessionLC( 1, 0 ); + + CMceVideoStream* videoOut = ConstructVideoOutStreamLC(); + inSession->Streams()[0]->BindL( videoOut ); + CleanupStack::Pop( videoOut ); + + iReceiveSession->iSession = inSession; // Transfers ownership + CleanupStack::Pop( inSession ); + + iReceiveSession->CompleteSessionStructureL(); + + EUNIT_ASSERT( inSession->Streams().Count() == 2 ); + + CMceMediaStream* videoIn = inSession->Streams()[0]; + + EUNIT_ASSERT( videoIn->IsEnabled() ) + EUNIT_ASSERT( videoIn->Type() == KMceVideo ) + EUNIT_ASSERT( videoIn->Sinks().Count() == 1 ) + EUNIT_ASSERT( videoIn->Sinks()[0]->Type() == KMceDisplaySink ) + + EUNIT_ASSERT( videoIn->BoundStream() ) + EUNIT_ASSERT( videoIn->BoundStreamL().IsEnabled() ) + + CMceMediaStream* videoVf = inSession->Streams()[1]; + EUNIT_ASSERT( videoVf->IsEnabled() ) + EUNIT_ASSERT( videoVf->Type() == KMceVideo ) + EUNIT_ASSERT( videoVf->Sinks().Count() == 1 ) + EUNIT_ASSERT( videoVf->Sinks()[0]->Type() == KMceDisplaySink ) + EUNIT_ASSERT( videoVf->Source()->Type() == KMceCameraSource ) + + // No audio, bundle is not constructed + EUNIT_ASSERT( inSession->Bundles().Count() == 0 ) + } + + +// ----------------------------------------------------------------------------- +// Two-way video in incoming session. Incoming stream is the bound stream. +// Both directions are enabled. Local viewfinder stream is added to display +// outgoing video locally +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTwoWayRecvSession::UT_CompleteSessionStructureL_WithVideoInBoundToVideoOutL() + { + CMceInSession* inSession = ConstructInSessionLC( 0, 0 ); + + CMceVideoStream* videoOut = ConstructVideoOutStreamLC(); + + CMceVideoStream* videoIn = ConstructVideoInStreamLC(); + videoOut->BindL( videoIn ); + CleanupStack::Pop( videoIn ); + + inSession->AddStreamL( videoOut ); + CleanupStack::Pop( videoOut ); + + iReceiveSession->iSession = inSession; // Transfers ownership + CleanupStack::Pop( inSession ); + + iReceiveSession->CompleteSessionStructureL(); + + EUNIT_ASSERT( inSession->Streams().Count() == 2 ); + EUNIT_ASSERT( videoOut->IsEnabled() ) + EUNIT_ASSERT( videoOut->Type() == KMceVideo ) + EUNIT_ASSERT( videoOut->Sinks().Count() == 1 ) + EUNIT_ASSERT( videoOut->Sinks()[0]->Type() == KMceRTPSink ) + EUNIT_ASSERT( videoOut->Sinks()[0]->IsEnabled() ) + + EUNIT_ASSERT( videoOut->BoundStream() ) + EUNIT_ASSERT( videoOut->BoundStreamL().IsEnabled() ) + EUNIT_ASSERT( videoOut->BoundStreamL().Type() == KMceVideo ) + EUNIT_ASSERT( videoOut->BoundStreamL().Sinks().Count() == 1 ) + EUNIT_ASSERT( videoOut->BoundStreamL().Sinks()[0]->Type() == + KMceDisplaySink ) + EUNIT_ASSERT( videoOut->BoundStreamL().Sinks()[0]->IsEnabled() ) + + CMceMediaStream* videoVf = inSession->Streams()[1]; + EUNIT_ASSERT( videoVf->IsEnabled() ) + EUNIT_ASSERT( videoVf->Type() == KMceVideo ) + EUNIT_ASSERT( videoVf->Sinks().Count() == 1 ) + EUNIT_ASSERT( videoVf->Sinks()[0]->Type() == KMceDisplaySink ) + EUNIT_ASSERT( videoVf->Source()->Type() == KMceCameraSource ) + + // No audio, bundle is not constructed + EUNIT_ASSERT( inSession->Bundles().Count() == 0 ) + } + + +// ----------------------------------------------------------------------------- +// Construct 3 video instreams: +// 0. Without bound stream +// 1. Bounds video out stream +// 2. Bounded by video out stream +// Bound stream should be selected and vf stream is added +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTwoWayRecvSession::UT_CompleteSessionStructureL_WithMultipleVideoInsL() + { + // construct session and stream 0 + CMceInSession* inSession = ConstructInSessionLC( 2, 0 ); + + // finish constructing stream 1 + CMceVideoStream* videoOut = ConstructVideoOutStreamLC(); + inSession->Streams()[1]->BindL( videoOut ); + CleanupStack::Pop( videoOut ); + + // finish constructing stream 2 + videoOut = ConstructVideoOutStreamLC(); + + CMceVideoStream* videoIn = ConstructVideoInStreamLC(); + videoOut->BindL( videoIn ); + CleanupStack::Pop( videoIn ); + + inSession->AddStreamL( videoOut ); + CleanupStack::Pop( videoOut ); + + // Transfers ownership + iReceiveSession->iSession = inSession; + CleanupStack::Pop( inSession ); + + // complete + iReceiveSession->CompleteSessionStructureL(); + + // Bound stream should be used, other original streams should be deleted + // but vf stream is added + EUNIT_ASSERT( inSession->Streams().Count() == 2 ); + + // First stream + EUNIT_ASSERT( inSession->Streams()[0]->IsEnabled() ) + EUNIT_ASSERT( inSession->Streams()[0]->Type() == KMceVideo ) + EUNIT_ASSERT( inSession->Streams()[0]->Sinks().Count() == 1 ) + EUNIT_ASSERT( inSession->Streams()[0]->Sinks()[0]->Type() == KMceDisplaySink ) + EUNIT_ASSERT( inSession->Streams()[0]->Sinks()[0]->IsEnabled() ) + EUNIT_ASSERT( inSession->Streams()[0]->BoundStream() ) + EUNIT_ASSERT( inSession->Streams()[0]->BoundStreamL().Type() == KMceVideo ) + + CMceMediaStream* videoVf = inSession->Streams()[1]; + EUNIT_ASSERT( videoVf->IsEnabled() ) + EUNIT_ASSERT( videoVf->Type() == KMceVideo ) + EUNIT_ASSERT( videoVf->Sinks().Count() == 1 ) + EUNIT_ASSERT( videoVf->Sinks()[0]->Type() == KMceDisplaySink ) + EUNIT_ASSERT( videoVf->Source()->Type() == KMceCameraSource ) + + // No audio, bundle is not constructed + EUNIT_ASSERT( inSession->Bundles().Count() == 0 ) + } + + +// ----------------------------------------------------------------------------- +// Streams in this test case +// 0. Video in +// 1. Audio in +// 2. Audio out bound to audio in +// 3. Audio in bound to audio out +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTwoWayRecvSession:: + UT_CompleteSessionStructureL_WithVideoAndMultipleAudioInsL() + { + // Construct session and streams 0 and 1 + CMceInSession* inSession = inSession = ConstructInSessionLC( 1, 2 ); + + // Construct stream 2 + CMceAudioStream* audioOut = ConstructAudioOutStreamLC(); + inSession->Streams()[2]->BindL( audioOut ); + CleanupStack::Pop( audioOut ); + + // Construct stream 3 + + audioOut = ConstructAudioOutStreamLC(); + + CMceAudioStream* audioIn = ConstructAudioInStreamLC(); + audioOut->BindL( audioIn ); + CleanupStack::Pop( audioIn ); + + inSession->AddStreamL( audioOut ); + CleanupStack::Pop( audioOut ); + + // Transfers ownership + iReceiveSession->iSession = inSession; + CleanupStack::Pop( inSession ); + + // Complete + iReceiveSession->CompleteSessionStructureL(); + EUNIT_ASSERT( inSession->Streams().Count() == 4 ); + + // Stream 0 + EUNIT_ASSERT( inSession->Streams()[0]->Type() == KMceVideo ) + EUNIT_ASSERT( inSession->Streams()[0]->IsEnabled() ) + EUNIT_ASSERT( inSession->Streams()[0]->Sinks().Count() == 1 ) + EUNIT_ASSERT( inSession->Streams()[0]->Sinks()[0]->Type() == + KMceDisplaySink ) + + // Stream 1 + EUNIT_ASSERT( inSession->Streams()[1]->Type() == KMceAudio ) + EUNIT_ASSERT( inSession->Streams()[1]->IsEnabled() ) + EUNIT_ASSERT( inSession->Streams()[1]->Sinks().Count() == 1 ) + EUNIT_ASSERT( inSession->Streams()[1]->Sinks()[0]->Type() == + KMceSpeakerSink ); + CMceSpeakerSink* speaker = + static_cast(inSession->Streams()[1]->Sinks()[0]); + EUNIT_ASSERT( speaker->VolumeL() == iReceiveSession->LcVolumeL() ) + + // Stream 2 and bound stream + EUNIT_ASSERT( inSession->Streams()[2]->Type() == KMceAudio ) + EUNIT_ASSERT( inSession->Streams()[2]->IsEnabled() ) + EUNIT_ASSERT( inSession->Streams()[2]->Sinks().Count() == 1 ) + EUNIT_ASSERT( inSession->Streams()[2]->Sinks()[0]->Type() == + KMceSpeakerSink ); + speaker = static_cast(inSession->Streams()[2]->Sinks()[0]); + EUNIT_ASSERT( speaker->VolumeL() == iReceiveSession->LcVolumeL() ) + + EUNIT_ASSERT( inSession->Streams()[2]->BoundStream() ) + EUNIT_ASSERT( !inSession->Streams()[2]->BoundStreamL().IsEnabled() ) + EUNIT_ASSERT( inSession->Streams()[2]->BoundStreamL().Type() == KMceAudio ) + + EUNIT_ASSERT( inSession->Streams()[2]->BoundStreamL().Sinks().Count() == 1 ) + EUNIT_ASSERT( inSession->Streams()[2]->BoundStreamL().Sinks()[0]->Type() == + KMceRTPSink ); + + // Stream 3 and bound stream + EUNIT_ASSERT( inSession->Streams()[3]->Type() == KMceAudio ) + EUNIT_ASSERT( !inSession->Streams()[3]->IsEnabled() ) + EUNIT_ASSERT( inSession->Streams()[3]->Sinks().Count() == 1 ) + EUNIT_ASSERT( inSession->Streams()[3]->Sinks()[0]->Type() == KMceRTPSink ) + EUNIT_ASSERT( !inSession->Streams()[3]->Sinks()[0]->IsEnabled() ) + + EUNIT_ASSERT( inSession->Streams()[3]->BoundStream() ) + EUNIT_ASSERT( inSession->Streams()[3]->BoundStreamL().IsEnabled() ) + EUNIT_ASSERT( inSession->Streams()[3]->BoundStreamL().Type() == KMceAudio ) + EUNIT_ASSERT( inSession->Streams()[3]->BoundStreamL().Sinks().Count() == 1 ) + EUNIT_ASSERT( inSession->Streams()[3]->BoundStreamL().Sinks()[0]->Type() == + KMceSpeakerSink ) + speaker = static_cast + (inSession->Streams()[3]->BoundStreamL().Sinks()[0]); + EUNIT_ASSERT( speaker->VolumeL() == iReceiveSession->LcVolumeL() ) + + // Check for bundles + EUNIT_ASSERT( inSession->Bundles().Count() == 1 ) + EUNIT_ASSERT( inSession->Bundles()[0]->Streams().Count() == 4 ) + EUNIT_ASSERT( inSession->Bundles()[0]->Streams()[0]->Type() == KMceAudio ) + EUNIT_ASSERT( inSession->Bundles()[0]->Streams()[0]->Sinks()[0]->Type() == + KMceSpeakerSink ) + EUNIT_ASSERT( inSession->Bundles()[0]->Streams()[1]->Type() == KMceAudio ) + EUNIT_ASSERT( inSession->Bundles()[0]->Streams()[1]->Sinks()[0]->Type() == + KMceSpeakerSink ) + EUNIT_ASSERT( inSession->Bundles()[0]->Streams()[2]->Type() == KMceAudio ) + EUNIT_ASSERT( inSession->Bundles()[0]->Streams()[2]->Sinks()[0]->Type() == + KMceSpeakerSink ) + EUNIT_ASSERT( inSession->Bundles()[0]->Streams()[3]->Type() == KMceVideo ) + EUNIT_ASSERT( inSession->Bundles()[0]->Streams()[3]->Sinks()[0]->Type() == + KMceDisplaySink ) + } + + +// ----------------------------------------------------------------------------- +// Streams in this test case +// 0. Video in +// 1. Audio in +// 2. Audio out bound to audio in +// 3. Audio in bound to audio out +// All audio will be removed because of operator variant +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTwoWayRecvSession::UT_CompleteSessionStructureL_OperatorVariant() + { + iReceiveSession->iOperatorVariant = ETrue; + + // Construct session and streams 0 and 1 + CMceInSession* inSession = inSession = ConstructInSessionLC( 1, 2 ); + + // Construct stream 2 + CMceAudioStream* audioOut = ConstructAudioOutStreamLC(); + inSession->Streams()[2]->BindL( audioOut ); + CleanupStack::Pop( audioOut ); + + // Construct stream 3 + + audioOut = ConstructAudioOutStreamLC(); + + CMceAudioStream* audioIn = ConstructAudioInStreamLC(); + audioOut->BindL( audioIn ); + CleanupStack::Pop( audioIn ); + + inSession->AddStreamL( audioOut ); + CleanupStack::Pop( audioOut ); + + // Transfers ownership + iReceiveSession->iSession = inSession; + CleanupStack::Pop( inSession ); + + // Complete + iReceiveSession->CompleteSessionStructureL(); + + // Check that all audio has been removed and no bundles has been + // constructed + EUNIT_ASSERT_EQUALS( inSession->Streams().Count(), 1 ) + EUNIT_ASSERT_EQUALS( inSession->Streams()[0]->Type(), KMceVideo ) + EUNIT_ASSERT_EQUALS( inSession->Bundles().Count(), 0 ) + + + // Session with bandwidth attribute at sessionlevel + // -> bandwidth is taken in use at session level + // + delete iReceiveSession->iSession; + iReceiveSession->iSession = NULL; + + inSession = ConstructInSessionLC( 1, 0 ); + CDesC8Array* sdpLines = new ( ELeave ) CDesC8ArrayFlat( 1 ); + CleanupStack::PushL( sdpLines ); + sdpLines->AppendL( KMusEngSessionSdpLineBandwidthField() ); + inSession->SetSessionSDPLinesL( sdpLines ); + CleanupStack::Pop( sdpLines ); + + // Transfers ownership + iReceiveSession->iSession = inSession; + CleanupStack::Pop( inSession ); + + iReceiveSession->CompleteSessionStructureL(); + + MDesC8Array* newSdpLines = iReceiveSession->iSession->SessionSDPLinesL(); + CleanupDeletePushL( newSdpLines ); + TBool bandwidthFoundFromSessionLevel( EFalse ); + for ( TInt i = 0; newSdpLines && i < newSdpLines->MdcaCount(); i++ ) + { + if ( newSdpLines->MdcaPoint( i ).Compare( + KMusEngSessionSdpLineBandwidthField() ) == 0 ) + { + bandwidthFoundFromSessionLevel = ETrue; + } + } + EUNIT_ASSERT( bandwidthFoundFromSessionLevel ); + CleanupStack::PopAndDestroy( newSdpLines ); + + newSdpLines = iReceiveSession->iSession->Streams()[ 0 ]->MediaAttributeLinesL(); + CleanupDeletePushL( newSdpLines ); + TBool bandwidthFoundFromMediaLevel( EFalse ); + for ( TInt i = 0; newSdpLines && i < newSdpLines->MdcaCount(); i++ ) + { + if ( newSdpLines->MdcaPoint( i ).Compare( + KMusEngSessionSdpLineBandwidthField() ) == 0 ) + { + bandwidthFoundFromMediaLevel = ETrue; + } + } + EUNIT_ASSERT( !bandwidthFoundFromMediaLevel ); + CleanupStack::PopAndDestroy( newSdpLines ); + + // Session with bandwidth attribute at media level + // -> bandwidth is taken in use at media level + // + delete iReceiveSession->iSession; + iReceiveSession->iSession = NULL; + + inSession = ConstructInSessionLC( 1, 0 ); + + sdpLines = new ( ELeave ) CDesC8ArrayFlat( 1 ); + CleanupStack::PushL( sdpLines ); + sdpLines->AppendL( KMusEngSessionSdpLineBandwidthField() ); + inSession->Streams()[ 0 ]->SetMediaAttributeLinesL( sdpLines ); + CleanupStack::Pop( sdpLines ); + + // Transfers ownership + iReceiveSession->iSession = inSession; + CleanupStack::Pop( inSession ); + + iReceiveSession->CompleteSessionStructureL(); + + newSdpLines = iReceiveSession->iSession->SessionSDPLinesL(); + CleanupDeletePushL( newSdpLines ); + bandwidthFoundFromSessionLevel = EFalse; + for ( TInt i = 0; newSdpLines && i < newSdpLines->MdcaCount(); i++ ) + { + if ( newSdpLines->MdcaPoint( i ).Compare( + KMusEngSessionSdpLineBandwidthField() ) == 0 ) + { + bandwidthFoundFromSessionLevel = ETrue; + } + } + EUNIT_ASSERT( !bandwidthFoundFromSessionLevel ); + CleanupStack::PopAndDestroy( newSdpLines ); + + newSdpLines = iReceiveSession->iSession->Streams()[ 0 ]->MediaAttributeLinesL(); + CleanupDeletePushL( newSdpLines ); + bandwidthFoundFromMediaLevel = EFalse; + for ( TInt i = 0; newSdpLines && i < newSdpLines->MdcaCount(); i++ ) + { + if ( newSdpLines->MdcaPoint( i ).Compare( + KMusEngSessionSdpLineBandwidthField() ) == 0 ) + { + bandwidthFoundFromMediaLevel = ETrue; + } + } + EUNIT_ASSERT( bandwidthFoundFromMediaLevel ); + CleanupStack::PopAndDestroy( newSdpLines ); + } + + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusEngTwoWayRecvSession, + "UT_CMusEngTwoWayRecvSession", + "UNIT" ) + + +EUNIT_TEST( + "NewL - test ", + "CMusEngTwoWayRecvSession", + "NewL", + "FUNCTIONALITY", + SetupL, UT_NewLL, Teardown) + +EUNIT_TEST( + "EnableDisplayL - test ", + "CMusEngTwoWayRecvSession", + "EnableDisplayL", + "FUNCTIONALITY", + SetupL, UT_EnableDisplayLL, Teardown) + +EUNIT_TEST( + "SetOrientationL - test ", + "CMusEngTwoWayRecvSession", + "SetOrientationL", + "FUNCTIONALITY", + SetupL, UT_SetOrientationLL, Teardown) + +EUNIT_TEST( + "OrientationL - test ", + "CMusEngTwoWayRecvSession", + "OrientationL", + "FUNCTIONALITY", + SetupL, UT_OrientationLL, Teardown) + +EUNIT_TEST( + "SetLocalRectL - test ", + "CMusEngTwoWayRecvSession", + "SetLocalRectL", + "FUNCTIONALITY", + SetupL, UT_SetLocalRectLL, Teardown) + +EUNIT_TEST( + "SetRectsL - test ", + "CMusEngTwoWayRecvSession", + "SetRectsL", + "FUNCTIONALITY", + SetupL, UT_SetRectsLL, Teardown) + +EUNIT_TEST( + "Camera - test ", + "CMusEngTwoWayRecvSession", + "Camera", + "FUNCTIONALITY", + SetupL, UT_CameraL, Teardown) + +EUNIT_TEST( + "LocalVideoPlayer - test ", + "CMusEngTwoWayRecvSession", + "LocalVideoPlayer", + "FUNCTIONALITY", + SetupL, UT_LocalVideoPlayerL, Teardown) + +EUNIT_TEST( + "HandleSessionStateChanged - test ", + "CMusEngTwoWayRecvSession", + "HandleSessionStateChanged", + "FUNCTIONALITY", + SetupL, UT_HandleSessionStateChangedL, Teardown) + +EUNIT_TEST( + "AdjustVideoCodecL - test ", + "CMusEngTwoWayRecvSession", + "AdjustVideoCodecL", + "FUNCTIONALITY", + SetupL, UT_AdjustVideoCodecLL, Teardown) + +EUNIT_TEST( + "AdjustAudioCodecL - test ", + "CMusEngTwoWayRecvSession", + "AdjustAudioCodecL", + "FUNCTIONALITY", + SetupL, UT_AdjustAudioCodecLL, Teardown) + +EUNIT_TEST( + "DoCodecSelectionL - test ", + "CMusEngTwoWayRecvSession", + "DoCodecSelectionL", + "FUNCTIONALITY", + SetupL, UT_DoCodecSelectionLL, Teardown) + +EUNIT_TEST( + "IncomingSession - test ", + "CMusEngTwoWayRecvSession", + "IncomingSession", + "FUNCTIONALITY", + SetupL, UT_IncomingSessionL, Teardown) + +EUNIT_TEST( + "UT_CompleteSessionStructureL_WithoutSessionL - test without a session", + "CMusEngTwoWayRecvSession", + "CompleteSessionStructureL", + "FUNCTIONALITY", + SetupL, UT_CompleteSessionStructureL_WithoutSessionL, Teardown) + +EUNIT_TEST( + "UT_CompleteSessionStructureL_WithoutStreamsL - without streams", + "CMusEngTwoWayRecvSession", + "CompleteSessionStructureL", + "FUNCTIONALITY", + SetupL, UT_CompleteSessionStructureL_WithoutStreamsL, Teardown) + +EUNIT_TEST( + "UT_CompleteSessionStructureL_WithOutgoingStreamL - with outgoing stream", + "CMusEngTwoWayRecvSession", + "CompleteSessionStructureL", + "FUNCTIONALITY", + SetupL, UT_CompleteSessionStructureL_WithOutgoingStreamL, Teardown) + +EUNIT_TEST( + "UT_CompleteSessionStructureL_WithVideoInL - with video in stream", + "CMusEngTwoWayRecvSession", + "CompleteSessionStructureL", + "FUNCTIONALITY", + SetupL, UT_CompleteSessionStructureL_WithVideoInL, Teardown) + +EUNIT_TEST( + "UT_CompleteSessionStructureL_WithVideoOutBoundToVideoInL - with sendrecv video, video out bound to video in", + "CMusEngTwoWayRecvSession", + "CompleteSessionStructureL", + "FUNCTIONALITY", + SetupL, UT_CompleteSessionStructureL_WithVideoOutBoundToVideoInL, Teardown) + +EUNIT_TEST( + "UT_CompleteSessionStructureL_WithVideoInBoundToVideoOutL - with sendrecv video, video in bound to video out", + "CMusEngTwoWayRecvSession", + "CompleteSessionStructureL", + "FUNCTIONALITY", + SetupL, UT_CompleteSessionStructureL_WithVideoInBoundToVideoOutL, Teardown) + +EUNIT_TEST( + "UT_CompleteSessionStructureL_WithMultipleVideoInsL - with multiple video in streams", + "CMusEngTwoWayRecvSession", + "CompleteSessionStructureL", + "FUNCTIONALITY", + SetupL, UT_CompleteSessionStructureL_WithMultipleVideoInsL, Teardown) + +EUNIT_TEST( + "CompleteSessionStructureL - test one video and multiple audio streams", + "CMusEngTwoWayRecvSession", + "CompleteSessionStructureL", + "FUNCTIONALITY", + SetupL, UT_CompleteSessionStructureL_WithVideoAndMultipleAudioInsL, Teardown) + +EUNIT_TEST( + "CompleteSessionStructureL - test operator variant", + "CMusEngTwoWayRecvSession", + "CompleteSessionStructureL", + "FUNCTIONALITY", + SetupL, UT_CompleteSessionStructureL_OperatorVariant, Teardown) + +EUNIT_END_TEST_TABLE + +// END OF FILE + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/tsrc/ut_engine/src/ut_musengtwowaysession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/tsrc/ut_engine/src/ut_musengtwowaysession.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,1217 @@ +/* +* 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: +* +*/ + + +// INTERNAL INCLUDES +#include "ut_musengtwowaysession.h" +#include "musengstubs.h" +#include "musengtestdefs.h" +#include "musengtwowaysession.h" +#include "mussipprofilehandler.h" +#include "musengmceutils.h" +#include "mussettings.h" +#include "mussessionproperties.h" +#include "musengremotevideoplayer.h" + +// SYSTEM INCLUDES +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +_LIT8( KMusAvcBitrateLevel1TestText, "TestTextForAvcBrL1Level" ); +_LIT8( KMusAvcBitrateLevel1bTestText, "TestTextForAvcBrL1bLevel" ); +_LIT8( KMusAvcBitrateLevel1_1TestText, "TestTextForAvcBrL1_1Level" ); +_LIT8( KMusAvcBitrateLevel1_2TestText, "TestTextForAvcBrL1_2Level" ); +_LIT8( KMusAvcBitrateLevel1_3TestText, "TestTextForAvcBrL1_3Level" ); +_LIT8( KMusAvcBitrateLevel2TestText, "TestTextForAvcBrL2Level" ); + +_LIT8( KMusAvcBitrateLevel_1b_ConfigKey, "AvcBrL1b=TestTextForAvcBrL1bLevel;" ); + +_LIT8( KMusAvcBitrateLevel_1_1_ConfigKey, +"AvcBrL1_1=TestTextForAvcBrL1_1Level;"); + +_LIT8( KMusAvcBitrateLevels_1_1_And_1b_ConfigKeys, +"AvcBrL1_1=TestTextForAvcBrL1_1Level;\ +AvcBrL1b=TestTextForAvcBrL1bLevel;" ); + +_LIT8( KMusAvcAllLevelsConcatenation, +"AvcBrL1=TestTextForAvcBrL1Level;\ +AvcBrL1b=TestTextForAvcBrL1bLevel;\ +AvcBrL1_1=TestTextForAvcBrL1_1Level;\ +AvcBrL1_2=TestTextForAvcBrL1_2Level;\ +AvcBrL1_3=TestTextForAvcBrL1_3Level;\ +AvcBrL2=TestTextForAvcBrL2Level;" ); + + + +//use step in different time period +const TInt KZoomBigStepCount = 15; +const TInt KZoomSmallStepCount = KZoomBigStepCount*2; +const TInt KZoomStepMinSize = 1; + +// 0.4 second +const TInt64 KZoomFasterTime = 400000;//must bigger than 1/3 second + +//insure that step is 1 +#define USER_SLEEP User::After(KZoomFasterTime) + + +// NOTE!!!!!!!!!! +// There are intentianally many same cases as already in CMusEngLiveSession +// as two-way session derives from livesession. These cases therefore +// ensure that live session changes are not breaking two-way session. + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusEngTwoWaySession* UT_CMusEngTwoWaySession::NewL() + { + UT_CMusEngTwoWaySession* self = UT_CMusEngTwoWaySession::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusEngTwoWaySession* UT_CMusEngTwoWaySession::NewLC() + { + UT_CMusEngTwoWaySession* self = new( ELeave ) UT_CMusEngTwoWaySession(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusEngTwoWaySession::~UT_CMusEngTwoWaySession() + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// Default constructor +// ----------------------------------------------------------------------------- +// +UT_CMusEngTwoWaySession::UT_CMusEngTwoWaySession() + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// Second phase construct +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTwoWaySession::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTwoWaySession::SetupL() + { + iLcSessionObserver = new( ELeave )CLcSessionObserverStub; + iLcUiProvider = new( ELeave )CLcUiProviderStub; + iLiveSession = CMusEngTwoWaySession::NewL(); + iLiveSession->SetLcSessionObserver( iLcSessionObserver ); + iLiveSession->SetLcUiProvider( iLcUiProvider ); + + User::LeaveIfError( RProperty::Set( NMusSessionApi::KCategoryUid, + NMusSessionApi::KRemoteSipAddress, + KTestRecipientSipUri ) ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTwoWaySession::Teardown() + { + delete iLiveSession; + delete iLcSessionObserver; + delete iLcUiProvider; + PropertyHelper::Close(); + // Delete static data from CenRep stub + CRepository::iStaticWriteAvcKeysToStaticData = EFalse; + CRepository::DeleteStubAvcConfigKeys(); + CRepository::ResetStubGlobal(); + CRepository::iForceFailWithCode = KErrNone; + } + + + +// TEST CASES + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTwoWaySession::UT_NewLL() + { + EUNIT_ASSERT( iLiveSession ) + EUNIT_ASSERT( iLiveSession->iCameraHandler.iCameraUsage == MusSettingsKeys::EUseCameraSwapping ); + EUNIT_ASSERT( iLiveSession->iMceManagerUid == TUid::Uid( KMusUiUid ) ); + + delete iLiveSession; + iLiveSession = NULL; + CRepository::SetStubGlobal( MusSettingsKeys::KCameraUsage, + MusSettingsKeys::EUseOnlySecondaryCamera ); + + iLiveSession = CMusEngTwoWaySession::NewL(); + + EUNIT_ASSERT( iLiveSession->iCameraHandler.iCameraUsage == MusSettingsKeys::EUseOnlySecondaryCamera ); + + delete iLiveSession; + iLiveSession = NULL; + CRepository::SetStubGlobal( MusSettingsKeys::KCameraUsage, + MusSettingsKeys::EUseOnlyMainCamera ); + + iLiveSession = CMusEngTwoWaySession::NewL(); + + EUNIT_ASSERT_EQUALS( TInt( MusSettingsKeys::EUseOnlyMainCamera ), + TInt( iLiveSession->iCameraHandler.iCameraUsage ) ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTwoWaySession::UT_EstablishLcSessionLL() + { + CRepository::SetStubGlobal( MusSettingsKeys::KVideoBandwidth, + 128 ); + iLiveSession->EstablishLcSessionL(); + + EUNIT_ASSERT( iLiveSession->iSession ); + // Next assertion ensures that session structure is new + EUNIT_ASSERT( iLiveSession->iSession->Streams().Count() > 0 ); + EUNIT_ASSERT( iLiveSession->iSession->Streams()[0] ); + EUNIT_ASSERT( *(iLiveSession->iRecipient) == KTestRecipientSipUri8() ); + EUNIT_ASSERT( iLiveSession->iSession->State() == CMceSession::EOffering ); + + EUNIT_ASSERT( iLiveSession->iSession->iHeaders ); + EUNIT_ASSERT( iLiveSession->iSession->iHeaders->Count() == 2 ); + EUNIT_ASSERT( iLiveSession->iSession->iHeaders->MdcaPoint( 0 ) == + KMusEngAcceptContactHeader() ); + EUNIT_ASSERT( iLiveSession->iSession->iHeaders->MdcaPoint( 1 ) == + KMusAcceptHeader() ); + + // Ensure there is no SDP lines at session level + EUNIT_ASSERT( iLiveSession->iSession->iSessionSDPLines ); + EUNIT_ASSERT( iLiveSession->iSession->iSessionSDPLines->Count() == 1 ); + EUNIT_ASSERT( iLiveSession->iSession->iSessionSDPLines->MdcaPoint( 0 ) == + KMusEngSessionSdpLineXApplication() ); + + // Ensure b=AS and b=TIAS attributes are taken at media level + MDesC8Array* mediaSdpLines = + iLiveSession->iSession->Streams()[0]->iMediaSDPLines; + + EUNIT_ASSERT( mediaSdpLines ); + EUNIT_ASSERT( mediaSdpLines->MdcaCount() == 2 ); + EUNIT_ASSERT( mediaSdpLines->MdcaPoint( 0 ).Find( + KMusEngSessionSdpLineBandwidthLine() ) == 0 ); + EUNIT_ASSERT( mediaSdpLines->MdcaPoint( 1 ).Find( + KMusEngSessionSdpLineTiasLine() ) == 0 ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTwoWaySession::UT_EnableDisplayLL() + { + TRAPD( error, iLiveSession->EnableDisplayL( ETrue ) ); + MUS_TEST_FORWARD_ALLOC_FAILURE( error ); + EUNIT_ASSERT( error == KErrNotReady ); + + ESTABLISH_OUT_SESSION( iLiveSession ); + + CMceDisplaySink* display = + MusEngMceUtils::GetDisplayL( *(iLiveSession->iSession) ); + + CMceDisplaySink* receivingDisplay = + MusEngMceUtils::GetReceivingDisplayL( *iLiveSession->iSession ); + + // Disable + iLiveSession->EnableDisplayL( EFalse ); + + EUNIT_ASSERT( !display->iIsEnabled ); + EUNIT_ASSERT( !receivingDisplay->iIsEnabled ); + + // Try to disable again, request should be ignored + + iLiveSession->EnableDisplayL( EFalse ); + + EUNIT_ASSERT( !display->iIsEnabled ); + EUNIT_ASSERT( !receivingDisplay->iIsEnabled ); + + // Enable + + iLiveSession->EnableDisplayL( ETrue ); + + EUNIT_ASSERT( display->iIsEnabled ); + EUNIT_ASSERT( receivingDisplay->iIsEnabled ); + + // Try to enable again, request should be ignored + + iLiveSession->EnableDisplayL( ETrue ); + + EUNIT_ASSERT( display->iIsEnabled ); + EUNIT_ASSERT( receivingDisplay->iIsEnabled ); + + // Display is active only if receiving and display is explicitly enabled + EUNIT_ASSERT( !iLiveSession->IsDisplayActive() ) + iLiveSession->iReceiving = ETrue; + EUNIT_ASSERT( iLiveSession->IsDisplayActive() ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTwoWaySession::UT_SetOrientationLL() + { + // Try without session, fails + EUNIT_ASSERT_SPECIFIC_LEAVE( iLiveSession->SetOrientationL( + CMusEngMceSession::EPortrait ), + KErrNotReady ) + + // Establish a session + ESTABLISH_OUT_SESSION( iLiveSession ) + + CMceDisplaySink* display = + MusEngMceUtils::GetDisplayL( *iLiveSession->iSession ); + + CMceDisplaySink* receivingDisplay = + MusEngMceUtils::GetReceivingDisplayL( *iLiveSession->iSession ); + + + // Check the initial state + display->iRotation = CMceDisplaySink::ENone; + receivingDisplay->iRotation = CMceDisplaySink::ENone; + EUNIT_ASSERT_EQUALS( iLiveSession->OrientationL(), + MLcWindow::EPortrait ) + + // Successfully change orientation + + iLiveSession->SetOrientationL( CMusEngMceSession::ELandscape ); + EUNIT_ASSERT_EQUALS( iLiveSession->OrientationL(), + MLcWindow::ELandscape ) + + EUNIT_ASSERT_EQUALS( display->iRotation, CMceDisplaySink::EClockwise90Degree ); + EUNIT_ASSERT_EQUALS( receivingDisplay->iRotation, CMceDisplaySink::EClockwise90Degree ); + + iLiveSession->SetOrientationL( CMusEngMceSession::EPortrait ); + EUNIT_ASSERT_EQUALS( iLiveSession->OrientationL(), + MLcWindow::EPortrait ) + + EUNIT_ASSERT_EQUALS( display->iRotation, CMceDisplaySink::ENone ); + EUNIT_ASSERT_EQUALS( receivingDisplay->iRotation, CMceDisplaySink::ENone ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTwoWaySession::UT_SetLocalRectLL() + { + // Does nothing real before session establishment + TRect rect1( 100, 200, 300, 500 ); + iLiveSession->SetSecondaryRectL( rect1 ); + + EUNIT_ASSERT( rect1 == iLiveSession->iLocalRect ); + + // Local rect changing affects to viewfinder display sink not to receiving video + // + ESTABLISH_OUT_SESSION( iLiveSession ); + + CMceDisplaySink* vfDisplay = + MusEngMceUtils::GetDisplayL( *( iLiveSession->iSession ) ); + CMceDisplaySink* receivingDisplay = + MusEngMceUtils::GetReceivingDisplayL( *( iLiveSession->iSession ) ); + + EUNIT_ASSERT( vfDisplay->DisplayRectL() == iLiveSession->iLocalRect ); + EUNIT_ASSERT( receivingDisplay->DisplayRectL() != iLiveSession->iLocalRect ); + + TRect rect2( 200, 200, 300, 500 ); + iLiveSession->SetSecondaryRectL( rect2 ); + EUNIT_ASSERT( rect2 == iLiveSession->iLocalRect ); + EUNIT_ASSERT( vfDisplay->DisplayRectL() == iLiveSession->iLocalRect ); + EUNIT_ASSERT( receivingDisplay->DisplayRectL() != iLiveSession->iLocalRect ); + + // Terminate session and try again, rect must not be changed + + iLiveSession->iSession->iState = CMceSession::ETerminated; + + TRect rect3( 300, 300, 400, 600 ); + + iLiveSession->SetSecondaryRectL( rect3 ); + + EUNIT_ASSERT( vfDisplay->DisplayRectL() != rect3 ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTwoWaySession::UT_SetRectsLL() + { + // Does nothing real before session establishment + TRect localrect1( 100, 200, 300, 400 ); + TRect remoterect1( 100, 200, 300, 500 ); + iLiveSession->SetRectsL( remoterect1, localrect1 ); + + EUNIT_ASSERT( localrect1 == iLiveSession->iLocalRect ); + EUNIT_ASSERT( remoterect1 == iLiveSession->iRect ); + + // Local rect changing affects to viewfinder display sink and remote rect to + // receiving video display sink + // + ESTABLISH_OUT_SESSION( iLiveSession ); + + CMceDisplaySink* vfDisplay = + MusEngMceUtils::GetDisplayL( *( iLiveSession->iSession ) ); + CMceDisplaySink* receivingDisplay = + MusEngMceUtils::GetReceivingDisplayL( *( iLiveSession->iSession ) ); + + TRect localrect2( 200, 200, 300, 400 ); + TRect remoterect2( 200, 200, 300, 500 ); + EUNIT_ASSERT( vfDisplay->DisplayRectL() != localrect2 ); + EUNIT_ASSERT( receivingDisplay->DisplayRectL() != remoterect2 ); + + iLiveSession->SetRectsL( remoterect2, localrect2 ); + EUNIT_ASSERT( localrect2 == iLiveSession->iLocalRect ); + EUNIT_ASSERT( remoterect2 == iLiveSession->iRect ); + EUNIT_ASSERT( vfDisplay->DisplayRectL() == iLiveSession->iLocalRect ); + EUNIT_ASSERT( receivingDisplay->DisplayRectL() == iLiveSession->iRect ); + + // Terminate session and try again, rect must not be changed + + iLiveSession->iSession->iState = CMceSession::ETerminated; + + TRect localrect3( 300, 200, 300, 400 ); + TRect remoterect3( 300, 200, 300, 500 ); + + iLiveSession->SetRectsL( remoterect3, localrect3 ); + + EUNIT_ASSERT( vfDisplay->DisplayRectL() != localrect3 ) + EUNIT_ASSERT( receivingDisplay->DisplayRectL() != remoterect3 ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTwoWaySession::UT_EnableLcFileL() + { + // Recording is not supported for two-way session + EUNIT_ASSERT_SPECIFIC_LEAVE( iLiveSession->EnableLcFileL( ETrue ), + KErrNotSupported ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTwoWaySession::UT_CompleteSessionStructureLL() + { + + CMceStreamBundle* localBundle = + CMceStreamBundle::NewLC( CMceStreamBundle::ELS ); + + // Check that structure cannot be completed before creating the session + TRAPD( error, iLiveSession->CompleteSessionStructureL( *localBundle ) ); + MUS_TEST_FORWARD_ALLOC_FAILURE( error ); + EUNIT_ASSERT( error == KErrNotReady ); + + // Normal case + + CSIPProfile* profile = iLiveSession->iSipProfileHandler->Profile(); + + iLiveSession->iSession = CMceOutSession::NewL( + *(iLiveSession->iManager), + *profile, + KTestRecipientSipUri8() ); + + iLiveSession->CompleteSessionStructureL( *localBundle ); + + EUNIT_ASSERT( localBundle->Streams().Count() == 0 ) + + EUNIT_ASSERT( iLiveSession->iSession->Streams().Count() == 1 ); + EUNIT_ASSERT( iLiveSession->iSession->Streams()[0]->Type() == KMceVideo ); + EUNIT_ASSERT( iLiveSession->iSession->Streams()[0]->Source() ); + EUNIT_ASSERT( iLiveSession->iSession->Streams()[0]->Source()->Type() == + KMceCameraSource ); + EUNIT_ASSERT( iLiveSession->iSession->Streams()[0]->Sinks().Count() == 1 ); + EUNIT_ASSERT( iLiveSession->iSession->Streams()[0]->Sinks()[0]->Type() == + KMceRTPSink ); + + EUNIT_ASSERT( iLiveSession->iCameraHandler.iCurrentCamera == + TMusEngCameraHandler::EBackCamera ); + + CMceVideoStream* vidStream = static_cast( iLiveSession->iSession->Streams()[0] ); + EUNIT_ASSERT( vidStream->BoundStream() ); + CMceVideoStream& inStream = static_cast( vidStream->BoundStreamL() ); + EUNIT_ASSERT( inStream.Source() ); + EUNIT_ASSERT( inStream.Source()->Type() == KMceRTPSource ); + EUNIT_ASSERT( inStream.Sinks().Count() == 1 ); + EUNIT_ASSERT( inStream.Sinks()[0]->Type() == KMceDisplaySink ); + + delete iLiveSession->iSession; + iLiveSession->iSession = NULL; + + iLiveSession->iSession = CMceOutSession::NewL( + *(iLiveSession->iManager), + *profile, + KTestRecipientSipUri8() ); + + iLiveSession->iCameraHandler.iCameraUsage = MusSettingsKeys::EUseOnlySecondaryCamera; + iLiveSession->CompleteSessionStructureL( *localBundle ); + + EUNIT_ASSERT( iLiveSession->iCameraHandler.iCurrentCamera == + TMusEngCameraHandler::EFrontCamera ); + + + CleanupStack::PopAndDestroy( localBundle ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTwoWaySession::UT_HandleSessionStateChangedL() + { + // Make Repository empty, config keys must be written + CRepository::SetStubAvcConfigKeysL( KNullDesC8() ); + + // Invite + iLiveSession->EstablishLcSessionL(); + iLiveSession->iSession->iState = CMceSession::EEstablished; + CRepository::iForceFailWithCode = KErrNone; + + // Simulate session state transition notification + iLiveSession->HandleSessionStateChanged( + *iLiveSession->iSession, + 200, KNullDesC8() ); + + HBufC8* info = MultimediaSharingSettings::EncoderConfigInfoLC(); + EUNIT_ASSERT_NOT_EQUALS( *info, KMusAvcBitrateLevel_1b_ConfigKey() ) + CleanupStack::PopAndDestroy( info ); + + // sendrecv->recvonly downgrade terminates session + iLcSessionObserver->Reset(); + iLiveSession->iSession->iState = CMceSession::EEstablished; + CMceVideoStream* inStream = + MusEngMceUtils::GetVideoInStreamL( *iLiveSession->iSession ); + inStream->EnableL(); + CMceVideoStream* outStream = + MusEngMceUtils::GetVideoOutStreamL( *iLiveSession->iSession ); + outStream->DisableL(); + iLiveSession->HandleSessionStateChanged( + *iLiveSession->iSession, 200, KNullDesC8() ); + EUNIT_ASSERT_EQUALS( TInt( iLcSessionObserver->iCalledFunction ), + TInt( CLcSessionObserverStub::ESessionFailed ) ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTwoWaySession::UT_AdjustVideoCodecLL() + { + CRepository::SetStubAvcConfigKeysL( KNullDesC8() ); + + CMceVideoCodec* codecH263 = CMceH263Codec::NewLC( KMceSDPNameH263() ); + CMceVideoCodec* codecH2632000 = CMceH263Codec::NewLC( KMceSDPNameH2632000() ); + CMceVideoCodec* codecAvc = CMceAvcCodec::NewLC( KMceSDPNameH264() ); + CMceVideoCodec* codecUnknown = CMceH263Codec::NewLC( KNullDesC8() ); + + iLiveSession->AdjustVideoCodecL( *codecH263, KMceCameraSource ); + iLiveSession->AdjustVideoCodecL( *codecH2632000, KMceCameraSource ); + iLiveSession->AdjustVideoCodecL( *codecAvc, KMceCameraSource ); + iLiveSession->AdjustVideoCodecL( *codecUnknown, KMceCameraSource ); + + // Test that bit rates and keepalive has been set to H263 & AVC codecs + EUNIT_ASSERT( codecH263->iAllowedBitrates == KMceAllowedH263BitrateAll ) + EUNIT_ASSERT( codecH263->iMaxBitRate == KMceH263Level45Bitrate ) + EUNIT_ASSERT( codecH263->iBitrate == 80000 ) + EUNIT_ASSERT_EQUALS( codecH263->KeepAliveTimer(), 6 ) + EUNIT_ASSERT_EQUALS( codecH263->KeepAlivePayloadType(), 96 ) + EUNIT_ASSERT_EQUALS( codecH263->KeepAliveData(), KNullDesC8() ) + + EUNIT_ASSERT( codecH2632000->iAllowedBitrates == + KMceAllowedH263BitrateAll ) + EUNIT_ASSERT( codecH2632000->iMaxBitRate == KMceH263Level45Bitrate ) + EUNIT_ASSERT( codecH2632000->iBitrate == 80000 ) + EUNIT_ASSERT_EQUALS( codecH2632000->KeepAliveTimer(), 6 ) + EUNIT_ASSERT_EQUALS( codecH2632000->KeepAlivePayloadType(), 96 ) + EUNIT_ASSERT_EQUALS( codecH2632000->KeepAliveData(), KNullDesC8() ) + + EUNIT_ASSERT( codecAvc->iAllowedBitrates == + KMceAvcCodecProfileIdBaseline | + KMceAvcCodecProfileIopConstraintSet | + KMceAvcBitrateLevel1b ) + EUNIT_ASSERT_EQUALS( codecAvc->KeepAliveTimer(), 6 ) + EUNIT_ASSERT_EQUALS( codecAvc->KeepAlivePayloadType(), 98 ) + EUNIT_ASSERT_EQUALS( codecAvc->KeepAliveData(), KNullDesC8() ) + EUNIT_ASSERT( iLiveSession->iStoreEncoderConfigInfo ) + + + // Test that bitrates and keepalive has not been set to unknown codecs + EUNIT_ASSERT( codecUnknown->iAllowedBitrates != + KMceAllowedH263BitrateAll ) + EUNIT_ASSERT( codecUnknown->iMaxBitRate != KMceH263Level45Bitrate ) + EUNIT_ASSERT( codecUnknown->iBitrate != KMceH263Level10Bitrate ) + EUNIT_ASSERT_EQUALS( codecUnknown->KeepAliveTimer(), 6 ) + EUNIT_ASSERT_EQUALS( codecUnknown->KeepAlivePayloadType(), 0 ) + EUNIT_ASSERT_EQUALS( codecUnknown->KeepAliveData(), KNullDesC8() ) + + // Test that base class has been called to all codecs + EUNIT_ASSERT( codecH263->iPayloadType == 96 ) + EUNIT_ASSERT( codecH2632000->iPayloadType == 96 ) + EUNIT_ASSERT( codecAvc->iPayloadType == 98 ) + EUNIT_ASSERT( codecUnknown->iPayloadType == 0 ) + + CleanupStack::PopAndDestroy( codecUnknown ); + CleanupStack::PopAndDestroy( codecAvc ); + CleanupStack::PopAndDestroy( codecH2632000 ); + CleanupStack::PopAndDestroy( codecH263 ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTwoWaySession::UT_AdjustAudioCodecLL() + { + CMceAudioCodec* codec = + iLiveSession->iManager->SupportedAudioCodecs()[0]->CloneL(); + CleanupStack::PushL( codec ); + iLiveSession->AdjustAudioCodecL( *codec ); + + // Does nothing so just test that base class has been called + + EUNIT_ASSERT( codec->iPayloadType == 97 ) + + CleanupStack::PopAndDestroy( codec ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTwoWaySession::UT_DoCodecSelectionLL() + { + CMceVideoStream* stream = CMceVideoStream::NewLC(); + + CMceVideoCodec* codecH263 = CMceH263Codec::NewLC( _L8( "Foo" ) ); + stream->AddCodecL( codecH263 ); + CleanupStack::Pop( codecH263 ); + + CMceVideoCodec* codecH2632000 = CMceH263Codec::NewLC( _L8( "Bar" ) ); + stream->AddCodecL( codecH2632000 ); + CleanupStack::Pop( codecH2632000 ); + + CMceVideoCodec* codecAvc = CMceAvcCodec::NewLC( KMceSDPNameH264() ); + stream->AddCodecL( codecAvc ); + CleanupStack::Pop( codecAvc ); + + // No assumptions so all the codecs are left to stream + iLiveSession->DoCodecSelectionL( *stream ); + EUNIT_ASSERT_EQUALS( stream->Codecs().Count(), 3 ) + + // Check that AVC codecs are removed if they are known to be not supported + delete iLiveSession->iVideoCodecList; + iLiveSession->iVideoCodecList = NULL; + iLiveSession->iVideoCodecList = _L8("SomethingThatIsNotAVC").AllocL(); + iLiveSession->DoCodecSelectionL( *stream ); + EUNIT_ASSERT_EQUALS( stream->Codecs().Count(), 2 ) + EUNIT_ASSERT( stream->Codecs()[0]->SdpName() != KMceSDPNameH264() ) + EUNIT_ASSERT( stream->Codecs()[1]->SdpName() != KMceSDPNameH264() ) + + CleanupStack::PopAndDestroy( stream ); + } + +// ----------------------------------------------------------------------------- +// Although all states are not meaningfull for LiveSession, all states are +// tested in order to force the updating of unit tests when behavior is changed +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTwoWaySession::UT_StreamStateChangedL() + { + // Try without a session, nothing happens + CMceVideoStream* videoStream = CMceVideoStream::NewLC(); + static_cast(iLiveSession)->StreamStateChanged( + *videoStream ); + CleanupStack::PopAndDestroy( videoStream ); + + // Simulate sending invite + iLiveSession->EstablishLcSessionL(); + + // Try all the stream states + CMceMediaStream* changedStream = iLiveSession->iSession->Streams()[0]; + + // EUninitialized, stream is created, unexpected change, nothing happens + changedStream->iState = CMceMediaStream::EUninitialized; + static_cast(iLiveSession)->StreamStateChanged( + *changedStream ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + // EInitialized, stream is initialized + changedStream->iState = CMceMediaStream::EInitialized; + static_cast(iLiveSession)->StreamStateChanged( + *changedStream ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + // EBuffering, outgoing stream is buffering + changedStream->iState = CMceMediaStream::EBuffering; + static_cast(iLiveSession)->StreamStateChanged( + *changedStream ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + // EBuffering, incoming stream is buffering + EUNIT_ASSERT( !iLiveSession->iBuffered ); + CMceMediaStream* changedInStream = &iLiveSession->iSession->Streams()[0]->BoundStreamL(); + changedInStream->iState = CMceMediaStream::EBuffering; + iLiveSession->StreamStateChanged( *changedInStream ); + EUNIT_ASSERT( iLiveSession->iBuffered ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + // EIdle, stream is not receiving RTP + changedStream->iState = CMceMediaStream::EIdle; + static_cast(iLiveSession)->StreamStateChanged( + *changedStream ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + // EStreaming, outgoing stream is streaming, no effect on receiving information + changedStream->iState = CMceMediaStream::EStreaming; + static_cast(iLiveSession)->StreamStateChanged( + *changedStream ); + EUNIT_ASSERT_EQUALS( TInt( iLcSessionObserver->iCalledFunction ), + TInt( CLcSessionObserverStub::EPlayerStateChanged ) ) + iLcSessionObserver->Reset(); + + // EStreaming, incoming stream is streaming, receiving information is updated and notified + EUNIT_ASSERT( !iLiveSession->iReceiving ); + changedInStream->iState = CMceMediaStream::EStreaming; + iLiveSession->StreamStateChanged( *changedInStream ); + EUNIT_ASSERT_EQUALS( TInt( iLcSessionObserver->iCalledFunction ), + TInt( CLcSessionObserverStub::EPlayerStateChanged ) ) + EUNIT_ASSERT( iLiveSession->iReceiving ); + iLcSessionObserver->Reset(); + + // EStreaming, incoming stream is streaming, state is notified even if receiving information + // says we are already receiving + changedInStream->iState = CMceMediaStream::EStreaming; + iLiveSession->StreamStateChanged( *changedInStream ); + EUNIT_ASSERT_EQUALS( TInt( iLcSessionObserver->iCalledFunction ), + TInt( CLcSessionObserverStub::EPlayerStateChanged ) ) + iLcSessionObserver->Reset(); + + // EDisabled, stream is explicitly disabled + changedStream->iState = CMceMediaStream::EDisabled; + static_cast(iLiveSession)->StreamStateChanged( + *changedStream ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + // ENoResources, stream has no needed resources to stream + changedStream->iState = CMceMediaStream::ENoResources; + static_cast(iLiveSession)->StreamStateChanged( + *changedStream ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + // ETranscodingRequired, stream requires non-realtime transcoding + changedStream->iState = CMceMediaStream::ETranscodingRequired; + static_cast(iLiveSession)->StreamStateChanged( + *changedStream ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + // ETranscoding, stream is transcoding in non-realtime + changedStream->iState = CMceMediaStream::ETranscoding; + static_cast(iLiveSession)->StreamStateChanged( + *changedStream ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + } + +// ----------------------------------------------------------------------------- +// Although all states are not meaningfull for LiveSession, all states are +// tested in order to force the updating of unit tests when behavior is changed +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTwoWaySession::UT_StreamStateChangedWithSourceL() + { + // Try without a session, nothing happens + CMceVideoStream* videoStream = CMceVideoStream::NewLC(); + static_cast(iLiveSession)->StreamStateChanged( + *videoStream, + *CMceCameraSource::NewLC( *iLiveSession->iManager ) ); + CleanupStack::PopAndDestroy(); // camera + CleanupStack::PopAndDestroy( videoStream ); + + // Simulate sending invite + iLiveSession->EstablishLcSessionL(); + + // Try all the stream states + CMceMediaStream* changedStream = iLiveSession->iSession->Streams()[0]; + CMceMediaSource* changedSource = changedStream->Source(); + + // EUninitialized, stream is created, unexpected change, nothing happens + changedStream->iState = CMceMediaStream::EUninitialized; + static_cast(iLiveSession)->StreamStateChanged( + *changedStream, *changedSource ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + // EInitialized, stream is initialized + changedStream->iState = CMceMediaStream::EInitialized; + static_cast(iLiveSession)->StreamStateChanged( + *changedStream, *changedSource );; + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + // EBuffering, stream is buffering + changedStream->iState = CMceMediaStream::EBuffering; + static_cast(iLiveSession)->StreamStateChanged( + *changedStream, *changedSource ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + // EIdle, stream is not receiving RTP + changedStream->iState = CMceMediaStream::EIdle; + static_cast(iLiveSession)->StreamStateChanged( + *changedStream, *changedSource ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + // EStreaming, stream is streaming + changedStream->iState = CMceMediaStream::EStreaming; + static_cast(iLiveSession)->StreamStateChanged( + *changedStream, *changedSource ); + EUNIT_ASSERT_EQUALS( TInt( iLcSessionObserver->iCalledFunction ), + TInt( CLcSessionObserverStub::EPlayerStateChanged ) ) + iLcSessionObserver->Reset(); + + // EDisabled, stream is explicitly disabled + changedStream->iState = CMceMediaStream::EDisabled; + static_cast(iLiveSession)->StreamStateChanged( + *changedStream, *changedSource ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + // ENoResources, stream has no needed resources to stream + changedStream->iState = CMceMediaStream::ENoResources; + static_cast(iLiveSession)->StreamStateChanged( + *changedStream, *changedSource ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + // ETranscodingRequired, stream requires non-realtime transcoding + changedStream->iState = CMceMediaStream::ETranscodingRequired; + static_cast(iLiveSession)->StreamStateChanged( + *changedStream, *changedSource ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + // ETranscoding, stream is transcoding in non-realtime + changedStream->iState = CMceMediaStream::ETranscoding; + static_cast(iLiveSession)->StreamStateChanged( + *changedStream, *changedSource ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTwoWaySession::UT_SetEncodingDeviceLL() + { + CMceAvcCodec* codec = CMceAvcCodec::NewLC( KMceSDPNameH264() ); + + // Generic error in CenRep, leave expected + CRepository::iForceFailWithCode = KErrNotReady; + EUNIT_ASSERT_LEAVE( iLiveSession->SetEncodingDeviceL( *codec ) ) + EUNIT_ASSERT_EQUALS( codec->iEncodingDecodingDevice, TUid::Uid( 0 ) ) + + // No entry in CenRep, default value expected + CRepository::iForceFailWithCode = KErrNotFound; + const TUid KDefaultEncodingDevice( TUid::Uid( 0x20001C13 ) ); + iLiveSession->SetEncodingDeviceL( *codec ); + EUNIT_ASSERT_EQUALS( codec->iEncodingDecodingDevice, + KDefaultEncodingDevice ) + + // Entry in CenRep + const TInt KSomeEncodingDevice( 0x20001C15 ); + CRepository::iStaticEncoderUid = KSomeEncodingDevice; + iLiveSession->SetEncodingDeviceL( *codec ); + EUNIT_ASSERT_EQUALS( codec->iEncodingDecodingDevice, + TUid::Uid( KSomeEncodingDevice ) ) + + CleanupStack::PopAndDestroy( codec ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTwoWaySession::UT_SetCodecConfigKeyLL() + { + CMceAvcCodec* codec = CMceAvcCodec::NewLC( KMceSDPNameH264() ); + codec->SetAllowedBitrates( KMceAvcBitrateLevel1b ); + + // Generic error in CenRep, leave expected + CRepository::iForceFailWithCode = KErrNotReady; + EUNIT_ASSERT_LEAVE( iLiveSession->SetCodecConfigKeyL( *codec ) ); + EUNIT_ASSERT( !codec->iConfigKey ) + EUNIT_ASSERT( !iLiveSession->iStoreEncoderConfigInfo ) + CRepository::iForceFailWithCode = KErrNone; + + // No entry in CenRep, nothing happens + iLiveSession->SetCodecConfigKeyL( *codec ); + EUNIT_ASSERT( !codec->iConfigKey ) + EUNIT_ASSERT( !iLiveSession->iStoreEncoderConfigInfo ) + + // Empty entry in CenRep + CRepository::SetStubAvcConfigKeysL( KNullDesC8() ); + iLiveSession->SetCodecConfigKeyL( *codec ); + EUNIT_ASSERT( !codec->iConfigKey ) + EUNIT_ASSERT( iLiveSession->iStoreEncoderConfigInfo ) + iLiveSession->iStoreEncoderConfigInfo = EFalse; // emulate original situation + + // Entry in CenRep + CRepository::SetStubAvcConfigKeysL( KMusAvcBitrateLevel_1b_ConfigKey ); + iLiveSession->SetCodecConfigKeyL( *codec ); + EUNIT_ASSERT( codec->iConfigKey ) + HBufC8* key = codec->ConfigKeyL(); + CleanupStack::PushL( key ); + EUNIT_ASSERT_EQUALS( *key, KMusAvcBitrateLevel1bTestText() ) + CleanupStack::PopAndDestroy( key ); + EUNIT_ASSERT( !iLiveSession->iStoreEncoderConfigInfo ) + + CleanupStack::PopAndDestroy( codec ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTwoWaySession::UT_ReadCodecConfigKeyLL() + { + HBufC8* key( NULL ); + + // Try with H263, leave expected + CMceVideoCodec* codecH263 = CMceH263Codec::NewLC( KMceSDPNameH263() ); + EUNIT_ASSERT_LEAVE( key = iLiveSession->ReadCodecConfigKeyL( *codecH263 ) ) + CleanupStack::PopAndDestroy( codecH263 ); + + // Try without an entry in CenRep, leave expected + CMceVideoCodec* codec = CMceAvcCodec::NewLC( KMceSDPNameH264() ); + codec->SetAllowedBitrates( 0 | KMceAvcBitrateLevel1 ); + EUNIT_ASSERT_LEAVE( key = iLiveSession->ReadCodecConfigKeyL( *codec ) ) + + // Create CenRep entry which does not include wanted bitrate, NULL value + // expected + CRepository::SetStubAvcConfigKeysL( KMusAvcBitrateLevel1bTestText() ); + key = iLiveSession->ReadCodecConfigKeyL( *codec ); + EUNIT_ASSERT( !key ) + + // Create entry with all AVC keys and try with all the values + CRepository::SetStubAvcConfigKeysL( KMusAvcAllLevelsConcatenation() ); + + // KMceAvcBitrateLevel1 + key = iLiveSession->ReadCodecConfigKeyL( *codec ); + EUNIT_ASSERT( key ); + CleanupStack::PushL( key ); + EUNIT_ASSERT_EQUALS( *key, KMusAvcBitrateLevel1TestText ); + CleanupStack::PopAndDestroy( key ); + + // KMceAvcBitrateLevel1b + codec->SetAllowedBitrates( KMceAvcBitrateLevel1b ); + key = iLiveSession->ReadCodecConfigKeyL( *codec ); + EUNIT_ASSERT( key ); + CleanupStack::PushL( key ); + EUNIT_ASSERT_EQUALS( *key, KMusAvcBitrateLevel1bTestText ); + CleanupStack::PopAndDestroy( key ); + + // KMceAvcBitrateLevel1_1 + codec->SetAllowedBitrates( KMceAvcBitrateLevel1_1 ); + key = iLiveSession->ReadCodecConfigKeyL( *codec ); + EUNIT_ASSERT( key ); + CleanupStack::PushL( key ); + EUNIT_ASSERT_EQUALS( *key, KMusAvcBitrateLevel1_1TestText ); + CleanupStack::PopAndDestroy( key ); + + // KMceAvcBitrateLevel1_2 + codec->SetAllowedBitrates( KMceAvcBitrateLevel1_2 ); + key = iLiveSession->ReadCodecConfigKeyL( *codec ); + EUNIT_ASSERT( key ); + CleanupStack::PushL( key ); + EUNIT_ASSERT_EQUALS( *key, KMusAvcBitrateLevel1_2TestText ); + CleanupStack::PopAndDestroy( key ); + + // KMceAvcBitrateLevel1_3 + codec->SetAllowedBitrates( KMceAvcBitrateLevel1_3 ); + key = iLiveSession->ReadCodecConfigKeyL( *codec ); + EUNIT_ASSERT( key ); + CleanupStack::PushL( key ); + EUNIT_ASSERT_EQUALS( *key, KMusAvcBitrateLevel1_3TestText ); + CleanupStack::PopAndDestroy( key ); + + // KMceAvcBitrateLevel2 + codec->SetAllowedBitrates( KMceAvcBitrateLevel2 ); + key = iLiveSession->ReadCodecConfigKeyL( *codec ); + EUNIT_ASSERT( key ); + CleanupStack::PushL( key ); + EUNIT_ASSERT_EQUALS( *key, KMusAvcBitrateLevel2TestText ); + CleanupStack::PopAndDestroy( key ); + + CleanupStack::PopAndDestroy( codec ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTwoWaySession::UT_StoreEncoderConfigInfoLL() + { + CRepository::iStaticWriteAvcKeysToStaticData = ETrue; + + // Try with clean CenRep + MultimediaSharingSettings::SetEncoderConfigInfoL( KNullDesC8() ); + + ESTABLISH_OUT_SESSION( iLiveSession ) // calls StoreEncoderConfigInfoL + // If StoreEncoderConfigInfoL leaves with KErrNoMemory, + // MMusEngSessionObserver::SessionFailed will be called. + if ( iLcSessionObserver->iCalledFunction == CLcSessionObserverStub::ESessionFailed ) + { + User::Leave( KErrNoMemory ); + } + + HBufC8* keys = MultimediaSharingSettings::EncoderConfigInfoLC(); + EUNIT_ASSERT_EQUALS( *keys, KMusAvcBitrateLevel_1b_ConfigKey() ) + CleanupStack::PopAndDestroy( keys ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTwoWaySession::UT_RemoteVideoPlayerL() + { + EUNIT_ASSERT( iLiveSession->RemoteVideoPlayer() == + iLiveSession->iRemoteVideoPlayer ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusEngTwoWaySession::UT_InactivityTimeoutL() + { + // Not receiving, no effect + iLiveSession->iReceiving = EFalse; + CMceVideoStream* videoStream = CMceVideoStream::NewLC(); + CMceRtpSource* rtpSource = CMceRtpSource::NewLC(); + iLiveSession->InactivityTimeout( *videoStream, *rtpSource ); + EUNIT_ASSERT( iLcSessionObserver->IsReseted() ); + + // Receiving, state change is notified and + // receiving and buffering status are cleared + iLiveSession->iBuffered = ETrue; + iLiveSession->iReceiving = ETrue; + iLiveSession->InactivityTimeout( *videoStream, *rtpSource ); + EUNIT_ASSERT_EQUALS( iLcSessionObserver->iCalledFunction, + CLcSessionObserverStub::EPlayerStateChanged ); + EUNIT_ASSERT( !iLiveSession->iReceiving ); + EUNIT_ASSERT( !iLiveSession->iBuffered ); + CleanupStack::PopAndDestroy( rtpSource ); + CleanupStack::PopAndDestroy( videoStream ); + } + + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusEngTwoWaySession, + "UT_CMusEngTwoWaySession", + "UNIT" ) + +EUNIT_TEST( + "NewL - test ", + "CMusEngTwoWaySession", + "NewL", + "FUNCTIONALITY", + SetupL, UT_NewLL, Teardown) + +EUNIT_TEST( + "EstablishLcSessionL - test ", + "CMusEngTwoWaySession", + "EstablishLcSessionL", + "FUNCTIONALITY", + SetupL, UT_EstablishLcSessionLL, Teardown) + +EUNIT_TEST( + "EnableDisplayL - test ", + "CMusEngTwoWaySession", + "EnableDisplayL", + "FUNCTIONALITY", + SetupL, UT_EnableDisplayLL, Teardown) + +EUNIT_TEST( + "SetOrientationL - test ", + "CMusEngTwoWaySession", + "SetOrientationL", + "FUNCTIONALITY", + SetupL, UT_SetOrientationLL, Teardown) + +EUNIT_TEST( + "SetLocalRectL - test ", + "CMusEngTwoWaySession", + "SetLocalRectL", + "FUNCTIONALITY", + SetupL, UT_SetLocalRectLL, Teardown) + +EUNIT_TEST( + "SetRectsL - test ", + "CMusEngTwoWaySession", + "SetRectsL", + "FUNCTIONALITY", + SetupL, UT_SetRectsLL, Teardown) + +EUNIT_TEST( + "CompleteSessionStructureL - test ", + "CMusEngTwoWaySession", + "CompleteSessionStructureL", + "FUNCTIONALITY", + SetupL, UT_CompleteSessionStructureLL, Teardown) + +EUNIT_TEST( + "HandleSessionStateChanged - test ", + "CMusEngTwoWaySession", + "HandleSessionStateChanged", + "FUNCTIONALITY", + SetupL, UT_HandleSessionStateChangedL, Teardown) + +EUNIT_TEST( + "AdjustVideoCodecL - test ", + "CMusEngTwoWaySession", + "AdjustVideoCodecL", + "FUNCTIONALITY", + SetupL, UT_AdjustVideoCodecLL, Teardown) + +EUNIT_TEST( + "AdjustAudioCodecL - test ", + "CMusEngTwoWaySession", + "AdjustAudioCodecL", + "FUNCTIONALITY", + SetupL, UT_AdjustAudioCodecLL, Teardown) + +EUNIT_TEST( + "DoCodecSelectionL- test ", + "CMusEngTwoWaySession", + "DoCodecSelectionL", + "FUNCTIONALITY", + SetupL, UT_DoCodecSelectionLL, Teardown) + +EUNIT_TEST( + "StreamStateChangedL() - test ", + "CMusEngTwoWaySession", + "StreamStateChangedL()", + "FUNCTIONALITY", + SetupL, UT_StreamStateChangedL, Teardown) + +EUNIT_TEST( + "StreamStateChangedL( src ) - test ", + "CMusEngTwoWaySession", + "StreamStateChangedL( src )", + "FUNCTIONALITY", + SetupL, UT_StreamStateChangedWithSourceL, Teardown) + +EUNIT_TEST( + "SetEncodingDeviceL - test ", + "CMusEngTwoWaySession", + "SetEncodingDeviceL", + "FUNCTIONALITY", + SetupL, UT_SetEncodingDeviceLL, Teardown) + +EUNIT_TEST( + "SetCodecConfigKeyL - test ", + "CMusEngTwoWaySession", + "SetCodecConfigKeyL", + "FUNCTIONALITY", + SetupL, UT_SetCodecConfigKeyLL, Teardown) + +EUNIT_TEST( + "ReadCodecConfigKeyL - test ", + "CMusEngTwoWaySession", + "ReadCodecConfigKeyL", + "FUNCTIONALITY", + SetupL, UT_ReadCodecConfigKeyLL, Teardown) + +EUNIT_TEST( + "StoreEncoderConfigInfoL - test ", + "CMusEngTwoWaySession", + "StoreEncoderConfigInfoL", + "FUNCTIONALITY", + SetupL, UT_StoreEncoderConfigInfoLL, Teardown) + +EUNIT_TEST( + "RemoteVideoPlayer - test ", + "CMusEngTwoWaySession", + "RemoteVideoPlayer", + "FUNCTIONALITY", + SetupL, UT_RemoteVideoPlayerL, Teardown) + +EUNIT_TEST( + "EnableLcFileL - test ", + "CMusEngTwoWaySession", + "EnableLcFileL", + "FUNCTIONALITY", + SetupL, UT_EnableLcFileL, Teardown) + +EUNIT_TEST( + "InactivityTimeout - test ", + "CMusEngTwoWaySession", + "InactivityTimeout", + "FUNCTIONALITY", + SetupL, UT_InactivityTimeoutL, Teardown) + +EUNIT_END_TEST_TABLE + +// END OF FILE + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/tsrc/ut_engine/src/ut_musenguriparser.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/tsrc/ut_engine/src/ut_musenguriparser.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,407 @@ +/* +* 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: +* +*/ + + +// INTERNAL INCLUDES +#include "ut_musenguriparser.h" +#include "musenguriparser.h" +#include "musengtestdefs.h" +#include "mussettingskeys.h" +#include "mussettings.h" + +// SYSTEM INCLUDES +#include +#include + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_TMusEngUriParser* UT_TMusEngUriParser::NewL() + { + UT_TMusEngUriParser* self = UT_TMusEngUriParser::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_TMusEngUriParser* UT_TMusEngUriParser::NewLC() + { + UT_TMusEngUriParser* self = new( ELeave ) UT_TMusEngUriParser(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_TMusEngUriParser::~UT_TMusEngUriParser() + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// Default constructor +// ----------------------------------------------------------------------------- +// +UT_TMusEngUriParser::UT_TMusEngUriParser() + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// Second phase construct +// ----------------------------------------------------------------------------- +// +void UT_TMusEngUriParser::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_TMusEngUriParser::SetupL() + { + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_TMusEngUriParser::Teardown() + { + MultimediaSharingSettings::SetOperatorVariantSettingL( + MusSettingsKeys::EStandard ); + PropertyHelper::Close(); + } + + + +// TEST CASES + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_TMusEngUriParser::UT_TMusEngUriParser_TMusEngUriParserL() + { + TMusEngUriParser parser( KTestRecipientSipUri() ); + EUNIT_ASSERT( parser.iUri == KTestRecipientSipUri8() ) + + // Too long + TBuf<520> longBuf; + longBuf.Fill('a', 520); + + TMusEngUriParser parser2( longBuf ); + EUNIT_ASSERT( parser2.iUri == KNullDesC8() ) + + } + + +#include + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_TMusEngUriParser::UT_TMusEngUriParser_GetUri8LL() + { + TMusEngUriParser parser( KTestRecipientSipUriNoSipPrefix() ); + + // No parsing done, fails + TRAPD( error, parser.GetUri8L() ); + MUS_TEST_FORWARD_ALLOC_FAILURE( error ); + EUNIT_ASSERT( error == KErrNotReady ); + + // Parse and test + parser.ParseUriL(); + + HBufC8* uri = parser.GetUri8L(); + + CleanupStack::PushL( uri ); + EUNIT_ASSERT( *uri == KTestRecipientSipUri8() ); + CleanupStack::PopAndDestroy( uri ); + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_TMusEngUriParser::UT_TMusEngUriParser_GetUri16LL() + { + TMusEngUriParser parser( KTestRecipientSipUriNoSipPrefix() ); + + // No parsing done, fails + TRAPD( error, parser.GetUri16L( ETrue ) ); + MUS_TEST_FORWARD_ALLOC_FAILURE( error ); + EUNIT_ASSERT( error == KErrNotReady ); + + // Parse and test + parser.ParseUriL(); + + HBufC16* uri = parser.GetUri16L( ETrue ); + + CleanupStack::PushL( uri ); + EUNIT_ASSERT( *uri == KTestRecipientSipUri() ); + CleanupStack::PopAndDestroy( uri ); + + uri = parser.GetUri16L( EFalse ); + + CleanupStack::PushL( uri ); + EUNIT_ASSERT( *uri == KTestRecipientSipUriNoSipPrefix() ); + CleanupStack::PopAndDestroy( uri ); + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_TMusEngUriParser::UT_TMusEngUriParser_ParseUriLL() + { + TMusEngUriParser parser( KTestRecipientSipUri() ); + + // Succesful case, sip uri + parser.ParseUriL(); + EUNIT_ASSERT_EQUALS( parser.iUri, KTestRecipientSipUri8() ); + + // Succesful case, sip uri with uppercase prefix + parser.iUri = KTestRecipientSipUriPrefixUpperCase8(); + parser.ParseUriL(); + EUNIT_ASSERT_EQUALS( parser.iUri, KTestRecipientSipUri8() ); + + // Succesful case, secure sip uri + _LIT8( KTestRecipientSipsUriPrefix8, "sips:testrecipient@host.domain" ); + parser.iUri = KTestRecipientSipsUriPrefix8(); + parser.ParseUriL(); + EUNIT_ASSERT_EQUALS( parser.iUri, KTestRecipientSipsUriPrefix8() ); + + // Succesful case, secure sip uri with uppercase prefix + _LIT8( KTestRecipientSipsUriPrefixUpperCase8, "SIPS:testrecipient@host.domain" ); + parser.iUri = KTestRecipientSipsUriPrefixUpperCase8(); + parser.ParseUriL(); + EUNIT_ASSERT_EQUALS( parser.iUri, KTestRecipientSipsUriPrefix8() ); + + // Succesful case, tel uri + parser.iUri = KTestRecipientTelUri8(); + parser.ParseUriL(); + EUNIT_ASSERT_EQUALS( parser.iUri, KTestRecipientTelUri8() ); + + // Succesful case, sip uri added + parser.iUri = KTestRecipientSipUriNoSipPrefix8(); + parser.ParseUriL(); + EUNIT_ASSERT_EQUALS( parser.iUri, KTestRecipientSipUri8() ); + + // Succesful case, tel uri added + parser.iUri = KTestRecipientTelUriNoTelPrefix8(); + parser.ParseUriL(); + EUNIT_ASSERT_EQUALS( parser.iUri, KTestRecipientTelUri8() ); + + // Succesfull case, valid number with separators + _LIT8( KTestTelUriWithSomeWildChars, " +358 (1) [11-]{1}111 " ); + _LIT8( KTestTelUriWithPrefixAndSomeWildChars, "tel:+358 (1) [11-]{1}111" ); + + parser.iUri = KTestTelUriWithSomeWildChars(); + parser.ParseUriL(); + EUNIT_ASSERT_EQUALS( parser.iUri, KTestRecipientTelUri8() ); + + parser.iUri = KTestTelUriWithPrefixAndSomeWildChars(); + parser.ParseUriL(); + EUNIT_ASSERT_EQUALS( parser.iUri, KTestRecipientTelUri8() ); + + // Unsuccessful case, random string + parser.iUri = KTestRecipientRandomText8(); + TRAPD( error, parser.ParseUriL() ); + MUS_TEST_FORWARD_ALLOC_FAILURE( error ); + EUNIT_ASSERT_EQUALS( error, KErrArgument ); + + // Unsuccessful case, tel prefix and at sign present + parser.iUri = KTestRecipientTelUriWithAtSign8(); + TRAP( error, parser.ParseUriL() ); + MUS_TEST_FORWARD_ALLOC_FAILURE( error ); + EUNIT_ASSERT_EQUALS( error, KErrCorrupt ); + + // Unsuccessful case, plus sign and non-numeric characters + parser.iUri = KTestRecipientTelUriWithXCharAtEnd8(); + TRAP( error, parser.ParseUriL() ); + MUS_TEST_FORWARD_ALLOC_FAILURE( error ); + EUNIT_ASSERT_EQUALS( error, KErrCorrupt ); + + parser.iUri = KTestRecipientTelUriWithXCharAtStart8(); + TRAP( error, parser.ParseUriL() ); + MUS_TEST_FORWARD_ALLOC_FAILURE( error ); + EUNIT_ASSERT_EQUALS( error, KErrCorrupt ); + + // Unsuccesful case, name too long to be able to add sip prefix + parser.iUri.Fill('a', 510); + parser.iUri.Replace( 0, + KTestRecipientSipUriNoSipPrefix8().Length(), + KTestRecipientSipUriNoSipPrefix8() ); + + TRAP( error, parser.ParseUriL() ); + MUS_TEST_FORWARD_ALLOC_FAILURE( error ); + EUNIT_ASSERT_EQUALS( error, KErrCorrupt ); + + // Unsuccesful case, name too long to be able to add tel prefix + parser.iUri.Fill('1', 510); + parser.iUri.Replace( 0, + KTestRecipientTelUriNoTelPrefix8().Length(), + KTestRecipientTelUriNoTelPrefix8() ); + + TRAP( error, parser.ParseUriL() ); + MUS_TEST_FORWARD_ALLOC_FAILURE( error ); + EUNIT_ASSERT_EQUALS( error, KErrCorrupt ); + + // test cases for operator variant + // set operator variant + MultimediaSharingSettings::SetOperatorVariantSettingL( + MusSettingsKeys::EOperatorSpecific ); + + EUNIT_ASSERT_EQUALS( MusSettingsKeys::EOperatorSpecific, + MultimediaSharingSettings::OperatorVariantSettingL() ); + + //local number cases without tel prefix + // Successful case + parser.iUri = KTestRecipientLocalTelUriNoTelPrefix8(); + parser.ParseUriL(); + EUNIT_ASSERT_EQUALS( parser.iUri, KTestRecipientLocalTelUri8() ); + + // Unsuccesful case, uri too long to be able to add tel prefix + parser.iUri = KTestRecipientLocalTelUriNoTelPrefix8(); + parser.iUri.Fill('1', 510); + + TRAP( error, parser.ParseUriL() ); + MUS_TEST_FORWARD_ALLOC_FAILURE( error ); + EUNIT_ASSERT_EQUALS( error, KErrCorrupt ); + + // Unsuccessful case, crap uri + parser.iUri = KTestRecipientLocalTelUriNoTelPrefixWithXCharAtEnd8(); + TRAP( error, parser.ParseUriL() ); + MUS_TEST_FORWARD_ALLOC_FAILURE( error ); + EUNIT_ASSERT_EQUALS( error, KErrCorrupt ); + + // Unsuccessful case, crap uri + parser.iUri = KTestRecipientLocalTelUriNoTelPrefixWithXCharAtStart8(); + TRAP( error, parser.ParseUriL() ); + MUS_TEST_FORWARD_ALLOC_FAILURE( error ); + EUNIT_ASSERT_EQUALS( error, KErrCorrupt ); + + // Unsuccessful case, crap uri + parser.iUri = KTestRecipientLocalTelUriNoTelPrefixWithXCharAtMiddle8(); + TRAP( error, parser.ParseUriL() ); + MUS_TEST_FORWARD_ALLOC_FAILURE( error ); + EUNIT_ASSERT_EQUALS( error, KErrCorrupt ); + + //local number cases with tel prefix + // Successful case + parser.iUri = KTestRecipientLocalTelUri8(); + parser.ParseUriL(); + EUNIT_ASSERT_EQUALS( parser.iUri, KTestRecipientLocalTelUri8() ); + + // Successful case, prefix uppercase + parser.iUri = KTestRecipientLocalTelUriPrefixUpperCase8(); + parser.ParseUriL(); + EUNIT_ASSERT_EQUALS( parser.iUri, KTestRecipientLocalTelUri8() ); + + // Unsuccessful case, crap uri + parser.iUri = KTestRecipientLocalTelUriWithXCharAtEnd8(); + TRAP( error, parser.ParseUriL() ); + MUS_TEST_FORWARD_ALLOC_FAILURE( error ); + EUNIT_ASSERT_EQUALS( error, KErrCorrupt ); + + // Unsuccessful case, crap uri + parser.iUri = KTestRecipientLocalTelUriWithXCharAtStart8(); + TRAP( error, parser.ParseUriL() ); + MUS_TEST_FORWARD_ALLOC_FAILURE( error ); + EUNIT_ASSERT_EQUALS( error, KErrCorrupt ); + + // Unsuccessful case, crap uri + parser.iUri = KTestRecipientLocalTelUriWithXCharAtMiddle8(); + TRAP( error, parser.ParseUriL() ); + MUS_TEST_FORWARD_ALLOC_FAILURE( error ); + EUNIT_ASSERT_EQUALS( error, KErrCorrupt ); + + // Unsuccessful case, crap uri + parser.iUri = KTestRecipientLocalTelUriTelPrefixAtMiddle8(); + TRAP( error, parser.ParseUriL() ); + MUS_TEST_FORWARD_ALLOC_FAILURE( error ); + EUNIT_ASSERT_EQUALS( error, KErrCorrupt ); + } + + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_TMusEngUriParser, + "UT_TMusEngUriParser", + "UNIT" ) + +EUNIT_TEST( + "TMusEngUriParser - test ", + "TMusEngUriParser", + "TMusEngUriParser", + "FUNCTIONALITY", + SetupL, UT_TMusEngUriParser_TMusEngUriParserL, Teardown) + +EUNIT_TEST( + "GetUri8L - test ", + "TMusEngUriParser", + "GetUri8L", + "FUNCTIONALITY", + SetupL, UT_TMusEngUriParser_GetUri8LL, Teardown) + +EUNIT_TEST( + "GetUri16L - test ", + "TMusEngUriParser", + "GetUri16L", + "FUNCTIONALITY", + SetupL, UT_TMusEngUriParser_GetUri16LL, Teardown) + +EUNIT_TEST( + "ParseUriL - test ", + "TMusEngUriParser", + "ParseUriL", + "FUNCTIONALITY", + SetupL, UT_TMusEngUriParser_ParseUriLL, Teardown) + + + +EUNIT_END_TEST_TABLE + +// END OF FILE + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshengine/tsrc/ut_engine/src/ut_muspropertywatch.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshengine/tsrc/ut_engine/src/ut_muspropertywatch.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,268 @@ +/* +* 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: +* +*/ + + +// INTERNAL INCLUDES +#include "ut_muspropertywatch.h" +#include "muspropertywatch.h" + +#include "mussessionproperties.h" + +// SYSTEM INCLUDES +#include +#include + +using namespace NMusSessionApi; + +const TInt KMusUiTestKey = 1100; +const TInt KMusUiTestPropertyReadInteger = 200; +_LIT( KMusUiTestPropertyReadDesc, "testread" ); +TUid KMusUiDummyUid = { 1000 }; // Unit testing dummy + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusPropertyWatch* UT_CMusPropertyWatch::NewL() + { + UT_CMusPropertyWatch* self = UT_CMusPropertyWatch::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusPropertyWatch* UT_CMusPropertyWatch::NewLC() + { + UT_CMusPropertyWatch* self = new( ELeave ) UT_CMusPropertyWatch(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusPropertyWatch::~UT_CMusPropertyWatch() + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// Default constructor +// ----------------------------------------------------------------------------- +// +UT_CMusPropertyWatch::UT_CMusPropertyWatch() + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// Second phase construct +// ----------------------------------------------------------------------------- +// +void UT_CMusPropertyWatch::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusPropertyWatch::SetupL() + { + PropertyHelper::SetErrorCode( KErrNone ); + RProperty::Set( KMusUiDummyUid, KMusUiTestKey, KMusUiTestPropertyReadInteger ); + iPropertyWatch = CMusPropertyWatch::NewL( iPropertyObserver, + KMusUiDummyUid, + KMusUiTestKey ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusPropertyWatch::Teardown() + { + delete iPropertyWatch; + PropertyHelper::Close(); + } + + + +// TEST CASES + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusPropertyWatch::UT_CMusPropertyWatch_ReadIntPropertyLL() + { + + // Teesting leave + PropertyHelper::SetErrorCode( KErrNotFound ); + RProperty::Set( KMusUiDummyUid, KMusUiTestKey, KMusUiTestPropertyReadInteger ); + TInt value; + TRAPD( err, value = CMusPropertyWatch::ReadIntPropertyL( KMusUiTestKey ) ); + EUNIT_ASSERT( err == KErrNotFound ); + + // Testing return value + PropertyHelper::SetErrorCode( KErrNone ); + RProperty::Set( KMusUiDummyUid, KMusUiTestKey, KMusUiTestPropertyReadInteger ); + EUNIT_ASSERT( CMusPropertyWatch::ReadIntPropertyL( KMusUiTestKey ) == + KMusUiTestPropertyReadInteger ); + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusPropertyWatch::UT_CMusPropertyWatch_ReadDescPropertyLL() + { + // Teesting leave + PropertyHelper::SetErrorCode( KErrNotFound ); + TRAPD( err, CMusPropertyWatch::ReadDescPropertyL( KMusUiTestKey ) ); + EUNIT_ASSERT( err == KErrNotFound ); + + // Testing return value + RProperty::Set( KMusUiDummyUid, KMusUiTestKey, KMusUiTestPropertyReadDesc ); + PropertyHelper::SetErrorCode( KErrNone ); + HBufC* result = CMusPropertyWatch::ReadDescPropertyL( KMusUiTestKey ); + CleanupStack::PushL( result ); + EUNIT_ASSERT( KMusUiTestPropertyReadDesc().Compare( result->Des() ) == 0 ); + CleanupStack::PopAndDestroy( result ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusPropertyWatch::UT_CMusPropertyWatch_DoCancelL() + { + PropertyHelper::SetErrorCode( KErrNone ); + iPropertyWatch->Cancel(); + EUNIT_ASSERT( PropertyHelper::GetCalledFunction() == RProperty::ECancel ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusPropertyWatch::UT_CMusPropertyWatch_RunLL() + { + + // Leave test + PropertyHelper::SetErrorCode( KErrNotFound ); + iPropertyWatch->Cancel(); + TRAPD( err, iPropertyWatch->RunL() ); + EUNIT_ASSERT( err == KErrNotFound ); + + + // SessionPropertyChanged + PropertyHelper::SetErrorCode( KErrNone ); + iPropertyWatch->Cancel(); + iPropertyWatch->RunL(); + EUNIT_ASSERT( iPropertyObserver.iCalledFunction == + TMusPropertyObserverStub::EPropertyChanged ); + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusPropertyWatch::UT_CMusPropertyWatch_RunErrorL() + { + + // Allways returns KErrNone + PropertyHelper::SetErrorCode( KErrNone ); + EUNIT_ASSERT( iPropertyWatch->RunError( KErrNotFound ) == KErrNone ); + + // is right observer called + PropertyHelper::SetErrorCode( KErrNone ); + EUNIT_ASSERT( iPropertyObserver.iCalledFunction == + TMusPropertyObserverStub::EHandlePropertyError ); + } + + + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusPropertyWatch, + "UT_CMusPropertyWatch", + "UNIT" ) + +EUNIT_TEST( + "ReadIntPropertyLL - test ", + "CMusPropertyWatch", + "ReadIntPropertyLL", + "FUNCTIONALITY", + SetupL, UT_CMusPropertyWatch_ReadIntPropertyLL, Teardown) + +EUNIT_TEST( + "ReadDescPropertyLL - test ", + "CMusPropertyWatch", + "ReadDescPropertyLL", + "FUNCTIONALITY", + SetupL, UT_CMusPropertyWatch_ReadDescPropertyLL, Teardown) + +EUNIT_TEST( + "DoCancelL - test ", + "CMusPropertyWatch", + "DoCancelL", + "FUNCTIONALITY", + SetupL, UT_CMusPropertyWatch_DoCancelL, Teardown) + +EUNIT_TEST( + "RunLL - test ", + "CMusPropertyWatch", + "RunLL", + "FUNCTIONALITY", + SetupL, UT_CMusPropertyWatch_RunLL, Teardown) + +EUNIT_TEST( + "RunErrorL - test ", + "CMusPropertyWatch", + "RunErrorL", + "FUNCTIONALITY", + SetupL, UT_CMusPropertyWatch_RunErrorL, Teardown) + + +EUNIT_END_TEST_TABLE + + +// END OF FILE + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshindicator/bwins/musindicatoru.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshindicator/bwins/musindicatoru.def Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,7 @@ +EXPORTS + ?ConfirmationQueryL@CMusIndicatorApi@@SAHW4TVsPopupQuery@1@@Z @ 1 NONAME ; int CMusIndicatorApi::ConfirmationQueryL(enum CMusIndicatorApi::TVsPopupQuery) + ?IndicateAvailabilityL@CMusIndicatorApi@@QAEXXZ @ 2 NONAME ; void CMusIndicatorApi::IndicateAvailabilityL(void) + ?NewL@CMusIndicatorApi@@SAPAV1@AAVMMusIndicatorObserver@@@Z @ 3 NONAME ; class CMusIndicatorApi * CMusIndicatorApi::NewL(class MMusIndicatorObserver &) + ?NewLC@CMusIndicatorApi@@SAPAV1@AAVMMusIndicatorObserver@@@Z @ 4 NONAME ; class CMusIndicatorApi * CMusIndicatorApi::NewLC(class MMusIndicatorObserver &) + ?NewL@CMusIndicatorApi@@SAPAV1@XZ @ 5 NONAME ; class CMusIndicatorApi * CMusIndicatorApi::NewL(void) + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshindicator/data/musindicator.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshindicator/data/musindicator.rss Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,65 @@ +/* +* 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: Resource definitions for project MuS indicator +* +*/ + + + +#include // localization +#include //localization +#include +#include + + +// 4 letter ID +NAME MIND + + +RESOURCE RSS_SIGNATURE { } + + +// ----------------------------------------------------------------------------- +// r_musindicator_manual_activation_txt +// Note shown to user while trying to activate VS whilst roaming and VS +// activation setting is set to "Aut. in home network only". +// ----------------------------------------------------------------------------- +// +RESOURCE TBUF r_musindicator_manual_activation_txt + { + buf = qtn_msh_note_manual_activation; + } + + +// ----------------------------------------------------------------------------- +// r_musindicator_note_capability_txt +// Displays a query to start live video to user. +// ----------------------------------------------------------------------------- +// +RESOURCE TBUF r_musindicator_note_capability_txt + { + buf = qtn_msh_note_capability; + } + + +// ----------------------------------------------------------------------------- +// r_musindicator_note_vsready_txt +// Informational text to tell that videosharing is ready to be used. +// ----------------------------------------------------------------------------- +// +RESOURCE TBUF r_musindicator_note_vsready_txt + { + buf = qtn_msh_note_vsready; + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshindicator/data/tone.amr Binary file mmsharing/mmshindicator/data/tone.amr has changed diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshindicator/eabi/musindicatoru.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshindicator/eabi/musindicatoru.def Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,13 @@ +EXPORTS + _ZN16CMusIndicatorApi18ConfirmationQueryLENS_13TVsPopupQueryE @ 1 NONAME + _ZN16CMusIndicatorApi21IndicateAvailabilityLEv @ 2 NONAME + _ZN16CMusIndicatorApi4NewLER21MMusIndicatorObserver @ 3 NONAME + _ZN16CMusIndicatorApi5NewLCER21MMusIndicatorObserver @ 4 NONAME + _ZTI15CMusSoundPlayer @ 5 NONAME ; ## + _ZTI16CMusIndicatorApi @ 6 NONAME ; ## + _ZTI16CMusIndicatorDsa @ 7 NONAME ; ## + _ZTV15CMusSoundPlayer @ 8 NONAME ; ## + _ZTV16CMusIndicatorApi @ 9 NONAME ; ## + _ZTV16CMusIndicatorDsa @ 10 NONAME ; ## + _ZN16CMusIndicatorApi4NewLEv @ 11 NONAME + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshindicator/graphics/qgn_mus_ready.bmp Binary file mmsharing/mmshindicator/graphics/qgn_mus_ready.bmp has changed diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshindicator/graphics/qgn_mus_ready_mask.bmp Binary file mmsharing/mmshindicator/graphics/qgn_mus_ready_mask.bmp has changed diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshindicator/graphics/qgn_mus_ready_mask_soft.bmp Binary file mmsharing/mmshindicator/graphics/qgn_mus_ready_mask_soft.bmp has changed diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshindicator/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshindicator/group/bld.inf Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,34 @@ +/* +* 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: Build information file for MuS indicator. +* +*/ +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../data/tone.amr /epoc32/data/z/private/1028238d/tone.amr + +PRJ_MMPFILES +musindicator.mmp + +PRJ_EXTENSIONS +START EXTENSION s60/mifconv +OPTION TARGETFILE musindicatoricons.mif +OPTION HEADERFILE musindicatoricons.mbg +OPTION SOURCEDIR ../graphics +OPTION SOURCES -c24,8 qgn_mus_ready +END diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshindicator/group/musindicator.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshindicator/group/musindicator.mmp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,70 @@ +/* +* 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: Project definition file for project MuS Settings UI test +* +*/ + + +#include +#include +#include "../../../inc/musuid.hrh" + +TARGET musindicator.dll +TARGETTYPE dll +TARGETPATH /sys/bin +UID 0x0 KMusIndicatorUid + +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + +SOURCEPATH ../data +START RESOURCE musindicator.rss +HEADER +LANGUAGE_IDS +TARGETPATH RESOURCE_FILES_DIR +END // RESOURCE + +SOURCEPATH ../src +SOURCE musindicatorapi.cpp +SOURCE mussoundplayer.cpp +SOURCE musindicatordsa.cpp +SOURCE musresourceutil.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../mmshshared/inc +USERINCLUDE ../../inc +USERINCLUDE ../../../inc + +APP_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY bafl.lib +LIBRARY aknnotify.lib +LIBRARY eiksrv.lib +LIBRARY flogger.lib // RFileLogger +LIBRARY centralrepository.lib +LIBRARY commonengine.lib // RConeResourceLoader +LIBRARY efsrv.lib +LIBRARY mediaclientaudio.lib +LIBRARY ws32.lib // Window server +LIBRARY bitgdi.lib // +LIBRARY gdi.lib // Font +LIBRARY fntstr.lib +LIBRARY fbscli.lib // Font and bitmap server +LIBRARY cone.lib +LIBRARY aknskins.lib // Avkon Skins Utils +LIBRARY avkon.lib // Avkon Utils +LIBRARY eikcore.lib // Eikon core controls API + +PAGED diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshindicator/inc/musindicatordsa.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshindicator/inc/musindicatordsa.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,186 @@ +/* +* 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: Draws availability indication to screen using direct screen +* access. +* +*/ + + + +#ifndef C_MUSINDICATORDSA_H +#define C_MUSINDICATORDSA_H + + +#include "musunittesting.h" +#include +#include +#include + +const TInt KMusIndicatorDelay = 400000; +const TInt KMusRedrawDelay = 25000; + +/** + * CMusIndicatorDsa provides multimedia sharing ready indicator "box" + * indcating videosharing availability to user. + * + * @code + * // Activates indication + * CMusIndicatorDsa* dsa = CMusIndicatorDsa::NewL(); + * + * // Deactivates indication + * delete dsa; + * + * @endcode + * + * @lib musindicator.lib + */ +class CMusIndicatorDsa : public CCoeControl + { +public: + + MUS_UNITTEST( UT_CMusIndicatorDsa ) + + static CMusIndicatorDsa* NewL(); + + /** + * Destructor. + */ + ~CMusIndicatorDsa(); + + +public: //from CCoeControl + + + /** + * Draws video sharing ready box and text + */ + void Draw( const TRect& aRect ) const; + + /** + * Hanldes resource change i.e layout change + * + */ + void HandleResourceChange( TInt aType); + +private: + + /** + * Initializes + */ + void Initialize(); + + /** + * Loads image. + */ + void LoadImageL(); + + /** + * Loads resource string. + */ + void LoadResourceStringL(); + + +private: + + CMusIndicatorDsa(); + + void ConstructL(); + + const CFont& Font() const; + + void TryActivateL(); + + + /** + * Callback function to periodic timer. + * + * @param instanse of this. + * @return TInt value indicating if function completed succesfully + */ + static TInt TryActivate( TAny* aThis ); + + /** + * Callback function to periodic timer. + * + * @param instanse of this. + * @return TInt value indicating if function completed succesfully + */ + static TInt DoHandleResourceChange( TAny* aThis ); + + void StartPeriodicTimer( const TCallBack& aCallBack) const; + + /** + * Stops peridoic timer. + */ + void StopPeriodicTimer(); + + +private: // data + + + /** + * Periodic timer. + * Own. + */ + CPeriodic* iPeriodic; + + /** + * Used screen rectangle. + */ + TRect iScreenRect; + + /** + * Used client area size + */ + TSize iScreenSize; + + /** + * Calculated position of left-top point of text. + */ + TPoint iTextpos; + + /** + * Color of DSA boxes border. + */ + TRgb iBorderColor; + + /** + * DSA boxes background color. + */ + TRgb iBorderBgColor; + + /** + * Color of used font. + */ + TRgb iFontColor; + + /** + * Displayed text. + * Own. + */ + HBufC* iText; + + CFbsBitmap* iIcon; + CFbsBitmap* iIconMask; + + TSize iImageSize; + TPoint iImagepos; + + TCallBack iActivateCallBack; + TCallBack iRedrawCallBack; + + + }; + +#endif // C_MUSINDICATORDSA_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshindicator/inc/musresourceutil.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshindicator/inc/musresourceutil.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,100 @@ +/* +* 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: Provides means to read strings from resource files. +* +*/ + + + +#ifndef MUSRESOURCEUTIL_H +#define MUSRESOURCEUTIL_H + + +#include "musunittesting.h" +#include + + +/** Resource filename for musindicator.dll */ +_LIT( KMusIndicatorResource, "musindicator.rsc" ); + + +/** + * MusResourceUtil retrieves strings from resourcefiles. + * + * @code + * HBufC* text = ReadResourceString16L( R_SOME_STRING_ID, KResourceFileName ); + * @endcode + * + * @lib musindicator.lib + */ +class MusResourceUtil + { + +public: + + /** + * Reads resource string. + * + * @param aId Identifier of the resource to be read. + * @param aFilename Name of used resource file. + * @return Text containing resource string. Ownership is transferred. + */ + static HBufC16* ReadResourceString16LC( TUint aId, const TDesC& aFilename ); + + /** + * Reads resource string. + * + * @param aId Identifier of the resource to be read. + * @param aFilename Name of used resource file. + * @return Text containing resource string. Ownership is transferred. + */ + static HBufC16* ReadResourceString16L( TUint aId, const TDesC& aFilename ); + + /** + * Reads resource string. + * + * @param aId Identifier of the resource to be read. + * @param aFilename Name of used resource file. + * @return Text containing resource string. Ownership is transferred. + */ + static HBufC8* ReadResourceString8LC( TUint aId, const TDesC& aFilename ); + + /** + * Reads resource string. + * + * @param aId Identifier of the resource to be read. + * @param aFilename Name of used resource file. + * @return Text containing resource string. Ownership is transferred. + */ + static HBufC8* ReadResourceString8L( TUint aId, const TDesC& aFilename ); + + /** + * Converts HBufC8 to HBufC. + * + * @param aText Text to be converted. + * @return Text converted text. Ownership is transferred. + */ + static HBufC* ConvertResourceStringLC( const TDesC8& aText ); + + /** + * Constructs name of resource file. + * + * @param aFilename Name of resource file (eg. file.rsc). + * @return Text containing resource filename. Ownership is transferred. + */ + static HBufC* ResourceFilenameLC( const TDesC& aFilename ); + + }; + +#endif // MUSRESOURCEUTIL_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshindicator/inc/mussoundplayer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshindicator/inc/mussoundplayer.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,172 @@ +/* +* 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: Provides means to play custom indication sound. +* +*/ + + + +#ifndef C_MUSSOUNDPLAYER_H +#define C_MUSSOUNDPLAYER_H + + +#include "musunittesting.h" +#include "mussoundplayerobserver.h" +#include +#include + + +/** + * CMusSoundPlayer provides means to play custom indication sounds. + * + * @code + * void CMyClass::PlaySoundL() + * { + * if ( iPlayer ) + * { + * User::Leave( KErrInUse ); + * } + * iPlayer = CMusSoundPlayer::NewL( *this ); + * TRAPD( error, iPlayer->PlayL( CMusSoundPlayer::EVsAvailableSound ) ); + * if ( error ) + * { + * delete iPlayer; + * iPlayer = NULL; + * User::Leave( error ); + * } + * } + * + * // from MMusSoundPlayerObserver + * void CMyClass::PlaySoundComplete( TInt aError ) + * { + * delete iPlayer; + * iPlayer = NULL; + * } + * + * void CMyClass::~CMyClass() + * { + * delete iPlayer; + * iPlayer = NULL; + * } + * @endcode + * + * @lib musindicator.lib + */ +class CMusSoundPlayer : public CBase, protected MMdaAudioPlayerCallback + { +public: + + MUS_UNITTEST( UT_CMusSoundPlayer ) + + /** VS sound indications */ + enum TVsSoundIndication + { + EVsAvailableSound // Plays sound associated to VS becoming available. + }; + + /** + * Two-phased constructor. + * + * @param aObserver Reference to observer interface. + * @return Pointer to newly instantiated CMusSoundPlayer. + */ + static CMusSoundPlayer* NewL( MMusSoundPlayerObserver& aObserver ); + + /** + * Two-phased constructor. + * + * @param aObserver Reference to observer interface. + * @return Pointer to newly instantiated CMusSoundPlayer. + */ + static CMusSoundPlayer* NewLC( MMusSoundPlayerObserver& aObserver ); + + /** + * Destructor. + */ + ~CMusSoundPlayer(); + + /** + * Plays selected sound. + * + * @param aIndication Identifies the played sound. + */ + void PlayL( TVsSoundIndication aIndication ); + + /** + * Stops playing sound. + */ + void Stop(); + +protected: + +// from base class MMdaAudioPlayerCallback. + + /** + * From MMdaAudioPlayerCallback. + * Informs that initializing an audio sample has completed. + * + * @param aError Systemwide errorcode. + * @param aDuration Duration of the sample. + */ + virtual void MapcInitComplete( TInt aError, const TTimeIntervalMicroSeconds& aDuration ); + + /** + * From MMdaAudioPlayerCallback. + * Informs that playing an audio sample has completed. + * + * @param aError Systemwide errorcode. + */ + virtual void MapcPlayComplete( TInt aError ); + +private: + + CMusSoundPlayer( MMusSoundPlayerObserver& aObserver ); + + void ConstructL(); + + /** + * Returns sound file name associated with event. + * + * @param aIndication Identifies sound to return filename for. + * @return Buffer containing filename of sound. Ownership is transferred. + */ + HBufC* SoundFileNameLC( TVsSoundIndication aIndication ); + + /** Internal state. */ + enum TMusSoundPlayerState + { + ESoundPlayerReady, + ESoundPlayerPlaying + }; + +private: // data + + /** + * Reference to observer interface. + */ + MMusSoundPlayerObserver& iObserver; + + /** + * Internal state. + */ + TMusSoundPlayerState iState; + + /** + * Instance of MDA audio player. + * Own. + */ + CMdaAudioPlayerUtility* iMdaPlayer; + }; + +#endif // C_MUSSOUNDPLAYER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshindicator/src/musindicatorapi.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshindicator/src/musindicatorapi.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,495 @@ +/* +* 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: MusIndicatorApi provides means to show notes and indicate +* availability of videosharing to user. +* +*/ + + + +#include "musindicatorapi.h" +#include "musresourcefinderutil.h" +#include "muslogger.h" +#include "musindicatordsa.h" +#include "mussettings.h" +#include "mussettingskeys.h" +#include "mussoundplayer.h" +#include "musresourceutil.h" +#include +#include +#include +#include + + +const TInt KMusLiveSharingQueryTimeout = 5000000; + + +// ======== MEMBER FUNCTIONS ======== + +using namespace MusSettingsKeys; + + +EXPORT_C CMusIndicatorApi* CMusIndicatorApi::NewL( MMusIndicatorObserver& aObserver ) + { + CMusIndicatorApi* self = CMusIndicatorApi::NewLC( aObserver ); + CleanupStack::Pop( self ); + return self; + } + + +EXPORT_C CMusIndicatorApi* CMusIndicatorApi::NewLC( MMusIndicatorObserver& aObserver ) + { + CMusIndicatorApi* self = new (ELeave) CMusIndicatorApi( &aObserver ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +EXPORT_C CMusIndicatorApi* CMusIndicatorApi::NewL() + { + CMusIndicatorApi* self = new (ELeave) CMusIndicatorApi( NULL ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +CMusIndicatorApi::~CMusIndicatorApi() + { + MUS_LOG( "mus: [MUSIND ] -> MusIndicatorApi::~CMusIndicatorApi" ); + + Cancel(); + delete iQuery; + delete iIndicatorWindow; + delete iSoundPlayer; + delete iLiveSharingQueryTimeout; + if ( !IsSubscriber() ) + { + Indicator( EFalse ); + } + + iProperty.Close(); + + MUS_LOG( "mus: [MUSIND ] <- MusIndicatorApi::~CMusIndicatorApi" ); + } + + +TBool CMusIndicatorApi::IsSubscriber() const + { + return !iObserver; + } + + + +// --------------------------------------------------------------------------- +// Provides a confirmation query to user and returns true if user selected +// "yes". +// --------------------------------------------------------------------------- +// +EXPORT_C TBool CMusIndicatorApi::ConfirmationQueryL( TVsPopupQuery aQuery ) + { + MUS_LOG( "mus: [MUSIND ] -> MusIndicatorApi::ConfirmationQueryL" ); + + CAknGlobalConfirmationQuery* dlg = CAknGlobalConfirmationQuery::NewLC(); + TRequestStatus status( KRequestPending ); + HBufC* prompt = NoteTextLC( aQuery ); + dlg->ShowConfirmationQueryL( status, *prompt, R_AVKON_SOFTKEYS_YES_NO ); + User::WaitForRequest( status ); + CleanupStack::PopAndDestroy( prompt ); + CleanupStack::PopAndDestroy( dlg ); + MUS_LOG( "mus: [MUSIND ] <- MusIndicatorApi::ConfirmationQueryL" ); + return status == EAknSoftkeyYes; + } + +// --------------------------------------------------------------------------- +// Indicates VS availability to user. +// In operator specific variant this can include a popup-note, DSA note and +// an audio tone played with CMdaAudioPlayerUtility. +// --------------------------------------------------------------------------- +// +EXPORT_C void CMusIndicatorApi::IndicateAvailabilityL() + { + MUS_LOG( "mus: [MUSIND] -> CMusIndicatorApi::IndicateAvailabilityL" ) + __ASSERT_ALWAYS( !IsSubscriber(), User::Leave( KErrArgument ) ); + + Indicator( ETrue ); + + if( MultimediaSharingSettings::PopupNotificationSettingL() == + EPopupNotificationOn ) + { + // Show dialog + MUS_LOG( "mus: [MUSIND] CMusIndicatorApi::IndicateAvailabilityL - Show popup" ) + ShowLiveSharingQueryL( EFalse ); + } + + if( MultimediaSharingSettings::AuditoryNotificationSettingL() == + EAuditoryNotificationOn ) + { + MUS_LOG( "mus: [MUSIND] CMusIndicatorApi::IndicateAvailabilityL - Play tone" ) + PlayToneL(); + } + + MUS_LOG( "mus: [MUSIND] <- CMusIndicatorApi::IndicateAvailabilityL" ) + } + + +// --------------------------------------------------------------------------- +// From CActive. +// Handles completion of an outstanding asynchronous request. +// --------------------------------------------------------------------------- +// +void CMusIndicatorApi::RunL() + { + MUS_LOG( "mus: [MUSIND] <- CMusIndicatorApi::RunL" ) + + if ( !IsSubscriber() ) + { + MUS_LOG( "mus: [MUSIND ] : publisher" ) + StartLiveSharingL(); + } + else + { + MUS_LOG( "mus: [MUSIND ] : subscriber" ) + ToggleIndicatorL(); + } + + MUS_LOG( "mus: [MUSIND] -> CMusIndicatorApi::RunL" ) + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMusIndicatorApi::StartLiveSharingL() + { + MUS_LOG( "mus: [MUSIND] -> CMusIndicatorApi::StartLiveSharingL" ) + delete iQuery; + iQuery = NULL; + + if( iLiveSharingQueryTimeout ) + { + iLiveSharingQueryTimeout->Cancel(); + } + delete iLiveSharingQueryTimeout; + iLiveSharingQueryTimeout = NULL; + + if( iStatus.Int() != KErrNotFound ) // eq. Cancel -button + { + if ( iObserver ) + { + iObserver->StartLiveSharingL(); + } + } + + MUS_LOG( "mus: [MUSIND] <- CMusIndicatorApi::StartLiveSharingL" ) + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMusIndicatorApi::ToggleIndicatorL() + { + MUS_LOG( "mus: [MUSIND] -> CMusIndicatorApi::ToggleIndicatorL" ) + TInt val; + + + + User::LeaveIfError( RProperty::Get( KPSUidCoreApplicationUIs, + KCoreAppUIsVideoSharingIndicator, + val ) ); + iProperty.Subscribe( iStatus ); + SetActive(); + + TBool on = ( val == ECoreAppUIsVideoSharingIndicatorOn ); + + if ( on && !iIndicatorWindow + && MultimediaSharingSettings::OperatorVariantSettingL() == + EOperatorSpecific ) + { + iIndicatorWindow = CMusIndicatorDsa::NewL(); + } + else if ( !on ) + { + delete iIndicatorWindow; + iIndicatorWindow = NULL; + } + else + { + //NOP + } + + MUS_LOG( "mus: [MUSIND] <- CMusIndicatorApi::ToggleIndicatorL" ) + } + + +// --------------------------------------------------------------------------- +// From CActive. +// Cancels an outstanding asynchronous request. +// --------------------------------------------------------------------------- +// +void CMusIndicatorApi::DoCancel() + { + MUS_LOG( "mus: [MUSIND] <- CMusIndicatorApi::DoCancel" ) + + if( iLiveSharingQueryTimeout ) + { + iLiveSharingQueryTimeout->Cancel(); + } + delete iLiveSharingQueryTimeout; + iLiveSharingQueryTimeout = NULL; + + if ( iQuery ) + { + iQuery->CancelMsgQuery(); + } + delete iQuery; + iQuery = NULL; + + if ( IsSubscriber() ) + { + iProperty.Cancel(); + } + MUS_LOG( "mus: [MUSIND] -> CMusIndicatorApi::DoCancel" ) + } + + +// --------------------------------------------------------------------------- +// From CActive. +// Handles a leave occurring in the request completion event handler RunL. +// --------------------------------------------------------------------------- +// +#ifdef _DEBUG +TInt CMusIndicatorApi::RunError( TInt aError ) +#else +TInt CMusIndicatorApi::RunError( TInt ) +#endif + { + MUS_LOG1( "mus: [MUSIND] -> CMusIndicatorApi::RunError(%d)", aError ) + + MUS_LOG( "mus: [MUSIND] <- CMusIndicatorApi::RunError(%d)" ) + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// From MMusSoundPlayerObserver. +// Indicates completion of sound playback. +// ----------------------------------------------------------------------------- +// +#ifdef _DEBUG +void CMusIndicatorApi::PlaySoundComplete( TInt aError ) +#else +void CMusIndicatorApi::PlaySoundComplete( TInt /* aError */ ) +#endif + { + MUS_LOG1( "mus: [MUSIND ] -> MusIndicatorApi::PlaySoundComplete(%d)", aError ) + delete iSoundPlayer; + iSoundPlayer = NULL; + MUS_LOG( "mus: [MUSIND ] <- MusIndicatorApi::PlaySoundComplete" ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusIndicatorApi::CMusIndicatorApi( MMusIndicatorObserver* aObserver ) + : CActive( EPriorityStandard ), + iObserver( aObserver ) + { + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusIndicatorApi::ConstructL() + { + MUS_LOG( "mus: [MUSIND ] -> MusIndicatorApi::ConstructL" ) + + if ( IsSubscriber() ) + { + MUS_LOG( "mus: [MUSIND ] : subscriber (called by aiwprovider)" ) + + User::LeaveIfError( iProperty.Attach( KPSUidCoreApplicationUIs, + KCoreAppUIsVideoSharingIndicator ) ); + CActiveScheduler::Add( this ); + iProperty.Subscribe( iStatus ); + SetActive(); + } + else + { + MUS_LOG( "mus: [MUSIND ] : publisher (called by manager)" ) + CActiveScheduler::Add( this ); + } + MUS_LOG( "mus: [MUSIND ] <- MusIndicatorApi::ConstructL" ) + } + + +// ----------------------------------------------------------------------------- +// Indicating availability of VS. +// ----------------------------------------------------------------------------- +// +void CMusIndicatorApi::Indicator( TBool aShown ) + { + MUS_LOG1( "mus: [MUSIND ] <- MusIndicatorApi::Indicator( %d)" , aShown ) + + RProperty property; + TInt error( KErrNone ); + + error = property.Attach( KPSUidCoreApplicationUIs, KCoreAppUIsVideoSharingIndicator ); + if ( error == KErrNone ) + { + if ( aShown ) + { + MUS_LOG( "mus: [MUSIND ] : indicator ON" ) + + property.Set( ECoreAppUIsVideoSharingIndicatorOn ); + } + else + { + MUS_LOG( "mus: [MUSIND ] : indicator OFF" ) + property.Set( ECoreAppUIsVideoSharingIndicatorOff ); + } + } + property.Close(); + MUS_LOG( "mus: [MUSIND ] <- MusIndicatorApi::Indicator" ) + + } + +// ----------------------------------------------------------------------------- +// Plays tone indicating availability of VS. +// ----------------------------------------------------------------------------- +// +void CMusIndicatorApi::PlayToneL() + { + MUS_LOG( "mus: [MUSIND ] -> MusIndicatorApi::PlayToneL" ) + delete iSoundPlayer; + iSoundPlayer = NULL; + iSoundPlayer = CMusSoundPlayer::NewL( *this ); + MUS_LOG( "mus: [MUSIND ] MusIndicatorApi::PlayToneL - Play sound" ) + iSoundPlayer->PlayL( CMusSoundPlayer::EVsAvailableSound ); + MUS_LOG( "mus: [MUSIND ] <- MusIndicatorApi::PlayToneL" ) + } + + +// --------------------------------------------------------------------------- +// Returns text associated with specified dialog. +// --------------------------------------------------------------------------- +// +HBufC* CMusIndicatorApi::NoteTextLC( TVsPopupQuery aQuery ) + { + MUS_LOG1( "mus: [MUSIND] -> MusIndicatorApi::NoteTextLC( %d )", aQuery ) + + HBufC* dlgPrompt( NULL ); + + switch ( aQuery ) + { + case EVsRoamingActivationQuery: + { + dlgPrompt = MusResourceUtil::ReadResourceString16LC( + R_MUSINDICATOR_MANUAL_ACTIVATION_TXT, + KMusIndicatorResource ); + break; + } + + default: + { + MUS_LOG( "mus: [MUSIND] MusIndicatorApi::NoteTextLC, UNKNOWN" ) + User::Leave( KErrNotFound ); + } + } + // now pop and destroy the resource reader + + MUS_LOG( "mus: [MUSIND] <- MusIndicatorApi::NoteTextLC" ) + + return dlgPrompt; + } + + +// ----------------------------------------------------------------------------- +// Reads resource string +// ----------------------------------------------------------------------------- +// +void CMusIndicatorApi::ShowLiveSharingQueryL( TBool aPlayTone ) + { + MUS_LOG( "mus: [MUSIND] -> CMusIndicatorApi::ShowLiveSharingQuery" ) + Cancel(); + + delete iQuery; + iQuery = NULL; + + HBufC* dlgPrompt = MusResourceUtil::ReadResourceString16LC( + R_MUSINDICATOR_NOTE_CAPABILITY_TXT, + KMusIndicatorResource ); + + HBufC* dlgHeader = MusResourceUtil::ReadResourceString16LC( + R_MUSINDICATOR_NOTE_VSREADY_TXT, + KMusIndicatorResource ); + + iQuery = CAknGlobalMsgQuery::NewL(); + TRAPD( error, + iQuery->ShowMsgQueryL( + iStatus, + *dlgPrompt, + R_AVKON_SOFTKEYS_OK_CANCEL, + *dlgHeader, + KNullDesC, + 0, // default image id + -1, // default image mask id + ( aPlayTone ? + CAknQueryDialog::EConfirmationTone : + CAknQueryDialog::ENoTone ) ) ); + + CleanupStack::PopAndDestroy( dlgHeader ); + CleanupStack::PopAndDestroy( dlgPrompt ); + + if ( !error ) + { + SetActive(); + + delete iLiveSharingQueryTimeout; + iLiveSharingQueryTimeout = NULL; + iLiveSharingQueryTimeout = + CPeriodic::NewL( CActive::EPriorityStandard ); + + iLiveSharingQueryTimeout->Start( + KMusLiveSharingQueryTimeout, + KMusLiveSharingQueryTimeout, + TCallBack( LiveSharingQueryTimeout, this ) ); + + } + else + { + delete iQuery; + iQuery = NULL; + } + + MUS_LOG( "mus: [MUSIND] <- CMusIndicatorApi::ShowLiveSharingQuery" ) + } + + + +TInt CMusIndicatorApi::LiveSharingQueryTimeout( TAny* aThis ) + { + static_cast< CMusIndicatorApi* >( aThis )->Cancel(); + return KErrNone; + } + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshindicator/src/musindicatordsa.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshindicator/src/musindicatordsa.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,467 @@ +/* +* 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: MusIndicatorApi provides means to show notes and indicate +* availability of videosharing to user. +* +*/ + + +#include "musindicatordsa.h" +#include "muslogger.h" +#include "musresourceutil.h" +#include "musresourcefinderutil.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// constants +// Size and positions + +const TInt KMusIndicatorWindowHeight = 50; +const TInt KMusIndicatorWindowShrink = 2; +const TInt KMusSpaceBetweenImageAndText = 5; + +// appereance +const TInt KMusIndicatorBorderRoundedCorners = 6; +const TInt KMusIndicatorBorderSize = 1; +//const TInt KMusIndicatorFontPenSize = 1; + + + + +CMusIndicatorDsa* CMusIndicatorDsa::NewL() + { + MUS_LOG( "mus: [MUSIND] -> CMusIndicatorDsa::NewL" ) + CMusIndicatorDsa* self = new (ELeave) CMusIndicatorDsa(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + MUS_LOG( "mus: [MUSIND] <- CMusIndicatorDsa::NewL" ) + return self; + } + + +CMusIndicatorDsa::CMusIndicatorDsa() + : iActivateCallBack( CMusIndicatorDsa::TryActivate, this ), + iRedrawCallBack( CMusIndicatorDsa::DoHandleResourceChange, this ) + { + MUS_LOG( "mus: [MUSIND] -> CMusIndicatorDsa::CMusIndicatorDsa" ) + + iBorderColor = KRgbBlack; + iBorderBgColor = KRgbWhite; + iFontColor = KRgbBlack; + + MUS_LOG( "mus: [MUSIND] <- CMusIndicatorDsa::CMusIndicatorDsa" ) + } + + +CMusIndicatorDsa::~CMusIndicatorDsa() + { + MUS_LOG( "mus: [MUSIND] -> CMusIndicatorDsa::~CMusIndicatorDsa" ) + + StopPeriodicTimer(); + delete iPeriodic; + + delete iIcon; + delete iIconMask; + + delete iText; + + MUS_LOG( "mus: [MUSIND] <- CMusIndicatorDsa::~CMusIndicatorDsa" ) + } + + +const CFont& CMusIndicatorDsa::Font() const + { + TCoeFont coeFont = TCoeFont::NormalFont(); + TZoomFactor zoomFactor = AccumulatedZoom(); + return FindFontProvider().Font(coeFont, zoomFactor); + } + +//------------------------------------------------------------------------------ +// +//------------------------------------------------------------------------------ +// +void CMusIndicatorDsa::ConstructL() + { + MUS_LOG( "mus: [MUSIND] -> CMusIndicatorDsa::ConstructL" ) + + iPeriodic = CPeriodic::NewL( CActive::EPriorityStandard ); + + LoadResourceStringL(); + LoadImageL(); + CreateWindowL(); + + Initialize(); + TryActivateL(); + + MUS_LOG( "mus: [MUSIND] <- CMusIndicatorDsa::ConstructL" ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusIndicatorDsa::TryActivateL() + { + MAknsControlContext* cc = + AknsDrawUtils::ControlContext( ControlEnv()->AppUi()->TopFocusedControl() ); + + if ( cc ) + { + StopPeriodicTimer(); + ActivateL(); + } + else + { + StartPeriodicTimer( iActivateCallBack ); + } + } + + +// ----------------------------------------------------------------------------- +// Called by framework to redraw the screen area. +// ----------------------------------------------------------------------------- +// +void CMusIndicatorDsa::Draw( const TRect& aRect ) const + { + MUS_LOG( "mus: [MUSIND] -> CMusIndicatorDsa::Draw" ) + MUS_LOG2( "mus: [MUSIND] : x=%d,y=%d", aRect.iTl.iX, aRect.iTl.iY ) + MUS_LOG2( "mus: [MUSIND] : x=%d,y=%d", aRect.iBr.iX, aRect.iBr.iY ) + + CWindowGc& gc = SystemGc(); + + TSize screenSizeNow = ControlEnv()->ScreenDevice()->SizeInPixels(); + + if ( screenSizeNow != iScreenSize ) + { + StartPeriodicTimer( iRedrawCallBack ); + } + + MAknsControlContext* cc = + AknsDrawUtils::ControlContext( ControlEnv()->AppUi()->TopFocusedControl() ); + MUS_LOG1( "mus: [MUSIND] : cc = %d", cc ) + + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + MUS_LOG1( "mus: [MUSIND] : skin = %d", skin ) + + TRgb fontColor; + AknsUtils::GetCachedColor( skin, fontColor, + KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6 ); + TRgb borderColor = fontColor; + + TBool backgroundWithBitmap = + ( skin && !cc ) ? + EFalse : + AknsDrawUtils::Background( skin, cc,this,gc,aRect,KAknsDrawParamDefault ); + + if( !backgroundWithBitmap ) + { + MUS_LOG( "mus: [MUSIND] : Clearing rect with null brush") + gc.SetBrushStyle( CGraphicsContext::ENullBrush ); + gc.Clear( aRect ); + } + else + { + MUS_LOG( "mus: [MUSIND] : rect was cleared with bitmap") + } + + gc.UseFont( &Font() ); + + // Border initialization + gc.SetBrushStyle( CGraphicsContext::ENullBrush ); + + // Draw border + MUS_LOG( "mus: [MUSIND] : Draw border") + gc.SetPenStyle( CGraphicsContext::ESolidPen ); + gc.SetPenColor( borderColor ); + gc.SetPenSize( + TSize( KMusIndicatorBorderSize, KMusIndicatorBorderSize ) ); + gc.DrawRoundRect( iScreenRect, + TSize( KMusIndicatorBorderRoundedCorners, + KMusIndicatorBorderRoundedCorners ) ); + + /* + // Draw smaller border with other color + MUS_LOG( "mus: [MUSIND] : Draw smaller border with other color") + gc.SetPenColor( iBorderBgColor ); + TRect smallerRect = iScreenRect; + smallerRect.Shrink( KMusIndicatorBorderSize, KMusIndicatorBorderSize ); + gc.DrawRoundRect( smallerRect, + TSize( KMusIndicatorBorderRoundedCorners, + KMusIndicatorBorderRoundedCorners ) ); + + // Font outline initialization + + MUS_LOG( "mus: [MUSIND] : Draw text outlines") + gc.SetPenColor( iBorderBgColor ); + gc.SetPenSize( TSize( KMusIndicatorFontPenSize, KMusIndicatorFontPenSize ) ); + + // Draw text outlines + TPoint outlineTextPos = iTextpos; + outlineTextPos -= TPoint( 1, 1 ); + gc.DrawText( *iText, outlineTextPos ); + */ + + // Font initialization + gc.SetPenColor( fontColor ); + + // Draw text + MUS_LOG( "mus: [MUSIND] : Draw text") + gc.DrawText( *iText, iTextpos ); + + gc.BitBltMasked( iImagepos, + iIcon, + TRect( 0, 0, iImageSize.iWidth, iImageSize.iHeight ), + iIconMask, + EFalse ); + + + + MUS_LOG( "mus: [MUSIND] <- CMusIndicatorDsa::Draw" ) + } + + +//------------------------------------------------------------------------------ +// +//------------------------------------------------------------------------------ +// +void CMusIndicatorDsa::HandleResourceChange( TInt aType ) + { + + if ( aType == KEikDynamicLayoutVariantSwitch ) + { + Initialize(); + DrawDeferred(); + } + + StopPeriodicTimer(); + + } + + + +//------------------------------------------------------------------------------ +// Calculates topleft position of drawn text. +//------------------------------------------------------------------------------ +// +void CMusIndicatorDsa::Initialize() + { + MUS_LOG( "mus: [MUSIND] -> CMusIndicatorDsa::Initialize" ) + + TRect clientRect = CEikonEnv::Static()->EikAppUi()->ClientRect(); + MUS_LOG2( "mus: [MUSIND] clientrect : x=%d,y=%d", clientRect.iTl.iX, clientRect.iTl.iY ) + MUS_LOG2( "mus: [MUSIND] clientrect : x=%d,y=%d", clientRect.iBr.iX, clientRect.iBr.iY ) + + iScreenSize = ControlEnv()->ScreenDevice()->SizeInPixels(); + + //test (indicator goes inside options menu area) + //clientRect.iTl.iY = 150; + + SetPosition( clientRect.iTl ); + SetSize( + TSize( iScreenSize.iWidth, KMusIndicatorWindowHeight ) ); + + iScreenRect = TRect( + TPoint( 0, 0 ), + TSize( iScreenSize.iWidth, KMusIndicatorWindowHeight ) ); + iScreenRect.Shrink( KMusIndicatorWindowShrink, KMusIndicatorWindowShrink ); + + + TInt imagePlusTextWidth = Font().TextWidthInPixels( *iText ) + + iImageSize.iWidth + KMusSpaceBetweenImageAndText; + + iImagepos.iX = ( iScreenRect.Width() - imagePlusTextWidth ) >> 1; + iImagepos.iY = ( iScreenRect.Height() - iImageSize.iHeight ) >> 1; + + // Text position + iTextpos.iX = iImagepos.iX + iImageSize.iWidth + KMusSpaceBetweenImageAndText; + + iTextpos.iY = ( iScreenRect.Height() >> 1 ) + + ( Font().HeightInPixels() >> 1 ) + + iScreenRect.iTl.iY; + + MUS_LOG( "mus: [MUSIND] <- CMusIndicatorDsa::Initialize" ) + } + + + +//------------------------------------------------------------------------------ +// Loads displayed image. +//------------------------------------------------------------------------------ +// +void CMusIndicatorDsa::LoadImageL() + { + MUS_LOG( "mus: [MUSIND] -> CMusIndicatorDsa::LoadImageL" ) + + if ( iIcon || iIconMask ) + { + MUS_LOG( "mus: [MUSIND] <- CMusIndicatorDsa::LoadImageL" ) + return; + } + + _LIT( KMyBitmapRomFile, "Z:\\resource\\apps\\musindicatoricons.mbm" ); + _LIT( KMyBitmapRamFile, "C:\\resource\\apps\\musindicatoricons.mbm" ); + + TFileName imageFileName; + if ( MusResourceFinderUtil::IsExistL( KMyBitmapRomFile ) ) + { + imageFileName = KMyBitmapRomFile; + } + else if ( MusResourceFinderUtil::IsExistL( KMyBitmapRamFile ) ) + { + imageFileName = KMyBitmapRamFile; + } + else + { + MUS_LOG( "mus: [MUSIND] Icon File Not Found!" ); + User::Leave( KErrNotFound ); + } + + iIcon = new ( ELeave ) CFbsBitmap(); + iIconMask = new ( ELeave ) CFbsBitmap(); + + // Enumerations of mbg file are usable only when vector images + // in mif file are used. Those cannot be loaded without UI components. + const TInt KMusIndicatorIconIndex = 0; + const TInt KMusIndicatorIconMaskIndex = 1; + User::LeaveIfError( + iIcon->Load( imageFileName, KMusIndicatorIconIndex ) ); + User::LeaveIfError( + iIconMask->Load( imageFileName, KMusIndicatorIconMaskIndex ) ); + + iImageSize = iIcon->SizeInPixels(); + + // Crop icon if it is too big + if ( iImageSize.iHeight > KMusIndicatorWindowHeight ) + { + TInt newHeight = KMusIndicatorWindowHeight >> 1; + TInt newWidth = + TReal( iImageSize.iHeight / iImageSize.iWidth ) * newHeight; + iIcon->Resize( TSize( newHeight, newWidth ) ); + iIconMask->Resize( TSize( newHeight, newWidth ) ); + } + + + MUS_LOG( "mus: [MUSIND] <- CMusIndicatorDsa::LoadImageL" ) + } + + +//------------------------------------------------------------------------------ +// +//------------------------------------------------------------------------------ +// +void CMusIndicatorDsa::LoadResourceStringL() + { + MUS_LOG( "mus: [MUSIND] -> CMusIndicatorDsa::LoadResourceStringL" ) + delete iText; + iText = NULL; + iText = MusResourceUtil::ReadResourceString16L( + R_MUSINDICATOR_NOTE_VSREADY_TXT, + KMusIndicatorResource ); + MUS_LOG( "mus: [MUSIND] <- CMusIndicatorDsa::LoadResourceStringL" ) + } + +//------------------------------------------------------------------------------ +// Periodic timer completion +//------------------------------------------------------------------------------ +// +TInt CMusIndicatorDsa::TryActivate( TAny* aThis ) + { + if ( !aThis ) + { + return KErrArgument; + } + + CMusIndicatorDsa* handle = static_cast< CMusIndicatorDsa* > ( aThis ); + + TInt error = KErrNone; + TRAP( error, handle->TryActivateL() ); + + return error; + } + + +//------------------------------------------------------------------------------ +// Periodic timer completion +//------------------------------------------------------------------------------ +// +TInt CMusIndicatorDsa::DoHandleResourceChange( TAny* aThis ) + { + + if ( !aThis ) + { + return KErrArgument; + } + + CMusIndicatorDsa* handle = static_cast< CMusIndicatorDsa* > ( aThis ); + + handle->HandleResourceChange( KEikDynamicLayoutVariantSwitch ); + + return KErrNone; + + } + + + +//------------------------------------------------------------------------------ +// +//------------------------------------------------------------------------------ +// +void CMusIndicatorDsa::StartPeriodicTimer( const TCallBack& aCallBack) const + { + MUS_LOG( "mus: [MUSIND] -> CMusIndicatorDsa::StartPeriodicTimer" ) + + if ( iPeriodic->IsActive() ) + { + return; + } + + TTimeIntervalMicroSeconds32 delay = + aCallBack.iFunction == CMusIndicatorDsa::TryActivate ? + KMusIndicatorDelay : KMusRedrawDelay; + + iPeriodic->Start( delay, delay, aCallBack ); + + MUS_LOG( "mus: [MUSIND] <- CMusIndicatorDsa::StartPeriodicTimer" ) + } + + +//------------------------------------------------------------------------------ +// +//------------------------------------------------------------------------------ +// +void CMusIndicatorDsa::StopPeriodicTimer() + { + MUS_LOG( "mus: [MUSIND] -> CMusIndicatorDsa::StopPeriodicTimer" ) + if( iPeriodic ) + { + iPeriodic->Cancel(); + } + MUS_LOG( "mus: [MUSIND] <- CMusIndicatorDsa::StopPeriodicTimer" ) + } + + + + + +// End of file + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshindicator/src/musresourceutil.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshindicator/src/musresourceutil.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,130 @@ +/* +* 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: Provides means to read resource strings from resource files. +* +*/ + + + +#include "musresourcefinderutil.h" +#include "muslogger.h" +#include "musresourceutil.h" +#include +#include + + +// ======== MEMBER FUNCTIONS ======== + + +// ----------------------------------------------------------------------------- +// Reads resource string from file. +// ----------------------------------------------------------------------------- +// +HBufC16* MusResourceUtil::ReadResourceString16LC( TUint aId, const TDesC& aFilename ) + { + HBufC8* tmp = ReadResourceString8LC( aId, aFilename ); + HBufC* result = ConvertResourceStringLC( *tmp ); + CleanupStack::Pop( result ); + CleanupStack::PopAndDestroy( tmp ); + CleanupStack::PushL( result ); + return result; + } + + +// ----------------------------------------------------------------------------- +// Reads resource string from file. +// ----------------------------------------------------------------------------- +// +HBufC16* MusResourceUtil::ReadResourceString16L( TUint aId, const TDesC& aFilename ) + { + HBufC* result = ReadResourceString16LC( aId, aFilename ); + CleanupStack::Pop( result ); + return result; + } + + +// ----------------------------------------------------------------------------- +// Reads resource string from file. +// ----------------------------------------------------------------------------- +// +HBufC8* MusResourceUtil::ReadResourceString8LC( TUint aId, const TDesC& aFilename ) + { + HBufC8* result = ReadResourceString8L( aId, aFilename ); + CleanupStack::PushL( result ); + return result; + } + + +// ----------------------------------------------------------------------------- +// Reads resource string from file. +// ----------------------------------------------------------------------------- +// +HBufC8* MusResourceUtil::ReadResourceString8L( TUint aId, const TDesC& aFilename ) + { + MUS_LOG( "mus: [MUSIND ] -> MusIndicatorApi::ReadResourceString8L" ) + + RFs fs; + User::LeaveIfError( fs.Connect() ); + CleanupClosePushL( fs ); + + HBufC* filenameBuf = ResourceFilenameLC( aFilename ); + + TFileName filename( *filenameBuf ); + + CleanupStack::PopAndDestroy( filenameBuf ); + + RResourceFile resource; + resource.OpenL( fs, filename ); + CleanupClosePushL( resource ); + resource.ConfirmSignatureL(); + HBufC8* resString; + resString = resource.AllocReadL( aId ); + CleanupStack::PopAndDestroy(); // resource + CleanupStack::PopAndDestroy(); // fs + + MUS_LOG( "mus: [MUSIND ] <- MusResourceUtil::ReadResourceString8L" ) + return resString; + } + + +// ----------------------------------------------------------------------------- +// Converts HBufC8 to HBufC. +// ----------------------------------------------------------------------------- +// +HBufC* MusResourceUtil::ConvertResourceStringLC( const TDesC8& aText ) + { + MUS_LOG( "mus: [MUSIND ] -> MusResourceUtil::ConvertResourceStringLC" ) + HBufC16* result = HBufC16::NewL( aText.Length() / 2 ); + result->Des().Copy( (TUint16*) aText.Ptr(), aText.Length() / 2 ); + + // push dlgPrompt now to cleanup stack + CleanupStack::PushL( result ); + + MUS_LOG( "mus: [MUSIND ] <- MusResourceUtil::ConvertResourceStringLC" ) + return result; + } + + +// ----------------------------------------------------------------------------- +// Constructs name of resource file. +// ----------------------------------------------------------------------------- +// +HBufC* MusResourceUtil::ResourceFilenameLC( const TDesC& aFilename ) + { + MUS_LOG( "mus: [MUSIND ] -> MusResourceUtil::ResourceFilenameLC" ) + HBufC* fileName = MusResourceFinderUtil::ResourcePathL( aFilename ); + CleanupStack::PushL( fileName ); + MUS_LOG( "mus: [MUSIND ] <- MusResourceUtil::ResourceFilenameLC" ) + return fileName; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshindicator/src/mussoundplayer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshindicator/src/mussoundplayer.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,226 @@ +/* +* 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: Provides means to play custom indication sound. +* +*/ + + + +#include "mussoundplayer.h" +#include "muslogger.h" +#include + + +// Name of availability sound. Path used is private path of process. +_LIT( KMusAvailabilitySound, "tone.amr" ); + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusSoundPlayer* CMusSoundPlayer::NewL( MMusSoundPlayerObserver& aObserver ) + { + MUS_LOG( "mus: [MUSIND] -> CMusSoundPlayer::NewL" ) + CMusSoundPlayer* self = NewLC( aObserver ); + CleanupStack::Pop( self ); + MUS_LOG( "mus: [MUSIND] <- CMusSoundPlayer::NewL" ) + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusSoundPlayer* CMusSoundPlayer::NewLC( MMusSoundPlayerObserver& aObserver ) + { + MUS_LOG( "mus: [MUSIND] -> CMusSoundPlayer::NewLC" ) + CMusSoundPlayer* self = new (ELeave) CMusSoundPlayer( aObserver ); + CleanupStack::PushL( self ); + self->ConstructL(); + MUS_LOG( "mus: [MUSIND] <- CMusSoundPlayer::NewLC" ) + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusSoundPlayer::~CMusSoundPlayer() + { + MUS_LOG( "mus: [MUSIND] -> CMusSoundPlayer::CMusSoundPlayer" ) + if ( iMdaPlayer ) + { + if ( ESoundPlayerPlaying == iState ) + { + iMdaPlayer->Stop(); + } + delete iMdaPlayer; + iMdaPlayer = NULL; + } + MUS_LOG( "mus: [MUSIND] <- CMusSoundPlayer::CMusSoundPlayer" ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusSoundPlayer::CMusSoundPlayer( MMusSoundPlayerObserver& aObserver ): + iObserver( aObserver ), + iState( ESoundPlayerReady ) + { + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusSoundPlayer::ConstructL() + { + } + + +// ----------------------------------------------------------------------------- +// Plays specified indication sound. +// ----------------------------------------------------------------------------- +// +void CMusSoundPlayer::PlayL( TVsSoundIndication aIndication ) + { + MUS_LOG( "mus: [MUSIND] -> CMusSoundPlayer::PlayL" ) + if ( ESoundPlayerPlaying == iState ) + { + User::Leave( KErrNotReady ); + } + + HBufC* soundFileName = SoundFileNameLC( aIndication ); + + // Used KAudioPrefVoiceAid from audiopreference.h as preference since it + // should always be played. + iMdaPlayer = CMdaAudioPlayerUtility::NewFilePlayerL( + *soundFileName, + *this, + EMdaPriorityMax, + (TMdaPriorityPreference) KAudioPrefNotification ); + + iMdaPlayer->SetPriority( EMdaPriorityMax, + (TMdaPriorityPreference) KAudioPrefNotification ); + + CleanupStack::PopAndDestroy( soundFileName ); + + iState = ESoundPlayerPlaying; + MUS_LOG( "mus: [MUSIND] <- CMusSoundPlayer::PlayL" ) + } + + +// ----------------------------------------------------------------------------- +// Stops playing current sound. +// ----------------------------------------------------------------------------- +// +void CMusSoundPlayer::Stop() + { + MUS_LOG( "mus: [MUSIND] -> CMusSoundPlayer::Stop" ) + if ( ESoundPlayerPlaying == iState ) + { + iMdaPlayer->Stop(); + } + + delete iMdaPlayer; + iMdaPlayer = NULL; + + iState = ESoundPlayerReady; + MUS_LOG( "mus: [MUSIND] <- CMusSoundPlayer::Stop" ) + } + + +// ----------------------------------------------------------------------------- +// From MMdaAudioPlayerCallback. +// Defines required client behaviour when an attempt to open and initialise an +// audio sample has completed, successfully or otherwise. +// ----------------------------------------------------------------------------- +// +void CMusSoundPlayer::MapcInitComplete( + TInt aError, + const TTimeIntervalMicroSeconds& /*aDuration*/ ) + { + MUS_LOG1( "mus: [MUSIND] -> CMusSoundPlayer::MapcInitComplete(%d)", aError ) + if ( aError ) + { + delete iMdaPlayer; + iMdaPlayer = NULL; + iState = ESoundPlayerReady; + iObserver.PlaySoundComplete( aError ); + } + else + { + iMdaPlayer->Play(); + } + MUS_LOG( "mus: [MUSIND] <- CMusSoundPlayer::MapcInitComplete" ) + } + + +// ----------------------------------------------------------------------------- +// From MMdaAudioPlayerCallback. +// Informs of playback completion. +// ----------------------------------------------------------------------------- +// +void CMusSoundPlayer::MapcPlayComplete( TInt aError ) + { + MUS_LOG1( "mus: [MUSIND] -> CMusSoundPlayer::MapcPlayComplete(%d)", aError ) + delete iMdaPlayer; + iMdaPlayer = NULL; + iState = ESoundPlayerReady; + iObserver.PlaySoundComplete( aError ); + MUS_LOG( "mus: [MUSIND] <- CMusSoundPlayer::MapcPlayComplete" ) + } + + +// ----------------------------------------------------------------------------- +// Returns name of sound file associated with event. +// ----------------------------------------------------------------------------- +// +HBufC* CMusSoundPlayer::SoundFileNameLC( TVsSoundIndication aIndication ) + { + MUS_LOG1( "mus: [MUSIND] -> CMusSoundPlayer::SoundFileNameLC(%d)", + aIndication ) + RFs fs; + User::LeaveIfError( fs.Connect() ); + TFileName filename; + fs.PrivatePath( filename ); + fs.Close(); + switch ( aIndication ) + { + case EVsAvailableSound: + { + filename.Append( KMusAvailabilitySound() ); + } + break; + + default: + { + User::Leave( KErrNotFound ); + } + } + + /* In product all ways tone file will present in ROM , + Note: this prevents auditory tone hearing in sis installation. + */ + filename.Insert(0,_L("z:")); + + MUS_LOG( "mus: [MUSIND] <- CMusSoundPlayer::SoundFileNameLC" ) + return filename.AllocLC(); + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshindicator/tsrc/IndicatorTestApp/group/IndicatorTestApp.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshindicator/tsrc/IndicatorTestApp/group/IndicatorTestApp.mmp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,103 @@ +/* +* 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: +* +*/ + +// To get the APP_LAYER_SYSTEMINCLUDE-definition +#include +#include + + +#ifdef __UI_FRAMEWORKS_V2__ +TARGETPATH /sys/bin +#if defined(EKA2) || !defined(WINS) +TARGET IndicatorTestApp.exe +TARGETTYPE exe +#else // EKA1 WINS +TARGET IndicatorTestApp.app +TARGETTYPE exedll +deffile /epoc32/release/wins/IndicatorTestApp.def +#endif +#else // __UI_FRAMEWORKS_V2__ +TARGET IndicatorTestApp.app +TARGETPATH /system/apps/IndicatorTestApp +TARGETTYPE app +#endif + +UID 0x100039CE 0x0B821B86 + +CAPABILITY EUNIT_CAPS + +LANG SC + +SOURCEPATH ../src +DOCUMENT Series_60_APP_ReadMe.txt +SOURCE IndicatorTestApp.cpp +SOURCE IndicatorTestAppApplication.cpp +SOURCE IndicatorTestAppAppView.cpp +SOURCE IndicatorTestAppAppUi.cpp +SOURCE IndicatorTestAppDocument.cpp + +SOURCEPATH ../group + + +USERINCLUDE ../inc +USERINCLUDE ../sis + +USERINCLUDE ../../../inc +USERINCLUDE ../../../../../common/inc + +// Default system include paths for application layer modules. +APP_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY apparc.lib +LIBRARY cone.lib +LIBRARY eikcore.lib +LIBRARY avkon.lib +LIBRARY gdi.lib +LIBRARY musindicator.lib +LIBRARY flogger.lib // RFileLogger +LIBRARY centralrepository.lib +LIBRARY eikcoctl.lib // Control framework API +//LIBRARY eikcore.lib // Eikon core controls API +//LIBRARY eikctl.lib // Eikon controls + + +#ifdef __UI_FRAMEWORKS_V2__ +START RESOURCE IndicatorTestApp.RSS +HEADER +targetpath /resource/apps +lang sc +end +#else +RESOURCE IndicatorTestApp.RSS +#endif + +#ifdef __UI_FRAMEWORKS_V2__ +sourcepath . +START RESOURCE IndicatorTestApp_reg.rss +#ifdef WINSCW +TARGETPATH /private/10003a3f/apps +#else +TARGETPATH /private/10003a3f/import/apps +#endif +END + +start resource IndicatorTestApp_loc.RSS +targetpath /resource/apps +lang sc +end +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshindicator/tsrc/IndicatorTestApp/group/IndicatorTestApp.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshindicator/tsrc/IndicatorTestApp/group/IndicatorTestApp.rss Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,103 @@ +/* +* 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: +* +*/ + +NAME HELL + +#include +#include +#include +#include + +#include "IndicatorTestApp.hrh" + + +// --------------------------------------------------------- +// +// Define the resource file signature +// This resource should be empty. +// +// --------------------------------------------------------- +// +RESOURCE RSS_SIGNATURE { } + +// --------------------------------------------------------- +// +// Default Document Name +// +// --------------------------------------------------------- +// +RESOURCE TBUF r_default_document_name { buf=""; } + +// --------------------------------------------------------- +// +// Define default menu and CBA key. +// +// --------------------------------------------------------- +// +RESOURCE EIK_APP_INFO + { + menubar = r_IndicatorTestApp_menubar; + cba = R_AVKON_SOFTKEYS_OPTIONS_EXIT; + } + + +// --------------------------------------------------------- +// +// r_IndicatorTestApp_menubar +// Menubar for IndicatorTestApp example +// +// --------------------------------------------------------- +// +RESOURCE MENU_BAR r_IndicatorTestApp_menubar + { + titles = + { + MENU_TITLE {menu_pane = r_IndicatorTestApp_menu;} + }; + } + + +// --------------------------------------------------------- +// +// r_IndicatorTestApp_menu +// Menu for "Options" +// +// --------------------------------------------------------- +// +RESOURCE MENU_PANE r_IndicatorTestApp_menu + { + items = + { + MENU_ITEM {command = EIndicatorTestAppSharingAvailable; txt = "Sharing Available";}, + MENU_ITEM {command = EIndicatorTestAppSharingNotAvailable; txt = "Sharing Not Available";}, + + MENU_ITEM {command = EIndicatorTestAppEnableOperator; txt = "Set operator specific";}, + MENU_ITEM {command = EIndicatorTestAppDisableOperator; txt = "Set non operator specific";}, + + + MENU_ITEM {command = EIndicatorTestAppAudiotoryNotification; txt = "Set play sound";}, + MENU_ITEM {command = EIndicatorTestAppNoAudiotoryNotification; txt = "Set no sound";}, + + MENU_ITEM {command = EIndicatorTestAppPopUpNotification; txt = "Set pop-up notification";}, + MENU_ITEM {command = EIndicatorTestAppNoPopUpNotification; txt = "Set no pop-up notification";}, + + MENU_ITEM {command = EIndicatorTestAppIconNotification; txt = "Set icon notification";}, + MENU_ITEM {command = EIndicatorTestAppNoIconNotification; txt = "Set no icon notification";}, + + MENU_ITEM {command = EAknSoftkeyExit; txt = "Exit";} + }; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshindicator/tsrc/IndicatorTestApp/group/IndicatorTestApp_loc.rls --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshindicator/tsrc/IndicatorTestApp/group/IndicatorTestApp_loc.rls Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,21 @@ +/* +* 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: +* +*/ + +//rls_string STRING_r_IndicatorTestApp_icon_path "z:\\resource\\apps\\IndicatorTestAppicon.mbm" +rls_string STRING_short_caption "ChangeMe" +rls_string STRING_r_IndicatorTestApp_caption "ChangeMeApp" + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshindicator/tsrc/IndicatorTestApp/group/IndicatorTestApp_loc.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshindicator/tsrc/IndicatorTestApp/group/IndicatorTestApp_loc.rss Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,36 @@ +/* +* 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: +* +*/ + +#include +#include "IndicatorTestApp_loc.rls" + +RESOURCE LOCALISABLE_APP_INFO + { + short_caption = STRING_short_caption; + caption_and_icon = + { + CAPTION_AND_ICON_INFO + { + caption=STRING_r_IndicatorTestApp_caption; + //number_of_icons=3; + //icon_file=STRING_r_IndicatorTestApp_icon_path; + } + }; + } + + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshindicator/tsrc/IndicatorTestApp/group/IndicatorTestApp_reg.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshindicator/tsrc/IndicatorTestApp/group/IndicatorTestApp_reg.rss Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,31 @@ +/* +* 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: +* +*/ + +//IndicatorTestApp application's registration resource file + +#include + +UID2 KUidAppRegistrationResourceFile +UID3 0x0B821B86 + +RESOURCE APP_REGISTRATION_INFO + { + app_file="IndicatorTestApp"; + // + localisable_resource_file="\\resource\\apps\\IndicatorTestApp_loc"; + // + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshindicator/tsrc/IndicatorTestApp/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshindicator/tsrc/IndicatorTestApp/group/bld.inf Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,21 @@ +/* +* 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: +* +*/ + +PRJ_MMPFILES + +IndicatorTestApp.mmp + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshindicator/tsrc/IndicatorTestApp/inc/IndicatorTestApp.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshindicator/tsrc/IndicatorTestApp/inc/IndicatorTestApp.hrh Thu Jul 22 16:32:26 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: +* +*/ + +#ifndef __IndicatorTestApp_HRH__ +#define __IndicatorTestApp_HRH__ + +/** IndicatorTestApp enumerate command codes */ +enum TIndicatorTestAppIds + { + EIndicatorTestAppEnableOperator = 1, // start value must not be 0 + EIndicatorTestAppDisableOperator, + EIndicatorTestAppSharingAvailable, + EIndicatorTestAppSharingNotAvailable, + EIndicatorTestAppAudiotoryNotification, + EIndicatorTestAppNoAudiotoryNotification, + EIndicatorTestAppPopUpNotification, + EIndicatorTestAppNoPopUpNotification, + EIndicatorTestAppIconNotification, + EIndicatorTestAppNoIconNotification + + }; + + +#endif // __IndicatorTestApp_HRH__ diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshindicator/tsrc/IndicatorTestApp/inc/IndicatorTestAppApplication.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshindicator/tsrc/IndicatorTestApp/inc/IndicatorTestAppApplication.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,52 @@ +/* +* 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: +* +*/ + +#ifndef __INDICATORTESTAPP_APPLICATION_H__ +#define __INDICATORTESTAPP_APPLICATION_H__ + +#include + + +/*! + @class CIndicatorTestAppApplication + + @discussion An instance of CIndicatorTestAppApplication is the application part of the AVKON + application framework for the IndicatorTestApp example application + */ +class CIndicatorTestAppApplication : public CAknApplication + { +public: // from CAknApplication + +/*! + @function AppDllUid + + @discussion Returns the application DLL UID value + @result the UID of this Application/Dll + */ + TUid AppDllUid() const; + +protected: // from CAknApplication +/*! + @function CreateDocumentL + + @discussion Create a CApaDocument object and return a pointer to it + @result a pointer to the created document + */ + CApaDocument* CreateDocumentL(); + }; + +#endif // __INDICATORTESTAPP_APPLICATION_H__ diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshindicator/tsrc/IndicatorTestApp/inc/IndicatorTestAppAppui.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshindicator/tsrc/IndicatorTestApp/inc/IndicatorTestAppAppui.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,88 @@ +/* +* 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: +* +*/ + +#ifndef __INDICATORTESTAPP_APPUI_H__ +#define __INDICATORTESTAPP_APPUI_H__ + +#include +#include "musindicatorobserver.h" + +// Forward reference +class CIndicatorTestAppAppView; +class CMusIndicatorApi; + +/*! + @class CIndicatorTestAppAppUi + + @discussion An instance of class CIndicatorTestAppAppUi is the UserInterface part of the AVKON + application framework for the IndicatorTestApp example application + */ +class CIndicatorTestAppAppUi : public CAknAppUi, public MMusIndicatorObserver + { +public: +/*! + @function ConstructL + + @discussion Perform the second phase construction of a CIndicatorTestAppAppUi object + this needs to be public due to the way the framework constructs the AppUi + */ + void ConstructL(); + +/*! + @function CIndicatorTestAppAppUi + + @discussion Perform the first phase of two phase construction. + This needs to be public due to the way the framework constructs the AppUi + */ + CIndicatorTestAppAppUi(); + + +/*! + @function ~CIndicatorTestAppAppUi + + @discussion Destroy the object and release all memory objects + */ + ~CIndicatorTestAppAppUi(); + + +public: // from CAknAppUi +/*! + @function HandleCommandL + + @discussion Handle user menu selections + @param aCommand the enumerated code for the option selected + */ + void HandleCommandL(TInt aCommand); + +private: // from MMusIndicatorObserver + + void StartLiveSharingL(); + + void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane); + + +private: +/*! @var iAppView The application view */ + CIndicatorTestAppAppView* iAppView; + + + CMusIndicatorApi* iIndicator; + }; + + +#endif // __INDICATORTESTAPP_APPUI_H__ + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshindicator/tsrc/IndicatorTestApp/inc/IndicatorTestAppAppview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshindicator/tsrc/IndicatorTestApp/inc/IndicatorTestAppAppview.h Thu Jul 22 16:32:26 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: +* +*/ + +#ifndef __INDICATORTESTAPP_APPVIEW_H__ +#define __INDICATORTESTAPP_APPVIEW_H__ + + +#include + +/*! + @class CIndicatorTestAppAppView + + @discussion An instance of the Application View object for the IndicatorTestApp + example application + */ +class CIndicatorTestAppAppView : public CCoeControl + { +public: + +/*! + @function NewL + + @discussion Create a CIndicatorTestAppAppView object, which will draw itself to aRect + @param aRect the rectangle this view will be drawn to + @result a pointer to the created instance of CIndicatorTestAppAppView + */ + static CIndicatorTestAppAppView* NewL(const TRect& aRect); + +/*! + @function NewLC + + @discussion Create a CIndicatorTestAppAppView object, which will draw itself to aRect + @param aRect the rectangle this view will be drawn to + @result a pointer to the created instance of CIndicatorTestAppAppView + */ + static CIndicatorTestAppAppView* NewLC(const TRect& aRect); + + +/*! + @function ~CIndicatorTestAppAppView + + @discussion Destroy the object and release all memory objects + */ + ~CIndicatorTestAppAppView(); + + +public: // from CCoeControl +/*! + @function Draw + + @discussion Draw this CIndicatorTestAppAppView to the screen + @param aRect the rectangle of this view that needs updating + */ + void Draw(const TRect& aRect) const; + + +private: + +/*! + @function ConstructL + + @discussion Perform the second phase construction of a CIndicatorTestAppAppView object + @param aRect the rectangle this view will be drawn to + */ + void ConstructL(const TRect& aRect); + +/*! + @function CIndicatorTestAppAppView + + @discussion Perform the first phase of two phase construction + */ + CIndicatorTestAppAppView(); + }; + + +#endif // __INDICATORTESTAPP_APPVIEW_H__ diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshindicator/tsrc/IndicatorTestApp/inc/IndicatorTestAppDocument.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshindicator/tsrc/IndicatorTestApp/inc/IndicatorTestAppDocument.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,95 @@ +/* +* 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: +* +*/ + +#ifndef __INDICATORTESTAPP_DOCUMENT_H__ +#define __INDICATORTESTAPP_DOCUMENT_H__ + + +#include + +// Forward references +class CIndicatorTestAppAppUi; +class CEikApplication; + + +/*! + @class CIndicatorTestAppDocument + + @discussion An instance of class CIndicatorTestAppDocument is the Document part of the AVKON + application framework for the IndicatorTestApp example application + */ +class CIndicatorTestAppDocument : public CAknDocument + { +public: + +/*! + @function NewL + + @discussion Construct a CIndicatorTestAppDocument for the AVKON application aApp + using two phase construction, and return a pointer to the created object + @param aApp application creating this document + @result a pointer to the created instance of CIndicatorTestAppDocument + */ + static CIndicatorTestAppDocument* NewL(CEikApplication& aApp); + +/*! + @function NewLC + + @discussion Construct a CIndicatorTestAppDocument for the AVKON application aApp + using two phase construction, and return a pointer to the created object + @param aApp application creating this document + @result a pointer to the created instance of CIndicatorTestAppDocument + */ + static CIndicatorTestAppDocument* NewLC(CEikApplication& aApp); + +/*! + @function ~CIndicatorTestAppDocument + + @discussion Destroy the object and release all memory objects + */ + ~CIndicatorTestAppDocument(); + +public: // from CAknDocument +/*! + @function CreateAppUiL + + @discussion Create a CIndicatorTestAppAppUi object and return a pointer to it + @result a pointer to the created instance of the AppUi created + */ + CEikAppUi* CreateAppUiL(); + +private: + +/*! + @function ConstructL + + @discussion Perform the second phase construction of a CIndicatorTestAppDocument object + */ + void ConstructL(); + +/*! + @function CIndicatorTestAppDocument + + @discussion Perform the first phase of two phase construction + @param aApp application creating this document + */ + CIndicatorTestAppDocument(CEikApplication& aApp); + + }; + + +#endif // __INDICATORTESTAPP_DOCUMENT_H__ diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshindicator/tsrc/IndicatorTestApp/sis/IndicatorTestApp.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshindicator/tsrc/IndicatorTestApp/sis/IndicatorTestApp.pkg Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,37 @@ +; +; 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: +; +; IndicatorTestApp.pkg +; +;Language - standard language definitions +&EN + +; standard SIS file header +#{"IndicatorTestApp"},(0x0B821B86),1,0,0 + +;Supports Series 60 v 3.0 +(0x101F7961), 0, 0, 0, {"Series60ProductID"} + +;Localized Vendor Name +%{"My Test EN"} + +;Unique Vendor name +:"Vendor" + +; Files to copy +"\epoc32\release\gcce\udeb\IndicatorTestApp.exe"-"!:\sys\bin\IndicatorTestApp.exe" +"\epoc32\data\z\private\10003a3f\apps\IndicatorTestApp_reg.rsc"-"!:\private\10003a3f\import\apps\IndicatorTestApp_reg.rsc" +"\epoc32\data\z\resource\apps\IndicatorTestApp_loc.Rsc"-"!:\resource\apps\IndicatorTestApp_loc.Rsc" +"\epoc32\data\z\resource\apps\IndicatorTestApp.Rsc"-"!:\resource\apps\IndicatorTestApp.Rsc" diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshindicator/tsrc/IndicatorTestApp/src/IndicatorTestApp.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshindicator/tsrc/IndicatorTestApp/src/IndicatorTestApp.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,69 @@ +/* +* 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: +* +*/ + +#include "IndicatorTestAppApplication.h" +#include + +#pragma message("Please ensure that you read the ReadMe file.") + +#ifdef __UI_FRAMEWORKS_V2__ + +// Create an application, and return a pointer to it +CApaApplication* NewApplication() + { + return new CIndicatorTestAppApplication; + } + + +TInt E32Main() + { + return EikStart::RunApplication(NewApplication); + + } + +/////////////////////////////////////////////////////////////////////////////// +// +// The following is required for wins on EKA1 (using the exedll target) +// +#if defined(__WINS__) && !defined(EKA2) +EXPORT_C TInt WinsMain(TDesC* aCmdLine) + { + return EikStart::RunApplication(NewApplication, aCmdLine); + } + +TInt E32Dll(TDllReason) + { + return KErrNone; + } +#endif + +#else // __UI_FRAMEWORKS_V2__ + +// Create an application, and return a pointer to it +EXPORT_C CApaApplication* NewApplication() + { + return new CIndicatorTestAppApplication; + } + +// DLL entry point, return that everything is ok +GLDEF_C TInt E32Dll(TDllReason) + { + return KErrNone; + } + +#endif // __UI_FRAMEWORKS_V2__ + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshindicator/tsrc/IndicatorTestApp/src/IndicatorTestAppApplication.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshindicator/tsrc/IndicatorTestApp/src/IndicatorTestAppApplication.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,36 @@ +/* +* 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: +* +*/ + +#include "IndicatorTestAppDocument.h" +#include "IndicatorTestAppApplication.h" + +// UID for the application, this should correspond to the uid defined in the mmp file +static const TUid KUidIndicatorTestAppApp = {0x0B821B86}; + +CApaDocument* CIndicatorTestAppApplication::CreateDocumentL() + { + // Create an IndicatorTestApp document, and return a pointer to it + CApaDocument* document = CIndicatorTestAppDocument::NewL(*this); + return document; + } + +TUid CIndicatorTestAppApplication::AppDllUid() const + { + // Return the UID for the IndicatorTestApp application + return KUidIndicatorTestAppApp; + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshindicator/tsrc/IndicatorTestApp/src/IndicatorTestAppAppui.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshindicator/tsrc/IndicatorTestApp/src/IndicatorTestAppAppui.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,143 @@ +/* +* 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: +* +*/ + +#include +#include + +#include "IndicatorTestApp.pan" +#include "IndicatorTestAppAppUi.h" +#include "IndicatorTestAppAppView.h" +#include "IndicatorTestApp.hrh" +#include "indicatortestapp.rsg" + +#include "musindicatorapi.h" +#include "mussettings.h" + +using namespace MusSettingsKeys; + +// ConstructL is called by the application framework +void CIndicatorTestAppAppUi::ConstructL() + { + BaseConstructL(); + + iAppView = CIndicatorTestAppAppView::NewL(ClientRect()); + + AddToStackL(iAppView); + + iIndicator = CMusIndicatorApi::NewL( *this ); + + } + +CIndicatorTestAppAppUi::CIndicatorTestAppAppUi() + { + // no implementation required + } + +CIndicatorTestAppAppUi::~CIndicatorTestAppAppUi() + { + if (iAppView) + { + RemoveFromStack(iAppView); + delete iAppView; + iAppView = NULL; + } + + delete iIndicator; + } + +// handle any menu commands +void CIndicatorTestAppAppUi::HandleCommandL(TInt aCommand) + { + switch(aCommand) + { + case EEikCmdExit: + case EAknSoftkeyExit: + Exit(); + break; + + case EIndicatorTestAppEnableOperator: + { + _LIT(message,"Hello!"); + CAknInformationNote* informationNote = new (ELeave) CAknInformationNote; + informationNote->ExecuteLD(message); + } + break; + + case EIndicatorTestAppSharingAvailable: + { + + MultimediaSharingSettings::SetPopupNotificationSettingL( EPopupNotificationOn ); + break; + } + case EIndicatorTestAppSharingNotAvailable: + { + MultimediaSharingSettings::SetPopupNotificationSettingL( EPopupNotificationOff ); + break; + } + default: + //Panic(EIndicatorTestAppBasicUi); + break; + } + + + iIndicator->IndicateAvailabilityL(); + } + + +void CIndicatorTestAppAppUi::StartLiveSharingL() + { + // + TInt a; + a = 0; + // CRepository + } + +void CIndicatorTestAppAppUi::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane) + { + if( aResourceId == R_INDICATORTESTAPP_MENU ) + { + if( MultimediaSharingSettings::PopupNotificationSettingL() == EPopupNotificationOn ) + { + aMenuPane->DeleteMenuItem( EIndicatorTestAppNoPopUpNotification ); + } + else + { + aMenuPane->DeleteMenuItem( EIndicatorTestAppPopUpNotification ); + } + if( MultimediaSharingSettings::AuditoryNotificationSettingL() == EAuditoryNotificationOn ) + { + aMenuPane->DeleteMenuItem( EIndicatorTestAppNoAudiotoryNotification ); + } + else + { + aMenuPane->DeleteMenuItem( EIndicatorTestAppAudiotoryNotification ); + } + if( MultimediaSharingSettings::OperatorVariantSettingL() == EOperatorSpecific ) + { + aMenuPane->DeleteMenuItem( EIndicatorTestAppDisableOperator ); + } + else + { + aMenuPane->DeleteMenuItem( EIndicatorTestAppEnableOperator ); + } + + // Write some key for MainUI app + aMenuPane->DeleteMenuItem( EIndicatorTestAppIconNotification ); + aMenuPane->DeleteMenuItem( EIndicatorTestAppNoIconNotification ); + + } + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshindicator/tsrc/IndicatorTestApp/src/IndicatorTestAppAppview.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshindicator/tsrc/IndicatorTestApp/src/IndicatorTestAppAppview.cpp Thu Jul 22 16:32:26 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: +* +*/ + +#include +#include + +#include "IndicatorTestAppAppView.h" + +// Standard construction sequence +CIndicatorTestAppAppView* CIndicatorTestAppAppView::NewL(const TRect& aRect) + { + CIndicatorTestAppAppView* self = CIndicatorTestAppAppView::NewLC(aRect); + CleanupStack::Pop(self); + return self; + } + +CIndicatorTestAppAppView* CIndicatorTestAppAppView::NewLC(const TRect& aRect) + { + CIndicatorTestAppAppView* self = new (ELeave) CIndicatorTestAppAppView; + CleanupStack::PushL(self); + self->ConstructL(aRect); + return self; + } + +CIndicatorTestAppAppView::CIndicatorTestAppAppView() + { + // no implementation required + } + +CIndicatorTestAppAppView::~CIndicatorTestAppAppView() + { + // no implementation required + } + +void CIndicatorTestAppAppView::ConstructL(const TRect& aRect) + { + // Create a window for this application view + CreateWindowL(); + + // Set the windows size + SetRect(aRect); + + // Activate the window, which makes it ready to be drawn + ActivateL(); + } + +// Draw this application's view to the screen +void CIndicatorTestAppAppView::Draw(const TRect& /*aRect*/) const + { + // Get the standard graphics context + CWindowGc& gc = SystemGc(); + + // Gets the control's extent + TRect rect = Rect(); + + // Clears the screen + gc.Clear(rect); + } + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshindicator/tsrc/IndicatorTestApp/src/IndicatorTestAppDocument.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshindicator/tsrc/IndicatorTestApp/src/IndicatorTestAppDocument.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,59 @@ +/* +* 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: +* +*/ + +#include "IndicatorTestAppAppUi.h" +#include "IndicatorTestAppDocument.h" + +// Standard Symbian OS construction sequence +CIndicatorTestAppDocument* CIndicatorTestAppDocument::NewL(CEikApplication& aApp) + { + CIndicatorTestAppDocument* self = NewLC(aApp); + CleanupStack::Pop(self); + return self; + } + +CIndicatorTestAppDocument* CIndicatorTestAppDocument::NewLC(CEikApplication& aApp) + { + CIndicatorTestAppDocument* self = new (ELeave) CIndicatorTestAppDocument(aApp); + CleanupStack::PushL(self); + self->ConstructL(); + return self; + } + +void CIndicatorTestAppDocument::ConstructL() + { + // no implementation required + } + +CIndicatorTestAppDocument::CIndicatorTestAppDocument(CEikApplication& aApp) : CAknDocument(aApp) + { + // no implementation required + } + +CIndicatorTestAppDocument::~CIndicatorTestAppDocument() + { + // no implementation required + } + +CEikAppUi* CIndicatorTestAppDocument::CreateAppUiL() + { + // Create the application user interface, and return a pointer to it, + // the framework takes ownership of this object + CEikAppUi* appUi = new (ELeave) CIndicatorTestAppAppUi; + return appUi; + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshindicator/tsrc/ut_indicator/BWINS/ut_musindicatoru.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshindicator/tsrc/ut_indicator/BWINS/ut_musindicatoru.def Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,37 @@ +EXPORTS + ?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 1 NONAME ; class MEUnitTest * CreateTestSuiteL(void) + ?NewL@CAknGlobalMsgQuery@@SAPAV1@XZ @ 2 NONAME ; class CAknGlobalMsgQuery * CAknGlobalMsgQuery::NewL(void) + ?NewL@CAknGlobalConfirmationQuery@@SAPAV1@XZ @ 3 NONAME ; class CAknGlobalConfirmationQuery * CAknGlobalConfirmationQuery::NewL(void) + ?NewLC@CMusIndicatorApi@@SAPAV1@AAVMMusIndicatorObserver@@@Z @ 4 NONAME ; class CMusIndicatorApi * CMusIndicatorApi::NewLC(class MMusIndicatorObserver &) + ?DrawDeferred@CCoeControl@@QBEXXZ @ 5 NONAME ; void CCoeControl::DrawDeferred(void) const + ?SystemGc@CCoeControl@@QBEAAVCWindowGc@@XZ @ 6 NONAME ; class CWindowGc & CCoeControl::SystemGc(void) const + ?SetPenColor@CWindowGc@@UAEXABVTRgb@@@Z @ 7 NONAME ; void CWindowGc::SetPenColor(class TRgb const &) + ?ShowConfirmationQueryL@CAknGlobalConfirmationQuery@@QAEXAAVTRequestStatus@@ABVTDesC16@@HH1HHW4TTone@CAknQueryDialog@@H@Z @ 8 NONAME ; void CAknGlobalConfirmationQuery::ShowConfirmationQueryL(class TRequestStatus &, class TDesC16 const &, int, int, class TDesC16 const &, int, int, enum CAknQueryDialog::TTone, int) + ?CancelMsgQuery@CAknGlobalMsgQuery@@QAEXXZ @ 9 NONAME ; void CAknGlobalMsgQuery::CancelMsgQuery(void) + ?NewL@CMusIndicatorApi@@SAPAV1@AAVMMusIndicatorObserver@@@Z @ 10 NONAME ; class CMusIndicatorApi * CMusIndicatorApi::NewL(class MMusIndicatorObserver &) + ?DrawRoundRect@CWindowGc@@UAEXABVTRect@@ABVTSize@@@Z @ 11 NONAME ; void CWindowGc::DrawRoundRect(class TRect const &, class TSize const &) + ?ShowMsgQueryL@CAknGlobalMsgQuery@@QAEXAAVTRequestStatus@@ABVTDesC16@@H11HHW4TTone@CAknQueryDialog@@@Z @ 12 NONAME ; void CAknGlobalMsgQuery::ShowMsgQueryL(class TRequestStatus &, class TDesC16 const &, int, class TDesC16 const &, class TDesC16 const &, int, int, enum CAknQueryDialog::TTone) + ?SetPenStyle@CWindowGc@@UAEXW4TPenStyle@CGraphicsContext@@@Z @ 13 NONAME ; void CWindowGc::SetPenStyle(enum CGraphicsContext::TPenStyle) + ??1CAknGlobalMsgQuery@@UAE@XZ @ 14 NONAME ; CAknGlobalMsgQuery::~CAknGlobalMsgQuery(void) + ?ConfirmationQueryL@CMusIndicatorApi@@SAHW4TVsPopupQuery@1@@Z @ 15 NONAME ; int CMusIndicatorApi::ConfirmationQueryL(enum CMusIndicatorApi::TVsPopupQuery) + ?NewL@CMusIndicatorApi@@SAPAV1@XZ @ 16 NONAME ; class CMusIndicatorApi * CMusIndicatorApi::NewL(void) + ??1CAknGlobalConfirmationQuery@@UAE@XZ @ 17 NONAME ; CAknGlobalConfirmationQuery::~CAknGlobalConfirmationQuery(void) + ?NewLC@CAknGlobalConfirmationQuery@@SAPAV1@XZ @ 18 NONAME ; class CAknGlobalConfirmationQuery * CAknGlobalConfirmationQuery::NewLC(void) + ?SizeInPixels@CWsScreenDevice@@UBE?AVTSize@@XZ @ 19 NONAME ; class TSize CWsScreenDevice::SizeInPixels(void) const + ??1CWindowGc@@UAE@XZ @ 20 NONAME ; CWindowGc::~CWindowGc(void) + ?IndicateAvailabilityL@CMusIndicatorApi@@QAEXXZ @ 21 NONAME ; void CMusIndicatorApi::IndicateAvailabilityL(void) + ?ActivateL@CCoeControl@@UAEXXZ @ 22 NONAME ; void CCoeControl::ActivateL(void) + ?Start@CPeriodic@@QAEXVTTimeIntervalMicroSeconds32@@0VTCallBack@@@Z @ 23 NONAME ; void CPeriodic::Start(class TTimeIntervalMicroSeconds32, class TTimeIntervalMicroSeconds32, class TCallBack) + ?SetPenSize@CWindowGc@@UAEXABVTSize@@@Z @ 24 NONAME ; void CWindowGc::SetPenSize(class TSize const &) + ?Background@AknsDrawUtils@@SAHPAVMAknsSkinInstance@@PAVMAknsControlContext@@PBVCCoeControl@@AAVCWindowGc@@ABVTRect@@H@Z @ 25 NONAME ; int AknsDrawUtils::Background(class MAknsSkinInstance *, class MAknsControlContext *, class CCoeControl const *, class CWindowGc &, class TRect const &, int) + ?Clear@CWindowGc@@UAEXABVTRect@@@Z @ 26 NONAME ; void CWindowGc::Clear(class TRect const &) + ?NewLC@CAknGlobalMsgQuery@@SAPAV1@XZ @ 27 NONAME ; class CAknGlobalMsgQuery * CAknGlobalMsgQuery::NewLC(void) + ?ControlContext@AknsDrawUtils@@SAPAVMAknsControlContext@@PBVMObjectProvider@@@Z @ 28 NONAME ; class MAknsControlContext * AknsDrawUtils::ControlContext(class MObjectProvider const *) + ?CancelConfirmationQuery@CAknGlobalConfirmationQuery@@QAEXXZ @ 29 NONAME ; void CAknGlobalConfirmationQuery::CancelConfirmationQuery(void) + ?UseFont@CWindowGc@@UAEXPBVCFont@@@Z @ 30 NONAME ; void CWindowGc::UseFont(class CFont const *) + ?SetBrushStyle@CWindowGc@@UAEXW4TBrushStyle@CGraphicsContext@@@Z @ 31 NONAME ; void CWindowGc::SetBrushStyle(enum CGraphicsContext::TBrushStyle) + ?CreateWindowL@CCoeControl@@IAEXXZ @ 32 NONAME ; void CCoeControl::CreateWindowL(void) + ?DrawText@CWindowGc@@UAEXABVTDesC16@@ABVTPoint@@@Z @ 33 NONAME ; void CWindowGc::DrawText(class TDesC16 const &, class TPoint const &) + ?BitBltMasked@CWindowGc@@UAEXABVTPoint@@PBVCFbsBitmap@@ABVTRect@@1H@Z @ 34 NONAME ; void CWindowGc::BitBltMasked(class TPoint const &, class CFbsBitmap const *, class TRect const &, class CFbsBitmap const *, int) + ??0CWindowGc@@QAE@PAVCWsScreenDevice@@@Z @ 35 NONAME ; CWindowGc::CWindowGc(class CWsScreenDevice *) + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshindicator/tsrc/ut_indicator/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshindicator/tsrc/ut_indicator/group/bld.inf Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,23 @@ +/* +* 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: Build information file for project MuS indicator test. +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_MMPFILES +ut_musindicator.mmp diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshindicator/tsrc/ut_indicator/group/ut_musindicator.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshindicator/tsrc/ut_indicator/group/ut_musindicator.mmp Thu Jul 22 16:32:26 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: Project definition file for project MuS Settings UI test +* +*/ + + +#include +#include +#include + + +TARGET ut_musindicator.dll +TARGETTYPE dll +EPOCALLOWDLLDATA +TARGETPATH /sys/bin +UID 0x1000af5a 0x01700001 + +CAPABILITY EUNIT_CAPS +VENDORID VID_DEFAULT + + +MACRO UNIT_TESTING + +SOURCEPATH ../src +SOURCE dllmain.cpp +SOURCE ut_cmusindicatorapi.cpp +SOURCE ut_cmussoundplayer.cpp +SOURCE ut_cmusindicatordsa.cpp + +// tested classes +SOURCEPATH ../../../src +SOURCE mussoundplayer.cpp +SOURCE musindicatorapi.cpp +SOURCE musindicatordsa.cpp +SOURCE musresourceutil.cpp + +USERINCLUDE ../inc + +// FROM TESTED UNITS: +USERINCLUDE ../../../inc +USERINCLUDE ../../../../mmshshared/inc +USERINCLUDE ../../../../mmshshared/loc +USERINCLUDE ../../../../inc +USERINCLUDE ../../../../../inc +USERINCLUDE ../../../../../tsrc/ututils/inc +USERINCLUDE ../../../../../tsrc/propertystub/inc +USERINCLUDE ../../../../../tsrc/fbsbitmapstub/inc +USERINCLUDE ../../../../../tsrc/centralrepositorystub/inc + +// STUB SOURCES +SOURCEPATH ../../../../../tsrc/propertystub/src +SOURCE e32property.cpp +SOURCEPATH ../../../../../tsrc/fbsbitmapstub/src +SOURCE fbs.cpp +SOURCEPATH ../../../../../tsrc/centralrepositorystub/src +SOURCE centralrepositorystub.cpp + +// STUB INCLUDES + +// To replace RProperty with a stub +SYSTEMINCLUDE ../../../../../tsrc/propertystub/inc +SYSTEMINCLUDE ../../../../../tsrc/centralrepositorystub/inc + +// INCLUDESs + +APP_LAYER_SYSTEMINCLUDE + +//LIBRARY centralrepository.lib +LIBRARY commonengine.lib // RConeResourceLoader +LIBRARY bafl.lib +LIBRARY eunit.lib +LIBRARY euser.lib +LIBRARY flogger.lib // RFileLogger +LIBRARY aknskins.lib // AknsUtils.h +LIBRARY avkon.lib +LIBRARY cone.lib +LIBRARY efsrv.lib +LIBRARY eikcoctl.lib +LIBRARY eikcore.lib +LIBRARY aknnotify.lib +LIBRARY eiksrv.lib +LIBRARY mediaclientaudio.lib +LIBRARY ws32.lib // Window server +LIBRARY bitgdi.lib // +LIBRARY gdi.lib // Font +LIBRARY fntstr.lib +LIBRARY fbscli.lib // Font and bitmap server diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshindicator/tsrc/ut_indicator/inc/ut_cmusindicatorapi.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshindicator/tsrc/ut_indicator/inc/ut_cmusindicatorapi.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,111 @@ +/* +* 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: Unit tests for CMusIndicatorApi class. +* +*/ + + + +#ifndef UT_CMUSINDICATORAPI_H +#define UT_CMUSINDICATORAPI_H + + +#include "musindicatorobserver.h" +#include +#include + + +#ifndef NONSHARABLE_CLASS + #define NONSHARABLE_CLASS(x) class x +#endif + + +class CMusIndicatorApi; + + +/** + * Unit test class for CMusIndicatorApi class. + * Implements unit tests for CMusIndicatorApi class. + */ +NONSHARABLE_CLASS( UT_CMusIndicatorApi ) : public + CEUnitTestSuiteClass, + MMusIndicatorObserver + { +public: + + static UT_CMusIndicatorApi* NewL(); + static UT_CMusIndicatorApi* NewLC(); + + /** + * Destructor. + */ + ~UT_CMusIndicatorApi(); + +private: + + UT_CMusIndicatorApi(); + + void ConstructL(); + + /** + * Sets up a new test. + */ + void SetupL(); + + /** + * Tears down a test. + */ + void Teardown(); + + /** + * From MMusIndicatorObserver. + * Instructs to start live video sharing. + */ + virtual void StartLiveSharingL(); + + /** + * Actual unit test methods. + */ + void UT_CMusIndicatorApi_NewLL(); + void UT_CMusIndicatorApi_ConfirmationQueryLL(); + void UT_CMusIndicatorApi_IndicateAvailabilityLL(); + void UT_CMusIndicatorApi_RunLL(); + void UT_CMusIndicatorApi_DoCancelL(); + void UT_CMusIndicatorApi_RunErrorL(); + void UT_CMusIndicatorApi_PlaySoundCompleteL(); + void UT_CMusIndicatorApi_PlayToneLL(); + void UT_CMusIndicatorApi_NoteTextLCL(); + void UT_CMusIndicatorApi_ShowLiveSharingQueryLL(); + void UT_CMusIndicatorApi_LiveSharingQueryTimeoutL(); + + +private: // data + + /** + * Tested class. + * Own. + */ + CMusIndicatorApi* iIndicatorApi; + + /** + * Tells if observer method MMusIndicatorObserver::StartLiveSharingL has + * been called. + */ + TBool iStartLiveSharingLCalled; + + EUNIT_DECLARE_TEST_TABLE; + + }; + +#endif // UT_CMUSINDICATORAPI_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshindicator/tsrc/ut_indicator/inc/ut_cmusindicatordsa.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshindicator/tsrc/ut_indicator/inc/ut_cmusindicatordsa.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,100 @@ +/* +* 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: Unit tests for CMusIndicatorApi class. +* +*/ + + + +#ifndef UT_CMUSINDICATORDSA_H +#define UT_CMUSINDICATORDSA_H + + +#include +#include + + +#ifndef NONSHARABLE_CLASS + #define NONSHARABLE_CLASS(x) class x +#endif + + +class CMusIndicatorDsa; + + +/** + * Unit test class for CMusIndicatorApi class. + * Implements unit tests for CMusIndicatorApi class. + */ +NONSHARABLE_CLASS( UT_CMusIndicatorDsa ) : public CEUnitTestSuiteClass + { +public: + + static UT_CMusIndicatorDsa* NewL(); + static UT_CMusIndicatorDsa* NewLC(); + + /** + * Destructor. + */ + ~UT_CMusIndicatorDsa(); + +private: + + UT_CMusIndicatorDsa(); + + void ConstructL(); + + /** + * Sets up a new test. + */ + void SetupL(); + + /** + * Tears down a test. + */ + void Teardown(); + + /** + * Actual unit test methods. + */ + void UT_CMusIndicatorDsa_NewLL(); + void UT_CMusIndicatorDsa_DrawL(); + void UT_CMusIndicatorDsa_LoadImageLL(); + void UT_CMusIndicatorDsa_LoadResourceStringLL(); + void UT_CMusIndicatorDsa_InitializeL(); + void UT_CMusIndicatorDsa_TryActivateL(); + void UT_CMusIndicatorDsa_StartPeriodicTimerL(); + void UT_CMusIndicatorDsa_StopPeriodicTimerL(); + void UT_CMusIndicatorDsa_HandleResourceChangeL(); + void UT_CMusIndicatorDsa_DoHandleResourceChangeL(); + + + /** + * Helpers + */ + void FakeVisibilityL(); + +private: // data + + /** + * Tested class. + * Own. + */ + CMusIndicatorDsa* iIndicatorDsa; + + EUNIT_DECLARE_TEST_TABLE; + + }; + +#endif // UT_CMUSINDICATORDSA_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshindicator/tsrc/ut_indicator/inc/ut_cmussoundplayer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshindicator/tsrc/ut_indicator/inc/ut_cmussoundplayer.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,112 @@ +/* +* 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: Unit tests for CMusSoundPlayer class. +* +*/ + + + +#ifndef UT_CMUSSOUNDPLAYER_H +#define UT_CMUSSOUNDPLAYER_H + + +#include "mussoundplayer.h" +#include "mussoundplayerobserver.h" +#include +#include + + +#ifndef NONSHARABLE_CLASS + #define NONSHARABLE_CLASS(x) class x +#endif + + +class CMusSoundPlayer; + + +/** + * Unit test class for CMusSoundPlayer class. + * Implements unit tests for CMusSoundPlayer class. + */ +NONSHARABLE_CLASS( UT_CMusSoundPlayer ) + : public CEUnitTestSuiteClass, MMusSoundPlayerObserver + { +public: + + static UT_CMusSoundPlayer* NewL(); + static UT_CMusSoundPlayer* NewLC(); + + /** + * Destructor. + */ + ~UT_CMusSoundPlayer(); + +// from base class MMusSoundPlayerObserver + + /** + * From MMusSoundPlayerObserver. + * Notifies of sound playing complete. + * + * @param aError Errorcode associated with playback. + */ + virtual void PlaySoundComplete( TInt aError ); + +private: + + UT_CMusSoundPlayer(); + + void ConstructL(); + + /** + * Sets up a new test. + */ + void SetupL(); + + /** + * Tears down a test. + */ + void Teardown(); + + /** + * Actual unit test methods. + */ + void UT_CMusSoundPlayer_NewLL(); + void UT_CMusSoundPlayer_NewLCL(); + void UT_CMusSoundPlayer_PlayLL(); + void UT_CMusSoundPlayer_StopL(); + void UT_CMusSoundPlayer_MapcInitCompleteL(); + void UT_CMusSoundPlayer_MapcPlayCompleteL(); + void UT_CMusSoundPlayer_SoundFileNameLCL(); + + /* + * Integration test methods + */ + void IT_CMusSoundPlayer_DeletePlayerWhenPlaying(); + + +private: // data + + /** + * Tested class. + * Own. + */ + CMusSoundPlayer* iSoundPlayer; + + TInt iPlaySoundCompleteError; + + EUNIT_DECLARE_TEST_TABLE; + + }; + +#endif // UT_CMUSSOUNDPLAYER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshindicator/tsrc/ut_indicator/src/dllmain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshindicator/tsrc/ut_indicator/src/dllmain.cpp Thu Jul 22 16:32:26 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: Provides factory function for EUnit test suite. +* +*/ + + + +#include "ut_cmusindicatorapi.h" +#include "ut_cmussoundplayer.h" +#include "ut_cmusindicatordsa.h" +#include + + +_LIT( KRootSuiteName, "Mus Indicator" ); + + +/** + * Test suite factory function. + */ +EXPORT_C MEUnitTest* CreateTestSuiteL() + { + CEUnitTestSuite* rootSuite = CEUnitTestSuite::NewLC( KRootSuiteName ); + + rootSuite->AddL( UT_CMusIndicatorApi::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusSoundPlayer::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusIndicatorDsa::NewLC() ); + CleanupStack::Pop(); + + CleanupStack::Pop( rootSuite ); + + return rootSuite; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshindicator/tsrc/ut_indicator/src/ut_cmusindicatorapi.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshindicator/tsrc/ut_indicator/src/ut_cmusindicatorapi.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,527 @@ +/* +* 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: Implements unit tests for CMusIndicatorApi class. +* +*/ + + + +#include "ut_cmusindicatorapi.h" +#include "musindicatorapi.h" +#include "mussoundplayer.h" +#include "mussettingskeys.h" +#include +#include +#include +#include + +// Next row is to disable warning emerging from EUnit code. +#pragma warn_illtokenpasting off +static TInt stubStatus = KErrNone; +static TRequestStatus* rstatus = NULL; + + +// ======== CAknGlobalMsgQuery stub ======== + + +CAknGlobalMsgQuery* CAknGlobalMsgQuery::NewL() + { + CAknGlobalMsgQuery* self = CAknGlobalMsgQuery::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +CAknGlobalMsgQuery* CAknGlobalMsgQuery::NewLC() + { + CAknGlobalMsgQuery* self = new (ELeave) CAknGlobalMsgQuery(); + CleanupStack::PushL( self ); + return self; + } + +CAknGlobalMsgQuery::CAknGlobalMsgQuery() + { + } + +CAknGlobalMsgQuery::~CAknGlobalMsgQuery() + { + CancelMsgQuery(); + iNotify.Close(); + } + +void CAknGlobalMsgQuery::ShowMsgQueryL( + TRequestStatus& aStatus, + const TDesC& /*aMsgText*/, + TInt /*aSoftkeys*/, + const TDesC& /*HeaderText*/, + const TDesC& /*HeaderImageFile*/, + TInt /*aImageId*/, + TInt /*aImageMaskId*/, + CAknQueryDialog::TTone /*aTone*/) + { + if ( stubStatus == KErrNone ) + { + aStatus = KRequestPending; + rstatus = &aStatus; + } + else + { + User::Leave( stubStatus ); + } + } + +void CAknGlobalMsgQuery::CancelMsgQuery() + { + if ( rstatus ) + { + User::RequestComplete( rstatus, KErrCancel ); + rstatus = NULL; + } + } + + +// ======== CAknGlobalConfirmationQuery stub ======== + +CAknGlobalConfirmationQuery* CAknGlobalConfirmationQuery::NewL() + { + CAknGlobalConfirmationQuery* self = CAknGlobalConfirmationQuery::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +CAknGlobalConfirmationQuery* CAknGlobalConfirmationQuery::NewLC() + { + CAknGlobalConfirmationQuery* self = new (ELeave) CAknGlobalConfirmationQuery(); + CleanupStack::PushL( self ); + return self; + } + +CAknGlobalConfirmationQuery::CAknGlobalConfirmationQuery() + { + } + + +CAknGlobalConfirmationQuery::~CAknGlobalConfirmationQuery() + { + CancelConfirmationQuery(); + iNotify.Close(); + } + + + + +void CAknGlobalConfirmationQuery::ShowConfirmationQueryL( + TRequestStatus& aStatus, + const TDesC& /*aPrompt*/, + TInt /*aSoftkeys*/, + TInt /*aAnimation*/, + const TDesC& /*aImageFile*/, + TInt /*aImageId*/, + TInt /*aImageMaskId*/, + CAknQueryDialog::TTone /*aTone*/, + TBool /*aDismissWithAllKeys*/ ) + + { + if ( stubStatus == KErrNone ) + { + TRequestStatus* stat = &aStatus; + User::RequestComplete( stat, EAknSoftkeyYes ); + // rstatus = &aStatus; + } + else + { + User::Leave( stubStatus ); + } + + } + +void CAknGlobalConfirmationQuery::CancelConfirmationQuery() + { + if ( rstatus ) + { + User::RequestComplete( rstatus, KErrCancel ); + rstatus = NULL; + } + } + +// ======== MEMBER FUNCTIONS ======== + + +UT_CMusIndicatorApi* UT_CMusIndicatorApi::NewL() + { + UT_CMusIndicatorApi* self = UT_CMusIndicatorApi::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +UT_CMusIndicatorApi* UT_CMusIndicatorApi::NewLC() + { + UT_CMusIndicatorApi* self = new( ELeave ) UT_CMusIndicatorApi(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +UT_CMusIndicatorApi::~UT_CMusIndicatorApi() + { + } + + +UT_CMusIndicatorApi::UT_CMusIndicatorApi() + { + } + + +// --------------------------------------------------------------------------- +// The ConstructL from the base class CEUnitTestSuiteClass must be called. +// It generates the test case table. +// --------------------------------------------------------------------------- +// +void UT_CMusIndicatorApi::ConstructL() + { + CEUnitTestSuiteClass::ConstructL(); + } + + +// ---------------------------------------------------------------------------- +// Prepares a test for execution. +// ---------------------------------------------------------------------------- +// +void UT_CMusIndicatorApi::SetupL() + { + iIndicatorApi = CMusIndicatorApi::NewL( *this ); + rstatus = NULL; + stubStatus = KErrNone; + iStartLiveSharingLCalled = EFalse; + } + + +// ---------------------------------------------------------------------------- +// Finalizes a test by releasing used resources. +// ---------------------------------------------------------------------------- +// +void UT_CMusIndicatorApi::Teardown() + { + delete iIndicatorApi; + iIndicatorApi = NULL; + PropertyHelper::Close(); + + } + + +// ---------------------------------------------------------------------------- +// From MMusIndicatorObserver. +// Instructs to start live video sharing. +// ---------------------------------------------------------------------------- +// +void UT_CMusIndicatorApi::StartLiveSharingL() + { + iStartLiveSharingLCalled = ETrue; + } + + +// ======== UNIT TEST METHODS ======== + + +// ---------------------------------------------------------------------------- +// Asserts that instantiation is successful. +// ---------------------------------------------------------------------------- +// +void UT_CMusIndicatorApi::UT_CMusIndicatorApi_NewLL() + { + EUNIT_ASSERT( iIndicatorApi ); + } + + +// ---------------------------------------------------------------------------- +// @TODO: Can this be tested without a dialog? +// ---------------------------------------------------------------------------- +// +void UT_CMusIndicatorApi::UT_CMusIndicatorApi_ConfirmationQueryLL() + { + TBool ret = iIndicatorApi->ConfirmationQueryL( + CMusIndicatorApi::EVsRoamingActivationQuery ); + + EUNIT_ASSERT( ret ); + } + + +// ---------------------------------------------------------------------------- +// Dummy test. @TODO: Can this be tested? +// ---------------------------------------------------------------------------- +// +void UT_CMusIndicatorApi::UT_CMusIndicatorApi_IndicateAvailabilityLL() + { + iIndicatorApi->IndicateAvailabilityL(); + } + + +// ---------------------------------------------------------------------------- +// Asserts that start livesharing is called only when there is no error. +// ---------------------------------------------------------------------------- +// +void UT_CMusIndicatorApi::UT_CMusIndicatorApi_RunLL() + { + /* NOTE: EUnit reports leak for this test due AVKON resource reservation, + * which is not released by AVKON at end of test. Resource reservation + * happend in contruction of indicator(dsa) + */ + TRAPD( error, RProperty::Define( + KPSUidCoreApplicationUIs, + KCoreAppUIsVideoSharingIndicator, + RProperty::EInt, + 0 ) ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT ( error == KErrNone ); + + TRAP( error, RProperty::Set( + KPSUidCoreApplicationUIs, + KCoreAppUIsVideoSharingIndicator, + ( TInt ) ECoreAppUIsVideoSharingIndicatorOn ) ); + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT ( error == KErrNone ); + + iIndicatorApi->Cancel(); + iIndicatorApi->iStatus = KErrNotFound; + iIndicatorApi->RunL(); + EUNIT_ASSERT( !iStartLiveSharingLCalled ); + + iIndicatorApi->Cancel(); + iIndicatorApi->iStatus = KErrNone; + iIndicatorApi->RunL(); + EUNIT_ASSERT( iStartLiveSharingLCalled ); + EUNIT_ASSERT( !iIndicatorApi->iQuery ); + + delete iIndicatorApi->iLiveSharingQueryTimeout; + iIndicatorApi->iLiveSharingQueryTimeout = NULL; + iIndicatorApi->iLiveSharingQueryTimeout = + CPeriodic::NewL( CActive::EPriorityStandard ); + + iIndicatorApi->RunL(); + EUNIT_ASSERT( !iIndicatorApi->iLiveSharingQueryTimeout ); + + EUNIT_ASSERT( !iIndicatorApi->IsSubscriber() ); + + iIndicatorApi->iObserver = NULL; + EUNIT_ASSERT( iIndicatorApi->IsSubscriber() ); + iIndicatorApi->Indicator( ETrue ); + + iIndicatorApi->Cancel(); + + iIndicatorApi->RunL(); + + TRequestStatus& status = iIndicatorApi->iStatus; + rstatus = &status; + //User::RequestComplete( rstatus, KErrCancel ); + } + + +// ---------------------------------------------------------------------------- +// Asserts that DoCancel removes current activity and deletes used resources. +// ---------------------------------------------------------------------------- +// +void UT_CMusIndicatorApi::UT_CMusIndicatorApi_DoCancelL() + { + iIndicatorApi->ShowLiveSharingQueryL( EFalse ); + iIndicatorApi->Cancel(); + EUNIT_ASSERT( !iIndicatorApi->iQuery ); + EUNIT_ASSERT( !iIndicatorApi->IsActive() ); + + } + + +// ---------------------------------------------------------------------------- +// Asserts that method returns KErrNone. +// ---------------------------------------------------------------------------- +// +void UT_CMusIndicatorApi::UT_CMusIndicatorApi_RunErrorL() + { + EUNIT_ASSERT( KErrNone == iIndicatorApi->RunError( KErrGeneral ) ); + EUNIT_ASSERT( KErrNone == iIndicatorApi->RunError( KErrNone ) ); + EUNIT_ASSERT( KErrNone == iIndicatorApi->RunError( KErrCancel ) ); + } + + +// ---------------------------------------------------------------------------- +// Asserts that tested method deletes soundplayer. +// ---------------------------------------------------------------------------- +// +void UT_CMusIndicatorApi::UT_CMusIndicatorApi_PlaySoundCompleteL() + { + iIndicatorApi->iSoundPlayer = CMusSoundPlayer::NewL( *iIndicatorApi ); + iIndicatorApi->PlaySoundComplete( KErrNone ); + EUNIT_ASSERT( !iIndicatorApi->iSoundPlayer ); + iIndicatorApi->PlaySoundComplete( KErrGeneral ); + EUNIT_ASSERT( !iIndicatorApi->iSoundPlayer ); + } + + +// ---------------------------------------------------------------------------- +// Asserts that method creates sound player. +// ---------------------------------------------------------------------------- +// +void UT_CMusIndicatorApi::UT_CMusIndicatorApi_PlayToneLL() + { + iIndicatorApi->PlayToneL(); + EUNIT_ASSERT( iIndicatorApi->iSoundPlayer ); + } + + +// ---------------------------------------------------------------------------- +// Asserts that a note text is generated. +// ---------------------------------------------------------------------------- +// +void UT_CMusIndicatorApi::UT_CMusIndicatorApi_NoteTextLCL() + { + HBufC* tmp = iIndicatorApi->NoteTextLC( + CMusIndicatorApi::EVsRoamingActivationQuery ); + EUNIT_ASSERT( tmp ); + EUNIT_ASSERT( tmp->Length() ); + CleanupStack::PopAndDestroy(); + } + + +// ---------------------------------------------------------------------------- +// Asserts that method creates a query and calls CActive::SetActive. +// ---------------------------------------------------------------------------- +// +void UT_CMusIndicatorApi::UT_CMusIndicatorApi_ShowLiveSharingQueryLL() + { + + iIndicatorApi->ShowLiveSharingQueryL( EFalse ); + EUNIT_ASSERT( iIndicatorApi->iQuery ); + EUNIT_ASSERT( iIndicatorApi->IsActive() ); + + iIndicatorApi->Cancel(); + EUNIT_ASSERT( !iIndicatorApi->iQuery ); + EUNIT_ASSERT( !iIndicatorApi->IsActive() ); + + stubStatus = KErrNotFound; + iIndicatorApi->ShowLiveSharingQueryL( EFalse ); + EUNIT_ASSERT( !iIndicatorApi->iQuery ); + EUNIT_ASSERT( !iIndicatorApi->IsActive() ); + + + } + +// ---------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- +// +void UT_CMusIndicatorApi::UT_CMusIndicatorApi_LiveSharingQueryTimeoutL() + { + iIndicatorApi->ShowLiveSharingQueryL( EFalse ); + EUNIT_ASSERT( iIndicatorApi->iQuery ); + EUNIT_ASSERT( iIndicatorApi->IsActive() ); + + EUNIT_ASSERT( CMusIndicatorApi::LiveSharingQueryTimeout( iIndicatorApi ) == KErrNone ); + + EUNIT_ASSERT( !iIndicatorApi->iQuery ); + EUNIT_ASSERT( !iIndicatorApi->IsActive() ); + + + } + + + +// ======== EUNIT TEST TABLE ======== + + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusIndicatorApi, + "UT_CMusIndicatorApi", + "UNIT" ) + +EUNIT_TEST( + "NewL - test ", + "CMusIndicatorApi", + "NewL", + "FUNCTIONALITY", + SetupL, UT_CMusIndicatorApi_NewLL, Teardown ) + +EUNIT_TEST( + "ConfirmationQueryL - test ", + "CMusIndicatorApi", + "ConfirmationQueryL", + "FUNCTIONALITY", + SetupL, UT_CMusIndicatorApi_ConfirmationQueryLL, Teardown ) + +EUNIT_TEST( + "IndicateAvailabilityL - test ", + "CMusIndicatorApi", + "IndicateAvailabilityL", + "FUNCTIONALITY", + SetupL, UT_CMusIndicatorApi_IndicateAvailabilityLL, Teardown ) + +EUNIT_TEST( + "RunL - test ", + "CMusIndicatorApi", + "RunL", + "FUNCTIONALITY", + SetupL, UT_CMusIndicatorApi_RunLL, Teardown ) + +EUNIT_TEST( + "DoCancel - test ", + "CMusIndicatorApi", + "DoCancel", + "FUNCTIONALITY", + SetupL, UT_CMusIndicatorApi_DoCancelL, Teardown ) + +EUNIT_TEST( + "RunError - test ", + "CMusIndicatorApi", + "RunError", + "FUNCTIONALITY", + SetupL, UT_CMusIndicatorApi_RunErrorL, Teardown ) + +EUNIT_TEST( + "PlaySoundComplete - test ", + "CMusIndicatorApi", + "PlaySoundComplete", + "FUNCTIONALITY", + SetupL, UT_CMusIndicatorApi_PlaySoundCompleteL, Teardown ) + +EUNIT_TEST( + "PlayToneL - test ", + "CMusIndicatorApi", + "PlayToneL", + "FUNCTIONALITY", + SetupL, UT_CMusIndicatorApi_PlayToneLL, Teardown ) + +EUNIT_TEST( + "NoteTextLC - test ", + "CMusIndicatorApi", + "NoteTextLC", + "FUNCTIONALITY", + SetupL, UT_CMusIndicatorApi_NoteTextLCL, Teardown ) + +EUNIT_TEST( + "ShowLiveSharingQueryL - test ", + "CMusIndicatorApi", + "ShowLiveSharingQueryL", + "FUNCTIONALITY", + SetupL, UT_CMusIndicatorApi_ShowLiveSharingQueryLL, Teardown ) + +EUNIT_TEST( + "LiveSharingQueryTimeout - test ", + "CMusIndicatorApi", + "LiveSharingQueryTimeout", + "FUNCTIONALITY", + SetupL, UT_CMusIndicatorApi_LiveSharingQueryTimeoutL, Teardown ) + + + +EUNIT_END_TEST_TABLE diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshindicator/tsrc/ut_indicator/src/ut_cmusindicatordsa.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshindicator/tsrc/ut_indicator/src/ut_cmusindicatordsa.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,501 @@ +/* +* 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: Implements unit tests for CMusIndicatorApi class. +* +*/ + + + +#include "ut_cmusindicatordsa.h" +#include "musindicatordsa.h" +#include "mustesthelp.h" +#include "e32property.h" + +#include +#include +#include + + +// Next row is to disable warning emerging from EUnit code. +#pragma warn_illtokenpasting off + +const TSize KOriginalSize = TSize( 176, 208 ); +const TSize KDifferentSize = TSize( 208, 176 ); + +static CWindowGc* gc = NULL; +static TAny* cc = NULL; +static TTimeIntervalMicroSeconds32 delay = 0; +static TSize sizeInPixels = KOriginalSize; + + +// ======== stubs ======== + + +void CCoeControl::CreateWindowL() + { + + } + +void CCoeControl::ActivateL() + { + + } + +void CCoeControl::DrawDeferred() const + { + } + +CWindowGc& CCoeControl::SystemGc() const + { + return *gc; + } + +MWsClientClass::MWsClientClass() + { + } + +CWindowGc::CWindowGc(CWsScreenDevice* /*aDevice*/ ) + { + + } + +CWindowGc::~CWindowGc() + { + + } + +void CWindowGc::SetBrushStyle( TBrushStyle /*aBrushStyle*/ ) + { + } + +void CWindowGc::Clear( const TRect& /*aRect*/ ) + { + } + +void CWindowGc::UseFont( const CFont* /*aFont*/ ) + { + } + +void CWindowGc::SetPenStyle( TPenStyle /*aPenStyle*/ ) + { + } + +void CWindowGc::SetPenColor( const TRgb& /*aColor*/ ) + { + } + +void CWindowGc::SetPenSize( const TSize& /*aSize*/ ) + { + } + +void CWindowGc::DrawRoundRect( const TRect& /*aRect*/,const TSize& /*aEllipse*/ ) + { + } + +void CWindowGc::DrawText( const TDesC& /*aBuf*/,const TPoint& /*aPos*/ ) + { + } + +//Cannot stub due it is virtual method. This is not called +TSize CWsScreenDevice::SizeInPixels() const + { + return sizeInPixels; + } + +void CWindowGc::BitBltMasked(const TPoint& /*aPoint*/,const CFbsBitmap* /*aBitmap*/, + const TRect& /*aSourceRect*/,const CFbsBitmap* /*aMaskBitmap*/,TBool /*aInvertMask*/) + { + } + +MAknsControlContext* AknsDrawUtils::ControlContext( const MObjectProvider* /*aMop*/ ) + { + return static_cast( cc ); + } + +TBool AknsDrawUtils::Background( MAknsSkinInstance* /*aInstance*/, + MAknsControlContext* /*aContext*/, const CCoeControl* /*aControl*/, + CWindowGc& /*aGc*/, const TRect& /*aRect*/, const TInt /*aDrawParam*/ ) + { + return ETrue; + } + + +void CPeriodic::Start(TTimeIntervalMicroSeconds32 aDelay,TTimeIntervalMicroSeconds32 /*anInterval*/,TCallBack /*aCallBack*/) + { + delay = aDelay; + After(aDelay); + + } + + + +// ======== MEMBER FUNCTIONS ======== + + +UT_CMusIndicatorDsa* UT_CMusIndicatorDsa::NewL() + { + UT_CMusIndicatorDsa* self = UT_CMusIndicatorDsa::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +UT_CMusIndicatorDsa* UT_CMusIndicatorDsa::NewLC() + { + UT_CMusIndicatorDsa* self = new( ELeave ) UT_CMusIndicatorDsa(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +UT_CMusIndicatorDsa::~UT_CMusIndicatorDsa() + { + } + + +UT_CMusIndicatorDsa::UT_CMusIndicatorDsa() + { + delete iIndicatorDsa; + iIndicatorDsa = NULL; + } + + +// --------------------------------------------------------------------------- +// The ConstructL from the base class CEUnitTestSuiteClass must be called. +// It generates the test case table. +// --------------------------------------------------------------------------- +// +void UT_CMusIndicatorDsa::ConstructL() + { + CEUnitTestSuiteClass::ConstructL(); + } + + +// ---------------------------------------------------------------------------- +// Prepares a test for execution. +// ---------------------------------------------------------------------------- +// +void UT_CMusIndicatorDsa::SetupL() + { + /* NOTE: EUnit reports leak for any first test due AVKON resource reservation, + * which is not released by AVKON at end of test. Resource reservation + * happend in contruction of CMusIndicatorDsa + */ + + cc = this; + iIndicatorDsa = CMusIndicatorDsa::NewL(); + if ( !gc ) + { + gc = new (ELeave) CWindowGc( NULL ); + } + delay = 0; + sizeInPixels = KOriginalSize; + + } + + +// ---------------------------------------------------------------------------- +// Finalizes a test by releasing used resources. +// ---------------------------------------------------------------------------- +// +void UT_CMusIndicatorDsa::Teardown() + { + delete iIndicatorDsa; + iIndicatorDsa = NULL; + delete gc; + gc = NULL; + cc = NULL; + delay = 0; + sizeInPixels = KOriginalSize; + PropertyHelper::Close(); + + } + + +// ======== UNIT TEST METHODS ======== + + +// ---------------------------------------------------------------------------- +// Asserts successful instantiation. +// ---------------------------------------------------------------------------- +// + +void UT_CMusIndicatorDsa::UT_CMusIndicatorDsa_NewLL() + { + EUNIT_ASSERT( iIndicatorDsa ); + } + + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +void UT_CMusIndicatorDsa::UT_CMusIndicatorDsa_DrawL() + { + EUNIT_ASSERT( !iIndicatorDsa->iPeriodic->IsActive() ); + + TRect rect; + iIndicatorDsa->Draw( rect ); + EUNIT_ASSERT( !iIndicatorDsa->iPeriodic->IsActive() ); + + cc = NULL; + iIndicatorDsa->Draw( rect ); + EUNIT_ASSERT( !iIndicatorDsa->iPeriodic->IsActive() ); + + /*size cannot be changed + sizeInPixels = KDifferentSize; + iIndicatorDsa->Draw( rect ); + EUNIT_ASSERT( iIndicatorDsa->iPeriodic->IsActive() ); + */ + + } + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +void UT_CMusIndicatorDsa::UT_CMusIndicatorDsa_InitializeL() + { + iIndicatorDsa->Initialize(); + + + EUNIT_ASSERT( iIndicatorDsa->iTextpos.iX ); + EUNIT_ASSERT( iIndicatorDsa->iTextpos.iY ); + + } + + +// ---------------------------------------------------------------------------- +// Asserts that load image is not doing anything if icon is already loaded +// ---------------------------------------------------------------------------- +// +void UT_CMusIndicatorDsa::UT_CMusIndicatorDsa_LoadImageLL() + { + CFbsBitmap* icon = iIndicatorDsa->iIcon; + CFbsBitmap* iconMask = iIndicatorDsa->iIconMask; + EUNIT_ASSERT( icon != NULL ); + EUNIT_ASSERT( iconMask != NULL ); + iIndicatorDsa->LoadImageL(); + + EUNIT_ASSERT( icon == iIndicatorDsa->iIcon ); + EUNIT_ASSERT( iconMask == iIndicatorDsa->iIconMask ); + } + + +// ---------------------------------------------------------------------------- +// Asserts successful loading of resource string. +// ---------------------------------------------------------------------------- +// +void UT_CMusIndicatorDsa::UT_CMusIndicatorDsa_LoadResourceStringLL() + { + iIndicatorDsa->LoadResourceStringL(); + EUNIT_ASSERT( iIndicatorDsa->iText ); + EUNIT_ASSERT( iIndicatorDsa->iText->Length() ); + } + + + +// ---------------------------------------------------------------------------- +// Asserts that periodic timer is started after method call. +// ---------------------------------------------------------------------------- +// +void UT_CMusIndicatorDsa::UT_CMusIndicatorDsa_StartPeriodicTimerL() + { + EUNIT_ASSERT( iIndicatorDsa->iPeriodic ); + EUNIT_ASSERT( !iIndicatorDsa->iPeriodic->IsActive() ); + EUNIT_ASSERT( delay.Int() == 0 ); + + iIndicatorDsa->StartPeriodicTimer( iIndicatorDsa->iActivateCallBack ); + EUNIT_ASSERT( iIndicatorDsa->iPeriodic->IsActive() ); + EUNIT_ASSERT( delay.Int() == KMusIndicatorDelay ); + + delay = 0; + iIndicatorDsa->StartPeriodicTimer( iIndicatorDsa->iActivateCallBack ); + EUNIT_ASSERT( delay.Int() == 0 ); + + iIndicatorDsa->iPeriodic->Cancel(); + EUNIT_ASSERT( !iIndicatorDsa->iPeriodic->IsActive() ); + EUNIT_ASSERT( delay.Int() == 0 ); + + iIndicatorDsa->StartPeriodicTimer( iIndicatorDsa->iRedrawCallBack ); + EUNIT_ASSERT( iIndicatorDsa->iPeriodic->IsActive() ); + EUNIT_ASSERT( delay.Int() == KMusRedrawDelay ); + + } + + +// ---------------------------------------------------------------------------- +// Asserts that periodic timer is stopped after method call. +// ---------------------------------------------------------------------------- +// +void UT_CMusIndicatorDsa::UT_CMusIndicatorDsa_StopPeriodicTimerL() + { + EUNIT_ASSERT( iIndicatorDsa->iPeriodic ); + EUNIT_ASSERT( !iIndicatorDsa->iPeriodic->IsActive() ); + iIndicatorDsa->StopPeriodicTimer(); + EUNIT_ASSERT( iIndicatorDsa->iPeriodic ); + EUNIT_ASSERT( !iIndicatorDsa->iPeriodic->IsActive() ); + + iIndicatorDsa->StartPeriodicTimer( iIndicatorDsa->iActivateCallBack ); + EUNIT_ASSERT( iIndicatorDsa->iPeriodic ); + EUNIT_ASSERT( iIndicatorDsa->iPeriodic->IsActive() ); + + iIndicatorDsa->StopPeriodicTimer(); + EUNIT_ASSERT( iIndicatorDsa->iPeriodic ); + EUNIT_ASSERT( !iIndicatorDsa->iPeriodic->IsActive() ); + + } + +// ---------------------------------------------------------------------------- +// Asserts that periodic timer +// ---------------------------------------------------------------------------- +// +void UT_CMusIndicatorDsa::UT_CMusIndicatorDsa_TryActivateL() + { + EUNIT_ASSERT( iIndicatorDsa->iPeriodic ); + EUNIT_ASSERT( !iIndicatorDsa->iPeriodic->IsActive() ); + + EUNIT_ASSERT_EQUALS( iIndicatorDsa->TryActivate( iIndicatorDsa ), KErrNone ); + EUNIT_ASSERT( iIndicatorDsa->iPeriodic ); + EUNIT_ASSERT( !iIndicatorDsa->iPeriodic->IsActive() ); + + cc = NULL; + + // Through async callback + EUNIT_ASSERT_EQUALS( iIndicatorDsa->TryActivate( iIndicatorDsa ), KErrNone ); + EUNIT_ASSERT( iIndicatorDsa->iPeriodic->IsActive() ); + + EUNIT_ASSERT_EQUALS( iIndicatorDsa->TryActivate( NULL ), KErrArgument ); + EUNIT_ASSERT( iIndicatorDsa->iPeriodic->IsActive() ); + + } + +void UT_CMusIndicatorDsa::UT_CMusIndicatorDsa_DoHandleResourceChangeL() + { + EUNIT_ASSERT( iIndicatorDsa->iPeriodic ); + EUNIT_ASSERT( !iIndicatorDsa->iPeriodic->IsActive() ); + + EUNIT_ASSERT_EQUALS( iIndicatorDsa->DoHandleResourceChange( iIndicatorDsa ), KErrNone ); + EUNIT_ASSERT( iIndicatorDsa->iPeriodic ); + EUNIT_ASSERT( !iIndicatorDsa->iPeriodic->IsActive() ); + + EUNIT_ASSERT_EQUALS( iIndicatorDsa->DoHandleResourceChange( NULL ), KErrArgument ); + EUNIT_ASSERT( !iIndicatorDsa->iPeriodic->IsActive() ); + + } + +void UT_CMusIndicatorDsa::UT_CMusIndicatorDsa_HandleResourceChangeL() + { + EUNIT_ASSERT( !iIndicatorDsa->iPeriodic->IsActive() ); + iIndicatorDsa->StartPeriodicTimer( iIndicatorDsa->iRedrawCallBack ); + EUNIT_ASSERT( iIndicatorDsa->iPeriodic->IsActive() ); + + iIndicatorDsa->iScreenSize = TSize(); + iIndicatorDsa->HandleResourceChange( KEikDynamicLayoutVariantSwitch ); + EUNIT_ASSERT( !iIndicatorDsa->iPeriodic->IsActive() ); + + EUNIT_ASSERT( iIndicatorDsa->iScreenSize != TSize() ); + + iIndicatorDsa->iScreenSize = TSize(); + iIndicatorDsa->HandleResourceChange( 0 ); + EUNIT_ASSERT( iIndicatorDsa->iScreenSize == TSize() ); + + } + + + +// ======== EUNIT TEST TABLE ======== + + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusIndicatorDsa, + "UT_CMusIndicatorDsa", + "UNIT" ) + +EUNIT_TEST( + "NewL - test", + "CMusIndicatorDsa", + "NewL", + "FUNCTIONALITY", + SetupL, UT_CMusIndicatorDsa_NewLL, Teardown ) + + +EUNIT_TEST( + "Draw - test", + "CMusIndicatorDsa", + "Draw", + "FUNCTIONALITY", + SetupL, UT_CMusIndicatorDsa_DrawL, Teardown ) + + +EUNIT_TEST( + "Initialize - test", + "CMusIndicatorDsa", + "Initialize", + "FUNCTIONALITY", + SetupL, UT_CMusIndicatorDsa_InitializeL, Teardown ) + +EUNIT_TEST( + "LoadImageL - test", + "CMusIndicatorDsa", + "LoadImageL", + "FUNCTIONALITY", + SetupL, UT_CMusIndicatorDsa_LoadImageLL, Teardown ) + +EUNIT_TEST( + "LoadResourceStringL - test", + "CMusIndicatorDsa", + "LoadResourceStringL", + "FUNCTIONALITY", + SetupL, UT_CMusIndicatorDsa_LoadResourceStringLL, Teardown ) + + +EUNIT_TEST( + "TryActivate - test", + "CMusIndicatorDsa", + "TryActivate", + "FUNCTIONALITY", + SetupL, UT_CMusIndicatorDsa_TryActivateL, Teardown ) + +EUNIT_TEST( + "StartPeriodicTimer - test", + "CMusIndicatorDsa", + "StartPeriodicTimer", + "FUNCTIONALITY", + SetupL, UT_CMusIndicatorDsa_StartPeriodicTimerL, Teardown ) + +EUNIT_TEST( + "StopPeriodicTimer - test", + "CMusIndicatorDsa", + "StopPeriodicTimer", + "FUNCTIONALITY", + SetupL, UT_CMusIndicatorDsa_StopPeriodicTimerL, Teardown ) + +EUNIT_TEST( + "DoHandleResourceChange - test", + "CMusIndicatorDsa", + "DoHandleResourceChange", + "FUNCTIONALITY", + SetupL, UT_CMusIndicatorDsa_DoHandleResourceChangeL, Teardown ) + +EUNIT_TEST( + "HandleResourceChange - test", + "CMusIndicatorDsa", + "HandleResourceChange", + "FUNCTIONALITY", + SetupL, UT_CMusIndicatorDsa_HandleResourceChangeL, Teardown ) + + +EUNIT_END_TEST_TABLE diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshindicator/tsrc/ut_indicator/src/ut_cmussoundplayer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshindicator/tsrc/ut_indicator/src/ut_cmussoundplayer.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,288 @@ +/* +* 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: Unit tests for CMusSoundPlayer class. +* +*/ + + + +#include "ut_cmussoundplayer.h" +#include +#include + + +// Next row is to disable warning emerging from EUnit code. +#pragma warn_illtokenpasting off + + +// ======== MEMBER FUNCTIONS ======== + + +UT_CMusSoundPlayer* UT_CMusSoundPlayer::NewL() + { + UT_CMusSoundPlayer* self = UT_CMusSoundPlayer::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +UT_CMusSoundPlayer* UT_CMusSoundPlayer::NewLC() + { + UT_CMusSoundPlayer* self = new( ELeave ) UT_CMusSoundPlayer(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +UT_CMusSoundPlayer::~UT_CMusSoundPlayer() + { + delete iSoundPlayer; + iSoundPlayer = NULL; + } + + +UT_CMusSoundPlayer::UT_CMusSoundPlayer() + { + } + + +// --------------------------------------------------------------------------- +// The ConstructL from the base class CEUnitTestSuiteClass must be called. +// It generates the test case table. +// --------------------------------------------------------------------------- +// +void UT_CMusSoundPlayer::ConstructL() + { + CEUnitTestSuiteClass::ConstructL(); + } + + +// --------------------------------------------------------------------------- +// From MMusSoundPlayerObserver. +// Notifies of sound playing complete. +// --------------------------------------------------------------------------- +// +void UT_CMusSoundPlayer::PlaySoundComplete( TInt /*aError*/ ) + { + } + + +// ---------------------------------------------------------------------------- +// Prepares a test for execution. +// ---------------------------------------------------------------------------- +// +void UT_CMusSoundPlayer::SetupL() + { + iSoundPlayer = CMusSoundPlayer::NewL( *this ); + } + + +// ---------------------------------------------------------------------------- +// Finalizes a test by releasing used resources. +// ---------------------------------------------------------------------------- +// +void UT_CMusSoundPlayer::Teardown() + { + delete iSoundPlayer; + } + + +// ======== UNIT TEST METHODS ======== + + +// ---------------------------------------------------------------------------- +// Asserts that instantiation is successful. +// ---------------------------------------------------------------------------- +// +void UT_CMusSoundPlayer::UT_CMusSoundPlayer_NewLL() + { + EUNIT_ASSERT( iSoundPlayer ); + } + + +// ---------------------------------------------------------------------------- +// Asserts that instantiation is successful. +// ---------------------------------------------------------------------------- +// +void UT_CMusSoundPlayer::UT_CMusSoundPlayer_NewLCL() + { + delete iSoundPlayer; + iSoundPlayer = NULL; + iSoundPlayer = CMusSoundPlayer::NewLC( *this ); + CleanupStack::Pop( iSoundPlayer ); + EUNIT_ASSERT( iSoundPlayer ); + } + + +// ---------------------------------------------------------------------------- +// Dummy test. +// ---------------------------------------------------------------------------- +// +void UT_CMusSoundPlayer::UT_CMusSoundPlayer_PlayLL() + { + iSoundPlayer->PlayL( CMusSoundPlayer::EVsAvailableSound ); + EUNIT_ASSERT( iSoundPlayer->iMdaPlayer ) + EUNIT_ASSERT_EQUALS( iSoundPlayer->iState, + CMusSoundPlayer::ESoundPlayerPlaying ) + + EUNIT_ASSERT_SPECIFIC_LEAVE( + iSoundPlayer->PlayL( CMusSoundPlayer::EVsAvailableSound ), + KErrNotReady ) + } + + +// ---------------------------------------------------------------------------- +// Asserts that stopping works. +// ---------------------------------------------------------------------------- +// +void UT_CMusSoundPlayer::UT_CMusSoundPlayer_StopL() + { + iSoundPlayer->PlayL( CMusSoundPlayer::EVsAvailableSound ); + iSoundPlayer->Stop(); + EUNIT_ASSERT( CMusSoundPlayer::ESoundPlayerReady == iSoundPlayer->iState ); + + // No harm done if called second time + iSoundPlayer->Stop(); + } + + +// ---------------------------------------------------------------------------- +// Asserts that failure in init deletes MDA sound player instance. +// ---------------------------------------------------------------------------- +// +void UT_CMusSoundPlayer::UT_CMusSoundPlayer_MapcInitCompleteL() + { + iSoundPlayer->iMdaPlayer = CMdaAudioPlayerUtility::NewFilePlayerL( + _L( "C:\\wav.wav" ), + *iSoundPlayer, + EMdaPriorityMax, + (TMdaPriorityPreference) KAudioPrefVoiceAid ); + iSoundPlayer->MapcInitComplete( KErrGeneral, 1000 ); + EUNIT_ASSERT( !iSoundPlayer->iMdaPlayer ); + } + + +// ---------------------------------------------------------------------------- +// Asserts that completion of playback deletes MDA sound player instance. +// ---------------------------------------------------------------------------- +// +void UT_CMusSoundPlayer::UT_CMusSoundPlayer_MapcPlayCompleteL() + { + iSoundPlayer->iMdaPlayer = CMdaAudioPlayerUtility::NewFilePlayerL( + _L( "C:\\wav.wav" ), + *iSoundPlayer, + EMdaPriorityMax, + (TMdaPriorityPreference) KAudioPrefVoiceAid ); + iSoundPlayer->MapcPlayComplete( KErrNone ); + EUNIT_ASSERT( !iSoundPlayer->iMdaPlayer ); + } + + +// ---------------------------------------------------------------------------- +// Asserts that sound filename is generated. +// ---------------------------------------------------------------------------- +// +void UT_CMusSoundPlayer::UT_CMusSoundPlayer_SoundFileNameLCL() + { + HBufC* filename = iSoundPlayer->SoundFileNameLC( + CMusSoundPlayer::EVsAvailableSound ); + EUNIT_ASSERT( filename ); + EUNIT_ASSERT( filename->Length() ); + CleanupStack::PopAndDestroy( filename ); + } + + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +void UT_CMusSoundPlayer::IT_CMusSoundPlayer_DeletePlayerWhenPlaying() + { + iSoundPlayer->PlayL( CMusSoundPlayer::EVsAvailableSound ); + EUNIT_ASSERT( iSoundPlayer->iMdaPlayer ) + EUNIT_ASSERT_EQUALS( iSoundPlayer->iState, + CMusSoundPlayer::ESoundPlayerPlaying ) + + delete iSoundPlayer; + iSoundPlayer = NULL; + } + + +// ======== EUNIT TEST TABLE ======== + + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusSoundPlayer, + "UT_CMusSoundPlayer", + "UNIT" ) + +EUNIT_TEST( + "NewL - test", + "CMusSoundPlayer", + "NewL", + "FUNCTIONALITY", + SetupL, UT_CMusSoundPlayer_NewLL, Teardown ) + +EUNIT_TEST( + "NewLC - test ", + "CMusSoundPlayer", + "NewLC", + "FUNCTIONALITY", + SetupL, UT_CMusSoundPlayer_NewLCL, Teardown ) + +EUNIT_TEST( + "PlayL - test ", + "CMusSoundPlayer", + "PlayL", + "FUNCTIONALITY", + SetupL, UT_CMusSoundPlayer_PlayLL, Teardown ) + +EUNIT_TEST( + "Stop - test ", + "CMusSoundPlayer", + "Stop", + "FUNCTIONALITY", + SetupL, UT_CMusSoundPlayer_StopL, Teardown ) + +EUNIT_TEST( + "MapcInitComplete - test ", + "CMusSoundPlayer", + "MapcInitComplete", + "FUNCTIONALITY", + SetupL, UT_CMusSoundPlayer_MapcInitCompleteL, Teardown ) + +EUNIT_TEST( + "MapcPlayComplete - test ", + "CMusSoundPlayer", + "MapcPlayComplete", + "FUNCTIONALITY", + SetupL, UT_CMusSoundPlayer_MapcPlayCompleteL, Teardown ) + +EUNIT_TEST( + "SoundFileNameLC - test ", + "CMusSoundPlayer", + "SoundFileNameLC", + "FUNCTIONALITY", + SetupL, UT_CMusSoundPlayer_SoundFileNameLCL, Teardown ) + +EUNIT_TEST( + "Test deleting player when playing", + "CMusSoundPlayer", + "Destructor", + "FUNCTIONALITY", + SetupL, IT_CMusSoundPlayer_DeletePlayerWhenPlaying, Teardown ) + + +EUNIT_END_TEST_TABLE diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagercli/BWINS/musmanagerclientu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagercli/BWINS/musmanagerclientu.def Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,12 @@ +EXPORTS + ?AvailabilityL@CMusManager@@QAE?AW4TMusAvailabilityStatus@MultimediaSharing@@XZ @ 1 NONAME ; enum MultimediaSharing::TMusAvailabilityStatus CMusManager::AvailabilityL(void) + ?ExamineAvailabilityL@CMusManager@@QAEXXZ @ 2 NONAME ; void CMusManager::ExamineAvailabilityL(void) + ?HandleCommandL@CMusManager@@QAEXW4TCommandType@MultimediaSharing@@@Z @ 3 NONAME ; void CMusManager::HandleCommandL(enum MultimediaSharing::TCommandType) + ?HandleSipRequestL@CMusManager@@QAEXW4TRequestType@1@@Z @ 4 NONAME ; void CMusManager::HandleSipRequestL(enum CMusManager::TRequestType) + ?NewL@CMusManager@@SAPAV1@XZ @ 5 NONAME ; class CMusManager * CMusManager::NewL(void) + ?NewLC@CMusManager@@SAPAV1@XZ @ 6 NONAME ; class CMusManager * CMusManager::NewLC(void) + ?StartApplicationL@CMusManager@@QAEXW4TMusUseCase@MultimediaSharing@@@Z @ 7 NONAME ; void CMusManager::StartApplicationL(enum MultimediaSharing::TMusUseCase) + ?StopApplicationL@CMusManager@@QAEXXZ @ 8 NONAME ; void CMusManager::StopApplicationL(void) + ?NewL@CMusManager@@SAPAV1@PAVMMusAvailabilityObserver@@@Z @ 9 NONAME ; class CMusManager * CMusManager::NewL(class MMusAvailabilityObserver *) + ?NewLC@CMusManager@@SAPAV1@PAVMMusAvailabilityObserver@@@Z @ 10 NONAME ; class CMusManager * CMusManager::NewLC(class MMusAvailabilityObserver *) + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagercli/EABI/musmanagerclientu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagercli/EABI/musmanagerclientu.def Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,18 @@ +EXPORTS + _ZN11CMusManager13AvailabilityLEv @ 1 NONAME + _ZN11CMusManager14HandleCommandLEN17MultimediaSharing12TCommandTypeE @ 2 NONAME + _ZN11CMusManager16StopApplicationLEv @ 3 NONAME + _ZN11CMusManager17HandleSipRequestLENS_12TRequestTypeE @ 4 NONAME + _ZN11CMusManager17StartApplicationLEN17MultimediaSharing11TMusUseCaseE @ 5 NONAME + _ZN11CMusManager20ExamineAvailabilityLEv @ 6 NONAME + _ZN11CMusManager4NewLEv @ 7 NONAME + _ZN11CMusManager5NewLCEv @ 8 NONAME + _ZTI11CMusManager @ 9 NONAME ; ## + _ZTI15CMusManagerImpl @ 10 NONAME ; ## + _ZTV11CMusManager @ 11 NONAME ; ## + _ZTV15CMusManagerImpl @ 12 NONAME ; ## + _ZN11CMusManager4NewLEP24MMusAvailabilityObserver @ 13 NONAME + _ZN11CMusManager5NewLCEP24MMusAvailabilityObserver @ 14 NONAME + _ZTIN15CMusManagerImpl23CMusManagerImplListenerE @ 15 NONAME ; ## + _ZTVN15CMusManagerImpl23CMusManagerImplListenerE @ 16 NONAME ; ## + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagercli/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagercli/group/bld.inf Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,31 @@ +/* +* 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: Build information file for project MUSH +* +*/ + + +#include + +PRJ_PLATFORMS +WINSCW ARMV5 + +PRJ_EXPORTS +// None. + +PRJ_MMPFILES +musmanagerclient.mmp + + +PRJ_TESTEXPORTS diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagercli/group/musmanagerclient.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagercli/group/musmanagerclient.mmp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2006-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: Definition of project MultimediaSharing for S60 3.2 +* +*/ + + +#include +#include + +#include "../../../inc/musuid.hrh" + +TARGET musmanagerclient.dll +TARGETTYPE dll +UID 0x1000008d KMusManagerClientUid + +EPOCSTACKSIZE 0x8000 + +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE musmanagerserverstarter.cpp +SOURCE musmanager.cpp +SOURCE musmanagerimpl.cpp +SOURCE musmanagerclientsession.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../mmshshared/inc +USERINCLUDE ../../inc +USERINCLUDE ../../../inc + +APP_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY flogger.lib +LIBRARY featmgr.lib + +PAGED diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagercli/inc/musmanagerclientsession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagercli/inc/musmanagerclientsession.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,88 @@ +/* +* 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: ?Description +* +*/ + +#ifndef MUSMANAGERCLIENTSESSION_H +#define MUSMANAGERCLIENTSESSION_H + +#include + +#include "musunittesting.h" +#include "musmanagercommon.h" + +/** + * ?one_line_short_description + * + * ?more_complete_description + * + * @lib ?library + * @since S60 ?S60_version *** for example, S60 v3.0 + */ +class RMusManagerClientSession + : public RSessionBase + { + + MUS_UNITTEST( UT_RMusManagerClientSession ) + +public: // constructor + + RMusManagerClientSession(); + +public: // new functions + + void ConnectL(); + + void Disconnect(); + + void InvestigateAvailabilityL(); + + MultimediaSharing::TMusAvailabilityStatus QueryAvailabilityL(); + + void StartL( MultimediaSharing::TMusUseCase aUseCase ); + + void StartObservingAvailabilityL(); + + void StopL(); + + /** + * This function allows clients to request coomand's to be executed by + * the MUS manager server. + * + * In erroneous cases, this function will leave + * with an error code that describes the error. Positive leave codes + * are defined in MultimediaSharing::TMusAvailabilityStatus. + * + * @param aRequest Defines the coomand type. + * + */ + void HandleCommandL( MultimediaSharing::TCommandType aCommandType ); + + void HandleSipRequestL( TInt aUid ); + + void MonitorAvailabilityL( + TRequestStatus& aRequestStatus, + TIpcArgs& aIpcArgs ); + + void CancelMonitoringL(); + +private: // data + + TVersion Version() const; + }; + + + +#endif // MUSMANAGERCLIENTSESSION_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagercli/inc/musmanagerimpl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagercli/inc/musmanagerimpl.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,171 @@ +/* +* 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: ?Description +* +*/ + + +#ifndef MUSMANAGERIMPL_H +#define MUSMANAGERIMPL_H + +#include "musunittesting.h" +#include "musmanagerclientsession.h" + +#include + + +enum TServerStart + { + EServerAlreadyRunning, + EServer + + }; + +/** + * ?one_line_short_description + * + * ?more_complete_description + * + * @lib musmanagerclient.dll + * @since S60 v3.2 + */ + +class MMusAvailabilityObserver; + +class CMusManagerImpl : public CBase + { + + MUS_UNITTEST( UT_CMusManagerImpl ) + +public: // first phase constructors + + static CMusManagerImpl* NewL(); + + static CMusManagerImpl* NewLC(); + + static CMusManagerImpl* NewL( MMusAvailabilityObserver* aObserver ); + + static CMusManagerImpl* NewLC( MMusAvailabilityObserver* aObserver ); + + virtual ~CMusManagerImpl(); + +public: // new functions + + void ExamineAvailabilityL(); + + MultimediaSharing::TMusAvailabilityStatus AvailabilityL(); + + /** + * This function allows clients to request coomand's to be executed by + * the MUS manager server. + * + * In erroneous cases, this function will leave + * with an error code that describes the error. Positive leave codes + * are defined in MultimediaSharing::TMusAvailabilityStatus. + * + * @param aRequest Defines the coomand type. + * + */ + void HandleCommandL( MultimediaSharing::TCommandType aCommandType ); + + void HandleSipRequestL( TInt aChannelId ); + + void StartApplicationL( MultimediaSharing::TMusUseCase aUseCase ); + + void StopApplicationL(); + +private: // second phase constructors + + CMusManagerImpl(); + + CMusManagerImpl( MMusAvailabilityObserver* aObserver ); + + void ConstructL(); + +private: // private helper functions + + void StartServer(); + + TBool ServerStarted(); + + void ConnectL(); + + void InitSessionL(); + +private: // private new functions + + MultimediaSharing::TMusAvailabilityStatus QueryAvailabilityL(); + + void MonitorAvailabilityL( TRequestStatus& aRequestStatus ); + + void CancelMonitoring(); + +private: // data + + RMusManagerClientSession iSession; + + TBool iConnected; + + TIpcArgs iPcArgs; + + TPckgBuf iPckg; + + MMusAvailabilityObserver* iAvailabilityObserver; + +private: // class + + /** + * Active object class listening for + * availability status changes + */ + class CMusManagerImplListener : public CActive + { + + public: + + static CMusManagerImplListener* NewL( CMusManagerImpl* aMusManagerImpl ); + + virtual ~CMusManagerImplListener(); + + void ListenL(); + + private: // from CActive + + void RunL(); + + void DoCancel(); + + TInt RunError( TInt aError ); + + private: + + CMusManagerImplListener( CMusManagerImpl* aMusManagerImpl ); + + void ConstructL(); + + private: + + CMusManagerImpl* iMusManagerImpl; + + }; + +private: // data + + CMusManagerImplListener* iListener; + }; + + + + +#endif // MUSMANAGERIMPL_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagercli/inc/musmanagerserverstarter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagercli/inc/musmanagerserverstarter.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,48 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef MUSMANAGERSERVERSTARTER_H +#define MUSMANAGERSERVERSTARTER_H + +// INCLUDES +#include + +// CLASS DECLARATION + +/** +* This class starts client-server server part of MultimediaSharing. +* +* @lib +*/ + +class MusManagerServerStarter + { +public: // New functions + + static TInt Start(); + + static TBool Started(); + +private: + + static TInt CreateServerProcess(RSemaphore& aSemaphore); + }; + +#endif // MUSMANAGERSERVERSTARTER_H + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagercli/src/musmanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagercli/src/musmanager.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,216 @@ +/* +* 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: ?Description +* +*/ + + +#include "musmanager.h" +#include "musmanagerimpl.h" + +#include "musunittesting.h" +#include "muslogger.h" +#include "musavailabilityobserver.h" +#include + +// --------------------------------------------------------------------------- +// Default Constructor for CMusManager +// CMusManager::CMusManager() +// --------------------------------------------------------------------------- +// +CMusManager::CMusManager() + { + } + +// --------------------------------------------------------------------------- +// Two Phase Constructor +// CMusManager::ConstructL() +// --------------------------------------------------------------------------- +// +void CMusManager::ConstructL() + { + FeatureManager::InitializeLibL(); + TBool support = FeatureManager::FeatureSupported( KFeatureIdMultimediaSharing ); + FeatureManager::UnInitializeLib(); + if ( !support ) + { + User::Leave( KErrNotSupported ); + } + iImpl = CMusManagerImpl::NewL(); + } + + +// --------------------------------------------------------------------------- +// Two Phase Constructor +// CMusManager::ConstructL() +// --------------------------------------------------------------------------- +// +void CMusManager::ConstructL( MMusAvailabilityObserver* aObserver ) + { + FeatureManager::InitializeLibL(); + TBool support = FeatureManager::FeatureSupported( KFeatureIdMultimediaSharing ); + FeatureManager::UnInitializeLib(); + if ( !support ) + { + User::Leave( KErrNotSupported ); + } + iImpl = CMusManagerImpl::NewL( aObserver ); + } + + +// --------------------------------------------------------------------------- +// Two Phase Constructor +// CMusManager::NewL() +// --------------------------------------------------------------------------- +// +EXPORT_C CMusManager* CMusManager::NewL() + { + MUS_LOG( "mus: [MUSCLI] -> CMusManager::NewL()" ); + CMusManager* self = CMusManager::NewLC(); + CleanupStack::Pop( self ); + MUS_LOG( "mus: [MUSCLI] <- CMusManager::NewL()" ); + return self; + } + + +// --------------------------------------------------------------------------- +// Two Phase Constructor +// CMusManager::NewLC() +// --------------------------------------------------------------------------- +// +EXPORT_C CMusManager* CMusManager::NewLC() + { + MUS_LOG( "mus: [MUSCLI] -> CMusManager::NewLC()" ); + + CMusManager* self = new( ELeave ) CMusManager; + CleanupStack::PushL( self ); + self->ConstructL(); + + MUS_LOG( "mus: [MUSCLI] <- CMusManager::NewLC()" ); + return self; + } + + +// --------------------------------------------------------------------------- +// Two Phase Constructor +// CMusManager::NewL() +// --------------------------------------------------------------------------- +// +EXPORT_C CMusManager* CMusManager::NewL( MMusAvailabilityObserver* aObserver ) + { + MUS_LOG( "mus: [MUSCLI] -> CMusManager::NewL()" ); + CMusManager* self = CMusManager::NewLC( aObserver ); + CleanupStack::Pop( self ); + MUS_LOG( "mus: [MUSCLI] <- CMusManager::NewL()" ); + return self; + } + + +// --------------------------------------------------------------------------- +// Two Phase Constructor +// CMusManager::NewLC() +// --------------------------------------------------------------------------- +// +EXPORT_C CMusManager* CMusManager::NewLC( MMusAvailabilityObserver* aObserver ) + { + MUS_LOG( "mus: [MUSCLI] -> CMusManager::NewLC()" ); + + CMusManager* self = new( ELeave ) CMusManager; + CleanupStack::PushL( self ); + self->ConstructL( aObserver ); + + MUS_LOG( "mus: [MUSCLI] <- CMusManager::NewLC()" ); + return self; + } + + +// --------------------------------------------------------------------------- +// Destructor +// CMusManager::~CMusManager() +// --------------------------------------------------------------------------- +// +CMusManager::~CMusManager() + { + MUS_LOG( "mus: [MUSCLI] -> CMusManager::~CMusManager()" ); + delete iImpl; + MUS_LOG( "mus: [MUSCLI] <- CMusManager::~CMusManager()" ); + } + +// --------------------------------------------------------------------------- +// CMusManager::ExamineAvailabilityL() +// --------------------------------------------------------------------------- +// +EXPORT_C void CMusManager::ExamineAvailabilityL() + { + MUS_LOG( "mus: [MUSCLI] -> CMusManager::ExamineAvailabilityL()" ); + iImpl->ExamineAvailabilityL(); + MUS_LOG( "mus: [MUSCLI] <- CMusManager::ExamineAvailabilityL()" ); + } + +// --------------------------------------------------------------------------- +// CMusManager::AvailabilityL() +// --------------------------------------------------------------------------- +// +EXPORT_C MultimediaSharing::TMusAvailabilityStatus CMusManager::AvailabilityL() + { + MUS_LOG( "mus: [MUSCLI] -> CMusManager::AvailabilityL()" ); + MultimediaSharing::TMusAvailabilityStatus status = iImpl->AvailabilityL(); + MUS_LOG( "mus: [MUSCLI] <- CMusManager::AvailabilityL()" ); + return status; + } + +// --------------------------------------------------------------------------- +// CMusManager::HandleCommandL() +// --------------------------------------------------------------------------- +// +EXPORT_C void CMusManager::HandleCommandL( + MultimediaSharing::TCommandType aCommandType ) + { + MUS_LOG( "mus: [MUSCLI] -> CMusManager::HandleCommandL()" ); + iImpl->HandleCommandL( aCommandType ); + MUS_LOG( "mus: [MUSCLI] <- CMusManager::HandleCommandL()" ); + } +// --------------------------------------------------------------------------- +// CMusManager::HandleSipRequestL( TRequestType aChannelId ) +// --------------------------------------------------------------------------- +// +EXPORT_C void CMusManager::HandleSipRequestL( TRequestType aChannelId ) + { + MUS_LOG( "mus: [MUSCLI] -> CMusManager::HandleSipRequestL()" ); + iImpl->HandleSipRequestL( ( TInt ) aChannelId ); + MUS_LOG( "mus: [MUSCLI] <- CMusManager::HandleSipRequestL()" ); + } + +// --------------------------------------------------------------------------- +// CMusManager::StartApplicationL( MultimediaSharing::TMusUseCase aUseCase ) +// --------------------------------------------------------------------------- +// +EXPORT_C void CMusManager::StartApplicationL( + MultimediaSharing::TMusUseCase aUseCase ) + { + MUS_LOG( "mus: [MUSCLI] -> CMusManager::StartApplicationL()" ); + iImpl->StartApplicationL( aUseCase ); + MUS_LOG( "mus: [MUSCLI] <- CMusManager::StartApplicationL()" ); + } + +// --------------------------------------------------------------------------- +// CMusManager::StopApplicationL() +// --------------------------------------------------------------------------- +// +EXPORT_C void CMusManager::StopApplicationL() + { + MUS_LOG( "mus: [MUSCLI] -> CMusManager::StopApplicationL()" ); + iImpl->StopApplicationL(); + MUS_LOG( "mus: [MUSCLI] <- CMusManager::StopApplicationL()" ); + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagercli/src/musmanagerclientsession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagercli/src/musmanagerclientsession.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,239 @@ +/* +* 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: ?Description +* +*/ + + +#include + +#include "musmanagerclientsession.h" +#include "musmanageripccommon.h" +#include "musmanagercommon.h" +#include "muslogger.h" +#include "musmanager.h" + +/* Number of outstanding request can be issued by the client + For Mush 8 is normal and if needed it has to be increased + Or decreased . If request exceeds this number then that particular + Request will be considered as part of the global pool of request +*/ +#define ASYNCHRONOUS_MESSAGE_SLOTS 255 + +// ======== LOCAL FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +RMusManagerClientSession::RMusManagerClientSession() + : RSessionBase () + { + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void RMusManagerClientSession::ConnectL() + { + MUS_LOG( "mus: [MUSCLI] -> RMusManagerClientSession::ConnectL()" ); + TRequestStatus s; + User::LeaveIfError( CreateSession( KMusManagerServerName(), Version(), + ASYNCHRONOUS_MESSAGE_SLOTS, &s ) ); + + User::WaitForRequest( s ); + MUS_LOG( "mus: [MUSCLI] <- RMusManagerClientSession::ConnectL()" ); + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void RMusManagerClientSession::Disconnect() + { + MUS_LOG( "mus: [MUSCLI] -> RMusManagerClientSession::Disconnect()" ); + RHandleBase::Close(); + MUS_LOG( "mus: [MUSCLI] <- RMusManagerClientSession::Disconnect()" ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TVersion RMusManagerClientSession::Version(void) const + { + MUS_LOG( "mus: [MUSCLI] -> RMusManagerClientSession::Version()" ); + MUS_LOG( "mus: [MUSCLI] <- RMusManagerClientSession::Version()" ); + return TVersion( KMusManagerServerMajorVersionNumber, + KMusManagerServerMinorVersionNumber, + KMusManagerServerBuildVersionNumber); + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void RMusManagerClientSession::InvestigateAvailabilityL() + { + MUS_LOG( "mus: [MUSCLI] -> RMusManagerClientSession::InvestigateAvailabilityL()" ); + // construct an empty argument + TIpcArgs ipcArgs( TIpcArgs::ENothing ); + + // send + User::LeaveIfError( SendReceive( EMusManagerIpcInvestigateAvailability, ipcArgs ) ); + MUS_LOG( "mus: [MUSCLI] <- RMusManagerClientSession::InvestigateAvailabilityL()" ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +MultimediaSharing::TMusAvailabilityStatus RMusManagerClientSession::QueryAvailabilityL() + { + MUS_LOG( "mus: [MUSCLI] -> RMusManagerClientSession::QueryAvailabilityL()" ); + TInt capability; + TPckg capPckg( capability ); + + // construct a single argument + TIpcArgs ipcArgs( &capPckg ); + + // send and wait for answer + User::LeaveIfError( SendReceive( EMusManagerIpcAvailabilityQuery, ipcArgs ) ); + + MUS_LOG( "mus: [MUSCLI] <- RMusManagerClientSession::QueryAvailabilityL()" ); + return ( MultimediaSharing::TMusAvailabilityStatus ) capability; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void RMusManagerClientSession::StartL( MultimediaSharing::TMusUseCase aUseCase ) + { + MUS_LOG( "mus: [MUSCLI] -> RMusManagerClientSession::StartL()" ); + TPckg pckg( ( TInt ) aUseCase ); + TIpcArgs ipcArgs( &pckg ); + // send + + User::LeaveIfError( SendReceive( EMusManagerIpcStartMultimediaSharing, ipcArgs ) ); + MUS_LOG( "mus: [MUSCLI] <- RMusManagerClientSession::StartL()" ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void RMusManagerClientSession::StartObservingAvailabilityL() + { + MUS_LOG( "mus: [MUSCLI] -> RMusManagerClientSession::\ + StartObservingAvailabilityL()" ); + // construct an empty argument + TIpcArgs ipcArgs( TIpcArgs::ENothing ); + + // send + User::LeaveIfError( SendReceive( EMusManagerIpcStartObservingAvailability, ipcArgs ) ); + MUS_LOG( "mus: [MUSCLI] <- RMusManagerClientSession::\ + StartObservingAvailabilityL()" ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void RMusManagerClientSession::StopL() + { + MUS_LOG( "mus: [MUSCLI] -> RMusManagerClientSession::StopL()" ); + // construct an empty argument + TIpcArgs ipcArgs( TIpcArgs::ENothing ); + + // send + User::LeaveIfError( SendReceive( EMusManagerIpcStopMultimediaSharing, ipcArgs ) ); + MUS_LOG( "mus: [MUSCLI] -> RMusManagerClientSession::StopL()" ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void RMusManagerClientSession::HandleCommandL( + MultimediaSharing::TCommandType aCommandType ) + { + MUS_LOG( "mus: [MUSCLI] -> RMusManagerClientSession::HandleCommandL()" ); + // construct a single argument + TPckg pckg( ( TInt ) aCommandType ); + TIpcArgs ipcArgs( &pckg ); + // send + User::LeaveIfError( SendReceive( EMusManagerIpcHandleCommand, ipcArgs ) ); + MUS_LOG( "mus: [MUSCLI] <- RMusManagerClientSession::HandleCommandL()" ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void RMusManagerClientSession::HandleSipRequestL( TInt aUid ) + { + MUS_LOG( "mus: [MUSCLI] -> RMusManagerClientSession::HandleSipRequestL()" ); + // construct a single argument + TPckg pckg( aUid ); + TIpcArgs ipcArgs( &pckg ); + // Handle sip options in a different way + if (aUid == CMusManager::ESipOptions) + { + MUS_LOG( "mus: [MUSCLI] -> This is sip options request sending to server" ); + User::LeaveIfError( SendReceive( EMusManagerIpcOptionsReceived, ipcArgs ) ); + } + else + { + MUS_LOG( "mus: [MUSCLI] -> This is some invitation request sending to server" ); + User::LeaveIfError( SendReceive( EMusManagerIpcInvitationReceived, ipcArgs ) ); + } + + MUS_LOG( "mus: [MUSCLI] <- RMusManagerClientSession::HandleSipRequestL()" ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void RMusManagerClientSession::MonitorAvailabilityL( + TRequestStatus& aRequestStatus, + TIpcArgs& aIpcArgs ) + { + MUS_LOG( "mus: [MUSCLI] -> RMusManagerClientSession::MonitorAvailabilityL()" ); + SendReceive( + EMusManagerIpcMonitorAvailability, + aIpcArgs, + aRequestStatus ); + MUS_LOG( "mus: [MUSCLI] <- RMusManagerClientSession::MonitorAvailabilityL()" ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void RMusManagerClientSession::CancelMonitoringL() + { + MUS_LOG( "mus: [MUSCLI] -> RMusManagerClientSession::CancelMonitoring()" ); + // construct an empty argument + TIpcArgs ipcArgs( TIpcArgs::ENothing ); + + // send + User::LeaveIfError( SendReceive( EMusManagerIpcCancelMonitoring, ipcArgs ) ); + MUS_LOG( "mus: [MUSCLI] <- RMusManagerClientSession::CancelMonitoring()" ); + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagercli/src/musmanagerimpl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagercli/src/musmanagerimpl.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,415 @@ +/* +* 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: ?Description +* +*/ + + + +#include "musmanagerimpl.h" +#include "musmanager.h" +#include "musmanageripccommon.h" +#include "musmanagerserverstarter.h" +#include "muslogger.h" +#include "musavailabilityobserver.h" + +// --------------------------------------------------------------------------- +// CMusManagerImpl::CMusManagerImpl +// --------------------------------------------------------------------------- +// +CMusManagerImpl::CMusManagerImpl() + : iConnected( EFalse ) + { + } + + +// --------------------------------------------------------------------------- +// CMusManagerImpl::CMusManagerImpl +// --------------------------------------------------------------------------- +// +CMusManagerImpl::CMusManagerImpl( MMusAvailabilityObserver* aObserver ) + : iConnected( EFalse ), iAvailabilityObserver( aObserver ) + { + } + + +// --------------------------------------------------------------------------- +// CMusManagerImpl::ConstructL +// --------------------------------------------------------------------------- +// +void CMusManagerImpl::ConstructL() + { + if ( iAvailabilityObserver ) + { + iListener = CMusManagerImplListener::NewL( this ); + } + } + + +// --------------------------------------------------------------------------- +// CMusManagerImpl::NewL +// --------------------------------------------------------------------------- +// +CMusManagerImpl* CMusManagerImpl::NewL() + { + CMusManagerImpl* self = CMusManagerImpl::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// --------------------------------------------------------------------------- +// CMusManagerImpl::NewLC +// --------------------------------------------------------------------------- +// +CMusManagerImpl* CMusManagerImpl::NewLC() + { + CMusManagerImpl* self = new( ELeave ) CMusManagerImpl; + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// --------------------------------------------------------------------------- +// CMusManagerImpl::NewL +// --------------------------------------------------------------------------- +// +CMusManagerImpl* CMusManagerImpl::NewL( MMusAvailabilityObserver* aObserver ) + { + CMusManagerImpl* self = CMusManagerImpl::NewLC( aObserver ); + CleanupStack::Pop( self ); + return self; + } + + +// --------------------------------------------------------------------------- +// CMusManagerImpl::NewLC +// --------------------------------------------------------------------------- +// +CMusManagerImpl* CMusManagerImpl::NewLC( MMusAvailabilityObserver* aObserver ) + { + CMusManagerImpl* self = new( ELeave ) CMusManagerImpl( aObserver ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// --------------------------------------------------------------------------- +// CMusManagerImpl::~CMusManagerImpl +// --------------------------------------------------------------------------- +// +CMusManagerImpl::~CMusManagerImpl() + { + MUS_LOG( "mus: [MUSCLI] -> CMusManagerImpl::~CMusManagerImpl()" ); + delete iListener; + iSession.Disconnect(); + MUS_LOG( "mus: [MUSCLI] <- CMusManagerImpl::~CMusManagerImpl()" ); + } + + +// --------------------------------------------------------------------------- +// CMusManagerImpl::~CMusManagerImpl +// --------------------------------------------------------------------------- +// +void CMusManagerImpl::StartServer() + { + MUS_LOG( "mus: [MUSCLI] -> CMusManagerImpl::StartServer()" ); + TInt error = MusManagerServerStarter::Start(); + MUS_LOG( "mus: [MUSCLI] <- CMusManagerImpl::StartServer()" ); + } + +// --------------------------------------------------------------------------- +// CMusManagerImpl::~CMusManagerImpl +// --------------------------------------------------------------------------- +// +TBool CMusManagerImpl::ServerStarted() + { + return MusManagerServerStarter::Started(); + } + +// --------------------------------------------------------------------------- +// CMusManagerImpl::~CMusManagerImpl +// --------------------------------------------------------------------------- +// +void CMusManagerImpl::ExamineAvailabilityL() + { + MUS_LOG( "mus: [MUSCLI] -> CMusManagerImpl::ExamineAvailabilityL()" ); + // ensure server and connection are ok + InitSessionL(); + + iSession.InvestigateAvailabilityL(); + MUS_LOG( "mus: [MUSCLI] <- CMusManagerImpl::ExamineAvailabilityL()" ); + } + +// --------------------------------------------------------------------------- +// Returns the current availability of MultimediaSharing. +// --------------------------------------------------------------------------- +// +MultimediaSharing::TMusAvailabilityStatus CMusManagerImpl::AvailabilityL() + { + MUS_LOG( "mus: [MUSCLI] -> CMusManagerImpl::AvailabilityL()" ); + + MultimediaSharing::TMusAvailabilityStatus status; + + if( !ServerStarted() ) + { + status = ( MultimediaSharing::TMusAvailabilityStatus ) KErrNotReady; + } + else + { + status = QueryAvailabilityL(); + } + MUS_LOG( "mus: [MUSCLI] <- CMusManagerImpl::AvailabilityL()" ); + + return status; + } + +// --------------------------------------------------------------------------- +// Forwards command to executed by MultimediaSharing. +// --------------------------------------------------------------------------- +// +void CMusManagerImpl::HandleCommandL( + MultimediaSharing::TCommandType aCommandType ) + { + MUS_LOG( "mus: [MUSCLI] -> CMusManagerImpl::HandleCommandL()" ); + // ensure server and connection are ok + InitSessionL(); + + iSession.HandleCommandL( aCommandType ); + MUS_LOG( "mus: [MUSCLI] <- CMusManagerImpl::HandleCommandL()" ); + } +// --------------------------------------------------------------------------- +// Forwards a SIP request to be handled by MultimediaSharing. +// --------------------------------------------------------------------------- +// +void CMusManagerImpl::HandleSipRequestL( TInt aChannelId ) + { + MUS_LOG( "mus: [MUSCLI] -> CMusManagerImpl::HandleSipRequestL()" ); + // ensure server and connection are ok + InitSessionL(); + + iSession.HandleSipRequestL( aChannelId ); + MUS_LOG( "mus: [MUSCLI] <- CMusManagerImpl::HandleSipRequestL()" ); + } + +// --------------------------------------------------------------------------- +// Starts the MultimediaSharing application. +// --------------------------------------------------------------------------- +// +void CMusManagerImpl::StartApplicationL( MultimediaSharing::TMusUseCase aUseCase ) + { + MUS_LOG( "mus: [MUSCLI] -> CMusManagerImpl::StartApplicationL()" ); + // ensure server and connection are ok + InitSessionL(); + + MultimediaSharing::TMusAvailabilityStatus status = + iSession.QueryAvailabilityL(); + + if( status < KErrNone || status >= MultimediaSharing::EErrSipRegistration ) + { + MUS_LOG1( "mus: [MUSCLI] <- CMusManagerImpl::StartApplicationL( leave: %d )", + status ); + User::Leave( status ); + } + + iSession.StartL( aUseCase ); + + MUS_LOG( "mus: [MUSCLI] <- CMusManagerImpl::StartApplicationL()" ); + } + +// --------------------------------------------------------------------------- +// Stops the MultimediaSharing application. +// --------------------------------------------------------------------------- +// +void CMusManagerImpl::StopApplicationL() + { + MUS_LOG( "mus: [MUSCLI] -> CMusManagerImpl::StopApplicationL()" ); + // ensure server and connection are ok + InitSessionL(); + + iSession.StopL(); + MUS_LOG( "mus: [MUSCLI] <- CMusManagerImpl::StopApplicationL()" ); + } + +// --------------------------------------------------------------------------- +// Starts investigating the current availability of MultimediaSharing. +// --------------------------------------------------------------------------- +// +MultimediaSharing::TMusAvailabilityStatus CMusManagerImpl::QueryAvailabilityL() + { + MUS_LOG( "mus: [MUSCLI] -> CMusManagerImpl::QueryAvailabilityL()" ); + // ensure server and connection are ok + InitSessionL(); + + MultimediaSharing::TMusAvailabilityStatus status + = iSession.QueryAvailabilityL(); + + MUS_LOG( "mus: [MUSCLI] <- CMusManagerImpl::QueryAvailabilityL()" ); + return status; + } + +// --------------------------------------------------------------------------- +// Starts to monitor availability +// --------------------------------------------------------------------------- +// +void CMusManagerImpl::MonitorAvailabilityL( TRequestStatus& aRequestStatus ) + { + MUS_LOG( "mus: [MUSCLI] -> CMusManagerImpl::MonitorAvailabilityL()" ); + + iPcArgs.Set( EMusManagerIpcArgAvailabilityStatus, &iPckg ); + iSession.MonitorAvailabilityL( aRequestStatus, iPcArgs ); + + MUS_LOG( "mus: [MUSCLI] <- CMusManagerImpl::MonitorAvailabilityL()" ); + } + + +// --------------------------------------------------------------------------- +// Starts server process, if needed, and then opens a session to it. +// --------------------------------------------------------------------------- +// +void CMusManagerImpl::InitSessionL() + { + MUS_LOG( "mus: [MUSCLI] -> CMusManagerImpl::InitSessionL()" ); + // if server not started, start it + if( !ServerStarted() ) + { + StartServer(); + } + + // if no session, connect + if( !iConnected ) + { + ConnectL(); + } + MUS_LOG( "mus: [MUSCLI] <- CMusManagerImpl::InitSessionL()" ); + } + + +// --------------------------------------------------------------------------- +// Connects this client to the server process; opens a session. +// --------------------------------------------------------------------------- +// +void CMusManagerImpl::ConnectL() + { + MUS_LOG( "mus: [MUSCLI] -> CMusManagerImpl::ConnectL()" ); + iSession.ConnectL(); + + iConnected = ETrue; + MUS_LOG( "mus: [MUSCLI] <- CMusManagerImpl::ConnectL()" ); + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CMusManagerImpl::CancelMonitoring() + { + MUS_LOG( "mus: [MUSCLI] -> CMusManagerImpl::CancelMonitoring()" ); + TRAP_IGNORE( iSession.CancelMonitoringL() ); + MUS_LOG( "mus: [MUSCLI] <- CMusManagerImpl::CancelMonitoring()" ); + } + + +// --------------------------------------------------------------------------- +// Creates listener +// --------------------------------------------------------------------------- +// +CMusManagerImpl::CMusManagerImplListener* + CMusManagerImpl::CMusManagerImplListener::NewL( + CMusManagerImpl* aMusManagerImpl ) + { + CMusManagerImplListener* self = + new ( ELeave ) CMusManagerImplListener( aMusManagerImpl ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// Constructs listener +// --------------------------------------------------------------------------- +// +CMusManagerImpl::CMusManagerImplListener::CMusManagerImplListener( + CMusManagerImpl* aMusManagerImpl ) : + CActive(0), iMusManagerImpl( aMusManagerImpl ) + { + CActiveScheduler::Add(this); + } + +// --------------------------------------------------------------------------- +// ConstructL +// --------------------------------------------------------------------------- +// +void CMusManagerImpl::CMusManagerImplListener::ConstructL() + { + iMusManagerImpl->InitSessionL(); + iMusManagerImpl->iSession.StartObservingAvailabilityL(); + ListenL(); + } + +// --------------------------------------------------------------------------- +// Destructs listener +// --------------------------------------------------------------------------- +// +CMusManagerImpl::CMusManagerImplListener::~CMusManagerImplListener() + { + Cancel(); + } + +// --------------------------------------------------------------------------- +// Start listening availability events +// --------------------------------------------------------------------------- +// +void CMusManagerImpl::CMusManagerImplListener::ListenL() + { + iMusManagerImpl->MonitorAvailabilityL( iStatus ); + SetActive(); + } + +// --------------------------------------------------------------------------- +// RunL +// --------------------------------------------------------------------------- +// +void CMusManagerImpl::CMusManagerImplListener::RunL() + { + iMusManagerImpl->iAvailabilityObserver->MusAvailabilityChangedL( + iMusManagerImpl->iPckg() ); + + // restart monitoring + ListenL(); + } + +// --------------------------------------------------------------------------- +// RunL +// --------------------------------------------------------------------------- +// +TInt CMusManagerImpl::CMusManagerImplListener::RunError( TInt aError ) + { + MUS_LOG1( "mus: [MUSCLI] CMusManagerImplListener::RunError: %d", \ + aError ); + return aError; + } + +// --------------------------------------------------------------------------- +// Cancel +// --------------------------------------------------------------------------- +// +void CMusManagerImpl::CMusManagerImplListener::DoCancel() + { + iMusManagerImpl->CancelMonitoring(); + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagercli/src/musmanagerserverstarter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagercli/src/musmanagerserverstarter.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,90 @@ +/* +* 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: ?Description +* +*/ + + +// INCLUDES +#include "musmanagerserverstarter.h" +#include "musmanageripccommon.h" +#include "muslogger.h" + +// ---------------------------------------------------------------------------- +// MusManagerServerStarter::Start +// ---------------------------------------------------------------------------- +// +TInt MusManagerServerStarter::Start () + { + MUS_LOG( "mus: [MUSCLI] -> MusManagerServerStarter::Start()" ); + TInt err( KErrNone ); + + if( !Started() ) + { + RSemaphore semaphore; + err = semaphore.CreateGlobal( KMusManagerServerSemaphoreName ,0 ); + if ( err != KErrNone ) + { + MUS_LOG1( "mus: [MUSCLI] <- MusManagerServerStarter::Start( %d )", + err ); + return err; + } + + err = CreateServerProcess( semaphore ); + semaphore.Close (); + } + MUS_LOG( "mus: [MUSCLI] <- MusManagerServerStarter::Start()" ); + return err; + } + +// ---------------------------------------------------------------------------- +// MusManagerServerStarter::Started +// ---------------------------------------------------------------------------- +// +TBool MusManagerServerStarter::Started() + { + MUS_LOG( "mus: [MUSCLI] -> MusManagerServerStarter::Start()" ); + TFindServer findServer( KMusManagerServerName ); + TFullName name; + if (findServer.Next(name) == KErrNone) + { + MUS_LOG( "mus: [MUSCLI] <- MusManagerServerStarter::Start()" ); + return ETrue; // Server already running + } + MUS_LOG( "mus: [MUSCLI] <- MusManagerServerStarter::Start()" ); + return EFalse; + } + +// ---------------------------------------------------------------------------- +// MusManagerServerStarter::CreateServerProcess +// ---------------------------------------------------------------------------- +// +TInt MusManagerServerStarter::CreateServerProcess( RSemaphore& aSemaphore ) + { + TInt err = KErrNone; + const TUidType serverUid( KNullUid, KNullUid, KServerUid3 ); + RProcess server; + err = server.Create( KMusManagerServerName, KNullDesC() ,serverUid ); + if ( err ) + { + return err; + } + server.Resume(); + aSemaphore.Wait(); + TInt exitReason = server.ExitReason(); + server.Close(); + return exitReason; + } + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagercli/tsrc/ut_managercli/bwins/ut_musmanagerclientu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagercli/tsrc/ut_managercli/bwins/ut_musmanagerclientu.def Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,3 @@ +EXPORTS + ?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 1 NONAME ; class MEUnitTest * CreateTestSuiteL(void) + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagercli/tsrc/ut_managercli/eabi/ut_musmanagerclientu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagercli/tsrc/ut_managercli/eabi/ut_musmanagerclientu.def Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,3 @@ +EXPORTS + _Z16CreateTestSuiteLv @ 1 NONAME + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagercli/tsrc/ut_managercli/group/Coverage.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagercli/tsrc/ut_managercli/group/Coverage.bat Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,30 @@ +rem +rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +rem All rights reserved. +rem This component and the accompanying materials are made available +rem under the terms of "Eclipse Public License v1.0" +rem which accompanies this distribution, and is available +rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +rem +rem Initial Contributors: +rem Nokia Corporation - initial contribution. +rem +rem Contributors: +rem +rem Description: +rem + +set my_wins_udeb=%EPOCROOT%epoc32\release\winscw\udeb\ +set my_output_file=Coverage.txt +set my_uncovered=UnCovered.txt +set my_dll=SipClientDiscoveryTest + +prep /EXCALL /INC CSIPClientDiscoveryReceiver.cpp(0-0) /INC CSIPClientDiscoverySerializer.cpp(0-0) /INC CSipClientDiscovery.cpp(0-0) /INC CSipClientDiscoveryImpl.cpp(0-0) /INC SIPClientResolverServerStarter.cpp(0-0) /LV %my_wins_udeb%%my_dll%.dll + +profile /i %my_wins_udeb%%my_dll% /o %my_wins_udeb%%my_dll% %my_wins_udeb%cppunit.exe %my_dll%.dll 2 + +prep /M %my_wins_udeb%%my_dll% + +plist %my_wins_udeb%%my_dll% > %my_output_file% + +grep -h -e ": \.\|\.cpp" %my_output_file% | grep -vh "inline" > %my_uncovered% diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagercli/tsrc/ut_managercli/group/Coverage.txt diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagercli/tsrc/ut_managercli/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagercli/tsrc/ut_managercli/group/bld.inf Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,20 @@ +/* +* Copyright (c) 2005-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 file for project MuS Manager Client tests. +* +*/ + + +PRJ_MMPFILES +ut_musmanagerclient.mmp \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagercli/tsrc/ut_managercli/group/ct_en_example.cmd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagercli/tsrc/ut_managercli/group/ct_en_example.cmd Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,35 @@ +rem +rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +rem All rights reserved. +rem This component and the accompanying materials are made available +rem under the terms of "Eclipse Public License v1.0" +rem which accompanies this distribution, and is available +rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +rem +rem Initial Contributors: +rem Nokia Corporation - initial contribution. +rem +rem Contributors: +rem +rem Description: +rem + +@echo off +set CODE_TEST_LIB=NTmvc_TargetLibMD.lib CtSymbianNativeMem.lib +set AMC_TARGET=x86-symbian-native + +REM ######################################################## +REM ### Default settings (performance analysis, statement coverage) +REM set CTDRIVER_ARGS=-CTsize_t=unsigned -CTtag-allocator -CTv -CTno-tag-includes + +REM ######################################################## +REM ### MCE Client +set CTDRIVER_ARGS=-CTsize_t=unsigned -CTtag-allocator -CTsymbian -CTno-tag-includes -CTtag-level=DC -CTonly-tag-files=mushmanager.cpp,mushmanagerclientsession.cpp,mushmanagerimpl.cpp,mushmanagerserverstarter.cpp + +REM ######################################################## +REM ### Display the new settings +echo CodeTest parameters set to: +set CODE_TEST_LIB +set CTDRIVER_ARGS + +@echo on diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagercli/tsrc/ut_managercli/group/ut_musmanagerclient.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagercli/tsrc/ut_managercli/group/ut_musmanagerclient.mmp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,62 @@ +/* +* Copyright (c) 2006-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 definition file for project MusManager Client unit +* tests. +* +*/ + + +#include +#include + + +TARGET ut_musmanagerclient.dll +TARGETTYPE dll +TARGETPATH /sys/bin +UID 0x1000af5a 0x01700021 + +CAPABILITY EUNIT_CAPS +VENDORID VID_DEFAULT + +MACRO UNIT_TESTING + +SOURCEPATH ../src +SOURCE ut_musmanagerclientdllmain.cpp +SOURCE musmanagerserverstarterstub.cpp +SOURCE musmanagerclientsessionstub.cpp +SOURCE ut_cmusmanager.cpp +SOURCE ut_cmusmanagerimpl.cpp + +SOURCEPATH ../../../src +SOURCE musmanager.cpp +SOURCE musmanagerimpl.cpp + +SOURCEPATH ../../../../../tsrc/featmgrstub/src +SOURCE FeatMgr.cpp + + +USERINCLUDE ../../../../../tsrc/featmgrstub/inc +USERINCLUDE ../inc +USERINCLUDE ../../../inc +USERINCLUDE ../../../../mmshshared/inc +USERINCLUDE ../../../../inc +USERINCLUDE ../../../../../inc + +APP_LAYER_SYSTEMINCLUDE + +LIBRARY EUnit.lib +LIBRARY euser.lib +LIBRARY flogger.lib + +EPOCALLOWDLLDATA diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagercli/tsrc/ut_managercli/inc/ut_cmusmanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagercli/tsrc/ut_managercli/inc/ut_cmusmanager.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,95 @@ +/* +* Copyright (c) 2006-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: Unit tests for CMusManager class. +* +*/ + + + +#ifndef UT_CMUSMANAGER_H +#define UT_CMUSMANAGER_H + + +#include "musmanagercommon.h" +#include +#include +#include + +#pragma warn_illtokenpasting off + +class CMusManager; + + +/** + * UT_CMusManager implements unit tests for CMusManager class. + */ +class UT_CMusManager : public CEUnitTestSuiteClass, + public MMusAvailabilityObserver + { +public: + + static UT_CMusManager* NewL(); + static UT_CMusManager* NewLC(); + + /** + * Destructor. + */ + virtual ~UT_CMusManager(); + + /** + * Sets up a test case by instantiating tested class. + */ + void SetupL(); + void SetupDummyL(); + + /** + * Finalizes a test case by freeing resources. + */ + void Teardown(); + void TeardownDummy(); + + /** + * Unit test methods. + */ + void UT_CMusManager_ExamineAvailabilityLL(); + void UT_CMusManager_AvailabilityLL(); + void UT_CMusManager_HandleSipRequestLL(); + void UT_CMusManager_HandleCommandLL(); + void UT_CMusManager_StartApplicationLL(); + void UT_CMusManager_StopApplicationLL(); + void UT_CMusManager_NewLL(); + +public: // from MMusAvailabilityObserver + void MusAvailabilityChangedL( + MultimediaSharing::TMusAvailabilityStatus aAvailabilityStatus ); + +private: + + UT_CMusManager(); + void ConstructL(); + +private: // data + + /** + * Pointer to instance of tested class. + * Own. + */ + CMusManager* iImpl; + + EUNIT_DECLARE_TEST_TABLE; + + }; + + +#endif // UT_CMUSMANAGER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagercli/tsrc/ut_managercli/inc/ut_cmusmanagerimpl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagercli/tsrc/ut_managercli/inc/ut_cmusmanagerimpl.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,82 @@ +/* +* Copyright (c) 2006-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: Unit tests for CMusManagerImpl class. +* +*/ + + + +#ifndef UT_CMUSMANAGERIMPL_H +#define UT_CMUSMANAGERIMPL_H + + +#include "musmanagerimpl.h" +#include +#include + + +/** + * This class implements unit tests for CMusManagerImpl class. + */ +class UT_CMusManagerImpl : public CEUnitTestSuiteClass + { +public: + + static UT_CMusManagerImpl* NewL(); + static UT_CMusManagerImpl* NewLC(); + virtual ~UT_CMusManagerImpl(); + + /** + * Unit test methods. + */ + void UT_CMusManagerImpl_ExamineAvailabilityLL(); + void UT_CMusManagerImpl_AvailabilityLL(); + void UT_CMusManagerImpl_HandleSipRequestLL(); + void UT_CMusManagerImpl_StartApplicationLL(); + void UT_CMusManagerImpl_StopApplicationLL(); + void UT_CMusManagerImpl_HandleCommandLL(); +private: + + UT_CMusManagerImpl(); + void ConstructL(); + + /** + * Sets up a test case by instantiating tested class. + */ + void SetupL(); + + /** + * Finalizes a test case by freeing resources. + */ + void Teardown(); + + void UT_CMusManagerImpl_StartServerL(); + void UT_CMusManagerImpl_ServerStartedL(); + void UT_CMusManagerImpl_ConnectLL(); + void UT_CMusManagerImpl_InitSessionLL(); + void UT_CMusManagerImpl_QueryAvailabilityLL(); + +private: // data + + /** + * Pointer to instance of tested class. + * Own. + */ + CMusManagerImpl* iImpl; + + EUNIT_DECLARE_TEST_TABLE; + }; + + +#endif // UT_CMUSMANAGERIMPL_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagercli/tsrc/ut_managercli/src/musmanagerclientsessionstub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagercli/tsrc/ut_managercli/src/musmanagerclientsessionstub.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,101 @@ +/* +* Copyright (c) 2006-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: Stub implementation of CMusManagerServerClientSession +* +*/ + + + +#include "musmanagerclientsession.h" +#include "musmanagercommon.h" +#include "musmanageripccommon.h" +#include "musunittesting.h" +#include + + +TRequestStatus* iRequestStatus; + +// ======== MEMBER FUNCTIONS ======== + + +RMusManagerClientSession::RMusManagerClientSession() + : RSessionBase () + { + } + + +void RMusManagerClientSession::ConnectL() + { + } + + +TVersion RMusManagerClientSession::Version(void) const + { + return TVersion( KMusManagerServerMajorVersionNumber, + KMusManagerServerMinorVersionNumber, + KMusManagerServerBuildVersionNumber); + } + + +void RMusManagerClientSession::Disconnect() + { + } + + +void RMusManagerClientSession::InvestigateAvailabilityL() + { + } + + +MultimediaSharing::TMusAvailabilityStatus RMusManagerClientSession::QueryAvailabilityL() + { + return (MultimediaSharing::TMusAvailabilityStatus) KErrNone; + } + + +void RMusManagerClientSession::StartL( MultimediaSharing::TMusUseCase /*aUseCase*/ ) + { + } + + +void RMusManagerClientSession::StopL() + { + } + + +void RMusManagerClientSession::HandleSipRequestL( TInt /*aUid*/ ) + { + } + + +void RMusManagerClientSession::MonitorAvailabilityL( + TRequestStatus& aRequestStatus, + TIpcArgs& /*aIpcArgs*/ ) + { + iRequestStatus = &aRequestStatus; + } + + +void RMusManagerClientSession::CancelMonitoringL() + { + User::RequestComplete( iRequestStatus, KErrCancel ); + } + +void RMusManagerClientSession::HandleCommandL( MultimediaSharing::TCommandType /*aCommandType*/ ) + { + } + +void RMusManagerClientSession::StartObservingAvailabilityL() + { + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagercli/tsrc/ut_managercli/src/musmanagerserverstarterstub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagercli/tsrc/ut_managercli/src/musmanagerserverstarterstub.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,40 @@ +/* +* Copyright (c) 2005-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: Stub implementation of MusManagerServerStarter +* +*/ + + + +#include "musmanagerserverstarter.h" +#include "musmanageripccommon.h" +#include "musunittesting.h" + + +TInt MusManagerServerStarter::Start () + { + return KErrNone; + } + + +TBool MusManagerServerStarter::Started() + { + return EFalse; + } + + +TInt MusManagerServerStarter::CreateServerProcess( RSemaphore& /*aSemaphore*/ ) + { + return KErrNone; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagercli/tsrc/ut_managercli/src/ut_cmusmanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagercli/tsrc/ut_managercli/src/ut_cmusmanager.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,260 @@ +/* +* Copyright (c) 2006-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: Implements unit tests for CMusManager class. +* +*/ + + + +#include "muslogger.h" +#include "musmanager.h" +#include "ut_cmusmanager.h" +#include "musmanagerimpl.h" +#include "FeatMgr.h" +#include + +// ======== MEMBER FUNCTIONS ======== + + +UT_CMusManager::UT_CMusManager() + : CEUnitTestSuiteClass() + { + } + + +// --------------------------------------------------------------------------- +// The ConstructL from the base class CEUnitTestSuiteClass must be called. +// It generates the test case table. +// --------------------------------------------------------------------------- +// +void UT_CMusManager::ConstructL() + { + CEUnitTestSuiteClass::ConstructL(); + } + + +UT_CMusManager* UT_CMusManager::NewL() + { + UT_CMusManager* self = UT_CMusManager::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +UT_CMusManager* UT_CMusManager::NewLC() + { + UT_CMusManager* self = new( ELeave ) UT_CMusManager; + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +UT_CMusManager::~UT_CMusManager() + { + } + + +// --------------------------------------------------------------------------- +// Sets up a test case by instantiating tested class. +// --------------------------------------------------------------------------- +// +void UT_CMusManager::SetupL( ) + { + iImpl = CMusManager::NewL(); + } + + +// --------------------------------------------------------------------------- +// Finalizes a test case by freeing resources. +// --------------------------------------------------------------------------- +// +void UT_CMusManager::Teardown( ) + { + delete iImpl; + } + + +// ======== UNIT TEST METHODS ======== + + +// --------------------------------------------------------------------------- +// Dummy test to increase execution coverage. +// --------------------------------------------------------------------------- +// +void UT_CMusManager::UT_CMusManager_ExamineAvailabilityLL() + { + iImpl->ExamineAvailabilityL(); + } + + +// --------------------------------------------------------------------------- +// Dummy test to increase execution coverage. +// --------------------------------------------------------------------------- +// +void UT_CMusManager::UT_CMusManager_AvailabilityLL() + { + iImpl->AvailabilityL(); + } + + +// --------------------------------------------------------------------------- +// Dummy test to increase execution coverage. +// --------------------------------------------------------------------------- +// +void UT_CMusManager::UT_CMusManager_HandleSipRequestLL() + { + iImpl->HandleSipRequestL( CMusManager::ESipOptions ); + } + + +// --------------------------------------------------------------------------- +// Dummy test to increase execution coverage. +// --------------------------------------------------------------------------- +// +void UT_CMusManager::UT_CMusManager_StartApplicationLL() + { + iImpl->StartApplicationL( MultimediaSharing::EMusLiveVideo ); + iImpl->StartApplicationL( MultimediaSharing::EMusClipVideo ); + iImpl->StartApplicationL( MultimediaSharing::EMusStillImage ); + } + + +void UT_CMusManager::UT_CMusManager_HandleCommandLL() + { + MultimediaSharing::TCommandType commandType = MultimediaSharing::ECommandNotDefined; + iImpl->HandleCommandL( commandType ); + commandType = MultimediaSharing::ECommandManualActivation; + iImpl->HandleCommandL( commandType ); + + } + +// --------------------------------------------------------------------------- +// Dummy test to increase execution coverage. +// --------------------------------------------------------------------------- +// +void UT_CMusManager::UT_CMusManager_StopApplicationLL() + { + iImpl->StopApplicationL(); + } + +// --------------------------------------------------------------------------- +// Sets up dummy +// --------------------------------------------------------------------------- +// +void UT_CMusManager::SetupDummyL( ) + { + } + + +// --------------------------------------------------------------------------- +// Teardown Dummy +// --------------------------------------------------------------------------- +// +void UT_CMusManager::TeardownDummy( ) + { + } + +// --------------------------------------------------------------------------- +// NewLL +// --------------------------------------------------------------------------- +// +void UT_CMusManager::UT_CMusManager_NewLL() + { + CMusManager *self = NULL; + + FeatureManager::MultimediaSharingNotSupported(); + TRAPD(err, self =CMusManager::NewL( this )); + EUNIT_ASSERT( err == KErrNoMemory||err == KErrNotSupported ); + delete self; + + FeatureManager::MultimediaSharingSupported(); + TRAPD(error, self =CMusManager::NewL( this )); + EUNIT_ASSERT( error == KErrNoMemory||error == KErrNone ); + delete self; + } + +// --------------------------------------------------------------------------- +// MusAvailabilityChangedL +// --------------------------------------------------------------------------- +// +void UT_CMusManager::MusAvailabilityChangedL( + MultimediaSharing::TMusAvailabilityStatus /*aAvailabilityStatus*/ ) + { + + } + + +// ======== EUNIT TEST TABLE ======== + + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusManager, + "CMusManager", + "CMusManager" ) + +EUNIT_TEST( + "StopApplicationL - test", + "CMusManager", + "StopApplicationL", + "FUNCTIONALITY", + SetupL, UT_CMusManager_StopApplicationLL, Teardown) + +EUNIT_TEST( + "StartApplicationL - test", + "CMusManager", + "StartApplicationL", + "FUNCTIONALITY", + SetupL, UT_CMusManager_StartApplicationLL, Teardown) + +EUNIT_TEST( + "HandleSipRequestL - test", + "CMusManager", + "HandleSipRequestL", + "FUNCTIONALITY", + SetupL, UT_CMusManager_HandleSipRequestLL, Teardown) + + +EUNIT_TEST( + "AvailabilityL - test", + "CMusManager", + "AvailabilityL", + "FUNCTIONALITY", + SetupL, UT_CMusManager_AvailabilityLL, Teardown) + + +EUNIT_TEST( + "ExamineAvailabilityL - test", + "CMusManager", + "ExamineAvailabilityL", + "FUNCTIONALITY", + SetupL, UT_CMusManager_ExamineAvailabilityLL, Teardown) + +EUNIT_TEST( + "NewL - test", + "CMusManager", + "NewL", + "FUNCTIONALITY", + SetupDummyL, UT_CMusManager_NewLL, TeardownDummy ) + +EUNIT_TEST( + "HandleCommandL - test", + "CMusManager", + "HandleCommandL", + "FUNCTIONALITY", + SetupL, UT_CMusManager_HandleCommandLL, Teardown ) + + +EUNIT_END_TEST_TABLE + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagercli/tsrc/ut_managercli/src/ut_cmusmanagerimpl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagercli/tsrc/ut_managercli/src/ut_cmusmanagerimpl.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,290 @@ +/* +* Copyright (c) 2006-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 unit tests for CMusManagerImpl class. +* +*/ + + + +#include "musmanager.h" +#include "musmanagerimpl.h" +#include "ut_cmusmanagerimpl.h" +#include "musmanagerserverstarter.h" + +// To avoid warning about "invalid token pasting" when generating test table +#pragma warn_illtokenpasting off + + +// ======== MEMBER FUNCTIONS ======== + + +UT_CMusManagerImpl::UT_CMusManagerImpl() + : CEUnitTestSuiteClass() + { + } + + +// --------------------------------------------------------------------------- +// The ConstructL from the base class CEUnitTestSuiteClass must be called. +// It generates the test case table. +// --------------------------------------------------------------------------- +// +void UT_CMusManagerImpl::ConstructL() + { + CEUnitTestSuiteClass::ConstructL(); + } + + +UT_CMusManagerImpl* UT_CMusManagerImpl::NewL() + { + UT_CMusManagerImpl* self = UT_CMusManagerImpl::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +UT_CMusManagerImpl* UT_CMusManagerImpl::NewLC() + { + UT_CMusManagerImpl* self = new( ELeave ) UT_CMusManagerImpl; + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +UT_CMusManagerImpl::~UT_CMusManagerImpl() + { + } + + +// --------------------------------------------------------------------------- +// Sets up a test case by instantiating tested class. +// --------------------------------------------------------------------------- +// +void UT_CMusManagerImpl::SetupL( ) + { + iImpl = CMusManagerImpl::NewL(); + } + + +// --------------------------------------------------------------------------- +// Finalizes a test case by freeing resources. +// --------------------------------------------------------------------------- +// +void UT_CMusManagerImpl::Teardown( ) + { + delete iImpl; + } + + +// ======== UNIT TEST METHODS ======== + + +// --------------------------------------------------------------------------- +// Dummy test to increase execution coverage. +// --------------------------------------------------------------------------- +// +void UT_CMusManagerImpl::UT_CMusManagerImpl_StartServerL() + { + iImpl->StartServer(); + } + + +// --------------------------------------------------------------------------- +// Dummy test to increase execution coverage. +// --------------------------------------------------------------------------- +// +void UT_CMusManagerImpl::UT_CMusManagerImpl_ServerStartedL() + { + iImpl->ServerStarted(); + } + + +// --------------------------------------------------------------------------- +// Dummy test to increase execution coverage. +// --------------------------------------------------------------------------- +// +void UT_CMusManagerImpl::UT_CMusManagerImpl_ExamineAvailabilityLL() + { + iImpl->ExamineAvailabilityL(); + } + + +// --------------------------------------------------------------------------- +// Dummy test to increase execution coverage. +// --------------------------------------------------------------------------- +// +void UT_CMusManagerImpl::UT_CMusManagerImpl_AvailabilityLL() + { + iImpl->AvailabilityL(); + } + + +// --------------------------------------------------------------------------- +// Dummy test to increase execution coverage. +// --------------------------------------------------------------------------- +// +void UT_CMusManagerImpl::UT_CMusManagerImpl_HandleSipRequestLL() + { + iImpl->HandleSipRequestL( 1 ); + } + + +// --------------------------------------------------------------------------- +// Dummy test to increase execution coverage. +// --------------------------------------------------------------------------- +// +void UT_CMusManagerImpl::UT_CMusManagerImpl_StartApplicationLL() + { + iImpl->StartApplicationL( MultimediaSharing::EMusLiveVideo ); + iImpl->StartApplicationL( MultimediaSharing::EMusClipVideo ); + iImpl->StartApplicationL( MultimediaSharing::EMusStillImage ); + } + + +// --------------------------------------------------------------------------- +// Dummy test to increase execution coverage. +// --------------------------------------------------------------------------- +// +void UT_CMusManagerImpl::UT_CMusManagerImpl_StopApplicationLL() + { + iImpl->StopApplicationL(); + } + + +// --------------------------------------------------------------------------- +// Dummy test to increase execution coverage. +// --------------------------------------------------------------------------- +// +void UT_CMusManagerImpl::UT_CMusManagerImpl_QueryAvailabilityLL() + { + iImpl->QueryAvailabilityL(); + } + + +// --------------------------------------------------------------------------- +// Dummy test to increase execution coverage. +// --------------------------------------------------------------------------- +// +void UT_CMusManagerImpl::UT_CMusManagerImpl_InitSessionLL() + { + iImpl->InitSessionL(); + } + + +// --------------------------------------------------------------------------- +// Dummy test to increase execution coverage. +// --------------------------------------------------------------------------- +// +void UT_CMusManagerImpl::UT_CMusManagerImpl_ConnectLL() + { + iImpl->ConnectL(); + } + +void UT_CMusManagerImpl::UT_CMusManagerImpl_HandleCommandLL() + { + MultimediaSharing::TCommandType commandType = MultimediaSharing::ECommandNotDefined; + iImpl->HandleCommandL( commandType ); + commandType = MultimediaSharing::ECommandManualActivation; + iImpl->HandleCommandL( commandType ); + + } + + +// ======== EUNIT TEST TABLE ======== + + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusManagerImpl, + "CMusManagerImpl", + "CMusManagerImpl" ) + +EUNIT_TEST( + "ConnectL - test", + "CMusManagerImpl", + "ConnectL", + "FUNCTIONALITY", + SetupL, UT_CMusManagerImpl_ConnectLL, Teardown ) + +EUNIT_TEST( + "InitSessionL - test", + "CMusManagerImpl", + "InitSessionL", + "FUNCTIONALITY", + SetupL, UT_CMusManagerImpl_InitSessionLL, Teardown ) + +EUNIT_TEST( + "QueryAvailabilityL - test", + "CMusManagerImpl", + "QueryAvailabilityL", + "FUNCTIONALITY", + SetupL, UT_CMusManagerImpl_QueryAvailabilityLL, Teardown ) + +EUNIT_TEST( + "StopApplicationL - test", + "CMusManagerImpl", + "StopApplicationL", + "FUNCTIONALITY", + SetupL, UT_CMusManagerImpl_StopApplicationLL, Teardown ) + +EUNIT_TEST( + "StartApplicationL - test", + "CMusManagerImpl", + "StartApplicationL", + "FUNCTIONALITY", + SetupL, UT_CMusManagerImpl_StartApplicationLL, Teardown ) + +EUNIT_TEST( + "HandleSipRequestL - test", + "CMusManagerImpl", + "HandleSipRequestL", + "FUNCTIONALITY", + SetupL, UT_CMusManagerImpl_HandleSipRequestLL, Teardown ) + +EUNIT_TEST( + "AvailabilityL - test", + "CMusManagerImpl", + "AvailabilityL", + "FUNCTIONALITY", + SetupL, UT_CMusManagerImpl_AvailabilityLL, Teardown ) + +EUNIT_TEST( + "ExamineAvailabilityL - test", + "CMusManagerImpl", + "ExamineAvailabilityL", + "FUNCTIONALITY", + SetupL, UT_CMusManagerImpl_ExamineAvailabilityLL, Teardown ) + +EUNIT_TEST( + "ServerStarted - test", + "CMusManagerImpl", + "ServerStarted", + "FUNCTIONALITY", + SetupL, UT_CMusManagerImpl_ServerStartedL, Teardown ) + +EUNIT_TEST( + "StartServer - test", + "CMusManagerImpl", + "StartServer", + "FUNCTIONALITY", + SetupL, UT_CMusManagerImpl_StartServerL, Teardown ) + +EUNIT_TEST( + "HandleCommandL - test", + "CMusManager", + "HandleCommandL", + "FUNCTIONALITY", + SetupL, UT_CMusManagerImpl_HandleCommandLL, Teardown ) + +EUNIT_END_TEST_TABLE diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagercli/tsrc/ut_managercli/src/ut_musmanagerclientDllMain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagercli/tsrc/ut_managercli/src/ut_musmanagerclientDllMain.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,47 @@ +/* +* 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: Provides main factory function for unit test suite. +* +*/ + + + +#include "ut_cmusmanagerimpl.h" +#include "ut_cmusmanager.h" +#include + + +// Name of test suite +_LIT( KTestSuiteName, "MusMangerClient TestSuite" ); + + +// ======== LOCAL FUNCTIONS ======== + + +/** + * Test suite factory function. + */ +EXPORT_C MEUnitTest* CreateTestSuiteL() + { + CEUnitTestSuite* rootSuite = CEUnitTestSuite::NewLC( KTestSuiteName ); + + rootSuite->AddL( UT_CMusManagerImpl::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusManager::NewLC() ); + CleanupStack::Pop(); + + CleanupStack::Pop( rootSuite ); + return rootSuite; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagersrv/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagersrv/group/bld.inf Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,29 @@ +/* +* 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: Build information file for project MUSH +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +// None. + +PRJ_MMPFILES +musmanagerserver.mmp + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagersrv/group/musmanagerserver.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagersrv/group/musmanagerserver.mmp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,66 @@ +/* +* Copyright (c) 2006-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: Definition of project MultimediaSharing for S60 3.2 +* +*/ + + +#include +#include + +#include "../../../inc/musuid.hrh" +#include "../../../inc/musversionnumbers.h" + +TARGET musmanagerserver.exe +TARGETTYPE EXE +UID 0x1000008d KMusManagerServerUid + +CAPABILITY CAP_SERVER +VENDORID VID_DEFAULT +VERSION KMusBinaryVersionNumber + +// Stack Size 20K +EPOCSTACKSIZE 0x5000 + +SOURCEPATH ../src +SOURCE musmanagerserver.cpp +SOURCE musmanagerservercore.cpp +SOURCE musmanagerserveritcutility.cpp +SOURCE musmanagerservermain.cpp +SOURCE musmanagerserversession.cpp +SOURCE musmanagerserverclosetimer.cpp +SOURCE musavailabilitypluginmanager.cpp +SOURCE musapplicationmanager.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../mmshshared/inc +USERINCLUDE ../../inc +USERINCLUDE ../../../inc +USERINCLUDE ../../cenrep + + +APP_LAYER_SYSTEMINCLUDE + +LIBRARY apparc.lib +LIBRARY apgrfx.lib +LIBRARY bafl.lib +LIBRARY ecom.lib +LIBRARY euser.lib +LIBRARY flogger.lib +LIBRARY ws32.lib +LIBRARY musindicator.lib +LIBRARY centralrepository.lib +LIBRARY charconv.lib + +PAGED diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagersrv/inc/musapplicationmanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagersrv/inc/musapplicationmanager.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,159 @@ +/* +* 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: ?Description +* +*/ + + +#ifndef MUSAPPLICATIONMANAGER_H +#define MUSAPPLICATIONMANAGER_H + +#include "musmanagercommon.h" +#include "musunittesting.h" + +#include +#include +#include +#include + + +const TInt KMusMgrMaxPluginNameLen = 256; + +//class TApaTask; + +/** + * Multimedia Sharing application handler + * + * Handles application launch and close functionality. Also + * but application to foreground if all ready running. + * + * @lib none + */ +class CMusApplicationManager : public CBase + { + MUS_UNITTEST( UT_CMusApplicationManager ) + + public: // first phase constructors & destructor + + /** + * + */ + static CMusApplicationManager* NewL(); + + /** + * + */ + static CMusApplicationManager* NewLC(); + + /** + * + */ + ~CMusApplicationManager(); + + + protected: // second phase constructors + + /** + * + */ + void ConstructL(); + + /** + * + */ + CMusApplicationManager(); + + + public: // new public functions + + /** + * @return TBool ETrue if application is runing ( MultimediaSharing ) + */ + TBool ApplicationRunning(); + + /** + * + */ + void StartApplicationL(); + + /** + * + */ + void StopApplicationL(); + + /** + * Brings application to foreground if running all reaydy. + */ + void ShowApplicationL(); + + /** + * Writes given array and other parameter spefic date to Publish & + * Subscripe database. + */ + void WriteSessionPropertiesL( + MultimediaSharing::TMusUseCase aUseCase, + MultimediaSharing::TMusAvailabilityStatus aStatus, + MDesCArray& aSessionParameters ); + + /** + * Overrided version whitout use case. + * + */ + void WriteSessionPropertiesL( + MultimediaSharing::TMusAvailabilityStatus aStatus, + MDesCArray& aSessionParameters ); + + /** + * + */ + void SetStatusL( MultimediaSharing::TMusAvailabilityStatus aStatus ); + + /** + * + */ + void SetIndicatorStatusL( TBool aLaunch ); + + /** + * Resolves name of the ecom plugin which implements the livecomms engine api + * by using the callprovider + */ + void ResolvePluginNameL(TDes8& aPluginName); + + + private: // helper functions + + /** + * + */ + void SetPropertyL( TUint aProperty, const TDesC& aValue ); + + /** + * + */ + void SetPropertyL( TUint aProperty, TInt aValue ); + + /** + * Reads the call provider information from PS key. + */ + void CallProviderL(TDes8& aProvider); + + /** + * Creates command line used when starting application. + * + */ + HBufC* CreateCommandLineArgsLC(); + }; + + +#endif // ? MUSAPPLICATIONMANAGER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagersrv/inc/musavailabilitymonitorobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagersrv/inc/musavailabilitymonitorobserver.h Thu Jul 22 16:32:26 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: ?Description +* +*/ + + +#ifndef MUSCAPABILITYPLUGINMANAGEROBSERVER_H +#define MUSCAPABILITYPLUGINMANAGEROBSERVER_H + +#include + +#include "musmanagercommon.h" + +/** + * ?one_line_short_description + * + * ?more_complete_description + * + * @lib ?library + * @since S60 v3.2 + */ +class MMusAvailabilityPluginManagerObserver + { +public: + + virtual void PluginStopped() = 0; + + virtual void AvailabilityChangedL( + MultimediaSharing::TMusAvailabilityStatus aAvailability ) = 0; + }; + + +#endif // ? MUSCAPABILITYPLUGINMANAGEROBSERVER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagersrv/inc/musavailabilitypluginloader.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagersrv/inc/musavailabilitypluginloader.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,44 @@ +/* +* 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: ?Description +* +*/ + + +#ifndef MUSAVAILABILITYPLUGINLOADER_H +#define MUSAVAILABILITYPLUGINLOADER_H + +#include + +class CMusAvailabilityPlugin; + +/** + * ?one_line_short_description + * + * ?more_complete_description + * + * @lib ?library + * @since S60 ?S60_version *** for example, S60 v3.0 + */ +class MusAvailabilityPluginLoader + { + +public: + + static CMusAvailabilityPlugin* LoadPluginImplementationL(); + + }; + + +#endif // ? MUSAVAILABILITYPLUGINLOADER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagersrv/inc/musavailabilitypluginmanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagersrv/inc/musavailabilitypluginmanager.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,247 @@ +/* +* Copyright (c) 2006-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: Handles interaction with availability plugin +* +*/ + + +#ifndef MUSAVAILABILITYPLUGINMANAGER_H +#define MUSAVAILABILITYPLUGINMANAGER_H + +#include "musmanagercommon.h" +#include "musavaobserver.h" +#include "musunittesting.h" +#include "musindicatorobserver.h" +#include "musavasettingsobserver.h" + +#include +#include + +class CMusAvailabilityPlugin; +class MMusAvailabilityPluginManagerObserver; +class MDesCArray; +class CMusAvaInterface; +class CMusIndicatorApi; +class CMusApplicationManager; + +/** + * ?one_line_short_description + * + * ?more_complete_description + * + * @lib ?library + * @since S60 ?S60_version *** for example, S60 v3.0 + */ +class CMusAvailabilityPluginManager : public CBase, + public MMusAvaObserver, + public MMusIndicatorObserver, + public MMusAvaSettingsObserver + { + + public: // first phase constructors & destructor + + /** + * + */ + static CMusAvailabilityPluginManager* NewL( + MMusAvailabilityPluginManagerObserver& aObserver, + CMusApplicationManager& aApplicationManager ); + + /** + * + */ + static CMusAvailabilityPluginManager* NewLC( + MMusAvailabilityPluginManagerObserver& aObserver, + CMusApplicationManager& aApplicationManager ); + + /** + * + */ + ~CMusAvailabilityPluginManager(); + + + protected: + + /** + * + */ + void ConstructL(); + + /** + * + */ + CMusAvailabilityPluginManager( + MMusAvailabilityPluginManagerObserver& aObserver, + CMusApplicationManager& aApplicationManager ); + + + public: // API + + /** + * + */ + TBool ApplicationAllowed(); + + + /** + * Returning composed availability status + */ + MultimediaSharing::TMusAvailabilityStatus Availability(); + + /** + * + */ + void InvestigateAvailabilityL(); + + /** + * + */ + void PrepareForReceivedInviteL(); + + /** + * + */ + void InvitationReceivedL(); + + /** + * + */ + void OptionsReceivedL(); + + /** + * + */ + void LoadPluginL(); + + /** + * + */ + void StopPluginL(); + + /** + * + */ + MDesCArray& SessionParametersL(); + + /** + * + */ + void ManualQueryL(); + + + /** + * + */ + TBool PossibleToLaunch(); + + + + private: // from MMusAvaObserver + + // TBD: COMMENTS + virtual void AvailabilityChanged( + TAvailabilityName aName, TAvailabilityStatus aStatus ); + + virtual void AvailabilityError( + TAvailabilityName aName, TAvailabilityStatus aStatus ); + + + public: //from MMusAvaSettingsObserver + + TApplicationState ApplicationState(); + + TBool OptionAllowed(); + + void StartApplicationL( MultimediaSharing::TMusUseCase aUseCase ); + + private: // from base class MMusIndicatorObserver. + + /** + * From MMusIndicatorObserver. + * Starts live video sharing. + */ + virtual void StartLiveSharingL(); + + private: /// helper functions + + /** + * Cross-link status codes + */ + MultimediaSharing::TMusAvailabilityStatus MapAvailabilities( + TAvailabilityStatus aStatus ); + + /** + * + */ + void UpdateSessionParametersL(); + + /** + * + */ + HBufC* SipAddressesLC(); + + /** + * + */ + HBufC* VideoCodecsLC(); + /** + * + */ + HBufC* TelNumberLC(); + + /** + * + */ + HBufC* ContactNameLC(); + + + /** + * + */ + void IndicateAvailabilityL(); + + + + private: // owned data + + /** + * + */ + CMusAvaInterface* iPlugin; + + /** + * + */ + MMusAvailabilityPluginManagerObserver& iObserver; + + /** + * + */ + CDesCArrayFlat* iSessionParameters; + + CMusIndicatorApi* iIndicator; + + CMusApplicationManager& iApplicationManager; + + /** + * + */ + TBool iPluginStarted; + MUS_UNITTEST( UT_CMusManagerServerCore ) + MUS_UNITTEST( UT_CMusAvailabilityPluginManager ) + + }; + +#endif // ? MUSAVAILABILITYPLUGINMANAGER_H + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagersrv/inc/musavailabilitypluginmanagerobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagersrv/inc/musavailabilitypluginmanagerobserver.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,48 @@ +/* +* 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: ?Description +* +*/ + + +#ifndef MUSAVAILABILITYPLUGINMANAGEROBSERVER_H +#define MUSAVAILABILITYPLUGINMANAGEROBSERVER_H + +#include + +#include "musmanagercommon.h" + +/** + * ?one_line_short_description + * + * ?more_complete_description + * + * @lib ?library + * @since S60 v3.2 + */ +class MMusAvailabilityPluginManagerObserver + { +public: + + virtual void PluginStopped() = 0; + + virtual void AvailabilityChangedL( + MultimediaSharing::TMusAvailabilityStatus aAvailability ) = 0; + + virtual void StartSharingWithUseCaseL( MultimediaSharing::TMusUseCase aUseCase ) = 0; + + }; + + +#endif // ? MUSAVAILABILITYPLUGINMANAGEROBSERVER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagersrv/inc/musmanagerpanics.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagersrv/inc/musmanagerpanics.h Thu Jul 22 16:32:26 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: ?Description +* +*/ + + + +#ifndef MUSMANAGERPANICS_H +#define MUSMANAGERPANICS_H + +#include + +// Panic Category +// +_LIT(KMusManagerServer, "MusManagerServer"); + + +// MusManagerServer panic codes +// +enum TMusManagerServerPanic + { + EBadRequest, + EBadDescriptor, + ESrvCreateServer, + ECreateTrapCleanup, + EBadSipSessionHandle, + EBadSipSubSessionHandle, + EDatFileCorrupted + }; + +#endif // ? MUSMANAGERPANICS_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagersrv/inc/musmanagerserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagersrv/inc/musmanagerserver.h Thu Jul 22 16:32:26 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: ?Description +* +*/ + + +#ifndef MUSMANAGERSERVER_H +#define MUSMANAGERSERVER_H + +#include +#include "musmanagerserverpanics.h" +#include "musmanagerservercoreobserver.h" +#include "musunittesting.h" + +class CMusManagerServerCloseTimer; +class CMusManagerServerCore; + +/** + * This static class contains the very essential starting functions + * of MusManagerServer + * + * @since S60 v3.2 + */ +class CMusManagerServer + : public CPolicyServer, + public MMusManagerServerCoreObserver + { + MUS_UNITTEST( UT_CMusManagerServerSession ) + +public : + + // TODO: comments + + static CMusManagerServer* NewL(); + static CMusManagerServer* NewLC(); + ~CMusManagerServer(); + + void IncrementSessions(); + void DecrementSessions(); + +public: // from MMusManagerServerCoreObserver + + void StopServer(); + + TUint SessionCount(); + +protected: // From CActive + + TInt RunError( TInt aError ); + +private: // From CServer2 + + CSession2* NewSessionL( const TVersion &aVersion, + const RMessage2& aMessage ) const; + +private: // Second phase constructors + + CMusManagerServer( TInt aPriority ); + void ConstructL(); + +private: // Data + + TUint iSessionCount; + + CMusManagerServerCloseTimer* iCloseTimer; + + CActiveScheduler* iActiveScheduler; + + CMusManagerServerCore* iServerCore; + + }; + +#endif // MUSMANAGERSERVER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagersrv/inc/musmanagerserverclosetimer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagersrv/inc/musmanagerserverclosetimer.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,57 @@ +/* +* 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: ?Description +* +*/ + + +#ifndef MUSMANAGERSERVERCLOSETIMER_H +#define MUSMANAGERSERVERCLOSETIMER_H + +// INCLUDES +#include + +/** + * This class contains + * + * @since S60 v3.2 + */ +class CMusManagerServerCloseTimer : public CActive + { +public: + + static CMusManagerServerCloseTimer* NewL(); + + static CMusManagerServerCloseTimer* NewLC(); + + ~CMusManagerServerCloseTimer(); + + void StopActiveSchedulerAfter( TUint aMilliSeconds ); + void RunL(); + void DoCancel(); + +private: + + CMusManagerServerCloseTimer(); + void ConstructL(); + +private: + //Data + RTimer iTimer; + + }; + +#endif // MUSMANAGERSERVERCLOSETIMER_H + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagersrv/inc/musmanagerservercommon.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagersrv/inc/musmanagerservercommon.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,36 @@ +/* +* 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: ?Description +* +*/ + + +#ifndef MUSMANAGERSERVERCOMMON_H +#define MUSMANAGERSERVERCOMMON_H + +const TInt KParameterCount = 8; + +enum EMusManagerServerParameter + { + KTelNumber = 0, + KSipAddress, + KSipAddressProposal, + KContactId, + KVideoCodec, + KSipProfileId, + KContactName, + KFastMode + }; + +#endif // ? MUSMANAGERSERVERCOMMON_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagersrv/inc/musmanagerservercore.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagersrv/inc/musmanagerservercore.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,140 @@ +/* +* 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: ?Description +* +*/ + + +#ifndef MUSMANAGERSERVERCORE_H +#define MUSMANAGERSERVERCORE_H + +#include + +#include "musmanagercommon.h" +#include "musmanagerserversessionobserver.h" +#include "musavailabilitypluginmanagerobserver.h" +#include "musmanagercommon.h" +#include "musapplicationmanager.h" + +class CMusApplicationManager; +class CMusAvailabilityPlugin; +class CMusAvailabilityPluginManager; +class CMusManagerServerCloseTimer; +class MMusManagerServerCoreObserver; + + +/** + * This static class contains the very essential starting functions + * of MusManagerServer + * + * @since S60 v3.2 + */ +class CMusManagerServerCore + : public CBase, + public MMusManagerServerSessionObserver, + public MMusAvailabilityPluginManagerObserver + { + MUS_UNITTEST( UT_CMusManagerServerCore ) + +public: // first phase constructors & destructor + + static CMusManagerServerCore* NewL( MMusManagerServerCoreObserver& aObserver ); + static CMusManagerServerCore* NewLC( MMusManagerServerCoreObserver& aObserver ); + ~CMusManagerServerCore(); + +protected: // second phase constructors + + void ConstructL(); + + CMusManagerServerCore( MMusManagerServerCoreObserver& aObserver ); + +public: // from MMusManagerServerSessionObserver + + // functionality + + MultimediaSharing::TMusAvailabilityStatus AvailabilityQueryL(); + + void CancelMonitoring( MMusMonitorAvailabilityObserver* aObserver ); + + void CommandL( MultimediaSharing::TCommandType aCommandType ); + + void InvestigateAvailabilityL(); + + void InvitationReceivedL( TUid aChannelId ); + + void OptionsReceivedL( TUid aChannelId ); + + void RegisterObserverL( MMusMonitorAvailabilityObserver* aObserver ); + + void RemoveObserver( MMusMonitorAvailabilityObserver* aObserver ); + + void StartMultimediaSharingL( MultimediaSharing::TMusUseCase aUseCase ); + + void StopMultimediaSharingL(); + +private: + + void StopMonitoring(); + +public: // from MMusManagerServerObserver + + void EventNoSessions(); + +public: // from MMusAvailabilityPluginManagerObserver + + virtual void PluginStopped(); + + // TODO: capability -> availability + + virtual void AvailabilityChangedL( MultimediaSharing::TMusAvailabilityStatus aAvailability ); + + virtual void StartSharingWithUseCaseL( MultimediaSharing::TMusUseCase aUseCase ); + +private: // private methods + + TBool IsMusEnginePlugin(); + + MultimediaSharing::TMusAvailabilityStatus Availability(); + + TBool ApplicationAllowed(); + + void PrepareForReceivedInviteL(); + + void WriteSessionPropertiesL( + MultimediaSharing::TMusUseCase aUseCase, + MultimediaSharing::TMusAvailabilityStatus aStatus, + MDesCArray& aSessionParameters ); + + void WriteSessionPropertiesL( + MultimediaSharing::TMusAvailabilityStatus aStatus, + MDesCArray& aSessionParameters ); + +private: // owned data: + + CMusAvailabilityPluginManager* iPluginManager; + + CMusApplicationManager* iApplicationManager; + + TBuf8 iPluginName; + +private: // not owned data + + MMusManagerServerCoreObserver& iObserver; + + RPointerArray iAvailabilityMonitors; + + RArray iAvailabilityStatus; + }; + +#endif // MUSMANAGERSERVERCORE_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagersrv/inc/musmanagerservercoreobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagersrv/inc/musmanagerservercoreobserver.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,40 @@ +/* +* 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: ?Description +* +*/ + + +#ifndef MUSMANAGERSERVERCOREOBSERVER_H +#define MUSMANAGERSERVERCOREOBSERVER_H + +#include + +/** + * This abstract class contains the very essential stopping functions + * of MusManagerServer + * + * @since S60 v3.2 + */ +class MMusManagerServerCoreObserver + { +public: // server stopper function + + virtual void StopServer() = 0; + + virtual TUint SessionCount() = 0; + + }; + +#endif // MUSMANAGERSERVERCOREOBSERVER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagersrv/inc/musmanagerserveritcutility.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagersrv/inc/musmanagerserveritcutility.h Thu Jul 22 16:32:26 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: ?Description +* +*/ + + +#ifndef MUSMANAGERSERVERITCUTILITY_H +#define MUSMANAGERSERVERITCUTILITY_H + +#include + +#include "musmanagercommon.h" +#include "musmanageripccommon.h" +#include "musmanagerserversessionobserver.h" + +class RMessage2; +class TRequestStatus; + +/** + * This static class contains the very essential starting functions + * of MusManagerServer + * + * @since S60 v3.2 + */ +class MusManagerServerItcUtility + { +public: // new functions + + static void WriteAvailabilityL( + const RMessage2& aMessage, + TInt aAvailability ); + + static void WriteAvailabilityReportL( + const RMessage2& aMessage, + TInt aAvailability ); + + static TUid ReadChannelIdL( const RMessage2& aMessage ); + + static TInt ReadUseCaseL( const RMessage2& aMessage ); + + static TInt ReadCommandL( const RMessage2& aMessage ); + + static TRequestStatus ReadRequestStatusL( const RMessage2& aMessage ); + +private: + + static void WriteL ( + TMusManagerIpcArguments aIndex, + const RMessage2& aMessage, + const TDesC8& aDes ); + }; + +#endif // MUSMANAGERSERVERITCUTILITY_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagersrv/inc/musmanagerservermain.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagersrv/inc/musmanagerservermain.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,48 @@ +/* +* 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: ?Description +* +*/ + + +#ifndef MUSMANAGERSERVERMAIN_H +#define MUSMANAGERSERVERMAIN_H + + +#include + +#include "musmanagerserverpanics.h" + +/** + * This static class contains the very essential starting functions + * of MusManagerServer + * + * @since S60 v3.2 + */ +class MusManagerServerMain + { +public : + + static TInt ThreadFunction (TAny* aNone); + +private: + + MusManagerServerMain (); + + static void PanicServer (TMusManagerServerPanic aReason); + static void ThreadFunctionL (RSemaphore& aSemaphore); + }; + + +#endif // ? MUSMANAGERSERVERMAIN_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagersrv/inc/musmanagerserverpanics.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagersrv/inc/musmanagerserverpanics.h Thu Jul 22 16:32:26 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: ?Description +* +*/ + + + +#ifndef MUSMANAGERSERVERPANICS_H +#define MUSMANAGERSERVERPANICS_H + +#include + +// Panic Category +// +_LIT(KMusManagerServer, "MusManagerServer"); + + +// MusManagerServer panic codes +// +enum TMusManagerServerPanic + { + EBadRequest, + EBadDescriptor, + ESrvCreateServer, + ECreateTrapCleanup, + EBadSipSessionHandle, + EBadSipSubSessionHandle, + EDatFileCorrupted + }; + +#endif // ? MUSMANAGERSERVERPANICS_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagersrv/inc/musmanagerserverplatsecpolicy.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagersrv/inc/musmanagerserverplatsecpolicy.h Thu Jul 22 16:32:26 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: ?Description +* +*/ + + +#ifndef MUSMANAGERSERVERPLATSECPOLICY_H +#define MUSMANAGERSERVERPLATSECPOLICY_H + +/** + * Number of different IPC ranges + */ +const TUint KMusManagerServerPlatSecRangeCount = 4; + +/** + * IPC ranges segmented into groups based on their capability requirements + */ +const TInt KMusManagerServerPlatSecRanges[KMusManagerServerPlatSecRangeCount] = + { + 0, // IPC message 0 - 3 + 4, // IPC message 4 - 6 + 7, // IPC message 7 - 9 + 10 // Not Supported 10 -> + }; + +/** + * IPC segments and their capability requirements + */ +const TUint8 KMusManagerServerPlatSecElementsIndex[KMusManagerServerPlatSecRangeCount] = + { + CPolicyServer::EAlwaysPass, // Security policy for ITC 0-3 + 0, // Security policy for IPC 0-2 (WriteDeviceData) + 1, // Security policy for IPC 3-9 (ReadDeviceData) + CPolicyServer::ENotSupported // Not Supported 10 -> + }; + +/** + * Availability sets and the action performed in case of failure + */ +const CPolicyServer::TPolicyElement KMusManagerServerPlatSecElements[2] = + { + // Requires the user to have WriteDeviceData capability, otherwise the message is + // completed with KErrPermissionDenied + { _INIT_SECURITY_POLICY_C1(ECapabilityWriteDeviceData), CPolicyServer::EFailClient }, + + // Requires the user to have ReadDeviceData capability, otherwise the message is + // completed with KErrPermissionDenied + { _INIT_SECURITY_POLICY_C1(ECapabilityReadDeviceData), CPolicyServer::EFailClient }, + + }; + +/** + * Platform security policy that SIP Server uses. + */ +const CPolicyServer::TPolicy KMusManagerServerPlatSecPolicy = + { + CPolicyServer::EAlwaysPass, // Specifies all connect attempts should pass + KMusManagerServerPlatSecRangeCount, // Number of IPC ranges + KMusManagerServerPlatSecRanges, // IPC Ranges + KMusManagerServerPlatSecElementsIndex, // Policy to ITC mapping array + KMusManagerServerPlatSecElements // Policies used in MusManagerServer + }; + +#endif // ? MUSMANAGERSERVERPLATSECPOLICY_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagersrv/inc/musmanagerserversession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagersrv/inc/musmanagerserversession.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,94 @@ +/* +* 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: ?Description +* +*/ + + +#ifndef MUSMANAGERSERVERSESSION_H +#define MUSMANAGERSERVERSESSION_H + +#include "musmanager.h" +#include "musmonitoravailabilityobserver.h" +#include "musavailabilitypluginmanagerobserver.h" + +class CMusManagerServer; +class MMusManagerServerSessionObserver; +class TRequestStatus; + +/** + * This class contains + * + * @since S60 v3.2 + */ +class CMusManagerServerSession : public CSession2, + MMusMonitorAvailabilityObserver + + { +public: // Constructors and destructor + + static CMusManagerServerSession* NewL( + CMusManagerServer& aServer, + MMusManagerServerSessionObserver& aObserver ); + + static CMusManagerServerSession* NewLC( + CMusManagerServer& aServer, + MMusManagerServerSessionObserver& aObserver ); + + ~CMusManagerServerSession (); + +private: + + TInt MonitorAvailabilityL(); +public: // From CSession2 + + void ServiceL( const RMessage2& aMessage ); + +public: // from MMusMonitorAvailabilityObserver + + virtual void AvailabilityChangedL( + MultimediaSharing::TMusAvailabilityStatus aAvailability ); + + virtual void RequestComplete(); + +private: // Second phase constructors + + CMusManagerServerSession( + CMusManagerServer& aServer, + MMusManagerServerSessionObserver& aObserver ); + + void ConstructL(); + +public: // Helper functions + + + +private: // Data + + CMusManagerServer& iServer; + + MMusManagerServerSessionObserver& iServerCore; + + RMessage2 iMessage; + + RArray iAvailabilityStatus; + + MultimediaSharing::TMusAvailabilityStatus iLastReport; + + TInt iSessionCounter; + +private: // For testing purposes + }; + +#endif // ? MUSMANAGERSERVERSESSION_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagersrv/inc/musmanagerserversessionobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagersrv/inc/musmanagerserversessionobserver.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,60 @@ +/* +* 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: ?Description +* +*/ + + +#ifndef MUSMANAGERSERVERSESSIONOBSERVER_H +#define MUSMANAGERSERVERSESSIONOBSERVER_H + +#include + +#include "musmanagercommon.h" + +class MMusMonitorAvailabilityObserver; + +/** + * This abstract class contains the essential functions + * executable by manager clients + * + * @since S60 v3.2 + */ +class MMusManagerServerSessionObserver + { +public: // new functions + + virtual MultimediaSharing::TMusAvailabilityStatus AvailabilityQueryL() = 0; + + virtual void CancelMonitoring( MMusMonitorAvailabilityObserver* aObserver) = 0; + + virtual void CommandL( MultimediaSharing::TCommandType aCommandType ) = 0; + + virtual void InvestigateAvailabilityL() = 0; + + virtual void InvitationReceivedL( TUid aChannelId ) = 0; + + virtual void OptionsReceivedL( TUid aChannelId ) = 0; + + virtual void RegisterObserverL( MMusMonitorAvailabilityObserver* aObserver ) = 0; + + virtual void RemoveObserver( MMusMonitorAvailabilityObserver* aObserver ) = 0; + + virtual void StartMultimediaSharingL( MultimediaSharing::TMusUseCase aUseCase ) = 0; + + virtual void StopMultimediaSharingL() = 0; + + }; + +#endif // MUSMANAGERSERVERSESSIONOBSERVER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagersrv/inc/musmonitoravailabilityobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagersrv/inc/musmonitoravailabilityobserver.h Thu Jul 22 16:32:26 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: ?Description +* +*/ + + +#ifndef MUSMONITORAVAILABILITYOBSERVER_H +#define MUSMONITORAVAILABILITYOBSERVER_H + +#include "musmanagercommon.h" + +#include + +class TRequestStatus; + +/** + * ?one_line_short_description + * + * ?more_complete_description + * + * @lib ?library + * @since S60 v3.2 + */ +class MMusMonitorAvailabilityObserver + { +public: + virtual void AvailabilityChangedL( + MultimediaSharing::TMusAvailabilityStatus aAvailability ) = 0; + + virtual void RequestComplete() = 0; + + }; + + +#endif // ? MUSMONITORAVAILABILITYOBSERVER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagersrv/src/musapplicationmanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagersrv/src/musapplicationmanager.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,488 @@ +/* +* 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: ?Description +* +*/ + + +#include "musunittesting.h" +#include "muslogger.h" +#include "musapplicationmanager.h" +#include "musmanagercommon.h" +#include "musmanagerservercommon.h" +#include "mussessionproperties.h" +#include "musuid.hrh" +#include "mussettings.h" +/* PS keys related to NMusSessionInformationApi defined here */ +#include "mussesseioninformationapi.h" +#include "muscleanupresetanddestroy.h" +#include "lcengine.h" + +#include +#include +#include +#include +#include +#include + + +// CONSTANTS +_LIT8( KDefaultEngineName, "MultimediaSharing" ); +_LIT( KMusUiProcessName, "musui.exe" ); + +// ----------------------------------------------------------------------------- +// CMusApplicationManager::NewL +// ----------------------------------------------------------------------------- +// +CMusApplicationManager* CMusApplicationManager::NewL() + { + MUS_LOG( "mus: [MUSSRV] -> CMusApplicationManager* \ + CMusApplicationManager::NewL()" ); + + CMusApplicationManager* self = CMusApplicationManager::NewLC(); + CleanupStack::Pop( self ); + + MUS_LOG( "mus: [MUSSRV] <- CMusApplicationManager* \ + CMusApplicationManager::NewL()" ); + return self; + } + + +// ----------------------------------------------------------------------------- +// CMusApplicationManager::NewLC +// ----------------------------------------------------------------------------- +// +CMusApplicationManager* CMusApplicationManager::NewLC() + { + MUS_LOG( "mus: [MUSSRV] -> CMusApplicationManager* \ + CMusApplicationManager::NewLC()" ); + + CMusApplicationManager* self = new( ELeave ) CMusApplicationManager(); + CleanupStack::PushL( self ); + self->ConstructL(); + + MUS_LOG( "mus: [MUSSRV] <- CMusApplicationManager* \ + CMusApplicationManager::NewLC()" ); + return self; + } + + +// ----------------------------------------------------------------------------- +// CMusApplicationManager::~CMusApplicationManager +// ----------------------------------------------------------------------------- +// +CMusApplicationManager::~CMusApplicationManager() + { + MUS_LOG( "mus: [MUSSRV] -> \ + CMusApplicationManager::~CMusApplicationManager()" ); + + MUS_LOG( "mus: [MUSSRV] <- \ + CMusApplicationManager::~CMusApplicationManager()" ); + } + + +// ----------------------------------------------------------------------------- +// CMusApplicationManager::ConstructL +// ----------------------------------------------------------------------------- +// +void CMusApplicationManager::ConstructL() + { + MUS_LOG( "mus: [MUSSRV] -> CMusApplicationManager::ConstructL()" ); + + SetPropertyL( NMusSessionApi::KFastMode, MusSettingsKeys::EFastModeOff ); + + MUS_LOG( "mus: [MUSSRV] <- CMusApplicationManager::ConstructL()" ); + } + + +// ----------------------------------------------------------------------------- +// CMusApplicationManager::CMusApplicationManager +// ----------------------------------------------------------------------------- +// +CMusApplicationManager::CMusApplicationManager() + { + } + + +// ----------------------------------------------------------------------------- +// CMusApplicationManager::ApplicationRunning +// ----------------------------------------------------------------------------- +// +TBool CMusApplicationManager::ApplicationRunning() + { + MUS_LOG( "mus: [MUSSRV] <> CMusApplicationManager::ApplicationRunning()" ); + + TFindProcess findProcess( KMusUiProcessName ); + TFullName name; + return ( findProcess.Next( name ) == KErrNone ); + } + + +// ----------------------------------------------------------------------------- +// CMusApplicationManager::ApplicationRunning +// ----------------------------------------------------------------------------- +// +void CMusApplicationManager::StartApplicationL() + { + MUS_LOG( "mus: [MUSSRV] -> CMusApplicationManager::StartApplicationL()" ); + + if( ApplicationRunning() ) + { + ShowApplicationL(); + } + else + { + MUS_LOG( "mus: [MUSSRV] Starting app" ); + + RProcess process; + CleanupClosePushL( process ); + HBufC* args = CreateCommandLineArgsLC(); + User::LeaveIfError( process.Create( KMusUiProcessName, *args ) ); + process.Resume(); + CleanupStack::PopAndDestroy( args ); + CleanupStack::PopAndDestroy( &process ); + } + + MUS_LOG( "mus: [MUSSRV] <- CMusApplicationManager::StartApplicationL()" ); + } + + +// ----------------------------------------------------------------------------- +// CMusApplicationManager::ApplicationRunning +// ----------------------------------------------------------------------------- +// +void CMusApplicationManager::StopApplicationL() + { + MUS_LOG( "mus: [MUSSRV] -> CMusApplicationManager::StopApplicationL()" ); + + if( ApplicationRunning() ) + { + SetPropertyL( NMusSessionApi::KStatus, + MultimediaSharing::EMultimediaSharingNotAvailable ); + } + + MUS_LOG( "mus: [MUSSRV] <- CMusApplicationManager::StopApplicationL()" ); + } + + +// ----------------------------------------------------------------------------- +// CMusApplicationManager::ShowApplication +// ----------------------------------------------------------------------------- +// +void CMusApplicationManager::ShowApplicationL() + { + MUS_LOG( "mus: [MUSSRV] -> CMusApplicationManager::ShowApplicationL()" ); + + // TODO: How to bring a QT application to foreground? + + MUS_LOG( "mus: [MUSSRV] <- CMusApplicationManager::ShowApplicationL()" ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusApplicationManager::WriteSessionPropertiesL( + MultimediaSharing::TMusUseCase aUseCase, + MultimediaSharing::TMusAvailabilityStatus aStatus, + MDesCArray& aSessionParameters ) + { + MUS_LOG2( "mus: [MUSSRV] -> \ + CMusApplicationManager::WriteSessionPropertiesL( %d, %d )", + ( TInt ) aUseCase, ( TInt ) aStatus ); + TRAPD( error, + if ( aUseCase == MultimediaSharing::EMusLiveVideo && + MultimediaSharingSettings::VideoDirectionL() == + MusSettingsKeys::ETwoWayVideo ) + { + MUS_LOG( "mus: [MUSSRV] UseCase MultimediaSharing::EMusTwoWayVideo" ); + aUseCase = MultimediaSharing::EMusTwoWayVideo; + } + ) + if ( error == KErrNoMemory ) + { + User::Leave( error ); + } + // set use case property + SetPropertyL( NMusSessionApi::KUseCase, ( TInt ) aUseCase ); + + WriteSessionPropertiesL( aStatus, aSessionParameters ); + + + MUS_LOG( "mus: [MUSSRV] <- \ + CMusApplicationManager::WriteSessionPropertiesL()" ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusApplicationManager::WriteSessionPropertiesL( + MultimediaSharing::TMusAvailabilityStatus aStatus, + MDesCArray& aSessionParameters ) + { + MUS_LOG1( "mus: [MUSSRV] -> \ + CMusApplicationManager::WriteSessionPropertiesL( %d )", + ( TInt ) aStatus ); + + // set tel number property + SetPropertyL( NMusSessionApi::KTelNumber, + aSessionParameters.MdcaPoint( KTelNumber ) ); + + // set sip address property + SetPropertyL( NMusSessionApi::KRemoteSipAddress, + aSessionParameters.MdcaPoint( KSipAddress ) ); + + // set sip address proposal property + SetPropertyL( NMusSessionApi::KRemoteSipAddressProposal, + aSessionParameters.MdcaPoint( KSipAddressProposal ) ); + + // set video codec property + SetPropertyL( NMusSessionApi::KVideoCodecs, + aSessionParameters.MdcaPoint( KVideoCodec ) ); + + // set contact id property + TLex lex( aSessionParameters.MdcaPoint( KContactId ) ); + TInt val; + lex.Val( val ); + + SetPropertyL( NMusSessionApi::KContactId, val ); + + // set contact id property + lex.Assign( aSessionParameters.MdcaPoint( KSipProfileId ) ); + lex.Val( val ); + + SetPropertyL( NMusSessionApi::KSipProfileId, val ); + + // contact name + SetPropertyL( NMusSessionApi::KContactName, + aSessionParameters.MdcaPoint( KContactName ) ); + + // fast mode + TInt fastMode; + User::LeaveIfError( RProperty::Get( NMusSessionApi::KCategoryUid, + NMusSessionApi::KFastMode, + fastMode ) ); + if ( fastMode != MusSettingsKeys::EFastModeDisabled ) + { + lex.Assign( aSessionParameters.MdcaPoint( KFastMode ) ); + lex.Val( val ); + SetPropertyL( NMusSessionApi::KFastMode, val ); + } + else + { + MUS_LOG( "mus: [MUSSRV] fast mode disabled, do not update it" ); + } + + // set status property + SetStatusL( aStatus ); + + MUS_LOG( "mus: [MUSSRV] <- \ + CMusApplicationManager::WriteSessionPropertiesL()" ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusApplicationManager::SetStatusL( + MultimediaSharing::TMusAvailabilityStatus aStatus ) + { + MUS_LOG1( "mus: [MUSSRV] -> CMusApplicationManager::SetStatusL( %d )", + ( TInt ) aStatus ); + SetPropertyL( NMusSessionApi::KStatus, ( TInt ) aStatus ); + MUS_LOG( "mus: [MUSSRV] <- CMusApplicationManager::SetStatusL()" ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusApplicationManager::SetIndicatorStatusL( TBool aLaunch ) + { + TInt launch = aLaunch; + MUS_LOG1( "mus: [MUSSRV] -> CMusApplicationManager::SetStatusL( %d )", + launch ); + + TInt indicatorStatus; + TInt ret = RProperty::Get( NMusSessionApi::KCategoryUid, + NMusSessionApi::KMusIndicatorStatus, + indicatorStatus ); + + if ( ret != KErrNone && ret != KErrNotFound ) + { + User::Leave( ret ); + } + + // set property only if not defined yet or if value changed + if ( ret == KErrNotFound || indicatorStatus != launch ) + { + SetPropertyL( NMusSessionApi::KMusIndicatorStatus, launch ); + } + + MUS_LOG( "mus: [MUSSRV] <- CMusApplicationManager::SetStatusL()" ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusApplicationManager::SetPropertyL( TUint aProperty, + const TDesC& aValue ) + { + MUS_LOG1( "mus: [MUSSRV] -> CMusApplicationManager::SetPropertyL( %d )", + aProperty ); + MUS_LOG_TDESC( "mus: [MUSSRV] New property value: ", aValue ); + + // set tel number property + TInt retval = RProperty::Define( NMusSessionApi::KCategoryUid, + aProperty, + RProperty::EText ); + + if( retval != KErrAlreadyExists && retval != KErrNone ) + { + User::Leave( retval ); + } + User::LeaveIfError( RProperty::Set( NMusSessionApi::KCategoryUid, + aProperty, + aValue ) ); + + MUS_LOG( "mus: [MUSSRV] <- CMusApplicationManager::SetPropertyL()" ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusApplicationManager::SetPropertyL( TUint aProperty, TInt aValue ) + { + MUS_LOG2( "mus: [MUSSRV] -> CMusApplicationManager::SetPropertyL( %d, %d )", + ( TInt ) aProperty, aValue ); + + // set tel number property + TInt retval = RProperty::Define( NMusSessionApi::KCategoryUid, + aProperty, + RProperty::EInt ); + + if( retval != KErrAlreadyExists && retval != KErrNone ) + { + User::Leave( retval ); + } + User::LeaveIfError( RProperty::Set( NMusSessionApi::KCategoryUid, + aProperty, + aValue ) ); + + MUS_LOG( "mus: [MUSSRV] <- CMusApplicationManager::SetPropertyL()" ); + } + +// ----------------------------------------------------------------------------- +// Reads the callprovider description from the PS key +// return aProvider will have the proper callprovider name. +// ----------------------------------------------------------------------------- +// +void CMusApplicationManager::CallProviderL(TDes8& aProvider) + { + MUS_LOG( "mus: [MUSSRV] -> CMusApplicationManager::CallProviderL"); + const TInt KMusMgrMaxPluginNameLen = 256; + TBuf pluginName; + + User::LeaveIfError(RProperty::Get( + NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMUSCallProvider, + pluginName )); + User::LeaveIfError( + CnvUtfConverter::ConvertFromUnicodeToUtf8( aProvider, pluginName )); + + MUS_LOG( "mus: [MUSSRV] <- CMusApplicationManager::CallProviderL"); + } + +// ----------------------------------------------------------------------------- +// Resolves name of the ecom plugin which implements the livecomms engine api +// by using the callprovider +// ----------------------------------------------------------------------------- +// +void CMusApplicationManager::ResolvePluginNameL(TDes8& aPluginName) + { + MUS_LOG( "mus: [MUSSRV] -> CMusApplicationManager::ResolvePluginNameL"); + + TBuf8 providerName ; + + // Read the call provider name + CallProviderL( providerName ); + + RImplInfoPtrArray pluginArray; + MusCleanupResetAndDestroy::PushL( pluginArray ); + + TEComResolverParams resolverParams; + + resolverParams.SetDataType ( providerName ); + resolverParams.SetWildcardMatch (ETrue); + + // Use default plugin even if listing fails + TRAPD( err, + REComSession::ListImplementationsL(KLcEngineInterfaceUid, resolverParams, pluginArray) ); + MUS_LOG1( "mus: [MUSSRV] List implementations compl:%d", err ); + if ( err == KErrNoMemory ) + { + User::Leave( err ); + } + + if( pluginArray.Count() > 0 ) + { + CImplementationInformation* info = pluginArray[ 0 ]; + __ASSERT_ALWAYS( aPluginName.MaxLength() >= info->DataType().Length(), + User::Leave( KErrArgument ) ); + aPluginName.Copy( info->DataType() ); + } + else + { + __ASSERT_ALWAYS( aPluginName.MaxLength() >= KDefaultEngineName().Length(), + User::Leave( KErrArgument ) ); + aPluginName.Copy( KDefaultEngineName() ); + } + CleanupStack::PopAndDestroy();//pluginArray + MUS_LOG( "mus: [MUSSRV] <- CMusApplicationManager::ResolvePluginNameL"); + } + +// ----------------------------------------------------------------------------- +// Creates command line used when starting application. +// ----------------------------------------------------------------------------- +// +HBufC* CMusApplicationManager::CreateCommandLineArgsLC() + { + MUS_LOG( "mus: [MUSSRV] -> CMusApplicationManager::CreateCommandLineLC"); + + TBuf8 pluginNameUtf8; + ResolvePluginNameL( pluginNameUtf8 ); + + MUS_LOG_TDESC8( "mus: [MUSSRV] Plugin name:", pluginNameUtf8 ); + + HBufC* commandLineArgs = HBufC::NewLC( KMusMgrMaxPluginNameLen ); + TPtr commandLineArgsPtr( commandLineArgs->Des() ); + User::LeaveIfError( + CnvUtfConverter::ConvertToUnicodeFromUtf8( + commandLineArgsPtr, pluginNameUtf8 ) ); + + MUS_LOG_TDESC( "mus: [MUSSRV] <- command line args:", commandLineArgsPtr ); + + return commandLineArgs; + } + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagersrv/src/musavailabilitypluginmanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagersrv/src/musavailabilitypluginmanager.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,813 @@ +/* +* Copyright (c) 2006-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: ?Description +* +*/ + + +#include "musavailabilitypluginmanager.h" +#include "musavasettings.h" +#include "musunittesting.h" +#include "musavainterface.h" +#include "muslogger.h" +#include "musavailabilitypluginmanagerobserver.h" +#include "musmanagerservercommon.h" +#include "musindicatorapi.h" +#include "musapplicationmanager.h" + +#include +#include +#include + + +// CONSTANTS + +// Max number of digits in unsigned 32 bit integer (TInt32) +const TUint KMaxInt32Length = 16; + + +using namespace MultimediaSharing; + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusAvailabilityPluginManager* CMusAvailabilityPluginManager::NewL( + MMusAvailabilityPluginManagerObserver& aObserver, + CMusApplicationManager& aApplicationManager ) + { + MUS_LOG( "mus: [MUSSRV] -> CMusAvailabilityPluginManager::NewL()" ) + + CMusAvailabilityPluginManager* self = + CMusAvailabilityPluginManager::NewLC( aObserver, + aApplicationManager ); + + CleanupStack::Pop( self ); + MUS_LOG( "mus: [MUSSRV] <- CMusAvailabilityPluginManager::NewL()" ) + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusAvailabilityPluginManager* CMusAvailabilityPluginManager::NewLC( + MMusAvailabilityPluginManagerObserver& aObserver, + CMusApplicationManager& aApplicationManager ) + { + MUS_LOG( "mus: [MUSSRV] -> CMusAvailabilityPluginManager::NewLC()" ) + + CMusAvailabilityPluginManager* self = + new( ELeave ) CMusAvailabilityPluginManager( aObserver, + aApplicationManager ); + + CleanupStack::PushL( self ); + self->ConstructL(); + MUS_LOG( "mus: [MUSSRV] <- CMusAvailabilityPluginManager::NewLC()" ) + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusAvailabilityPluginManager::~CMusAvailabilityPluginManager() + { + MUS_LOG( "mus: [MUSSRV] -> CMusAvailabilityPluginManager::\ + ~CMusAvailabilityPluginManager()" ) + delete iPlugin; + delete iSessionParameters; + delete iIndicator; + iIndicator = NULL; + MUS_LOG( "mus: [MUSSRV] <- CMusAvailabilityPluginManager::\ + ~CMusAvailabilityPluginManager()" ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusAvailabilityPluginManager::ConstructL() + { + MUS_LOG( "mus: [MUSSRV] -> CMusAvailabilityPluginManager::ConstructL()" ) + iSessionParameters = new( ELeave ) CDesCArrayFlat( KParameterCount ); + iPlugin = CMusAvaInterface::NewL(); + iPlugin->SetObserver( *this ); + iPlugin->SetSettingsObserver( *this ); + MUS_LOG( "mus: [MUSSRV] <- CMusAvailabilityPluginManager::ConstructL()" ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusAvailabilityPluginManager::CMusAvailabilityPluginManager( + MMusAvailabilityPluginManagerObserver& aObserver, + CMusApplicationManager& aApplicationManager ) + : iObserver( aObserver ), + iApplicationManager( aApplicationManager ) + { + iPluginStarted = EFalse; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMusAvailabilityPluginManager::ApplicationAllowed() + { + MUS_LOG( "mus: [MUSSRV] -> CMusAvailabilityPluginManager::\ + ApplicationAllowed()" ) + MUS_LOG( "mus: [MUSSRV] <- CMusAvailabilityPluginManager::\ + ApplicationAllowed()" ) + return ( iPlugin->MandatoryAvailability() + || iPlugin->AvailabilityState( EMusAvaNameRegistration ) == + EMusAvaStatusInProgress + || iPlugin->AvailabilityState( EMusAvaNameRegistration ) == + EMusAvaStatusAvailable ); + } +// ----------------------------------------------------------------------------- +// If minumum availability is available returning mandaroty level status +// and if mandatory level status is available returning extension level status +// ----------------------------------------------------------------------------- +// +TMusAvailabilityStatus CMusAvailabilityPluginManager::Availability() + { + MUS_LOG( "mus: [MUSSRV] -> CMusAvailabilityPluginManager::\ + Availability()" ) + MUS_LOG( "mus: [MUSSRV] <- CMusAvailabilityPluginManager::\ + Availability()" ) + return MapAvailabilities( iPlugin->AvailabilityStatus() ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusAvailabilityPluginManager::InvestigateAvailabilityL() + { + MUS_LOG( "mus: [MUSSRV] -> CMusAvailabilityPluginManager::\ + InvestigateAvailabilityL()" ) + if( !iPluginStarted ) + { + iPlugin->StartL(); + iPluginStarted = ETrue; + } + + + MUS_LOG( "mus: [MUSSRV] <- CMusAvailabilityPluginManager::\ + InvestigateAvailabilityL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusAvailabilityPluginManager::PrepareForReceivedInviteL() + { + MUS_LOG( "mus: [MUSSRV] -> CMusAvailabilityPluginManager::\ + PrepareForReceivedInviteL()" ) + + iPlugin->PrepareForReceivedInviteL(); + + MUS_LOG( "mus: [MUSSRV] <- CMusAvailabilityPluginManager::\ + PrepareForReceivedInviteL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusAvailabilityPluginManager::InvitationReceivedL() + { + MUS_LOG( "mus: [MUSSRV] -> CMusAvailabilityPluginManager::\ + InvitationReceivedL()" ) + + if( !iPluginStarted ) + { + iPlugin->StartL(); + iPluginStarted = ETrue; + } + + MUS_LOG( "mus: [MUSSRV] <- CMusAvailabilityPluginManager::\ + InvitationReceivedL()" ) + } + +// ----------------------------------------------------------------------------- +// CMusAvailabilityPluginManager::OptionsReceived +// ----------------------------------------------------------------------------- +// +void CMusAvailabilityPluginManager::OptionsReceivedL() + { + MUS_LOG( "mus: [MUSSRV] -> CMusAvailabilityPluginManager::\ + OptionsReceivedL()" ) + + if( !iPluginStarted ) + { + iPlugin->StartL(); + iPluginStarted = ETrue; + } + + MUS_LOG( "mus: [MUSSRV] <- CMusAvailabilityPluginManager::\ + OptionsReceivedL()" ) + } + +// ----------------------------------------------------------------------------- +// CMusAvailabilityPluginManager::LoadPluginL +// ----------------------------------------------------------------------------- +// +void CMusAvailabilityPluginManager::LoadPluginL() + { + MUS_LOG( "mus: [MUSSRV] -> CMusAvailabilityPluginManager::\ + LoadPluginL()" ) + MUS_LOG( "mus: [MUSSRV] <- CMusAvailabilityPluginManager::\ + LoadPluginL()" ) + } + +// ----------------------------------------------------------------------------- +// CMusAvailabilityPluginManager::UnloadPluginL +// ----------------------------------------------------------------------------- +// +void CMusAvailabilityPluginManager::StopPluginL() + { + MUS_LOG( "mus: [MUSSRV] -> CMusAvailabilityPluginManager::\ + StopPluginL()" ) + if( iPluginStarted ) + { + iPlugin->Stop(); + iPluginStarted = EFalse; + } + MUS_LOG( "mus: [MUSSRV] <- CMusAvailabilityPluginManager::\ + StopPluginL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +MDesCArray& CMusAvailabilityPluginManager::SessionParametersL() + { + MUS_LOG( "mus: [MUSSRV] -> CMusAvailabilityPluginManager::\ + SessionParametersL()" ) + // update the values + UpdateSessionParametersL(); + + // then pass them + MUS_LOG( "mus: [MUSSRV] <- CMusAvailabilityPluginManager::\ + SessionParametersL()" ) + return *iSessionParameters; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusAvailabilityPluginManager::ManualQueryL() + { + + MUS_LOG( "mus: [MUSSRV] -> CMusAvailabilityPluginManager::\ + ManualQueryL()" ) + MMusAvaSettings& settings = iPlugin->Settings(); + + MUS_LOG( "mus: [MUSSRV] Status available" ) + if( !iIndicator ) + { + MUS_LOG( "mus: [MUSSRV] Create indicator" ) + iIndicator = CMusIndicatorApi::NewL( *this ); + if( iIndicator->ConfirmationQueryL( CMusIndicatorApi::EVsRoamingActivationQuery ) ) + { + settings.SetManualActivation( MMusAvaSettings::EActivationAllowed ); + iPlugin->StartL(); + } + else + { + settings.SetManualActivation( MMusAvaSettings::EActivationNotAllowed ); + } + delete iIndicator; + iIndicator = NULL; + } + else + { + if( iIndicator->ConfirmationQueryL( CMusIndicatorApi::EVsRoamingActivationQuery ) ) + { + settings.SetManualActivation( MMusAvaSettings::EActivationAllowed ); + iPlugin->StartL(); + } + else + { + settings.SetManualActivation( MMusAvaSettings::EActivationNotAllowed ); + } + } + MUS_LOG( "mus: [MUSSRV] <- CMusAvailabilityPluginManager::\ + ManualQueryL()" ) + } + +TBool CMusAvailabilityPluginManager::PossibleToLaunch() + { + return iPlugin->ExtensionAvailability() && + iPlugin->AvailabilityStatus() == + MMusAvaObserver::EMusAvaStatusAvailable; + } +void CMusAvailabilityPluginManager::AvailabilityChanged( + TAvailabilityName /*aName*/, + TAvailabilityStatus aStatus ) + { + MUS_LOG( "mus: [MUSSRV] -> CMusAvailabilityPluginManager::\ + AvailabilityChanged()" ) + TRAPD( err , iObserver.AvailabilityChangedL( MapAvailabilities( aStatus ) ) ); + if ( err ) + { + // Not sure about what to do. Very rare situation. + MUS_LOG1( "mus: [MUSSRV] AvailabilityChangedL() leave code: %d",err ) + } + // Do some indicator things... + TRAP( err, IndicateAvailabilityL() ); + if ( err ) + { + // Not sure about what to do. Very rare situation. + MUS_LOG1( "mus: [MUSSRV] IndicateAvailabilityL() leave code: %d",err ) + } + + MUS_LOG( "mus: [MUSSRV] <- CMusAvailabilityPluginManager::\ + AvailabilityChanged()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusAvailabilityPluginManager::AvailabilityError( + TAvailabilityName /*aName*/, + TAvailabilityStatus aStatus ) + { + MUS_LOG( "mus: [MUSSRV] -> CMusAvailabilityPluginManager::\ + AvailabilityError()" ) + TRAPD( err , iObserver.AvailabilityChangedL( MapAvailabilities( aStatus ) ) ); + if ( err ) + { + // Not sure about what to do. Very rare situation. + MUS_LOG1( "mus: [MUSSRV] AvailabilityChangedL() leave code: %d",err ) + } + + // Do some indicator things... + TRAP( err, IndicateAvailabilityL() ); + if ( err ) + { + MUS_LOG1( "mus: [MUSSRV] IndicateAvailabilityL() leave code: %d",err ) + } + + MUS_LOG( "mus: [MUSSRV] <- CMusAvailabilityPluginManager::\ + AvailabilityError()" ) + } + +// ----------------------------------------------------------------------------- +// From MMusAvaSettingsObserver +// ----------------------------------------------------------------------------- +// +MMusAvaSettingsObserver::TApplicationState CMusAvailabilityPluginManager:: + ApplicationState() + { + MUS_LOG( "mus: [MUSSRV] -> CMusAvailabilityPluginManager::\ + ApplicationState()" ) + MMusAvaSettingsObserver::TApplicationState ret = EApplicationStateNotDefined; + if ( iApplicationManager.ApplicationRunning() ) + { + ret = EApplicationIsRunning; + } + else + { + ret = EApplicationNotRunning; + } + + MUS_LOG( "mus: [MUSSRV] <- CMusAvailabilityPluginManager::\ + ApplicationState()" ) + return ret; + } + +// ----------------------------------------------------------------------------- +// From MMusAvaSettingsObserver +// ----------------------------------------------------------------------------- +// +TBool CMusAvailabilityPluginManager::OptionAllowed() + { + MUS_LOG( "mus: [MUSSRV] -> CMusAvailabilityPluginManager::\ + OptionAllowed()" ) + MUS_LOG( "mus: [MUSSRV] <- CMusAvailabilityPluginManager::\ + OptionAllowed()" ) + // TBD: Check it out + return iPlugin->AvailabilityState( MMusAvaObserver::EMusAvaOptionHandler ) + >= EMusAvaStatusNotExecuted; + } + +// ----------------------------------------------------------------------------- +// From MMusAvaSettingsObserver +// ----------------------------------------------------------------------------- +// +void CMusAvailabilityPluginManager::StartApplicationL( + MultimediaSharing::TMusUseCase aUseCase ) + { + iObserver.StartSharingWithUseCaseL( aUseCase ); + } + +// ----------------------------------------------------------------------------- +// From MMusIndicatorObserver. +// Starts live video sharing. +// ----------------------------------------------------------------------------- +// +void CMusAvailabilityPluginManager::StartLiveSharingL() + { + iObserver.StartSharingWithUseCaseL( MultimediaSharing::EMusLiveVideo ); + } + +// ----------------------------------------------------------------------------- +// This functions cross-links TAvailabilityStatus and +// MultimediaSharing::TMusAvailabilityStatus +// ----------------------------------------------------------------------------- +// +MultimediaSharing::TMusAvailabilityStatus + CMusAvailabilityPluginManager::MapAvailabilities( + TAvailabilityStatus aStatus ) + { + MultimediaSharing::TMusAvailabilityStatus status; + switch( aStatus ) + { + case EMusAvaStatusNotExecuted: + { + MUS_LOG( "mus: [MUSSRV] that is \ + EMultimediaSharingNotAvailable" ) + status = EMultimediaSharingNotAvailable; + break; + } + case EMusAvaFailureCode: + { + MUS_LOG( "mus: [MUSSRV] that is \ + EMusAvaFailureCode" ) + status = EMultimediaFailureCode; + break; + } + case EMusAvaStatusInProgress: // EMusAvaStatusRegistering: + { + MUS_LOG( "mus: [MUSSRV] that is ESipRegistrationPending" ) + if ( iPlugin->CurrentAvailability() > EMusAvaNameRegistration ) + { + // SIP registration already performed, we're available + MUS_LOG( "mus: [MUSSRV] that is \ + EMultimediaSharingAvailable - a" ) + status = EMultimediaSharingAvailable; + } + else if ( + iPlugin->CurrentAvailability() == EMusAvaNameRegistration ) + { + // SIP register pending + MUS_LOG( "mus: [MUSSRV] that is \ + ESipRegistrationPending - a" ) + status = ESipRegistrationPending; + } + else + { + MUS_LOG( "mus: [MUSSRV] that is \ + EMultimediaSharingNotAvailable - a" ) + status = EMultimediaSharingNotAvailable; + } + break; + } + case EMusAvaStatusAvailable: + { + MUS_LOG( "mus: [MUSSRV] that is EMultimediaSharingAvailable" ) + status = EMultimediaSharingAvailable; + break; + } + case EMusAvaStatusNoSipProfile: + { + MUS_LOG( "mus: [MUSSRV] that is EErrNoSipProfile" ) + status = EErrNoSipProfile; + break; + } + case EMusAvaStatusNotRegistered: + { + MUS_LOG( "mus: [MUSSRV] that is EErrSipRegistration" ) + status = EErrSipRegistration; + break; + } + case EMusAvaStatusNoCall: + { + MUS_LOG( "mus: [MUSSRV] that is EErrNoActiveCall" ) + status = EErrNoActiveCall; + break; + } + case EMusAvaStatusCallOnHold: + { + MUS_LOG( "mus: [MUSSRV] that is EErrCallOnHold" ) + status = EErrCallOnHold; + break; + } + case EMusAvaOptionNotAvailable: + { + MUS_LOG( "mus: [MUSSRV] that is EErrOptionAvailable" ) + status = ESipOptionsNotCapable; + break; + } + case EMusAvaStatusConferenceCall: + { + MUS_LOG( "mus: [MUSSRV] that is EErrConferenceCall" ) + status = EErrConferenceCall; + break; + } + case EMusAvaStatusOptionsSent: + { + MUS_LOG( "mus: [MUSSRV] that is ESipOptionsCapable" ) + status = ESipOptionsSent; + break; + } + case EMusAvaStatusOptionsNotSent: + { + MUS_LOG( "mus: [MUSSRV] that is ESipOptionsNotSent" ) + status = ESipOptionsNotSent; + break; + } + case EMusAvaNetworkType: + { + MUS_LOG( "mus: [MUSSRV] that is EErrNetwork" ) + status = EErrNetwork; + break; + } + case EMusAvaRoamingError: + { + MUS_LOG( "mus: [MUSSRV] that is EErrRoaming" ) + status = EErrRoaming; + break; + } + case EMusAvaConnectionErr: + { + MUS_LOG( "mus: [MUSSRV] that is EErrConnection" ) + status = EErrConnection; + break; + } + case EMusActivationError: + { + MUS_LOG( "mus: [MUSSRV] that is EErrActivation" ) + status = EErrActivation; + break; + } + + case EMusAvaManualActivation: + { + MUS_LOG( "mus: [MUSSRV] that is Manual Activation" ) + status = EManualActivation; + break; + } + + case EMusAvaEdgeDtmStatusUnknown: + { + MUS_LOG( "mus: [MUSSRV] Edge/DTM support" ) + status = EErrNetwork; + break; + } + default: + MUS_LOG( "mus: [MUSSRV] that is unknown; returning \ + KErrUnknown" ) + status = ( TMusAvailabilityStatus ) KErrUnknown; + } + return status; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusAvailabilityPluginManager::UpdateSessionParametersL() + { + MUS_LOG( "mus: [MUSSRV] -> CMusAvailabilityPluginManager::\ + UpdateSessionParametersL()" ) + // clear the table + iSessionParameters->Delete( 0, iSessionParameters->Count() ); + + HBufC* telNumber = TelNumberLC(); + iSessionParameters->AppendL( *telNumber ); + CleanupStack::PopAndDestroy( telNumber ); + + HBufC* sipAddresses = SipAddressesLC(); + iSessionParameters->AppendL( *sipAddresses ); + CleanupStack::PopAndDestroy( sipAddresses ); + + MMusAvaSettings& settings = iPlugin->Settings(); + + // append sip address proposal + iSessionParameters->AppendL( settings.SipAddressProposal() ); + + TBuf contactIdBuf; + contactIdBuf.Num( settings.ContactId() ); + + // append contact id + iSessionParameters->AppendL( contactIdBuf ); + // append video codec + HBufC* videoCodecs = VideoCodecsLC(); + iSessionParameters->AppendL( *videoCodecs ); + CleanupStack::PopAndDestroy( videoCodecs ); + + TBuf sipProfileIdBuf; + sipProfileIdBuf.Num( settings.SipProfileId() ); + + MUS_LOG1("iSessionParameters -> SIP Profile ID = %d ", + settings.SipProfileId() ) + + // append sip profile id + iSessionParameters->AppendL( sipProfileIdBuf ); + + HBufC* contactName = ContactNameLC(); + iSessionParameters->AppendL( *contactName ); + CleanupStack::PopAndDestroy( contactName ); + + TBuf fastModeBuf; + fastModeBuf.Num( settings.FastMode() ); + MUS_LOG1("iSessionParameters -> fast mode = %d ", + settings.FastMode() ) + + // append fast mode + iSessionParameters->AppendL( fastModeBuf ); + + MUS_LOG( "mus: [MUSSRV] <- CMusAvailabilityPluginManager::\ + UpdateSessionParametersL()" ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +HBufC* CMusAvailabilityPluginManager::SipAddressesLC() + { + MUS_LOG( "mus: [MUSSRV] -> CMusAvailabilityPluginManager::\ + SipAddressesLC()" ) + HBufC* sipAddresses = NULL; + + // We have to keep up with KMaxPropertySize since it is advertised through + // RProperty to UI process. + TBuf tbuf; + _LIT( KComma, "," ); + + MMusAvaSettings& settings = iPlugin->Settings(); + const MDesCArray& addresses = settings.SipAddresses(); + MUS_LOG1( "mus: [MUSSRV] addresses.MdcaCount() %d", + addresses.MdcaCount() ) + + for( TInt i=0;i + addresses.MdcaPoint(i).Size()+KComma().Size()) + { + if( i > 0) tbuf.Append( KComma() ); + tbuf.Append( addresses.MdcaPoint( i ) ); + } + else + { + // if no space just break and do not continue further. + break; + } + } + sipAddresses = tbuf.AllocLC(); + + MUS_LOG_TDESC( "mus: [MUSSRV] SIP Address: ", (*sipAddresses) ); + MUS_LOG( "mus: [MUSSRV] <- CMusAvailabilityPluginManager::\ + SipAddressesLC()" ) + + return sipAddresses; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +HBufC* CMusAvailabilityPluginManager::VideoCodecsLC() + { + MUS_LOG( "mus: [MUSSRV] -> CMusAvailabilityPluginManager::\ + VideoCodecsLC()" ) + HBufC* videoCodecs = NULL; + + // We have to keep up with KMaxPropertySize since it is advertised through + // RProperty to UI process. + TBuf tbuf; + _LIT( KComma, "," ); + + MMusAvaSettings& settings = iPlugin->Settings(); + const MDesCArray& codecs = settings.VideoCodecs(); + MUS_LOG1( "mus: [MUSSRV] addresses.MdcaCount() %d", + codecs.MdcaCount() ) + + for( TInt i=0;i + codecs.MdcaPoint(i).Size()+KComma().Size()) + { + if( i > 0) tbuf.Append( KComma() ); + tbuf.Append( codecs.MdcaPoint( i ) ); + } + else + { + // if no space just break and do not continue further. + break; + } + } + videoCodecs = tbuf.AllocLC(); + + MUS_LOG_TDESC( "mus: [MUSSRV] Video codecs: ", (*videoCodecs) ); + MUS_LOG( "mus: [MUSSRV] <- CMusAvailabilityPluginManager::\ + VideoCodecsLC()" ) + + return videoCodecs; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +HBufC* CMusAvailabilityPluginManager::TelNumberLC() + { + MUS_LOG( "mus: [MUSSRV] -> CMusAvailabilityPluginManager::\ + TelNumberLC()" ) + + MMusAvaSettings& settings = iPlugin->Settings(); + + HBufC* telNumber = settings.TelNumber().AllocLC(); + + MUS_LOG( "mus: [MUSSRV] <- CMusAvailabilityPluginManager::\ + TelNumberLC()" ) + + return telNumber; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +HBufC* CMusAvailabilityPluginManager::ContactNameLC() + { + MUS_LOG( "mus: [MUSSRV] -> CMusAvailabilityPluginManager::\ + ContactNameLC()" ) + + MMusAvaSettings& settings = iPlugin->Settings(); + + HBufC* contactName = settings.ContactName().AllocLC(); + + MUS_LOG( "mus: [MUSSRV] <- CMusAvailabilityPluginManager::\ + ContactNameLC()" ) + + return contactName; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusAvailabilityPluginManager::IndicateAvailabilityL() + { + + MUS_LOG( "mus: [MUSSRV] -> CMusAvailabilityPluginManager::\ + IndicateAvailabilityL()" ) + + if( PossibleToLaunch() ) + { + MUS_LOG( "mus: [MUSSRV] Status available" ) + if( !iIndicator ) + { + MUS_LOG( "mus: [MUSSRV] Create indicator" ) + iIndicator = CMusIndicatorApi::NewL( *this ); + iIndicator->IndicateAvailabilityL(); + } + iApplicationManager.SetIndicatorStatusL( ETrue ); + } + else + { + MUS_LOG( "mus: [MUSSRV] Not available" ) + iApplicationManager.SetIndicatorStatusL( EFalse ); + delete iIndicator; + iIndicator = NULL; + } + + MUS_LOG( "mus: [MUSSRV] <- CMusAvailabilityPluginManager::\ + IndicateAvailabilityL()" ) + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagersrv/src/musmanagerserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagersrv/src/musmanagerserver.cpp Thu Jul 22 16:32:26 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: ?Description +* +*/ + + +#include "musmanagerserver.h" +#include "musunittesting.h" +#include "muslogger.h" +#include "musmanageripccommon.h" +#include "musmanagerserverclosetimer.h" +#include "musmanagerservercore.h" +#include "musmanagerserverplatsecpolicy.h" +#include "musmanagerserversession.h" + +// CONSTANTS +const TUint KServerCloseWaitTime = 500; // milliseconds + +// ----------------------------------------------------------------------------- +// CMusManagerServer::NewL +// ----------------------------------------------------------------------------- +// +CMusManagerServer* CMusManagerServer::NewL() + { + MUS_LOG( "mus: [MUSSRV] -> CMusManagerServer* CMusManagerServer::NewL()" ); + + CMusManagerServer* self = CMusManagerServer::NewLC(); + CleanupStack::Pop( self ); + MUS_LOG( "mus: [MUSSRV] <- CMusManagerServer* CMusManagerServer::NewL()" ); + return self; + } + +// ----------------------------------------------------------------------------- +// CMusManagerServer::NewLC +// ----------------------------------------------------------------------------- +// +CMusManagerServer* CMusManagerServer::NewLC() + { + MUS_LOG( "mus: [MUSSRV] -> CMusManagerServer* CMusManagerServer::NewLC()" ); + + CMusManagerServer* self = new( ELeave ) CMusManagerServer( EPriorityHigh ); + CleanupStack::PushL( self ); + self->ConstructL(); + MUS_LOG( "mus: [MUSSRV] <- CMusManagerServer* CMusManagerServer::NewLC()" ); + return self; + } + +// ----------------------------------------------------------------------------- +// CMusManagerServer::CMusManagerServer +// ----------------------------------------------------------------------------- +// +CMusManagerServer::CMusManagerServer ( TInt aPriority ) + : CPolicyServer( aPriority, KMusManagerServerPlatSecPolicy ) + { + } + +// ----------------------------------------------------------------------------- +// CMusManagerServer::ConstructL +// ----------------------------------------------------------------------------- +// +void CMusManagerServer::ConstructL() + { + MUS_LOG( "mus: [MUSSRV] -> CMusManagerServer::ConstructL()" ); + + iActiveScheduler = new( ELeave ) CActiveScheduler (); + CActiveScheduler::Install( iActiveScheduler ); + + StartL( KMusManagerServerName ); + + iCloseTimer = CMusManagerServerCloseTimer::NewL(); + + iServerCore = CMusManagerServerCore::NewL( *this ); + MUS_LOG( "mus: [MUSSRV] <- CMusManagerServer::ConstructL()" ); + } + +// ----------------------------------------------------------------------------- +// CMusManagerServer::~CMusManagerServer +// ----------------------------------------------------------------------------- +// +CMusManagerServer::~CMusManagerServer() + { + MUS_LOG( "mus: [MUSSRV] -> CMusManagerServer::~CMusManagerServer()" ); + + delete iCloseTimer; + //iServerCore.StopMonitoring(); + delete iServerCore; + + delete iActiveScheduler; + CActiveScheduler::Install( NULL ); + MUS_LOG( "mus: [MUSSRV] <- CMusManagerServer::~CMusManagerServer()" ); + } + +// ----------------------------------------------------------------------------- +// CMusManagerServer::IncrementSessions +// ----------------------------------------------------------------------------- +// +void CMusManagerServer::StopServer() + { + MUS_LOG( "mus: [MUSSRV] -> CMusManagerServer::StopServer()" ); + iCloseTimer->StopActiveSchedulerAfter( KServerCloseWaitTime ); + MUS_LOG( "mus: [MUSSRV] <- CMusManagerServer::StopServer()" ); + } + +// ----------------------------------------------------------------------------- +// CMusManagerServer::IncrementSessions +// ----------------------------------------------------------------------------- +// +void CMusManagerServer::IncrementSessions() + { + MUS_LOG( "mus: [MUSSRV] -> CMusManagerServer::IncrementSessions()" ); + + iSessionCount++; + + if ( iCloseTimer->IsActive() ) + { + iCloseTimer->Cancel(); + } + MUS_LOG1( "mus: [MUSSRV] <- CMusManagerServer::IncrementSessions( %d )", + iSessionCount ); + } + +// ----------------------------------------------------------------------------- +// CMusManagerServer::DecrementSessions +// ----------------------------------------------------------------------------- +// +void CMusManagerServer::DecrementSessions() + { + MUS_LOG( "mus: [MUSSRV] -> CMusManagerServer::DecrementSessions()" ); + + iSessionCount--; + + if( iSessionCount == 0 ) + { + iServerCore->EventNoSessions(); + } + MUS_LOG1( "mus: [MUSSRV] <- CMusManagerServer::DecrementSessions( %d )", + iSessionCount ); + } + +// ----------------------------------------------------------------------------- +// CMusManagerServer::RunError +// ----------------------------------------------------------------------------- +// +TInt CMusManagerServer::RunError(TInt aError) + { + MUS_LOG1( "mus: [MUSSRV] -> CMusManagerServer::RunError( %d )", + aError ); + + if ( aError == KErrBadDescriptor ) + { + // A bad descriptor error implies a badly programmed client, + // so panic it; otherwise report the error to the client + Message().Panic( KMusManagerServer(), EBadDescriptor ); + } + else + { + Message().Complete( aError ); + } + // + // The leave will result in an early return from CServer::RunL(), skipping + // the call to request another message. So do that now in order to keep the + // server running. + ReStart(); + + MUS_LOG( "mus: [MUSSRV] <- CMusManagerServer::RunError()" ); + return KErrNone; // handled the error fully + } + +// ----------------------------------------------------------------------------- +// CMusManagerServer::NewSessionL +// ----------------------------------------------------------------------------- +// +CSession2* CMusManagerServer::NewSessionL( + const TVersion &aVersion, + const RMessage2& /*aMessage*/ ) const + { + MUS_LOG( "mus: [MUSSRV] -> CMusManagerServer::NewSessionL()" ); + + // check we're the right version + if ( !User::QueryVersionSupported( TVersion( KMusManagerServerMajorVersionNumber, + KMusManagerServerMinorVersionNumber, + KMusManagerServerBuildVersionNumber), + aVersion ) ) + { + User::Leave( KErrNotSupported ); + } + // make new session + CMusManagerServerSession* session = CMusManagerServerSession::NewL( + const_cast( *this ), + *iServerCore ); + MUS_LOG( "mus: [MUSSRV] <- CMusManagerServer::NewSessionL()" ); + return session; + + } + +// ----------------------------------------------------------------------------- +// CMusManagerServer::SessionCount +// ----------------------------------------------------------------------------- +// +TUint CMusManagerServer::SessionCount() + { + MUS_LOG( "mus: [MUSSRV] -> CMusManagerServer::SessionCount()" ); + MUS_LOG( "mus: [MUSSRV] <- CMusManagerServer::SessionCount()" ); + return iSessionCount; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagersrv/src/musmanagerserverclosetimer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagersrv/src/musmanagerserverclosetimer.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,114 @@ +/* +* 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: ?Description +* +*/ + + +// INCLUDES +#include "musmanagerserverclosetimer.h" + +const TUint KMicroSecondsInMilliSecond = 1000; + +// ---------------------------------------------------------------------------- +// CMusManagerServerCloseTimer::NewL +// ---------------------------------------------------------------------------- +// +CMusManagerServerCloseTimer* CMusManagerServerCloseTimer::NewL() + { + CMusManagerServerCloseTimer* self = CMusManagerServerCloseTimer::NewLC (); + CleanupStack::Pop (self); + return self; + } + +// ---------------------------------------------------------------------------- +// CMusManagerServerCloseTimer::NewLC +// ---------------------------------------------------------------------------- +// +CMusManagerServerCloseTimer* CMusManagerServerCloseTimer::NewLC () + { + CMusManagerServerCloseTimer* self = new(ELeave)CMusManagerServerCloseTimer; + CleanupStack::PushL (self); + self->ConstructL (); + return self; + } + +// ---------------------------------------------------------------------------- +// CMusManagerServerCloseTimer::ConstructL +// ---------------------------------------------------------------------------- +// +void CMusManagerServerCloseTimer::ConstructL () + { + User::LeaveIfError (iTimer.CreateLocal()); + } + + +// ---------------------------------------------------------------------------- +// CMusManagerServerCloseTimer::ConstructL +// ---------------------------------------------------------------------------- +// +CMusManagerServerCloseTimer::CMusManagerServerCloseTimer () +: CActive(EPriorityStandard) + { + CActiveScheduler::Add(this); + } + + +// ---------------------------------------------------------------------------- +// CMusManagerServerCloseTimer::~CMusManagerServerCloseTimer +// ---------------------------------------------------------------------------- +// +CMusManagerServerCloseTimer::~CMusManagerServerCloseTimer () + { + CActive::Cancel(); + iTimer.Close(); + } + +// ---------------------------------------------------------------------------- +// CMusManagerServerCloseTimer::StopActiveSchedulerAfter +// ---------------------------------------------------------------------------- +// +void CMusManagerServerCloseTimer::StopActiveSchedulerAfter (TUint aMilliSeconds) + { + TTimeIntervalMicroSeconds32 time( + KMicroSecondsInMilliSecond + * aMilliSeconds ); + + if (!IsActive()) + { + iTimer.After(iStatus,time); + SetActive (); + } + } + +// ---------------------------------------------------------------------------- +// CMusManagerServerCloseTimer::RunL +// ---------------------------------------------------------------------------- +// +void CMusManagerServerCloseTimer::RunL () + { + CActiveScheduler::Stop(); + } + +// ---------------------------------------------------------------------------- +// CMusManagerServerCloseTimer::DoCancel +// ---------------------------------------------------------------------------- +// +void CMusManagerServerCloseTimer::DoCancel () + { + iTimer.Cancel(); + } + +// End of File + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagersrv/src/musmanagerservercore.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagersrv/src/musmanagerservercore.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,501 @@ +/* +* 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: ?Description +* +*/ + + +#include "musunittesting.h" + +#include "musmanagerservercore.h" +#include "musapplicationmanager.h" +#include "musavailabilitypluginmanager.h" +#include "musmonitoravailabilityobserver.h" +#include "muslogger.h" +#include "musmanagerservercoreobserver.h" +#include "musmanager.h" +#include "musmanagerservercommon.h" + +using namespace MultimediaSharing; + +// CONSTANTS +_LIT8( KMusEngineName, "MultimediaSharing" ); + + +// ----------------------------------------------------------------------------- +// CMusManagerServerCore::NewL +// ----------------------------------------------------------------------------- +// +CMusManagerServerCore* CMusManagerServerCore::NewL( + MMusManagerServerCoreObserver& aObserver ) + { + MUS_LOG( "mus: [MUSSRV] -> CMusManagerServerCore::NewL()" ); + + CMusManagerServerCore* self = CMusManagerServerCore::NewLC( aObserver ); + CleanupStack::Pop( self ); + MUS_LOG( "mus: [MUSSRV] <- CMusManagerServerCore::NewL()" ); + return self; + } + +// ----------------------------------------------------------------------------- +// CMusManagerServerCore::NewLC +// ----------------------------------------------------------------------------- +// +CMusManagerServerCore* CMusManagerServerCore::NewLC( + MMusManagerServerCoreObserver& aObserver ) + { + MUS_LOG( "mus: [MUSSRV] -> CMusManagerServerCore::NewLC()" ); + + CMusManagerServerCore* self + = new( ELeave ) CMusManagerServerCore( aObserver ); + CleanupStack::PushL( self ); + self->ConstructL(); + MUS_LOG( "mus: [MUSSRV] <- CMusManagerServerCore::NewLC()" ); + return self; + } + +// ----------------------------------------------------------------------------- +// CMusManagerServerCore::CMusManagerServerCore +// ----------------------------------------------------------------------------- +// +CMusManagerServerCore::CMusManagerServerCore( MMusManagerServerCoreObserver& aObserver ) + : iObserver( aObserver ) + { + } + +// ----------------------------------------------------------------------------- +// CMusManagerServerCore::ConstructL +// ----------------------------------------------------------------------------- +// +void CMusManagerServerCore::ConstructL() + { + MUS_LOG( "mus: [MUSSRV] -> CMusManagerServerCore::ConstructL" ); + + iApplicationManager = CMusApplicationManager::NewL(); + + iApplicationManager->ResolvePluginNameL( iPluginName ); + + iPluginManager = CMusAvailabilityPluginManager::NewL( *this, *iApplicationManager ); + + MUS_LOG( "mus: [MUSSRV] <- CMusManagerServerCore::ConstructL" ); + } + +// ----------------------------------------------------------------------------- +// CMusManagerServerCore::~CMusManagerServerCore +// ----------------------------------------------------------------------------- +// +CMusManagerServerCore::~CMusManagerServerCore() + { + MUS_LOG( "mus: [MUSSRV] -> CMusManagerServerCore::CMusManagerServerCore" ); + + // inform ui via application manager (via session api) + + delete iPluginManager; + + delete iApplicationManager; + + // go through interested client sessions + StopMonitoring(); + iAvailabilityMonitors.Close(); + + MUS_LOG( "mus: [MUSSRV] <- CMusManagerServerCore::CMusManagerServerCore" ); + } + +// ----------------------------------------------------------------------------- +// CMusManagerServerCore::~CMusManagerServerCore +// ----------------------------------------------------------------------------- +// +MultimediaSharing::TMusAvailabilityStatus CMusManagerServerCore::AvailabilityQueryL() + { + MUS_LOG( "mus: [MUSSRV] -> CMusManagerServerCore::AvailabilityQueryL" ); + MultimediaSharing::TMusAvailabilityStatus status + = Availability(); + + MUS_LOG( "mus: [MUSSRV] <- CMusManagerServerCore::AvailabilityQueryL" ); + return status; + } + // ----------------------------------------------------------------------------- +// CMusManagerServerCore::InvestigateAvailability +// ----------------------------------------------------------------------------- +// +void CMusManagerServerCore::CommandL( MultimediaSharing::TCommandType aCommandType ) + { + MUS_LOG( "mus: [MUSSRV] -> CMusManagerServerCore::CommandL" ); + if ( aCommandType == MultimediaSharing::ECommandManualActivation && + IsMusEnginePlugin() ) + { + MUS_LOG( "mus: [MUSSRV] Manual Activation is started" ) + iPluginManager->ManualQueryL(); + } + MUS_LOG( "mus: [MUSSRV] <- CMusManagerServerCore::CommandL" ); + } + +// ----------------------------------------------------------------------------- +// CMusManagerServerCore::InvestigateAvailability +// ----------------------------------------------------------------------------- +// +void CMusManagerServerCore::InvestigateAvailabilityL() + { + MUS_LOG( "mus: [MUSSRV] -> CMusManagerServerCore::InvestigateAvailabilityL" ); + if ( IsMusEnginePlugin() ) + { + iPluginManager->InvestigateAvailabilityL(); + } + MUS_LOG( "mus: [MUSSRV] <- CMusManagerServerCore::InvestigateAvailabilityL" ); + } + +// ----------------------------------------------------------------------------- +// CMusManagerServerCore::InvitationReceived +// ----------------------------------------------------------------------------- +// +void CMusManagerServerCore::InvitationReceivedL( TUid aChannelId ) + { + MUS_LOG( "mus: [MUSSRV] -> CMusManagerServerCore::InvitationReceivedL" ); + + TInt uid = aChannelId.iUid; + + if( uid == CMusManager::ESipInviteDesired && + ApplicationAllowed() ) + { + PrepareForReceivedInviteL(); + + // write session boundary values + WriteSessionPropertiesL( + MultimediaSharing::EMusReceive, + Availability(), + iPluginManager->SessionParametersL() ); + + iApplicationManager->StartApplicationL(); + } + else if( uid == CMusManager::ESipInviteDesired2WayVideo && + ApplicationAllowed() ) + { + PrepareForReceivedInviteL(); + + // write session boundary values + WriteSessionPropertiesL( + MultimediaSharing::EMusReceiveTwoWayVideo, + Availability(), + iPluginManager->SessionParametersL() ); + + iApplicationManager->StartApplicationL(); + } + else if ( IsMusEnginePlugin() ) + { + if( uid == CMusManager::ESipInviteNotDesired ) + { + iPluginManager->InvitationReceivedL(); + } + else + { + User::Leave( KErrNotReady ); + } + } + + MUS_LOG( "mus: [MUSSRV] <- CMusManagerServerCore::InvitationReceivedL" ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusManagerServerCore::OptionsReceivedL( TUid /*aChannelId*/ ) + { + MUS_LOG( "mus: [MUSSRV] -> CMusManagerServerCore::OptionsReceivedL" ); + if ( IsMusEnginePlugin() ) + { + iPluginManager->OptionsReceivedL(); + } + MUS_LOG( "mus: [MUSSRV] <- CMusManagerServerCore::OptionsReceivedL" ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusManagerServerCore::StartMultimediaSharingL( MultimediaSharing::TMusUseCase aUseCase ) + { + MUS_LOG( "mus: [MUSSRV] -> CMusManagerServerCore::StartMultimediaSharingL" ); + if( !iApplicationManager->ApplicationRunning() && + ApplicationAllowed() ) + { + // write session boundary values + WriteSessionPropertiesL( + aUseCase, + Availability(), + iPluginManager->SessionParametersL() ); + + // start actual application + iApplicationManager->StartApplicationL(); + } + else + { + iApplicationManager->ShowApplicationL(); + } + MUS_LOG( "mus: [MUSSRV] <- CMusManagerServerCore::StartMultimediaSharingL" ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusManagerServerCore::StopMultimediaSharingL() + { + MUS_LOG( "mus: [MUSSRV] -> CMusManagerServerCore::StopMultimediaSharingL" ); + iApplicationManager->StopApplicationL(); + MUS_LOG( "mus: [MUSSRV] <- CMusManagerServerCore::StopMultimediaSharingL" ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusManagerServerCore::EventNoSessions() + { + MUS_LOG( "mus: [MUSSRV] -> CMusManagerServerCore::EventNoSessions" ); + if ( IsMusEnginePlugin() ) + { + TRAPD( error, iPluginManager->StopPluginL() ); + if( error ) + { + // iObserver.StopServer(); + } + } + iObserver.StopServer(); + MUS_LOG( "mus: [MUSSRV] <- CMusManagerServerCore::EventNoSessions" ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusManagerServerCore::PluginStopped() + { + MUS_LOG( "mus: [MUSSRV] -> CMusManagerServerCore::PluginStopped" ); + if( iObserver.SessionCount() == 0 ) + { + iObserver.StopServer(); + } + MUS_LOG( "mus: [MUSSRV] <- CMusManagerServerCore::PluginStopped" ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusManagerServerCore::AvailabilityChangedL( + MultimediaSharing::TMusAvailabilityStatus aAvailability ) + { + MUS_LOG1( "mus: [MUSSRV] -> CMusManagerServerCore::AvailabilityChangedL( %d )", + aAvailability ); + + if ( !IsMusEnginePlugin() ) + { + MUS_LOG( "mus: [MUSSRV] <- CMusManagerServerCore::AvailabilityChangedL - \ + non-MuS plugin"); + return; + } + // inform ui via application manager (via session api) + + WriteSessionPropertiesL( + aAvailability, + iPluginManager->SessionParametersL() ); + + if( iAvailabilityMonitors.Count() ) + { + // go through interested client sessions + for( TInt i=0; iAvailabilityChangedL( + aAvailability ); + } + } + + MUS_LOG( "mus: [MUSSRV] <- CMusManagerServerCore::AvailabilityChangedL" ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusManagerServerCore::CancelMonitoring( MMusMonitorAvailabilityObserver* aObserver ) + { + TInt index = iAvailabilityMonitors.Find( aObserver ); + + if( index != KErrNotFound ) + { + iAvailabilityMonitors[index]->RequestComplete(); + iAvailabilityMonitors.Remove( index ); + } + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusManagerServerCore::RegisterObserverL( + MMusMonitorAvailabilityObserver* aObserver ) + { + if( iAvailabilityMonitors.Find( aObserver ) == KErrNotFound ) + { + iAvailabilityMonitors.AppendL( aObserver ); + } + MUS_LOG( "mus: [MUSSRV] -> CMusManagerServerCore::RegisterObserver" ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusManagerServerCore::RemoveObserver( MMusMonitorAvailabilityObserver* aObserver ) + { + MUS_LOG( "mus: [MUSSRV] -> CMusManagerServerCore::RemoveObserver" ); + TInt index = iAvailabilityMonitors.Find( aObserver ); + + if( index != KErrNotFound ) + { + iAvailabilityMonitors.Remove( index ); + } + MUS_LOG( "mus: [MUSSRV] -> CMusManagerServerCore::RemoveObserver" ); + } + +// ----------------------------------------------------------------------------- +// From MMusAvailabilityPluginManagerObserver. +// Starts live video sharing. +// ----------------------------------------------------------------------------- +// +void CMusManagerServerCore::StartSharingWithUseCaseL( + MultimediaSharing::TMusUseCase aUseCase ) + { + MUS_LOG1( "mus: [MUSSRV] -> CMusManagerServerCore::StartSharingWithUseCaseL:%d", + aUseCase ); + + StartMultimediaSharingL( aUseCase ); + + MUS_LOG( "mus: [MUSSRV] <- CMusManagerServerCore::StartSharingWithUseCaseL" ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusManagerServerCore::StopMonitoring() + { + // go through interested client sessions + for( TInt i=0; iRequestComplete(); + iAvailabilityMonitors.Remove( i ); + } + } + +// ----------------------------------------------------------------------------- +// CMusManagerServerCore::IsMusEnginePlugin +// ----------------------------------------------------------------------------- +// +TBool CMusManagerServerCore::IsMusEnginePlugin() + { + TBool isMus( EFalse ); + if ( !iPluginName.Compare( KMusEngineName ) ) + { + isMus = ETrue; + } + return isMus; + } + +// ----------------------------------------------------------------------------- +// CMusManagerServerCore::Availability +// ----------------------------------------------------------------------------- +// +MultimediaSharing::TMusAvailabilityStatus CMusManagerServerCore::Availability() + { + MUS_LOG( "mus: [MUSSRV] -> CMusManagerServerCore::Availability" ); + if ( IsMusEnginePlugin() ) + { + MUS_LOG( "mus: [MUSSRV] <- CMusManagerServerCore::Availability - MuS plugin" ); + return iPluginManager->Availability(); + } + else + { + MUS_LOG( "mus: [MUSSRV] <- CMusManagerServerCore::Availability - non-MuS plugin" ); + return EMultimediaSharingAvailable; + } + } + +// ----------------------------------------------------------------------------- +// CMusManagerServerCore::ApplicationAllowed +// ----------------------------------------------------------------------------- +// +TBool CMusManagerServerCore::ApplicationAllowed() + { + if ( IsMusEnginePlugin() ) + { + return iPluginManager->ApplicationAllowed(); + } + else + { + return ETrue; + } + } + +// ----------------------------------------------------------------------------- +// CMusManagerServerCore::PrepareForReceivedInviteL +// ----------------------------------------------------------------------------- +// +void CMusManagerServerCore::PrepareForReceivedInviteL() + { + if ( IsMusEnginePlugin() ) + { + iPluginManager->PrepareForReceivedInviteL(); + } + } + +// ----------------------------------------------------------------------------- +// CMusManagerServerCore::WriteSessionPropertiesL +// ----------------------------------------------------------------------------- +// +void CMusManagerServerCore::WriteSessionPropertiesL( + MultimediaSharing::TMusUseCase aUseCase, + MultimediaSharing::TMusAvailabilityStatus aStatus, + MDesCArray& aSessionParameters ) + { + if ( IsMusEnginePlugin() ) + { + iApplicationManager->WriteSessionPropertiesL( + aUseCase, + aStatus, + aSessionParameters ); + } + } + +// ----------------------------------------------------------------------------- +// CMusManagerServerCore::WriteSessionPropertiesL +// ----------------------------------------------------------------------------- +// +void CMusManagerServerCore::WriteSessionPropertiesL( + MultimediaSharing::TMusAvailabilityStatus aStatus, + MDesCArray& aSessionParameters ) + { + if ( IsMusEnginePlugin() ) + { + iApplicationManager->WriteSessionPropertiesL( + aStatus, + aSessionParameters ); + } + } + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagersrv/src/musmanagerserveritcutility.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagersrv/src/musmanagerserveritcutility.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,140 @@ +/* +* 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: ?Description +* +*/ + + +#include + +#include "muslogger.h" +#include "musmanagerserveritcutility.h" + +// --------------------------------------------------------------------------- +// MusManagerServerItcUtility::WriteAvailabilityL +// --------------------------------------------------------------------------- +// +void MusManagerServerItcUtility::WriteAvailabilityL( + const RMessage2& aMessage, + TInt aAvailability ) + { + TPckg capPckg( aAvailability ); + WriteL( + EMusManagerIpcArgAvailability, + aMessage, + capPckg ); + } + + +// --------------------------------------------------------------------------- +// MusManagerServerItcUtility::WriteAvailabilityReportL +// --------------------------------------------------------------------------- +// +void MusManagerServerItcUtility::WriteAvailabilityReportL( + const RMessage2& aMessage, + TInt aAvailability ) + { + TPckg capPckg( aAvailability ); + WriteL( + EMusManagerIpcArgAvailabilityStatus, + aMessage, + capPckg ); + } +// --------------------------------------------------------------------------- +// MusManagerServerItcUtility::ReadChannelIdL +// --------------------------------------------------------------------------- +// +TUid MusManagerServerItcUtility::ReadChannelIdL( + const RMessage2& aMessage ) + { + TPckgBuf uidPckg; + aMessage.ReadL( + EMusManagerIpcArgChannelUid, + uidPckg ); + + return uidPckg(); + } + +// --------------------------------------------------------------------------- +// MusManagerServerItcUtility::ReadCommandL +// --------------------------------------------------------------------------- +// +TInt MusManagerServerItcUtility::ReadCommandL( + const RMessage2& aMessage ) + { + TPckgBuf intPckg; + aMessage.ReadL( + EMusManagerIpcArgCommandType, + intPckg ); + + return intPckg(); + } + + + +// --------------------------------------------------------------------------- +// MusManagerServerItcUtility::ReadRequestStatusL +// --------------------------------------------------------------------------- +// +TRequestStatus MusManagerServerItcUtility::ReadRequestStatusL( + const RMessage2& aMessage ) + { + TPckgBuf intPckg; + aMessage.ReadL( + EMusManagerIpcArgRequestStatus, + intPckg ); + + return TRequestStatus( intPckg() ); + } + +// --------------------------------------------------------------------------- +// MusManagerServerItcUtility::ReadUseCaseL +// --------------------------------------------------------------------------- +// +TInt MusManagerServerItcUtility::ReadUseCaseL( + const RMessage2& aMessage ) + { + TPckgBuf intPckg; + aMessage.ReadL( + EMusManagerIpcArgUseCase, + intPckg ); + + return intPckg(); + } + +// ---------------------------------------------------------------------------- +// MusManagerServerItcUtility::WriteL +// ---------------------------------------------------------------------------- +// +void MusManagerServerItcUtility::WriteL ( + TMusManagerIpcArguments aIndex, + const RMessage2& aMessage, + const TDesC8& aDes) + { + TInt length = aMessage.GetDesMaxLength( aIndex ); + + if (length < 0) + { + User::Leave( KErrArgument ); + } + if (length < aDes.Length()) + { + User::Leave( KErrOverflow ); + } + + aMessage.WriteL( aIndex, aDes ); + } + + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagersrv/src/musmanagerservermain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagersrv/src/musmanagerservermain.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,98 @@ +/* +* 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: ?Description +* +*/ + + +#include "muslogger.h" +#include "musmanagerservermain.h" +#include "musmanagerserver.h" +#include "musmanageripccommon.h" + +// ======== MEMBER FUNCTIONS ======== + +// ----------------------------------------------------------------------------- +// MusManagerServerMain::ThreadFunction +// ----------------------------------------------------------------------------- +// +TInt MusManagerServerMain::ThreadFunction ( TAny* /*aNone*/ ) + { + TInt err = KErrNone; + CTrapCleanup* cleanupStack = CTrapCleanup::New(); + if (!cleanupStack) + { + PanicServer( ECreateTrapCleanup ); + } + RSemaphore semaphore; + err = semaphore.OpenGlobal( KMusManagerServerSemaphoreName ); + if (err != KErrNone) + { + PanicServer( ESrvCreateServer ); + } + TRAP( err, ThreadFunctionL( semaphore ) ); + if ( err != KErrNone ) + { + semaphore.Signal(); + semaphore.Close(); + } + + delete cleanupStack; + return err; + } + +// ----------------------------------------------------------------------------- +// MusManagerServerMain::ThreadFunctionL +// ----------------------------------------------------------------------------- +// +void MusManagerServerMain::ThreadFunctionL (RSemaphore& aSemaphore) + { + // Give a name to this thread + User::LeaveIfError(User::RenameThread(KMusManagerServerName)); + + // Construct server + CMusManagerServer* server = CMusManagerServer::NewLC(); + + // Server created ok + aSemaphore.Signal(); + aSemaphore.Close(); + + // Start handling requests + CActiveScheduler::Start(); + + // This will be executed after the active scheduler has been stopped: + CleanupStack::PopAndDestroy(server); + } + +// ----------------------------------------------------------------------------- +// MusManagerServerMain::PanicServer +// ----------------------------------------------------------------------------- +// +void MusManagerServerMain::PanicServer (TMusManagerServerPanic aPanic) + { + User::Panic( KMusManagerServer(), aPanic ); + } + + +// ======== GLOBAL FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// Main function of the application executable. +// --------------------------------------------------------------------------- +// + +GLDEF_C TInt E32Main() + { + return MusManagerServerMain::ThreadFunction( NULL ); + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagersrv/src/musmanagerserversession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagersrv/src/musmanagerserversession.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,258 @@ +/* +* 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: ?Description +* +*/ + + +#include + +#include "muslogger.h" +#include "musmanageripccommon.h" +#include "musmanagerserveritcutility.h" +#include "musmanagerserversession.h" +#include "musmanagerserversessionobserver.h" +#include "musmanagerserver.h" + + +const TInt KServerRequestPending = 1; + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// Second phase constructor. +// --------------------------------------------------------------------------- +// +CMusManagerServerSession::CMusManagerServerSession( + CMusManagerServer& aServer, + MMusManagerServerSessionObserver& aObserver ) + : CSession2(), iServer( aServer ), iServerCore( aObserver ) + { + iServer.IncrementSessions(); + } + +// --------------------------------------------------------------------------- +// Second phase constructor. +// --------------------------------------------------------------------------- +// +void CMusManagerServerSession::ConstructL() + { + + } + + +// --------------------------------------------------------------------------- +// First phase constructor. +// --------------------------------------------------------------------------- +// +CMusManagerServerSession* CMusManagerServerSession::NewL( + CMusManagerServer& aServer, + MMusManagerServerSessionObserver& aObserver ) + { + MUS_LOG( "mus: [MUSSRV] -> CMusManagerServerSession::NewL()" ); + CMusManagerServerSession* self = CMusManagerServerSession::NewLC( + aServer, + aObserver ); + CleanupStack::Pop( self ); + MUS_LOG( "mus: [MUSSRV] <- CMusManagerServerSession::NewL()" ); + return self; + } + + +// --------------------------------------------------------------------------- +// First phase constructor. +// --------------------------------------------------------------------------- +// +CMusManagerServerSession* CMusManagerServerSession::NewLC( + CMusManagerServer& aServer, + MMusManagerServerSessionObserver& aObserver ) + { + CMusManagerServerSession* self = new( ELeave ) CMusManagerServerSession( + aServer, + aObserver ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// --------------------------------------------------------------------------- +// Standard destructor. +// --------------------------------------------------------------------------- +// +CMusManagerServerSession::~CMusManagerServerSession() + { + MUS_LOG( "mus: [MUSSRV] -> CMusManagerServerSession::~CMusManagerServerSession()" ); + iServer.DecrementSessions(); + iServerCore.CancelMonitoring( this ); + iAvailabilityStatus.Close(); + MUS_LOG( "mus: [MUSSRV] <- CMusManagerServerSession::~CMusManagerServerSession()" ); + } + +// ----------------------------------------------------------------------------- +// Start to monitor availability states for this session. +// ----------------------------------------------------------------------------- +// +TInt CMusManagerServerSession::MonitorAvailabilityL() + { + MUS_LOG( "mus: [MUSSRV] -> CMusManagerServerSession::MonitorAvailabilityL" ); + if ( iAvailabilityStatus.Count() ) + { + MusManagerServerItcUtility::WriteAvailabilityReportL( + iMessage, iAvailabilityStatus[0] ); + iAvailabilityStatus.Remove( 0 ); + MUS_LOG( "mus: [MUSSRV] <- CMusManagerServerSession::\ + MonitorAvailabilityL" ); + return KErrNone; + } + else + { + MUS_LOG( "mus: [MUSSRV] <- CMusManagerServerSession::\ + MonitorAvailabilityL" ); + return KServerRequestPending; + } + } + +// --------------------------------------------------------------------------- +// Receives incoming messages. +// --------------------------------------------------------------------------- +// +void CMusManagerServerSession::ServiceL( const RMessage2& aMessage ) + { + MUS_LOG1( "mus: [MUSSRV] -> CMusManagerServerSession::ServiceL( %d )", + ( TInt ) aMessage.Function() ); + TMusManagerIpcFunctions function + = ( TMusManagerIpcFunctions )aMessage.Function(); + + TInt retVal( KErrNone ); + + switch ( function ) + { + case EMusManagerIpcAvailabilityQuery: + { + TInt capability = iServerCore.AvailabilityQueryL(); + MusManagerServerItcUtility::WriteAvailabilityL( + aMessage, + capability ); + + iLastReport = ( MultimediaSharing::TMusAvailabilityStatus )capability; + break; + } + case EMusManagerIpcInvestigateAvailability: + { + TRAP( retVal, iServerCore.InvestigateAvailabilityL() ); + break; + } + case EMusManagerIpcInvitationReceived: + { + TUid channelId + = MusManagerServerItcUtility::ReadChannelIdL( aMessage ); + + TRAP( retVal, iServerCore.InvitationReceivedL( channelId ) ); + + break; + } + case EMusManagerIpcOptionsReceived: + { + TUid channelId + = MusManagerServerItcUtility::ReadChannelIdL( aMessage ); + + TRAP( retVal, iServerCore.OptionsReceivedL( channelId ) ); + break; + } + case EMusManagerIpcStartMultimediaSharing: + { + TInt useCase + = MusManagerServerItcUtility::ReadUseCaseL( aMessage ); + + TRAP( retVal, iServerCore.StartMultimediaSharingL( + (MultimediaSharing::TMusUseCase) useCase ) ); + break; + } + case EMusManagerIpcStopMultimediaSharing: + { + TRAP( retVal, iServerCore.StopMultimediaSharingL() ); + break; + } + case EMusManagerIpcStartObservingAvailability: + { + iServerCore.RegisterObserverL( this ); + break; + } + + case EMusManagerIpcMonitorAvailability: + { + iMessage = aMessage; + retVal = MonitorAvailabilityL(); + } + break; + case EMusManagerIpcCancelMonitoring: + { + iServerCore.CancelMonitoring( this ); + } + break; + case EMusManagerIpcHandleCommand: + { + TInt command + = MusManagerServerItcUtility::ReadCommandL( aMessage ); + + TRAP( retVal, iServerCore.CommandL( + ( MultimediaSharing::TCommandType ) command ) ); + } + break; + + default: + break; + } + + MUS_LOG1( "mus: [MUSSRV] - Message compleated with code %d", retVal ); + aMessage.Complete( retVal ); + + MUS_LOG( "mus: [MUSSRV] <- CMusManagerServerSession::ServiceL()" ); + } + +void CMusManagerServerSession::AvailabilityChangedL( + MultimediaSharing::TMusAvailabilityStatus aAvailability ) + { + MUS_LOG1( "mus: [MUSSRV] -> CMusManagerServerCore::AvailabilityChangedL( %d )", + aAvailability ); + // inform ui via application manager (via session api) + if( iAvailabilityStatus.Count() && !iMessage.IsNull() ) + { + iAvailabilityStatus.AppendL( aAvailability ); + MusManagerServerItcUtility::WriteAvailabilityReportL( + iMessage, iAvailabilityStatus[0] ); + iAvailabilityStatus.Remove( 0 ); + iMessage.Complete( KErrNone ); + } + else if ( iMessage.IsNull() ) + { + iAvailabilityStatus.AppendL( aAvailability ); + } + else + { + MusManagerServerItcUtility::WriteAvailabilityReportL( + iMessage, aAvailability ); + iMessage.Complete( KErrNone ); + } + MUS_LOG( "mus: [MUSSRV] <- CMusManagerServerSession::AvailabilityChangedL()" ); + } + +void CMusManagerServerSession::RequestComplete() + { + MUS_LOG( "mus: [MUSSRV] -> CMusManagerServerSession::RequestComplete()" ); + iMessage.Complete( KErrCancel ); + MUS_LOG( "mus: [MUSSRV] <- CMusManagerServerSession::RequestComplete()" ); + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagersrv/tsrc/ut_managersrv/BMARM/ut_musmanagerserveru.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagersrv/tsrc/ut_managersrv/BMARM/ut_musmanagerserveru.def Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,2 @@ +EXPORTS + CreateTestSuiteL__Fv @ 1 NONAME R3UNUSED ; CreateTestSuiteL(void) diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagersrv/tsrc/ut_managersrv/BWINS/ut_musmanagerserveru.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagersrv/tsrc/ut_managersrv/BWINS/ut_musmanagerserveru.def Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,3 @@ +EXPORTS + ?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 1 NONAME ; class MEUnitTest * CreateTestSuiteL(void) + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagersrv/tsrc/ut_managersrv/EABI/ut_musmanagerserveru.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagersrv/tsrc/ut_managersrv/EABI/ut_musmanagerserveru.def Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,4 @@ +EXPORTS + _Z16CreateTestSuiteLv @ 1 NONAME + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagersrv/tsrc/ut_managersrv/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagersrv/tsrc/ut_managersrv/group/bld.inf Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,20 @@ +/* +* Copyright (c) 2005-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 file for project MuS Manager Server tests. +* +*/ + +PRJ_MMPFILES +../../../../mmshindicator/group/musindicator.mmp +ut_musmanagerserver.mmp \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagersrv/tsrc/ut_managersrv/group/ut_musmanagerserver.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagersrv/tsrc/ut_managersrv/group/ut_musmanagerserver.mmp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,105 @@ +/* +* Copyright (c) 2006-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 definition file for MuS Manager Server unit tests +* +*/ + + +#include +#include + +TARGET ut_musmanagerserver.dll +TARGETTYPE dll +EPOCALLOWDLLDATA +TARGETPATH /DigiaEUnit/Tests +UID 0x1000af5a 0x01700000 + +CAPABILITY EUNIT_CAPS +VENDORID VID_DEFAULT + +MACRO UNIT_TESTING + +SOURCEPATH ../../../../../tsrc/propertystub/src +SOURCE e32property.cpp + +SOURCEPATH ../../../../../tsrc/multimediasharingsettingsstub/src +SOURCE mussettings.cpp + +SOURCEPATH ../../../../../tsrc/mmusavasettingsstub/src +SOURCE mmusavasettingsstub.cpp + +SOURCEPATH ../../../../../tsrc/cmusavainterfacestub/src +SOURCE cmusavainterfacestub.cpp + +SOURCEPATH ../../../../../tsrc/musavaailabilitystub/src +SOURCE musavaailabilitystub.cpp + +SOURCEPATH ../../../../mmshavailability/tsrc/ut_availability/stubs/src +SOURCE CMusAvaAvailabilityObserverImp.cpp + + +SOURCEPATH ../../../../mmshavailability/src +SOURCE musavasettingsimp.cpp + +SOURCEPATH ../src +SOURCE stubs.cpp +SOURCE ut_cmusapplicationmanager.cpp +SOURCE ut_cmusavailabilitypluginmanager.cpp +SOURCE ut_cmusmanagerserverclosetimer.cpp +SOURCE ut_cmusmanagerservercore.cpp +SOURCE ut_musmanagerserverdllmain.cpp +SOURCE ut_cmusmanagerserversession.cpp + +SOURCEPATH ../../../src +SOURCE musmanagerservercore.cpp +SOURCE musmanagerserverclosetimer.cpp +SOURCE musapplicationmanager.cpp +SOURCE musavailabilitypluginmanager.cpp + +SOURCE musmanagerserver.cpp +SOURCE musmanagerserveritcutility.cpp +SOURCE musmanagerservermain.cpp +SOURCE musmanagerserversession.cpp + +USERINCLUDE ../../../../../tsrc/multimediasharingsettingsstub/inc +USERINCLUDE ../inc +USERINCLUDE ../../../../mmshavailability/inc +USERINCLUDE ../../../inc +USERINCLUDE ../../../../mmshshared/inc +USERINCLUDE ../../../../mmshindicator/inc +USERINCLUDE ../../../../inc +USERINCLUDE ../../../../../inc + +USERINCLUDE ../../../../../tsrc/mmusavasettingsstub/inc +USERINCLUDE ../../../../../tsrc/cmusavainterfacestub/inc +USERINCLUDE ../../../../../tsrc/musavaailabilitystub/inc +USERINCLUDE ../../../../mmshavailability/tsrc/ut_availability/stubs/inc +USERINCLUDE ../../../../../tsrc/ututils/inc +USERINCLUDE ../../../../../tsrc/propertystub/inc +USERINCLUDE ../../../../../tsrc/Apastub/inc + +SYSTEMINCLUDE ../../../../../tsrc/propertystub/inc +SYSTEMINCLUDE ../../../../../tsrc/Apastub/inc + +APP_LAYER_SYSTEMINCLUDE + +LIBRARY musindicator.lib +LIBRARY EUnit.lib +LIBRARY euser.lib +LIBRARY apparc.lib +LIBRARY ws32.lib +LIBRARY flogger.lib +LIBRARY bafl.lib +LIBRARY charconv.lib + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagersrv/tsrc/ut_managersrv/inc/ut_cmusapplicationmanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagersrv/tsrc/ut_managersrv/inc/ut_cmusapplicationmanager.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,96 @@ +/* +* 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: Unit tests for CMusApplicationManager class. +* +*/ + + +#ifndef UT_CMUSAPPLICATIONMANAGER_H +#define UT_CMUSAPPLICATIONMANAGER_H + +#include + +class CMusApplicationManager; + +#include +#ifndef NONSHARABLE_CLASS + #define NONSHARABLE_CLASS(x) class x +#endif + +/** + * Unit test class for CMusApplicationManager class. + * Implements unit testing of CMusApplicationManager class. + * + * @since S60 v3.2 + */ +NONSHARABLE_CLASS( UT_CMusApplicationManager ) : public CEUnitTestSuiteClass + { +public: + + static UT_CMusApplicationManager* NewL(); + + static UT_CMusApplicationManager* NewLC(); + + /** + * Destructor. + */ + ~UT_CMusApplicationManager(); + +private: + + UT_CMusApplicationManager(); + + void ConstructL(); + + /** + * Sets up a test case. + */ + void SetupL(); + + /** + * Tears down a test case. + */ + void Teardown(); + + /** + * Invidual unit test methods. + */ + void UT_CMusApplicationManager_NewLL(); + void UT_CMusApplicationManager_NewLCL(); + void UT_CMusApplicationManager_ApplicationRunningL(); + void UT_CMusApplicationManager_StartApplicationLL(); + void UT_CMusApplicationManager_StopApplicationLL(); + void UT_CMusApplicationManager_ShowApplicationLL(); + void UT_CMusApplicationManager_WriteSessionPropertiesL(); + void UT_CMusApplicationManager_SetPropertyLL(); + void UT_CMusApplicationManager_SetPropertyL2L(); + void UT_CMusApplicationManager_MapAvailabilitiesL(); + void UT_CMusApplicationManager_SetStatusLL(); + void UT_CMusApplicationManager_CallProviderLL(); + void UT_CMusApplicationManager_ResolvePluginNameLL(); + void UT_CMusApplicationManager_CreateCommandLineArgsLCL(); + +private: // data + + /** + * Instance of tested class. + * Own. + */ + CMusApplicationManager* iManager; + + EUNIT_DECLARE_TEST_TABLE; + + }; + +#endif // UT_CMUSAPPLICATIONMANAGER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagersrv/tsrc/ut_managersrv/inc/ut_cmusavailabilitypluginmanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagersrv/tsrc/ut_managersrv/inc/ut_cmusavailabilitypluginmanager.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,156 @@ +/* +* Copyright (c) 2006-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: Unit tests for CMusAvailabilityManager class. +* +*/ + + +#ifndef UT_CMUSAVAILABILITYPLUGINMANAGER_H +#define UT_CMUSAVAILABILITYPLUGINMANAGER_H + +#include "musavailabilitypluginmanagerobserver.h" +#include +#include + +#pragma warn_illtokenpasting off + +class CMusAvailabilityPluginManager; +class CMusApplicationManager; + +#ifndef NONSHARABLE_CLASS + #define NONSHARABLE_CLASS(x) class x +#endif + +/** + * Unit test class for CMusAvailabilityPluginManager. + * Implements unit tests for CMusAvailabilityPluginManager. + * + * @since S60 v3.2 + */ +NONSHARABLE_CLASS( UT_CMusAvailabilityPluginManager ) + : public CEUnitTestSuiteClass, MMusAvailabilityPluginManagerObserver + { +public: + + static UT_CMusAvailabilityPluginManager* NewL(); + + static UT_CMusAvailabilityPluginManager* NewLC(); + + /** + * Destructor. + */ + ~UT_CMusAvailabilityPluginManager(); + +// from baseclass MMusAvailabilityPluginManagerObserver. + + /** + * From MMusAvailabilityPluginManagerObserver. + * Informs that observed plugin is stopped. + * + * @since S60 v3.2 + */ + virtual void PluginStopped(); + + /** + * From MMusAvailabilityPluginManagerObserver. + * Informs a change in multimedia sharing availability. + * + * @param aAvailability Represents new state of availability. + * @since S60 v3.2 + */ + virtual void AvailabilityChangedL( MultimediaSharing::TMusAvailabilityStatus aAvailability ); + + + /** + * From MMusAvailabilityPluginManagerObserver. + * + * @since S60 v3.2 + */ + virtual void StartSharingWithUseCaseL( MultimediaSharing::TMusUseCase aUseCase ); + +private: + + UT_CMusAvailabilityPluginManager(); + + void ConstructL(); + + /** + * Sets up a test case. + */ + void SetupL(); + + /** + * Tears down a test case. + */ + void Teardown(); + + /** + * Invidual unit test methods. + */ + void UT_CMusAvailabilityPluginManager_NewLL(); + void UT_CMusAvailabilityPluginManager_NewLCL(); + void UT_CMusAvailabilityPluginManager_InvestigateAvailabilityLL(); + void UT_CMusAvailabilityPluginManager_InvitationReceivedLL(); + void UT_CMusAvailabilityPluginManager_OptionsReceivedLL(); + void UT_CMusAvailabilityPluginManager_StopPluginLL(); + void UT_CMusAvailabilityPluginManager_SessionParametersL(); + void UT_CMusAvailabilityPluginManager_OptionAllowedL(); + void UT_CMusAvailabilityPluginManager_ApplicationStateL(); + void UT_CMusAvailabilityPluginManager_AvailabilityL(); + void UT_CMusAvailabilityPluginManager_StartLiveSharingLL(); + void UT_CMusAvailabilityPluginManager_MapAvailabilitiesL(); + void UT_CMusAvailabilityPluginManager_UpdateSessionParametersLL(); + void UT_CMusAvailabilityPluginManager_SipAddressesLCL(); + void UT_CMusAvailabilityPluginManager_TelNumberLCL(); + void UT_CMusAvailabilityPluginManager_ContactNameLCL(); + void UT_CMusAvailabilityPluginManager_IndicateAvailabilityLL(); + void UT_CMusAvailabilityPluginManager_PrepareForReceivedInviteLL(); + +private: // data + + /** + * Instance of tested class. + * Own. + */ + CMusAvailabilityPluginManager* iManager; + + /** + * Tells if observer method + * MMusAvailabilityPluginManagerObserver::AvailabilityChangedL has been + * called. + */ + TBool iCalledAvailabilityChangedL; + + /** + * Tells if observer method + * MMusAvailabilityPluginManagerObserver::PluginStoppedL has been called. + */ + TBool iCalledPluginStoppedL; + + /** + * Tells if observer method + * MMusAvailabilityPluginManagerObserver::StartLiveSharingL has been called. + */ + TBool iCalledAStartLiveSharing; + + /** + * Application manager instance. Owned. + */ + CMusApplicationManager* iAppManager; + + EUNIT_DECLARE_TEST_TABLE; + + }; + +#endif // UT_CMUSAVAILABILITYPLUGINMANAGER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagersrv/tsrc/ut_managersrv/inc/ut_cmusmanagerserverclosetimer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagersrv/tsrc/ut_managersrv/inc/ut_cmusmanagerserverclosetimer.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,87 @@ +/* +* 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: Unit tests for CMusAvailabilityManager class. +* +*/ + + +#ifndef UT_CMUSMANAGERSERVERCLOSETIMER_H +#define UT_CMUSMANAGERSERVERCLOSETIMER_H + +#include + +class CMusManagerServerCloseTimer; + +#include +#ifndef NONSHARABLE_CLASS + #define NONSHARABLE_CLASS(x) class x +#endif + +/** + * Unit test class for CMusManagerServerCloseTimer. + * Implements unit tests for CMusManagerServerCloseTimer. + * + * @since S60 v3.2 + */ +NONSHARABLE_CLASS( UT_CMusManagerServerCloseTimer ) + : public CEUnitTestSuiteClass + { +public: + + static UT_CMusManagerServerCloseTimer* NewL(); + + static UT_CMusManagerServerCloseTimer* NewLC(); + + /** + * Destructor. + */ + ~UT_CMusManagerServerCloseTimer(); + +private: + + UT_CMusManagerServerCloseTimer(); + + void ConstructL(); + + /** + * Sets up a test case. + */ + void SetupL(); + + /** + * Tears down a test case. + */ + void Teardown(); + + /** + * Invidual unit test methods. + */ + void UT_CMusManagerServerCloseTimer_NewLL(); + void UT_CMusManagerServerCloseTimer_NewLCL(); + void UT_CMusManagerServerCloseTimer_StopActiveSchedulerAfterL(); + void UT_CMusManagerServerCloseTimer_DoCancelL(); + +private: // data + + /** + * Instance of tested class. + * Own. + */ + CMusManagerServerCloseTimer* iTimer; + + EUNIT_DECLARE_TEST_TABLE; + + }; + +#endif // UT_CMUSMANAGERSERVERCLOSETIMER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagersrv/tsrc/ut_managersrv/inc/ut_cmusmanagerservercore.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagersrv/tsrc/ut_managersrv/inc/ut_cmusmanagerservercore.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,141 @@ +/* +* 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: Unit tests for CMusManagerServerCore class. +* +*/ + + +#ifndef UT_CMUSMANAGERSERVERCORE_H +#define UT_CMUSMANAGERSERVERCORE_H + +#include "musmanagerservercoreobserver.h" +#include "musMonitorAvailabilityObserver.h" +#include + +class CMusManagerServerCore; + +#include +#ifndef NONSHARABLE_CLASS + #define NONSHARABLE_CLASS(x) class x +#endif + +/** + * Unit test class for CMusManagerServerCore. + * Implements unit tests for CMusManagerServerCore. + * + * @since S60 v3.2 + */ +NONSHARABLE_CLASS( UT_CMusManagerServerCore ) : public CEUnitTestSuiteClass, + MMusMonitorAvailabilityObserver, + MMusManagerServerCoreObserver + { +public: + + static UT_CMusManagerServerCore* NewL(); + + static UT_CMusManagerServerCore* NewLC(); + + /** + * Destructor. + */ + ~UT_CMusManagerServerCore(); + +// from baseclass MMusManagerServerCoreObserver. + + /** + * From MMusManagerServerCoreObserver. + * Stops server. + * + * @since S60 v3.2 + */ + virtual void StopServer(); + + + virtual TUint SessionCount(); + +// from baseclass MMusMonitorAvailabilityObserver. + + /** + * From MMusMonitorAvailabilityObserver. + * Informs of a change in multimediasharing availability. + * + * @since S60 v3.2 + * @param aStatus New state of availability. + */ + virtual void AvailabilityChangedL( MultimediaSharing::TMusAvailabilityStatus aStatus ); + + virtual void RequestComplete(); + +private: + + UT_CMusManagerServerCore(); + + void ConstructL(); + + /** + * Sets up a test case. + */ + void SetupL(); + + /** + * Tears down a test case. + */ + void Teardown(); + + /** + * Invidual unit test methods. + */ + void UT_CMusManagerServerCore_NewLL(); + void UT_CMusManagerServerCore_NewLCL(); + void UT_CMusManagerServerCore_AvailabilityQueryLL(); + void UT_CMusManagerServerCore_InvestigateAvailabilityLL(); + void UT_CMusManagerServerCore_InvitationReceivedLL(); + void UT_CMusManagerServerCore_OptionsReceivedLL(); + void UT_CMusManagerServerCore_StartMultimediaSharingLL(); + void UT_CMusManagerServerCore_StopMultimediaSharingLL(); + void UT_CMusManagerServerCore_EventNoSessionsL(); + void UT_CMusManagerServerCore_PluginStoppedL(); + void UT_CMusManagerServerCore_AvailabilityChangedLL(); + void UT_CMusManagerServerCore_MonitorAvailabilityLL(); + void UT_CMusManagerServerCore_RegisterObserverL(); + void UT_CMusManagerServerCore_IsMusEnginePluginL(); + + +private: // data + + /** + * Tested class. + * Own. + */ + CMusManagerServerCore* iCore; + + /** + * Tells if observer function is called. + */ + TBool iStopServerCalled; + + /** + * Tells if observer function is called. + */ + TBool iAvailabilityChangedLCalled; + + /** + * Stub count of sessions for MMusManagerServerCoreObserver::SessionCount. + */ + TUint iSessionCount; + + EUNIT_DECLARE_TEST_TABLE; + }; + +#endif // UT_CMUSMANAGERSERVERCORE_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagersrv/tsrc/ut_managersrv/inc/ut_cmusmanagerserversession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagersrv/tsrc/ut_managersrv/inc/ut_cmusmanagerserversession.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,145 @@ +/* +* 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: Unit tests for CMusManagerServerSession class. +* +*/ + + +#ifndef UT_CMUSMANAGERSERVERSESSION_H +#define UT_CMUSMANAGERSERVERSESSION_H + +#include "musmanagerserversessionobserver.h" +#include + +class CMusManagerServerSession; +class CMusManagerServer; +class CSession2; +class MMusMonitorAvailabilityObserver; + +#include +#ifndef NONSHARABLE_CLASS + #define NONSHARABLE_CLASS(x) class x +#endif + +/** + * Unit test class for CMusManagerServerSession. + * Implements unit tests for CMusManagerServerSession. + * + * @since S60 v3.2 + */ +NONSHARABLE_CLASS( UT_CMusManagerServerSession ) : public CEUnitTestSuiteClass, + MMusManagerServerSessionObserver + { +public: + + enum TObserved + { + + EAvailabilityQueryL = 1, + ECommandL, + EInvestigateAvailabilityL, + EInvitationReceivedL, + EOptionsReceivedL, + EStartMultimediaSharingL, + EStopMultimediaSharingL, + ERegisterObserverL, + ERemoveObserver, + ECancelMonitoring + }; + + static UT_CMusManagerServerSession* NewL(); + + static UT_CMusManagerServerSession* NewLC(); + + /** + * Destructor. + */ + ~UT_CMusManagerServerSession(); + + +// from baseclass MMusManagerServerSessionObserver. + + MultimediaSharing::TMusAvailabilityStatus AvailabilityQueryL() + { iObserved = EAvailabilityQueryL; + return MultimediaSharing::EMultimediaSharingAvailable; } + + void CommandL( MultimediaSharing::TCommandType /*aCommandType*/ ) + { iObserved = ECommandL; } + + void InvestigateAvailabilityL() + { iObserved = EInvestigateAvailabilityL; } + + void InvitationReceivedL( TUid /*aChannelId*/ ) + { iObserved = EInvitationReceivedL; } + + void OptionsReceivedL( TUid /*aChannelId*/ ) + { iObserved = EOptionsReceivedL; } + + void StartMultimediaSharingL( MultimediaSharing::TMusUseCase /*aUseCase*/ ) + { iObserved = EStartMultimediaSharingL; } + + void StopMultimediaSharingL() + { iObserved = EStopMultimediaSharingL; } + + void RegisterObserverL( MMusMonitorAvailabilityObserver* /*aObserver*/ ) + { iObserved = ERegisterObserverL; } + + void RemoveObserver( MMusMonitorAvailabilityObserver* /*aObserver*/ ) + { iObserved = ERemoveObserver; } + + void CancelMonitoring( MMusMonitorAvailabilityObserver* /*aObserver*/) + { iObserved = ECancelMonitoring; } + + + TObserved iObserved; + +private: + + UT_CMusManagerServerSession(); + + void ConstructL(); + + /** + * Sets up a test case. + */ + void SetupL(); + + /** + * Tears down a test case. + */ + void Teardown(); + + /** + * Invidual unit test methods. + */ + void UT_CMusManagerServerSession_NewLL(); + void UT_CMusManagerServerSession_NewLCL(); + void UT_CMusManagerServerSession_ServiceLL(); + void UT_CMusManagerServerSession_AvailabilityChangedLL(); + +private: // data + + /** + * Tested class. + * Own. + */ + CMusManagerServerSession* iSession; + CSession2* iSession2; + + CMusManagerServer* iServer; + + EUNIT_DECLARE_TEST_TABLE; + }; + +#endif // UT_CMUSMANAGERSERVERSESSION_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagersrv/tsrc/ut_managersrv/src/UT_CMusApplicationManager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagersrv/tsrc/ut_managersrv/src/UT_CMusApplicationManager.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,533 @@ +/* +* 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: Unit tests for CMusApplicationManager class +* +*/ + + +#include "ut_cmusapplicationmanager.h" +#include "musapplicationmanager.h" +#include "musmanagercommon.h" +#include "mussessionproperties.h" +#include "musunittesting.h" +#include "musmanagerservercommon.h" +#include "mussessionproperties.h" +#include "mustesthelp.h" +#include "mussettings.h" +#include "mussesseioninformationapi.h" +#include +#include +#include +#include +#include +#include + + + +// ======== MEMBER FUNCTIONS ======== + + +UT_CMusApplicationManager* UT_CMusApplicationManager::NewL() + { + UT_CMusApplicationManager* self = UT_CMusApplicationManager::NewLC(); + CleanupStack::Pop(); + return self; + } + + +UT_CMusApplicationManager* UT_CMusApplicationManager::NewLC() + { + UT_CMusApplicationManager* self = new( ELeave ) UT_CMusApplicationManager(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +UT_CMusApplicationManager::~UT_CMusApplicationManager() + { + } + + +UT_CMusApplicationManager::UT_CMusApplicationManager() + { + } + + +// --------------------------------------------------------------------------- +// The ConstructL from the base class CEUnitTestSuiteClass must be called. +// It generates the test case table. +// --------------------------------------------------------------------------- +// +void UT_CMusApplicationManager::ConstructL() + { + CEUnitTestSuiteClass::ConstructL(); + } + + +// --------------------------------------------------------------------------- +// Setups a test by instantiating tested class. +// --------------------------------------------------------------------------- +// +void UT_CMusApplicationManager::SetupL() + { + iManager = CMusApplicationManager::NewL(); + } + + +// --------------------------------------------------------------------------- +// Finalizes a by deleting instance of tested class. +// --------------------------------------------------------------------------- +// +void UT_CMusApplicationManager::Teardown() + { + delete iManager; + iManager = NULL; + PropertyHelper::Close(); + Dll::FreeTls(); // Used by the RProcess and TFindProcess stubs + } + + +// ======== TEST METHODS ======== + + +// --------------------------------------------------------------------------- +// Asserts that instantiation is successful. +// --------------------------------------------------------------------------- +// +void UT_CMusApplicationManager::UT_CMusApplicationManager_NewLL() + { + EUNIT_ASSERT( iManager ); + TInt fastMode; + User::LeaveIfError( RProperty::Get( NMusSessionApi::KCategoryUid, + NMusSessionApi::KFastMode, + fastMode ) ); + EUNIT_ASSERT_EQUALS( TInt( MusSettingsKeys::EFastModeOff ), fastMode ); + } + + +// --------------------------------------------------------------------------- +// Asserts that instantiation is successful. +// --------------------------------------------------------------------------- +// +void UT_CMusApplicationManager::UT_CMusApplicationManager_NewLCL() + { + CMusApplicationManager* manager = CMusApplicationManager::NewLC(); + EUNIT_ASSERT( manager ); + CleanupStack::PopAndDestroy( manager ); + } + + +// --------------------------------------------------------------------------- +// Asserts that correct functions from TApaTask are called. +// --------------------------------------------------------------------------- +// +void UT_CMusApplicationManager::UT_CMusApplicationManager_ApplicationRunningL() + { + EUNIT_ASSERT( !iManager->ApplicationRunning() ) + + iManager->StartApplicationL(); + EUNIT_ASSERT( iManager->ApplicationRunning() ) + } + + +// --------------------------------------------------------------------------- +// Else branch of tested method can't be tested since it tries to start real +// application. +// --------------------------------------------------------------------------- +// +void UT_CMusApplicationManager::UT_CMusApplicationManager_StartApplicationLL() + { + EUNIT_ASSERT( !iManager->ApplicationRunning() ) + iManager->StartApplicationL(); + EUNIT_ASSERT_EQUALS( PropertyHelper::GetCalledFunction(), RProperty::EDefine ) + EUNIT_ASSERT( iManager->ApplicationRunning() ) + + iManager->StartApplicationL(); + EUNIT_ASSERT( iManager->ApplicationRunning() ) + } + + +// --------------------------------------------------------------------------- +// Asserts that tested method calls TApaTask::Exists and if task exists it +// should also call TApaTask::KillTask. +// --------------------------------------------------------------------------- +// +void UT_CMusApplicationManager::UT_CMusApplicationManager_StopApplicationLL() + { + // MuS not running + iManager->StopApplicationL(); + + // MuS running + User::LeaveIfError( + Dll::SetTls( reinterpret_cast< TAny* >( 1 ) ) ); + // TLS is used by TFindProcess stub + iManager->StopApplicationL(); + TInt availability = MultimediaSharing::EMultimediaSharingAvailable; + TUint key( NMusSessionApi::KStatus ); + RProperty::Get( key, availability ); + EUNIT_ASSERT_EQUALS( PropertyHelper::GetCalledFunction(), RProperty::EDefine ) + EUNIT_ASSERT_EQUALS( availability, + MultimediaSharing::EMultimediaSharingNotAvailable ) + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void UT_CMusApplicationManager::UT_CMusApplicationManager_ShowApplicationLL() + { + } + + +// --------------------------------------------------------------------------- +// Writes session properties. Asserts that RProperty leaves are passed +// correctly to user. +// --------------------------------------------------------------------------- +// +void UT_CMusApplicationManager::UT_CMusApplicationManager_WriteSessionPropertiesL() + { + CDesCArrayFlat* array = new( ELeave ) CDesCArrayFlat(4); + CleanupStack::PushL( array ); + + array->AppendL( _L( "a" ) ); + array->AppendL( _L( "b" ) ); + array->AppendL( _L( "c" ) ); + array->AppendL( _L( "d" ) ); + array->AppendL( _L( "e" ) ); + array->AppendL( _L( "f" ) ); + array->AppendL( _L( "g" ) ); + array->AppendL( _L( "0" ) ); //EFastModeOn + + iManager->WriteSessionPropertiesL( + MultimediaSharing::EMusLiveVideo, + (MultimediaSharing::TMusAvailabilityStatus) KErrNone, + *array ); + + PropertyHelper::SetErrorCode( KErrGeneral ); + + EUNIT_ASSERT_SPECIFIC_LEAVE( + iManager->WriteSessionPropertiesL( + MultimediaSharing::EMusLiveVideo, + (MultimediaSharing::TMusAvailabilityStatus) KErrNone, + *array ), KErrGeneral ); + + PropertyHelper::SetErrorCode(KErrNone); + + + + MultimediaSharingSettings::iVideoDirection = MusSettingsKeys::ETwoWayVideo; + iManager->WriteSessionPropertiesL( + MultimediaSharing::EMusLiveVideo, + (MultimediaSharing::TMusAvailabilityStatus) KErrNone, + *array ); + + TInt val; + User::LeaveIfError( RProperty::Get( NMusSessionApi::KCategoryUid, + NMusSessionApi::KUseCase, + val ) ); + + MultimediaSharing::TMusUseCase usecase = + static_cast< MultimediaSharing::TMusUseCase >( val ); + + EUNIT_ASSERT( usecase == MultimediaSharing::EMusTwoWayVideo ); + + + //Ensure if fast mode key is "disabled", value from session params + //won't be published + User::LeaveIfError( RProperty::Set( NMusSessionApi::KCategoryUid, + NMusSessionApi::KFastMode, + MusSettingsKeys::EFastModeDisabled ) ); + iManager->WriteSessionPropertiesL( + MultimediaSharing::EMusLiveVideo, + (MultimediaSharing::TMusAvailabilityStatus) KErrNone, + *array ); + User::LeaveIfError( RProperty::Get( NMusSessionApi::KCategoryUid, + NMusSessionApi::KFastMode, + val ) ); + EUNIT_ASSERT_EQUALS( TInt( MusSettingsKeys::EFastModeDisabled ), val ); + + CleanupStack::PopAndDestroy( array ); + } + + +// --------------------------------------------------------------------------- +// Sets a videosharing P/S property. Asserts that RProperty leaves are passed +// correctly to user and RProperty::Define is called. Tests literal +// properties specifically. +// --------------------------------------------------------------------------- +// +void UT_CMusApplicationManager::UT_CMusApplicationManager_SetPropertyLL() + { + _LIT( KTest, "unit_test"); + PropertyHelper::SetErrorCode( KErrNotSupported ); + MUS_EUNIT_ASSERT_SPECIFIC_LEAVE( + iManager->SetPropertyL( 1, KTest ), + KErrNotSupported ); + + EUNIT_ASSERT( PropertyHelper::GetCalledFunction() == RProperty::EDefine ) + + PropertyHelper::SetErrorCode( KErrNone ); + EUNIT_ASSERT_NO_LEAVE( iManager->SetPropertyL( 1, KTest ) ); + } + + +// --------------------------------------------------------------------------- +// Sets a videosharing P/S property. Asserts that RProperty leaves are passed +// correctly to user and RProperty::Define is called. Tests integral +// properties specifically. +// --------------------------------------------------------------------------- +// +void UT_CMusApplicationManager::UT_CMusApplicationManager_SetPropertyL2L() + { + PropertyHelper::SetErrorCode( KErrNotSupported ); + MUS_EUNIT_ASSERT_SPECIFIC_LEAVE( + iManager->SetPropertyL( 1, 1 ), + KErrNotSupported ); + + EUNIT_ASSERT( PropertyHelper::GetCalledFunction() == RProperty::EDefine ) + + PropertyHelper::SetErrorCode(KErrNone); + MUS_EUNIT_ASSERT_NO_LEAVE( iManager->SetPropertyL( 1, 1 ) ); + } + + +// --------------------------------------------------------------------------- +// Sets a videosharing status. Asserts that RProperty leaves are passed +// correctly to user and RProperty::Define is called. +// --------------------------------------------------------------------------- +// +void UT_CMusApplicationManager::UT_CMusApplicationManager_SetStatusLL() + { + PropertyHelper::SetErrorCode( KErrGeneral ); + MUS_EUNIT_ASSERT_SPECIFIC_LEAVE( iManager->SetStatusL( + MultimediaSharing::EMultimediaSharingNotAvailable ), KErrGeneral ); + + EUNIT_ASSERT( PropertyHelper::GetCalledFunction() == RProperty::EDefine ); + + PropertyHelper::SetErrorCode(KErrNone); + MUS_EUNIT_ASSERT_NO_LEAVE( iManager->SetStatusL( + MultimediaSharing::EMultimediaSharingAvailable ) ); + } + + +// --------------------------------------------------------------------------- +// CallProviderL Test +// --------------------------------------------------------------------------- +// +void UT_CMusApplicationManager::UT_CMusApplicationManager_CallProviderLL() + { + TInt error = KErrNone; + + // Use Publish & Subscribe Keys to set CallProvider Name + _LIT( KProviderName1, "MultimediaSharing"); + _LIT8( KProviderNameTest1, "MultimediaSharing"); + + _LIT( KProviderNameEmpty1, ""); + _LIT8( KProviderNameEmptyTest1, ""); + + + // Valid Test: + TRAP( error, RProperty::Set( + NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMUSCallProvider, + KProviderName1 )); + + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT ( error == KErrNone ); + + TBuf8 providerName ; + iManager->CallProviderL( providerName ); + + EUNIT_ASSERT( providerName == KProviderNameTest1 ); + + + //Empty Test + TRAP( error, RProperty::Set( + NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMUSCallProvider, + KProviderNameEmpty1 )); + + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT ( error == KErrNone ); + + iManager->CallProviderL( providerName ); + + EUNIT_ASSERT( providerName == KProviderNameEmptyTest1 ); + } + + +// --------------------------------------------------------------------------- +// ResolvePluginName Test +// --------------------------------------------------------------------------- +// +void UT_CMusApplicationManager::UT_CMusApplicationManager_ResolvePluginNameLL() + { + // Default Engine Name to be returned + TInt error = KErrNone; + _LIT( KEngineName, "MultimediaSharing"); + _LIT8( KEngineTestName, "MultimediaSharing"); + + // Test String for the Publish/Subscribe Keys. + _LIT( KProviderName, "MultimediaSharing"); + _LIT( KProviderName1, "CS"); + + TBuf8 engineName ; + + // Use Publish & Subscribe Keys to set Engine Name as + // 1. MultimediaSharing [Exact Name] + // 2. CS [No Match Found, Default MultiMediaSharing will be picked] + + // 1. MultimediaSharing [Exact Name] + + TRAP( error, RProperty::Set( + NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMUSCallProvider, + KProviderName )); + + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT ( error == KErrNone ); + + iManager->ResolvePluginNameL( engineName ); + EUNIT_ASSERT( engineName == KEngineTestName ); + + // 2. CS [No Match Found, Default MultiMediaSharing will be picked] + TRAP( error, RProperty::Set( + NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMUSCallProvider, + KProviderName1 )); + + if ( error == KErrNoMemory ) User::Leave( error ); + EUNIT_ASSERT ( error == KErrNone ); + + iManager->ResolvePluginNameL( engineName ); + EUNIT_ASSERT( engineName == KEngineTestName ); + } + +// --------------------------------------------------------------------------- +// Command line arg test +// --------------------------------------------------------------------------- +// +void UT_CMusApplicationManager::UT_CMusApplicationManager_CreateCommandLineArgsLCL() + { + _LIT( KEnginePluginName, "MultimediaSharing" ); + HBufC* cmdLineArgs = iManager->CreateCommandLineArgsLC(); + + EUNIT_ASSERT( cmdLineArgs != NULL ) + EUNIT_ASSERT_EQUALS( KEnginePluginName(), *cmdLineArgs ) + + CleanupStack::PopAndDestroy( cmdLineArgs ); + } + +// ======== EUNIT TEST TABLE ======== + + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusApplicationManager, + "CMusApplicationManager", + "UNIT" ) + +EUNIT_TEST( + "NewL - test ", + "CMusApplicationManager", + "NewL", + "FUNCTIONALITY", + SetupL, UT_CMusApplicationManager_NewLL, Teardown ) + +EUNIT_TEST( + "NewLC - test ", + "CMusApplicationManager", + "NewLC", + "FUNCTIONALITY", + SetupL, UT_CMusApplicationManager_NewLCL, Teardown ) + +EUNIT_TEST( + "ApplicationRunning - test ", + "CMusApplicationManager", + "ApplicationRunning", + "FUNCTIONALITY", + SetupL, UT_CMusApplicationManager_ApplicationRunningL, Teardown ) + +EUNIT_TEST( + "StartApplicationL - test ", + "CMusApplicationManager", + "StartApplicationL", + "FUNCTIONALITY", + SetupL, UT_CMusApplicationManager_StartApplicationLL, Teardown ) + +EUNIT_TEST( + "StopApplicationL - test ", + "CMusApplicationManager", + "StopApplicationL", + "FUNCTIONALITY", + SetupL, UT_CMusApplicationManager_StopApplicationLL, Teardown ) + +EUNIT_TEST( + "ShowApplicationL - test ", + "CMusApplicationManager", + "ShowApplicationL", + "FUNCTIONALITY", + SetupL, UT_CMusApplicationManager_ShowApplicationLL, Teardown ) + +EUNIT_TEST( + "WriteSessionProperties - test ", + "CMusApplicationManager", + "WriteSessionProperties", + "FUNCTIONALITY", + SetupL, UT_CMusApplicationManager_WriteSessionPropertiesL, Teardown ) + +EUNIT_TEST( + "SetPropertyL (string) - test ", + "CMusApplicationManager", + "SetPropertyL", + "FUNCTIONALITY", + SetupL, UT_CMusApplicationManager_SetPropertyLL, Teardown ) + +EUNIT_TEST( + "SetPropertyL (integer) - test ", + "CMusApplicationManager", + "SetPropertyL", + "FUNCTIONALITY", + SetupL, UT_CMusApplicationManager_SetPropertyL2L, Teardown ) + +EUNIT_TEST( + "SetStatusL - test ", + "CMusApplicationManager", + "SetStatusL", + "FUNCTIONALITY", + SetupL, UT_CMusApplicationManager_SetStatusLL, Teardown ) + +EUNIT_TEST( + "CallProviderL - test ", + "CMusApplicationManager", + "CallProviderL", + "FUNCTIONALITY", + SetupL, UT_CMusApplicationManager_CallProviderLL, Teardown ) + +EUNIT_TEST( + "ResolvePluginNameL - test ", + "CMusApplicationManager", + "ResolvePluginNameL", + "FUNCTIONALITY", + SetupL, UT_CMusApplicationManager_ResolvePluginNameLL, Teardown ) + +EUNIT_TEST( + "CreateCommandLineLC - test ", + "CMusApplicationManager", + "CreateCommandLineLC", + "FUNCTIONALITY", + SetupL, UT_CMusApplicationManager_CreateCommandLineArgsLCL, Teardown ) + +EUNIT_END_TEST_TABLE diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagersrv/tsrc/ut_managersrv/src/UT_CMusManagerServerCloseTimer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagersrv/tsrc/ut_managersrv/src/UT_CMusManagerServerCloseTimer.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,166 @@ +/* +* 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: Unit tests for CMusManagerServerCloseTimer class. +* +*/ + + +#include "UT_CMusManagerServerCloseTimer.h" +#include "musmanagerserverclosetimer.h" +#include + + +// ======== MEMBER FUNCTIONS ======== + + +UT_CMusManagerServerCloseTimer* UT_CMusManagerServerCloseTimer::NewL() + { + UT_CMusManagerServerCloseTimer* self = UT_CMusManagerServerCloseTimer::NewLC(); + CleanupStack::Pop(); + return self; + } + + +UT_CMusManagerServerCloseTimer* UT_CMusManagerServerCloseTimer::NewLC() + { + UT_CMusManagerServerCloseTimer* self = new( ELeave ) UT_CMusManagerServerCloseTimer(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +UT_CMusManagerServerCloseTimer::~UT_CMusManagerServerCloseTimer() + { + } + + +UT_CMusManagerServerCloseTimer::UT_CMusManagerServerCloseTimer() + { + } + + +// --------------------------------------------------------------------------- +// The ConstructL from the base class CEUnitTestSuiteClass must be called. +// It generates the test case table. +// --------------------------------------------------------------------------- +// +void UT_CMusManagerServerCloseTimer::ConstructL() + { + CEUnitTestSuiteClass::ConstructL(); + } + + +// --------------------------------------------------------------------------- +// Setups a test by instantiating tested class. +// --------------------------------------------------------------------------- +// +void UT_CMusManagerServerCloseTimer::SetupL( ) + { + iTimer = CMusManagerServerCloseTimer::NewL(); + } + + +// --------------------------------------------------------------------------- +// Finalizes a test by deleting instance of tested class. +// --------------------------------------------------------------------------- +// +void UT_CMusManagerServerCloseTimer::Teardown( ) + { + delete iTimer; + iTimer = NULL; + } + + +// ======== TEST METHODS ======== + + +// --------------------------------------------------------------------------- +// Asserts a successful instantiation. +// --------------------------------------------------------------------------- +// +void UT_CMusManagerServerCloseTimer::UT_CMusManagerServerCloseTimer_NewLL( ) + { + EUNIT_ASSERT( iTimer ); + } + + +// --------------------------------------------------------------------------- +// Asserts a successful instantiation. +// --------------------------------------------------------------------------- +// +void UT_CMusManagerServerCloseTimer::UT_CMusManagerServerCloseTimer_NewLCL( ) + { + delete iTimer; + iTimer = NULL; + iTimer = CMusManagerServerCloseTimer::NewLC(); + CleanupStack::Pop( iTimer ); + EUNIT_ASSERT( iTimer ); + } + + +void UT_CMusManagerServerCloseTimer::UT_CMusManagerServerCloseTimer_StopActiveSchedulerAfterL( ) + { + iTimer->StopActiveSchedulerAfter( 1000000 ); + iTimer->Cancel(); + EUNIT_ASSERT( !iTimer->IsActive() ); + } + + +void UT_CMusManagerServerCloseTimer::UT_CMusManagerServerCloseTimer_DoCancelL( ) + { + iTimer->StopActiveSchedulerAfter( 1000000 ); + iTimer->Cancel(); + EUNIT_ASSERT( !iTimer->IsActive() ); + } + + +// ======== EUNIT TEST TABLE ======== + + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusManagerServerCloseTimer, + "CMusManagerServerCloseTimer", + "UNIT" ) + +EUNIT_TEST( + "NewL - test ", + "CMusManagerServerCloseTimer", + "NewL", + "FUNCTIONALITY", + SetupL, UT_CMusManagerServerCloseTimer_NewLL, Teardown ) + +EUNIT_TEST( + "NewLC - test ", + "CMusManagerServerCloseTimer", + "NewLC", + "FUNCTIONALITY", + SetupL, UT_CMusManagerServerCloseTimer_NewLCL, Teardown ) + +EUNIT_TEST( + "StopActiveSchedulerAfter - test ", + "CMusManagerServerCloseTimer", + "StopActiveSchedulerAfter", + "FUNCTIONALITY", + SetupL, UT_CMusManagerServerCloseTimer_StopActiveSchedulerAfterL, Teardown ) + +EUNIT_TEST( + "DoCancel - test ", + "CMusManagerServerCloseTimer", + "DoCancel", + "FUNCTIONALITY", + SetupL, UT_CMusManagerServerCloseTimer_DoCancelL, Teardown ) + + +EUNIT_END_TEST_TABLE diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagersrv/tsrc/ut_managersrv/src/UT_CMusManagerServerCore.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagersrv/tsrc/ut_managersrv/src/UT_CMusManagerServerCore.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,512 @@ +/* +* 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: Unit tests for CMusAvailabilityPluginManager class +* +*/ + + +#include "UT_CMusManagerServerCore.h" +#include "musunittesting.h" +#include "musmanagerservercore.h" +#include "musavailabilitypluginmanager.h" +#include "musavaavailability.h" +#include "musavaavailabilitystub.h" +#include "musavainterface.h" +#include "cmusavainterfacestub.h" +#include "mussessionproperties.h" +#include "mustesthelp.h" +#include +#include +#include + +_LIT8( KMusEngineName, "MultimediaSharing" ); +_LIT8( KAnotherEngineName, "AnotherEngine" ); + +// ======== MEMBER FUNCTIONS ======== + + +UT_CMusManagerServerCore* UT_CMusManagerServerCore::NewL() + { + UT_CMusManagerServerCore* self = UT_CMusManagerServerCore::NewLC(); + CleanupStack::Pop(); + return self; + } + + +UT_CMusManagerServerCore* UT_CMusManagerServerCore::NewLC() + { + UT_CMusManagerServerCore* self = new( ELeave ) UT_CMusManagerServerCore(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +UT_CMusManagerServerCore::~UT_CMusManagerServerCore() + { + } + + +UT_CMusManagerServerCore::UT_CMusManagerServerCore() + { + } + + +// --------------------------------------------------------------------------- +// The ConstructL from the base class CEUnitTestSuiteClass must be called. +// It generates the test case table. +// --------------------------------------------------------------------------- +// +void UT_CMusManagerServerCore::ConstructL() + { + CEUnitTestSuiteClass::ConstructL(); + } + + +// --------------------------------------------------------------------------- +// From MMusManagerServerCoreObserver. +// Stops server. +// --------------------------------------------------------------------------- +// +void UT_CMusManagerServerCore::StopServer() + { + iStopServerCalled = ETrue; + } + + +// --------------------------------------------------------------------------- +// From MMusManagerServerCoreObserver. +// Returns count of sessions. +// --------------------------------------------------------------------------- +// +TUint UT_CMusManagerServerCore::SessionCount() + { + return iSessionCount; + } + + +// --------------------------------------------------------------------------- +// From MMusMonitorAvailabilityObserver. +// Informs of a change in multimediasharing availability. +// --------------------------------------------------------------------------- +// +void UT_CMusManagerServerCore::AvailabilityChangedL( + MultimediaSharing::TMusAvailabilityStatus /*aStatus*/ ) + { + iAvailabilityChangedLCalled = ETrue; + } + +void UT_CMusManagerServerCore::RequestComplete() + { + + } +// --------------------------------------------------------------------------- +// Setups the test by instantiating tested class. +// --------------------------------------------------------------------------- +// +void UT_CMusManagerServerCore::SetupL() + { + iCore = CMusManagerServerCore::NewL( *this ); + iStopServerCalled = EFalse; + iAvailabilityChangedLCalled = EFalse; + iSessionCount = 0; + } + + +// --------------------------------------------------------------------------- +// Finalizes test by deleting instance of tested class. +// --------------------------------------------------------------------------- +// +void UT_CMusManagerServerCore::Teardown() + { + delete iCore; + PropertyHelper::Close(); + Dll::FreeTls(); // Used by the RProcess and TFindProcess stubs + } + + +// ======== TEST METHODS ======== + + +// --------------------------------------------------------------------------- +// Asserts that instance creation is successful. +// --------------------------------------------------------------------------- +// +void UT_CMusManagerServerCore::UT_CMusManagerServerCore_NewLL() + { + EUNIT_ASSERT( iCore ); + } + + +// --------------------------------------------------------------------------- +// Asserts that instance creation is successful. +// --------------------------------------------------------------------------- +// +void UT_CMusManagerServerCore::UT_CMusManagerServerCore_NewLCL() + { + delete iCore; + iCore = NULL; + iCore = CMusManagerServerCore::NewLC( *this ); + EUNIT_ASSERT( iCore ); + CleanupStack::Pop( iCore ); + } + + +// --------------------------------------------------------------------------- +// Availability query should return MMusAvaObserver::EMusAvaStatusNotAvailable +// when videosharing is not yet available. +// --------------------------------------------------------------------------- +// +void UT_CMusManagerServerCore::UT_CMusManagerServerCore_AvailabilityQueryLL() + { + EUNIT_ASSERT( iCore->AvailabilityQueryL() + == MultimediaSharing::EMultimediaSharingNotAvailable ); + } + + +// --------------------------------------------------------------------------- +// Dummy test to increase execution coverage. +// --------------------------------------------------------------------------- +// +void UT_CMusManagerServerCore:: + UT_CMusManagerServerCore_InvestigateAvailabilityLL() + { + iCore->InvestigateAvailabilityL(); + } + + +// --------------------------------------------------------------------------- +// Asserts that invitation with inappropriate UID should leave. +// --------------------------------------------------------------------------- +// +void UT_CMusManagerServerCore::UT_CMusManagerServerCore_InvitationReceivedLL() + { + // 1. The cases with MuS engine + iCore->iPluginName = KMusEngineName; + + TUid uid = { 0x10101010 }; // Not a valid UID in musmanager.h + // since used UID is not in appropriate, this should leave + EUNIT_ASSERT_SPECIFIC_LEAVE( + iCore->InvitationReceivedL( uid ), KErrNotReady ); + + uid.iUid = 0x1028238D; // ESipInviteNotDesired from musmanager.h + iCore->InvitationReceivedL( uid ); + + uid.iUid = 0x10282391; // ESipInviteDesired from musmanager.h + EUNIT_ASSERT_SPECIFIC_LEAVE( + iCore->InvitationReceivedL( uid ), KErrNotReady ); + + // 2. The cases with non-MuS engine + iCore->iPluginName = KAnotherEngineName; + + uid.iUid = 0x10101010; // Not a valid UID in musmanager.h + iCore->InvitationReceivedL( uid ); + + uid.iUid = 0x1028238D; // ESipInviteNotDesired from musmanager.h + iCore->InvitationReceivedL( uid ); + + uid.iUid = 0x10282391; // ESipInviteDesired from musmanager.h + iCore->InvitationReceivedL( uid ); + } + + +// --------------------------------------------------------------------------- +// Dummy test to increase execution coverage. +// --------------------------------------------------------------------------- +// +void UT_CMusManagerServerCore::UT_CMusManagerServerCore_OptionsReceivedLL() + { + TUid uid = { 0x10101010 }; + iCore->iPluginName = KMusEngineName; + iCore->iPluginManager->iPluginStarted = EFalse; + iCore->OptionsReceivedL( uid ); + EUNIT_ASSERT( iCore->iPluginManager->iPluginStarted ); + + iCore->iPluginName = KAnotherEngineName; + iCore->iPluginManager->iPluginStarted = EFalse; + iCore->OptionsReceivedL( uid ); + EUNIT_ASSERT ( !(iCore->iPluginManager->iPluginStarted) ); + } + + +// --------------------------------------------------------------------------- +// Asserts that tested method does not leave. In certain case it could leave +// with KErrPermissionDenied, but with this this test, used capabilities +// and used stubs, tested method shouldn't leave. +// --------------------------------------------------------------------------- +// +void UT_CMusManagerServerCore:: + UT_CMusManagerServerCore_StartMultimediaSharingLL() + { + CMusAvaInterface* interface = iCore->iPluginManager->iPlugin; + CMusAvaInterface2* interface2 = static_cast( interface ); + CMusAvaAvailabilityStub* abilityStub = + static_cast( interface2->iAvailabilities[0] ); + // ----------------------------------------------------------------------- + // Dummy test that shouldn't leave -> + // ----------------------------------------------------------------------- + MUS_EUNIT_ASSERT_NO_LEAVE( + iCore->StartMultimediaSharingL( MultimediaSharing::EMusLiveVideo ) ); + // <- Dummy test that shouldn't leave + + // ----------------------------------------------------------------------- + // Test for "if( !iApplicationManager->ApplicationRunning() && + // iPluginManager->ApplicationAllowed() ) branch -> + // ----------------------------------------------------------------------- + // CMusAvailabilityPluginManager::ApplicationAllowed = ETrue + abilityStub->iNameStub = MMusAvaObserver::EMusAvaNameRegistration; + abilityStub->iStatusStub = MMusAvaObserver::EMusAvaStatusAvailable; + interface2->iCurrentAvailability =MMusAvaObserver::EMusAvaOptionHandler; + + PropertyHelper::SetErrorCode(KErrGeneral); + + // Should leave in WriteSessionPropertiesL + MUS_EUNIT_ASSERT_SPECIFIC_LEAVE( + iCore->StartMultimediaSharingL( MultimediaSharing::EMusLiveVideo ), + KErrGeneral ); + + PropertyHelper::SetErrorCode(KErrNone); + + // Should go all the way to StartApplicationL + MUS_EUNIT_ASSERT_NO_LEAVE( + iCore->StartMultimediaSharingL( MultimediaSharing::EMusLiveVideo ) ); + EUNIT_ASSERT( PropertyHelper::GetCalledFunction() == RProperty::EDefine ); + + // <- Test for "if( !iApplicationManager->ApplicationRunning() && + // iPluginManager->ApplicationAllowed() ) branch + + // ----------------------------------------------------------------------- + // Test for else branch -> + // ----------------------------------------------------------------------- + + // CMusAvailabilityPluginManager::ApplicationAllowed = EFalse + abilityStub->iNameStub = MMusAvaObserver::EMusAvaNameRegistration; + abilityStub->iStatusStub = MMusAvaObserver::EMusAvaStatusNotExecuted; + interface2->iCurrentAvailability =MMusAvaObserver::EMusAvaNameRegistration; + + + // CMusApplicationManager::ApplicationRunning = EFalse + MUS_EUNIT_ASSERT_NO_LEAVE( + iCore->StartMultimediaSharingL( MultimediaSharing::EMusLiveVideo ) ); + } + + +// --------------------------------------------------------------------------- +// Asserts that tested method checks if task exists and calls +// TApaTask::KillTask if task exists. +// --------------------------------------------------------------------------- +// +void UT_CMusManagerServerCore:: + UT_CMusManagerServerCore_StopMultimediaSharingLL() + { + // MuS not running + iCore->StopMultimediaSharingL(); + + // MuS running + User::LeaveIfError( + Dll::SetTls( reinterpret_cast< TAny* >( 1 ) ) ); + // TLS is used by TFindProcess stub + iCore->StopMultimediaSharingL(); + TInt availability = MultimediaSharing::EMultimediaSharingAvailable; + TUint key( NMusSessionApi::KStatus ); + RProperty::Get( key, availability ); + EUNIT_ASSERT_EQUALS( PropertyHelper::GetCalledFunction(), RProperty::EDefine ) + EUNIT_ASSERT_EQUALS( availability, + MultimediaSharing::EMultimediaSharingNotAvailable ) + } + + +// --------------------------------------------------------------------------- +// Asserts that observer method MMusManagerServerCoreObserver::StopServer is +// called. +// --------------------------------------------------------------------------- +// +void UT_CMusManagerServerCore::UT_CMusManagerServerCore_EventNoSessionsL() + { + iCore->iPluginName = KMusEngineName; + iCore->iPluginManager->iPluginStarted = ETrue; + iCore->EventNoSessions(); + EUNIT_ASSERT ( !(iCore->iPluginManager->iPluginStarted) ); + EUNIT_ASSERT( iStopServerCalled ); + + iCore->iPluginName = KAnotherEngineName; + iCore->iPluginManager->iPluginStarted = ETrue; + iCore->EventNoSessions(); + EUNIT_ASSERT ( iCore->iPluginManager->iPluginStarted ); + EUNIT_ASSERT( iStopServerCalled ); + } + + +// --------------------------------------------------------------------------- +// Asserts that MMusManagerServerCoreObserver::StopServer is called when it +// should. +// --------------------------------------------------------------------------- +// +void UT_CMusManagerServerCore::UT_CMusManagerServerCore_PluginStoppedL() + { + // Should not call iStopServer when sessions still exists. + iSessionCount = 1; + iCore->PluginStopped(); + EUNIT_ASSERT( !iStopServerCalled ); + + // Should call iStopServer when sessioncount = 0. + iSessionCount = 0; + iCore->PluginStopped(); + EUNIT_ASSERT( iStopServerCalled ); + } + + +// --------------------------------------------------------------------------- +// Asserts that KErrNone should be returned. +// --------------------------------------------------------------------------- +// +void UT_CMusManagerServerCore:: + UT_CMusManagerServerCore_AvailabilityChangedLL() + { + iCore->iPluginName = KMusEngineName; + MUS_EUNIT_ASSERT_NO_LEAVE( iCore->AvailabilityChangedL( + (MultimediaSharing::TMusAvailabilityStatus) KErrNone ) ); + EUNIT_ASSERT( iCore->iAvailabilityMonitors.Count() == 0 ); + + iCore->iPluginName = KAnotherEngineName; + MUS_EUNIT_ASSERT_NO_LEAVE( iCore->AvailabilityChangedL( + (MultimediaSharing::TMusAvailabilityStatus) KErrNone ) ); + EUNIT_ASSERT( iCore->iAvailabilityMonitors.Count() == 0 ); + } + + +// --------------------------------------------------------------------------- +// Asserts that called method removes *this* monitor. +// --------------------------------------------------------------------------- +// +void UT_CMusManagerServerCore::UT_CMusManagerServerCore_RegisterObserverL() + { + TInt monitors = iCore->iAvailabilityMonitors.Count(); + iCore->RegisterObserverL( this ); + EUNIT_ASSERT( iCore->iAvailabilityMonitors.Count() == monitors + 1 ); + iCore->RemoveObserver( this ); + EUNIT_ASSERT( iCore->iAvailabilityMonitors.Count() == monitors ); + } + +void UT_CMusManagerServerCore::UT_CMusManagerServerCore_IsMusEnginePluginL() + { + iCore->iPluginName = KMusEngineName; + EUNIT_ASSERT( iCore->IsMusEnginePlugin() ); + + iCore->iPluginName = KAnotherEngineName; + EUNIT_ASSERT( !(iCore->IsMusEnginePlugin()) ); + } + + +// ======== EUNIT TEST TABLE ======== + + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusManagerServerCore, + "CMusManagerServerCore", + "UNIT" ) + +EUNIT_TEST( + "NewL - test ", + "CMusManagerServerCore", + "NewL", + "FUNCTIONALITY", + SetupL, UT_CMusManagerServerCore_NewLL, Teardown) + +EUNIT_TEST( + "NewLC - test ", + "CMusManagerServerCore", + "NewLC", + "FUNCTIONALITY", + SetupL, UT_CMusManagerServerCore_NewLCL, Teardown) + + +EUNIT_TEST( + "RegisterObserver - test ", + "CMusManagerServerCore", + "RegisterObserver", + "FUNCTIONALITY", + SetupL, UT_CMusManagerServerCore_RegisterObserverL, Teardown) + +EUNIT_TEST( + "AvailabilityQueryL - test ", + "CMusManagerServerCore", + "AvailabilityQueryL", + "FUNCTIONALITY", + SetupL, UT_CMusManagerServerCore_AvailabilityQueryLL, Teardown) + +EUNIT_TEST( + "InvestigateAvailabilityL - test ", + "CMusManagerServerCore", + "InvestigateAvailabilityL", + "FUNCTIONALITY", + SetupL, UT_CMusManagerServerCore_InvestigateAvailabilityLL, Teardown) + +EUNIT_TEST( + "InvitationReceivedL - test ", + "CMusManagerServerCore", + "InvitationReceivedL", + "FUNCTIONALITY", + SetupL, UT_CMusManagerServerCore_InvitationReceivedLL, Teardown) + +EUNIT_TEST( + "OptionsReceivedL - test ", + "CMusManagerServerCore", + "OptionsReceivedL", + "FUNCTIONALITY", + SetupL, UT_CMusManagerServerCore_OptionsReceivedLL, Teardown) + +EUNIT_TEST( + "StartMultimediaSharingL - test ", + "CMusManagerServerCore", + "StartMultimediaSharingL", + "FUNCTIONALITY", + SetupL, UT_CMusManagerServerCore_StartMultimediaSharingLL, Teardown) + +EUNIT_TEST( + "StopMultimediaSharingL - test ", + "CMusManagerServerCore", + "StopMultimediaSharingL", + "FUNCTIONALITY", + SetupL, UT_CMusManagerServerCore_StopMultimediaSharingLL, Teardown) + +EUNIT_TEST( + "EventNoSessions - test ", + "CMusManagerServerCore", + "EventNoSessions", + "FUNCTIONALITY", + SetupL, UT_CMusManagerServerCore_EventNoSessionsL, Teardown) + +EUNIT_TEST( + "PluginStopped - test ", + "CMusManagerServerCore", + "PluginStopped", + "FUNCTIONALITY", + SetupL, UT_CMusManagerServerCore_PluginStoppedL, Teardown) + +EUNIT_TEST( + "AvailabilityChangedL - test ", + "CMusManagerServerCore", + "AvailabilityChangedL", + "FUNCTIONALITY", + SetupL, UT_CMusManagerServerCore_AvailabilityChangedLL, Teardown) + +EUNIT_TEST( + "IsMusEnginePlugin - test ", + "CMusManagerServerCore", + "IsMusEnginePlugin", + "FUNCTIONALITY", + SetupL, UT_CMusManagerServerCore_IsMusEnginePluginL, Teardown) + +EUNIT_END_TEST_TABLE diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagersrv/tsrc/ut_managersrv/src/UT_CMusManagerServerSession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagersrv/tsrc/ut_managersrv/src/UT_CMusManagerServerSession.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,326 @@ +/* +* 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: Unit tests for CMusAvailabilityPluginManager class +* +*/ + + +#include "UT_CMusManagerServerSession.h" +#include "musunittesting.h" +#include "musmanagerserversession.h" +#include "musmanagerserver.h" +#include "musmanageripccommon.h" + +/* +#include "musavaavailability.h" +#include "musavaavailabilitystub.h" +#include "musavainterface.h" +#include "cmusavainterfacestub.h" +#include "mussessionproperties.h" +*/ + +#include "mustesthelp.h" +#include +#include +#include + + +void CActiveScheduler::Install(CActiveScheduler* /*aScheduler*/) + { + } + +void RMessagePtr2::Complete(TInt /*aReason*/) const + { + } + +void RMessagePtr2::ReadL(TInt /*aParam*/,TDes8& aDes,TInt /*aOffset*/) const + { + TUint32 val = 0; + TPckgBuf valPckg( val ); + aDes.Copy( valPckg ); + } + + +void RMessagePtr2::WriteL(TInt /*aParam*/,const TDesC8& /*aDes*/,TInt /*aOffset*/) const + { + + } + +TInt RMessagePtr2::GetDesMaxLength(TInt /*aParam*/) const + { + return 256; + } + +class RMessage2Test : public RMessage2 + { + public: + inline RMessage2Test( TInt aFunction ); + inline void SetHandle( TInt aHandle ); + }; + + +inline RMessage2Test::RMessage2Test( TInt aFunction ) + : RMessage2() + { + iFunction = aFunction; + } + + +inline void RMessage2Test::SetHandle( TInt aHandle ) + { + iHandle = aHandle; + } + +TInt RMessagePtr2::Client(RThread& /*aClient*/, TOwnerType /*aOwnerType*/) const + { + return KErrNone; + } + +void RThread::RequestComplete(TRequestStatus*& /*aStatus*/,TInt /*aReason*/) const + { + } + +void CServer2::ReStart() + { + } + +// ======== MEMBER FUNCTIONS ======== + + +UT_CMusManagerServerSession* UT_CMusManagerServerSession::NewL() + { + UT_CMusManagerServerSession* self = UT_CMusManagerServerSession::NewLC(); + CleanupStack::Pop(); + return self; + } + + +UT_CMusManagerServerSession* UT_CMusManagerServerSession::NewLC() + { + UT_CMusManagerServerSession* self = new( ELeave ) UT_CMusManagerServerSession(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +UT_CMusManagerServerSession::~UT_CMusManagerServerSession() + { + } + + +UT_CMusManagerServerSession::UT_CMusManagerServerSession() + { + } + + +// --------------------------------------------------------------------------- +// The ConstructL from the base class CEUnitTestSuiteClass must be called. +// It generates the test case table. +// --------------------------------------------------------------------------- +// +void UT_CMusManagerServerSession::ConstructL() + { + CEUnitTestSuiteClass::ConstructL(); + } + + + + +// --------------------------------------------------------------------------- +// Setups the test by instantiating tested class. +// --------------------------------------------------------------------------- +// +void UT_CMusManagerServerSession::SetupL() + { + iServer = CMusManagerServer::NewL(); + iSession = CMusManagerServerSession::NewL(*iServer, *this ); + + TVersion version; + RMessage2 message; + iSession2 = iServer->NewSessionL( version, message ); + iObserved = (TObserved)0; + } + + +// --------------------------------------------------------------------------- +// Finalizes test by deleting instance of tested class. +// --------------------------------------------------------------------------- +// +void UT_CMusManagerServerSession::Teardown() + { + delete iSession; + delete iSession2; + iServer->RunError( KErrNone ); + delete iServer; + PropertyHelper::Close(); + + } + + +// ======== TEST METHODS ======== + + +// --------------------------------------------------------------------------- +// Asserts that instance creation is successful. +// --------------------------------------------------------------------------- +// +void UT_CMusManagerServerSession::UT_CMusManagerServerSession_NewLL() + { + EUNIT_ASSERT( iSession ); + } + + +// --------------------------------------------------------------------------- +// Asserts that instance creation is successful. +// --------------------------------------------------------------------------- +// +void UT_CMusManagerServerSession::UT_CMusManagerServerSession_NewLCL() + { + delete iSession; + iSession = NULL; + iSession = CMusManagerServerSession::NewLC( *iServer, *this ); + EUNIT_ASSERT( iSession ); + CleanupStack::Pop( iSession ); + } + + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void UT_CMusManagerServerSession:: + UT_CMusManagerServerSession_ServiceLL() + { + RMessage2Test msg1( EMusManagerIpcAvailabilityQuery ); + RMessage2Test msg2( EMusManagerIpcInvestigateAvailability ); + RMessage2Test msg3( EMusManagerIpcInvitationReceived ); + RMessage2Test msg4( EMusManagerIpcOptionsReceived ); + RMessage2Test msg5( EMusManagerIpcStartMultimediaSharing ); + RMessage2Test msg6( EMusManagerIpcStopMultimediaSharing ); + RMessage2Test msg6_1( EMusManagerIpcStartObservingAvailability ); + RMessage2Test msg7( EMusManagerIpcMonitorAvailability ); + RMessage2Test msg8( EMusManagerIpcCancelMonitoring ); + RMessage2Test msg9( EMusManagerIpcHandleCommand ); + + + iSession->ServiceL( msg7 ); + EUNIT_ASSERT( iObserved == (TObserved)0 ); + iObserved = (TObserved)0; + iSession->ServiceL( msg1 ); + EUNIT_ASSERT( iObserved == EAvailabilityQueryL ); + iObserved = (TObserved)0; + iSession->ServiceL( msg2 ); + EUNIT_ASSERT( iObserved == EInvestigateAvailabilityL ); + iObserved = (TObserved)0; + iSession->ServiceL( msg3 ); + EUNIT_ASSERT( iObserved == EInvitationReceivedL ); + iObserved = (TObserved)0; + iSession->ServiceL( msg4 ); + EUNIT_ASSERT( iObserved == EOptionsReceivedL ); + iObserved = (TObserved)0; + iSession->ServiceL( msg5 ); + EUNIT_ASSERT( iObserved == EStartMultimediaSharingL ); + iObserved = (TObserved)0; + iSession->ServiceL( msg6 ); + EUNIT_ASSERT( iObserved == EStopMultimediaSharingL ); + iObserved = (TObserved)0; + iSession->ServiceL( msg6_1 ); + EUNIT_ASSERT( iObserved == ERegisterObserverL ); + iObserved = (TObserved)0; + iSession->ServiceL( msg8 ); + EUNIT_ASSERT( iObserved == ECancelMonitoring ); + iObserved = (TObserved)0; + iSession->ServiceL( msg9 ); + EUNIT_ASSERT( iObserved == ECommandL ); + iObserved = (TObserved)0; + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void UT_CMusManagerServerSession:: + UT_CMusManagerServerSession_AvailabilityChangedLL() + { + + iSession->AvailabilityChangedL( + (MultimediaSharing::TMusAvailabilityStatus) KErrNone ); + + RMessage2Test msg7( EMusManagerIpcMonitorAvailability ); + iSession->ServiceL( msg7 ); + + iSession->AvailabilityChangedL( + (MultimediaSharing::TMusAvailabilityStatus) KErrNone ); + + iSession->AvailabilityChangedL( + (MultimediaSharing::TMusAvailabilityStatus) KErrNone ); + + msg7.SetHandle( 1 ); + iSession->ServiceL( msg7 ); + + iSession->AvailabilityChangedL( + (MultimediaSharing::TMusAvailabilityStatus) KErrNone ); + + iSession->ServiceL( msg7 ); + + iSession->AvailabilityChangedL( + (MultimediaSharing::TMusAvailabilityStatus) KErrNone ); + + } + + + + +// ======== EUNIT TEST TABLE ======== + + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusManagerServerSession, + "CMusManagerServerSession", + "UNIT" ) + +EUNIT_TEST( + "NewL - test ", + "CMusManagerServerSession", + "NewL", + "FUNCTIONALITY", + SetupL, UT_CMusManagerServerSession_NewLL, Teardown) + +EUNIT_TEST( + "NewLC - test ", + "CMusManagerServerSession", + "NewLC", + "FUNCTIONALITY", + SetupL, UT_CMusManagerServerSession_NewLCL, Teardown) + +EUNIT_TEST( + "ServiceL - test ", + "CMusManagerServerSession", + "ServiceL", + "FUNCTIONALITY", + SetupL, UT_CMusManagerServerSession_ServiceLL, Teardown) + +EUNIT_TEST( + "AvailabilityChangedL - test ", + "CMusManagerServerSession", + "AvailabilityChangedL", + "FUNCTIONALITY", + SetupL, UT_CMusManagerServerSession_AvailabilityChangedLL, Teardown) + + + +EUNIT_END_TEST_TABLE diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagersrv/tsrc/ut_managersrv/src/UT_CMusavailabilityPluginManager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagersrv/tsrc/ut_managersrv/src/UT_CMusavailabilityPluginManager.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,615 @@ +/* +* 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: Unit tests for CMusAvailabilityPluginManager class +* +*/ + + + +#include "musunittesting.h" +#include "UT_CmusavailabilityPluginManager.h" +#include "mmusavasettingsstub.h" +#include "musavailabilitypluginmanager.h" +#include "musavaavailability.h" +#include "musavaavailabilitystub.h" +#include "musavainterface.h" +#include "cmusavainterfacestub.h" +#include "musmanagerservercommon.h" +#include "musapplicationmanager.h" +#include +#include +#include + + +/* + * Video codec set in CMusAvailabilityManager. + */ +_LIT( KUsedVideoCodec, "H264" ); + +/* + * Tel number from MusAvaSettingsStub. + */ +_LIT( KUsedTelNumber, "123" ); + +/* + * SIP address from MusAvaSettingsStub. + */ +_LIT( KUsedSipAddress, "sip:stadi@hesa.fi" ); + + +// ======== MEMBER FUNCTIONS ======== + + +UT_CMusAvailabilityPluginManager* UT_CMusAvailabilityPluginManager::NewL() + { + UT_CMusAvailabilityPluginManager* self = UT_CMusAvailabilityPluginManager::NewLC(); + CleanupStack::Pop(); + return self; + } + + +UT_CMusAvailabilityPluginManager* UT_CMusAvailabilityPluginManager::NewLC() + { + UT_CMusAvailabilityPluginManager* self = new( ELeave ) UT_CMusAvailabilityPluginManager(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +UT_CMusAvailabilityPluginManager::~UT_CMusAvailabilityPluginManager() + { + } + + +UT_CMusAvailabilityPluginManager::UT_CMusAvailabilityPluginManager() + : CEUnitTestSuiteClass() + { + } + + +// --------------------------------------------------------------------------- +// The ConstructL from the base class CEUnitTestSuiteClass must be called. +// It generates the test case table. +// --------------------------------------------------------------------------- +// +void UT_CMusAvailabilityPluginManager::ConstructL() + { + CEUnitTestSuiteClass::ConstructL(); + } + + +// --------------------------------------------------------------------------- +// From class MMusAvailabilityPluginManagerObserver. +// --------------------------------------------------------------------------- +// +void UT_CMusAvailabilityPluginManager::PluginStopped() + { + iCalledPluginStoppedL = ETrue; + } + + +// --------------------------------------------------------------------------- +// From class MMusAvailabilityPluginManagerObserver. +// --------------------------------------------------------------------------- +// +void UT_CMusAvailabilityPluginManager::AvailabilityChangedL( + MultimediaSharing::TMusAvailabilityStatus /*aAvailability*/ ) + { + iCalledAvailabilityChangedL = ETrue; + } +// --------------------------------------------------------------------------- +// From class MMusAvailabilityPluginManagerObserver. +// --------------------------------------------------------------------------- +// +void UT_CMusAvailabilityPluginManager::StartSharingWithUseCaseL( + MultimediaSharing::TMusUseCase /*aUseCase*/ ) + { + iCalledAStartLiveSharing = ETrue; + } + +// --------------------------------------------------------------------------- +// Setups a test by instantiating tested class. +// --------------------------------------------------------------------------- +// +void UT_CMusAvailabilityPluginManager::SetupL() + { + iAppManager = CMusApplicationManager::NewL(); + iManager = CMusAvailabilityPluginManager::NewL( *this, *iAppManager ); + iCalledAvailabilityChangedL = EFalse; + iCalledPluginStoppedL = EFalse; + } + + +// --------------------------------------------------------------------------- +// Finalizes a test by deleting instance of tested class. +// --------------------------------------------------------------------------- +// +void UT_CMusAvailabilityPluginManager::Teardown() + { + delete iManager; + iManager = NULL; + delete iAppManager; + PropertyHelper::Close(); + Dll::FreeTls(); // Used by the RProcess and TFindProcess stubs + + } + + +// ======== TEST METHODS ======== + + +// --------------------------------------------------------------------------- +// Asserts a successful instantiation. +// --------------------------------------------------------------------------- +// +void UT_CMusAvailabilityPluginManager::UT_CMusAvailabilityPluginManager_NewLL() + { + delete iManager; + iManager = NULL; + iManager = CMusAvailabilityPluginManager::NewL( *this, *iAppManager ); + EUNIT_ASSERT( iManager ); + } + + +// --------------------------------------------------------------------------- +// Asserts a successful instantiation. +// --------------------------------------------------------------------------- +// +void UT_CMusAvailabilityPluginManager::UT_CMusAvailabilityPluginManager_NewLCL() + { + delete iManager; + iManager = NULL; + iManager = CMusAvailabilityPluginManager::NewLC( *this, *iAppManager ); + EUNIT_ASSERT( iManager ); + CleanupStack::Pop(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void UT_CMusAvailabilityPluginManager::UT_CMusAvailabilityPluginManager_AvailabilityL() + { + iManager->Availability(); + } + +// --------------------------------------------------------------------------- +// Asserts that plugin is started after a call to InvestigateAvailabilityL. +// --------------------------------------------------------------------------- +// +void UT_CMusAvailabilityPluginManager::UT_CMusAvailabilityPluginManager_InvestigateAvailabilityLL() + { + iManager->InvestigateAvailabilityL(); + EUNIT_ASSERT( iManager->iPluginStarted ); + + // same code again skipping !iPluginStarted + iManager->InvestigateAvailabilityL(); + EUNIT_ASSERT( iManager->iPluginStarted ); + } + + +// --------------------------------------------------------------------------- +// Asserts that plugin is started after a call to InvitationReceivedL. +// --------------------------------------------------------------------------- +// +void UT_CMusAvailabilityPluginManager::UT_CMusAvailabilityPluginManager_InvitationReceivedLL() + { + iManager->InvitationReceivedL(); + EUNIT_ASSERT( iManager->iPluginStarted ); + + // same code again skipping !iPluginStarted + iManager->InvitationReceivedL(); + EUNIT_ASSERT( iManager->iPluginStarted ); + } + + +// --------------------------------------------------------------------------- +// Asserts that plugin is started after a call to OptionsReceivedL. +// --------------------------------------------------------------------------- +// +void UT_CMusAvailabilityPluginManager::UT_CMusAvailabilityPluginManager_OptionsReceivedLL() + { + iManager->OptionsReceivedL(); + EUNIT_ASSERT( iManager->iPluginStarted ); + + // same code again skipping !iPluginStarted + iManager->OptionsReceivedL(); + EUNIT_ASSERT( iManager->iPluginStarted ); + } + + +// --------------------------------------------------------------------------- +// Asserts that plugin is no more started after a call to StopPluginL. +// --------------------------------------------------------------------------- +// +void UT_CMusAvailabilityPluginManager::UT_CMusAvailabilityPluginManager_StopPluginLL() + { + iManager->StopPluginL(); + EUNIT_ASSERT( !iManager->iPluginStarted ); + iManager->InvestigateAvailabilityL(); + EUNIT_ASSERT( iManager->iPluginStarted ); + iManager->StopPluginL(); + EUNIT_ASSERT( !iManager->iPluginStarted ); + } + + +// --------------------------------------------------------------------------- +// Asserts that session parameters comply with defaults from +// CMusAvaSettings stub (tel number, SIP address) and +// CMusAvailabilityPluginManager (video codec). +// --------------------------------------------------------------------------- +// +void UT_CMusAvailabilityPluginManager::UT_CMusAvailabilityPluginManager_SessionParametersL() + { + MDesCArray* params = &iManager->SessionParametersL(); + EUNIT_ASSERT_EQUALS( KUsedTelNumber(), params->MdcaPoint( KTelNumber ) ); + EUNIT_ASSERT_EQUALS( KUsedSipAddress(), params->MdcaPoint( KSipAddress ) ); + EUNIT_ASSERT_EQUALS( KUsedVideoCodec(), params->MdcaPoint( KVideoCodec ) ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void UT_CMusAvailabilityPluginManager:: + UT_CMusAvailabilityPluginManager_ApplicationStateL() + { + EUNIT_ASSERT( iManager->ApplicationState() == + MMusAvaSettingsObserver::EApplicationNotRunning ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusAvailabilityPluginManager::UT_CMusAvailabilityPluginManager_OptionAllowedL() + { + CMusAvaInterface* interface = iManager->iPlugin; + CMusAvaInterface2* interface2 = static_cast( interface ); + + CMusAvaAvailabilityStub* abilityStub = + static_cast( interface2->iAvailabilities[0] ); + EUNIT_ASSERT( !iManager->OptionAllowed() ); + abilityStub->iNameStub = MMusAvaObserver::EMusAvaOptionHandler; + EUNIT_ASSERT( iManager->OptionAllowed() ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusAvailabilityPluginManager::UT_CMusAvailabilityPluginManager_StartLiveSharingLL() + { + iManager->StartLiveSharingL(); + } +// --------------------------------------------------------------------------- +// Asserts that availabilitymapping is done correctly. +// --------------------------------------------------------------------------- +// +void UT_CMusAvailabilityPluginManager:: + UT_CMusAvailabilityPluginManager_MapAvailabilitiesL() + { + CMusAvaInterface* interface = iManager->iPlugin; + CMusAvaInterface2* interface2 = static_cast( interface ); + EUNIT_ASSERT( iManager->MapAvailabilities( + MMusAvaObserver::EMusAvaStatusNotExecuted ) + == MultimediaSharing::EMultimediaSharingNotAvailable ); + + //EMusAvaStatusInProgress + //It is not registered + interface2->iCurrentAvailability = + MMusAvaObserver::EMusAvaNameNetworkStatus; + EUNIT_ASSERT( iManager->MapAvailabilities( + MMusAvaObserver::EMusAvaStatusNotExecuted ) + == MultimediaSharing::EMultimediaSharingNotAvailable ); + //It is registered + interface2->iCurrentAvailability = + MMusAvaObserver::EMusAvaOptionHandler; + EUNIT_ASSERT( iManager->MapAvailabilities( + MMusAvaObserver::EMusAvaStatusInProgress ) + == MultimediaSharing::EMultimediaSharingAvailable ); + //registration is pending + interface2->iCurrentAvailability = + MMusAvaObserver::EMusAvaNameRegistration; + EUNIT_ASSERT( iManager->MapAvailabilities( + MMusAvaObserver::EMusAvaStatusInProgress ) + == MultimediaSharing::ESipRegistrationPending ); + + EUNIT_ASSERT( iManager->MapAvailabilities( + MMusAvaObserver::EMusAvaStatusNoSipProfile ) + == MultimediaSharing::EErrNoSipProfile ); + + EUNIT_ASSERT( iManager->MapAvailabilities( + MMusAvaObserver::EMusAvaStatusNotRegistered ) + == MultimediaSharing::EErrSipRegistration ); + + EUNIT_ASSERT( iManager->MapAvailabilities( + MMusAvaObserver::EMusAvaStatusNoCall ) + == MultimediaSharing::EErrNoActiveCall ); + + EUNIT_ASSERT( iManager->MapAvailabilities( + MMusAvaObserver::EMusAvaStatusCallOnHold ) + == MultimediaSharing::EErrCallOnHold ); + + EUNIT_ASSERT( iManager->MapAvailabilities( + MMusAvaObserver::EMusAvaStatusConferenceCall ) + == MultimediaSharing::EErrConferenceCall ); + + EUNIT_ASSERT( iManager->MapAvailabilities( + MMusAvaObserver::EMusAvaStatusOptionsSent ) + == MultimediaSharing::ESipOptionsSent ); + + EUNIT_ASSERT( iManager->MapAvailabilities( + MMusAvaObserver::EMusAvaStatusOptionsNotSent ) + == MultimediaSharing::ESipOptionsNotSent ); + + EUNIT_ASSERT( iManager->MapAvailabilities( + MMusAvaObserver::EMusAvaOptionNotAvailable ) + == MultimediaSharing::ESipOptionsNotCapable ); + + EUNIT_ASSERT( iManager->MapAvailabilities( + MMusAvaObserver::EMusAvaNetworkType ) + == MultimediaSharing::EErrNetwork ); + + EUNIT_ASSERT( iManager->MapAvailabilities( + MMusAvaObserver::EMusAvaRoamingError ) + == MultimediaSharing::EErrRoaming ); + + EUNIT_ASSERT( iManager->MapAvailabilities( + MMusAvaObserver::EMusAvaConnectionErr ) + == MultimediaSharing::EErrConnection ); + + EUNIT_ASSERT( iManager->MapAvailabilities( + MMusAvaObserver::EMusAvaManualActivation ) + == MultimediaSharing::EManualActivation ); + + EUNIT_ASSERT( iManager->MapAvailabilities( + MMusAvaObserver::EMusActivationError ) + == MultimediaSharing::EErrActivation ); + + EUNIT_ASSERT( iManager->MapAvailabilities( + (MMusAvaObserver::TAvailabilityStatus)KErrUnknown ) + == (MultimediaSharing::TMusAvailabilityStatus)KErrUnknown ); + + + } + + +// --------------------------------------------------------------------------- +// Asserts that session parameters are updated. +// --------------------------------------------------------------------------- +// +void UT_CMusAvailabilityPluginManager:: + UT_CMusAvailabilityPluginManager_UpdateSessionParametersLL() + { + MDesCArray* params = &iManager->SessionParametersL(); + EUNIT_ASSERT_EQUALS( KUsedTelNumber(), iManager->SessionParametersL().MdcaPoint( KTelNumber ) ); + EUNIT_ASSERT_EQUALS( KUsedSipAddress(), iManager->SessionParametersL().MdcaPoint( KSipAddress ) ); + EUNIT_ASSERT_EQUALS( KUsedVideoCodec(), iManager->SessionParametersL().MdcaPoint( KVideoCodec ) ); + } + + +// --------------------------------------------------------------------------- +// Asserts that session parameters are updated. +// --------------------------------------------------------------------------- +// +void UT_CMusAvailabilityPluginManager:: + UT_CMusAvailabilityPluginManager_SipAddressesLCL() + { + EUNIT_ASSERT( iManager->SipAddressesLC() ); + CleanupStack::PopAndDestroy(); + + CMusAvaSettings2& settings = STATIC_CAST(CMusAvaSettings2&,iManager->iPlugin->Settings()); + settings.iSipAddresses->Reset(); + // append enough sip address so that it will exceed + // RProperty::KMaxPropertySize = 512 bytes + // 512/29(per sip address ) = 18 ( approx ) + settings.iSipAddresses->AppendL(_L("sip:testtesttest1@10.21.32.51")); + settings.iSipAddresses->AppendL(_L("sip:testtesttest2@10.21.32.51")); + settings.iSipAddresses->AppendL(_L("sip:testtesttest4@10.21.32.51")); + settings.iSipAddresses->AppendL(_L("sip:testtesttest5@10.21.32.51")); + settings.iSipAddresses->AppendL(_L("sip:testtesttest6@10.21.32.51")); + settings.iSipAddresses->AppendL(_L("sip:testtesttest7@10.21.32.51")); + settings.iSipAddresses->AppendL(_L("sip:testtesttest8@10.21.32.51")); + settings.iSipAddresses->AppendL(_L("sip:testtesttest9@10.21.32.51")); + settings.iSipAddresses->AppendL(_L("sip:testtesttest10@10.21.32.51")); + settings.iSipAddresses->AppendL(_L("sip:testtesttest11@10.21.32.51")); + settings.iSipAddresses->AppendL(_L("sip:testtesttest12@10.21.32.51")); + settings.iSipAddresses->AppendL(_L("sip:testtesttest13@10.21.32.51")); + settings.iSipAddresses->AppendL(_L("sip:testtesttest14@10.21.32.51")); + settings.iSipAddresses->AppendL(_L("sip:testtesttest15@10.21.32.51")); + settings.iSipAddresses->AppendL(_L("sip:testtesttest16@10.21.32.51")); + settings.iSipAddresses->AppendL(_L("sip:testtesttest17@10.21.32.51")); + settings.iSipAddresses->AppendL(_L("sip:testtesttest18@10.21.32.51")); + settings.iSipAddresses->AppendL(_L("sip:testtesttest19@10.21.32.51")); + + HBufC* retDes = iManager->SipAddressesLC(); + EUNIT_ASSERT( retDes->Length()TelNumberLC() ); + CleanupStack::PopAndDestroy(); + } + + +// --------------------------------------------------------------------------- +// Asserts that contact name is instantiated and put to cleanupstack. +// --------------------------------------------------------------------------- +// +void UT_CMusAvailabilityPluginManager:: + UT_CMusAvailabilityPluginManager_ContactNameLCL() + { + EUNIT_ASSERT( iManager->ContactNameLC() ); + CleanupStack::PopAndDestroy(); + } +void UT_CMusAvailabilityPluginManager:: + UT_CMusAvailabilityPluginManager_IndicateAvailabilityLL() + { + iManager->IndicateAvailabilityL(); + } + +void UT_CMusAvailabilityPluginManager::UT_CMusAvailabilityPluginManager_PrepareForReceivedInviteLL() + { + CMusAvaInterface* interface = iManager->iPlugin; + CMusAvaInterface2* interface2 = static_cast( interface ); + + CMusAvaAvailabilityStub* abilityStub = + static_cast( interface2->iAvailabilities[0] ); + abilityStub->iPrepareForInviteCalled = EFalse; + + iManager->PrepareForReceivedInviteL(); + EUNIT_ASSERT( abilityStub->iPrepareForInviteCalled ); + } + +// ======== EUNIT TEST TABLE ======== + + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusAvailabilityPluginManager, + "CMusAvailabilityPluginManager", + "UNIT" ) + +EUNIT_TEST( + "NewL - test ", + "CMusAvailabilityPluginManager", + "NewL", + "FUNCTIONALITY", + SetupL, UT_CMusAvailabilityPluginManager_NewLL, Teardown ) + +EUNIT_TEST( + "NewLC - test ", + "CMusAvailabilityPluginManager", + "NewLC", + "FUNCTIONALITY", + SetupL, UT_CMusAvailabilityPluginManager_NewLCL, Teardown ) + +EUNIT_TEST( + "InvestigateAvailabilityL - test ", + "CMusAvailabilityPluginManager", + "InvestigateAvailabilityL", + "FUNCTIONALITY", + SetupL, UT_CMusAvailabilityPluginManager_InvestigateAvailabilityLL, Teardown ) + +EUNIT_TEST( + "InvitationReceivedL - test ", + "CMusAvailabilityPluginManager", + "InvitationReceivedL", + "FUNCTIONALITY", + SetupL, UT_CMusAvailabilityPluginManager_InvitationReceivedLL, Teardown ) + +EUNIT_TEST( + "OptionsReceivedL - test ", + "CMusAvailabilityPluginManager", + "OptionsReceivedL", + "FUNCTIONALITY", + SetupL, UT_CMusAvailabilityPluginManager_OptionsReceivedLL, Teardown ) + +EUNIT_TEST( + "StopPluginL - test ", + "CMusAvailabilityPluginManager", + "StopPluginL", + "FUNCTIONALITY", + SetupL, UT_CMusAvailabilityPluginManager_StopPluginLL, Teardown ) + +EUNIT_TEST( + "SessionParameters - test ", + "CMusAvailabilityPluginManager", + "SessionParameters", + "FUNCTIONALITY", + SetupL, UT_CMusAvailabilityPluginManager_SessionParametersL, Teardown ) + +EUNIT_TEST( + "ApplicationState - test ", + "CMusAvailabilityPluginManager", + "ApplicationState", + "FUNCTIONALITY", + SetupL, UT_CMusAvailabilityPluginManager_ApplicationStateL, Teardown ) + +EUNIT_TEST( + "Availability - test ", + "CMusAvailabilityPluginManager", + "Availability", + "FUNCTIONALITY", + SetupL, UT_CMusAvailabilityPluginManager_AvailabilityL, Teardown ) + + +EUNIT_TEST( + "StartLiveSharingL - test ", + "CMusAvailabilityPluginManager", + "StartLiveSharingL", + "FUNCTIONALITY", + SetupL, UT_CMusAvailabilityPluginManager_StartLiveSharingLL, Teardown ) +// NEW + +EUNIT_TEST( + "MapAvailabilities - test ", + "CMusAvailabilityPluginManager", + "MapAvailabilities", + "FUNCTIONALITY", + SetupL, UT_CMusAvailabilityPluginManager_MapAvailabilitiesL, Teardown ) + +EUNIT_TEST( + "UpdateSessionParametersL - test ", + "CMusAvailabilityPluginManager", + "UpdateSessionParametersL", + "FUNCTIONALITY", + SetupL, UT_CMusAvailabilityPluginManager_UpdateSessionParametersLL, Teardown ) + +EUNIT_TEST( + "SipAddressesLC - test ", + "CMusAvailabilityPluginManager", + "SipAddressesLC", + "FUNCTIONALITY", + SetupL, UT_CMusAvailabilityPluginManager_SipAddressesLCL, Teardown ) + +EUNIT_TEST( + "TelNumberLC - test ", + "CMusAvailabilityPluginManager", + "TelNumberLC", + "FUNCTIONALITY", + SetupL, UT_CMusAvailabilityPluginManager_TelNumberLCL, Teardown ) + +EUNIT_TEST( + "ContactNameLC - test ", + "CMusAvailabilityPluginManager", + "ContactNameLC", + "FUNCTIONALITY", + SetupL, UT_CMusAvailabilityPluginManager_ContactNameLCL, Teardown ) + +EUNIT_TEST( + "IndicateAvailabilityL - test ", + "CMusAvailabilityPluginManager", + "IndicateAvailabilityL", + "FUNCTIONALITY", + SetupL, UT_CMusAvailabilityPluginManager_IndicateAvailabilityLL, Teardown ) + +EUNIT_TEST( + "PrepareForReceivedInviteL - test ", + "CMusAvailabilityPluginManager", + "PrepareForReceivedInviteL", + "FUNCTIONALITY", + SetupL, UT_CMusAvailabilityPluginManager_PrepareForReceivedInviteLL, Teardown ) + +EUNIT_END_TEST_TABLE diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagersrv/tsrc/ut_managersrv/src/stubs.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagersrv/tsrc/ut_managersrv/src/stubs.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,56 @@ +/* +* 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 + +// TFindProcess stub + +// ------------------------------------------------------------------------- +// TFindProcess::Next +// ------------------------------------------------------------------------- +// +TInt TFindProcess::Next( TFullName& aResult ) + { + if ( Dll::Tls() != NULL ) + { + return KErrNone; + } + return KErrNotFound; + } + + +// RProcess stub + +// ------------------------------------------------------------------------- +// RProcess::Create +// ------------------------------------------------------------------------- +// +TInt RProcess::Create( + const TDesC& /*aFileName*/, + const TDesC& /*aCommand*/, + TOwnerType /*aType*/ ) + { + return Dll::SetTls( reinterpret_cast< TAny* >( 1 ) ); + } + +// ------------------------------------------------------------------------- +// RProcess::Resume +// ------------------------------------------------------------------------- +// +void RProcess::Resume() + { + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshmanagersrv/tsrc/ut_managersrv/src/ut_musmanagerserverDllMain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshmanagersrv/tsrc/ut_managersrv/src/ut_musmanagerserverDllMain.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,47 @@ +/* +* 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: Provides factory method for MuS Manager Server test suite. +* +*/ + + +#include "ut_cmusmanagerservercore.h" +#include "ut_cmusmanagerserverclosetimer.h" +#include "ut_cmusapplicationmanager.h" +#include "ut_cmusavailabilitypluginmanager.h" +#include "ut_cmusmanagerserversession.h" + +#include + + +// ======== GLOBAL FUNCTIONS ======== + + +// --------------------------------------------------------------------------- +// Constructs and returns EUnit Test suite. +// --------------------------------------------------------------------------- +// +EXPORT_C MEUnitTest* CreateTestSuiteL() + { + CEUnitTestSuite* rootSuite = CEUnitTestSuite::NewLC( _L( "Mush ManagerServer" ) ); + + rootSuite->AddL( UT_CMusApplicationManager::NewL() ); + rootSuite->AddL( UT_CMusAvailabilityPluginManager::NewL() ); + rootSuite->AddL( UT_CMusManagerServerCore::NewL() ); + rootSuite->AddL( UT_CMusManagerServerCloseTimer::NewL() ); + rootSuite->AddL( UT_CMusManagerServerSession::NewL() ); + + CleanupStack::Pop( rootSuite ); + return rootSuite; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshshared/inc/muspropertyobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshshared/inc/muspropertyobserver.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,38 @@ +/* +* Copyright (c) 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: Mus Applications Event Observer Interface +* +*/ + + + +#ifndef MUSPROPERTYOBSERVER_H +#define MUSPROPERTYOBSERVER_H + +#include + +class MMusPropertyObserver + { + +public: + + virtual void PropertyChanged( const TUint aKey, const TInt aValue ) = 0; + + virtual void HandlePropertyError( const TInt aReason ) = 0; + + }; + +#endif // MUSPROPERTYOBSERVER_H + +// end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshshared/inc/muspropertywatch.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshshared/inc/muspropertywatch.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,127 @@ +/* +* Copyright (c) 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: +* +*/ + + + +#ifndef MUSPROPERTYWATCH_H +#define MUSPROPERTYWATCH_H + +#include "musunittesting.h" + +#include +#include + +class MMusPropertyObserver; + +class CMusPropertyWatch : public CActive + { + + MUS_UNITTEST( UT_CMusPropertyWatch ) + +public: // constructors and destructor + + /** + * Two-phased constructor. Leaves on failure. + * @return The constructed CMusPropertyWatch object. + */ + static CMusPropertyWatch* NewL( MMusPropertyObserver& aObserver, + TUid aCategory, + const TInt aPropertyName ); + + /** + * Destructor. + */ + ~CMusPropertyWatch(); + +private: + + /** + * C++ constructor. + */ + CMusPropertyWatch( MMusPropertyObserver& aObserver, + TUid aCategory, + const TInt aPropertyName ); + + /** + * Symbian 2nd-phase constructor. + * @leave If return value of RProperty::Attach != KErrNone, e.q. KErrNoMemory + * or one of the system wide error codes if RunL() leaves + */ + void ConstructL(); + + +public: // new functions + + /** + * Reads a P&S integer value from the category KCategoryUid + * @pre P&S value has to be defined. + * @leave One of the system wide error codes, if RProperty::Get() + * returns an error value. + * @param aKey Name of the P&S Key, which value should be read + * @returns The integer value of the P&S Key. + */ + static TInt ReadIntPropertyL( TUint aKey ); + + /** + * Reads a P&S descriptor value from the category KCategoryUid + * @pre P&S value has to be defined. + * @leave One of the system wide error codes, if RProperty::Get() + * returns an error value or if descriptor AllocL() leaves. + * @param aKey Name of the P&S Key, which value should be read + * @returns The descriptor value of the P&S Key. + * Ownership is transferred + */ + static HBufC* ReadDescPropertyL( TUint aKey ); + + +private: // functions from base class CActive + + /** + * + */ + void DoCancel(); + + /** + * Reads a P&S integer value from the category KCategoryUid + * and starts to monitor changes in the property value. + * Calls observer function for read property values. + * @pre P&S value has to be defined as an integer. + * @leave One of the system wide error codes, if RProperty::Get() + * returns an error value. + */ + void RunL(); + + /** + * + */ + TInt RunError(TInt aError); + +private: // Data + + RProperty iProperty; + + TUid iPropertyCategory; + + TUint iPropertyKey; + + MMusPropertyObserver& iObserver; + + }; + +#endif // MUSPROPERTYWATCH_H + +// end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshshared/loc/mus.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshshared/loc/mus.loc Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,820 @@ +/* +* Copyright (c) 2005-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: Localization strings for project MuS +* +*/ + + + +/* + The syntax of a logical name entry in this file is the following: + + // d:context description (line 1) + // d:context description (line N) + // l:layout id + // w: + // r:release information + // + #define qtn__?freetext "?text" + + where + "qtn_" starts a logical name. Note: "text_" has been used in + old logical names, but is deprecated. + "?feature/application" is 2-5 lower-case characters and/or numbers + identifying the larger context of the display text. + "?freetext" is the free text portion of the logical name. + It may contain only lower-case letters ('a' to 'z'), numbers + ('0' to '9'), and the underscore ('_'). The total length of + the logical name does must not exceed 50 characters. + "d:" Starts a description line clarifying the entry's context with + information like: + - Is a word a verb in imperative or is it a noun? (For instance, + what does "Set" mean?) + - What will replace %U (unicode text parameter) or %N (number + parameter) included in texts? (For instance, is it a phone + number or an e-mail address?) + "l:" Starts a layout id information (one line). + "P" and "No" are symbols in LAF's information table + - "P" is parent pane or current pane + - "No" is reference number in table + "r:" Starts a release information: one line indicating in which + S60 release the text was used for the first time. + + Refer to the S60 localization instructions for more information. + + Examples: + +// d:Command in options list in short term memories. +// d:Opens the call list view that is focused. +// l:list_single_pane_t1_cp2 +// r:3.2 +// +#define text_logs_stm_cmd_open "Open" + +// d:Title pane text in converter main state. +// l:title_pane_t2/opt9 +// r:3.0 +// +#define qtn_cnv_title "Converter" + +// d:Prompt text for currency data query in converter. +// l:popup_query_data_window +// r:4.0 +// +#define qtn_cnv_edit_name_prompt "Currency name" + +// d:Active call is terminated and a held call becomes active. +// d:Operation is confirmed with this info note. +// d:%U stands for the call identification of the activated call. +// l:popup_note_window +// r:3.2 +// +#define qtn_multc_unhold_done_note "%U active" + +*/ + +// IN-CALL STRINGS START /////////////////////////////////////////////////// +// d:Menu item for video sharing, contains submenu options. +// l:list_single_pane_t1_cp2/opt3 +// r:3.2 +// +#define qtn_incal_share_video "Video sharing" + +// d:Submenu option to start live sharing from camera. +// l:list_single_popup_submenu_pane_t1 +// r:3.2 +// +#define qtn_incal_live_video "Live" + +// d:Submenu option to start sharing recorded clip. +// l:list_single_popup_submenu_pane_t1 +// r:3.2 +// +#define qtn_incal_video_clip "Clip" + +// d:Menu option to return to sharing that is already running. +// l:list_single_pane_t1_cp2 +// r:3.2 +// +#define qtn_incal_continue_sharing "Continue video sharing" + +// IN-CALL STRINGS END ////////////////////////////////////////////////////// + +// GENERAL STRINGS START //////////////////////////////////////////////////// + +// d:Application title. +// d:Title of the application shown in grid mode. +// d:Note! Though not visible in app shell, needed +// d:when UI framework is asked for app's name. +// l:cell_app_pane_t1 +// r:3.2 +// +#define qtn_apps_msh_grid "Video sharing" + +// d:Application title. +// d:Title of the application shown in list mode. +// d:Note! Though not visible in app shell, needed +// d:when UI framework is asked for app's name. +// l:list_single_large_graphic_pane_t1 +// r:3.2 +// +#define qtn_apps_msh_list "Video sharing" + +// d:Error note text. +// d:Shown when a connection is lost. +// l:popup_note_window +// r:3.2 +// +#define qtn_msh_note_connection_lost "Video Sharing connection lost" + +// d:Error note text. +// d:Shown when a connection timeout has occured. +// l:popup_note_window +// r:3.2 +// +#define qtn_msh_note_timeout_expired "Connection timeout" + +// d:Error note text. +// d:Shown when service is currently unavailable. +// l:popup_note_window +// r:3.2 +// +#define qtn_msh_note_service_n_a "Service temporarily unavailable" + +// d:Information note text. +// d:Shown when an invitation is cancelled. +// l:popup_note_window +// r:3.2 +// +#define qtn_msh_note_invitation_cancelled "Invitation cancelled" + +// d:Information note text +// d:Shown when terminal is out of network coverage. +// l:popup_note_window +// r:3.2 +// +#define qtn_msh_note_network_n_a "No network coverage" + +// d:Error note text. +// d:Shown when a severe application error condition occurs. +// l:popup_note_window +// r:3.2 +// +#define qtn_msh_note_error_app_general "Application error" + +// d:Error note text. +// d:Shown when sip registration fails. +// l:popup_note_window +// r:3.2 +// +#define qtn_msh_note_no_reg "Unable to register to network" + +// d:Error note text. +// d:Popup to inform user there was a catastrophic failure at startup. +// l:popup_note_window +// r:3.2 +// +#define qtn_msh_note_startup_failed "Start-up failed. Reinstall 'Video sharing' application." + +// d:Error note text. +// d:Popup to inform user that application-related settings are +// d:incorrect/corrupt. +// l:popup_note_window +// r:3.2 +// +#define qtn_msh_note_bad_startup_settings "Start-up failed. Check settings." + +// d:Error note text. +// d:Popup to inform user that video transcoding has failed. +// l:popup_note_window +// r:3.2 +// +#define qtn_msh_note_transcoding_failed "Unable to convert clip" + +// d:Information note text. +// d:Popup to inform user that the phone has to be physically manipulated so the +// d:main camera can be used. +// l:popup_note_window +// r:3.2 +// +#define qtn_msh_note_change_camera_mode "Unable to share video. Activate the main camera." + +// d:Information note text. +// d:Popup to inform user that the phone has to be physically manipulated so the +// d:keypad can be used. +// l:popup_note_window +// r:3.2 +// +#define qtn_msh_note_change_keypad_mode "Unable to edit. Activate keypad first." + +// d:Information note text. +// d:Popup to inform user of an incoming request from another user to share video. +// d:%U is the name or phone number of that other user. +// l:popup_note_window +// r:3.2 +// +#define qtn_msh_note_incoming_video_request "Accept sharing request from %U[35]?" + +// d:Information note text. +// d:Popup query to: a) inform the user the VS has been disabled in settings +// d:b) query whether the user would like to enable VS for duration of ongoing CS call. +// l:popup_note_window +// r:3.2 +// +#define qtn_msh_note_manual_activation "Video Sharing has been disabled in settings. Do you want to enable it for this call?" + +// d:Information note text. +// d:Poput to inform that VS is not possible during a conference call. +// l:popup_note_window +// r:3.2 +// +#define qtn_mshstarter_note_conference_call "Video Sharing cannot be started from conference call." + +// d:Information note text. +// d:Poput to inform that VS is possible only in 3G network. +// l:popup_note_window +// r:3.2 +// +#define qtn_mshstarter_note_network_incompatible "Video Sharing is supported only in 3G network." + +// d:Information note text. +// d:Poput to inform that VS is possible while the CS call is on hold. +// l:popup_note_window +// r:3.2 +// +#define qtn_mshstarter_note_on_hold "Video Sharing cannot be started while call is on hold." + +// d:Information note text. +// d:Poput to inform that recipient's terminal does not support VS. +// l:popup_note_window +// r:3.2 +// +#define qtn_mshstarter_note_recipient_incapable "Recipient's terminal does not support Video Sharing." + + + +// GENERAL STRINGS END ////////////////////////////////////////////////////// + +// INVITE VIEW RELATED STRINGS START //////////////////////////////////////// + +// d:Header text for Select Address list query. +// l:heading_pane_t1 +// r:3.2 +// +#define qtn_msh_inviteview_select_query_hdr_txt "Select address:" + +// d:Header text for manual SIP address entry dialog. +// l:popup_query_data_window +// r:3.2 +// +#define qtn_msh_inviteview_enter_sip "Enter address:" + +// d:Wait note text in invite view. +// d:Shown when an invitation is sent out. This string will have the +// d:recipients name added to it in run-time. +// l:popup_note_wait_window +// r:3.2 +// +#define qtn_msh_note_inviting "Sending invitation to %U" + +// d:Information note text in invite view. +// d:Indicates user B already has some exclusive session ongoing. +// l:popup_note_window +// r:3.2 +// +#define qtn_msh_note_recipient_busy "Recipient already sharing video. Unable to establish connection." + +// d:Information note text in invite view. +// d:Indicates user B has declined user A's invitation. +// l:popup_note_window +// r:3.2 +// +#define qtn_msh_note_connection_rejected "Invitation rejected by recipient" + +// d:Error note text in invite view. +// d:Shown when error occurs in sending invite. +// l:popup_note_window +// r:3.2 +// +#define qtn_msh_note_invite_error "Unable to send invitation" + +// d:Error note text in invite view. +// d:Shown if the invited user is not registered to the +// d:network. +// l:popup_note_window +// r:3.2 +// +#define qtn_msh_note_recipient_not_found "Unable to find recipient" + +// d:Error note text in invite view. +// d:Shown if terminal B doesn't have MuS application +// d:available. +// l:popup_note_window +// r:3.2 +// +#define qtn_msh_note_app_n_a "Recipient does not have 'Video sharing' application" + +// d:Error note text in invite view. +// d:Shown if user B cannot be reached for some reason. +// l:popup_note_window +// r:3.2 +// +#define qtn_msh_note_recipient_n_a "Recipient busy. Try again later." + +// d:Error note text in invite view. +// d:Shown if user B invitation times out. +// l:popup_note_window +// r:3.2 +// +#define qtn_msh_note_no_response "No response received to invitation" + +// d:Error note text in invite view. +// d:Shown if recipient address is somehow malformed. +// l:popup_note_window +// r:3.2 +// +#define qtn_msh_note_wrong_address "Recipient not found. Check the address." + +// d:Progress note text in invite view. +// d:Shown while transcoding operation is going on. +// l:popup_note_wait_window +// r:3.2 +// +#define qtn_msh_note_transcoding_video "Converting video" + +// d:Informational note text in invite view. +// d:Shown when transcoding has completed. +// l:popup_note_window +// r:3.2 +// +#define qtn_msh_note_transcoding_complete "Clip conversion complete" + +// INVITE VIEW RELATED STRINGS END ////////////////////////////////////////// + +// SHARE VIEW RELATED STRINGS START ///////////////////////////////////////// +// d:Title for MuS sharing view, if name or telephone number cannot be displayed. +// l:title_pane_t2/opt9 +// r:3.2 +// +#define qtn_msh_shareview_title "Video sharing" + +// d:Softkey in Share View. +// d:Labels command which resumes local recording of +// d:paused clip record. +// l:control_pane_t1/opt7 +// r:3.2 +// +#define qtn_msh_shareview_softk_continue "Continue" + +// d:Softkey command in Share View. +// d:Labels command to replay clip and stream. +// l:control_pane_t1/opt7 +// r:3.2 +// +#define qtn_msh_shareview_softk_replay "Replay" + +// d:Right softkey command. +// d:Right Softkey label for stopping the app. +// l:control_pane_t1/opt7 +// r:3.2 +// +#define qtn_msh_softkey_stop "Stop" + +// d:Label in confirmation note. +// d:Shown when user is ending sharing. +// l:popup_note_window +// r:3.2 +// +#define qtn_msh_query_save_clip "Save shared video clip?" + +// d:Label in confirmation note. +// d:Shown when sharing ends and contact info is not in Phonebook. +// l:popup_note_window +// r:3.2 +// +#define qtn_msh_query_save_contact "Save address to contacts?" + +// d:Label in wait note. +// d:Shown when user accepts remote stream. +// l:popup_note_wait_window +// r:3.2 +// +#define qtn_msh_note_waiting_for_stream "Waiting for shared video from %U" + +// d:Label in global note. +// d:Shown when media sharing has been terminated. +// l:popup_preview_text_window_t1 +// r:3.2 +// +#define qtn_msh_note_sharing_ended "Video sharing ended" + +// d:Label in confirmation note. +// d:Shown when media sharing has been terminated by recipient. +// l:popup_note_window +// r:3.2 +// +#define qtn_msh_note_sharing_ended_record "Video sharing ended. Continue recording?" + +// d:Label in global error note. +// d:Shown when media initialization fails. +// l:popup_note_window +// r:3.2 +// +#define qtn_msh_note_error_mediainit "Unable to share video. Required resource cannot be used." + +// d:Label in global error note. +// d:Shown when clip is not in shareable format and cannot be transcoded. +// l:popup_note_window +// r:3.2 +// +#define qtn_msh_note_transcoding_not_supported "Clip is not in correct format. Unable to share." + + +// d:Label in global error note. +// d:Shown when file cannot be read. +// l:popup_note_window +// r:3.2 +// +#define qtn_msh_note_error_filelock "Unable to read file" + +// d:Label in global error note. +// d:Shown when an unspecified file system error occurs. +// l:popup_note_window +// r:3.2 +// +#define qtn_msh_note_error_genericfile "File error" + +// d:Label in global error note. +// d:Shown when memory runs out while sharing. +// l:popup_note_window +// r:3.2 +// +#define qtn_msh_note_memory_low "Memory low. Recording stopped." + +// d:Label in information note. +// d:Shown when memory card is not accessible (e.g. corrupted, write protected). +// l:popup_note_window +// r:3.2 +// +#define qtn_msh_note_memorycard_problem "Memory card is not accessible. Phone memory will be used instead." + +// d:Label in global error note. +// d:Shown when an unspecified file system error occurs. +// l:popup_note_window +// r:3.2 +// +#define qtn_msh_note_resource_n_a "Application not available" + +// d:Label in wait note. +// d:Shown when waiting for SIP registration during early activation +// l:popup_note_wait_window +// r:3.2 +#define qtn_msh_note_registration_pending "Registering to SIP server" + +// d:File name of saved video clip +// d:Localizable portion of a recorded file's name. +// l:title_pane_t2/opt9 +// r:3.2 +// +#define qtn_msh_set_saving_filename "SharedVideo" + +// d:Label in information note. +// d:Shown when user has decided to save shared clip and operation succeeds. +// d:First %U is filename, second %U is folder where saved. +// l:popup_note_window +// r:3.2 +// +#define qtn_msh_note_video_saved "File %0U saved to folder %1U" + +// d:Command in options list in live video sharing. +// d:Starts recording the video. +// l:list_single_pane_t1_cp2 +// r:3.2 +// +#define qtn_msh_options_rec_start "Start recording" + +// d:Command in options list in video sharing. +// d:Stops recording the video. +// l:list_single_pane_t1_cp2 +// r:3.2 +// +#define qtn_msh_options_rec_stop "Stop recording" + + +// d:Command in options list in receiving sharing video. +// l:list_single_pane_t1_cp2 +// r:3.2 +// +#define qtn_msh_options_fullscreen "View in full screen" + +// d:Command in options list in live video sharing. +// d:Activates zoom control live indicator +// l:list_single_pane_t1_cp2 +// r:3.2 +// +#define qtn_msh_options_zoom "Zoom" + +// d:Command in options list in live video sharing. +// d:Activates brightness control live indicator +// l:list_single_pane_t1_cp2 +// r:3.2 +// +#define qtn_msh_options_brightness "Brightness" + +// d:Command in options list in video sharing. +// d:Zooms the videwfinder in. +// l:list_single_pane_t1_cp2 +// r:3.2 +// +#define qtn_msh_options_zoom_in "Zoom in" + +// d:Command in options list in live video sharing. +// d:Zooms the videwfinder out. +// l:list_single_pane_t1_cp2 +// r:3.2 +// +#define qtn_msh_options_zoom_out "Zoom out" + +// d:Command in options list in image and video clip sharing. +// d:Shown in clip/image sharing. +// l:list_single_pane_t1_cp2 +// r:3.2 +// +#define qtn_msh_options_gen_sharelive "Share live video" + +// d:Command in options list. +// d:Shown in live/clip/image sharing. +// l:list_single_pane_t1_cp2 +// r:3.2 +// +#define qtn_msh_options_gen_shareimage "Share image" + +// d:Command in options list in image and video clip sharing. +// d:Shown in live/clip/image sharing. +// l:list_single_pane_t1_cp2 +// r:3.2 +// +#define qtn_msh_options_gen_shareclip "Share video clip" + +// d:Command in options list in image and video clip sharing. +// d:Shown in clip sharing. +// l:list_single_pane_t1_cp2 +// r:3.2 +// +#define qtn_msh_options_clip_audio "Clip audio" + +// d:Subcommand in options list under Clip audio. +// d:Shown in clip sharing. +// l:list_single_popup_submenu_pane_t1 +// r:3.2 +// +#define qtn_msh_options_clip_audio_mute "Mute clip audio" + +// d:Subcommand in options list under Clip audio. +// d:Shown in clip sharing. +// l:list_single_popup_submenu_pane_t1 +// r:3.2 +// +#define qtn_msh_options_clip_audio_normal "Play clip audio" + +// d:Toolbar tooltip text +// l:popup_preview_text_window_t1 +// r:3.2 +// +#define qtn_msh_tooltip_volume "Adjust call volume" + +// d:Toolbar tooltip text +// l:popup_preview_text_window_t1 +// r:3.2 +// +#define qtn_msh_tooltip_fullscreen "View in full screen mode" + +// d:Toolbar tooltip text +// l:popup_preview_text_window_t1 +// r:3.2 +// +#define qtn_msh_tooltip_pause_live "Pause sharing" + +// d:Toolbar tooltip text +// l:popup_preview_text_window_t1 +// r:3.2 +// +#define qtn_msh_tooltip_unpause_live "Resume sharing" + +// d:Toolbar tooltip text +// l:popup_preview_text_window_t1 +// r:3.2 +// +#define qtn_msh_tooltip_ffrev "Fast forward or rewind clip" + +// d:Toolbar tooltip text +// l:popup_preview_text_window_t1 +// r:3.2 +// +#define qtn_msh_tooltip_zoom "Adjust zoom" + +// d:Toolbar tooltip text +// l:popup_preview_text_window_t1 +// r:3.2 +// +#define qtn_msh_tooltip_brightness "Adjust brightness" + +// d:Toolbar tooltip text +// l:popup_preview_text_window_t1 +// r:3.2 +// +#define qtn_msh_tooltip_mute "Mute Microphone" + +// d:Toolbar tooltip text +// l:popup_preview_text_window_t1 +// r:3.2 +// +#define qtn_msh_tooltip_unmute "Unmute Microphone" + +// d:Toolbar tooltip text +// l:popup_preview_text_window_t1 +// r:3.2 +// +#define qtn_msh_tooltip_ihf_off "Loudspeaker off" + +// d:Toolbar tooltip text +// l:popup_preview_text_window_t1 +// r:3.2 +// +#define qtn_msh_tooltip_ihf_on "Loudspeaker on" + +// SHARE VIEW RELATED STRINGS END /////////////////////////////////////////// + +// SETTINGS RELATED STRINGS START /////////////////////////////////////////// + +// d:Video Sharing settings title in General Settings +// l:list_single_large_graphic_pane_t1 +// r:3.2 +// +#define qtn_set_folder_video_sharing "Video Sharing" + +//d:Title in Video Sharing settings +//l:title_pane_t2/opt9 +// r:3.2 +// +#define qtn_msh_set_title "Video Sharing" + +// d:Text of a list item in video sharing settings view +// d:Activation setting title +// l:list_setting_pane_t1 +// r:3.2 +// +#define qtn_msh_set_activation_title "Activation" + +// d:Text of a list item in video sharing settings view +// d:Activation setting: always automatic +// l:list_set_graphic_pane_t1 +// r:3.2 +// +#define qtn_msh_set_activation_always "Always automatic" + +// d:Text of a list item in video sharing settings view +// d:Activation setting: automatic in home network +// l:list_set_graphic_pane_t1 +// r:3.2 +// +#define qtn_msh_set_activation_homentw "Automatic in home network" + +// d:Text of a list item in video sharing settings view +// d:Activation setting: off +// l:list_set_graphic_pane_t1 +// r:3.2 +// +#define qtn_msh_set_activation_off "Off" + +// d:Text of a list item in video sharing settings view +// d:Capability auditory note setting title +// l:list_setting_pane_t1 +// r:3.2 +// +#define qtn_msh_set_audio_title "Capability auditory note" + +// d:Text of a list item in video sharing settings view +// d:Capability auditory note setting: off +// l:list_set_graphic_pane_t1 +// r:3.2 +// +#define qtn_msh_set_audio_off "Off" + +// d:Text of a list item in video sharing settings view +// d:Capability auditory note setting: on +// l:list_set_graphic_pane_t1 +// r:3.2 +// +#define qtn_msh_set_audio_on "On" + +// d:Text of a list item in video sharing settings view +// d:SIP profile setting title +// l:list_setting_pane_t1 +// r:3.2 +// +#define qtn_msh_set_profile_title "SIP profile" + +// d:Text of a list item in video sharing settings view +// d:SIP profile setting: default profile +// l:list_set_graphic_pane_t1 +// r:3.2 +// +#define qtn_msh_set_profile_default "Default profile" + +// d:Text of a list item in video sharing settings view +// d:SIP profile setting: select from list +// l:list_set_graphic_pane_t1 +// r:3.2 +// +#define qtn_msh_set_profile_select "Select from list" + +// d:Text of a list item in video sharing settings view +// d:SIP profile setting: title of "select from list" +// l:list_setting_pane_t1 +// r:3.2 +// +#define qtn_msh_set_profile_select_title "Select SIP profile" + +// d:Text of a list item in video sharing settings view +// d:SIP profile setting: No profiles +// l:popup_note_window/opt2 +// r:3.2 +// +#define qtn_msh_set_profile_empty "No SIP profiles defined" + +// d:Text of a list item in video sharing settings view +// d:SIP profile setting: No profile selected +// l:list_set_graphic_pane_t1 +// r:3.2 +// +#define qtn_msh_set_profile_not_selected "No profile selected" + +// d:Text of a list item in video sharing settings view +// d:Pupup informing that change of SIP profile will not be active until next CS call +// l:popup_note_window +// r:3.2 +// +#define qtn_msh_set_profile_note "Profile change will be active from next call" + +// d:Text of a list item in video sharing settings view +// d:Autorecording setting title +// l:list_setting_pane_t1 +// r:3.2 +// +#define qtn_msh_set_saving_title "Autorecord" + +// d:Text of a list item in video sharing settings view +// d:Auto record setting: on +// l:list_set_graphic_pane_t1 +// r:3.2 +// +#define qtn_msh_set_saving_auto "On" + +// d:Text of a list item in video sharing settings view +// d:Auto record setting: off +// l:list_set_graphic_pane_t1 +// r:3.2 +// +#define qtn_msh_set_saving_off "Off" + +// d:Text of a list item in video sharing settings view +// d:Preferred storage setting title +// l:list_setting_pane_t1 +// r:3.2 +// +#define qtn_msh_set_storage_title "Preferred storage" + +// d:Text of a list item in video sharing settings view +// d:Preferred storage setting: Memory card +// l:list_set_graphic_pane_t1 +// r:3.2 +// +#define qtn_msh_set_storage_card "Memory card" + +// d:Text of a list item in video sharing settings view +// d:Preferred storage setting: Phone memory +// l:list_set_graphic_pane_t1 +// r:3.2 +// +#define qtn_msh_set_storage_phone "Phone memory" + +// d:Shown when video is stored +// l:popup_note_window +// r:3.2 +// +#define qtn_apps_mg_gs "My stuff" + +// SETTINGS RELATED STRINGS END ///////////////////////////////////////////// + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshshared/loc/musoperator.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshshared/loc/musoperator.loc Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,91 @@ +/* +* Copyright (c) 2000 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* This file contains the operator specific localised strings for +* Mulitmediasharing application. +* +* %version: 4.1.4 %, %date_modified: Tue Nov 03 10:00:14 2009 % by %derived_by: gurina % +* +*/ + + +// LOCALISATION STRINGS + +// +// NOTE: Exact layout information syntax for logical names has not been +// decided/approved yet. +// + +// d:Softkey command in Share View. +// l:control_pane_t3/opt7 +// r:3.2 +// +#define qtn_msh_msk_ihf_off "Speaker Off" + +// d:Softkey command in Share View. +// l:control_pane_t3/opt7 +// r:3.2 +// +#define qtn_msh_msk_ihf_on "Speaker On" + +// d:Softkey command in Share View. +// l:control_pane_t3/opt7 +// r:3.2 +// +#define qtn_msh_msk_ok "Ok" + +// d:Text to inform readiness of video sharing. +// l:popup_note_window +// r:3.2 +// +#define qtn_msh_note_vsready "Video Share Ready" + +// d:Asks if user wants to start sharing live video. +// d:Poput to inform that recipient's terminal is VS capable. +// l:popup_note_window +// r:3.2 +// +#define qtn_msh_note_capability "Do you want to share live video?" + +// d:Text of a list item in video sharing settings view +// d:Capability popup note setting title +// l:list_setting_pane_t1 +// r:3.2 +// +#define qtn_msh_set_autorecord_title "Autorecord" + +// d:Text of a list item in video sharing settings view +// d:Autorecording setting title +// l:list_setting_pane_t1 +// r:3.2 +// +#define qtn_msh_set_note_title "Alerts" + +// d:Text of a list item in video sharing settings view +// d:Capability popup note setting: off +// l:list_set_graphic_pane_t1 +// r:3.2 +// +#define qtn_msh_set_note_off "Off" + +// d:Text of a list item in video sharing settings view +// d:Capability popup note setting: on +// l:list_set_graphic_pane_t1 +// r:3.2 +// +#define qtn_msh_set_note_on "On" + +// End of File + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/mmshshared/src/muspropertywatch.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/mmshshared/src/muspropertywatch.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,178 @@ +/* +* Copyright (c) 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: +* +*/ + + + +#include "muspropertywatch.h" +#include "muspropertyobserver.h" +#include "mussessionproperties.h" +#include "musresourceproperties.h" +#include "muslogger.h" // debug logging + +using namespace NMusSessionApi; + +// ----------------------------------------------------------------------------- +// Symbian two-phase constructor. +// ----------------------------------------------------------------------------- +// +CMusPropertyWatch* CMusPropertyWatch::NewL( + MMusPropertyObserver& aObserver, + TUid aCategory, + const TInt aPropertyName ) + { + CMusPropertyWatch* self = new (ELeave) CMusPropertyWatch( + aObserver, + aCategory, + aPropertyName ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// C++ destructor. +// ----------------------------------------------------------------------------- +// +CMusPropertyWatch::~CMusPropertyWatch() + { + MUS_LOG( "mus: [MUSSH ] -> CMusPropertyWatch::~CMusPropertyWatch" ); + if ( IsActive() ) + { + Cancel(); + } + iProperty.Close(); + MUS_LOG( "mus: [MUSSH ] <- CMusPropertyWatch::~CMusPropertyWatch" ); + } + + +// ----------------------------------------------------------------------------- +// C++ constructor. +// ----------------------------------------------------------------------------- +// +CMusPropertyWatch::CMusPropertyWatch( MMusPropertyObserver& aObserver, + TUid aCategory, + const TInt aPropertyName ) : + CActive( EPriorityNormal ), + iObserver( aObserver ) + { + iPropertyCategory = aCategory; + iPropertyKey = aPropertyName; + } + + +// ----------------------------------------------------------------------------- +// Symbian second-phase constructor. +// ----------------------------------------------------------------------------- +// +void CMusPropertyWatch::ConstructL( ) + { + MUS_LOG( "mus: [MUSSH ] -> CMusPropertyWatch::ConstructL" ); + User::LeaveIfError( iProperty.Attach( iPropertyCategory, + iPropertyKey) ); + CActiveScheduler::Add( this ); + + iProperty.Subscribe( iStatus ); + SetActive(); + + MUS_LOG( "mus: [MUSSH ] <- CMusPropertyWatch::ConstructL" ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CMusPropertyWatch::ReadIntPropertyL( TUint aKey ) + { + MUS_LOG1( "mus: [MUSSH ] -> CMusPropertyWatch::ReadIntPropertyL: aKey: [%d]", + aKey ); + TInt val; + User::LeaveIfError( RProperty::Get( KCategoryUid, + aKey, + val ) ); + MUS_LOG1( "mus: [MUSSH ] <- CMusPropertyWatch::ReadIntPropertyL: val: [%d]", + val ); + return val; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +HBufC* CMusPropertyWatch::ReadDescPropertyL( TUint aKey ) + { + MUS_LOG1( "mus: [MUSSH ] -> CMusPropertyWatch::ReadDescPropertyL: aKey: [%d]", + aKey ); + TBuf buffer; + + User::LeaveIfError( RProperty::Get( KCategoryUid, + aKey, + buffer ) ); + HBufC* desc = buffer.AllocL(); + MUS_LOG_TDESC( "mus: [MUSSH ] <- CMusPropertyWatch::ReadDescPropertyL: val: ", + (*desc) ); + return desc; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusPropertyWatch::DoCancel() + { + MUS_LOG( "mus: [MUSSH ] -> CMusPropertyWatch::DoCancel" ); + iProperty.Cancel(); + MUS_LOG( "mus: [MUSSH ] <- CMusPropertyWatch::DoCancel" ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusPropertyWatch::RunL() + { + MUS_LOG( "mus: [MUSSH ] -> CMusPropertyWatch::RunL" ); + TInt val; + + User::LeaveIfError( RProperty::Get( iPropertyCategory, + iPropertyKey, + val ) ); + + iObserver.PropertyChanged( iPropertyKey, val ); + MUS_LOG( "mus: [MUSSH ] <- CMusPropertyWatch::RunL" ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt CMusPropertyWatch::RunError( TInt aError ) + { + MUS_LOG1( "mus: [MUSSH ] -> CMusPropertyWatch::RunError [%d]", aError ); + iObserver.HandlePropertyError( aError ); + MUS_LOG( "mus: [MUSSH ] <- CMusPropertyWatch::RunError" ); + return KErrNone; + } + + +// end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharing/tsrc/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharing/tsrc/group/bld.inf Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,34 @@ +/* +* 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: project specification +* +*/ + + + + + +PRJ_PLATFORMS +DEFAULT + + +PRJ_EXPORTS + + +PRJ_TESTMMPFILES +#include "../../mmshengine/tsrc/ut_engine/group/bld.inf" +#include "../../mmshavailability/tsrc/ut_availability/group/bld.inf" +#include "../../mmshmanagercli/tsrc/ut_managercli/group/bld.inf" +#include "../../mmshmanagersrv/tsrc/ut_managersrv/group/bld.inf" +#include "../../mmshindicator/tsrc/ut_indicator/group/bld.inf" diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharinguis.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharinguis.pro Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,32 @@ +# +# 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_exports += "rom/multimediasharing.iby CORE_APP_LAYER_IBY_EXPORT_PATH(multimediasharing.iby)" + :BLD_INF_RULES.prj_exports += "rom/multimediasharingresources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(multimediasharingresources.iby)" + :BLD_INF_RULES.prj_exports += "rom/multimediasharing_stub.SIS /epoc32/data/z/system/install/multimediasharing_stub.SIS" + + :BLD_INF_RULES.prj_mmpfiles += $$LITERAL_HASH"include \"mmsharinguis_plat/group/bld.inf\"" + :BLD_INF_RULES.prj_mmpfiles += $$LITERAL_HASH"include \"mmshplugins/group/bld.inf\"" + :BLD_INF_RULES.prj_mmpfiles += $$LITERAL_HASH"include \"mmsharing/mmshapp/help/group/bld.inf\"" +} + +SUBDIRS += mmsharing/group diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharinguis_plat/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharinguis_plat/group/bld.inf Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,23 @@ +/* +* 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: Includes all the Domain API specific bld.inf files, which +* export files. +* +*/ + + +#include "../live_comms_plugin_api/group/bld.inf" +#include "../multimedia_sharing_settings_api/group/bld.inf" +#include "../multimedia_sharing_resource_api/group/bld.inf" +#include "../multimedia_sharing_manager_api/group/bld.inf" diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharinguis_plat/live_comms_plugin_api/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharinguis_plat/live_comms_plugin_api/group/bld.inf Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,40 @@ +/* +* 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: The exported files for Live Comms plug-in API +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +../inc/lcaudiocontrol.h APP_LAYER_PLATFORM_EXPORT_PATH(lcaudiocontrol.h) +../inc/lcbrightnesscontrol.h APP_LAYER_PLATFORM_EXPORT_PATH(lcbrightnesscontrol.h) +../inc/lccameracontrol.h APP_LAYER_PLATFORM_EXPORT_PATH(lccameracontrol.h) +../inc/lcdestinationfilecontrol.h APP_LAYER_PLATFORM_EXPORT_PATH(lcdestinationfilecontrol.h) +../inc/lcengine.h APP_LAYER_PLATFORM_EXPORT_PATH(lcengine.h) +../inc/lcengine.inl APP_LAYER_PLATFORM_EXPORT_PATH(lcengine.inl) +../inc/lcsession.h APP_LAYER_PLATFORM_EXPORT_PATH(lcsession.h) +../inc/lcsessionobserver.h APP_LAYER_PLATFORM_EXPORT_PATH(lcsessionobserver.h) +../inc/lcsourcefilecontrol.h APP_LAYER_PLATFORM_EXPORT_PATH(lcsourcefilecontrol.h) +../inc/lcuiprovider.h APP_LAYER_PLATFORM_EXPORT_PATH(lcuiprovider.h) +../inc/lcvideoplayer.h APP_LAYER_PLATFORM_EXPORT_PATH(lcvideoplayer.h) +../inc/lcwindow.h APP_LAYER_PLATFORM_EXPORT_PATH(lcwindow.h) +../inc/lczoomcontrol.h APP_LAYER_PLATFORM_EXPORT_PATH(lczoomcontrol.h) + +PRJ_TESTMMPFILES \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharinguis_plat/live_comms_plugin_api/inc/lcaudiocontrol.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharinguis_plat/live_comms_plugin_api/inc/lcaudiocontrol.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,102 @@ +/* +* 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 MLCAUDIOCONTROL_H +#define MLCAUDIOCONTROL_H + +// INCLUDES +#include + +// CLASS DECLARATION +/** +* Class for adjusting the audio related settings +* such as muting and unmuting the audio and changing its volume level. +*/ +class MLcAudioControl + { + public: + + /** + * Checks whether the local audio has been muted. + * @return ETrue if the local audio has been muted, otherwise EFalse. + */ + virtual TBool IsLcAudioMutedL() = 0; + + /** + * Mutes / unmutes the local audio. + * @param aMute ETrue mutes the audio, EFalse unmutes it. + */ + virtual void MuteLcAudioL( TBool aMute ) = 0; + + /** + * Checks whether the microphone has been muted, + * @return ETrue if the microphone has been muted, otherwise EFalse. + */ + virtual TBool IsLcMicMutedL() = 0; + + /** + * Mutes / unmutes the microphone. + * @param aMute ETrue mutes the microphone, EFalse unmutes it. + */ + virtual void MuteLcMicL( TBool aMute ) = 0; + + /** + * Checks whether it is allowed + * to enable the loudspeaker by calling EnableLcLoudspeakerL. + * @return ETrue if enabling the loudspeaker is allowed, otherwise EFalse. + */ + virtual TBool IsEnablingLcLoudspeakerAllowed() = 0; + + /** + * Enables / disables the loudspeaker. + * @pre IsEnablingLcLoudspeakerAllowed() == ETrue + * @param aEnabled ETrue enables the loudspeaker, EFalse disables it. + */ + virtual void EnableLcLoudspeakerL( TBool aEnabled ) = 0; + + /** + * Checks whether the loudspeaker has been enabled. + * @return ETrue if the loudspeaker has been enabled, otherwise EFalse. + */ + virtual TBool IsLcLoudspeakerEnabled() = 0; + + /** + * Returns the current volume level. + * @return the current volume level + */ + virtual TInt LcVolumeL() = 0; + + /** + * Sets the volume level. + * @param aValue the volume level + */ + virtual void SetLcVolumeL( TInt aValue ) = 0; + + /** + * Increases the volume level by one step. + */ + virtual void IncreaseLcVolumeL() = 0; + + /** + * Decreases the volume level by one step. + */ + virtual void DecreaseLcVolumeL() = 0; + }; + +#endif // MLCAUDIOCONTROL_H + +// end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharinguis_plat/live_comms_plugin_api/inc/lcbrightnesscontrol.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharinguis_plat/live_comms_plugin_api/inc/lcbrightnesscontrol.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,70 @@ +/* +* 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 MLCBRIGHTNESSCONTROL_H +#define MLCBRIGHTNESSCONTROL_H + +// INCLUDES +#include + +// CLASS DECLARATION +/** +* Class for adjusting the brightness of a video. +*/ +class MLcBrightnessControl + { + public: + + /** + * Returns the minimum brightness level. + * @return the minimum brightness level + */ + virtual TInt MinLcBrightnessL() = 0; + + /** + * Returns the maximum brightness level. + * @return the maximum brightness level + */ + virtual TInt MaxLcBrightnessL() = 0; + + /** + * Returns the current brightness level. + * @return the current brightness level + */ + virtual TInt LcBrightnessL() = 0; + + /** + * Sets the brightness level. + * @pre aValue >= MinLcBrightnessL && aValue <= MaxLcBrightnessL + * @param aValue the new brightness level + */ + virtual void SetLcBrightnessL( TInt aValue ) = 0; + + /** + * Increments the brightness level by one step. + */ + virtual void IncreaseLcBrightnessL() = 0; + + /** + * Decrements the brightness level by one step. + */ + virtual void DecreaseLcBrightnessL() = 0; + }; + +#endif // MLCBRIGHTNESSCONTROL_H + +// end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharinguis_plat/live_comms_plugin_api/inc/lccameracontrol.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharinguis_plat/live_comms_plugin_api/inc/lccameracontrol.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,57 @@ +/* +* 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 MLCCAMERACONTROL_H +#define MLCCAMERACONTROL_H + +// INCLUDES +#include + +// CLASS DECLARATION +/** +* Class for querying the device's camera capabilities +* and switching between the device's cameras. +*/ +class MLcCameraControl + { + public: + + /** + * Returns the count of cameras available in the device. + * @return the count of cameras in the device + */ + virtual TInt LcCameraCountL() = 0; + + /** + * Return the index of the currently used camera. + * @return the camera index + */ + virtual TInt CurrentLcCameraIndex() = 0; + + /** + * Switches to the next camera available in the device. + * For example, if there are three cameras in the device, + * the first call switches from camera 1 to camera 2, + * the second call switches from camera 2 to camera 3 and + * the third call switches from camera 3 to camera 1. + */ + virtual void ToggleLcCameraL() = 0; + }; + +#endif // MLCCAMERACONTROL_H + +// end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharinguis_plat/live_comms_plugin_api/inc/lcdestinationfilecontrol.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharinguis_plat/live_comms_plugin_api/inc/lcdestinationfilecontrol.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,57 @@ +/* +* 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 MLCDESTINATIONFILECONTROL_H +#define MLCDESTINATIONFILECONTROL_H + +// INCLUDES +#include + +// CLASS DECLARATION +/** +* Class for controlling the usage of a destination file for a player. +*/ +class MLcDestinationFileControl + { + public: + + /** + * Sets the name of the destination file. + * @param aFileName the file name + */ + virtual void SetLcFileNameL( const TFileName& aFileName ) = 0; + + /** + * Returns the name of the destination file. + * @return the file name + */ + virtual TFileName& LcFileName() = 0; + + /** + * Starts or pauses recording + */ + virtual void LcRecordL( TBool aRecord ) = 0; + + /** + * Checks whether recording is paused or not + */ + virtual TBool LcIsRecording() = 0; + }; + +#endif // MLCDESTINATIONFILECONTROL_H + +// end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharinguis_plat/live_comms_plugin_api/inc/lcengine.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharinguis_plat/live_comms_plugin_api/inc/lcengine.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,96 @@ +/* +* 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 CLCENGINE_H +#define CLCENGINE_H + +// INCLUDES +#include + +// FORWARD DECLARATIONS +class MLcSession; + +// CONSTANTS +/** Interface UID of this ECOM interface */ +const TUid KLcEngineInterfaceUid = { 0x20021340 }; + +// CLASS DECLARATION +/** +* A base class for ECom plug-ins implementing +* the Live Comms engine plug-in API. +*/ +class CLcEngine : public CBase + { + public: // Enumerations + + /** + * The list of plug-in configurable features. + */ + enum TLcFeature + { + ELcShowInvitingNote, + ELcShowWaitingNote, + ELcShowAcceptQuery, + ELcSendVideoQuery + }; + + public: // Constructors and destructor + + /** + * Loads and creats an instance of the plug-in. + * @param aEngineName used in finding the correct implementation. + * Matched to the IMPLEMENTATION_INFO / default_data of the plug-in. + * @return a new instance of CLcEngine, the ownership is transferred + */ + inline static CLcEngine* NewL( const TDesC8& aEngineName ); + + /** + * Destructor + */ + inline ~CLcEngine(); + + public: // New pure virtual functions + + /** + * Returns a reference to the session created by the plug-in. + * @return the session + */ + virtual MLcSession& Session() = 0; + + public: // New virtual functions + + /** + * Checks if a feature should be used with the particular engine. + * @param aLcFeature the identifier of the feature + * @return ETrue if the feature is supported, otherwise EFalse. + */ + inline virtual TBool IsFeatureSupported( TLcFeature aLcFeature ); + + protected: // Constructors + + inline CLcEngine(); + + public: // Data + + TUid iInstanceKey; + }; + +#include "lcengine.inl" + +#endif // CLCENGINE_H + +// end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharinguis_plat/live_comms_plugin_api/inc/lcengine.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharinguis_plat/live_comms_plugin_api/inc/lcengine.inl Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,67 @@ +/* +* 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 CLCENGINE_INL +#define CLCENGINE_INL + +// INCLUDES +#include + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CLcEngine* CLcEngine::NewL( const TDesC8& aEngineName ) + { + TEComResolverParams resolverParams; + resolverParams.SetDataType( aEngineName ); + return reinterpret_cast< CLcEngine* >( + REComSession::CreateImplementationL( + KLcEngineInterfaceUid, + _FOFF( CLcEngine, iInstanceKey ), + resolverParams ) ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CLcEngine::CLcEngine() + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CLcEngine::~CLcEngine() + { + REComSession::DestroyedImplementation( iInstanceKey ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CLcEngine::IsFeatureSupported( TLcFeature /*aLcFeature*/ ) + { + return EFalse; + } + +#endif // CLCENGINE_INL + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharinguis_plat/live_comms_plugin_api/inc/lcsession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharinguis_plat/live_comms_plugin_api/inc/lcsession.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,186 @@ +/* +* 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 MLCSESSION_H +#define MLCSESSION_H + +// INCLUDES +#include + +// FORWARD DECLARATIONS +class MLcSessionObserver; +class MLcUiProvider; +class MLcVideoPlayer; + +// CLASS DECLARATION +/** +* A class representing a Live Comms session. +*/ +class MLcSession + { + public: + + /** + * The list of possible session states. + */ + enum TLcSessionState + { + EUninitialized, + EInitialized, + EReceived, + EOpening, + EOpen, + EClosing, + EClosed + }; + + /** + * The possible failure reasons for a session. + */ + enum TLcSessionFailure + { + ENoAnswer = 1, + ERecipientNotFound, + ESessionCancelled, + ESessionRejected, + ERecipientBusy, + ERecipientTemporarilyNotAvailable, + EDiskFull, + EConnectionLost, + EMediaInactivityTimeout, + }; + + /** + * Returns the current session state. + * @return the session state + */ + virtual TLcSessionState LcSessionState() const = 0; + + /** + * Sets the observer for the session related events. + * @param aObserver the observer + */ + virtual void SetLcSessionObserver( MLcSessionObserver* aObserver ) = 0; + + /** + * Sets the callback for the UI prompts. + * @param aUiProvider callback for UI prompts + */ + virtual void SetLcUiProvider( MLcUiProvider* aUiProvider ) = 0; + + /** + * Establishes the session. + * In case of a MO session initiates the session negotiation. + * In case of a MT session accepts the incoming session. + */ + virtual void EstablishLcSessionL() = 0; + + /** + * Terminates the session. + * Can be used for terminating an existing session as well as + * cancelling a MO session that has not yet been established. + * Can also be used for rejecting an incoming session. + */ + virtual void TerminateLcSessionL() = 0; + + /** + * Returns the video player for the received media. + * Is present if the session contains video + * received from the remote participant. + * @return the remote video player or NULL if not present + */ + virtual MLcVideoPlayer* RemoteVideoPlayer() = 0; + + /** + * Returns the video player for the media that is being sent. + * Is present if the session contains outgoing video. + * @return the local video player or NULL if not present + */ + virtual MLcVideoPlayer* LocalVideoPlayer() = 0; + + /** + * Returns the own display name for the session. + * @return the local display name or KNullDesC if local + * display name is not known + */ + virtual const TDesC& LocalDisplayName() = 0; + + /** + * Returns the remote party's display name for the session. + * @return the remote display name or KNullDesC if remote + * display name is not known + */ + virtual const TDesC& RemoteDisplayName() = 0; + + /** + * Sets a parameter for the session. + * The parameters can be plug-in specific. + * @param aId the identifier for the parameter + * @param aValue the value for the parameter + */ + virtual TInt SetParameter( TInt aId, TInt aValue ) = 0; + + /** + * Returns a value for a session parameter. + * @param aId the identifier for the parameter + * @return the value for the parameter or an error if not present + */ + virtual TInt ParameterValue( TInt aId ) = 0; + + /** + * Checks whether application should be started in background mode. + * In background mode session will be pre-set up without user + * interaction and will be in paused state. + * @return ETrue if background mode should be used + */ + virtual TBool IsBackgroundStartup() = 0; + + /** + * Engine can be informed about application foreground status via + * this method. + * @param aIsForeground ETrue if application is at foreground, EFalse + * if at background + * @return KErrNone if succesfully handled + */ + virtual TInt SetForegroundStatus( TBool aIsForeground ) = 0; + + /** + * Returns remote party details for the session + * @return remote party details or KNullDesC if those are not known + */ + virtual const TDesC& RemoteDetails() = 0; + + /** + * Updates established session. + * All the changes, if they are not yet delivered, to players, windows + * and session parameters has been commited after the call. + */ + virtual void UpdateLcSessionL() = 0; + + /** + * Send DTMF signals. + * @param aKey Key pressed from dialpad. Key can be [0-9],*,#,A,B,C,D. + * which is 16 key combination of DTMF. + * Send DTMF signals to remote party. + * @return ETrue upon success else EFalse. + */ + virtual TBool SendDialTone( TChar aKey) = 0; + }; + +#endif // MLCSESSION_H + +// end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharinguis_plat/live_comms_plugin_api/inc/lcsessionobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharinguis_plat/live_comms_plugin_api/inc/lcsessionobserver.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,95 @@ +/* +* 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 MLCSESSIONOBSERVER_H +#define MLCSESSIONOBSERVER_H + +// INCLUDES +#include + +// FORWARD DECLARATIONS +class MLcSession; +class MLcVideoPlayer; + +// CLASS DECLARATION +/** +* A callback for a Live Comms session related events. +*/ +class MLcSessionObserver + { + public: + + /** + * The state of the session has changed. + * The new state can be obtained from the session. + * @param aSession the session + */ + virtual void StateChanged( MLcSession& aSession ) = 0; + + /** + * The state of the player has changed. + * The new state can be obtained from the player. + * @param aPlayer the player + */ + virtual void StateChanged( MLcVideoPlayer& aPlayer ) = 0; + + /** + * The session has been updated. + * For example a new player has been added. + * @param aSession the updated session + */ + virtual void Updated( MLcSession& aSession ) = 0; + + /** + * The session has been updated. + * For example a new control has been added or + * an existing control has been updated. + * @param aPlayer the updated player + */ + virtual void Updated( MLcVideoPlayer& aPlayer ) = 0; + + /** + * The session has failed. + * @param aSession the failed session + * @param aError the reason for the failure + */ + virtual void Failed( + MLcSession& aSession, + TInt aError ) = 0; + + /** + * The player has failed. + * @param aPlayer the failed player + * @param aError the reason for the failure + */ + virtual void Failed( + MLcVideoPlayer& aPlayer, + TInt aError ) = 0; + + /** + * The session duration time has changed. + * @param aSession the session + * @param aSeconds the current session duration. + */ + virtual void SessionTimeChanged( + MLcSession& aSession, + const TTimeIntervalSeconds& aSeconds ) = 0; + }; + +#endif // MLCSESSIONOBSERVER_H + +// end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharinguis_plat/live_comms_plugin_api/inc/lcsourcefilecontrol.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharinguis_plat/live_comms_plugin_api/inc/lcsourcefilecontrol.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,80 @@ +/* +* 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 MLCSOURCEFILECONTROL_H +#define MLCSOURCEFILECONTROL_H + +// INCLUDES +#include + +// CLASS DECLARATION +/** +* Class for controlling the usage of a source file for a player. +*/ +class MLcSourceFileControl + { + public: + + /** + * Sets the name of the source file. + * @param aFileName the file name + */ + virtual void SetLcFileNameL( const TFileName& aFileName ) = 0; + + /** + * Returns the name of the source file. + * @return the file name + */ + virtual TFileName& LcFileName() = 0; + + /** + * Starts or stops fast forwarding the file. + * The file is left paused after stopping the fast forwarding. + * @param aUseFFWD ETrue to start FFWD, EFalse to stop it. + */ + virtual void LcFastForwardL( TBool aUseFFWD ) = 0; + + /** + * Starts or stops fast rewinding the file. + * The file is left paused after stopping the fast rewinding. + * @param aUseFRWD ETrue to start FRWD, EFalse to stop it. + */ + virtual void LcFastRewindL( TBool aUseFRWD ) = 0; + + /** + * Returns duration of the file as time interval. + * @return the duration of the file + */ + virtual TTimeIntervalSeconds LcFileDurationL() = 0; + + /** + * Returns current file position as time interval. + * @return the current position + */ + virtual TTimeIntervalSeconds LcFilePositionL() = 0; + + /** + * Sets the file position as time interval. + * @param aPosition the new position + */ + virtual void SetLcFilePositionL( + const TTimeIntervalSeconds& aPosition ) = 0; + }; + +#endif // MLCSOURCEFILECONTROL_H + +// end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharinguis_plat/live_comms_plugin_api/inc/lcuiprovider.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharinguis_plat/live_comms_plugin_api/inc/lcuiprovider.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,74 @@ +/* +* 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 MLCUIPROVIDER_H +#define MLCUIPROVIDER_H + +// INCLUDES +#include +#include + +// CLASS DECLARATION +/** +* A callback for fetching session related information from the end user. +*/ +class MLcUiProvider + { + public: + + /** + * Asks to select the recipient for the session from + * a predefined list of recipients. + * @param aRecipientAddresses the list of possible recipients + * @param aSelectedRecipientAddress on return contains + * the selected recipient + * @return ETrue if the recipient was selected, otherwise EFalse + */ + virtual TBool SelectRecipient( + MDesCArray& aRecipientAddresses, + TDes& aSelectedRecipientAddress ) = 0; + + /** + * Asks to input the recipient for the session. + * @param aRecipientAddress on return contains the recipient address + * @return ETrue if the recipient was inserted, otherwise EFalse + */ + virtual TBool InputRecipient( TDes& aRecipientAddress ) = 0; + + /** + * The application foreground status has to be changed. + * @param aForeground ETrue if application should be brought to + * foreground. + */ + virtual void HandleForegroundStatus( TBool aForeground ) = 0; + + /** + * UI needs to be blocked/unblocked. If engine is processing + * asynchronous operation and cannot handle other actions meanwhile, + * it can ask UI to block user controls until asynchronous operation + * completes. NOTE: session termination is allowed even if blocking + * is active. + * @param aBlocked, ETrue is UI should be blocked, EFalse + * if UI can be unblocked. + */ + virtual void BlockUi( TBool aBlocked ) = 0; + }; + + +#endif // MLCUIPROVIDER_H + +// end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharinguis_plat/live_comms_plugin_api/inc/lcvideoplayer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharinguis_plat/live_comms_plugin_api/inc/lcvideoplayer.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,144 @@ +/* +* 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 MLCVIDEOPLAYER_H +#define MLCVIDEOPLAYER_H + +// INCLUDES +#include + +// FORWARD DECLARATIONS +class MLcWindow; +class MLcCameraControl; +class MLcCamera; +class MLcSourceFileControl; +class MLcDestinationFileControl; +class MLcAudioControl; +class MLcZoomControl; +class MLcBrightnessControl; + +// CLASS DECLARATION +/** +* A class representing a video player and its controls. +*/ +class MLcVideoPlayer + { + public: + + + /** + * The list of possible video player sources. + */ + enum TLcVideoPlayerSource + { + ECameraSource, + EFileSource + }; + + /** + * The list of possible video player states. + */ + enum TLcVideoPlayerState + { + EInit, + EPreparing, + EBuffering, + EPlaying, + EPaused, + EUnavailable + }; + + /** + * Returns the current video player state. + * @return the video player state + */ + virtual TLcVideoPlayerState LcVideoPlayerState() const = 0; + + /** + * Checks whether the video is currently being played. + * @return ETrue if the video is being played, otherwise EFalse. + */ + virtual TBool LcIsPlayingL() = 0; + + /** + * Returns the current video player source. + * @return the video player source. + */ + virtual TLcVideoPlayerSource LcVideoPlayerSourceL() { return ECameraSource; }; + + /** + * Starts to play the source mentioned in the argument + * @aSource : One of the sources in TLcVideoPlayerSource enum. + * default : Play from camera. + */ + virtual void LcPlayL( TLcVideoPlayerSource aSource=ECameraSource ) = 0; + + /** + * Pauses the playing of the video. + */ + virtual void LcPauseL() = 0; + + /** + * Returns the window for the player, if present. + * @return the window for the player or NULL if not present + */ + virtual MLcWindow* LcWindow() = 0; + + /** + * Returns the camera control, + * if the video player uses the device's camera + * as the source of the played video. + * @return the camera control or NULL if not present + */ + virtual MLcCameraControl* LcCameraControl() = 0; + + /** + * Returns the source file control for the video player, + * if the video is played from a local video file. + * @return the source file control or NULL if not present + */ + virtual MLcSourceFileControl* LcSourceFileControl() = 0; + + /** + * Returns the destination file control for the video player, + * if the video is being recorded to a local video file. + * @return the destination file control or NULL if not present + */ + virtual MLcDestinationFileControl* LcDestinationFileControl() = 0; + + /** + * Returns the audio control for the player, if present. + * @return the audio control for the player or NULL if not present + */ + virtual MLcAudioControl* LcAudioControl() = 0; + + /** + * Returns the zoom control for the player, if present. + * @return the zoom control for the player or NULL if not present + */ + virtual MLcZoomControl* LcZoomControl() = 0; + + /** + * Returns the brightness control for the player, if present. + * @return the brightness control for the player or NULL if not present + */ + virtual MLcBrightnessControl* LcBrightnessControl() = 0; + }; + +#endif // MLCVIDEOPLAYER_H + +// end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharinguis_plat/live_comms_plugin_api/inc/lcwindow.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharinguis_plat/live_comms_plugin_api/inc/lcwindow.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,82 @@ +/* +* 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 MLCWINDOW_H +#define MLCWINDOW_H + +// INCLUDES +#include + +// CLASS DECLARATION +/** +* Class representing a window for a video player. +*/ +class MLcWindow + { + public: + + /** + * The possible window orientations. + */ + enum TLcWindowOrientation + { + EPortrait, // Normal + ELandscape // 90 degree's clockwise rotation + }; + + /** + * Enables / disables the window into use + * and start / stops to show the video in it. + * @param aEnabled ETrue enables the window, EFalse disables it. + */ + virtual void EnableLcWindowL( TBool aEnable ) = 0; + + /** + * Checks whether the window has been enabled. + * @return ETrue if the window has been enabled, otherwise EFalse. + */ + virtual TBool IsLcWindowEnabled() = 0; + + /** + * Sets the rectangle for the window. + * @param aRect the rectangle for the window + */ + virtual void SetLcWindowRectL( TRect aRect ) = 0; + + /** + * Returns the current rectangle for the window. + * @return the current rectangle for the window + */ + virtual TRect LcWindowRect() = 0; + + /** + * Sets the window orientation. + * @param aOrientation the current window orientation + */ + virtual void SetLcWindowOrientationL( + TLcWindowOrientation aOrientation ) = 0; + + /** + * Returns the current window orientation. + * @return the current window orientation + */ + virtual TLcWindowOrientation LcWindowOrientationL() = 0; + }; + +#endif // MLCWINDOW_H + +// end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharinguis_plat/live_comms_plugin_api/inc/lczoomcontrol.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharinguis_plat/live_comms_plugin_api/inc/lczoomcontrol.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,70 @@ +/* +* 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 MLCZOOMCONTROL_H +#define MLCZOOMCONTROL_H + +// INCLUDES +#include + +// CLASS DECLARATION +/** +* Class for controlling the zoom level of a video player. +*/ +class MLcZoomControl + { + public: + + /** + * Returns the minimum zoom value. + * @return the minimum zoom value + */ + virtual TInt MinLcZoomL() = 0; + + /** + * Returns the maximum zoom value. + * @return the maximum zoom value + */ + virtual TInt MaxLcZoomL() = 0; + + /** + * Returns the current value for the zoom. + * @return the current zoom value + */ + virtual TInt LcZoomValueL() = 0; + + /** + * Sets the current zoom level. + * @pre aValue >= MinLcZoomL && aValue <= MaxLcZoomL + * @param aValue the new zoom level + */ + virtual void SetLcZoomValueL( TInt aValue ) = 0; + + /** + * Zooms in by one step. + */ + virtual void LcZoomInL() = 0; + + /** + * Zooms out by one step. + */ + virtual void LcZoomOutL() = 0; + }; + +#endif // MLCZOOMCONTROL_H + +// end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharinguis_plat/multimedia_sharing_manager_api/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharinguis_plat/multimedia_sharing_manager_api/group/bld.inf Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,32 @@ +/* +* 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: File that exports the files belonging to +: Multimedia Sharing Manager API +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +../inc/musdomainpskeys.h APP_LAYER_PLATFORM_EXPORT_PATH(musdomainpskeys.h) +../inc/musmanager.h APP_LAYER_PLATFORM_EXPORT_PATH(musmanager.h) +../inc/musmanagercommon.h APP_LAYER_PLATFORM_EXPORT_PATH(musmanagercommon.h) +../inc/musavailabilityobserver.h APP_LAYER_PLATFORM_EXPORT_PATH(musavailabilityobserver.h) + +PRJ_TESTMMPFILES \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharinguis_plat/multimedia_sharing_manager_api/inc/musavailabilityobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharinguis_plat/multimedia_sharing_manager_api/inc/musavailabilityobserver.h Thu Jul 22 16:32:26 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: +* +*/ + + +#ifndef MUSAVAILABILITYOBSERVER_H +#define MUSAVAILABILITYOBSERVER_H + +// INCLUDES +#include +#include + +// CLASS DECLARATION + +/** + * This observer class should be implemented by components interested in the + * Multimedia Sharing availability changes + */ + +class MMusAvailabilityObserver + { +public: // New functions + + /** + * Method called when multimedia sharing availability changes + * + * @param aAvailabilityStatus state of multimedia sharing availability + */ + virtual void MusAvailabilityChangedL( + MultimediaSharing::TMusAvailabilityStatus aAvailabilityStatus ) = 0; + + }; + +#endif // MUSAVAILABILITYOBSERVER_H + +// End of File \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharinguis_plat/multimedia_sharing_manager_api/inc/musdomainpskeys.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharinguis_plat/multimedia_sharing_manager_api/inc/musdomainpskeys.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,52 @@ +/* +* 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: Multimedia Sharing Domain Publish and Subscribe keys +* +*/ + + +#ifndef MUSADOMAINPSKEYS_H +#define MUSADOMAINPSKEYS_H + +#include + +// CONSTANTS + +/****************************************************************************** +* Multimedia Sharing Session API +******************************************************************************/ + +namespace NMusSessionApi + { + const TUid KMusSessionApi = {0x1028238D}; + + /** + * Indication about Multimedia Sharing availability change. + * + * @type RProperty::TInt + */ + const TUint32 KMusAvailabilityStatus = 0x00000012; + + /** + * Indication about Multimedia Sharing able to show indicator. + * + * @type RProperty::TBool + */ + const TBool KMusIndicator = 0x0000001C; + + } + +#endif // MUSADOMAINPSKEYS_H + +// End of file \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharinguis_plat/multimedia_sharing_manager_api/inc/musmanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharinguis_plat/multimedia_sharing_manager_api/inc/musmanager.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,188 @@ +/* +* 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: ?Description +* +*/ + + +#ifndef MUSMANAGER_H +#define MUSMANAGER_H + +#include "musmanagercommon.h" +//#include "musunittesting.h" + +#include +#include + +class CMusManagerImpl; +class MMusAvailabilityObserver; + +/** + * Class to manager MultimediaSharing application. + * + * Class CMusManager provides an interface to monitor + * the system's ability to initiate a MultimediaSharing + * session. Also, MultimediaSharing application can be started + * via this interface. Application can be ordered to close + * itself by calling the stop application function. + * + * MultimediaSharing availability is a variable of a system + * that describes that is a MultimediaSharing session currently + * possible, or not. It depends on call state, network state, + * SIP profiles and SIP OPTIONS. + * + * @lib musmanagerclient.dll + */ +class CMusManager : public CBase + { +public: + + enum TRequestType + { + ESipOptions = 0x1028238D, + ESipInviteDesired = 0x10282391, + ESipInviteDesired2WayVideo = 0x10282392, + ESipInviteNotDesired = 0x1028238D + }; + + +public: // first phase constructors and destructor + + IMPORT_C static CMusManager* NewL(); + + IMPORT_C static CMusManager* NewLC(); + + /** + * Creates Mus Manager instance allowing the clients to pass + * an observer interface through which the clients will be capable + * to listen for the availability state of Multimedia Sharing + * + * @param aAvailabilityObserver pointer to the implementation of + * availabilty observer interface + * + * @since S60 v5.0 + */ + IMPORT_C static CMusManager* NewL( + MMusAvailabilityObserver* aAvailabilityObserver ); + + /** + * Creates Mus Manager instance allowing the clients to pass + * an observer interface through which the clients will be capable + * to listen for the availability state of Multimedia Sharing + * Mus Manager instance is left on cleanup stack. + * + * @param aAvailabilityObserver pointer to the implementation of + * availabilty observer interface + * + * @since S60 v5.0 + */ + IMPORT_C static CMusManager* NewLC( + MMusAvailabilityObserver* aAvailabilityObserver ); + + virtual ~CMusManager(); + +public: // functions related to availability of MultimediaSharing + + /** + * This function causes following things: + * - MS manager starts to monitor call and network state + * - In case of active call, MS manager + * - resolves the SIP address of the remote host + * - makes a capability query (SIP OPTIONS) + * + * This function must be called before a MultimediaSharing + * session is tried to be established. Otherwise, the internal state of + * MultimediaSharing will remain as undefined. In that state, + * MultimediaSharing Manager will not start the application. + * + * @since S60 v3.2 + */ + IMPORT_C void ExamineAvailabilityL(); + + /** + * Returns the current availability status. + * + * @since S60 v3.2 + * @return The current availability status. + */ + IMPORT_C MultimediaSharing::TMusAvailabilityStatus AvailabilityL(); + +public: // functions related to application start-up + + /** + * This function allows clients to request coomand's to be executed by + * the MUS manager server. + * + * In erroneous cases, this function will leave + * with an error code that describes the error. Positive leave codes + * are defined in MultimediaSharing::TMusAvailabilityStatus. + * + * @param aRequest Defines the coomand type. + * + */ + IMPORT_C void HandleCommandL( MultimediaSharing::TCommandType aCommandType ); + + + /** + * Orders MultimediaSharing subsystem to handle a SIP request. + * In some cases, this function call starts the application. + * + * In erroneous cases, this function will leave + * with an error code that describes the error. Positive leave codes + * are defined in MultimediaSharing::TMusAvailabilityStatus. + * + * @param aRequest Defines the request type. + * Must be SipStrConsts::EOptions or SipStrConsts::EInvite + */ + IMPORT_C void HandleSipRequestL( TRequestType aRequestType ); + + /** + * Starts the MultimediaSharing application + * + * If the application can't be started, this function will leave + * with an error code that describes the error. Positive leave codes + * are defined in MultimediaSharing::TMusAvailabilityStatus. + * + * @param aUseCase Describes the desired use case and + affects the default view. + */ + IMPORT_C void StartApplicationL( MultimediaSharing::TMusUseCase aUseCase ); + +public: // functions to related application closing + + /** + * This function causes the application to get a stop signal. + * Application will close itself smoothly. + * + */ + IMPORT_C void StopApplicationL(); + +private: // second phase constructors + + CMusManager(); + + void ConstructL(); + + void ConstructL( MMusAvailabilityObserver* aAvailabilityObserver ); + +private: // data + + /** + * The actual implementation of the interface. + * Own. + */ + CMusManagerImpl* iImpl; + }; + +#endif // ? MUSMANAGER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharinguis_plat/multimedia_sharing_manager_api/inc/musmanagercommon.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharinguis_plat/multimedia_sharing_manager_api/inc/musmanagercommon.h Thu Jul 22 16:32:26 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: ?Description +* +*/ + + + +#ifndef MUSMANAGERCOMMON_H +#define MUSMANAGERCOMMON_H + +#include + +/** + * A namespace container for MultimediaSharing enumerations. + */ +namespace MultimediaSharing + { + /** Contains the possible values for availability status. */ + enum TMusAvailabilityStatus + { + // OK STATES + ESipRegistrationPending = 1, // SIP registration pending + ESipOptionsSent, + ESipOptionsNotSent, // + EMultimediaSharingAvailable, + EManualActivation, + ESipOptionsNotCapable, + + // ERROR STATES + EErrServerShutDown = 100, // MUS Manager is Shut Down + EMultimediaSharingNotAvailable, + EErrSipRegistration, // SIP registration failed / not done + EErrNoActiveCall, // no active call ongoing + EErrCallOnHold, // CS call in hold + EErrConferenceCall, // conf call ongoing + EErrRoaming, // we're roaming, but this app not allowed when so + EErrNetwork, // network is of wrong type + EErrConnection, // PDP connection error + EErrActivation, // Activation is not allowed + EMultimediaFailureCode, // Start up forbiden + // FATAL ERROR STATES + EErrNoSipProfile = 1000 // no SIP profile; do not show MS menu options! + }; + + /** Contains the possible use cases of MultimediaSharing. */ + enum TMusUseCase + { + EMusLiveVideo, // live sharing from camera + EMusClipVideo, // video clip sharing + EMusStillImage, // still image sharing + EMusReceive, // receive video + EMusContinue, // continue running the existing application + EMusTwoWayVideo, // two-way sharing + EMusReceiveTwoWayVideo // two-way receive video + }; + /** Contains the possible commands of MultimediaSharing. */ + enum TCommandType + { + ECommandNotDefined, + ECommandManualActivation + }; + } + +#endif // MUSMANAGERCOMMON_H + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharinguis_plat/multimedia_sharing_manager_api/multimedia_sharing_manager_api.metaxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharinguis_plat/multimedia_sharing_manager_api/multimedia_sharing_manager_api.metaxml Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,18 @@ + + + Multimedia Sharing Manager API + To provide means to initiate and close Multimedia Sharing session, and to ask about current MS Availability + c++ + mmsharing + + + + + + + + + no + no + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharinguis_plat/multimedia_sharing_manager_api/tsrc/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharinguis_plat/multimedia_sharing_manager_api/tsrc/group/bld.inf Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,21 @@ +/* +* Copyright (c) 2005-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 file for project MuS Manager Client tests. +* +*/ + +#include + +PRJ_TESTMMPFILES +#include "../../../../mmsharing/mmshmanagercli/tsrc/ut_managercli/group/bld.inf" \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharinguis_plat/multimedia_sharing_resource_api/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharinguis_plat/multimedia_sharing_resource_api/group/bld.inf Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,27 @@ +/* +* 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: File that exports the files belonging to +: Multimedia Sharing Resource API +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +../inc/musresourceproperties.h APP_LAYER_PLATFORM_EXPORT_PATH(musresourceproperties.h) diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharinguis_plat/multimedia_sharing_resource_api/inc/musresourceproperties.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharinguis_plat/multimedia_sharing_resource_api/inc/musresourceproperties.h Thu Jul 22 16:32:26 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: ?Description +* +*/ + + +#ifndef MUSRESOURCEPROPERTIES_H +#define MUSRESOURCEPROPERTIES_H + +#include + +/** + * A namespace container for MultimediaSharing Resource API constants. + * This namespace has PS keys for dynamic resource setting which is used + * in multimediasharing. + * + * For example : + * If a product program configures the cenrep value of + * MusSettingsKeys::KProductModeVariation ( refer mussettingskeys.h) + * bit#2 and bit#5 to 1 ( means dynamic availability ) then it is upto + * product program to inform multimediasharing when camera and keypad + * resources will be available. + * + * In a practical usecase a product has camera slider and it must configure + * cenrep value of MusSettingsKeys::KProductModeVariation bit#2 to 1. Also when + * camera slider is open then it should call + * + * RProperty::Set( NMusResourceApi::KCategoryUid, + * NMusResourceApi::KCameraAvailability, + * ( TInt ) NMusResourceApi::EAvailable ); + * + * When camera slider is closed , It must call + * + * RProperty::Set( NMusResourceApi::KCategoryUid, + * NMusResourceApi::KCameraAvailability, + * ( TInt ) NMusResourceApi::ENotAvailable ); + * + */ +namespace NMusResourceApi + { + /** The category of these P&S properties. */ +#ifndef UNIT_TESTING + const TUid KCategoryUid = { 0x101F85EE }; // UID3 of AO Server +#else + const TUid KCategoryUid = { 0x01700a21 }; // UID3 of EunitTest of AO +#endif + + /** Contains the availability state of camera resource. + * It can have one of the values of TAvailability. + */ + const TInt KCameraAvailability( 0x1028239B ); + + /** Contains the availability state of keypad resource. + * It can have one of the values of TAvailability. + */ + const TInt KKeypadAvailability( 0x1028239C ); + + /** Contains the availability state of video resource. + * It can have one of the values of TAvailability. + */ + const TInt KVideoPlayerAvailability( 0x1028239D ); + + /** Contains the possible values of availability properties. */ + enum TAvailability + { + EAvailable = 1, + ENotAvailable + }; + + /** Contains the identifier of the preferred camera. + * It can have one of the values of TCameraInformation + */ + const TInt KCameraInformation( 0x1028239E ); + + /** Contains the possible values of camera properties. */ + enum TCameraInformation + { + EUsePrimaryCamera = 1, + EUseSecondaryCamera + }; + + } + +#endif // MUSRESOURCEPROPERTIES_H \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharinguis_plat/multimedia_sharing_resource_api/multimedia_sharing_resource_api.metaxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharinguis_plat/multimedia_sharing_resource_api/multimedia_sharing_resource_api.metaxml Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,17 @@ + + + Multimedia Sharing Resource API + To provide properties defining the availability of required resources + c++ + mmsharing + + + + + + + + no + no + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharinguis_plat/multimedia_sharing_settings_api/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharinguis_plat/multimedia_sharing_settings_api/group/bld.inf Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,28 @@ +/* +* 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: File that exports the files belonging to +: Multimedia Sharing +Settings API +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +../inc/mussettingskeys.h APP_LAYER_PLATFORM_EXPORT_PATH(mussettingskeys.h) diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharinguis_plat/multimedia_sharing_settings_api/inc/mussettingskeys.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharinguis_plat/multimedia_sharing_settings_api/inc/mussettingskeys.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,285 @@ +/* +* 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: ?Description + +* +*/ + + +#ifndef MUSSETTINGSKEYS_H +#define MUSSETTINGSKEYS_H + +#include + +/** + * A namespace container for MultimediaSharing Settings API constants. + */ +namespace MusSettingsKeys + { + /** Repository uid */ + const TUid KRepositoryUid = { 0x1028238B }; + + /* Defines when MultimediaSharing is activated (always/in home networks/never). + Modified from the Settings UI of MultimediaSharing. */ + const TInt KActivation( 0x01 ); + /** Contains the possible values of KMusActivation key. */ + enum TActivation + { + EAlwaysActive, + EActiveInHomeNetworks, + ENever + }; + + /** Defines that should we act in a operator specific way. */ + const TInt KOperatorVariant( 0x2 ); + /** Contains the possible values of KOperatorVariant key. */ + enum TOperatorVariant + { + EStandard, + EOperatorSpecific + }; + + /** Defines that should a beep be played when MS becomes available. + Modified from the Settings UI of MultimediaSharing. */ + const TInt KAuditoryNotification( 0x03 ); + /** Contains the possible values of KMusAvailabilityAuditoryNotification key. */ + enum TAuditoryNotification + { + EAuditoryNotificationOn, + EAuditoryNotificationOff + }; + + /** Defines that should a popup dialog be shown when MS becomes available. + * @deprecated + */ + const TInt KPopupNotification( 0x04 ); + /** Contains the possible values of KMusAvailabilityPopupNotification key. + * @deprecated + */ + enum TPopupNotification + { + EPopupNotificationOn, + EPopupNotificationOff + }; + + /** @deprecated */ + const TInt KPopupNotificationType( 0x05 ); + /** @deprecated */ + enum TPopupNotificationType + { + ENotificationTypeQueryUser, + ENotificationTypePopup + }; + + /** Defines EDGE/DTM support. */ + const TInt KEdgeDtmSupport( 0x06 ); + /** Contains the possible values of KMusEdgeDtmSupport key. */ + enum TEdgeDtmSupport + { + EDtmModeAllowed, + EDtmModeNotAllowed + }; + + /** Defines that is short (IETF) or long (3GPP) way of initiating sessions used. */ + const TInt KForceInternetSignaling( 0x07 ); + /** Contains the possible values of KMusSessionSetupMethod key. */ + enum TForceInternetSignaling + { + EForceInternetSignaling, + EFollowProfileConfiguration + }; + + /** + Modified from the Settings UI of MultimediaSharing. */ + const TInt KAutoRecord( 0x08 ); + /** Contains the possible values of KAutoRecord key. */ + enum TAutoRecord + { + EAutoRecordOn, + EAutoRecordOff + }; + + /** + Modified from the Settings UI of MultimediaSharing. */ + const TInt KVideoLocation( 0x09 ); + + /** Defines the id of the SIP Profile to be used by MultimediaSharing. + Modified from the Settings UI of MultimediaSharing. */ + /** Contains an integer value. */ + const TInt KSipProfileId( 0x0A ); + + /** Defines the default orientation of the UI. */ + const TInt KUiOrientation( 0x0B ); + /** Contains the possible values of KMusUiOrientation key. */ + enum TUiOrientation + { + EPortrait, + ELandscape + }; + + /** Defines the type of SIP options. + Defines that how are SIP OPTIONS handled (3GPP / operator specific way?) */ + const TInt KCapabilityQuery( 0x0C ); + /** */ + enum TCapabilityQuery + { + ESequential, + EParallel, + ENoOptions + }; + + /** Defines the intial value for product mode variation key. + * The values should be constructed like below + * + * 7 = Most Significant Bit(MSB) and 0 = Least Significant Bit (LSB) + * 76543210 <-- bits 7 and 6 for the video player, + * 5, 4 and 3 for the keypad, + * 2, 1 and 0 for the camera + * + * Bit 1 & 0 : Camera Usability + * 00 - > Always + * 01 - > Only portrait + * 10 - > Only lanscape + * Bit 2 : Camera Availability + * 0 - > Static ( For example no camera lens cover) + * 1 - > Dynamic ( For example camera with lens cover) + * Bit 3 & 4 : Keypad Usuability + * 00 - > Always + * 01 - > Only portrait + * 10 - > Only lanscape + * Bit 5 : Keypad Availability + * 0 - > Static ( For example keypad Not covered) + * 1 - > Dynamic ( For example keypad covered) + * Bit 6 & 7 : Videoplayer Usability + * 00 - > Always + * 01 - > Only portrait + * 10 - > Only lanscape + * Note :Videoplayer availability will be always.There is no static + * and dynamic availability in videoplayer. + * + * Example : Bits set like + * 01110001 = 0x71 ( In hex format ) = 113 ( In integer format ) + * It will be intrepreted and used like + * a)Videoplayer is usable only in portrait and + * b)Keypad availability is dynamic and if it is available + * the can be used only in landscape mode. + * c)Camera availability is static and can be used only in + * portrait mode. + */ + const TInt KProductModeVariation( 0x0D ); + + enum TAvailability + { + EAvailabilityStatic, + EAvailabilityDynamic + }; + + enum TUsability + { + EUsabilityAlways, + EUsabilityPortrait, + EUsabilityLandscape + }; + + /** Concatenation of encoder configuration information. Information has been + * divided to tokens separated by a semicolon. Modified from the MusEngine. + * Contains a 8-bit descriptor value. + */ + const TInt KEncoderConfigurationInfo( 0x0E ); + + /** + * Contains UID of the encoding device meant to be used. Read by MuS Engine + */ + const TInt KEncodingDevice( 0x0F ); + + /** + * Defines whether multimediasharing is restricted to CS call type only. + * Default value will be 0 ( EFalse ) means it is allowed in all call types + * for example VOIP and Skype calls. + */ + const TInt KAllowOnlyWithActiveCSCall( 0x10 ); + /** Contains the possible values of KAllowedCSOnly key. */ + enum TAllowedCSOnly + { + EAllowedAllCalls, + EAllowedCSOnly + }; + + /** + * Defines whether multimediasharing is restricted to 3G bearer only. + * Default value will be 0 ( EFalse ) means it is allowed in all bearer types + * for example 3G,WLAN etc. + */ + const TInt KAllowOnlyIn3GNetwork( 0x11 ); + /** Contains the possible values of KAllowed3GOnly key. */ + enum TAllowed3GOnly + { + EAllowedAllBearers, + EAllowed3GOnly + }; + + /** + * Defines which and how cameras are used. The default value + * is EUseCameraSwapping. To disable camera swapping and roll back + * old behaviuor, value must be set to EUseOnlyMainCamera. + * to the menu or to the toolbar. + */ + const TInt KCameraUsage( 0x12 ); + + /** Contains the possible values of KCameraUsage key. */ + enum TUseCamera + { + EUseOnlyMainCamera, + EUseOnlySecondaryCamera, + EUseCameraSwapping + }; + + /** + * Defines whether multimediasharing is supporting 2-way video. The + * default value is EOneWayVideo. + */ + const TInt KVideoDirection( 0x13 ); + + /** Contains the possible values of KVideoDirection key. */ + enum TVideoDirection + { + EOneWayVideo, + ETwoWayVideo + }; + + /** + * Defines whether b=AS and b=TIAS SDP attributes are used. Zero value + * means that usage of TIAS is disabled, only AS will be used (hard coded + * value). Positive value means AS in KBits per second. TIAS value will + * be set to AS multiplied by 1000. + */ + const TInt KVideoBandwidth( 0x14 ); + + /** + * Defines whether multimediasharing is supporting fast startup mode + */ + const TInt KFastStartupMode( 0x15 ); + + /** Contains the possible values of KFastStartupMode key. */ + enum TFastMode + { + EFastModeOn, + EFastModeOff, + EFastModeDisabled + }; + } + + +#endif // MUSSETTINGSKEYS_H + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmsharinguis_plat/multimedia_sharing_settings_api/multimedia_sharing_settings_api.metaxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmsharinguis_plat/multimedia_sharing_settings_api/multimedia_sharing_settings_api.metaxml Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,17 @@ + + + Multimedia Sharing Settings API + To provide permanent settings for Multimedia Sharing + c++ + mmsharing + + + + + + + + no + no + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/group/bld.inf Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,28 @@ +/* +* 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: project specification +* +*/ +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_MMPFILES +#include "../mmshaoplugin/group/bld.inf" +#include "../mmshaiwplugin/group/bld.inf" +#include "../mmshsipcrplugin/group/bld.inf" +//#include "../mmshsettingsuiplugin/group/bld.inf" +#include "../mmshwpadapterplugin/group/bld.inf" +//#include "../mmcctranscoder/group/bld.inf" diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmcctranscoder/data/10282896.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmcctranscoder/data/10282896.rss Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2002-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: +* +*/ + + +// INCLUDES +#include "RegistryInfo.rh" +#include "transcoderuids.hrh" +#include "../../../inc/musversionnumbers.h" + +// RESOURCE DEFINITIONS + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = KDllUidTranscoder; + interfaces = + { + INTERFACE_INFO + { + interface_uid = KMmfUidPluginInterfaceTranscoder; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = KImplUidTranscoder; + version_no = KMusEcomVersionNumber; + display_name = "Transcoder"; + default_data = ""; + opaque_data = ""; + } + }; + } + }; + } + +// End of File + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmcctranscoder/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmcctranscoder/group/bld.inf Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,21 @@ +/* +* Copyright (c) 2002-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: Build info +* +*/ +#include + +PRJ_MMPFILES +transcoder.mmp + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmcctranscoder/group/transcoder.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmcctranscoder/group/transcoder.mmp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,54 @@ +/* +* 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: Project definition file for MCC transcoder +* +*/ + +#include + +TARGET mmcctranscoder.dll + +CAPABILITY CAP_ECOM_PLUGIN +VENDORID VID_DEFAULT +TARGETTYPE PLUGIN + +UID 0x10009D8D 0x10282896 + +SOURCEPATH ../src +SOURCE transcoder.cpp +SOURCE transcoderimpl.cpp +SOURCE transcoderimplementationproxy.cpp +SOURCE transcodercodecinfo.cpp +SOURCE transcoderaudiocodec.cpp +SOURCE transcodervideocodec.cpp +SOURCE transcodersessioninfo.cpp + + +USERINCLUDE ../inc + +APP_LAYER_SYSTEMINCLUDE + +SOURCEPATH ../data + +START RESOURCE 10282896.rss +TARGET mmcctranscoder.rsc +END + +LIBRARY euser.lib +LIBRARY mmfserverbaseclasses.lib +LIBRARY ecom.lib +LIBRARY mmfcontrollerframework.lib +LIBRARY vedengine.lib + +PAGED diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmcctranscoder/inc/mcctranscoderlogs.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmcctranscoder/inc/mcctranscoderlogs.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,87 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef MCCTRANSCODERLOGS_H +#define MCCTRANSCODERLOGS_H + +#ifdef _DEBUG + +#include +#include + +class TMccTranscoderLog; + +_LIT( KAnyFormat, "Mcc/Transcoder:" ); +_LIT( KMccTranscoderLogWarning, "Mcc: Text contains not allowed characters, log ignored" ); + +#define __TRANSCODER( a ) \ + { _LIT( KStr, a ); TMccTranscoderLog::Print( KAnyFormat, KStr ); } +#define __TRANSCODER_INT1( a, b ) \ + { _LIT( KStr, a ); TMccTranscoderLog::Print( KAnyFormat, KStr, b ); } + +class TMccTranscoderLog + { + public: + + inline static void Print( const TDesC16& aName, const TDesC16& aStr ) + { + TChar notAllowed('%'); + if ( aStr.Locate( notAllowed ) == KErrNotFound ) + { + TBuf<256> str; + _LIT( KMcc, "%S %S" ); + str.Format( KMcc(), &aName, &aStr ); + RDebug::Print(str); + } + else + { + RDebug::Print( KMccTranscoderLogWarning ); + } + } + + inline static void Print( + const TDesC16& aName, + const TDesC16& aStr, + TInt aValue ) + { + TChar notAllowed('%'); + if ( aStr.Locate( notAllowed ) == KErrNotFound ) + { + TBuf<256> str; + _LIT( KMcc, "%S %S %d" ); + str.Format( KMcc(), &aName, &aStr, aValue ); + RDebug::Print(str); + } + else + { + RDebug::Print( KMccTranscoderLogWarning ); + } + } + + }; + +#else + +#define __TRANSCODER( a ) +#define __TRANSCODER_INT1( a, b ) + +#endif + +#endif // End of define MCCTRANSCODERLOGS_H + +// end of file \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmcctranscoder/inc/transcoderaudiocodec.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmcctranscoder/inc/transcoderaudiocodec.h Thu Jul 22 16:32:26 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: +* +*/ + + + +#ifndef MCCTRANSCODER_AUDIO_CODEC_H +#define MCCTRANSCODER_AUDIO_CODEC_H + +// INCLUDES +#include "transcodercodecinfo.h" + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// CLASS DECLARATION + +/** +* Container class for the codec information. +* +*/ +class CMccTranscoderAudioCodec : public CMccTranscoderCodecInfo + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CMccTranscoderAudioCodec* NewL(); + + /** + * Destructor. + */ + virtual ~CMccTranscoderAudioCodec(); + + public: // New functions + + + + void SetBitrate( TInt aBitrate ); + + TInt Bitrate(); + + void SetSamplingRate( TInt aSamplingRate ); + + TInt SamplingRate(); + + protected: // New functions + + protected: // Functions from base classes + + private: + + /** + * C++ default constructor. + */ + CMccTranscoderAudioCodec(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + public: // Data + + protected: // Data + + private: // Data + + public: // Friend classes + + protected: // Friend classes + + private: // Friend classes + + }; + +#endif // MCCTRANSCODER_AUDIO_CODEC_H + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmcctranscoder/inc/transcodercodecinfo.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmcctranscoder/inc/transcodercodecinfo.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,113 @@ +/* +* 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 is used for configuring media codecs. +* +*/ + + +#ifndef _MCCTRANSCODERCODECINFO_H +#define _MCCTRANSCODERCODECINFO_H + +// INCLUDES +#include +#include +#include +#include + + +// CLASS DECLARATION +/** +* Container class for the transcoder codec information. +* +* @lib mmccinterface.dll +*/ +class CMccTranscoderCodecInfo : public CBase +{ +public: // Constructors and destructor + + /** + * Destructor. + */ + virtual ~CMccTranscoderCodecInfo(); + +protected: // New functions + + /** + * C++ default constructor. + */ + CMccTranscoderCodecInfo(); + +public: // New functions + + + virtual void SetBitrate( TInt aBitrate ) = 0; + + virtual TInt Bitrate() = 0; + + virtual void SetSamplingRate( TInt aSamplingRate ) = 0; + + virtual TInt SamplingRate() = 0; + + + +public: // get + + virtual void SetVideoType( TVedVideoType aType); + + virtual TVedVideoType VideoType(); + + virtual void SetAudioType( TVedAudioType aType); + + virtual TVedAudioType AudioType(); + + virtual void SetFrameRate( TReal aFrameRate ); + + virtual TReal FrameRate(); + + virtual void SetAudioChannelMode( TVedAudioChannelMode aMode ); + + virtual TVedAudioChannelMode AudioChannelMode(); + + virtual void SetVideoResolution( TSize aVideoResolution ); + + virtual TSize VideoResolution(); + + +private: + + +protected: // Data + + TVedVideoType iVideoType; + TSize iVideoResolution; + TInt iBitrate; + TReal iFrameRate; + + TVedAudioType iAudioType; + TVedAudioChannelMode iAudioChannelMode; + TInt iSamplingRate; + +private: + + + +}; + + + + + +#endif // MCCTRANSCODERCODECINFO_H + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmcctranscoder/inc/transcoderimpl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmcctranscoder/inc/transcoderimpl.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,229 @@ +/* +* Copyright (c) 2002-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: +* +*/ + + +#ifndef MCC_TRANSCODER_IMPL_H +#define MCC_TRANSCODER_IMPL_H + +// INCLUDES +#include +#include +#include + +#include "mmccevents.h" +#include "mmcctranscoder.h" +#include "transcodersessioninfo.h" + +// CLASS DECLARATION +class MMccEventHandler; + + +/** +* class CMccTranscoderImpl +*/ +class CMccTranscoderImpl : public CBase, + public MVedMovieObserver, + public MVedMovieProcessingObserver + { + public: // Constructors and destructor + /** + * Two-phased constructor. + */ + static CMccTranscoderImpl* NewL(); + + /** + * Destructor. + */ + virtual ~CMccTranscoderImpl(); + + public: // New functions + + void RegisterEventObserver( MMccTranscoderObserver& aObserver ); + + void UnregisterEventObserver(); + + void TranscodeFileL( TUint32& aSessionId, const TDesC8& aVal ); + /** + * Cancels transcoding of media file. + * @param aSessionId session identifier for transcoding + * @return KErrNone if successful + */ + void CancelTranscodeFileL( TUint32 aSessionId ); + + public: // MVedMovieObserver functions + + void NotifyVideoClipAdded(CVedMovie& aMovie, TInt aIndex); + + void NotifyVideoClipAddingFailed(CVedMovie& aMovie, TInt aError); + + + void NotifyVideoClipRemoved(CVedMovie& aMovie, TInt aIndex); + + void NotifyMovieQualityChanged(CVedMovie& aMovie); + + void NotifyMovieOutputParametersChanged(CVedMovie& aMovie); + + + inline void NotifyVideoClipIndicesChanged( + CVedMovie& aMovie, + TInt aOldIndex, + TInt aNewIndex); + + + inline void NotifyVideoClipTimingsChanged( + CVedMovie& aMovie, + TInt aIndex); + + inline void NotifyVideoClipColorEffectChanged( + CVedMovie& aMovie, + TInt aIndex); + + + inline void NotifyVideoClipAudioSettingsChanged( + CVedMovie& aMovie, + TInt aIndex); + + + inline void NotifyVideoClipGeneratorSettingsChanged( + CVedMovie& aMovie, + TInt aIndex); + + inline void NotifyVideoClipDescriptiveNameChanged( + CVedMovie& aMovie, + TInt aIndex); + + inline void NotifyStartTransitionEffectChanged( + CVedMovie& aMovie); + + inline void NotifyMiddleTransitionEffectChanged( + CVedMovie& aMovie, + TInt aIndex); + + inline void NotifyEndTransitionEffectChanged( + CVedMovie& aMovie); + + inline void NotifyAudioClipAdded( + CVedMovie& aMovie, TInt aIndex ); + + inline void NotifyAudioClipAddingFailed( + CVedMovie& aMovie, TInt aError); + + inline void NotifyAudioClipRemoved( + CVedMovie& aMovie, TInt aIndex); + + inline void NotifyAudioClipIndicesChanged( + CVedMovie& aMovie, + TInt aOldIndex, + TInt aNewIndex); + + inline void NotifyAudioClipTimingsChanged( + CVedMovie& aMovie, TInt aIndex); + + inline void NotifyMovieReseted(CVedMovie& aMovie); + + inline void NotifyAudioClipDynamicLevelMarkInserted(CVedMovie& aMovie, + TInt aClipIndex, + TInt aMarkIndex); + + inline void NotifyAudioClipDynamicLevelMarkRemoved(CVedMovie& aMovie, + TInt aClipIndex, + TInt aMarkIndex); + + inline void NotifyVideoClipDynamicLevelMarkInserted(CVedMovie& aMovie, + TInt aClipIndex, + TInt aMarkIndex); + + inline void NotifyVideoClipDynamicLevelMarkRemoved(CVedMovie& aMovie, + TInt aClipIndex, + TInt aMarkIndex); + + + public: // MVedMovieProcessingObserver + + void NotifyMovieProcessingStartedL(CVedMovie& aMovie); + + void NotifyMovieProcessingProgressed( CVedMovie& aMovie, TInt aPercentage ); + + void NotifyMovieProcessingCompleted(CVedMovie& aMovie, + TInt aError); + + protected: // Functions from base classes + + private: + /** + * C++ default constructor. + */ + CMccTranscoderImpl(); + + /** + * By default Symbian 2nd phase constructor is private. + * + * @param aSource Source of the data for the payload format plugin + */ + void ConstructL(); + + private: + + /** + * @param aSessionId find session by ID + * @return KErrNotFound if can not found, otherwise + * return session index. + */ + TInt FindSession( TUint32 aSessionId ); + + /** + * @param aMovie find session by CVedMovie object + * @return KErrNotFound if can not found, otherwise + * return session index. + */ + TInt FindSession( CVedMovie& aMovie ); + + void RemoveSession( const TInt aIndex ); + + void SendTranscodeEventToClient( TMccEventType aEventType, + TInt aError, + TUint32 aSessionId, + TUint32 aData = 0 ); + + void Cleanup(); + + void InitiateCleanup(); + + static TInt AsyncTimerExpired( TAny* aPtr ); + + void SetOutputParameters( CVedMovie& aMovie ); + + private: // data + + RPointerArray iSessionArray; + + MMccTranscoderObserver* iEventObserver; + + CDeltaTimer* iDeltaTimer; + TCallBack iDeltaTimerCallBack; + TDeltaTimerEntry iDeltaTimerEntry; + + private: // Friend classes + + #ifdef EUNIT_TEST + friend class UT_CMccTranscoderImpl; + #endif + }; + +#include "transcoderimpl.inl" + +#endif // end of MCC_TRANSCODER_IMPL_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmcctranscoder/inc/transcoderimpl.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmcctranscoder/inc/transcoderimpl.inl Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,251 @@ +/* +* 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: +* +*/ + + +#ifndef MCCTRANSCODER_INL +#define MCCTRANSCODER_INL + +// INCLUDE FILES +#include +#include + + +// EXTERNAL DATA STRUCTURES + +// EXTERNAL FUNCTION PROTOTYPES + +// CONSTANTS + +// MACROS + +// LOCAL CONSTANTS AND MACROS + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// ============================= LOCAL FUNCTIONS =============================== + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CMccTranscoderImpl::NotifyVideoClipIndicesChanged +// ----------------------------------------------------------------------------- +// +inline void CMccTranscoderImpl::NotifyVideoClipIndicesChanged( + CVedMovie& /*aMovie*/, + TInt /*aOldIndex*/, + TInt /*aNewIndex*/ ) + { + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderImpl::NotifyVideoClipTimingsChanged +// ----------------------------------------------------------------------------- +// +inline void CMccTranscoderImpl::NotifyVideoClipTimingsChanged( + CVedMovie& /*aMovie*/, + TInt /*aIndex*/ ) + { + + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderImpl::NotifyVideoClipColorEffectChanged +// ----------------------------------------------------------------------------- +// +inline void CMccTranscoderImpl::NotifyVideoClipColorEffectChanged( + CVedMovie& /*aMovie*/, + TInt /*aIndex*/ ) + { + + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderImpl::NotifyVideoClipAudioSettingsChanged +// ----------------------------------------------------------------------------- +// +inline void CMccTranscoderImpl::NotifyVideoClipAudioSettingsChanged( + CVedMovie& /*aMovie*/, + TInt /*aIndex*/) + { + + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderImpl::NotifyVideoClipGeneratorSettingsChanged +// ----------------------------------------------------------------------------- +// +inline void CMccTranscoderImpl::NotifyVideoClipGeneratorSettingsChanged( + CVedMovie& /*aMovie*/, + TInt /*aIndex*/) + { + + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderImpl::NotifyVideoClipDescriptiveNameChanged +// ----------------------------------------------------------------------------- +// +inline void CMccTranscoderImpl::NotifyVideoClipDescriptiveNameChanged( + CVedMovie& /*aMovie*/, + TInt /*aIndex*/) + { + + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderImpl::NotifyStartTransitionEffectChanged +// ----------------------------------------------------------------------------- +// +inline void CMccTranscoderImpl::NotifyStartTransitionEffectChanged( + CVedMovie& /*aMovie*/ ) + { + + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderImpl::NotifyMiddleTransitionEffectChanged +// ----------------------------------------------------------------------------- +// +inline void CMccTranscoderImpl::NotifyMiddleTransitionEffectChanged( + CVedMovie& /*aMovie*/, + TInt /*aIndex*/ ) + { + + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderImpl::NotifyEndTransitionEffectChanged +// ----------------------------------------------------------------------------- +// +inline void CMccTranscoderImpl::NotifyEndTransitionEffectChanged( + CVedMovie& /*aMovie*/ ) + { + + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderImpl::NotifyAudioClipAdded +// ----------------------------------------------------------------------------- +// +inline void CMccTranscoderImpl::NotifyAudioClipAdded( + CVedMovie& /*aMovie*/, TInt /*aIndex*/ ) + { + + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderImpl::NotifyAudioClipAddingFailed +// ----------------------------------------------------------------------------- +// +inline void CMccTranscoderImpl::NotifyAudioClipAddingFailed( + CVedMovie& /*aMovie*/, TInt /*aError*/ ) + { + + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderImpl::NotifyAudioClipRemoved +// ----------------------------------------------------------------------------- +// +inline void CMccTranscoderImpl::NotifyAudioClipRemoved( + CVedMovie& /*aMovie*/, TInt /*aIndex*/ ) + { + + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderImpl::NotifyAudioClipIndicesChanged +// ----------------------------------------------------------------------------- +// +inline void CMccTranscoderImpl::NotifyAudioClipIndicesChanged( + CVedMovie& /*aMovie*/, + TInt /*aOldIndex*/, + TInt /*aNewIndex*/) + { + + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderImpl::NotifyAudioClipTimingsChanged +// ----------------------------------------------------------------------------- +// +inline void CMccTranscoderImpl::NotifyAudioClipTimingsChanged( + CVedMovie& /*aMovie*/, TInt /*aIndex*/) + { + + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderImpl::NotifyMovieReseted +// ----------------------------------------------------------------------------- +// +inline void CMccTranscoderImpl::NotifyMovieReseted( CVedMovie& /*aMovie*/ ) + { + + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderImpl::NotifyAudioClipDynamicLevelMarkInserted +// ----------------------------------------------------------------------------- +// +inline void CMccTranscoderImpl::NotifyAudioClipDynamicLevelMarkInserted(CVedMovie& /*aMovie*/, + TInt /*aClipIndex*/, + TInt /*aMarkIndex*/) + { + + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderImpl::NotifyAudioClipDynamicLevelMarkRemoved +// ----------------------------------------------------------------------------- +// +inline void CMccTranscoderImpl::NotifyAudioClipDynamicLevelMarkRemoved(CVedMovie& /*aMovie*/, + TInt /*aClipIndex*/, + TInt /*aMarkIndex*/) + { + + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderImpl::NotifyVideoClipDynamicLevelMarkInserted +// ----------------------------------------------------------------------------- +// +inline void CMccTranscoderImpl::NotifyVideoClipDynamicLevelMarkInserted(CVedMovie& /*aMovie*/, + TInt /*aClipIndex*/, + TInt /*aMarkIndex*/) + { + + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderImpl::NotifyVideoClipDynamicLevelMarkRemoved +// ----------------------------------------------------------------------------- +// +inline void CMccTranscoderImpl::NotifyVideoClipDynamicLevelMarkRemoved(CVedMovie& /*aMovie*/, + TInt /*aClipIndex*/, + TInt /*aMarkIndex*/) + { + + } + +#endif // MCCTRANSCODER_INL + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmcctranscoder/inc/transcodersessioninfo.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmcctranscoder/inc/transcodersessioninfo.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,141 @@ +/* +* Copyright (c) 2002-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: +* +*/ + + +#ifndef MCC_TRANSCODER_SESSION_INFO_H +#define MCC_TRANSCODER_SESSION_INFO_H + +// INCLUDES +#include +#include + +#include "transcodervideocodec.h" +#include "transcoderaudiocodec.h" +#include "mcctranscoderlogs.h" + +class TMccTranscoderCodecInfo; +/** +* +*/ +class CMccTranscoderSessionInfo : public CBase + { + public: // Constructors and destructor + /** + * Two-phased constructor. + */ + static CMccTranscoderSessionInfo* NewLC(); + + /** + * Destructor. + */ + virtual ~CMccTranscoderSessionInfo(); + + public: // New functions + + + TUint32 SessionId(); + + void GenerateSessionId(); + + void SetQuality( TUint32 aQuality ); + + void CreateMovieL(); + + CVedMovie& Movie(); + + + CVedMovie::TVedMovieQuality Quality(); + + void SetDesFileL( const TDesC& aFileName ); + + const TDesC& DesFile(); + + + CMccTranscoderVideoCodec& VideoCodec(); + + void SetVideoCodec( CMccTranscoderVideoCodec* aCodec ); + + + CMccTranscoderAudioCodec& AudioCodec(); + + void SetAudioCodec( CMccTranscoderAudioCodec* aCodec ); + + + + void SetVideoType( const TDesC8& aSdpNam, + const TInt aVideoBitRate ); + + void SetAudioType( const TDesC8& aSdpNam ); + + void CheckVideoCodecL( const TMccTranscoderCodecInfo& aCodecInfo ); + + void CheckAudioCodecL( const TMccTranscoderCodecInfo& aCodecInfo ); + + void GetPutputParameters( TVedOutputParameters& params ); + + void SetRemoved( TBool aIsRemoved ); + + TBool IsRemoved() const; + + TInt Progressed( TInt aProgressPercentage ); + + void ClipAdded(); + + TBool QualityChangeNeeded(); + + protected: // Functions from base classes + + private: + /** + * C++ default constructor. + */ + CMccTranscoderSessionInfo(); + + /** + * By default Symbian 2nd phase constructor is private. + * + * @param aSource Source of the data for the payload format plugin + */ + void ConstructL(); + + private: + + TInt CalculateVideoBitrate( CVedMovie& aMovie ); + + private: // data + + TUint32 iSessionId; + CVedMovie* iMovie; + CVedMovie::TVedMovieQuality iQuality; + TFileName iDesFile; + CMccTranscoderVideoCodec* iVideoCodec; + CMccTranscoderAudioCodec* iAudioCodec; + TBool iIsRemoved; + TBool iAudioNotPresent; + TInt iSyncIntervalInPicture; + TInt iSegmentSizeInBytes; + + + private: // Friend classes + + #ifdef EUNIT_TEST + friend class UT_CMccTranscoderSessionInfo; + #endif + }; + + +#endif // end of MCC_TRANSCODER_SESSION_INFO_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmcctranscoder/inc/transcoderuids.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmcctranscoder/inc/transcoderuids.hrh Thu Jul 22 16:32:26 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: UIDs for transcoder +* +*/ + + +#ifndef TRANSCODERUIDS_HRH +#define TRANSCODERUIDS_HRH + +// ----------------------------------------------------------------------------- +// TRANSCODER +// ----------------------------------------------------------------------------- +// Plugin DLL UID +#define KDllUidTranscoder 0x10282896 + +// Interface Implementation UID +#define KImplUidTranscoder 0x10282897 + +// Plugin Interface UID +#define KMmfUidPluginInterfaceTranscoder 0x10282898 + +#endif /* TRANSCODERUIDS_HRH */ + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmcctranscoder/inc/transcodervideocodec.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmcctranscoder/inc/transcodervideocodec.h Thu Jul 22 16:32:26 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: +* +*/ + + + +#ifndef MCCTRANSCODER_VIDEO_CODEC_H +#define MCCTRANSCODER_VIDEO_CODEC_H + +// INCLUDES +#include "transcodercodecinfo.h" + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// CLASS DECLARATION + +/** +* Container class for the codec information. +* +*/ +class CMccTranscoderVideoCodec : public CMccTranscoderCodecInfo + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CMccTranscoderVideoCodec* NewL(); + + /** + * Destructor. + */ + virtual ~CMccTranscoderVideoCodec(); + + public: // New functions + + public: // Functions from base classes + + public: // From CMccCodecInformation + + void SetBitrate( TInt aBitrate ); + + TInt Bitrate(); + + void SetSamplingRate( TInt aSamplingRate ); + + TInt SamplingRate(); + + protected: // New functions + + protected: // Functions from base classes + + private: + + /** + * C++ default constructor. + */ + CMccTranscoderVideoCodec(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + public: // Data + + protected: // Data + + private: // Data + + public: // Friend classes + + protected: // Friend classes + + private: // Friend classes + + }; + +#endif // MCCTRANSCODER_VIDEO_CODEC_H + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmcctranscoder/src/transcoder.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmcctranscoder/src/transcoder.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,132 @@ +/* +* Copyright (c) 2002-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: +* +*/ + + +// INCLUDE FILES +#include +#include +#include +#include +#include + +#include "transcoderimpl.h" +#include "mcctranscoderlogs.h" + + + +// ============================= LOCAL FUNCTIONS =============================== + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CMccTranscoder::CMccTranscoder +// +// CMccTranscoder default constructor, can NOT contain any code, +// that might leave +// Phase #1 of 2-phase constructor +// ----------------------------------------------------------------------------- +// +CMccTranscoder::CMccTranscoder() + { + + } + +// ----------------------------------------------------------------------------- +// CMccTranscoder::NewL +// ----------------------------------------------------------------------------- +// +CMccTranscoder* CMccTranscoder::NewL() + { + CMccTranscoder* self = new ( ELeave ) CMccTranscoder; + CleanupStack::PushL ( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CMccTranscoder::ConstructL +// ----------------------------------------------------------------------------- +// +void CMccTranscoder::ConstructL() + { + iTranscoderImpl = CMccTranscoderImpl::NewL(); + } + +// ----------------------------------------------------------------------------- +// CMccTranscoder::~CMccTranscoder +// ----------------------------------------------------------------------------- +// +CMccTranscoder::~CMccTranscoder() + { + delete iTranscoderImpl; + } + +// ----------------------------------------------------------------------------- +// CMccTranscoder::RegisterEventObserver +// ----------------------------------------------------------------------------- +// +void CMccTranscoder::RegisterEventObserver( MMccTranscoderObserver& aObserver ) + { + __TRANSCODER( "CMccTranscoder::RegisterEventObserver" ) + + if ( iTranscoderImpl ) + { + iTranscoderImpl->RegisterEventObserver( aObserver ); + } + } + +// ----------------------------------------------------------------------------- +// CMccTranscoder::UnregisterEventObserver +// ----------------------------------------------------------------------------- +// +void CMccTranscoder::UnregisterEventObserver() + { + __TRANSCODER( "CMccTranscoder::UnregisterEventObserver" ) + + if ( iTranscoderImpl ) + { + iTranscoderImpl->UnregisterEventObserver(); + } + } + +// ----------------------------------------------------------------------------- +// CMccTranscoder::TranscodeFile +// ----------------------------------------------------------------------------- +// +void CMccTranscoder::TranscodeFileL( TUint32& aSessionId, const TDesC8& aVal ) + { + __ASSERT_ALWAYS( iTranscoderImpl, User::Leave( KErrNotReady ) ); + + iTranscoderImpl->TranscodeFileL( aSessionId, aVal); + } + +// ----------------------------------------------------------------------------- +// CMccTranscoder::CancelTranscodeFile +// ----------------------------------------------------------------------------- +// +void CMccTranscoder::CancelTranscodeFileL( TUint32 aSessionId ) + { + __TRANSCODER( "CMccTranscoder::CancelTranscodeFileL" ) + + iTranscoderImpl->CancelTranscodeFileL( aSessionId ); + } + + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmcctranscoder/src/transcoderaudiocodec.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmcctranscoder/src/transcoderaudiocodec.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,115 @@ +/* +* Copyright (c) 2002-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: +* +*/ + + +// INCLUDE FILES + +#include "transcoderaudiocodec.h" + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// ============================= LOCAL FUNCTIONS =============================== + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CMccTranscoderAudioCodec::CMccTranscoderAudioCodec +// default constructor +// ----------------------------------------------------------------------------- +// +CMccTranscoderAudioCodec::CMccTranscoderAudioCodec() + { + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderAudioCodec::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CMccTranscoderAudioCodec::ConstructL( ) + { + + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderAudioCodec::NewL +// Static constructor. +// ----------------------------------------------------------------------------- +// +CMccTranscoderAudioCodec* CMccTranscoderAudioCodec::NewL() + { + CMccTranscoderAudioCodec* self = new (ELeave) CMccTranscoderAudioCodec; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderAudioCodec::~CMccTranscoderAudioCodec +// Destructor +// ----------------------------------------------------------------------------- +// +CMccTranscoderAudioCodec::~CMccTranscoderAudioCodec() + { + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderAudioCodec::SetBitrate +// Destructor +// ----------------------------------------------------------------------------- +// +void CMccTranscoderAudioCodec::SetBitrate( TInt aBitrate ) + { + iBitrate = aBitrate; + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderAudioCodec::Bitrate +// Destructor +// ----------------------------------------------------------------------------- +// +TInt CMccTranscoderAudioCodec::Bitrate() + { + return iBitrate; + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderAudioCodec::SetSamplingRate +// Destructor +// ----------------------------------------------------------------------------- +// +void CMccTranscoderAudioCodec::SetSamplingRate( TInt aSamplingRate ) + { + iSamplingRate = aSamplingRate; + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderAudioCodec::SamplingRate +// Destructor +// ----------------------------------------------------------------------------- +// +TInt CMccTranscoderAudioCodec::SamplingRate() + { + return iSamplingRate; + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmcctranscoder/src/transcodercodecinfo.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmcctranscoder/src/transcodercodecinfo.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,163 @@ +/* +* Copyright (c) 2002-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: +* +*/ + + +#include "transcodercodecinfo.h" + +// INCLUDE FILES + +// EXTERNAL DATA STRUCTURES + +// EXTERNAL FUNCTION PROTOTYPES + +// CONSTANTS + +// MACROS + +// LOCAL CONSTANTS AND MACROS + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// ============================= LOCAL FUNCTIONS =============================== + + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// CMccTranscoderCodecInfo::CMccTranscoderCodecInfo +// default constructor +// ----------------------------------------------------------------------------- +// +CMccTranscoderCodecInfo::CMccTranscoderCodecInfo() : + iVideoType( EVedVideoTypeUnrecognized ), + iVideoResolution( TSize( 0, 0 ) ), + iBitrate( 0 ), + iFrameRate( 0 ), + iAudioType( EVedAudioTypeUnrecognized ), + iAudioChannelMode( EVedAudioChannelModeSingleChannel ), + iSamplingRate( 0 ) + { + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderCodecInfo::~CMccTranscoderCodecInfo +// Destructor +// ----------------------------------------------------------------------------- +// +CMccTranscoderCodecInfo::~CMccTranscoderCodecInfo() + { + + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderCodecInfo::SetAudioType +// ----------------------------------------------------------------------------- +// +void CMccTranscoderCodecInfo::SetAudioType( TVedAudioType aType ) + { + iAudioType = aType; + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderCodecInfo::AudioType +// ----------------------------------------------------------------------------- +// +TVedAudioType CMccTranscoderCodecInfo::AudioType() + { + return iAudioType; + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderCodecInfo::SetAudioChannelMode +// ----------------------------------------------------------------------------- +// +void CMccTranscoderCodecInfo::SetAudioChannelMode( TVedAudioChannelMode aMode ) + { + iAudioChannelMode = aMode; + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderCodecInfo::AudioChannelMode +// ----------------------------------------------------------------------------- +// +TVedAudioChannelMode CMccTranscoderCodecInfo::AudioChannelMode() + { + return iAudioChannelMode; + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderCodecInfo::SetVideoType +// +// ----------------------------------------------------------------------------- +// +void CMccTranscoderCodecInfo::SetVideoType( TVedVideoType aType ) + { + iVideoType = aType; + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderCodecInfo::VideoType +// ----------------------------------------------------------------------------- +// +TVedVideoType CMccTranscoderCodecInfo::VideoType() + { + return iVideoType; + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderCodecInfo::SetFrameRate +// ----------------------------------------------------------------------------- +// +void CMccTranscoderCodecInfo::SetFrameRate( TReal aFrameRate ) + { + iFrameRate = aFrameRate; + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderCodecInfo::FrameRate +// ----------------------------------------------------------------------------- +// +TReal CMccTranscoderCodecInfo::FrameRate() + { + return iFrameRate; + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderCodecInfo::SetVideoResolution +// ----------------------------------------------------------------------------- +// +void CMccTranscoderCodecInfo::SetVideoResolution( TSize aVideoResolution ) + { + iVideoResolution = aVideoResolution; + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderCodecInfo::VideoResolution +// ----------------------------------------------------------------------------- +// +TSize CMccTranscoderCodecInfo::VideoResolution() + { + return iVideoResolution; + } + + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmcctranscoder/src/transcoderimpl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmcctranscoder/src/transcoderimpl.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,653 @@ +/* +* Copyright (c) 2002-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: +* +*/ + + +// INCLUDE FILES +#include + +#include "transcoderimpl.h" +#include "mcctranscoderlogs.h" + +const TInt KMccTranscodingCompletedPercentage = 100; + +const TInt KMccTranscoderCleanupTimerMicrosecs = 10000; // 10ms + +const TInt KMccTranscoderProgressNotifFreq = 10; + +// ============================= LOCAL FUNCTIONS =============================== + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CMccTranscoderImplImpl::CMccTranscoderImpl +// +// CMccTranscoderImpl default constructor, can NOT contain any code, +// that might leave +// Phase #1 of 2-phase constructor +// ----------------------------------------------------------------------------- +// +CMccTranscoderImpl::CMccTranscoderImpl() : + iDeltaTimerCallBack( AsyncTimerExpired, this ) + { + iDeltaTimerEntry.Set( iDeltaTimerCallBack ); + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderImpl::NewL +// ----------------------------------------------------------------------------- +// +CMccTranscoderImpl* CMccTranscoderImpl::NewL() + { + CMccTranscoderImpl* self = new ( ELeave ) CMccTranscoderImpl; + CleanupStack::PushL ( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderImpl::ConstructL +// ----------------------------------------------------------------------------- +// +void CMccTranscoderImpl::ConstructL() + { + __TRANSCODER( "CMccTranscoderImpl::ConstructL" ) + + iDeltaTimer = CDeltaTimer::NewL( CActive::EPriorityStandard ); + + __TRANSCODER( "CMccTranscoderImpl::ConstructL, exit" ) + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderImpl::~CMccTranscoderImpl +// ----------------------------------------------------------------------------- +// +CMccTranscoderImpl::~CMccTranscoderImpl() + { + __TRANSCODER( "CMccTranscoderImpl::~CMccTranscoderImpl" ) + + // Stop cleanup timer + if ( iDeltaTimer ) + { + iDeltaTimer->Remove( iDeltaTimerEntry ); + } + delete iDeltaTimer; + + // Delete sessions + TInt sessionCount = iSessionArray.Count(); + + for ( TInt i = ( sessionCount - 1 ); i >= 0 ; i-- ) + { + CMccTranscoderSessionInfo* session = iSessionArray[i]; + CVedMovie* movie = &(session->Movie()); + if ( movie && !session->IsRemoved() ) + { + movie->UnregisterMovieObserver( this ); + } + } + + iSessionArray.ResetAndDestroy(); + iSessionArray.Close(); + + __TRANSCODER( "CMccTranscoderImpl::~CMccTranscoderImpl, exit" ) + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderImpl::RegisterEventObserver +// ----------------------------------------------------------------------------- +// +void CMccTranscoderImpl::RegisterEventObserver( MMccTranscoderObserver& aObserver ) + { + __TRANSCODER( "CMccTranscoderImpl::RegisterEventObserver" ) + + iEventObserver = &aObserver; + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderImpl::UnregisterEventObserver +// ----------------------------------------------------------------------------- +// +void CMccTranscoderImpl::UnregisterEventObserver() + { + __TRANSCODER( "CMccTranscoderImpl::UnregisterEventObserver" ) + + iEventObserver = NULL; + } + + +// ----------------------------------------------------------------------------- +// CMccTranscoderImpl::TranscodeFile +// ----------------------------------------------------------------------------- +// +void CMccTranscoderImpl::TranscodeFileL( + TUint32& aSessionId, const TDesC8& aVal ) + { + __TRANSCODER( "CMccTranscoderImpl::TranscodeFileL" ) + + Cleanup(); + + const TMccTranscodeFileMsg& transcodeMsg = + reinterpret_cast( aVal )(); + + CMccTranscoderSessionInfo* session = CMccTranscoderSessionInfo::NewLC(); + + // Create session id + session->GenerateSessionId(); + + // Save quality info + session->SetQuality( transcodeMsg.iQuality ); + + // Save destination file info + session->SetDesFileL( transcodeMsg.iDesFile ); + + // CVedMovie object is created + session->CreateMovieL(); + + // Check if video code info is not empty, save it + session->CheckVideoCodecL( transcodeMsg.iVideoCodec ); + + // Check if audio code info is not empty, save it + session->CheckAudioCodecL( transcodeMsg.iAudioCodec ); + + __TRANSCODER( "CMccTranscoderImpl::RegisterMovieObserverL..." ) + session->Movie().RegisterMovieObserverL( this ); + User::LeaveIfError( iSessionArray.Append( session ) ); + CleanupStack::Pop( session ); + + __TRANSCODER( "CMccTranscoderImpl::InsertVideoClipL..." ) + + session->Movie().InsertVideoClipL( transcodeMsg.iSourceFile, 0 ); + // Callback function ::NotifyVideoClipAdded will be called later + + aSessionId = session->SessionId(); + + __TRANSCODER( "CMccTranscoderImpl::TranscodeFileL, exit" ) + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderImpl::CancelTranscodeFile +// ----------------------------------------------------------------------------- +// +void CMccTranscoderImpl::CancelTranscodeFileL( TUint32 aSessionId ) + { + __TRANSCODER( "CMccTranscoderImpl::CancelTranscodeFileL" ) + + Cleanup(); + + TInt session = FindSession( aSessionId ); + + __ASSERT_ALWAYS( session >= 0 , User::Leave( KErrNotFound) ); + __ASSERT_ALWAYS( &( iSessionArray[session]->Movie() ), + User::Leave( KErrNotFound) ); + + TUint32 sessionId = iSessionArray[session]->SessionId(); + + iSessionArray[session]->Movie().UnregisterMovieObserver( this ); + + iSessionArray[session]->Movie().CancelProcessing(); + + SendTranscodeEventToClient( KMccTranscodeCancelled, KErrNone, sessionId ); + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderImpl::FindSessionL +// ----------------------------------------------------------------------------- +// +TInt CMccTranscoderImpl::FindSession( CVedMovie& aMovie ) + { + TInt sessionCount = iSessionArray.Count(); + TInt err = KErrNotFound; + TInt sessionIndex = 0; + + for ( TInt i = 0; (i < sessionCount && err != KErrNone ); i++ ) + { + if ( &iSessionArray[i]->Movie() == &aMovie ) + { + sessionIndex = i; + err = KErrNone; + } + } + if ( err ) + { + return err; + } + else + { + return sessionIndex; + } + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderImpl::FindSession +// ----------------------------------------------------------------------------- +// +TInt CMccTranscoderImpl::FindSession( TUint32 aSessionID ) + { + TInt sessionCount = iSessionArray.Count(); + TInt err = KErrNotFound; + TInt sessionIndex = 0; + + for ( TInt i = 0; (i < sessionCount && err != KErrNone ); i++ ) + { + if ( iSessionArray[i]->SessionId() == aSessionID ) + { + sessionIndex = i; + err = KErrNone; + } + } + if ( err ) + { + return err; + } + else + { + return sessionIndex; + } + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderImpl::RemoveSession +// ----------------------------------------------------------------------------- +// +void CMccTranscoderImpl::RemoveSession( const TInt aIndex ) + { + TInt sessionCount = iSessionArray.Count(); + + if ( aIndex < sessionCount ) + { + iSessionArray[aIndex]->Movie().UnregisterMovieObserver( this ); + + // Can be deleted on next cleanup + iSessionArray[aIndex]->SetRemoved( ETrue ); + + // Initiate async cleanup + InitiateCleanup(); + } + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderImpl::SendTranscodeEventToClient +// ----------------------------------------------------------------------------- +// +void CMccTranscoderImpl::SendTranscodeEventToClient( + TMccEventType aEventType, TInt aError , TUint32 aSessionId, TUint32 aData ) + { + __TRANSCODER( "CMccTranscoderImpl::SendTranscodeEventToClient" ) + + if ( !iEventObserver ) + { + __TRANSCODER( "CMccTranscoderImpl::SendTranscodeEventToClient, no observer" ) + return; + } + + TMccEvent event; + event.iErrorCode = aError; + event.iEventCategory = KMccEventCategoryTranscode; + event.iEventType = aEventType; + event.iSessionId = aSessionId; + event.iEventNumData = aData; + + iEventObserver->MccTranscoderEventReceived( event ); + + __TRANSCODER( "CMccTranscoderImpl::SendTranscodeEventToClient, exit" ) + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderImpl::NotifyVideoClipAdded +// ----------------------------------------------------------------------------- +// +void CMccTranscoderImpl::NotifyVideoClipAdded( + CVedMovie& aMovie, TInt /*aIndex*/) + { + __TRANSCODER( "CMccTranscoderImpl::NotifyVideoClipAdded" ) + + TInt session = FindSession( aMovie ); + + // Session found + if ( session >= 0 ) + { + TUint32 sessionId = iSessionArray[session]->SessionId(); + + iSessionArray[session]->ClipAdded(); + + if ( iSessionArray[session]->QualityChangeNeeded() ) + { + iSessionArray[session]->Movie().SetQuality( + iSessionArray[session]->Quality() ); + // Callback function ::NotifyMovieQualityChanged will be called + } + else + { + // No need to change quality, continue with transcoding initialization + SetOutputParameters( aMovie ); + } + } + else + { + __TRANSCODER( "CMccTranscoderImpl::NotifyVideoClipAdded, \ +session not found" ) + } + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderImpl::NotifyMovieQualityChanged +// ----------------------------------------------------------------------------- +// +void CMccTranscoderImpl::NotifyMovieQualityChanged(CVedMovie& aMovie) + { + __TRANSCODER( "CMccTranscoderImpl::NotifyMovieQualityChanged" ) + + SetOutputParameters( aMovie ); + + __TRANSCODER( "CMccTranscoderImpl::NotifyMovieQualityChanged, exit" ) + } + + +// ----------------------------------------------------------------------------- +// CMccTranscoderImpl::NotifyMovieProcessingStartedL +// ----------------------------------------------------------------------------- +// +void CMccTranscoderImpl::NotifyMovieProcessingStartedL(CVedMovie& aMovie) + { + __TRANSCODER( "CMccTranscoderImpl::NotifyMovieProcessingStartedL" ) + + TInt session = FindSession( aMovie ); + + if ( session >= 0 ) + { + TUint32 sessionId = iSessionArray[session]->SessionId(); + + // Send event to client + SendTranscodeEventToClient( KMccTranscodeInProgress, KErrNone, sessionId ); + } + else + { + __TRANSCODER( "CMccTranscoderImpl::NotifyMovieProcessingStartedL, \ +session not found" ) + } + } + + +// ----------------------------------------------------------------------------- +// CMccTranscoderImpl::NotifyMovieOutputParametersChanged +// ----------------------------------------------------------------------------- +// +void CMccTranscoderImpl::NotifyMovieOutputParametersChanged(CVedMovie& aMovie) + { + __TRANSCODER( "CMccTranscoderImpl::NotifyMovieOutputParametersChanged" ) + + TInt session = FindSession( aMovie ); + + if ( session >= 0 ) + { + TRAPD( err, iSessionArray[session]->Movie().ProcessL( + iSessionArray[session]->DesFile(), *this ) ); + // Next will call + // MVedMovieProcessingObserver::NotifyMovieProcessingStartedL + if ( err ) + { + __TRANSCODER_INT1( "CMccTranscoderImpl::NotifyMovieOutput\ + ParametersChanged, call ProcessL, Error=", err ) + + TUint32 sessionId = iSessionArray[session]->SessionId(); + + // Error happened when process transcoding, remove the clip + RemoveSession( session ); + + SendTranscodeEventToClient( KMccTranscodeCompleted, err, sessionId ); + } + } + else + { + __TRANSCODER( "CMccTranscoderImpl::NotifyMovieOutputParametersChanged, \ +session not found" ) + } + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderImpl::NotifyMovieProcessingCompleted +// ----------------------------------------------------------------------------- +// +void CMccTranscoderImpl::NotifyMovieProcessingCompleted( + CVedMovie& aMovie, TInt aError) + { + __TRANSCODER( "CMccTranscoderImpl::NotifyMovieProcessingCompleted" ) + + __TRANSCODER_INT1( "CMccTranscoderImpl::NotifyMovieProcessingCompleted, \ +aError= ", aError) + + TInt session = FindSession( aMovie ); + + if ( session >= 0 ) + { + TUint32 sessionId = iSessionArray[session]->SessionId(); + + // Clip not needed anymore + RemoveSession( session ); + + // Send event + SendTranscodeEventToClient( KMccTranscodeCompleted, + aError, + sessionId, + KMccTranscodingCompletedPercentage ); + } + else + { + __TRANSCODER( "CMccTranscoderImpl::NotifyMovieProcessingCompleted, \ +session not found" ) + } + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderImpl::NotifyVideoClipAddingFailed +// ----------------------------------------------------------------------------- +// +void CMccTranscoderImpl::NotifyVideoClipAddingFailed( + CVedMovie& aMovie, TInt aError) + { + __TRANSCODER( "CMccTranscoderImpl::NotifyVideoClipAddingFailed" ) + + TInt session = FindSession( aMovie ); + + if ( session >= 0 ) + { + TUint32 sessionId = iSessionArray[session]->SessionId(); + + RemoveSession( session ); + + // Send event to client + SendTranscodeEventToClient( KMccTranscodeCompleted, aError, sessionId ); + } + else + { + __TRANSCODER_INT1( "CMccTranscoderImpl::NotifyVideoClipAddingFailed, \ +aError is ignored:", aError ) + } + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderImpl::NotifyVideoClipRemoved +// ----------------------------------------------------------------------------- +// +void CMccTranscoderImpl::NotifyVideoClipRemoved( + CVedMovie& aMovie, TInt /*aIndex*/ ) + { + __TRANSCODER( "CMccTranscoderImpl::NotifyVideoClipRemoved" ) + + TInt session = FindSession( aMovie ); + + if ( session >= 0 ) + { + __TRANSCODER( "CMccTranscoderImpl::NotifyVideoClipRemoved, \ +removing session..." ) + RemoveSession( session ); + } + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderImpl::NotifyMovieProcessingProgressed +// ----------------------------------------------------------------------------- +// +void CMccTranscoderImpl::NotifyMovieProcessingProgressed( + CVedMovie& aMovie, TInt aPercentage ) + { + __TRANSCODER( "CMccTranscoderImpl::NotifyMovieProcessingProgressed" ) + + TInt session = FindSession( aMovie ); + + if ( session >= 0 ) + { + __TRANSCODER_INT1( "CMccTranscoderImpl::NotifyMovieProcessingProgressed,\ +aPercenctage=", aPercentage ) + + TUint32 sessionId = iSessionArray[session]->SessionId(); + + TInt modifiedPercentage = iSessionArray[session]->Progressed( aPercentage ); + + if ( !(modifiedPercentage % KMccTranscoderProgressNotifFreq) ) + { + SendTranscodeEventToClient( KMccTranscodeInProgress, + KErrNone, sessionId, modifiedPercentage ); + } + } + else + { + __TRANSCODER( "CMccTranscoderImpl::NotifyMovieProcessingProgressed, \ +session not found" ) + } + + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderImpl::Cleanup +// ----------------------------------------------------------------------------- +// +void CMccTranscoderImpl::Cleanup() + { + __TRANSCODER("CMccTranscoderImpl::Cleanup"); + + TInt sessionCount = iSessionArray.Count(); + + for ( TInt i = ( sessionCount - 1 ); i >= 0 ; i-- ) + { + __TRANSCODER("CMccTranscoderImpl::Cleanup, iterating"); + + CMccTranscoderSessionInfo* session = iSessionArray[i]; + if ( session->IsRemoved() ) + { + iSessionArray.Remove( i ); + delete session; + } + } + + __TRANSCODER("CMccTranscoderImpl::Cleanup, exit"); + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderImpl::InitiateCleanup +// ----------------------------------------------------------------------------- +// +void CMccTranscoderImpl::InitiateCleanup() + { + __TRANSCODER("CMccTranscoderImpl::InitiateCleanup"); + + iDeltaTimer->Remove( iDeltaTimerEntry ); + TTimeIntervalMicroSeconds32 interval( KMccTranscoderCleanupTimerMicrosecs ); + iDeltaTimer->Queue( interval, iDeltaTimerEntry ); + + __TRANSCODER("CMccQosController::InitiateCleanup, exit"); + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderImpl::AsyncTimerExpired +// ----------------------------------------------------------------------------- +// +TInt CMccTranscoderImpl::AsyncTimerExpired( TAny* aPtr ) + { + __TRANSCODER("CMccTranscoderImpl::AsyncTimerExpired"); + + if ( aPtr ) + { + CMccTranscoderImpl* self = reinterpret_cast( aPtr ); + self->Cleanup(); + } + + __TRANSCODER("CMccTranscoderImpl::AsyncTimerExpired, exit"); + return ETrue; + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderImpl::SetOutputParameters +// ----------------------------------------------------------------------------- +// +void CMccTranscoderImpl::SetOutputParameters( CVedMovie& aMovie ) + { + __TRANSCODER( "CMccTranscoderImpl::SetOutputParameters" ) + + TInt session = FindSession( aMovie ); + + if ( session >= 0 ) + { + // Change coding options + TVedOutputParameters params; + + iSessionArray[session]->GetPutputParameters( params ); + + __TRANSCODER_INT1( "CMccTranscoderImpl:: video type", params.iVideoType ) + __TRANSCODER_INT1( "CMccTranscoderImpl:: video width", params.iVideoResolution.iWidth ) + __TRANSCODER_INT1( "CMccTranscoderImpl:: video height", params.iVideoResolution.iHeight ) + __TRANSCODER_INT1( "CMccTranscoderImpl:: video bitrate", params.iVideoBitrate ) + __TRANSCODER_INT1( "CMccTranscoderImpl:: sync interval", params.iSyncIntervalInPicture ) + __TRANSCODER_INT1( "CMccTranscoderImpl:: segment size", params.iSegmentSizeInBytes ) + __TRANSCODER_INT1( "CMccTranscoderImpl:: audio type", params.iAudioType ) + __TRANSCODER_INT1( "CMccTranscoderImpl:: audio bitrate", params.iAudioBitrate ) + __TRANSCODER_INT1( "CMccTranscoderImpl:: audio channel mode", params.iAudioChannelMode ) + __TRANSCODER_INT1( "CMccTranscoderImpl:: audio sampling rate", params.iAudioSamplingRate ) + + TRAPD( err, iSessionArray[session]->Movie().SetOutputParametersL( params ) ); + // Next call back will be ::NotifyMovieOutputParametersChanged + + if ( err ) + { + __TRANSCODER_INT1( "CMccTranscoderImpl::SetOutputParameters,\ +call SetOutputParametersL Error=", err ) + + TUint32 sessionId = iSessionArray[session]->SessionId(); + + // Error happend when set output parameter, remove the clip + RemoveSession( session ); + + SendTranscodeEventToClient( KMccTranscodeCompleted, err, sessionId ); + } + else + { + // Clean the video codec, it is not used any more + iSessionArray[session]->SetVideoCodec( NULL ); + // Clean the audio codec, it is not used any more + iSessionArray[session]->SetAudioCodec( NULL ); + } + } + else + { + __TRANSCODER( "CMccTranscoderImpl::SetOutputParameters, \ +session not found" ) + } + } + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmcctranscoder/src/transcoderimplementationproxy.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmcctranscoder/src/transcoderimplementationproxy.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,45 @@ +/* +* 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: +* +*/ + + +// INCLUDE FILES +#include +#include +#include "transcoderuids.hrh" + + + +// Exported proxy for instantiation method resolution +// Define the interface UIDs +const TImplementationProxy ImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( KImplUidTranscoder, CMccTranscoder::NewL ) + }; + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + +// ----------------------------------------------------------------------------- +// ImplementationGroupProxy +// Function to return the implementation proxy table +// ----------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount ) + { + aTableCount = sizeof( ImplementationTable ) / sizeof( TImplementationProxy ); + return ImplementationTable; + }; + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmcctranscoder/src/transcodersessioninfo.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmcctranscoder/src/transcodersessioninfo.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,557 @@ +/* +* Copyright (c) 2002-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: +* +*/ + + +// INCLUDE FILES +#include +#include +#include + +#include "transcodersessioninfo.h" +#include "mcctranscoderlogs.h" + +// CONSTANTS + +const TInt KMccTranscoderProgressMultiplier = 2; +const TInt KMccTranscoderProgressMiddle = 50; + +const TInt KMccTranscoderVideoOnlyBitrate = 64000; + +const TInt KMccTranscoderAvcTargetSegmentSize = 1300; // Try to fit to MTU + + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// ============================= LOCAL FUNCTIONS =============================== + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CMccTranscoderSessionInfo::CMccTranscoderSessionInfo +// default constructor +// ----------------------------------------------------------------------------- +// +CMccTranscoderSessionInfo::CMccTranscoderSessionInfo() + { + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderSessionInfo::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CMccTranscoderSessionInfo::ConstructL( ) + { + + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderSessionInfo::NewL +// Static constructor. +// ----------------------------------------------------------------------------- +// +CMccTranscoderSessionInfo* CMccTranscoderSessionInfo::NewLC() + { + CMccTranscoderSessionInfo* self = new (ELeave) CMccTranscoderSessionInfo; + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderSessionInfo::~CMccTranscoderSessionInfo +// Destructor +// ----------------------------------------------------------------------------- +// +CMccTranscoderSessionInfo::~CMccTranscoderSessionInfo() + { + __TRANSCODER( "CMccTranscoderSessionInfo::~CMccTranscoderSessionInfo" ) + + delete iMovie; + delete iVideoCodec; + delete iAudioCodec; + + __TRANSCODER( "CMccTranscoderSessionInfo::~CMccTranscoderSessionInfo, exit" ) + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderSessionInfo::SetQuality +// ----------------------------------------------------------------------------- +// +void CMccTranscoderSessionInfo::SetQuality( TUint32 aQuality ) + { + __TRANSCODER_INT1( "CMccTranscoderSessionInfo::SetQuality, quality=", aQuality ) + + switch( aQuality ) + { + case CVedMovie::EQualityAutomatic: + iQuality = CVedMovie::EQualityAutomatic; + break; + case CVedMovie::EQualityMMSInteroperability: + iQuality = CVedMovie::EQualityMMSInteroperability; + break; + case CVedMovie::EQualityResolutionCIF: + iQuality = CVedMovie::EQualityResolutionCIF; + break; + case CVedMovie::EQualityResolutionQCIF: + iQuality = CVedMovie::EQualityResolutionQCIF; + break; + case CVedMovie::EQualityLast: + iQuality = CVedMovie::EQualityLast; + break; + default: + iQuality = CVedMovie::EQualityLast; + break; + } + + __TRANSCODER( "CMccTranscoderSessionInfo::SetQuality, exits" ) + + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderSessionInfo::SetDesFileL +// ----------------------------------------------------------------------------- +// +void CMccTranscoderSessionInfo::SetDesFileL( const TDesC& aFileName ) + { + __TRANSCODER( "CMccTranscoderSessionInfo::SetDesFileL" ) + + __ASSERT_ALWAYS( aFileName.Length() > 0, User::Leave( KErrArgument ) ); + + iDesFile.Copy( aFileName ); + + __TRANSCODER( "CMccTranscoderSessionInfo::SetDesFileL, exit" ) + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderSessionInfo::SetVideoType +// ----------------------------------------------------------------------------- +// +void CMccTranscoderSessionInfo::SetVideoType( + const TDesC8& aSdpName, + const TInt aVideoBitRate ) + { + __TRANSCODER( "CMccTranscoderSessionInfo::SetVideoType" ) + + if ( aSdpName.CompareF( KAVCSdpName ) == 0 ) + { + iVideoCodec->SetVideoType( EVedVideoTypeAVCBaselineProfile ); + // Other than zero value will cause transcoding failure for AVC + iSyncIntervalInPicture = 0; + iSegmentSizeInBytes = KMccTranscoderAvcTargetSegmentSize; + } + else if ( aSdpName.CompareF( KH263SdpName ) == 0 || + aSdpName.CompareF( KH2631998SdpName ) == 0|| + aSdpName.CompareF( KH2632000SdpName ) == 0 ) + { + const TInt maxBitRateOne = 64000; + const TInt maxBitRateTwo = 128000; + if ( aVideoBitRate <= maxBitRateOne ) + { + iVideoCodec->SetVideoType( EVedVideoTypeH263Profile0Level10 ); + } + if ( aVideoBitRate > maxBitRateOne && + aVideoBitRate < maxBitRateTwo ) + { + iVideoCodec->SetVideoType( EVedVideoTypeH263Profile0Level45 ); + } + iSyncIntervalInPicture = 1; + } + else + { + iVideoCodec->SetVideoType( EVedVideoTypeUnrecognized) ; + } + + __TRANSCODER( "CMccTranscoderSessionInfo::SetVideoType, exit" ) + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderSessionInfo::SetVideoType +// ----------------------------------------------------------------------------- +// +void CMccTranscoderSessionInfo::SetAudioType( const TDesC8& aSdpName ) + { + __TRANSCODER( "CMccTranscoderSessionInfo::SetAudioType" ) + + if ( iAudioCodec ) + { + if ( aSdpName.CompareF( KAACSdpName ) == 0 ) + { + iAudioCodec->SetAudioType( EVedAudioTypeAAC_LC ); + } + else if ( aSdpName.CompareF( KAMRSdpName ) == 0 ) + { + iAudioCodec->SetAudioType( EVedAudioTypeAMR ); + } + else + { + iAudioCodec->SetAudioType( EVedAudioTypeUnrecognized ); + } + } + __TRANSCODER( "CMccTranscoderSessionInfo::SetAudioType, exit" ) + + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderSessionInfo::SetVideoType +// ----------------------------------------------------------------------------- +// +TUint32 CMccTranscoderSessionInfo::SessionId() + { + return iSessionId; + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderSessionInfo::SetVideoType +// ----------------------------------------------------------------------------- +// +void CMccTranscoderSessionInfo::GenerateSessionId() + { + __TRANSCODER( "CMccTranscoderSessionInfo::GenerateSessionId" ) + + iSessionId = 0; + + while( iSessionId == 0 ) + { + iSessionId = static_cast( Math::Random() ); + } + + __TRANSCODER( "CMccTranscoderSessionInfo::GenerateSessionId, exit" ) + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderSessionInfo::CreateMovieL() +// ----------------------------------------------------------------------------- +// +// ownership is transferred +void CMccTranscoderSessionInfo::CreateMovieL( ) + { + __TRANSCODER( "CMccTranscoderSessionInfo::CreateMovieL" ) + + if ( iMovie ) + { + delete iMovie; + iMovie = NULL; + } + iMovie = CVedMovie::NewL( 0 ); + + __TRANSCODER( "CMccTranscoderSessionInfo::CreateMovieL, exit" ) + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderSessionInfo::Movie +// ----------------------------------------------------------------------------- +// +CVedMovie& CMccTranscoderSessionInfo::Movie() + { + return *iMovie; + } + + +// ----------------------------------------------------------------------------- +// CMccTranscoderSessionInfo::Quality +// ----------------------------------------------------------------------------- +// +CVedMovie::TVedMovieQuality CMccTranscoderSessionInfo::Quality() + { + return iQuality; + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderSessionInfo::DesFile +// ----------------------------------------------------------------------------- +// +const TDesC& CMccTranscoderSessionInfo::DesFile() + { + return iDesFile; + } + + +// ----------------------------------------------------------------------------- +// CMccTranscoderSessionInfo::VideoCodec +// ----------------------------------------------------------------------------- +// +CMccTranscoderVideoCodec& CMccTranscoderSessionInfo::VideoCodec() + { + return *iVideoCodec; + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderSessionInfo::SetVideoCodec +// ----------------------------------------------------------------------------- +// +void CMccTranscoderSessionInfo::SetVideoCodec( CMccTranscoderVideoCodec* aCodec ) + { + __TRANSCODER( "CMccTranscoderSessionInfo::SetVideoCodec" ) + + if ( iVideoCodec ) + { + delete iVideoCodec; + } + iVideoCodec = aCodec; + + __TRANSCODER( "CMccTranscoderSessionInfo::SetVideoCodec, exit" ) + + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderSessionInfo::AudioCodec +// ----------------------------------------------------------------------------- +// +CMccTranscoderAudioCodec& CMccTranscoderSessionInfo::AudioCodec() + { + return *iAudioCodec; + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderSessionInfo::SetAudioCodec +// ----------------------------------------------------------------------------- +// +void CMccTranscoderSessionInfo::SetAudioCodec( CMccTranscoderAudioCodec* aCodec ) + { + __TRANSCODER( "CMccTranscoderSessionInfo::SetAudioCodec " ) + + if ( iAudioCodec ) + { + delete iAudioCodec; + } + + iAudioCodec = aCodec; + + __TRANSCODER( "CMccTranscoderSessionInfo::SetAudioCodec, exit" ) + + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderSessionInfo::CheckVideoCodecL +// ----------------------------------------------------------------------------- +// +void CMccTranscoderSessionInfo::CheckVideoCodecL( + const TMccTranscoderCodecInfo& aCodecInfo ) + { + __TRANSCODER( "CMccTranscoderSessionInfo::CheckVideoCodecL " ) + + // check if video code info is not empty, save it + if ( aCodecInfo.iMimeType.Length() ) + { + if ( iVideoCodec ) + { + delete iVideoCodec; + iVideoCodec = NULL; + } + iVideoCodec = CMccTranscoderVideoCodec::NewL(); + + iVideoCodec->SetBitrate( aCodecInfo.iBitrate ); + iVideoCodec->SetFrameRate( aCodecInfo.iFramerate ); + iVideoCodec->SetVideoResolution( + TSize(aCodecInfo.iVideoWidth, aCodecInfo.iVideoHeight) ); + + SetVideoType( aCodecInfo.iMimeType, aCodecInfo.iBitrate ); + } + + __TRANSCODER( "CMccTranscoderSessionInfo::CheckVideoCodecL, exit " ) + + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderSessionInfo::CheckAudioCodecL +// ----------------------------------------------------------------------------- +// +void CMccTranscoderSessionInfo::CheckAudioCodecL( + const TMccTranscoderCodecInfo& aCodecInfo ) + { + __TRANSCODER( "CMccTranscoderSessionInfo::CheckAudioCodecL " ) + + // check if audio code info is not empty, save it + if (aCodecInfo.iMimeType.Length() ) + { + if ( iAudioCodec ) + { + delete iAudioCodec; + iAudioCodec = NULL; + } + iAudioCodec = CMccTranscoderAudioCodec::NewL(); + iAudioCodec->SetBitrate( aCodecInfo.iBitrate ); + iAudioCodec->SetAudioChannelMode( EVedAudioChannelModeSingleChannel ); + iAudioCodec->SetSamplingRate( aCodecInfo.iSamplingFreq ); + SetAudioType( aCodecInfo.iMimeType ); + } + + __TRANSCODER( "CMccTranscoderSessionInfo::CheckAudioCodecL, exit " ) + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderSessionInfo::CheckAudioCodecL +// ----------------------------------------------------------------------------- +// +void CMccTranscoderSessionInfo::GetPutputParameters( + TVedOutputParameters& params ) + { + __TRANSCODER( "CMccTranscoderSessionInfo::GetPutputParameters " ) + + if ( iVideoCodec ) + { + __TRANSCODER( "Set video output values from codec" ) + params.iVideoType = iVideoCodec->VideoType(); + params.iVideoResolution = iVideoCodec->VideoResolution(); + params.iVideoBitrate = iVideoCodec->Bitrate(); + params.iVideoFrameRate = iVideoCodec->FrameRate(); + } + else if ( iMovie )// set video parameters from clip + { + __TRANSCODER( "Set video output values from mov" ) + params.iVideoType = iMovie->VideoType(); + params.iVideoResolution = iMovie->Resolution(); + params.iVideoBitrate = CalculateVideoBitrate( *iMovie ); + params.iVideoFrameRate = iMovie->VideoFrameRate(); + } + + //insert GOBs into clip + params.iSyncIntervalInPicture = iSyncIntervalInPicture; + params.iSegmentSizeInBytes = iSegmentSizeInBytes; + + // audio parameters are stored in session, + // copy those parameters from session, + if ( iAudioCodec ) + { + __TRANSCODER( "Set audio output values from codec" ) + params.iAudioType = iAudioCodec->AudioType(); + params.iAudioBitrate = iAudioCodec->Bitrate(); + params.iAudioChannelMode = EVedAudioChannelModeSingleChannel; + params.iAudioSamplingRate = iAudioCodec->SamplingRate(); + } + else if ( iMovie )// set audio parameters from clip + { + params.iAudioType = iMovie->AudioType(); + if ( params.iAudioType != EVedAudioTypeNoAudio ) + { + __TRANSCODER( "Set audio output values from mov" ) + params.iAudioBitrate = iMovie->AudioBitrate(); + params.iAudioChannelMode = iMovie->AudioChannelMode(); + params.iAudioSamplingRate = iMovie->AudioSamplingRate(); + } + else if ( params.iVideoType == EVedVideoTypeAVCBaselineProfile ) + { + __TRANSCODER( "No audio for avc, set compatibility values" ) + + // VideoEditorEngine strangely wants still these specific + // audio values if video type is AVC and clip does not contain + // audio. + const TInt KMccTranscoderVedCompatibility = 16000; + params.iAudioBitrate = KMccTranscoderVedCompatibility; + params.iAudioSamplingRate = KMccTranscoderVedCompatibility; + } + else + { + __TRANSCODER( "No audio, do not set audio output values" ) + } + } + + __TRANSCODER( "CMccTranscoderSessionInfo::GetPutputParameters, exit " ) + + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderSessionInfo::SetRemoved +// ----------------------------------------------------------------------------- +// +void CMccTranscoderSessionInfo::SetRemoved( TBool aIsRemoved ) + { + iIsRemoved = aIsRemoved; + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderSessionInfo::IsRemoved +// ----------------------------------------------------------------------------- +// +TBool CMccTranscoderSessionInfo::IsRemoved() const + { + return iIsRemoved; + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderSessionInfo::Progressed +// ----------------------------------------------------------------------------- +// +TInt CMccTranscoderSessionInfo::Progressed( TInt aProgressPercentage ) + { + // If only one media element is present, ved engine progress + // percentage has to be multiplied by two (otherwise it goes only to 50%) + if ( iAudioNotPresent && + ( aProgressPercentage <= KMccTranscoderProgressMiddle ) ) + { + aProgressPercentage = + ( aProgressPercentage * KMccTranscoderProgressMultiplier ); + } + return aProgressPercentage; + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderSessionInfo::Progressed +// ----------------------------------------------------------------------------- +// +void CMccTranscoderSessionInfo::ClipAdded() + { + if ( iMovie ) + { + __TRANSCODER_INT1( "CMccTranscoderSessionInfo::ClipAdded, audio type:", + iMovie->AudioType() ) + + iAudioNotPresent = + ( iMovie->AudioType() == EVedAudioTypeNoAudio || + iMovie->AudioType() == EVedAudioTypeUnrecognized ); + } + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderSessionInfo::QualityChangeNeeded +// If client has set output video codec, quality setting is ignored +// ----------------------------------------------------------------------------- +// +TBool CMccTranscoderSessionInfo::QualityChangeNeeded() + { + return ( iQuality != CVedMovie::EQualityAutomatic && !iVideoCodec ); + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderSessionInfo::CalculateVideoBitrate +// ----------------------------------------------------------------------------- +// +TInt CMccTranscoderSessionInfo::CalculateVideoBitrate( CVedMovie& aMovie ) + { + __TRANSCODER( "CMccTranscoderSessionInfo::CalculateVideoBitrate" ) + + TInt videoBitrate( KMccTranscoderVideoOnlyBitrate ); + if ( aMovie.AudioType() != EVedAudioTypeNoAudio && + aMovie.AudioBitrate() > 0 && + aMovie.AudioBitrate() < videoBitrate ) + { + videoBitrate -= aMovie.AudioBitrate(); + } + + __TRANSCODER_INT1( "CMccTranscoderSessionInfo::CalculateVideoBitrate, exit bitrate:", + videoBitrate ) + return videoBitrate; + } + +// End of file + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmcctranscoder/src/transcodervideocodec.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmcctranscoder/src/transcodervideocodec.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,112 @@ +/* +* Copyright (c) 2002-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: +* +*/ + + +// INCLUDE FILES + +#include "transcodervideocodec.h" + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// ============================= LOCAL FUNCTIONS =============================== + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CMccTranscoderVideoCodec::CMccTranscoderVideoCodec +// default constructor +// ----------------------------------------------------------------------------- +// +CMccTranscoderVideoCodec::CMccTranscoderVideoCodec() + { + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderVideoCodec::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CMccTranscoderVideoCodec::ConstructL( ) + { + + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderVideoCodec::NewL +// Static constructor. +// ----------------------------------------------------------------------------- +// +CMccTranscoderVideoCodec* CMccTranscoderVideoCodec::NewL() + { + CMccTranscoderVideoCodec* self = new (ELeave) CMccTranscoderVideoCodec; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderVideoCodec::~CMccTranscoderVideoCodec +// Destructor +// ----------------------------------------------------------------------------- +// +CMccTranscoderVideoCodec::~CMccTranscoderVideoCodec() + { + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderVideoCodec::SetBitrate +// +// ----------------------------------------------------------------------------- +// +void CMccTranscoderVideoCodec::SetBitrate( TInt aBitrate ) + { + iBitrate = aBitrate; + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderVideoCodec::Bitrate +// +// ----------------------------------------------------------------------------- +// +TInt CMccTranscoderVideoCodec::Bitrate() + { + return iBitrate; + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderVideoCodec::SetSamplingRate +// ----------------------------------------------------------------------------- +// +void CMccTranscoderVideoCodec::SetSamplingRate( TInt aSamplingRate ) + { + iSamplingRate = aSamplingRate; + } + +// ----------------------------------------------------------------------------- +// CMccTranscoderVideoCodec::SamplingRate +// ----------------------------------------------------------------------------- +// +TInt CMccTranscoderVideoCodec::SamplingRate() + { + return iSamplingRate; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmcctranscoder/tsrc/stubs/data/H264_QCIF_AMR_output.3gp Binary file mmshplugins/mmcctranscoder/tsrc/stubs/data/H264_QCIF_AMR_output.3gp has changed diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmcctranscoder/tsrc/stubs/data/Testt.mp4 Binary file mmshplugins/mmcctranscoder/tsrc/stubs/data/Testt.mp4 has changed diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmcctranscoder/tsrc/stubs/data/TimerAudio.3gp Binary file mmshplugins/mmcctranscoder/tsrc/stubs/data/TimerAudio.3gp has changed diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmcctranscoder/tsrc/stubs/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmcctranscoder/tsrc/stubs/group/bld.inf Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2002-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: Build info +* +*/ + + + +PRJ_PLATFORMS +DEFAULT + +PRJ_TESTEXPORTS +../data/TimerAudio.3gp /epoc32/winscw/c/data/videos/TimerAudio.3gp +../data/Testt.mp4 /epoc32/winscw/c/data/videos/Testt.mp4 +../data/H264_QCIF_AMR_output.3gp /epoc32/winscw/c/data/videos/H264_QCIF_AMR_output.3gp + +PRJ_TESTMMPFILES +dummytranscoder.mmp diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmcctranscoder/tsrc/stubs/group/dummytranscoder.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmcctranscoder/tsrc/stubs/group/dummytranscoder.mmp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,57 @@ +/* +* 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: Project definition file for MCC transcoder stub +* +*/ + +#include +#include + +TARGET mmcctranscoder.dll + +CAPABILITY EUNIT_CAPS +VENDORID VID_DEFAULT +TARGETTYPE PLUGIN + +UID 0x10009D8D 0x10282896 + +SOURCEPATH ../../../src +SOURCE transcoder.cpp +SOURCE transcoderimpl.cpp +SOURCE transcoderimplementationproxy.cpp +SOURCE transcodercodecinfo.cpp +SOURCE transcoderaudiocodec.cpp +SOURCE transcodervideocodec.cpp +SOURCE transcodersessioninfo.cpp +SOURCEPATH ../src +SOURCE vedmovie.cpp + + +USERINCLUDE ../../../inc +USERINCLUDE ../inc +SYSTEMINCLUDE ../inc + +MW_LAYER_SYSTEMINCLUDE + +SOURCEPATH ../../../data + +START RESOURCE 10282896.rss +TARGET mmcctranscoder.rsc +END + +LIBRARY euser.lib +LIBRARY mmfserverbaseclasses.lib +LIBRARY ecom.lib +LIBRARY mmfcontrollerframework.lib +LIBRARY efsrv.lib diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmcctranscoder/tsrc/stubs/inc/mmcctranscoder.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmcctranscoder/tsrc/stubs/inc/mmcctranscoder.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,156 @@ +/* +* 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: Plugin interface to be implemented in order to get transcoding +* functionality +* +*/ + + +#ifndef MCCTRANSCODER_H +#define MCCTRANSCODER_H + +// INCLUDES +#include +#include +#include + +// CLASS DECLARATION +class CMccTranscoderImpl; + +// CONSTS + +// Plugin Interface UID +#define KMmfUidPluginInterfaceMccTranscoder 0x10282898 + +/** +* Class for setting up codec values for transcoding. +*/ +class TMccTranscoderCodecInfo + { + public: + TUint32 iBitrate; + TReal iFramerate; + TUint32 iVideoWidth; + TUint32 iVideoHeight; + TUint32 iSamplingFreq; + TBuf8<256> iMimeType; + TUid iFourCC; + TUint32 iReserved1; + TUint32 iReserved2; + }; + +/** +* Class for setting up transcoding. +*/ +class TMccTranscodeFileMsg + { + public: + + TFileName iSourceFile; + + TFileName iDesFile; + + TUint32 iQuality; + + TMccTranscoderCodecInfo iVideoCodec; + + TMccTranscoderCodecInfo iAudioCodec; + }; + +typedef TPckgBuf TMccTranscodeFileMsgBuffer; + + +/** +* Observer interface for clients to receive events from transcoder. +*/ +class MMccTranscoderObserver + { + public: + + /** + * Callback function to receive transcoder events + * @param aEvent Received transcoder events + */ + virtual void MccTranscoderEventReceived( TMccEvent& aEvent ) = 0; + }; + +/** +* MCC subsystem transcoder interface. Class is used for transcoding audio and video +* files from one codec to another. Transcoding can be also done with old codec in order +* to change bitrate. +*/ +class CMccTranscoder : public CBase + { + public: // Constructors and destructor + /** + * Two-phased constructor. + */ + static CMccTranscoder* NewL(); + + /** + * Destructor. + */ + virtual ~CMccTranscoder(); + + public: // New functions + + /** + * Registers observer for transcoding events. + * @param aObserver observer for transcoding events. + */ + virtual void RegisterEventObserver( MMccTranscoderObserver& aObserver ); + + /** + * Unregisters observer for transcoding events. + */ + virtual void UnregisterEventObserver(); + + /** + * Starts transcoding of media file. + * @param aSessionId session identifier for transcoding, updated on return + * @param aVal TMccTranscodeFileMsgBuffer containing transcode parameters + */ + virtual void TranscodeFileL( TUint32& aSessionId, const TDesC8& aVal ); + + /** + * Cancels transcoding of media file. + * @param aSessionId session identifier for transcoding + */ + virtual void CancelTranscodeFileL( TUint32 aSessionId ); + + private: + /** + * C++ default constructor. + */ + CMccTranscoder(); + + /** + * By default Symbian 2nd phase constructor is private. + * + * @param aSource Source of the data for the payload format plugin + */ + void ConstructL(); + + private: // data + CMccTranscoderImpl* iTranscoderImpl; + + private: // Friend classes + + #ifdef EUNIT_TEST + friend class UT_CMccTranscoder; + #endif + + }; + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmcctranscoder/tsrc/stubs/inc/vedaudioclipinfo.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmcctranscoder/tsrc/stubs/inc/vedaudioclipinfo.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,245 @@ +/* +* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 __VEDAUDIOCLIPINFO_H__ +#define __VEDAUDIOCLIPINFO_H__ + +#include "VedCommon.h" + +/* + * Forward declarations. + */ +class CVedAudioClipInfo; + +/** + * Observer for notifying that audio clip info + * is ready for reading. + * + * @see CVedAudioClipInfo + */ +class MVedAudioClipInfoObserver + { +public: + /** + * Called to notify that audio clip info is ready + * for reading. + * + * Possible error codes: + * - KErrNotFound if there is no file with the specified name + * in the specified directory (but the directory exists) + * - KErrPathNotFound if the specified directory + * does not exist + * - KErrUnknown if the specified file is of unknown type + * + * @param aInfo audio clip info + * @param aError KErrNone if info is ready + * for reading; one of the system wide + * error codes if reading file failed + */ + virtual void NotifyAudioClipInfoReady(CVedAudioClipInfo& aInfo, + TInt aError) = 0; + }; + + +/** + * Observer for audio clip visualization. + * + * @see CVedAudioClipInfo + */ +class MVedAudioClipVisualizationObserver + { +public: + + /** + * Called to notify that audio clip visualization has been started. + * + * @param aInfo audio clip info + */ + virtual void NotifyAudioClipVisualizationStarted(const CVedAudioClipInfo& aInfo) = 0; + + /** + * Called to inform about the current progress of the audio clip visualization. + * + * @param aInfo audio clip info + * @param aPercentage percentage of the operation completed, must be + * in range 0..100 + */ + virtual void NotifyAudioClipVisualizationProgressed(const CVedAudioClipInfo& aInfo, + TInt aPercentage) = 0; + + /** + * Called to notify that audio clip visualization has been completed. + * Note that if the visualization was successfully completed, the ownership + * of the visualization array is passed to the observer and the observer is + * responsible for freeing the array). + * + * @param aInfo audio clip info + * @param aError KErrNone if visualization was + * completed successfully; one of the system wide + * error codes if generating visualization failed + * @param aVisualization pointer to the array containing the visualization values; + * note that the ownership of the array is passed to the + * observer (i.e., the observer is responsible for freeing + * the array); or 0, if generating the visualization failed + * @param aResolution resolution of the visualization (i.e., the number of values + * in the visualization array); or 0, if generating the + * visualization failed + */ + virtual void NotifyAudioClipVisualizationCompleted(const CVedAudioClipInfo& aInfo, + TInt aError, TInt8* aVisualization, + TInt aResolution) = 0; + }; + + +/** + * Utility class for getting information about audio clip files. + * + */ +class CVedAudioClipInfo : public CBase + { +public: + + /* Constructors & destructor. */ + + /** + * Constructs a new CVedAudioClipInfo object to get information + * about the specified audio clip file. The specified observer + * is notified when info is ready for reading. This method + * may leave if no resources are available to construct + * a new object. + * + * Possible leave codes: + * - KErrNoMemory if memory allocation fails + * + * @param aFileName name of audio clip file + * @param aObserver observer to notify when info is ready for reading + * + * @return pointer to a new CVedAudioClipInfo instance + */ + IMPORT_C static CVedAudioClipInfo* NewL(const TDesC& aFileName, + MVedAudioClipInfoObserver& aObserver); + + /** + * Constructs a new CVedAudioClipInfo object to get information + * about the specified audio clip file. The constructed object + * is left in the cleanup stack. The specified observer + * is notified when info is ready for reading. This method + * may leave if no resources are available to construct a new + * object. + * + * Possible leave codes: + * - KErrNoMemory if memory allocation fails + * + * @param aFileName name of audio clip file + * @param aObserver observer to notify when info is ready for reading + * + * @return pointer to a new CVedAudioClipInfo instance + */ + IMPORT_C static CVedAudioClipInfo* NewLC(const TDesC& aFileName, + MVedAudioClipInfoObserver& aObserver); + + /* Property methods. */ + + /** + * Returns the file name of the clip. Panics if info + * is not yet ready for reading. + * + * @return file name + */ + virtual TPtrC FileName() const = 0; + + /** + * Returns the audio type of the clip. Panics if info + * is not yet ready for reading. + * + * @return audio type + */ + virtual TVedAudioType Type() const = 0; + + /** + * Returns the duration of the clip. Panics if info + * is not yet ready for reading. + * + * @return duration in microseconds + */ + virtual TTimeIntervalMicroSeconds Duration() const = 0; + + /** + * Returns the channel mode of the audio if applicable. + * + * @return channel mode + */ + virtual TVedAudioChannelMode ChannelMode() const = 0; + + /** + * Returns the audio format of the clip. Panics if info + * is not yet ready for reading. + * + * @return audio format of the clip + */ + virtual TVedAudioFormat Format() const = 0; + + /** + * Returns the sampling rate in hertz. + * + * @return sampling rate + */ + virtual TInt SamplingRate() const = 0; + + /** + * Returns the bitrate mode. + * + * @return bitrate mode + */ + virtual TVedBitrateMode BitrateMode() const = 0; + + /** + * Returns the bitrate. + * + * @return bitrate in bits per second + */ + virtual TInt Bitrate() const = 0; + + /* Visualization methods. */ + + /** + * Generates a visualization of the audio clip. The visualization consists + * of an array of values with the specified resolution. This method is + * asynchronous. The visualization is generated in background and the observer + * is notified when the visualization is complete. This method panics if info + * is not yet ready for reading or the resolution is illegal. + * + * Possible leave codes: + * - KErrNoMemory if memory allocation fails + * + * @param aObserver observer to be notified when the visualization is completed + * @param aResolution resolution of the visualization (i.e., the number of values + * in the visualization array) + * @param aPriority priority of the visualization + */ + virtual void GetVisualizationL(MVedAudioClipVisualizationObserver& aObserver, + TInt aResolution, TInt aPriority) = 0; + + /** + * Cancels visualization generation. If no visualization is currently being + * generated, the function does nothing. + */ + virtual void CancelVisualizationL() = 0; + }; + +#endif // __VEDAUDIOCLIPINFO_H__ diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmcctranscoder/tsrc/stubs/inc/vedcommon.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmcctranscoder/tsrc/stubs/inc/vedcommon.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,346 @@ +/* +* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 __VEDCOMMON_H__ +#define __VEDCOMMON_H__ + +#include + + +/** + * Constants for video clip speed settings. The speed is given by % x10, i.e. 1000 means 100 %. + */ +const TInt KVedNormalSpeed(1000); +const TInt KVedMaxSpeed(1000); +const TInt KVedMinSpeed(1); + + +/** + * Enumeration for video clip classes. + */ +enum TVedVideoClipClass + { + EVedVideoClipClassFile = 15001, + EVedVideoClipClassGenerated + }; + + +/** + * Enumeration for bitrate modes. + */ +enum TVedBitrateMode + { + EVedBitrateModeUnrecognized = 18001, + EVedBitrateModeConstant, + EVedBitrateModeVariable, + EVedBitrateModeLast // should always be the last one + }; + +/** + * Enumeration for video bitstream modes. + */ +enum TVedVideoBitstreamMode + { + EVedVideoBitstreamModeUnknown = 0, /* unrecognized mode; outside of H.263 Profile 0 Level 10, or MPEG-4 Visual Simple Profile */ + EVedVideoBitstreamModeH263, /* H.263 Simple Profile (Profile 0, Level 10) */ + EVedVideoBitstreamModeMPEG4ShortHeader, /* MPEG-4 Visual Simple Profile - Short Header */ + EVedVideoBitstreamModeMPEG4Regular, /* MPEG-4 Visual Simple Profile - Regular */ + EVedVideoBitstreamModeMPEG4Resyn, /* MPEG-4 Visual Simple Profile - Regular with Resynchronization Markers */ + EVedVideoBitstreamModeMPEG4DP, /* MPEG-4 Visual Simple Profile - Data Partitioned */ + EVedVideoBitstreamModeMPEG4DP_RVLC, /* MPEG-4 Visual Simple Profile - Data Partitioned with Reversible VLCs */ + EVedVideoBitstreamModeMPEG4Resyn_DP, /* MPEG-4 Visual Simple Profile - Data Partitioned with Resynchronization Markers */ + EVedVideoBitstreamModeMPEG4Resyn_DP_RVLC, /* MPEG-4 Visual Simple Profile - Data Partitioned with Reversible VLCs & Resynchronization Markers */ + EVedVideoBitstreamModeAVC + }; + + + +/* Video format of bitstream - used everywhere */ +enum TVedVideoType + { + EVedVideoTypeUnrecognized = 13001, /* should always be the first one */ + EVedVideoTypeNoVideo, /* video is not present */ + EVedVideoTypeH263Profile0Level10, /* H.263 Simple Profile (Profile 0, Level 10) */ + EVedVideoTypeH263Profile0Level45, /* H.263 Simple Profile (Profile 0, Level 45) */ + EVedVideoTypeMPEG4SimpleProfile, /* MPEG-4 Visual Simple Profile (any mode) */ + EVedVideoTypeAVCBaselineProfile, /* AVC Baseline Profile */ + EVedVideoTypeLast /* should always be the last one */ + }; + +/** + * Enumeration for video formats. + */ +enum TVedVideoFormat + { + EVedVideoFormatUnrecognized = 11001, // should always be the first one + EVedVideoFormat3GPP, + EVedVideoFormatMP4, + EVedVideoFormatLast // should always be the last one + }; + +/** + * Enumeration for audio formats. + */ +enum TVedAudioFormat + { + EVedAudioFormatUnrecognized = 16001, // should always be the first one + EVedAudioFormat3GPP, + EVedAudioFormatMP4, + EVedAudioFormatAMR, + EVedAudioFormatAMRWB, + EVedAudioFormatMP3, + EVedAudioFormatAAC_ADIF, + EVedAudioFormatAAC_ADTS, + EVedAudioFormatWAV, + EVedAudioFormatLast // should always be the last one + }; + + +/** + * Enumeration for audio types (that is, codecs). + */ +enum TVedAudioType + { + EVedAudioTypeUnrecognized = 14001, // should always be the first one + EVedAudioTypeNoAudio, + EVedAudioTypeAMR, + EVedAudioTypeAMRWB, + EVedAudioTypeMP3, + EVedAudioTypeAAC_LC, + EVedAudioTypeAAC_LTP, + EVedAudioTypeWAV, + EVedAudioTypeLast // should always be the last one + }; + +/** + * Enumeration for audio channel modes. + */ +enum TVedAudioChannelMode + { + EVedAudioChannelModeUnrecognized = 17001, + EVedAudioChannelModeStereo, + EVedAudioChannelModeDualChannel, + EVedAudioChannelModeSingleChannel + }; + +/** + * Output parameter class + */ + +class TVedOutputParameters + { + public: + // default constructor; initializes optional parameters to values which mean that editor can decide the value + inline TVedOutputParameters() + : iVideoType(EVedVideoTypeH263Profile0Level10), iVideoResolution(TSize(0,0)), iVideoBitrate(0), iVideoFrameRate(0), + iAudioType(EVedAudioTypeAMR), iAudioBitrate(0), iAudioChannelMode(EVedAudioChannelModeSingleChannel), iAudioSamplingRate(0), + iSyncIntervalInPicture(0), iSegmentSizeInBytes(0) + {} + + public: + + // video codec + TVedVideoType iVideoType; + // target resolution, 0 = no preference (use from input) + TSize iVideoResolution; + // target video bitrate, 0 = no preference + TInt iVideoBitrate; + // target video framerate, 0 = no preference + TReal iVideoFrameRate; + + // audio codec + TVedAudioType iAudioType; + // target audio bitrate, 0 = no preference + TInt iAudioBitrate; + // audio channel mode + TVedAudioChannelMode iAudioChannelMode; + // audio sampling rate, 0 = no preference + TInt iAudioSamplingRate; + + // Segment interval in picture. In H.263 baseline this means number of non-empty GOB headers (1=every GOB has a header), + // Default is 0 == no segments inside picture + // Coding standard & used profile etc. limit the value. + TInt iSyncIntervalInPicture; + + // Target size of each coded video segment. Valid for H.264 and MPEG-4 + // Default is 0 == no segments inside picture + TInt iSegmentSizeInBytes; + + }; + + +/** + * Enumeration for start transition effects. + */ +enum TVedStartTransitionEffect + { + EVedStartTransitionEffectNone = 21001, // should always be the first one + EVedStartTransitionEffectFadeFromBlack, + EVedStartTransitionEffectFadeFromWhite, + EVedStartTransitionEffectLast // should always be the last one + }; + + +/** + * Enumeration for middle transition effects. + */ +enum TVedMiddleTransitionEffect + { + EVedMiddleTransitionEffectNone = 22001, // should always be the first one + EVedMiddleTransitionEffectDipToBlack, + EVedMiddleTransitionEffectDipToWhite, + EVedMiddleTransitionEffectCrossfade, + EVedMiddleTransitionEffectWipeLeftToRight, + EVedMiddleTransitionEffectWipeRightToLeft, + EVedMiddleTransitionEffectWipeTopToBottom, + EVedMiddleTransitionEffectWipeBottomToTop, + EVedMiddleTransitionEffectLast // should always be the last one + }; + + +/** + * Enumeration for end transition effects. + */ +enum TVedEndTransitionEffect + { + EVedEndTransitionEffectNone = 23001, // should always be the first one + EVedEndTransitionEffectFadeToBlack, + EVedEndTransitionEffectFadeToWhite, + EVedEndTransitionEffectLast // should always be the last one + }; + + +/** + * Enumeration for color effects. + */ +enum TVedColorEffect + { + EVedColorEffectNone = 31001, // should always be the first one + EVedColorEffectBlackAndWhite, + EVedColorEffectToning, + EVedColorEffectLast // should always be the last one + }; + + +/** + * Class for storing dynamic level marks. + */ +class TVedDynamicLevelMark + { +public: + /** Mark time. */ + TTimeIntervalMicroSeconds iTime; + + /** + * Dynamic level (-63.5 - +12.7) in dB:s; one step represents +0.1 or -0.5 dB => values are -127...+127 + */ + TInt8 iLevel; + + /** + * Constructs a new dynamic level mark. + * + * @param aTime time for the mark + * @param aLevel dynamic level (-63.5 ... +12.7) in dB:s one step = +0.1 or -0.5 dB => values can be -127...+127 + */ + inline TVedDynamicLevelMark(TTimeIntervalMicroSeconds aTime, TInt aLevel); + + /** + * Constructs a new dynamic level mark from existing instance. + * + * @param aMark dynamic level mark to copy + */ + inline TVedDynamicLevelMark(const TVedDynamicLevelMark& aMark); + }; + + +/** + * Transcode factor. + */ +struct TVedTranscodeFactor + { + TInt iTRes; + TVedVideoBitstreamMode iStreamType; + }; + + +/** + * Enumerates video editor engine panic codes and + * provides a static Panic() function. + * + */ +class TVedPanic + { +public: + enum TVedPanicCodes + { + EInternal = 1, // internal error (that is, a bug in the video editor engine) + EDeprecated, // deprecated class or method + EVideoClipInfoNotReady, + EVideoClipInfoIllegalVideoFrameIndex, + EVideoClipInfoIllegalVideoFrameTime, + EVideoClipInfoFrameOperationAlreadyRunning, + EVideoClipInfoIllegalFrameResolution, + EVideoClipInfoNoFileAssociated, + EVideoClipInfoNoGeneratorAssociated, + EAudioClipInfoNotReady, //10 + EMovieEmpty, + EMovieAddOperationAlreadyRunning, + EMovieIllegalStartTransitionEffect, + EMovieIllegalMiddleTransitionEffect, + EMovieIllegalEndTransitionEffect, + EMovieProcessingOperationAlreadyRunning, + EMovieObserverAlreadyRegistered, + EMovieObserverNotRegistered, + EMovieIllegalQuality, + EVideoClipIllegalIndex, //20 + EVideoClipIllegalSpeed, + EVideoClipIllegalColorEffect, + EVideoClipIllegalCutInTime, + EVideoClipIllegalCutOutTime, + EVideoClipNoFileAssociated, + EAudioClipIllegalStartTime, + EAudioClipIllegalCutInTime, + EAudioClipIllegalCutOutTime, + EVideoClipGeneratorNotInserted, + EVideoClipGeneratorNotReady,//30 + EVideoClipGeneratorAlreadyInserted, + EVideoClipGeneratorIllegalVideoFrameIndex, + EVideoClipGeneratorIllegalDuration, + EVideoClipGeneratorIllegalFrameResolution, + EVideoClipGeneratorIllegalVideoFrameTime, + EImageClipGeneratorIllegalMaxResolution, + EImageClipGeneratorNotReady, + EImageClipGeneratorFrameOperationAlreadyRunning, + ETitleClipGeneratorIllegalMaxResolution, + ETitleClipGeneratorIllegalMaxFramerate,//40 + ETitleClipGeneratorFrameOperationAlreadyRunning, + EIllegalDynamicLevelMark, + EIllegalDynamicLevelMarkIndex, + EVideoClipGeneratorNotOveray, + EAnimationClipGeneratorNotReady + }; + +public: + inline static void Panic(TInt aPanic); + }; + + +#include "VedCommon.inl" + +#endif // __VEDCOMMON_H__ + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmcctranscoder/tsrc/stubs/inc/vedcommon.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmcctranscoder/tsrc/stubs/inc/vedcommon.inl Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,53 @@ +/* +* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 __VEDCOMMON_INL__ +#define __VEDCOMMON_INL__ + + +inline void TVedPanic::Panic(TInt aPanic) + { + _LIT(KVedPanicCategory, "VIDEO EDITOR ENG"); + + User::Panic(KVedPanicCategory, aPanic); + } + +inline TVedDynamicLevelMark::TVedDynamicLevelMark(TTimeIntervalMicroSeconds aTime, TInt aLevel) + { + iTime = aTime; + if ( aLevel < -127 ) // level is TInt8 with 0.5 dB steps + { + iLevel = -127; + } + else if (aLevel > 127 ) + { + iLevel = 127; + } + else + { + iLevel = TInt8(aLevel); + } + } + +inline TVedDynamicLevelMark::TVedDynamicLevelMark(const TVedDynamicLevelMark& aMark) + { + iTime = aMark.iTime; + iLevel = aMark.iLevel; + } + +#endif //__VEDCOMMON_INL__ diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmcctranscoder/tsrc/stubs/inc/vedmovie.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmcctranscoder/tsrc/stubs/inc/vedmovie.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,601 @@ +/* +* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 __VEDMOVIE_H__ +#define __VEDMOVIE_H__ + +#include +#include +#include "VedVideoClipInfo.h" +#include "VedAudioClipInfo.h" + +/* + * Constant definitions. + */ + +const TInt KVedClipIndexAll(-1); + + + + +class CVedMovie; +class TVedDynamicLevelMark; + +/** + * Observer for movie events. + *

+ * Note that every change operation that is made to a movie or the clips it consists of + * results in a maximum of one notification method called (that is, more than one + * notification method is never called as a result of a single change). For example, + * changing the index of a clip results in the NotifyVideoClipIndicesChanged() + * method being called once. The NotifyVideoClipTimingsChanged() method is not + * called even if the timings of several clips may have changed as a result. See the + * descriptions of the notification methods for more detailed information. + * + * @see CVedMovie + */ +class MVedMovieObserver + { +public: + + /** + * Called to notify that a new video clip has been successfully + * added to the movie. Note that the indices and the start and end times + * of the video clips after the new clip have also changed as a result. + * Note that the transitions may also have changed. + * + * @param aMovie movie + * @param aIndex index of video clip in movie + */ + virtual void NotifyVideoClipAdded(CVedMovie& aMovie, TInt aIndex) = 0; + + /** + * Called to notify that adding a new video clip to the movie has failed. + * + * Possible error codes: + * - KErrNotFound if there is no file with the specified name + * in the specified directory (but the directory exists) + * - KErrPathNotFound if the specified directory + * does not exist + * - KErrUnknown if the specified file is of unknown format + * - KErrNotSupported if the format of the file is recognized but + * adding it to the movie is not supported (e.g., it is of different resolution + * or format than the other clips) + * + * @param aMovie movie + * @param aError one of the system wide error codes + */ + virtual void NotifyVideoClipAddingFailed(CVedMovie& aMovie, TInt aError) = 0; + + /** + * Called to notify that a video clip has been removed from the movie. + * Note that the indices and the start and end times of the video clips after + * the removed clip have also changed as a result. Note that the + * transitions may also have changed. + * + * @param aMovie movie + * @param aIndex index of the removed video clip + */ + virtual void NotifyVideoClipRemoved(CVedMovie& aMovie, TInt aIndex) = 0; + + /** + * Called to notify that a video clip has moved (that is, its index and + * start and end times have changed). Note that the indices and the start and + * end times of the clips between the old and new indices have also changed + * as a result. Note that the transitions may also have changed. + * + * @param aMovie movie + * @param aOldIndex old index of the moved clip + * @param aNewIndex new index of the moved clip + */ + virtual void NotifyVideoClipIndicesChanged(CVedMovie& aMovie, TInt aOldIndex, + TInt aNewIndex) = 0; + + /** + * Called to notify that the timings (that is, the cut in or cut out time or + * the speed and consequently the end time, edited duration, and possibly audio + * settings) of a video clip have changed (but the index of the clip has + * not changed). Note that the start and end times of the video clips + * after the changed clip have also changed. + * + * @param aMovie movie + * @param aClip changed video clip + */ + virtual void NotifyVideoClipTimingsChanged(CVedMovie& aMovie, + TInt aIndex) = 0; + + /** + * Called to notify that the color effect or a color tone of the existing effect + * of a video clip has changed. + * + * @param aMovie movie + * @param aClip changed video clip + */ + virtual void NotifyVideoClipColorEffectChanged(CVedMovie& aMovie, + TInt aIndex) = 0; + + /** + * Called to notify that the audio settings of a video clip have changed. + * + * @param aMovie movie + * @param aClip changed video clip + */ + virtual void NotifyVideoClipAudioSettingsChanged(CVedMovie& aMovie, + TInt aIndex) = 0; + + /** + * Called to notify that some generator-specific settings of + * a generated video clip have changed. + * + * @param aMovie movie + * @param aClip changed video clip + */ + virtual void NotifyVideoClipGeneratorSettingsChanged(CVedMovie& aMovie, + TInt aIndex) = 0; + + /** + * Called to notify that the descriptive name of a clip has changed. + * + * @param aMovie movie + * @param aIndex changed video clip index + */ + virtual void NotifyVideoClipDescriptiveNameChanged(CVedMovie& aMovie, + TInt aIndex) = 0; + + /** + * Called to notify that the start transition effect of the movie + * has changed (but no other changes have occurred). + * + * @param aMovie movie + */ + virtual void NotifyStartTransitionEffectChanged(CVedMovie& aMovie) = 0; + + /** + * Called to notify that a middle transition effect has changed + * (but no other changes have occurred). + * + * @param aMovie movie + * @param aIndex index of the changed middle transition effect + */ + virtual void NotifyMiddleTransitionEffectChanged(CVedMovie& aMovie, + TInt aIndex) = 0; + + /** + * Called to notify that the end transition effect of the movie + * has changed (but no other changes have occurred). + * + * @param aMovie movie + */ + virtual void NotifyEndTransitionEffectChanged(CVedMovie& aMovie) = 0; + + /** + * Called to notify that a new audio clip has been successfully + * added to the movie. Note that the indices of the audio clips + * starting after the new clip have also changed as a result. + * + * @param aMovie movie + * @param aClip new audio clip + */ + virtual void NotifyAudioClipAdded(CVedMovie& aMovie, TInt aIndex) = 0; + + /** + * Called to notify that adding a new audio clip to the movie has failed. + * + * Possible error codes: + * - KErrNotFound if there is no file with the specified name + * in the specified directory (but the directory exists) + * - KErrPathNotFound if the specified directory + * does not exist + * - KErrUnknown if the specified file is of unknown format + * + * @param aMovie movie + * @param aError one of the system wide error codes + */ + virtual void NotifyAudioClipAddingFailed(CVedMovie& aMovie, TInt aError) = 0; + + /** + * Called to notify that an audio clip has been removed from the movie. + * Note that the indices of the audio clips starting after the removed + * clip have also changed as a result. + * + * @param aMovie movie + * @param aIndex index of the removed audio clip + */ + virtual void NotifyAudioClipRemoved(CVedMovie& aMovie, TInt aIndex) = 0; + + /** + * Called to notify that an audio clip has moved (that is, its + * index has changed). This may happen when the start time of the audio + * clip is changed. Note that the indices of the clips between the old and + * new indices have also changed as a result. + * + * @param aMovie movie + * @param aOldIndex old index of the moved clip + * @param aNewIndex new index of the moved clip + */ + virtual void NotifyAudioClipIndicesChanged(CVedMovie& aMovie, TInt aOldIndex, + TInt aNewIndex) = 0; + + /** + * Called to notify that the timings (for example, the start time or + * the duration) of an audio clip have changed (but the index of the + * clip has not changed as a result). + * + * @param aMovie movie + * @param aClip changed audio clip + */ + virtual void NotifyAudioClipTimingsChanged(CVedMovie& aMovie, + TInt aIndex) = 0; + + /** + * Called to notify that the quality setting of the movie has been + * changed. + * + * @param aMovie movie + */ + virtual void NotifyMovieQualityChanged(CVedMovie& aMovie) = 0; + + /** + * Called to notify that the movie has been reseted. + * + * @param aMovie movie + */ + virtual void NotifyMovieReseted(CVedMovie& aMovie) = 0; + + /** + * Called to notify that the output parameters have been changed + * + * @param aMovie movie + */ + virtual void NotifyMovieOutputParametersChanged(CVedMovie& aMovie) = 0; + + /** + * Called to notify that a dynamic level mark has been inserted + * to an audio clip. + * + * @param aMovie movie + * @param aClipIndex audio clip index + * @param aMarkIndex index of the inserted level mark + */ + virtual void NotifyAudioClipDynamicLevelMarkInserted(CVedMovie& aMovie, + TInt aClipIndex, + TInt aMarkIndex) = 0; + + /** + * Called to notify that a dynamic level mark has been inserted + * to an audio clip. + * + * @param aMovie movie + * @param aClipIndex audio clip index + * @param aMarkIndex index of the inserted level mark + */ + virtual void NotifyAudioClipDynamicLevelMarkRemoved(CVedMovie& aMovie, + TInt aClipIndex, + TInt aMarkIndex) = 0; + + /** + * Called to notify that a dynamic level mark has been inserted + * to an audio clip. + * + * @param aMovie movie + * @param aClipIndex audio clip index + * @param aMarkIndex index of the inserted level mark + */ + virtual void NotifyVideoClipDynamicLevelMarkInserted(CVedMovie& aMovie, + TInt aClipIndex, + TInt aMarkIndex) = 0; + + /** + * Called to notify that a dynamic level mark has been inserted + * to an audio clip. + * + * @param aMovie movie + * @param aClipIndex audio clip index + * @param aMarkIndex index of the inserted level mark + */ + virtual void NotifyVideoClipDynamicLevelMarkRemoved(CVedMovie& aMovie, + TInt aClipIndex, + TInt aMarkIndex) = 0; + }; + + +/** + * Observer for movie processing operations. + * + * + * @see CVedMovie + */ +class MVedMovieProcessingObserver + { +public: + /** + * Called to notify that a new movie processing operation has been started. + * + * @param aMovie movie + */ + virtual void NotifyMovieProcessingStartedL(CVedMovie& aMovie) = 0; + + /** + * Called to inform about the current progress of the movie processing operation. + * + * @param aMovie movie + * @param aPercentage percentage of the operation completed, must be + * in range 0..100 + */ + virtual void NotifyMovieProcessingProgressed(CVedMovie& aMovie, TInt aPercentage) = 0; + + /** + * Called to notify that the movie processing operation has been completed. + * + * @param aMovie movie + * @param aError error code why the operation was completed. + * KErrNone if the operation was completed + * successfully. + */ + virtual void NotifyMovieProcessingCompleted(CVedMovie& aMovie, TInt aError) = 0; + }; + + +/** + * Video movie, which consists of zero or more video clips and zero or more audio clips. + * + * @see CVedVideoClip + * @see CVedAudioClip + */ +class CVedMovie : public CBase + { +public: + + /** + * Enumeration for movie quality settings. + */ + enum TVedMovieQuality + { + EQualityAutomatic = 0, + EQualityMMSInteroperability, + EQualityResolutionCIF, // Obsolete, please use Medium/High instead + EQualityResolutionQCIF, // Obsolete, please use Medium/High instead + EQualityResolutionMedium, + EQualityResolutionHigh, + EQualityLast // this should always be the last + }; + + +public: + + /* Constructors & destructor. */ + + /** + * Constructs a new empty CVedMovie object. May leave if no resources are available. + * + * Possible leave codes: + * - KErrNoMemory if memory allocation fails + * + * @param aFs file server session to use to lock the video and audio + * clip files of the new movie; or NULL to not to lock the files + * + * @return pointer to a new CVedMovie instance + */ + static CVedMovie* NewL(RFs* aFs); + + /** + * Constructs a new empty CVedMovie object and leaves the object in the cleanup stack. + * + * Possible leave codes: + * - KErrNoMemory if memory allocation fails + * + * @param aFs file server session to use to lock the video and audio + * clip files of the new movie; or NULL to not to lock the files + * + * @return pointer to a new CVedMovie instance + */ + static CVedMovie* NewLC(RFs* aFs); + + + ~CVedMovie(); + + + /** + * Sets the quality setting of this movie. + * + * @param aQuality quality setting + */ + virtual void SetQuality(TVedMovieQuality aQuality); + + + /** + * Returns the video type of this movie. + * + * @return video type of this movie + */ + virtual TVedVideoType VideoType() const; + + /** + * Returns the resolution of this movie. Panics with + * TVedPanic::EMovieEmpty if there are no clips + * in the movie. + * + * @return resolution of the movie + */ + virtual TSize Resolution() const; + + /** + * Returns the audio type of the movie audio track. + * + * @return audio type of the movie audio track + */ + virtual TVedAudioType AudioType() const; + + /** + * Returns the audio sampling rate of the movie audio track. + * + * @return audio sampling rate of the movie audio track. + */ + virtual TInt AudioSamplingRate() const; + + /** + * Returns the audio channel mode of the movie audio track. + * + * @return audio channel mode of the movie audio track. + */ + virtual TVedAudioChannelMode AudioChannelMode() const; + + + /** + * Inserts a video clip from the specified file to the specified index + * in this movie. The observers are notified when the clip has been added + * or adding clip has failed. Panics with EMovieAddOperationAlreadyRunning + * if another add video or audio clip operation is already running. + * Panics with code USER-130 if the clip index is invalid. + * The file will be opened in EFileShareReadersOnly mode by default, + * and the same mode should be used by the client too if it need to open + * the file at the same time. + * + * Possible leave codes: + * - KErrNoMemory if memory allocation fails + * + * @param aFileName file name of the clip to add + * @param aIndex index the clip should be inserted at + */ + virtual void InsertVideoClipL(const TDesC& aFileName, TInt aIndex); + + + + /* Processing methods. */ + + /** + * Starts a video processing operation. This method is asynchronous and + * returns immediately. The processing will happen in the background and + * the observer will be notified about the progress of the operation. + * Processed data is written into the specified file. Panics with + * TVedPanic::EMovieEmpty if there are no clips + * in the movie. Note that calling ProcessL may cause + * changes in the maximum frame rates of generated clips. + * + * Possible leave codes: + * - KErrNoMemory if memory allocation fails + * - KErrAccessDenied if the file access is denied + * - KErrDiskFull if the disk is full + * - KErrWrite if not all data could be written + * - KErrBadName if the filename is bad + * - KErrDirFull if the directory is full + * + * @param aObserver observer to be notified of the processing status + * @param aFileName name of the file to be written + */ + virtual void ProcessL(const TDesC& aFileName, + MVedMovieProcessingObserver& aObserver); + + /** + * Cancels the current video processing operation. If there is no + * operation in progress, the function does nothing. + */ + virtual void CancelProcessing(); + + + /* Observer methods. */ + + /** + * Registers a movie observer. Panics with panic code + * EMovieObserverAlreadyRegistered if the movie observer is + * already registered. + * + * @param aObserver observer that will receive the events + */ + virtual void RegisterMovieObserverL(MVedMovieObserver* aObserver); + + /** + * Unregisters a movie observer. + * + * @param aObserver observer to be unregistered + */ + virtual void UnregisterMovieObserver(MVedMovieObserver* aObserver); + + + /** + * Returns the target bitrate of the movie audio track. + * + * @return target bitrate of the movie audio track. + */ + virtual TInt AudioBitrate() const; + + /** + * Returns the target framerate of the movie video track. + * + * @return target framerate of the movie video track. + */ + virtual TReal VideoFrameRate() const; + + /** + * Sets the output parameters for the movie. Leaves + * with KErrNotSupported if a parameter is illegal, + * e.g., target bitrate is too high for the given + * codec. Setting a integer parameter to zero indicates + * that a default value will be used for that parameter. + * + * This method overrides the SetQuality method + * + * Possible leave codes: + * - KErrNotSupported if setting is not valid + * + * @param Output parameters + */ + + virtual void SetOutputParametersL(TVedOutputParameters& aOutputParams); + +public: // Stub stuff + + void ConstructL(); + + CVedMovie(); + + enum TVedMovieCurrentCallbackType + { + ENotifyVideoClipAdded, + ENotifyMovieQualityChanged, + ENotifyMovieOutputParametersChanged, + ENotifyMovieProcessingStartedL, + ENotifyMovieProcessingProgressed, + ENotifyMovieProcessingCompleted + }; + + void IssueCallback( TVedMovieCurrentCallbackType aCallback ); + + static TInt AsyncTimerExpired(TAny* aPtr); + + void DoCurrentCallbackL(); + + MVedMovieObserver* iObserver; + MVedMovieProcessingObserver* iProcessObserver; + + CDeltaTimer* iDeltaTimer; + TCallBack iDeltaTimerCallBack; + TDeltaTimerEntry iDeltaTimerEntry; + + TVedMovieCurrentCallbackType iCurrentCallback; + TInt iProgress; + + TVedMovieQuality iQuality; + TVedOutputParameters iOutputParams; + TVedAudioType iAudioType; + + }; + + +#endif // __VEDMOVIE_H__ + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmcctranscoder/tsrc/stubs/inc/vedvideoclipinfo.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmcctranscoder/tsrc/stubs/inc/vedvideoclipinfo.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,379 @@ +/* +* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 __VEDVIDEOCLIPINFO_H__ +#define __VEDVIDEOCLIPINFO_H__ + +#include "VedCommon.h" + +#include + +#define KFrameIndexBestThumb (-1) // search for best possible thumbnail from video + +/* + * Forward declarations. + */ +class CFbsBitmap; +class CVedVideoClipInfo; +class CVedVideoClipGenerator; + +/** + * Observer for notifying that video clip info + * is ready for reading. + * + * @see CVedVideoClipInfo + */ +class MVedVideoClipInfoObserver + { +public: + /** + * Called to notify that video clip info is ready + * for reading. + * + * Possible error codes: + * - KErrNotFound if there is no file with the specified name + * in the specified directory (but the directory exists) + * - KErrPathNotFound if the specified directory + * does not exist + * - KErrUnknown if the specified file is of unknown format + * + * @param aInfo video clip info + * @param aError KErrNone if info is ready + * for reading; one of the system wide + * error codes if reading file failed + */ + virtual void NotifyVideoClipInfoReady(CVedVideoClipInfo& aInfo, + TInt aError) = 0; + }; + + +/** + * Observer for notifying that video clip frame has been completed. + * + * @see CVedVideoClipInfo + */ +class MVedVideoClipFrameObserver + { +public: + /** + * Called to notify that video clip frame has been completed. + * + * @param aInfo video clip info + * @param aError KErrNone if frame was + * completed successfully; one of the system wide + * error codes if generating frame failed + * @param aFrame pointer to frame if it was completed successfully; + * NULL if generating frame failed + */ + virtual void NotifyVideoClipFrameCompleted(CVedVideoClipInfo& aInfo, + TInt aError, + CFbsBitmap* aFrame) = 0; + }; + +/** + * Utility class for getting information about video clip files. + */ +class CVedVideoClipInfo : public CBase + { +public: + + /* Constructors & destructor. */ + + /** + * Constructs a new CVedVideoClipInfo object to get information + * about the specified video clip file. The specified observer + * is notified when info is ready for reading. This method + * may leave if no resources are available to construct + * a new object. + * The file will be opened in EFileShareReadersOnly mode by default, + * and the same mode should be used by the client too if it need to open + * the file at the same time. + * + * Possible leave codes: + * - KErrNoMemory if memory allocation fails + * + * @param aFileName name of video clip file + * @param aObserver observer to notify when info is ready for reading + * + * @return pointer to a new CVedVideoClipInfo instance + */ + IMPORT_C static CVedVideoClipInfo* NewL(const TDesC& aFileName, + MVedVideoClipInfoObserver& aObserver); + + /** + * Constructs a new CVedVideoClipInfo object to get information + * about the specified video clip file. The constructed object + * is left in the cleanup stack. The specified observer + * is notified when info is ready for reading. This method + * may leave if no resources are available to construct a new + * object. + * The file will be opened in EFileShareReadersOnly mode by default, + * and the same mode should be used by the client too if it need to open + * the file at the same time. + * + * Possible leave codes: + * - KErrNoMemory if memory allocation fails + * + * @param aFileName name of video clip file + * @param aObserver observer to notify when info is ready for reading + * + * @return pointer to a new CVedVideoClipInfo instance + */ + IMPORT_C static CVedVideoClipInfo* NewLC(const TDesC& aFileName, + MVedVideoClipInfoObserver& aObserver); + + /* General property methods. */ + + + /** + * Returns a descriptive name for the clip. Panics if info is not yet + * ready for reading. + * + * @return descriptive name of the clip + */ + virtual TPtrC DescriptiveName() const = 0; + + /** + * Returns the file name of the clip. Panics if there is no file + * associated with this clip or info is not yet ready for reading. + * + * @return file name of the clip + */ + virtual TPtrC FileName() const = 0; + + /** + * Returns the generator of the clip. Panics if there is no video clip + * generator associated with the clip or info is not yet ready for reading. + * + * @return generator of the clip + */ + virtual CVedVideoClipGenerator* Generator() const = 0; + + /** + * Returns the class of the clip. + * + * @return class of the clip + */ + virtual TVedVideoClipClass Class() const = 0; + + /** + * Returns the video format of the clip. Panics if there is no file + * associated with this clip or info is not yet ready for reading. + * + * @return video format of the clip + */ + virtual TVedVideoFormat Format() const = 0; + + /** + * Returns the video type of the clip. Panics if there is no file + * associated with this clip or info is not yet ready for reading. + * + * @return video type of the clip + */ + virtual TVedVideoType VideoType() const = 0; + + /** + * Returns the resolution of the clip. Panics if info + * is not yet ready for reading. + * + * @return resolution of the clip + */ + virtual TSize Resolution() const = 0; + + /** + * Returns whether this video clip has an audio track or not. + * Panics if info is not yet ready for reading. + * + * @return ETrue if clip has an audio track; + * EFalse otherwise + */ + virtual TBool HasAudio() const = 0; + + /** + * Returns the audio type of the clip audio track. Panics if there is no file + * associated with this clip or info is not yet ready for reading. + * + * @return audio type of the clip audio track + */ + virtual TVedAudioType AudioType() const = 0; + + /** + * Returns the channel mode of the audio if applicable. + * + * @return channel mode + */ + virtual TVedAudioChannelMode AudioChannelMode() const = 0; + + /** + * Returns the sampling rate in kilohertz. + * + * @return sampling rate + */ + virtual TInt AudioSamplingRate() const = 0; + + /** + * Returns the duration of the clip in microseconds. Panics if info + * is not yet ready for reading. + * + * @return duration of the clip + */ + virtual TTimeIntervalMicroSeconds Duration() const = 0; + + + /* Video frame property methods. */ + + /** + * Returns the number of video frames in this clip. Panics if info + * is not yet ready for reading. + * + * @return number of video frames in this clip + */ + virtual TInt VideoFrameCount() const = 0; + + /** + * Returns the start time of the video frame at the specified index. + * Panics if info is not yet ready for reading or the index is illegal. + * + * @param aIndex index + * + * @return start time of the video frame at the specified index in microseconds + */ + virtual TTimeIntervalMicroSeconds VideoFrameStartTimeL(TInt aIndex) = 0; + + /** + * Returns the end time of the video frame at the specified index. + * Panics if info is not yet ready for reading or the index is illegal. + * + * @param aIndex index + * + * @return end time of the video frame at the specified index in microseconds + */ + virtual TTimeIntervalMicroSeconds VideoFrameEndTimeL(TInt aIndex) = 0; + + /** + * Returns the duration of the video frame at the specified index. + * Panics if info is not yet ready for reading or the index is illegal. + * + * @param aIndex index + * + * @return duration of the video frame at the specified index in microseconds + */ + virtual TTimeIntervalMicroSeconds VideoFrameDurationL(TInt aIndex) = 0; + + /** + * Returns the size of the video frame at the specified index. + * Panics if there is no file associated with this clip, or info is not + * yet ready for reading, or the index is illegal. + * + * @param aIndex index + * + * @return size of the video frame at the specified index in bytes + */ + virtual TInt VideoFrameSizeL(TInt aIndex) = 0; + + /** + * Returns whether the video frame at the specified index is an intra + * frame or not. Panics if info is not yet ready for reading or + * the index is illegal. + * + * @param aIndex index + * + * @return ETrue, if the video frame at the specified index is an + * intra frame; EFalse, otherwise + */ + virtual TBool VideoFrameIsIntraL(TInt aIndex) = 0; + + /** + * Returns the video frame index at the specified time. Panics if info is not yet + * ready for reading or the time is illegal. + * + * @param aTime time + * + * @return video frame index at the specified time + */ + virtual TInt GetVideoFrameIndexL(TTimeIntervalMicroSeconds aTime) = 0; + + + /* Frame methods. */ + + /** + * Generates a bitmap of the given frame from video clip. + * The frame bitmap is scaled to the specified resolution and converted + * to the specified display mode. This method is asynchronous. The frame + * is generated in background and the observer is notified when the frame + * is complete. This method panics if info is not yet ready for reading or + * the resolution is illegal. + * + * Possible leave codes: + * - KErrNoMemory if memory allocation fails + * - KErrNotSupported, if the specified combination of + * parameters is not supported + * + * @param aObserver observer to be notified when the frame is completed + * @param aIndex index of frame, or KFrameIndexBestThumb to look for + * most suitable thumbnail frame. + * @param aResolution resolution of the desired frame bitmap, or + * NULL if the frame should be + * in the original resolution + * @param aDisplayMode desired display mode; or ENone if + * any display mode is acceptable + * @param aEnhance apply image enhancement algorithms to improve + * frame quality; note that this may considerably + * increase the processing time needed to prepare + * the frame + * @param aPriority priority of the frame generation + */ + virtual void GetFrameL(MVedVideoClipFrameObserver& aObserver, + TInt aIndex = KFrameIndexBestThumb, + TSize* const aResolution = 0, + TDisplayMode aDisplayMode = ENone, + TBool aEnhance = EFalse, + TInt aPriority = CActive::EPriorityIdle) = 0; + + /** + * Cancels frame generation. If no frame is currently being + * generated, the function does nothing. + */ + virtual void CancelFrame() = 0; + + /** + * Sets the transcode factor. + * + * @param aFactor transcode factor + */ + virtual void SetTranscodeFactor(TVedTranscodeFactor aFactor) = 0; + + /** + * Returns the transcode factor. + * + * @return transcode factor. + */ + virtual TVedTranscodeFactor TranscodeFactor() = 0; + + /** + * Returns whether video clip is MMSCompatible. + * + * @return ETrue if compatible with MMS + */ + virtual TBool IsMMSCompatible() = 0; + }; + + + +#endif // __VEDVIDEOCLIPINFO_H__ + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmcctranscoder/tsrc/stubs/src/vedmovie.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmcctranscoder/tsrc/stubs/src/vedmovie.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,331 @@ +/* +* 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 "vedmovie.h" + +_LIT( KMccTranscodedFile, "C:\\data\\videos\\timeraudio.3gp" ); +_LIT( KMccTranscodedAvcFile, "C:\\data\\videos\\H264_QCIF_AMR_output.3gp" ); + + +// ----------------------------------------------------------------------------- +// CVedMovie +// ----------------------------------------------------------------------------- +// +CVedMovie* CVedMovie::NewL(RFs* aFs) + { + CVedMovie* movie = CVedMovie::NewLC( aFs ); + CleanupStack::Pop( movie ); + return movie; + } + +// ----------------------------------------------------------------------------- +// CVedMovie +// ----------------------------------------------------------------------------- +// +CVedMovie* CVedMovie::NewLC(RFs* /*aFs*/) + { + CVedMovie* movie = new ( ELeave ) CVedMovie; + CleanupStack::PushL( movie ); + movie->ConstructL(); + return movie; + } + +// ----------------------------------------------------------------------------- +// CVedMovie +// ----------------------------------------------------------------------------- +// +CVedMovie::~CVedMovie() + { + CancelProcessing(); + + delete iDeltaTimer; + } + +// ----------------------------------------------------------------------------- +// CVedMovie +// ----------------------------------------------------------------------------- +// +CVedMovie::CVedMovie() : + iDeltaTimerCallBack(AsyncTimerExpired, this) + { + iDeltaTimerEntry.Set(iDeltaTimerCallBack); + iAudioType = EVedAudioTypeAMR; + } + +// ----------------------------------------------------------------------------- +// CVedMovie +// ----------------------------------------------------------------------------- +// +void CVedMovie::ConstructL() + { + iDeltaTimer = CDeltaTimer::NewL(CActive::EPriorityStandard); + } + +// ----------------------------------------------------------------------------- +// CVedMovie +// ----------------------------------------------------------------------------- +// +void CVedMovie::SetQuality(TVedMovieQuality aQuality) + { + iQuality = aQuality; + IssueCallback( ENotifyMovieQualityChanged ); + } + +// ----------------------------------------------------------------------------- +// CVedMovie +// ----------------------------------------------------------------------------- +// +TVedVideoType CVedMovie::VideoType() const + { + return EVedVideoTypeH263Profile0Level45; + } + +// ----------------------------------------------------------------------------- +// CVedMovie +// ----------------------------------------------------------------------------- +// +TSize CVedMovie::Resolution() const + { + return TSize( 176, 144 ); + } + +// ----------------------------------------------------------------------------- +// CVedMovie +// ----------------------------------------------------------------------------- +// +TVedAudioType CVedMovie::AudioType() const + { + return iAudioType; + } + +// ----------------------------------------------------------------------------- +// CVedMovie +// ----------------------------------------------------------------------------- +// +TInt CVedMovie::AudioSamplingRate() const + { + return 8000; + } + +// ----------------------------------------------------------------------------- +// CVedMovie +// ----------------------------------------------------------------------------- +// +TVedAudioChannelMode CVedMovie::AudioChannelMode() const + { + return EVedAudioChannelModeSingleChannel; + } + +// ----------------------------------------------------------------------------- +// CVedMovie +// ----------------------------------------------------------------------------- +// +void CVedMovie::InsertVideoClipL(const TDesC& /*aFileName*/, TInt /*aIndex*/) + { + IssueCallback( ENotifyVideoClipAdded ); + } + +// ----------------------------------------------------------------------------- +// CVedMovie +// ----------------------------------------------------------------------------- +// +void CVedMovie::ProcessL(const TDesC& aFileName, + MVedMovieProcessingObserver& aObserver) + { + TFileName sourcePath; + + if ( iOutputParams.iVideoType == EVedVideoTypeAVCBaselineProfile ) + { + // AVC output + sourcePath.Copy( KMccTranscodedAvcFile ); + } + else + { + // H263 output + sourcePath.Copy( KMccTranscodedFile ); + } + + RFs fs; + User::LeaveIfError( fs.Connect() ); + CleanupClosePushL( fs ); + + CFileMan* fileMan = CFileMan::NewL(fs); + CleanupStack::PushL(fileMan); + + // Make sure path exists, ignore errors since path might exist already + fs.MkDirAll( aFileName ); + + // Make the destination file writeable, ignore errors since most probably + // file doesn't exist yet + fileMan->Attribs( aFileName, 0, KEntryAttReadOnly, TTime( 0 ), 0 ); + + User::LeaveIfError( fileMan->Copy( sourcePath, aFileName ) ); + + CleanupStack::PopAndDestroy( 2 ); // fileMan, fs + + iProcessObserver = &aObserver; + iProgress = 0; + + IssueCallback( ENotifyMovieProcessingStartedL ); + } + +// ----------------------------------------------------------------------------- +// CVedMovie +// ----------------------------------------------------------------------------- +// +void CVedMovie::CancelProcessing() + { + if ( iDeltaTimer ) + { + iDeltaTimer->Remove( iDeltaTimerEntry ); + } + } + +// ----------------------------------------------------------------------------- +// CVedMovie +// ----------------------------------------------------------------------------- +// +void CVedMovie::RegisterMovieObserverL(MVedMovieObserver* aObserver) + { + iObserver = aObserver; + } + +// ----------------------------------------------------------------------------- +// CVedMovie +// ----------------------------------------------------------------------------- +// +void CVedMovie::UnregisterMovieObserver(MVedMovieObserver* /*aObserver*/) + { + iObserver = NULL; + } + +// ----------------------------------------------------------------------------- +// CVedMovie +// ----------------------------------------------------------------------------- +// +TInt CVedMovie::AudioBitrate() const + { + return 12200; + } + +// ----------------------------------------------------------------------------- +// CVedMovie +// ----------------------------------------------------------------------------- +// +TReal CVedMovie::VideoFrameRate() const + { + return 15.0; + } + +// ----------------------------------------------------------------------------- +// CVedMovie +// ----------------------------------------------------------------------------- +// +void CVedMovie::SetOutputParametersL(TVedOutputParameters& aOutputParams) + { + iOutputParams = aOutputParams; + IssueCallback( ENotifyMovieOutputParametersChanged ); + } + +// ----------------------------------------------------------------------------- +// CVedMovie +// ----------------------------------------------------------------------------- +// +void CVedMovie::IssueCallback( TVedMovieCurrentCallbackType aCallback ) + { + iDeltaTimer->Remove(iDeltaTimerEntry); + iCurrentCallback = aCallback; + TTimeIntervalMicroSeconds32 interval(200000); + iDeltaTimer->Queue(interval, iDeltaTimerEntry); + } + +// ----------------------------------------------------------------------------- +// CVedMovie +// ----------------------------------------------------------------------------- +// +TInt CVedMovie::AsyncTimerExpired(TAny* aPtr) + { + CVedMovie* self = reinterpret_cast(aPtr); + + TRAP_IGNORE( self->DoCurrentCallbackL() ) + + return ETrue; + } + +// ----------------------------------------------------------------------------- +// CVedMovie +// ----------------------------------------------------------------------------- +// +void CVedMovie::DoCurrentCallbackL() + { + __ASSERT_ALWAYS( iObserver, User::Leave( KErrNotReady ) ); + + switch ( iCurrentCallback ) + { + case ENotifyVideoClipAdded: + { + iObserver->NotifyVideoClipAdded( *this, 0 ); + break; + } + case ENotifyMovieQualityChanged: + { + iObserver->NotifyMovieQualityChanged( *this ); + break; + } + case ENotifyMovieOutputParametersChanged: + { + iObserver->NotifyMovieOutputParametersChanged( *this ); + break; + } + case ENotifyMovieProcessingStartedL: + { + __ASSERT_ALWAYS( iProcessObserver, User::Leave( KErrNotReady ) ); + + iProcessObserver->NotifyMovieProcessingStartedL( *this ); + IssueCallback( ENotifyMovieProcessingProgressed ); + break; + } + case ENotifyMovieProcessingProgressed: + { + __ASSERT_ALWAYS( iProcessObserver, User::Leave( KErrNotReady ) ); + + iProgress += 20; + if ( iProgress < 100 ) + { + iProcessObserver->NotifyMovieProcessingProgressed( *this, iProgress ); + IssueCallback( ENotifyMovieProcessingProgressed ); + } + else + { + IssueCallback( ENotifyMovieProcessingCompleted ); + } + break; + } + case ENotifyMovieProcessingCompleted: + { + __ASSERT_ALWAYS( iProcessObserver, User::Leave( KErrNotReady ) ); + + iProgress = 100; + iProcessObserver->NotifyMovieProcessingCompleted( *this, KErrNone ); + break; + } + default: + { + break; + } + } + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmcctranscoder/tsrc/ut_transcoder/BWINS/ut_transcoderu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmcctranscoder/tsrc/ut_transcoder/BWINS/ut_transcoderu.def Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,5 @@ +EXPORTS + ?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 1 NONAME ; class MEUnitTest * CreateTestSuiteL(void) + ?ImplementationGroupProxy@@YAPBUTImplementationProxy@@AAH@Z @ 2 NONAME ; struct TImplementationProxy const * ImplementationGroupProxy(int &) + ?Copy@CFileMan@@QAEHABVTDesC16@@0I@Z @ 3 NONAME ; int CFileMan::Copy(class TDesC16 const &, class TDesC16 const &, unsigned int) + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmcctranscoder/tsrc/ut_transcoder/eabi/ut_transcoderu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmcctranscoder/tsrc/ut_transcoder/eabi/ut_transcoderu.def Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,18 @@ +EXPORTS + _Z16CreateTestSuiteLv @ 1 NONAME + _Z24ImplementationGroupProxyRi @ 2 NONAME + _ZTI14CMccTranscoder @ 3 NONAME ; ## + _ZTI18CMccTranscoderImpl @ 4 NONAME ; ## + _ZTI23CMccTranscoderCodecInfo @ 5 NONAME ; ## + _ZTI24CMccTranscoderAudioCodec @ 6 NONAME ; ## + _ZTI24CMccTranscoderVideoCodec @ 7 NONAME ; ## + _ZTI25CMccTranscoderSessionInfo @ 8 NONAME ; ## + _ZTI9CVedMovie @ 9 NONAME ; ## + _ZTV14CMccTranscoder @ 10 NONAME ; ## + _ZTV18CMccTranscoderImpl @ 11 NONAME ; ## + _ZTV23CMccTranscoderCodecInfo @ 12 NONAME ; ## + _ZTV24CMccTranscoderAudioCodec @ 13 NONAME ; ## + _ZTV24CMccTranscoderVideoCodec @ 14 NONAME ; ## + _ZTV25CMccTranscoderSessionInfo @ 15 NONAME ; ## + _ZTV9CVedMovie @ 16 NONAME ; ## + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmcctranscoder/tsrc/ut_transcoder/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmcctranscoder/tsrc/ut_transcoder/group/bld.inf Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,28 @@ +/* +* 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: project specification +* +*/ + + + +PRJ_PLATFORMS +DEFAULT + + +PRJ_EXPORTS + + +PRJ_MMPFILES +ut_transcoder.mmp diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmcctranscoder/tsrc/ut_transcoder/group/ut_transcoder.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmcctranscoder/tsrc/ut_transcoder/group/ut_transcoder.mmp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,84 @@ +/* +* 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 + +TARGET ut_transcoder.dll +TARGETTYPE dll +EPOCALLOWDLLDATA +TARGETPATH /DigiaEUnit/Tests +UID 0x1000af5a 0x10282396 + +CAPABILITY EUNIT_CAPS +VENDORID VID_DEFAULT + + +MACRO UNIT_TESTING + +// Test suite classes +SOURCEPATH ../src +SOURCE ut_transcoderdllmain.cpp + +// Defines, stubs and other test helpers + + +// Test classes +SOURCEPATH ../src +SOURCE ut_mcctranscoder.cpp +SOURCE ut_mcctranscoderimpl.cpp +SOURCE ut_mcctranscodersessioninfo.cpp + + +// Tested classes +SOURCEPATH ../../../src +SOURCE transcoder.cpp +SOURCE transcoderimpl.cpp +SOURCE transcoderimplementationproxy.cpp +SOURCE transcodercodecinfo.cpp +SOURCE transcoderaudiocodec.cpp +SOURCE transcodervideocodec.cpp +SOURCE transcodersessioninfo.cpp +SOURCEPATH ../../stubs/src +SOURCE vedmovie.cpp + +// Includes + +USERINCLUDE ../../../inc +USERINCLUDE ../inc +USERINCLUDE ../../stubs/inc + +APP_LAYER_SYSTEMINCLUDE + +//SOURCEPATH ../../../data + +//START RESOURCE 10282896.rss +//TARGET mmcctranscoder.rsc +//END + +LIBRARY euser.lib +LIBRARY mmfserverbaseclasses.lib +LIBRARY ecom.lib +LIBRARY mmfcontrollerframework.lib +LIBRARY efsrv.lib +LIBRARY EUnit.lib +DEBUGLIBRARY flogger.lib + +//EXPORTUNFROZEN + + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmcctranscoder/tsrc/ut_transcoder/inc/ut_mcctranscoder.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmcctranscoder/tsrc/ut_transcoder/inc/ut_mcctranscoder.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,88 @@ +/* +* 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: Unit test +* +*/ + + + +#ifndef __UT_CMCCTRANSCODER_H__ +#define __UT_CMCCTRANSCODER_H__ + + +// EXTERNAL INCLUDES +#include +#include +#include +#include + +// Forward declaration + + +// Next row is to disable warning emerging from EUnit code. +// Placement is due to a fact that most test case files +// include this file. Directive can be removed when +// EUnit is fixed. +#pragma warn_illtokenpasting off + +// CLASS DEFINITION +/** + * Tester class for CMusCallMonitorBase. + * + */ +NONSHARABLE_CLASS( UT_CMccTranscoder ): public CEUnitTestSuiteClass, + public MMccTranscoderObserver + + { + public: + //Two phase construction + static UT_CMccTranscoder* NewL(); + static UT_CMccTranscoder* NewLC(); + // Destructor + ~UT_CMccTranscoder(); + + private: // Constructor + UT_CMccTranscoder(); + void ConstructL(); + + private: // from MMccTranscoderObserver + + void MccTranscoderEventReceived( TMccEvent& aEvent ); + + + private: // Test case setup and teardown + void SetupL(); + void Teardown(); + + + private: // Test methdods + + void UT_CMccTranscoder_RegisterEventObserverL(); + void UT_CMccTranscoder_UnregisterEventObserverL(); + void UT_CMccTranscoder_TranscodeFileLL(); + void UT_CMccTranscoder_CancelTranscodeFileLL(); + + private: // Data + CMccTranscoder* iMccTranscoder; + TMccEvent iMccEvent; + + TMccTranscodeFileMsg iData; + + EUNIT_DECLARE_TEST_TABLE; + + }; + +#endif // __UT_CMCCTRANSCODER_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmcctranscoder/tsrc/ut_transcoder/inc/ut_mcctranscoderimpl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmcctranscoder/tsrc/ut_transcoder/inc/ut_mcctranscoderimpl.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,106 @@ +/* +* 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: Unit test +* +*/ + + + +#ifndef __UT_CMCCTRANSCODERIMPL_H__ +#define __UT_CMCCTRANSCODERIMPL_H__ + + +// EXTERNAL INCLUDES +#include +#include +#include +#include + +// Forward declaration +class CMccTranscoderImpl; +class CVedMovie; + + +// Next row is to disable warning emerging from EUnit code. +// Placement is due to a fact that most test case files +// include this file. Directive can be removed when +// EUnit is fixed. +#pragma warn_illtokenpasting off + +// CLASS DEFINITION +/** + * Tester class for CMusCallMonitorBase. + * + */ + +NONSHARABLE_CLASS( UT_CMccTranscoderImpl ): public CEUnitTestSuiteClass, + public MMccTranscoderObserver + { + public: + //Two phase construction + static UT_CMccTranscoderImpl* NewL(); + static UT_CMccTranscoderImpl* NewLC(); + // Destructor + ~UT_CMccTranscoderImpl(); + + private: // Constructor + UT_CMccTranscoderImpl(); + void ConstructL(); + + private: // Test case setup and teardown + void SetupL(); + void Setup2L(); + void Teardown(); + + private: // from MMccTranscoderObserver + + void MccTranscoderEventReceived( TMccEvent& aEvent ); + + private: // helpers + void Reset( TInt aError = KErrNone ); + + private: // Test methdods + + void UT_CMccTranscoderImpl_RegisterEventObserverL(); + void UT_CMccTranscoderImpl_UnregisterEventObserverL(); + void UT_CMccTranscoderImpl_TranscodeFileLL(); + void UT_CMccTranscoderImpl_CancelTranscodeFileLL(); + void UT_CMccTranscoderImpl_NotifyVideoClipAddedL(); + void UT_CMccTranscoderImpl_NotifyVideoClipAdded2L(); + void UT_CMccTranscoderImpl_NotifyVideoClipAddingFailedL(); + void UT_CMccTranscoderImpl_NotifyVideoClipRemovedL(); + void UT_CMccTranscoderImpl_NotifyMovieQualityChangedL(); + void UT_CMccTranscoderImpl_NotifyMovieProcessingStartedLL(); + void UT_CMccTranscoderImpl_NotifyMovieProcessingProgressedL(); + void UT_CMccTranscoderImpl_NotifyMovieProcessingCompletedL(); + void UT_CMccTranscoderImpl_NotifyMovieOutputParametersChangedL(); + void UT_CMccTranscoderImpl_AsyncTimerExpiredL(); + + + private: // Data + CMccTranscoderImpl* iMccTranscoder; + + CVedMovie* iMovie; + + TMccTranscodeFileMsg iData; + + TMccEvent iMccEvent; + + EUNIT_DECLARE_TEST_TABLE; + + }; + +#endif // __UT_CMCCTRANSCODERIMPL_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmcctranscoder/tsrc/ut_transcoder/inc/ut_mcctranscodersessioninfo.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmcctranscoder/tsrc/ut_transcoder/inc/ut_mcctranscodersessioninfo.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,91 @@ +/* +* 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_CMCCTRANSCODERSESSIONINFO_H__ +#define __UT_CMCCTRANSCODERSESSIONINFO_H__ + + +// EXTERNAL INCLUDES +#include +#include +#include +#include + +// Forward declaration +class CMccTranscoderSessionInfo; +class CVedMovie; + + +// Next row is to disable warning emerging from EUnit code. +// Placement is due to a fact that most test case files +// include this file. Directive can be removed when +// EUnit is fixed. +#pragma warn_illtokenpasting off + +// CLASS DEFINITION +/** + * Tester class for CMusCallMonitorBase. + * + */ + +NONSHARABLE_CLASS( UT_CMccTranscoderSessionInfo ): public CEUnitTestSuiteClass + { + public: + //Two phase construction + static UT_CMccTranscoderSessionInfo* NewL(); + static UT_CMccTranscoderSessionInfo* NewLC(); + // Destructor + ~UT_CMccTranscoderSessionInfo(); + + private: // Constructor + UT_CMccTranscoderSessionInfo(); + void ConstructL(); + + private: // Test case setup and teardown + void SetupL(); + void Teardown(); + + private: // Test methdods + + + void UT_CMccTranscoderSessionInfo_SetQualityL(); + void UT_CMccTranscoderSessionInfo_CreateMovieLL(); + void UT_CMccTranscoderSessionInfo_SetDesFileLL(); + void UT_CMccTranscoderSessionInfo_SetVideoCodecL(); + void UT_CMccTranscoderSessionInfo_SetAudioCodecL(); + void UT_CMccTranscoderSessionInfo_SetVideoTypeL(); + void UT_CMccTranscoderSessionInfo_SetAudioTypeL(); + void UT_CMccTranscoderSessionInfo_CheckVideoCodecLL(); + void UT_CMccTranscoderSessionInfo_CheckAudioCodecLL(); + void UT_CMccTranscoderSessionInfo_GetPutputParametersL(); + void UT_CMccTranscoderSessionInfo_ProgressedL(); + void UT_CMccTranscoderSessionInfo_ClipAddedL(); + void UT_CMccTranscoderSessionInfo_QualityChangeNeededL(); + + private: // Data + CMccTranscoderSessionInfo* iSession; + + CVedMovie* iMovie; + + EUNIT_DECLARE_TEST_TABLE; + + }; + +#endif // __UT_CMCCTRANSCODERSESSIONINFO_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmcctranscoder/tsrc/ut_transcoder/src/ut_mcctranscoder.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmcctranscoder/tsrc/ut_transcoder/src/ut_mcctranscoder.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,239 @@ +/* +* 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: Unit test +* +*/ + + + +// INTERNAL INCLUDES +#include "ut_mcctranscoder.h" +#include "mmcctranscoder.h" +#include "transcoderimpl.h" + +_LIT( KTestMccTranscodeFile, "C:\\data\\videos\\big.3gp" ); +_LIT( KTestMccTranscodedFile, "C:\\data\\videos\\normal.3gp" ); +_LIT8( KTestMccTranscodedVideoMimeType, "H264" ); +_LIT8( KTestMccTranscodedAudioMimeType, "AAC" ); + + +// SYSTEM INCLUDES +#include + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMccTranscoder* UT_CMccTranscoder::NewL() + { + UT_CMccTranscoder* self = UT_CMccTranscoder::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMccTranscoder* UT_CMccTranscoder::NewLC() + { + UT_CMccTranscoder* self = new( ELeave ) UT_CMccTranscoder(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMccTranscoder::~UT_CMccTranscoder() + { + } + + +// ----------------------------------------------------------------------------- +// Default constructor +// ----------------------------------------------------------------------------- +// +UT_CMccTranscoder::UT_CMccTranscoder() + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// Second phase construct +// ----------------------------------------------------------------------------- +// +void UT_CMccTranscoder::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMccTranscoder::SetupL() + { + iMccTranscoder = CMccTranscoder::NewL(); + iMccTranscoder->RegisterEventObserver( *this ); + + iData.iSourceFile = KTestMccTranscodeFile(); + iData.iDesFile = KTestMccTranscodedFile(); + iData.iQuality = CVedMovie::EQualityAutomatic; + iData.iVideoCodec.iMimeType = KTestMccTranscodedVideoMimeType(); + iData.iAudioCodec.iMimeType = KTestMccTranscodedAudioMimeType(); + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMccTranscoder::Teardown() + { + delete iMccTranscoder; + } + +void UT_CMccTranscoder::MccTranscoderEventReceived( TMccEvent& aEvent ) + { + iMccEvent = aEvent; + } + + + +// TEST CASES + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMccTranscoder::UT_CMccTranscoder_RegisterEventObserverL() + { + iMccTranscoder->RegisterEventObserver( *this ); + delete iMccTranscoder->iTranscoderImpl; + iMccTranscoder->iTranscoderImpl = NULL; + + iMccTranscoder->RegisterEventObserver( *this ); + } + + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMccTranscoder::UT_CMccTranscoder_UnregisterEventObserverL() + { + iMccTranscoder->UnregisterEventObserver(); + delete iMccTranscoder->iTranscoderImpl; + iMccTranscoder->iTranscoderImpl = NULL; + + iMccTranscoder->UnregisterEventObserver(); + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMccTranscoder::UT_CMccTranscoder_TranscodeFileLL() + { + + TMccTranscodeFileMsgBuffer data( iData ); + TUint32 sessionId = 0; + iMccTranscoder->TranscodeFileL( sessionId, data ); + + delete iMccTranscoder->iTranscoderImpl; + iMccTranscoder->iTranscoderImpl = NULL; + + EUNIT_ASSERT_LEAVE( iMccTranscoder->TranscodeFileL( sessionId, data ) ); + + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMccTranscoder::UT_CMccTranscoder_CancelTranscodeFileLL() + { + + EUNIT_ASSERT_LEAVE( iMccTranscoder->CancelTranscodeFileL( 11 ) ); + + TMccTranscodeFileMsgBuffer data( iData ); + TUint32 sessionId = 0; + iMccTranscoder->TranscodeFileL( sessionId, data ); + EUNIT_ASSERT( sessionId ); + + iMccTranscoder->CancelTranscodeFileL( sessionId ); + + } + + + + + + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_CMccTranscoder, + "UT_CMccTranscoder", + "UNIT" ) + +EUNIT_TEST( + "RegisterEventObserver - test", + "CMccTranscoder", + "RegisterEventObserver", + "FUNCTIONALITY", + SetupL, UT_CMccTranscoder_RegisterEventObserverL, Teardown) + +EUNIT_TEST( + "UnregisterEventObserver - test", + "CMccTranscoder", + "UnregisterEventObserver", + "FUNCTIONALITY", + SetupL, UT_CMccTranscoder_UnregisterEventObserverL, Teardown) + +EUNIT_TEST( + "TranscodeFileL - test", + "CMccTranscoder", + "TranscodeFileL", + "FUNCTIONALITY", + SetupL, UT_CMccTranscoder_TranscodeFileLL, Teardown) + +EUNIT_TEST( + "CancelTranscodeFileL - test", + "CMccTranscoder", + "CancelTranscodeFileL", + "FUNCTIONALITY", + SetupL, UT_CMccTranscoder_CancelTranscodeFileLL, Teardown) + + + +EUNIT_END_TEST_TABLE + +// END OF FILE + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmcctranscoder/tsrc/ut_transcoder/src/ut_mcctranscoderimpl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmcctranscoder/tsrc/ut_transcoder/src/ut_mcctranscoderimpl.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,681 @@ +/* +* 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: Unit test +* +*/ + + + +// INTERNAL INCLUDES +#include "ut_mcctranscoderimpl.h" +#include "transcoderimpl.h" + + +// SYSTEM INCLUDES +#include + +static TInt error; + +_LIT( KTestMccTranscodeFile, "C:\\data\\videos\\big.3gp" ); +_LIT( KTestMccTranscodedFile, "C:\\data\\videos\\normal.3gp" ); +_LIT8( KTestMccTranscodedVideoMimeType, "H264" ); +_LIT8( KTestMccTranscodedAudioMimeType, "AAC" ); + +#define TC_MEMORY_LEAVE_CHECKING_ON + +#ifdef TC_MEMORY_LEAVE_CHECKING_ON +#define TC_CHECK_MEMORY_LEAVE( conditions ) \ +if ( !(conditions) )\ + {\ + User::Leave( KErrNoMemory );\ + } + +#else +#define TC_CHECK_MEMORY_LEAVE( conditions ) \ + EUNIT_ASSERT( conditions ) +#endif + +#ifdef TC_MEMORY_LEAVE_CHECKING_ON +#define TC_CHECK_MEMORY_LEAVE_NEG( conditions ) \ +if ( conditions )\ + {\ + User::Leave( KErrNoMemory );\ + } + +#else +#define TC_CHECK_MEMORY_LEAVE_NEG( conditions ) +#endif + + +void CDeltaTimer::RunL() + { + } + +TInt CFileMan::Copy(const TDesC& /*anOld*/,const TDesC& /*aNew*/,TUint /*aSwitches*/) + { + return error; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMccTranscoderImpl* UT_CMccTranscoderImpl::NewL() + { + UT_CMccTranscoderImpl* self = UT_CMccTranscoderImpl::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMccTranscoderImpl* UT_CMccTranscoderImpl::NewLC() + { + UT_CMccTranscoderImpl* self = new( ELeave ) UT_CMccTranscoderImpl(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMccTranscoderImpl::~UT_CMccTranscoderImpl() + { + } + + +// ----------------------------------------------------------------------------- +// Default constructor +// ----------------------------------------------------------------------------- +// +UT_CMccTranscoderImpl::UT_CMccTranscoderImpl() + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// Second phase construct +// ----------------------------------------------------------------------------- +// +void UT_CMccTranscoderImpl::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMccTranscoderImpl::SetupL() + { + RFs fs; + CleanupClosePushL( fs ); + iMovie = CVedMovie::NewL( &fs ); + CleanupStack::PopAndDestroy();//fs + + iMccTranscoder = CMccTranscoderImpl::NewL(); + + iData.iSourceFile = KTestMccTranscodeFile(); + iData.iDesFile = KTestMccTranscodedFile(); + iData.iQuality = CVedMovie::EQualityAutomatic; + iData.iVideoCodec.iMimeType = KTestMccTranscodedVideoMimeType(); + iData.iAudioCodec.iMimeType = KTestMccTranscodedAudioMimeType(); + iMccTranscoder->RegisterEventObserver( *this ); + + Reset(); + + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMccTranscoderImpl::Setup2L() + { + RFs fs; + CleanupClosePushL( fs ); + iMovie = CVedMovie::NewL( &fs ); + CleanupStack::PopAndDestroy();//fs + + iMccTranscoder = CMccTranscoderImpl::NewL(); + + iData.iSourceFile = KTestMccTranscodeFile(); + iData.iDesFile = KTestMccTranscodedFile(); + iData.iQuality = CVedMovie::EQualityMMSInteroperability; + iData.iVideoCodec.iMimeType = KNullDesC8; + iData.iAudioCodec.iMimeType = KNullDesC8; + iMccTranscoder->RegisterEventObserver( *this ); + + Reset(); + + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMccTranscoderImpl::Teardown() + { + delete iMccTranscoder; + delete iMovie; + + } + + +void UT_CMccTranscoderImpl::MccTranscoderEventReceived( TMccEvent& aEvent ) + { + iMccEvent = aEvent; + } + + +void UT_CMccTranscoderImpl::Reset( TInt aError ) + { + iMccEvent = TMccEvent(); + error = aError; + + } + +// TEST CASES + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMccTranscoderImpl::UT_CMccTranscoderImpl_RegisterEventObserverL() + { + EUNIT_ASSERT( iMccTranscoder->iEventObserver ); + iMccTranscoder->RegisterEventObserver( *this ); + EUNIT_ASSERT( iMccTranscoder->iEventObserver == this); + iMccTranscoder->iEventObserver = NULL; + iMccTranscoder->RegisterEventObserver( *this ); + EUNIT_ASSERT( iMccTranscoder->iEventObserver == this); + + } + + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMccTranscoderImpl::UT_CMccTranscoderImpl_UnregisterEventObserverL() + { + EUNIT_ASSERT( iMccTranscoder->iEventObserver ); + iMccTranscoder->UnregisterEventObserver(); + EUNIT_ASSERT( !iMccTranscoder->iEventObserver ); + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMccTranscoderImpl::UT_CMccTranscoderImpl_TranscodeFileLL() + { + EUNIT_ASSERT( iMccTranscoder->FindSession( 1 ) == KErrNotFound ); + EUNIT_ASSERT( iMccEvent.iEventType == KMccEventNone ); + + TMccTranscodeFileMsgBuffer data( iData ); + TUint32 sessionId1 = 0; + iMccTranscoder->TranscodeFileL( sessionId1, data ); + EUNIT_ASSERT( sessionId1 != 0 ); + EUNIT_ASSERT( iMccTranscoder->iSessionArray.Count() == 1 ); + EUNIT_ASSERT( iMccEvent.iEventType == KMccEventNone ); + TUint32 sessionId2 = 0; + iMccTranscoder->TranscodeFileL( sessionId2, data ); + EUNIT_ASSERT( sessionId2 != 0 ); + EUNIT_ASSERT( iMccTranscoder->iSessionArray.Count() == 2 ); + EUNIT_ASSERT( iMccEvent.iEventType == KMccEventNone ); + EUNIT_ASSERT( sessionId2 != sessionId1 ); + + EUNIT_ASSERT( iMccTranscoder->FindSession( sessionId1 ) == 0 ); + EUNIT_ASSERT( iMccTranscoder->FindSession( sessionId2 ) == 1 ); + + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMccTranscoderImpl::UT_CMccTranscoderImpl_CancelTranscodeFileLL() + { + EUNIT_ASSERT( iMccEvent.iEventType == KMccEventNone ); + TMccTranscodeFileMsgBuffer data( iData ); + TUint32 sessionId = 0; + + EUNIT_ASSERT_LEAVE( iMccTranscoder->CancelTranscodeFileL( sessionId ) ); + + iMccTranscoder->TranscodeFileL( sessionId, data ); + iMccTranscoder->CancelTranscodeFileL( sessionId ); + EUNIT_ASSERT( iMccEvent.iEventType == KMccTranscodeCancelled ); + + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMccTranscoderImpl::UT_CMccTranscoderImpl_NotifyVideoClipAddedL() + { + // Quality change is not needed after clip has been added + // + + EUNIT_ASSERT( iMccEvent.iEventType == KMccEventNone ); + + TMccTranscodeFileMsgBuffer data( iData ); + + iMccTranscoder->NotifyVideoClipAdded( *iMovie, 0 ); + EUNIT_ASSERT( iMccEvent.iEventType == KMccEventNone ); + TUint32 sessionId = 0; + iMccTranscoder->TranscodeFileL( sessionId, data ); + EUNIT_ASSERT( iMccTranscoder->iSessionArray.Count() == 1 ); + EUNIT_ASSERT( iMccEvent.iEventType == KMccEventNone ); + + iMccTranscoder->NotifyVideoClipAdded( iMccTranscoder->iSessionArray[0]->Movie(), 0 ); + EUNIT_ASSERT( iMccEvent.iEventType == KMccEventNone ); + EUNIT_ASSERT_EQUALS( iMccTranscoder->iSessionArray[0]->Movie().iCurrentCallback, + CVedMovie::ENotifyMovieOutputParametersChanged ); + + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMccTranscoderImpl::UT_CMccTranscoderImpl_NotifyVideoClipAdded2L() + { + // Quality change is done once clip is added + // + + EUNIT_ASSERT( iMccEvent.iEventType == KMccEventNone ); + + TMccTranscodeFileMsgBuffer data( iData ); + + iMccTranscoder->NotifyVideoClipAdded( *iMovie, 0 ); + EUNIT_ASSERT( iMccEvent.iEventType == KMccEventNone ); + TUint32 sessionId = 0; + iMccTranscoder->TranscodeFileL( sessionId, data ); + EUNIT_ASSERT( iMccTranscoder->iSessionArray.Count() == 1 ); + EUNIT_ASSERT( iMccEvent.iEventType == KMccEventNone ); + + iMccTranscoder->NotifyVideoClipAdded( iMccTranscoder->iSessionArray[0]->Movie(), 0 ); + EUNIT_ASSERT( iMccEvent.iEventType == KMccEventNone ); + EUNIT_ASSERT_EQUALS( iMccTranscoder->iSessionArray[0]->Movie().iCurrentCallback, + CVedMovie::ENotifyMovieQualityChanged ); + + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMccTranscoderImpl::UT_CMccTranscoderImpl_NotifyVideoClipAddingFailedL() + { + EUNIT_ASSERT( iMccEvent.iEventType == KMccEventNone ); + EUNIT_ASSERT( iMccEvent.iErrorCode == KErrNone ); + TMccTranscodeFileMsgBuffer data( iData ); + + iMccTranscoder->NotifyVideoClipAddingFailed( *iMovie, KErrArgument ); + EUNIT_ASSERT( iMccEvent.iEventType == KMccEventNone ); + + TUint32 sessionId = 0; + iMccTranscoder->TranscodeFileL( sessionId, data ); + EUNIT_ASSERT( iMccTranscoder->iSessionArray.Count() == 1 ); + EUNIT_ASSERT( iMccEvent.iEventType == KMccEventNone ); + + iMccTranscoder->NotifyVideoClipAddingFailed( iMccTranscoder->iSessionArray[0]->Movie(), KErrArgument ); + EUNIT_ASSERT( iMccEvent.iEventType == KMccTranscodeCompleted ); + EUNIT_ASSERT( iMccEvent.iErrorCode != KErrNone ); + EUNIT_ASSERT( iMccTranscoder->iSessionArray.Count() == 1 ); + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMccTranscoderImpl::UT_CMccTranscoderImpl_NotifyVideoClipRemovedL() + { + EUNIT_ASSERT( iMccEvent.iEventType == KMccEventNone ); + EUNIT_ASSERT( iMccEvent.iErrorCode == KErrNone ); + TMccTranscodeFileMsgBuffer data( iData ); + + iMccTranscoder->NotifyVideoClipRemoved( *iMovie, 0 ); + EUNIT_ASSERT( iMccEvent.iEventType == KMccEventNone ); + + TUint32 sessionId = 0; + iMccTranscoder->TranscodeFileL( sessionId, data ); + EUNIT_ASSERT( iMccTranscoder->iSessionArray.Count() == 1 ); + EUNIT_ASSERT( iMccEvent.iEventType == KMccEventNone ); + + iMccTranscoder->NotifyVideoClipRemoved( iMccTranscoder->iSessionArray[0]->Movie(), 0 ); + EUNIT_ASSERT( iMccEvent.iEventType == KMccEventNone ); + EUNIT_ASSERT( iMccEvent.iErrorCode == KErrNone ); + EUNIT_ASSERT( iMccTranscoder->iSessionArray.Count() == 1 ); + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMccTranscoderImpl::UT_CMccTranscoderImpl_NotifyMovieQualityChangedL() + { + EUNIT_ASSERT( iMccEvent.iEventType == KMccEventNone ); + EUNIT_ASSERT( iMccEvent.iErrorCode == KErrNone ); + TMccTranscodeFileMsgBuffer data( iData ); + + iMccTranscoder->NotifyMovieQualityChanged( *iMovie ); + EUNIT_ASSERT( iMccEvent.iEventType == KMccEventNone ); + + TUint32 sessionId = 0; + iMccTranscoder->TranscodeFileL( sessionId, data ); + EUNIT_ASSERT( iMccTranscoder->iSessionArray.Count() == 1 ); + EUNIT_ASSERT( iMccEvent.iEventType == KMccEventNone ); + + iMccTranscoder->NotifyMovieQualityChanged( iMccTranscoder->iSessionArray[0]->Movie() ); + EUNIT_ASSERT( iMccEvent.iEventType == KMccEventNone ); + EUNIT_ASSERT( iMccEvent.iErrorCode == KErrNone ); + EUNIT_ASSERT( iMccTranscoder->iSessionArray.Count() == 1 ); + + /* error in SetOutputParametersL + * + Reset(); + iMccTranscoder->NotifyMovieQualityChanged( iMccTranscoder->iSessionArray[0]->Movie() ); + EUNIT_ASSERT( iMccEvent.iEventType == KMccTranscodeCompleted ); + EUNIT_ASSERT( iMccEvent.iErrorCode != KErrNone ); + EUNIT_ASSERT( iMccTranscoder->iSessionArray.Count() == 1 ); + */ + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMccTranscoderImpl::UT_CMccTranscoderImpl_NotifyMovieProcessingStartedLL() + { + EUNIT_ASSERT( iMccEvent.iEventType == KMccEventNone ); + EUNIT_ASSERT( iMccEvent.iErrorCode == KErrNone ); + TMccTranscodeFileMsgBuffer data( iData ); + + iMccTranscoder->NotifyMovieProcessingStartedL( *iMovie ); + EUNIT_ASSERT( iMccEvent.iEventType == KMccEventNone ); + + TUint32 sessionId = 0; + iMccTranscoder->TranscodeFileL( sessionId, data ); + EUNIT_ASSERT( iMccTranscoder->iSessionArray.Count() == 1 ); + EUNIT_ASSERT( iMccEvent.iEventType == KMccEventNone ); + + iMccTranscoder->NotifyMovieProcessingStartedL( iMccTranscoder->iSessionArray[0]->Movie() ); + EUNIT_ASSERT( iMccEvent.iEventType == KMccTranscodeInProgress ); + EUNIT_ASSERT( iMccEvent.iErrorCode == KErrNone ); + + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMccTranscoderImpl::UT_CMccTranscoderImpl_NotifyMovieOutputParametersChangedL() + { + EUNIT_ASSERT( iMccEvent.iEventType == KMccEventNone ); + EUNIT_ASSERT( iMccEvent.iErrorCode == KErrNone ); + TMccTranscodeFileMsgBuffer data( iData ); + + iMccTranscoder->NotifyMovieOutputParametersChanged( *iMovie ); + EUNIT_ASSERT( iMccEvent.iEventType == KMccEventNone ); + + TUint32 sessionId = 0; + iMccTranscoder->TranscodeFileL( sessionId, data ); + EUNIT_ASSERT( iMccTranscoder->iSessionArray.Count() == 1 ); + EUNIT_ASSERT( iMccEvent.iEventType == KMccEventNone ); + + iMccTranscoder->NotifyMovieOutputParametersChanged( iMccTranscoder->iSessionArray[0]->Movie() ); + TC_CHECK_MEMORY_LEAVE( iMccEvent.iEventType == KMccEventNone ); + + //processL fails + Reset( KErrNotFound ); + iMccTranscoder->NotifyMovieOutputParametersChanged( iMccTranscoder->iSessionArray[0]->Movie() ); + EUNIT_ASSERT( iMccEvent.iEventType == KMccTranscodeCompleted ); + EUNIT_ASSERT( iMccEvent.iErrorCode != KErrNone ); + + + + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMccTranscoderImpl::UT_CMccTranscoderImpl_NotifyMovieProcessingProgressedL() + { + TInt testData1 = 5; + TInt testData2 = 10; + + EUNIT_ASSERT( iMccEvent.iEventType == KMccEventNone ); + EUNIT_ASSERT( iMccEvent.iErrorCode == KErrNone ); + TMccTranscodeFileMsgBuffer data( iData ); + + iMccTranscoder->NotifyMovieProcessingProgressed( *iMovie, 0 ); + EUNIT_ASSERT( iMccEvent.iEventType == KMccEventNone ); + + TUint32 sessionId = 0; + iMccTranscoder->TranscodeFileL( sessionId, data ); + EUNIT_ASSERT( iMccTranscoder->iSessionArray.Count() == 1 ); + EUNIT_ASSERT( iMccEvent.iEventType == KMccEventNone ); + + // Progress is notified only at 10%, 20% etc. + iMccTranscoder->NotifyMovieProcessingProgressed( iMccTranscoder->iSessionArray[0]->Movie(), testData1 ); + EUNIT_ASSERT( iMccEvent.iEventType == KMccEventNone ); + + iMccTranscoder->NotifyMovieProcessingProgressed( iMccTranscoder->iSessionArray[0]->Movie(), testData2 ); + EUNIT_ASSERT( iMccEvent.iEventType == KMccTranscodeInProgress ); + EUNIT_ASSERT( iMccEvent.iEventNumData == testData2 ); + + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMccTranscoderImpl::UT_CMccTranscoderImpl_NotifyMovieProcessingCompletedL() + { + EUNIT_ASSERT( iMccEvent.iEventType == KMccEventNone ); + EUNIT_ASSERT( iMccEvent.iErrorCode == KErrNone ); + TMccTranscodeFileMsgBuffer data( iData ); + + iMccTranscoder->NotifyMovieProcessingCompleted( *iMovie, 0 ); + EUNIT_ASSERT( iMccEvent.iEventType == KMccEventNone ); + + TUint32 sessionId = 0; + iMccTranscoder->TranscodeFileL( sessionId, data ); + EUNIT_ASSERT( iMccTranscoder->iSessionArray.Count() == 1 ); + EUNIT_ASSERT( iMccEvent.iEventType == KMccEventNone ); + + iMccTranscoder->NotifyMovieProcessingCompleted( iMccTranscoder->iSessionArray[0]->Movie(), KErrArgument ); + EUNIT_ASSERT( iMccEvent.iEventType == KMccTranscodeCompleted ); + EUNIT_ASSERT( iMccEvent.iErrorCode == KErrArgument ); + EUNIT_ASSERT( iMccEvent.iEventNumData == 100 ); + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMccTranscoderImpl::UT_CMccTranscoderImpl_AsyncTimerExpiredL() + { + + iMccTranscoder->AsyncTimerExpired( NULL ); + EUNIT_ASSERT( iMccTranscoder->iSessionArray.Count() == 0 ); + EUNIT_ASSERT( iMccEvent.iEventType == KMccEventNone ); + + iMccTranscoder->AsyncTimerExpired( iMccTranscoder ); + EUNIT_ASSERT( iMccTranscoder->iSessionArray.Count() == 0 ); + EUNIT_ASSERT( iMccEvent.iEventType == KMccEventNone ); + + TMccTranscodeFileMsgBuffer data( iData ); + TUint32 sessionId = 0; + iMccTranscoder->TranscodeFileL( sessionId, data ); + EUNIT_ASSERT( iMccTranscoder->iSessionArray.Count() == 1 ); + EUNIT_ASSERT( iMccEvent.iEventType == KMccEventNone ); + + iMccTranscoder->AsyncTimerExpired( iMccTranscoder ); + EUNIT_ASSERT( iMccTranscoder->iSessionArray.Count() == 1 ); + EUNIT_ASSERT( iMccEvent.iEventType == KMccEventNone ); + + iMccTranscoder->RemoveSession( 0 ); + iMccTranscoder->AsyncTimerExpired( iMccTranscoder ); + EUNIT_ASSERT( iMccTranscoder->iSessionArray.Count() == 0 ); + EUNIT_ASSERT( iMccEvent.iEventType == KMccEventNone ); + + + } + + + + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_CMccTranscoderImpl, + "UT_CMccTranscoderImpl", + "UNIT" ) + +EUNIT_TEST( + "RegisterEventObserver - test", + "CMccTranscoderImpl", + "RegisterEventObserver", + "FUNCTIONALITY", + SetupL, UT_CMccTranscoderImpl_RegisterEventObserverL, Teardown) + +EUNIT_TEST( + "UnregisterEventObserver - test", + "CMccTranscoderImpl", + "UnregisterEventObserver", + "FUNCTIONALITY", + SetupL, UT_CMccTranscoderImpl_UnregisterEventObserverL, Teardown) + +EUNIT_TEST( + "TranscodeFileL - test", + "CMccTranscoderImpl", + "TranscodeFileL", + "FUNCTIONALITY", + SetupL, UT_CMccTranscoderImpl_TranscodeFileLL, Teardown) + +EUNIT_TEST( + "CancelTranscodeFileL - test", + "CMccTranscoderImpl", + "CancelTranscodeFileL", + "FUNCTIONALITY", + SetupL, UT_CMccTranscoderImpl_CancelTranscodeFileLL, Teardown) + +EUNIT_TEST( + "NotifyVideoClipAdded - test", + "CMccTranscoderImpl", + "NotifyVideoClipAdded", + "FUNCTIONALITY", + SetupL, UT_CMccTranscoderImpl_NotifyVideoClipAddedL, Teardown) + +EUNIT_TEST( + "NotifyVideoClipAdded 2 - test", + "CMccTranscoderImpl", + "NotifyVideoClipAdded 2", + "FUNCTIONALITY", + Setup2L, UT_CMccTranscoderImpl_NotifyVideoClipAdded2L, Teardown) + +EUNIT_TEST( + "NotifyVideoClipAddingFailed - test", + "CMccTranscoderImpl", + "NotifyVideoClipAddingFailed", + "FUNCTIONALITY", + SetupL, UT_CMccTranscoderImpl_NotifyVideoClipAddingFailedL, Teardown) + +EUNIT_TEST( + "NotifyVideoClipRemoved - test", + "CMccTranscoderImpl", + "NotifyVideoClipRemoved", + "FUNCTIONALITY", + SetupL, UT_CMccTranscoderImpl_NotifyVideoClipRemovedL, Teardown) + +EUNIT_TEST( + "NotifyMovieQualityChanged - test", + "CMccTranscoderImpl", + "NotifyMovieQualityChanged", + "FUNCTIONALITY", + SetupL, UT_CMccTranscoderImpl_NotifyMovieQualityChangedL, Teardown) + +EUNIT_TEST( + "NotifyMovieOutputParametersChanged - test", + "CMccTranscoderImpl", + "NotifyMovieOutputParametersChanged", + "FUNCTIONALITY", + SetupL, UT_CMccTranscoderImpl_NotifyMovieOutputParametersChangedL, Teardown) + + +EUNIT_TEST( + "NotifyMovieProcessingStartedL - test", + "CMccTranscoderImpl", + "NotifyMovieProcessingStartedL", + "FUNCTIONALITY", + SetupL, UT_CMccTranscoderImpl_NotifyMovieProcessingStartedLL, Teardown) + +EUNIT_TEST( + "NotifyMovieProcessingProgressed - test", + "CMccTranscoderImpl", + "NotifyMovieProcessingProgressed", + "FUNCTIONALITY", + SetupL, UT_CMccTranscoderImpl_NotifyMovieProcessingProgressedL, Teardown) + +EUNIT_TEST( + "NotifyMovieProcessingCompleted - test", + "CMccTranscoderImpl", + "NotifyMovieProcessingCompleted", + "FUNCTIONALITY", + SetupL, UT_CMccTranscoderImpl_NotifyMovieProcessingCompletedL, Teardown) + +EUNIT_TEST( + "AsyncTimerExpired - test", + "CMccTranscoderImpl", + "AsyncTimerExpired", + "FUNCTIONALITY", + SetupL, UT_CMccTranscoderImpl_AsyncTimerExpiredL, Teardown) + + +EUNIT_END_TEST_TABLE + +// END OF FILE + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmcctranscoder/tsrc/ut_transcoder/src/ut_mcctranscodersessioninfo.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmcctranscoder/tsrc/ut_transcoder/src/ut_mcctranscodersessioninfo.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,532 @@ +/* +* 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: Unit test +* +*/ + + + +// INTERNAL INCLUDES +#include "ut_mcctranscodersessioninfo.h" +#include "transcodersessioninfo.h" +#include + + +// SYSTEM INCLUDES +#include + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMccTranscoderSessionInfo* UT_CMccTranscoderSessionInfo::NewL() + { + UT_CMccTranscoderSessionInfo* self = UT_CMccTranscoderSessionInfo::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMccTranscoderSessionInfo* UT_CMccTranscoderSessionInfo::NewLC() + { + UT_CMccTranscoderSessionInfo* self = new( ELeave ) UT_CMccTranscoderSessionInfo(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMccTranscoderSessionInfo::~UT_CMccTranscoderSessionInfo() + { + } + + +// ----------------------------------------------------------------------------- +// Default constructor +// ----------------------------------------------------------------------------- +// +UT_CMccTranscoderSessionInfo::UT_CMccTranscoderSessionInfo() + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// Second phase construct +// ----------------------------------------------------------------------------- +// +void UT_CMccTranscoderSessionInfo::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMccTranscoderSessionInfo::SetupL() + { + RFs fs; + CleanupClosePushL( fs ); + iMovie = CVedMovie::NewL( &fs ); + CleanupStack::PopAndDestroy();//fs + iSession = CMccTranscoderSessionInfo::NewLC(); + CleanupStack::Pop(); + + CMccTranscoderAudioCodec* acodec = CMccTranscoderAudioCodec::NewL(); + iSession->SetAudioCodec( acodec ); + CMccTranscoderVideoCodec* vcodec = CMccTranscoderVideoCodec::NewL(); + iSession->SetVideoCodec( vcodec ); + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMccTranscoderSessionInfo::Teardown() + { + delete iSession; + delete iMovie; + + } + + + +// TEST CASES + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMccTranscoderSessionInfo::UT_CMccTranscoderSessionInfo_SetQualityL() + { + + EUNIT_ASSERT( !iSession->iQuality ); + + iSession->SetQuality( CVedMovie::EQualityAutomatic ); + EUNIT_ASSERT( iSession->Quality() == CVedMovie::EQualityAutomatic ); + + iSession->SetQuality( CVedMovie::EQualityMMSInteroperability ); + EUNIT_ASSERT( iSession->Quality() == CVedMovie::EQualityMMSInteroperability ); + + iSession->SetQuality( CVedMovie::EQualityResolutionCIF ); + EUNIT_ASSERT( iSession->Quality() == CVedMovie::EQualityResolutionCIF ); + + iSession->SetQuality( CVedMovie::EQualityLast ); + EUNIT_ASSERT( iSession->Quality() == CVedMovie::EQualityLast ); + + iSession->SetQuality( 589 ); + EUNIT_ASSERT( iSession->Quality() == CVedMovie::EQualityLast ); + + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMccTranscoderSessionInfo::UT_CMccTranscoderSessionInfo_CreateMovieLL() + { + + EUNIT_ASSERT( !iSession->iMovie ); + + iSession->CreateMovieL(); + EUNIT_ASSERT( &iSession->Movie() ); + + iSession->CreateMovieL(); + EUNIT_ASSERT( &iSession->Movie() ); + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMccTranscoderSessionInfo::UT_CMccTranscoderSessionInfo_SetDesFileLL() + { + + _LIT( KTestFile, "C:\\testfile.3gp"); + + EUNIT_ASSERT( iSession->iDesFile.Length() == 0 ); + EUNIT_ASSERT_LEAVE( iSession->SetDesFileL( KNullDesC ) ); + + EUNIT_ASSERT( iSession->iDesFile.Length() == 0 ); + iSession->SetDesFileL( KTestFile ); + EUNIT_ASSERT( iSession->DesFile() == KTestFile() ); + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMccTranscoderSessionInfo::UT_CMccTranscoderSessionInfo_SetVideoCodecL() + { + EUNIT_ASSERT( iSession->iVideoCodec ); + + CMccTranscoderVideoCodec* codec = CMccTranscoderVideoCodec::NewL(); + iSession->SetVideoCodec( codec ); + EUNIT_ASSERT( &iSession->VideoCodec() == codec ); + + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMccTranscoderSessionInfo::UT_CMccTranscoderSessionInfo_SetAudioCodecL() + { + EUNIT_ASSERT( iSession->iAudioCodec ); + + CMccTranscoderAudioCodec* codec = CMccTranscoderAudioCodec::NewL(); + iSession->SetAudioCodec( codec ); + EUNIT_ASSERT( &iSession->AudioCodec() == codec ); + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMccTranscoderSessionInfo::UT_CMccTranscoderSessionInfo_SetVideoTypeL() + { + + EUNIT_ASSERT( iSession->VideoCodec().VideoType() == EVedVideoTypeUnrecognized ); + + iSession->SetVideoType( KAVCSdpName, 0 ); + EUNIT_ASSERT( iSession->VideoCodec().VideoType() == EVedVideoTypeAVCBaselineProfile ); + + iSession->SetVideoType( KH263SdpName, 0 ); + EUNIT_ASSERT( iSession->VideoCodec().VideoType() == EVedVideoTypeH263Profile0Level10 ); + + iSession->SetVideoType( KH2631998SdpName, 0 ); + EUNIT_ASSERT( iSession->VideoCodec().VideoType() == EVedVideoTypeH263Profile0Level10 ); + + iSession->SetVideoType( KH2632000SdpName, 0 ); + EUNIT_ASSERT( iSession->VideoCodec().VideoType() == EVedVideoTypeH263Profile0Level10 ); + + iSession->SetVideoType( KH2632000SdpName, 64001 ); + EUNIT_ASSERT( iSession->VideoCodec().VideoType() == EVedVideoTypeH263Profile0Level45 ); + + iSession->SetVideoType( KH2632000SdpName, 64001 ); + EUNIT_ASSERT( iSession->VideoCodec().VideoType() == EVedVideoTypeH263Profile0Level45 ); + + iSession->VideoCodec().SetVideoType( EVedVideoTypeUnrecognized ); + iSession->SetVideoType( KH2632000SdpName, 128001 ); + EUNIT_ASSERT( iSession->VideoCodec().VideoType() == EVedVideoTypeUnrecognized ); + + + iSession->SetVideoType( KNullDesC8, 64001 ); + EUNIT_ASSERT( iSession->VideoCodec().VideoType() == EVedVideoTypeUnrecognized ); + + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMccTranscoderSessionInfo::UT_CMccTranscoderSessionInfo_SetAudioTypeL() + { + + EUNIT_ASSERT( iSession->AudioCodec().AudioType() == EVedAudioTypeUnrecognized ); + + iSession->SetAudioType( KAACSdpName ); + EUNIT_ASSERT( iSession->AudioCodec().AudioType() == EVedAudioTypeAAC_LC ); + + iSession->SetAudioType( KAMRSdpName ); + EUNIT_ASSERT( iSession->AudioCodec().AudioType() == EVedAudioTypeAMR ); + + iSession->SetAudioType( KNullDesC8 ); + EUNIT_ASSERT( iSession->AudioCodec().AudioType() == EVedAudioTypeUnrecognized ); + + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMccTranscoderSessionInfo::UT_CMccTranscoderSessionInfo_CheckVideoCodecLL() + { + EUNIT_ASSERT( iSession->VideoCodec().VideoType() == EVedVideoTypeUnrecognized ); + + TMccTranscoderCodecInfo info; + iSession->CheckVideoCodecL( info ); + EUNIT_ASSERT( iSession->VideoCodec().VideoType() == EVedVideoTypeUnrecognized ); + + info.iMimeType = KAVCSdpName(); + iSession->CheckVideoCodecL( info ); + EUNIT_ASSERT( iSession->VideoCodec().VideoType() == EVedVideoTypeAVCBaselineProfile ); + + delete iSession->iVideoCodec; + iSession->iVideoCodec = NULL; + iSession->CheckVideoCodecL( info ); + EUNIT_ASSERT( iSession->VideoCodec().VideoType() == EVedVideoTypeAVCBaselineProfile ); + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMccTranscoderSessionInfo::UT_CMccTranscoderSessionInfo_CheckAudioCodecLL() + { + EUNIT_ASSERT( iSession->AudioCodec().AudioType() == EVedAudioTypeUnrecognized ); + + TMccTranscoderCodecInfo info; + iSession->CheckAudioCodecL( info ); + EUNIT_ASSERT( iSession->AudioCodec().AudioType() == EVedAudioTypeUnrecognized ); + + info.iMimeType = KAACSdpName(); + iSession->CheckAudioCodecL( info ); + EUNIT_ASSERT( iSession->AudioCodec().AudioType() == EVedAudioTypeAAC_LC ); + + delete iSession->iAudioCodec; + iSession->iAudioCodec = NULL; + iSession->CheckAudioCodecL( info ); + EUNIT_ASSERT( iSession->AudioCodec().AudioType() == EVedAudioTypeAAC_LC ); + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMccTranscoderSessionInfo::UT_CMccTranscoderSessionInfo_GetPutputParametersL() + { + iSession->SetVideoType( KAVCSdpName, 0 ); + iSession->SetAudioType( KAACSdpName ); + + TVedOutputParameters params; + + iSession->GetPutputParameters( params ); + EUNIT_ASSERT( params.iVideoType == EVedVideoTypeAVCBaselineProfile ); + EUNIT_ASSERT( params.iAudioType == EVedAudioTypeAAC_LC ); + + + // Video codec present, but no audio codec + iSession->CreateMovieL(); + delete iSession->iAudioCodec; + iSession->iAudioCodec = NULL; + + // Strange compatibility hack needed when using avc without audio + iSession->iMovie->iAudioType = EVedAudioTypeNoAudio; + params.iAudioBitrate = 0; + iSession->GetPutputParameters( params ); + EUNIT_ASSERT( params.iVideoType == EVedVideoTypeAVCBaselineProfile ); + EUNIT_ASSERT( params.iAudioType == EVedAudioTypeNoAudio ); + EUNIT_ASSERT( params.iAudioBitrate == 16000 ); + + // No hack needed for H263 codec without audio + iSession->iVideoCodec->SetVideoType( EVedVideoTypeH263Profile0Level10 ); + params.iAudioBitrate = 0; + iSession->GetPutputParameters( params ); + EUNIT_ASSERT( params.iVideoType == EVedVideoTypeH263Profile0Level10 ); + EUNIT_ASSERT( params.iAudioType == EVedAudioTypeNoAudio ); + EUNIT_ASSERT( params.iAudioBitrate == 0 ); + + // Either of codecs are present + iSession->iMovie->iAudioType = EVedAudioTypeAMR; + delete iSession->iVideoCodec; + iSession->iVideoCodec = NULL; + + iSession->GetPutputParameters( params ); + EUNIT_ASSERT( params.iSyncIntervalInPicture == 0 ); + + delete iSession->iMovie; + iSession->iMovie = NULL; + + iSession->GetPutputParameters( params ); + EUNIT_ASSERT( params.iSyncIntervalInPicture == 0 ); + + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMccTranscoderSessionInfo::UT_CMccTranscoderSessionInfo_ProgressedL() + { + EUNIT_ASSERT( !iSession->iAudioNotPresent ); + + EUNIT_ASSERT( iSession->Progressed( 20 ) == 20 ); + iSession->iAudioNotPresent = ETrue; + EUNIT_ASSERT( iSession->Progressed( 50 ) == 50 * 2 ); + EUNIT_ASSERT( iSession->Progressed( 49 ) == 49 * 2 ); + EUNIT_ASSERT( iSession->Progressed( 75 ) == 75 ); + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMccTranscoderSessionInfo::UT_CMccTranscoderSessionInfo_ClipAddedL() + { + EUNIT_ASSERT( !iSession->iAudioNotPresent ); + iSession->ClipAdded(); + EUNIT_ASSERT( !iSession->iAudioNotPresent ); + + iSession->CreateMovieL(); + iSession->ClipAdded(); + + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMccTranscoderSessionInfo::UT_CMccTranscoderSessionInfo_QualityChangeNeededL() + { + iSession->SetQuality( CVedMovie::EQualityMMSInteroperability ); + EUNIT_ASSERT( !iSession->QualityChangeNeeded() ); + + iSession->SetVideoCodec( NULL ); + EUNIT_ASSERT( iSession->QualityChangeNeeded() ); + + + iSession->SetQuality( CVedMovie::EQualityAutomatic ); + EUNIT_ASSERT( !iSession->QualityChangeNeeded() ); + } + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_CMccTranscoderSessionInfo, + "UT_CMccTranscoderSessionInfo", + "UNIT" ) + +EUNIT_TEST( + "SetQuality - test", + "CMccTranscoderSessionInfo", + "SetQuality", + "FUNCTIONALITY", + SetupL, UT_CMccTranscoderSessionInfo_SetQualityL, Teardown) + +EUNIT_TEST( + "CreateMovieL - test", + "CMccTranscoderSessionInfo", + "CreateMovieL", + "FUNCTIONALITY", + SetupL, UT_CMccTranscoderSessionInfo_CreateMovieLL, Teardown) + +EUNIT_TEST( + "SetDesFileL - test", + "CMccTranscoderSessionInfo", + "SetDesFileL", + "FUNCTIONALITY", + SetupL, UT_CMccTranscoderSessionInfo_SetDesFileLL, Teardown) + +EUNIT_TEST( + "SetVideoCodec - test", + "CMccTranscoderSessionInfo", + "SetVideoCodec", + "FUNCTIONALITY", + SetupL, UT_CMccTranscoderSessionInfo_SetVideoCodecL, Teardown) + +EUNIT_TEST( + "SetAudioCodec - test", + "CMccTranscoderSessionInfo", + "SetAudioCodec", + "FUNCTIONALITY", + SetupL, UT_CMccTranscoderSessionInfo_SetAudioCodecL, Teardown) + +EUNIT_TEST( + "SetVideoType - test", + "CMccTranscoderSessionInfo", + "SetVideoType", + "FUNCTIONALITY", + SetupL, UT_CMccTranscoderSessionInfo_SetVideoTypeL, Teardown) + +EUNIT_TEST( + "SetAudioType - test", + "CMccTranscoderSessionInfo", + "SetAudioType", + "FUNCTIONALITY", + SetupL, UT_CMccTranscoderSessionInfo_SetAudioTypeL, Teardown) + +EUNIT_TEST( + "CheckVideoCodecL - test", + "CMccTranscoderSessionInfo", + "CheckVideoCodecL", + "FUNCTIONALITY", + SetupL, UT_CMccTranscoderSessionInfo_CheckVideoCodecLL, Teardown) + +EUNIT_TEST( + "CheckAudioCodecL - test", + "CMccTranscoderSessionInfo", + "CheckAudioCodecL", + "FUNCTIONALITY", + SetupL, UT_CMccTranscoderSessionInfo_CheckAudioCodecLL, Teardown) + +EUNIT_TEST( + "GetPutputParameters - test", + "CMccTranscoderSessionInfo", + "GetPutputParameters", + "FUNCTIONALITY", + SetupL, UT_CMccTranscoderSessionInfo_GetPutputParametersL, Teardown) + +EUNIT_TEST( + "Progressed - test", + "CMccTranscoderSessionInfo", + "Progressed", + "FUNCTIONALITY", + SetupL, UT_CMccTranscoderSessionInfo_ProgressedL, Teardown) + +EUNIT_TEST( + "ClipAdded - test", + "CMccTranscoderSessionInfo", + "ClipAdded", + "FUNCTIONALITY", + SetupL, UT_CMccTranscoderSessionInfo_ClipAddedL, Teardown) + +EUNIT_TEST( + "QualityChangeNeeded - test", + "CMccTranscoderSessionInfo", + "QualityChangeNeeded", + "FUNCTIONALITY", + SetupL, UT_CMccTranscoderSessionInfo_QualityChangeNeededL, Teardown) + + +EUNIT_END_TEST_TABLE + +// END OF FILE + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmcctranscoder/tsrc/ut_transcoder/src/ut_transcoderdllmain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmcctranscoder/tsrc/ut_transcoder/src/ut_transcoderdllmain.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,49 @@ +/* +* 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: Unit test +* +*/ + + +// USER INCLUDES +#include "ut_mcctranscoder.h" +#include "ut_mcctranscoderimpl.h" +#include "ut_mcctranscodersessioninfo.h" + +// SYSTEM INCLUDES +#include + + +// ----------------------------------------------------------------------------- +// Test suite factory function. +// ----------------------------------------------------------------------------- +// +EXPORT_C MEUnitTest* CreateTestSuiteL() + { + + CEUnitTestSuite* rootSuite = CEUnitTestSuite::NewLC( _L( "mcctranscoder" ) ); + + rootSuite->AddL( UT_CMccTranscoder::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMccTranscoderImpl::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMccTranscoderSessionInfo::NewLC() ); + CleanupStack::Pop(); + + CleanupStack::Pop( rootSuite ); + + return rootSuite; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaiwplugin/data/10282389.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaiwplugin/data/10282389.rss Thu Jul 22 16:32:26 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: Resource file. +* +*/ + + + +// +// The application name. +// +#include +#include +#include +#include +#include +#include "musaiwprovider.hrh" +#include "../../../inc/musversionnumbers.h" +#include + +// ------------------------------------------------------------------------- +// ECOM registry information +// ------------------------------------------------------------------------- + +RESOURCE REGISTRY_INFO theInfo + { + resource_format_version = RESOURCE_FORMAT_VERSION_2; + dll_uid = KMusAiwProviderUid; + interfaces = + { + INTERFACE_INFO + { + // Menu service class (offers menu based services) + interface_uid = 0x101F8652; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = KMusAiwProviderUid; + version_no = KMusEcomVersionNumber; + display_name = "AIW Example Provider"; + default_data = "image/jpeg"; + opaque_data = KAiwCmdShareStr; + } + }; + } + }; + } + +// end of file + + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaiwplugin/data/musaiwprovider.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaiwplugin/data/musaiwprovider.rss Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,137 @@ +/* +* 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 file. +* +*/ + + + +// +// The application name. +// + +#include +#include +#include +#include +#include +#include + +#include "musaiwprovider.hrh" +#include +#include //localization + +// +// The resource file signature -- should be empty. +// +RESOURCE RSS_SIGNATURE + { + } + +// +// Default document name. +// +RESOURCE TBUF r_default_document_name { buf = ""; } + +RESOURCE TBUF r_musaiwprovider_network_incompatible { buf = qtn_mshstarter_note_network_incompatible; } +RESOURCE TBUF r_musaiwprovider_on_hold { buf = qtn_mshstarter_note_on_hold; } +RESOURCE TBUF r_musaiwprovider_conference_call { buf = qtn_mshstarter_note_conference_call; } +RESOURCE TBUF r_musaiwprovider_recipient_incapable { buf = qtn_mshstarter_note_recipient_incapable; } +RESOURCE TBUF r_musaiwprovider_no_reg { buf = qtn_msh_note_no_reg; } +RESOURCE TBUF r_musaiwprovider_app_general { buf = qtn_msh_note_error_app_general; } + +// +// The submenu items offered through the AIW framework when +// sharing isn't yet going on. +// +RESOURCE MENU_PANE r_musaiwprovider_basic_cascaded_submenu + { + items = + { + MENU_ITEM + { + command = AIW_SUBMENU_TITLE; + txt = qtn_incal_share_video; + }, + MENU_ITEM + { + command = EMusCommandLiveShare; + txt = qtn_incal_live_video; + }, + MENU_ITEM + { + command = EMusCommandClipShare; + txt = qtn_incal_video_clip; + } + /*, + MENU_ITEM + { + command = EMusCommandImageShare; + txt = qtn_mshstarter_share_sub_image; + }*/ + }; + } + +// +// for no camera variants +// The submenu items offered through the AIW framework when +// sharing isn't yet going on. Clip sharing for no camera +// devices is started straight from Share Video -option +// (no submenu until image sharing is implemented) +// +RESOURCE MENU_PANE r_musaiwprovider_nocamera_cascaded_submenu + { + items = + { + MENU_ITEM + { + command = EMusCommandClipShare; + txt = qtn_incal_share_video; + } + /* + MENU_ITEM + { + command = AIW_SUBMENU_TITLE; + txt = qtn_incal_share_video; + }, + MENU_ITEM + { + command = EMusCommandClipShare; + txt = qtn_incal_video_clip; + } + , + MENU_ITEM + { + command = EMusCommandImageShare; + txt = qtn_mshstarter_share_sub_image; + }*/ + }; + } + +// +// The submenu items offered through the AIW framework when +// there's already sharing going on. +// +RESOURCE MENU_PANE r_musaiwprovider_running_cascaded_submenu + { + items = + { + MENU_ITEM + { + command = EMusCommandContinue; + txt = qtn_incal_continue_sharing; + } + }; + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaiwplugin/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaiwplugin/group/bld.inf Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,29 @@ +/* +* 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: project specification +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + + +PRJ_EXPORTS + +PRJ_MMPFILES +musaiwprovider.mmp + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaiwplugin/group/musaiwprovider.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaiwplugin/group/musaiwprovider.mmp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,75 @@ +/* +* 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: Subsystem's project specification. +* +*/ + + +#include +#include +#include "../../../inc/musuid.hrh" + +TARGET musaiwprovider.dll +TARGETTYPE PLUGIN +UID 0x10009D8D KMusAiwProviderUid +VENDORID VID_DEFAULT +CAPABILITY CAP_ECOM_PLUGIN + +SOURCEPATH ../data + +START RESOURCE 10282389.rss +TARGET musaiwprovider.rsc +END + +// Published to /resource +START RESOURCE musaiwprovider.rss +HEADER +TARGET musaiwproviderui.rsc +TARGETPATH RESOURCE_FILES_DIR +LANGUAGE_IDS +END + + +SOURCEPATH ../src +SOURCE musaiwprovider.cpp +SOURCE musaiwprovidermain.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../../inc + +APP_LAYER_SYSTEMINCLUDE + +// MultimediaSharing libraries +LIBRARY musmanagerclient.lib +LIBRARY musindicator.lib + +// SymbianOS/Series60 libraries +LIBRARY aknnotify.lib +LIBRARY eiksrv.lib +LIBRARY euser.lib +LIBRARY apgrfx.lib // Application Architecture +LIBRARY apparc.lib +LIBRARY bafl.lib // Basic Application Framework Library +LIBRARY cone.lib +LIBRARY ecom.lib +LIBRARY efsrv.lib +LIBRARY servicehandler.lib // AIW Consumer API +LIBRARY commonengine.lib +LIBRARY charconv.lib +LIBRARY ws32.lib +LIBRARY featmgr.lib // Feature Manager +LIBRARY centralrepository.lib +DEBUGLIBRARY flogger.lib // file logger + +PAGED diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaiwplugin/inc/musaiwprovider.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaiwplugin/inc/musaiwprovider.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,184 @@ +/* +* 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: The ECOM interface implementation. +* +*/ + + +#ifndef MUSAIWPROVIDER_H +#define MUSAIWPROVIDER_H + + +#include "musunittesting.h" +#include "musmanagercommon.h" +#include +#include + +// forward declarations + +class CEikonEnv; +class CMusManager; +class MAiwNotifyCallback; +class RResourceFile; +class CMusIndicatorApi; + + + +// function declarations + +IMPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount ); + +/** + * CMusAiwProvider + */ +class CMusAiwProvider : public CAiwServiceIfMenu + { + MUS_UNITTEST( UT_CMusAiwProvider ) +public: // constructors and destructor + + static CMusAiwProvider* NewL(); + + virtual ~CMusAiwProvider(); + +private: // constructors + + CMusAiwProvider(); + + void ConstructL(); + +public: // from CAiwServiceIfBase + + /** + * Called by the AIW framework to initialise the provider with + * necessary information. + * + * @param aFrameworkCallback Framework-provided callback for the + * provider to send events to the + * framework. + * @param aInterest List of criteria items which invoked + * the provider. + * @exception Symbian OS error code + */ + void InitialiseL( MAiwNotifyCallback& aFrameworkCallback, + const RCriteriaArray& aInterest ); + + /** + * Executes generic service commands included in criteria. + * + * @param aCmdId The command to be executed. + * @param aInParamList Input parameters. Can be an empty list. + * @param aOutParamList Output parameters. Can be an empty list. + * @param aCmdOptions Options for the command. See + * KAiwCmdOpt* constants. + * @param aCallback Callback for asynchronous command + * handling, parameter checking, etc. + * @see enum TServiceCmdOptions in GENERICPARAM.HRH. + * @exception KErrArgument if callback is missing when required. + * @exception KErrNotSupported if no provider support service. + */ + void HandleServiceCmdL( const TInt& aCmdId, + const CAiwGenericParamList& aInParamList, + CAiwGenericParamList& aOutParamList, + TUint aCmdOptions = 0, + const MAiwNotifyCallback* aCallback = NULL ); + +public: // from CAiwServiceIfMenu + + /** + * Initializes menu pane by adding provider-specific menu + * items. The AIW Framework gives the parameters to be used + * in addition. + * + * @param aMenuPane Menu pane handle. + * @param aIndex Position of item where to add menu items. + * @param aCascadeId ID of cascade menu item. + * @param aInParamList The input parameter list for provider's + * parameters checking. + */ + void InitializeMenuPaneL( CAiwMenuPane& aMenuPane, + TInt aIndex, + TInt aCascadeId, + const CAiwGenericParamList& aInParamList ); + + /** + * Handles a menu command invoked by the Handler. + * + * @param aMenuCmdId Command ID for the menu command, + * defined by the provider when adding + * the menu commands. + * @param aInParamList Input parameters. Could be empty list. + * @param aOutParamList Output parameters. Could be empty list. + * @param aCmdOptions Options for the command. See + * KAiwCmdOpt* constants. + * @param aCallback Callback if asynchronous command + * handling is wanted by consumer. The + * provider might not support this. If not, + * the function leaves with KErrNotSupported. + */ + void HandleMenuCmdL( TInt aMenuCmdId, + const CAiwGenericParamList& aInParamList, + CAiwGenericParamList& aOutParamList, + TUint aCmdOptions = 0, + const MAiwNotifyCallback* aCallback = NULL ); + + +private: // helper functions + + TBool ApplicationRunningL(); + + void NoVariationStartUpL( TFileName& aFileName, + CAiwMenuPane& aMenuPane, + TInt aIndex ); + + void OperatorVariantStartUpL( TFileName& aFileName, + CAiwMenuPane& aMenuPane, + TInt aIndex ); + + void FastModeStartUpL( + TFileName& aFileName, CAiwMenuPane& aMenuPane, TInt aIndex ); + + void ShowErrorNoteL( TInt aError ); + + HBufC* ErrorNoteTextLC( TInt aError ); + + HBufC8* ErrorNoteText8L( TInt aError, RResourceFile& aResourceFile ); + + void DoInitialiseL(); + + TBool AvailabilityOk( + MultimediaSharing::TMusAvailabilityStatus aAvailability ) const; + + TBool HiddenFromFastSwapL(); + + TBool IsFastStartupModeL(); + + void StartApplicationL( + CMusManager& aManager, MultimediaSharing::TMusUseCase aUseCase ); + +private: // data + + /** The AIW resource file name. */ + HBufC* iResourceFileName; + + /** Current availability status. */ + MultimediaSharing::TMusAvailabilityStatus iAvailability; + + /** To Differentiate Error and Warning Notes */ + TBool iIsWarning ; + + CMusIndicatorApi* iIndicator; + }; + + +#endif // MUSAIWPROVIDER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaiwplugin/inc/musaiwprovider.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaiwplugin/inc/musaiwprovider.hrh Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,34 @@ +/* +* 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: enumerations and UID constants +* +*/ + + +#ifndef MUSAIWPROVIDER_HRH +#define MUSAIWPROVIDER_HRH + +#include "../../../inc/musuid.hrh" + +// Values for MultimediaSharing submenu commands. +enum TMusSubmenuCommands + { + EMusCommandLiveShare = 0, // Start live sharing. + EMusCommandClipShare = 1, // Share sharing a clip. + EMusCommandImageShare = 2, + EMusCommandContinue = 3 // Return to sharing that is already running. + }; + + +#endif // MUSAIWPROVIDER_HRH diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaiwplugin/src/musaiwprovider.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaiwplugin/src/musaiwprovider.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,719 @@ +/* +* Copyright (c) 2006-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: The ECOM interface implementation. +* +*/ + + + + +#include "musaiwprovider.h" +#include "musaiwprovider.hrh" +#include "muslogger.h" +#include "musmanagercommon.h" +#include "musmanager.h" +#include "musuid.hrh" +#include "musresourcefinderutil.h" +#include "mussettings.h" +#include "mussesseioninformationapi.h" +#include "musindicatorapi.h" +#include "mussessionproperties.h" + +#include + +#include +#include +#include // AIW classes and definitions +#include // AIW constants +#include // AIW Menu pane +#include // CAknInformationNote +#include // Resources +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +//////// public -- constructor and destructor //////// + +_LIT( KMusAiwProviderResource, "musaiwproviderui.rsc" ); + +// ----------------------------------------------------------------------------- +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CMusAiwProvider* CMusAiwProvider::NewL() + { + MUS_LOG( "mus: [AIWPRO] -> CMusAiwProvider::NewL" ) + CMusAiwProvider* self = new( ELeave ) CMusAiwProvider; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + MUS_LOG( "mus: [AIWPRO] <- CMusAiwProvider::NewL" ) + return self; + } + + +// ----------------------------------------------------------------------------- +// C++ destructor. +// ----------------------------------------------------------------------------- +// +CMusAiwProvider::~CMusAiwProvider() + { + MUS_LOG( "mus: [AIWPRO] -> CMusAiwProvider::~CMusAiwProvider" ) + delete iResourceFileName ; + iResourceFileName = NULL ; + delete iIndicator; + iIndicator = NULL ; + MUS_LOG( "mus: [AIWPRO] <- CMusAiwProvider::~CMusAiwProvider" ) + } + + +//////// private -- constructors //////// + +// ----------------------------------------------------------------------------- +// C++ constructor. +// ----------------------------------------------------------------------------- +// +CMusAiwProvider::CMusAiwProvider() +: iIsWarning( ETrue ) + { + } + + +// ----------------------------------------------------------------------------- +// Symbian second-phase constructor. +// ----------------------------------------------------------------------------- +// +void CMusAiwProvider::ConstructL() + { + MUS_LOG( "mus: [AIWPRO] -> CMusAiwProvider::ConstructL" ) + iResourceFileName = MusResourceFinderUtil::ResourcePathL( + KMusAiwProviderResource ); + + DoInitialiseL(); + + MUS_LOG( "mus: [AIWPRO] <- CMusAiwProvider::ConstructL" ) + } + + + +//////// public -- from CAiwServiceIfBase //////// + +// ----------------------------------------------------------------------------- +// Called by the AIW framework to initialize the provider with necessary +// information. +// ----------------------------------------------------------------------------- +// +void CMusAiwProvider::InitialiseL( + MAiwNotifyCallback& /* aFrameworkCallback*/, + const RCriteriaArray& /* aInterest */ ) + { + MUS_LOG( "mus: [AIWPRO] -> CMusAiwProvider::InitialiseL") + MUS_LOG( "mus: [AIWPRO] <- CMusAiwProvider::InitialiseL") + } + + + + + +//////// public -- from CAiwServiceIfMenu //////// + +// ----------------------------------------------------------------------------- +// Initializes menu pane by adding provider-specific menu items. +// ----------------------------------------------------------------------------- +// +void CMusAiwProvider::InitializeMenuPaneL( + CAiwMenuPane& aMenuPane, + TInt aIndex, + TInt /* aCascadeId */, + const CAiwGenericParamList& /* aInParamList */ ) + { + MUS_LOG1( "mus: [AIWPRO] -> CMusAiwProvider::InitializeMenuPaneL( %d )", + aIndex ) + + if( iResourceFileName == NULL ) + { + iResourceFileName = MusResourceFinderUtil::ResourcePathL( + KMusAiwProviderResource ); + } + TFileName filename ( *iResourceFileName ); + MUS_LOG_TDESC( "mus: [AIWPRO] Resource filename: ", filename ) + + // If app running but hidden from fast swap it means that application + // is hidden from user and options menu should look same as + // when application is not yet started + if( ApplicationRunningL() && !HiddenFromFastSwapL() ) + { + MUS_LOG( "mus: [AIWPRO] Application already running:\ + giving _continue sharing_ menu command" ) + // Application is already started. Add resources to menu items. + aMenuPane.AddMenuItemsL( filename, + R_MUSAIWPROVIDER_RUNNING_CASCADED_SUBMENU, + KMusAiwProviderUid, + aIndex ); + + } + else + { + // check for variant + if ( MultimediaSharingSettings::OperatorVariantSettingL() + == MusSettingsKeys::EOperatorSpecific ) + { + OperatorVariantStartUpL( filename, aMenuPane, aIndex ); + } + else if ( IsFastStartupModeL() ) + { + FastModeStartUpL( filename, aMenuPane, aIndex ); + } + else + { + NoVariationStartUpL( filename, aMenuPane, aIndex ); + } + } + + + MUS_LOG( "mus: [AIWPRO] <- CMusAiwProvider::InitializeMenuPaneL" ) + } + +// ----------------------------------------------------------------------------- +// +// +// ----------------------------------------------------------------------------- +// +void CMusAiwProvider::DoInitialiseL() + { + MUS_LOG( "mus: [AIWPRO] -> CMusAiwProvider::DoInitialiseL") + + if ( !iIndicator ) + { + MUS_LOG( "mus: [AIWPRO] : creating indicator") + iIndicator = CMusIndicatorApi::NewL(); + } + MUS_LOG( "mus: [AIWPRO] <- CMusAiwProvider::DoInitialiseL") + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMusAiwProvider::ApplicationRunningL() + { + MUS_LOG( "mus: [AIWPRO] -> CMusAiwProvider::ApplicationRunningL" ) + RWsSession wsSession; + User::LeaveIfError( wsSession.Connect() ); + CleanupClosePushL( wsSession ); + TApaTaskList taskList( wsSession ); + TUid appUid; + appUid.iUid = KMusUiUid; + TApaTask task = taskList.FindApp( appUid ); + TBool running = task.Exists(); + CleanupStack::PopAndDestroy( &wsSession ); + MUS_LOG( "mus: [AIWPRO] <- CMusAiwProvider::ApplicationRunningL" ) + return running; + } +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusAiwProvider::NoVariationStartUpL( TFileName& aFileName, + CAiwMenuPane& aMenuPane, + TInt aIndex ) + { + MUS_LOG( "mus: [AIWPRO] -> CMusAiwProvider::NoVariationStartUpL" ) + CMusManager* manager = CMusManager::NewLC(); + iAvailability = manager->AvailabilityL(); + + /* Multimediasharing Menu items should be shown in call menu when + 1.SIP Registration is still ongoing or it has failed for some reason. + 2.Regardless of Options execution ( All options are just informative. + Cant be considered as Error situation.) + 3.When iAvailability plugin says OK ( Based on call,network,settingui item) + 4.Also in confrence and hold cases + */ + if ( AvailabilityOk( iAvailability ) ) + { + MUS_LOG1( "mus: [AIWPRO] Showing AIW Menu -> iAvailability = %d ", + iAvailability ) + TInt resourceID = R_MUSAIWPROVIDER_BASIC_CASCADED_SUBMENU ; + if ( !FeatureManager::FeatureSupported( KFeatureIdCamera ) ) + { + MUS_LOG( "mus: [AIWPRO] Camera Not Available" ) + resourceID = R_MUSAIWPROVIDER_NOCAMERA_CASCADED_SUBMENU ; + } + aMenuPane.AddMenuItemsL( aFileName, + resourceID, + KMusAiwProviderUid, + aIndex ); + } + else + { + MUS_LOG1( "mus: [AIWPRO] Not Showing AIW Menu -> iAvailability = %d ", + iAvailability ) + } + CleanupStack::PopAndDestroy( manager ); + MUS_LOG( "mus: [AIWPRO] <- CMusAiwProvider::NoVariationStartUpL" ) + } +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusAiwProvider::OperatorVariantStartUpL( TFileName& aFileName, + CAiwMenuPane& aMenuPane, + TInt aIndex ) + { + MUS_LOG( "mus: [AIWPRO] -> CMusAiwProvider::OperatorVariantStartUpL" ) + + CMusManager* manager = CMusManager::NewLC(); + iAvailability = manager->AvailabilityL(); + + // In operator specific mode Multimediasharing Menu items + // should be shown in call menu only if iAvailability plugin returns OK + if ( iAvailability == MultimediaSharing::EMultimediaSharingAvailable ) + { + MUS_LOG1( "mus: [AIWPRO] Showing AIW Menu -> iAvailability = %d ", + iAvailability ) + TInt resourceID = R_MUSAIWPROVIDER_BASIC_CASCADED_SUBMENU ; + if ( !FeatureManager::FeatureSupported( KFeatureIdCamera ) ) + { + MUS_LOG( "mus: [AIWPRO] Camera Not Available" ) + resourceID = R_MUSAIWPROVIDER_NOCAMERA_CASCADED_SUBMENU ; + } + aMenuPane.AddMenuItemsL( aFileName, + resourceID, + KMusAiwProviderUid, + aIndex ); + } + else + { + MUS_LOG1( "mus: [AIWPRO] Not Showing AIW Menu -> iAvailability = %d ", + iAvailability ) + } + + CleanupStack::PopAndDestroy( manager ); + + MUS_LOG( "mus: [AIWPRO] <- CMusAiwProvider::OperatorVariantStartUpL" ) + } + +// ----------------------------------------------------------------------------- +// In fast mode, Multimediasharing Menu items +// should not be shown before options queries have completed. Outcome +// of queries does not matter. +// ----------------------------------------------------------------------------- +// +void CMusAiwProvider::FastModeStartUpL( + TFileName& aFileName, CAiwMenuPane& aMenuPane, TInt aIndex ) + { + MUS_LOG( "mus: [AIWPRO] -> CMusAiwProvider::FastModeStartUpL" ) + + if ( MultimediaSharingSettings::CapabilityQuerySettingL() != + MusSettingsKeys::EParallel ) + { + // If parallel capability query is not enabled, use normal startup as + // capability query is essential for fast session setup + NoVariationStartUpL( aFileName, aMenuPane, aIndex ); + } + else + { + CMusManager* manager = CMusManager::NewLC(); + iAvailability = manager->AvailabilityL(); + + if ( iAvailability == MultimediaSharing::ESipRegistrationPending || + iAvailability == MultimediaSharing::ESipOptionsSent || + !AvailabilityOk( iAvailability ) ) + { + // Need to wait for options to complete + MUS_LOG1( "mus: [AIWPRO] Not Showing AIW Menu -> iAvailability = %d ", + iAvailability ) + } + else + { + // It does not matter what was result of query + MUS_LOG1( "mus: [AIWPRO] Showing AIW Menu -> iAvailability = %d ", + iAvailability ) + TInt resourceID = R_MUSAIWPROVIDER_BASIC_CASCADED_SUBMENU ; + if ( !FeatureManager::FeatureSupported( KFeatureIdCamera ) ) + { + MUS_LOG( "mus: [AIWPRO] Camera Not Available" ) + resourceID = R_MUSAIWPROVIDER_NOCAMERA_CASCADED_SUBMENU ; + } + aMenuPane.AddMenuItemsL( aFileName, + resourceID, + KMusAiwProviderUid, + aIndex ); + } + + CleanupStack::PopAndDestroy( manager ); + } + + MUS_LOG( "mus: [AIWPRO] <- CMusAiwProvider::FastModeStartUpL" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +HBufC* CMusAiwProvider::ErrorNoteTextLC( TInt aError ) + { + MUS_LOG1( "mus: [AIWPRO] -> CMusAiwProvider::ErrorNoteTextLC( %d )", + aError ) + + TFileName filename( *iResourceFileName ); + RFs fs; + User::LeaveIfError( fs.Connect() ); + CleanupClosePushL( fs ); + + RResourceFile resourceFile; + resourceFile.OpenL( fs, filename ); + CleanupClosePushL( resourceFile ); + + // Fetch error text + HBufC8* dlgPrompt8 = ErrorNoteText8L( aError, resourceFile ); + CleanupStack::PushL( dlgPrompt8 ); + const TUint8* ptr8 = dlgPrompt8->Des().Ptr(); + TPtrC ptr16( ( TUint16* ) ptr8, dlgPrompt8->Length()/2 ); + HBufC* dlgPrompt = ptr16.AllocL(); + + // CnvUtfConverter::ConvertToUnicodeFromUtf8L( *dlgPrompt8 ); + CleanupStack::PopAndDestroy( dlgPrompt8 ); + + CleanupStack::PopAndDestroy( &resourceFile ); + CleanupStack::PopAndDestroy( &fs ); + CleanupStack::PushL( dlgPrompt ); + + MUS_LOG( "mus: [AIWPRO] <- CMusAiwProvider::ErrorNoteTextLC" ) + return dlgPrompt; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +HBufC8* CMusAiwProvider::ErrorNoteText8L( TInt aError, + RResourceFile& aResourceFile ) + { + MUS_LOG1( "mus: [AIWPRO] -> CMusAiwProvider::ErrorNoteTextL( %d )", + aError ) + + HBufC8* errorText = NULL; + + switch( aError ) + { + case MultimediaSharing::EErrCallOnHold: + { + errorText = aResourceFile.AllocReadL( R_MUSAIWPROVIDER_ON_HOLD ); + iIsWarning = ETrue ; + break; + } + case MultimediaSharing::EErrNetwork: + { + errorText = aResourceFile.AllocReadL( + R_MUSAIWPROVIDER_NETWORK_INCOMPATIBLE ); + iIsWarning = ETrue ; + break; + } + case MultimediaSharing::EErrConferenceCall: + { + errorText = aResourceFile.AllocReadL( + R_MUSAIWPROVIDER_CONFERENCE_CALL ); + iIsWarning = ETrue ; + break; + } + case MultimediaSharing::ESipOptionsNotCapable: + { + errorText = aResourceFile.AllocReadL( + R_MUSAIWPROVIDER_RECIPIENT_INCAPABLE ); + iIsWarning = ETrue ; + break; + } + case MultimediaSharing::EErrSipRegistration: + { + errorText = aResourceFile.AllocReadL( R_MUSAIWPROVIDER_NO_REG ); + iIsWarning = ETrue ; + break; + } + case MultimediaSharing::EErrConnection: + { + errorText = aResourceFile.AllocReadL( R_MUSAIWPROVIDER_NO_REG ); + iIsWarning = ETrue ; + break; + } + default: + { + errorText = aResourceFile.AllocReadL( R_MUSAIWPROVIDER_APP_GENERAL ); + iIsWarning = EFalse ; + break; + } + } + + MUS_LOG( "mus: [AIWPRO] <- CMusAiwProvider::ErrorNoteTextL" ) + return errorText; + } + + +// ----------------------------------------------------------------------------- +// Handles a service command invoked by the Handler. +// ----------------------------------------------------------------------------- +// +void CMusAiwProvider::HandleServiceCmdL( + const TInt& aCmdId, + const CAiwGenericParamList& aInParamList, + CAiwGenericParamList& aOutParamList, + TUint aCmdOptions, + const MAiwNotifyCallback* aCallback ) + { + HandleMenuCmdL( aCmdId, + aInParamList, + aOutParamList, + aCmdOptions, + aCallback ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusAiwProvider::ShowErrorNoteL( TInt aError ) + { + MUS_LOG1( "mus: [AIWPRO] -> CMusAiwProvider::ShowErrorNote( %d )", + aError ) + HBufC* dlgPrompt = ErrorNoteTextLC( aError ); + MUS_LOG_TDESC( "mus: [AIWPRO] Error : ", ( *dlgPrompt ) ) + CAknGlobalNote* note = CAknGlobalNote::NewLC(); + TRequestStatus status; + if( iIsWarning ) + { + note->ShowNoteL( status,EAknGlobalInformationNote,*dlgPrompt ); + } + else + { + note->ShowNoteL( status,EAknGlobalErrorNote,*dlgPrompt ); + } + User::WaitForRequest( status ); + CleanupStack::PopAndDestroy( note ); + CleanupStack::PopAndDestroy( dlgPrompt ); + MUS_LOG( "mus: [AIWPRO] <- CMusAiwProvider::ShowErrorNote" ) + } + + +// ----------------------------------------------------------------------------- +// Handles a menu command invoked by the Handler. +// ----------------------------------------------------------------------------- +// +void CMusAiwProvider::HandleMenuCmdL( + TInt aMenuCmdId, + const CAiwGenericParamList& /*aInParamList*/, + CAiwGenericParamList& /*aOutParamList*/, + TUint /*aCmdOptions*/, + const MAiwNotifyCallback* /*aCallback*/ ) + { + MUS_LOG( "mus: [AIWPRO] -> CMusAiwProvider::HandleMenuCmdL" ) + + TInt error( KErrNone ); + + CMusManager* manager = CMusManager::NewLC(); + + if ( iAvailability == MultimediaSharing::EManualActivation ) + { + MUS_LOG( "mus: [AIWPRO] Manual activation" ) + TRAP( error, manager->HandleCommandL( MultimediaSharing::ECommandManualActivation )); + iAvailability = manager->AvailabilityL(); + } + + switch ( aMenuCmdId ) + { + case EMusCommandLiveShare: + { + MUS_LOG( "mus: [AIWPRO] \ + EMusCommandLiveShare: Will now attempt to start Mus." ) + TRAP( error, StartApplicationL( *manager, MultimediaSharing::EMusLiveVideo ) ); + break; + } + case EMusCommandClipShare: + { + MUS_LOG( "mus: [AIWPRO] \ + EMusCommandClipShare: Will now attempt to start Mus." ) + TRAP( error, StartApplicationL( *manager, MultimediaSharing::EMusClipVideo ) ); + + break; + } + case EMusCommandImageShare: + { + MUS_LOG( "mus: [AIWPRO] \ + EMusCommandImageShare: Will now attempt to start Mus." ) + TRAP( error, StartApplicationL( *manager, MultimediaSharing::EMusStillImage ) ); + break; + } + case EMusCommandContinue: + { + MUS_LOG( "mus: [AIWPRO] \ + EMusCommandContinue: Will now attempt to start/continue Mus." ) + TRAP( error, StartApplicationL( *manager, MultimediaSharing::EMusContinue ) ); + break; + } + default: + { + MUS_LOG( "mus: [AIWPRO] \ + Unknown command. Leave with KErrArgument" ) + User::Leave( KErrArgument ); + break; + } + } + + CleanupStack::PopAndDestroy( manager ); + + if( error != KErrNone ) + { + ShowErrorNoteL( error ); + } + + MUS_LOG( "mus: [AIWPRO] <- CMusAiwProvider::HandleMenuCmdL" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMusAiwProvider::AvailabilityOk( + MultimediaSharing::TMusAvailabilityStatus aAvailability ) const + { + return ( + aAvailability == MultimediaSharing::ESipRegistrationPending || + aAvailability == MultimediaSharing::ESipOptionsSent || + aAvailability == MultimediaSharing::EMultimediaSharingAvailable || + aAvailability == MultimediaSharing::EErrCallOnHold || + aAvailability == MultimediaSharing::EErrConferenceCall || + aAvailability == MultimediaSharing::ESipOptionsNotCapable || + aAvailability == MultimediaSharing::ESipOptionsNotSent || + aAvailability == MultimediaSharing::EErrNetwork || + aAvailability == MultimediaSharing::EManualActivation || + aAvailability == MultimediaSharing::EErrConnection || + aAvailability == MultimediaSharing::EErrSipRegistration ); + } + +// ----------------------------------------------------------------------------- +// App's fastswap visibility status is interesting only in fast mode. +// ----------------------------------------------------------------------------- +// +TBool CMusAiwProvider::HiddenFromFastSwapL() + { + MUS_LOG( "mus: [AIWPRO] -> CMusAiwProvider::HiddenFromFastSwapL" ) + + TBool hidden( EFalse ); + if ( !IsFastStartupModeL() ) + { + MUS_LOG( "mus: [AIWPRO] <- CMusAiwProvider::HiddenFromFastSwapL" ) + return hidden; + } + + const TInt KMusAiwMaxHiddenAppSizeMod = 4; + TBuf16 hiddenList; + TInt err = RProperty::Get( KPSUidUikon, KUikAppHiddenList, hiddenList ); + MUS_LOG1( "mus: [AIWPRO] Hidden list read:%d", err ) + + if ( err == KErrNone ) + { + TBool continueFinding( ETrue ); + MUS_LOG1( "mus: [AIWPRO] Hidden list len:%d", hiddenList.Length() ) + for ( TInt i = 0; i < KMaxHiddenApps && continueFinding; i++ ) + { + // 32-bit uid values are retrieved in two 16-bit parts + __ASSERT_ALWAYS( hiddenList.Length() > i + 1, User::Leave( KErrEof ) ); + TUint32 listValue = hiddenList[ i ] << 16; + listValue += hiddenList[ ++i ]; + // the value NULL marks the end of array -> leave the loop + if ( listValue ) + { + MUS_LOG1( "mus: [AIWPRO] Hidden uid:%d", listValue ) + if ( listValue == KMusUiUid ) + { + hidden = ETrue; + continueFinding = EFalse; + } + } + else + { + // Zero value means ending of list + continueFinding = EFalse; + } + } + } + + MUS_LOG1( "mus: [AIWPRO] <- CMusAiwProvider::HiddenFromFastSwapL:%d", hidden ) + + return hidden; + } + +// ----------------------------------------------------------------------------- +// Check whether fast mode is enabled, take in count that key +// might not be present. +// ----------------------------------------------------------------------------- +// +TBool CMusAiwProvider::IsFastStartupModeL() + { + TBool fastModeEnabled( EFalse ); + MusSettingsKeys::TFastMode fastMode( MusSettingsKeys::EFastModeOff ); + TRAPD( err, fastMode = MultimediaSharingSettings::FastStartupModeL() ); + if ( err == KErrNoMemory ) + { + User::Leave( err ); + } + if ( err == KErrNone ) + { + fastModeEnabled = ( fastMode == MusSettingsKeys::EFastModeOn ); + } + return fastModeEnabled; + } + +// ----------------------------------------------------------------------------- +// If fast mode is enabled and app is running and hidden, it has been started +// with live use-case but user does not know that. If user tries to do +// clip usecase in such situation, use case is just updated and engine +// takes case of bringing hidden application to foreground. +// ----------------------------------------------------------------------------- +// +void CMusAiwProvider::StartApplicationL( + CMusManager& aManager, MultimediaSharing::TMusUseCase aUseCase ) + { + MUS_LOG( "mus: [AIWPRO] -> CMusAiwProvider::StartApplicationL" ) + + TBool startApp( ETrue ); + if ( IsFastStartupModeL() && aUseCase == MultimediaSharing::EMusClipVideo && + ApplicationRunningL() && HiddenFromFastSwapL() ) + { + MUS_LOG( "mus: [AIWPRO] App already running hidden, change only usecase!" ) + User::LeaveIfError( RProperty::Set( + NMusSessionApi::KCategoryUid, NMusSessionApi::KUseCase, aUseCase ) ); + startApp = EFalse; + } + + if ( startApp ) + { + aManager.StartApplicationL( aUseCase ); + } + + MUS_LOG( "mus: [AIWPRO] <- CMusAiwProvider::StartApplicationL" ) + } + +// end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaiwplugin/src/musaiwprovidermain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaiwplugin/src/musaiwprovidermain.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,47 @@ +/* +* 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: Global functions. +* +*/ + + + +#include "musaiwprovider.h" +#include "musaiwprovider.hrh" + +#include +#include + + +/** + * Holds the implementation table. + */ +const TImplementationProxy KMusAiwProviderImplementationTable[] = + { +// disable PC-Lint warning for "suspicious typecast", caused by +// Symbian's ECom declarations, by "lint -e611" + IMPLEMENTATION_PROXY_ENTRY( KMusAiwProviderUid, //lint -e611 + CMusAiwProvider::NewL ) + }; + +/** + * Returns the implementation table and updates the aTableCount parameter + * to hold the number of elements in the table. + */ +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount ) + { + aTableCount = sizeof( KMusAiwProviderImplementationTable ) / + sizeof( TImplementationProxy ); + return KMusAiwProviderImplementationTable; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaiwplugin/tsrc/ut_aiwplugin/BMARM/ut_aopluginu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaiwplugin/tsrc/ut_aiwplugin/BMARM/ut_aopluginu.def Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,2 @@ +EXPORTS + CreateTestSuiteL__Fv @ 1 NONAME R3UNUSED ; CreateTestSuiteL(void) diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaiwplugin/tsrc/ut_aiwplugin/BWINS/ut_musaiwprovideru.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaiwplugin/tsrc/ut_aiwplugin/BWINS/ut_musaiwprovideru.def Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,33 @@ +EXPORTS + ?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 1 NONAME ; class MEUnitTest * CreateTestSuiteL(void) + ?CameraSupported@FeatureManager@@SAXXZ @ 2 NONAME ; void FeatureManager::CameraSupported(void) + ?NewL@CAknGlobalNote@@SAPAV1@XZ @ 3 NONAME ; class CAknGlobalNote * CAknGlobalNote::NewL(void) + ?KillTask@TApaTask@@QAEXXZ @ 4 NONAME ; void TApaTask::KillTask(void) + ?FindDoc@TApaTaskList@@QAE?AVTApaTask@@ABVTDesC16@@@Z @ 5 NONAME ; class TApaTask TApaTaskList::FindDoc(class TDesC16 const &) + ??0TApaTaskList@@QAE@AAVRWsSession@@@Z @ 6 NONAME ; TApaTaskList::TApaTaskList(class RWsSession &) + ?FindApp@TApaTaskList@@QAE?AVTApaTask@@VTUid@@@Z @ 7 NONAME ; class TApaTask TApaTaskList::FindApp(class TUid) + ?Close@RWsSession@@QAEXXZ @ 8 NONAME ; void RWsSession::Close(void) + ?OpenL@RResourceFile@@QAEXAAVRFs@@ABVTDesC16@@@Z @ 9 NONAME ; void RResourceFile::OpenL(class RFs &, class TDesC16 const &) + ??0RResourceFile@@QAE@XZ @ 10 NONAME ; RResourceFile::RResourceFile(void) + ?NewLC@CAknGlobalNote@@SAPAV1@XZ @ 11 NONAME ; class CAknGlobalNote * CAknGlobalNote::NewLC(void) + ?CancelNoteL@CAknGlobalNote@@QAEXH@Z @ 12 NONAME ; void CAknGlobalNote::CancelNoteL(int) + ?EndTask@TApaTask@@QAEXXZ @ 13 NONAME ; void TApaTask::EndTask(void) + ?CameraNotSupported@FeatureManager@@SAXXZ @ 14 NONAME ; void FeatureManager::CameraNotSupported(void) + ?BringToForeground@TApaTask@@QAEXXZ @ 15 NONAME ; void TApaTask::BringToForeground(void) + ?SendToBackground@TApaTask@@QAEXXZ @ 16 NONAME ; void TApaTask::SendToBackground(void) + ?Close@RResourceFile@@QAEXXZ @ 17 NONAME ; void RResourceFile::Close(void) + ?AllocReadL@RResourceFile@@QBEPAVHBufC8@@H@Z @ 18 NONAME ; class HBufC8 * RResourceFile::AllocReadL(int) const + ?Exists@TApaTask@@QAEHXZ @ 19 NONAME ; int TApaTask::Exists(void) + ??0TApaTask@@QAE@AAVRWsSession@@@Z @ 20 NONAME ; TApaTask::TApaTask(class RWsSession &) + ?FeatureSupported@FeatureManager@@SAHH@Z @ 21 NONAME ; int FeatureManager::FeatureSupported(int) + ?ShowNoteL@CAknGlobalNote@@QAEHW4TAknGlobalNoteType@@ABVTDesC16@@@Z @ 22 NONAME ; int CAknGlobalNote::ShowNoteL(enum TAknGlobalNoteType, class TDesC16 const &) + ?Connect@RWsSession@@QAEHXZ @ 23 NONAME ; int RWsSession::Connect(void) + ?SetTextProcessing@CAknGlobalNote@@QAEXH@Z @ 24 NONAME ; void CAknGlobalNote::SetTextProcessing(int) + ??0MWsClientClass@@QAE@XZ @ 25 NONAME ; MWsClientClass::MWsClientClass(void) + ??0RWsSession@@QAE@XZ @ 26 NONAME ; RWsSession::RWsSession(void) + ?FindApp@TApaTaskList@@QAE?AVTApaTask@@ABVTDesC16@@@Z @ 27 NONAME ; class TApaTask TApaTaskList::FindApp(class TDesC16 const &) + ??1CAknGlobalNote@@UAE@XZ @ 28 NONAME ; CAknGlobalNote::~CAknGlobalNote(void) + ?FindByPos@TApaTaskList@@QAE?AVTApaTask@@H@Z @ 29 NONAME ; class TApaTask TApaTaskList::FindByPos(int) + ?ShowNoteL@CAknGlobalNote@@QAEHAAVTRequestStatus@@W4TAknGlobalNoteType@@ABVTDesC16@@@Z @ 30 NONAME ; int CAknGlobalNote::ShowNoteL(class TRequestStatus &, enum TAknGlobalNoteType, class TDesC16 const &) + ?ImplementationGroupProxy@@YAPBUTImplementationProxy@@AAH@Z @ 31 NONAME ; struct TImplementationProxy const * ImplementationGroupProxy(int &) + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaiwplugin/tsrc/ut_aiwplugin/EABI/ut_musaiwprovideru.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaiwplugin/tsrc/ut_aiwplugin/EABI/ut_musaiwprovideru.def Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,40 @@ +EXPORTS + _Z16CreateTestSuiteLv @ 1 NONAME + _Z24ImplementationGroupProxyRi @ 2 NONAME + _ZN10RWsSession5CloseEv @ 3 NONAME + _ZN10RWsSession7ConnectEv @ 4 NONAME + _ZN10RWsSessionC1Ev @ 5 NONAME + _ZN10RWsSessionC2Ev @ 6 NONAME + _ZN11CMusManager10SetUseCaseEN17MultimediaSharing11TMusUseCaseE @ 7 NONAME + _ZN11CMusManager13AvailabilityLEv @ 8 NONAME + _ZN11CMusManager13SetStartErrorEi @ 9 NONAME + _ZN11CMusManager14HandleCommandLEN17MultimediaSharing12TCommandTypeE @ 10 NONAME + _ZN11CMusManager15SetAvailabilityEi @ 11 NONAME + _ZN11CMusManager16CancelMonitoringEv @ 12 NONAME + _ZN11CMusManager16StopApplicationLEv @ 13 NONAME + _ZN11CMusManager17HandleSipRequestLENS_12TRequestTypeE @ 14 NONAME + _ZN11CMusManager17StartApplicationLEN17MultimediaSharing11TMusUseCaseE @ 15 NONAME + _ZN11CMusManager20ExamineAvailabilityLEv @ 16 NONAME + _ZN11CMusManager20MonitorAvailabilityLER14TRequestStatusRN17MultimediaSharing22TMusAvailabilityStatusE @ 17 NONAME + _ZN11CMusManager4NewLEv @ 18 NONAME + _ZN11CMusManager5NewLCEv @ 19 NONAME + _ZN11CMusManager7UseCaseEv @ 20 NONAME + _ZN13RResourceFile5CloseEv @ 21 NONAME + _ZN13RResourceFile5OpenLER3RFsRK7TDesC16 @ 22 NONAME + _ZN13RResourceFileC1Ev @ 23 NONAME + _ZN13RResourceFileC2Ev @ 24 NONAME + _ZN14FeatureManager15CameraSupportedEv @ 25 NONAME + _ZN14FeatureManager16FeatureSupportedEi @ 26 NONAME + _ZN14FeatureManager18CameraNotSupportedEv @ 27 NONAME + _ZN14MWsClientClassC1Ev @ 28 NONAME + _ZN14MWsClientClassC2Ev @ 29 NONAME + _ZNK13RResourceFile10AllocReadLEi @ 30 NONAME + _ZTI11CMusManager @ 31 NONAME ; ## + _ZTI15CMusAiwProvider @ 32 NONAME ; ## + _ZTI16CMusIndicatorApi @ 33 NONAME ; ## + _ZTI18UT_CMusAiwProvider @ 34 NONAME ; ## + _ZTV11CMusManager @ 35 NONAME ; ## + _ZTV15CMusAiwProvider @ 36 NONAME ; ## + _ZTV16CMusIndicatorApi @ 37 NONAME ; ## + _ZTV18UT_CMusAiwProvider @ 38 NONAME ; ## + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaiwplugin/tsrc/ut_aiwplugin/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaiwplugin/tsrc/ut_aiwplugin/group/bld.inf Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,20 @@ +/* +* 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: +* +*/ + +PRJ_MMPFILES +ut_musaiwprovider.mmp + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaiwplugin/tsrc/ut_aiwplugin/group/ut_musaiwprovider.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaiwplugin/tsrc/ut_aiwplugin/group/ut_musaiwprovider.mmp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,124 @@ +/* +* 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: +* +*/ + +// To get the APP_LAYER_SYSTEMINCLUDE-definition +#include +#include + +TARGET ut_musaiwprovider.dll +TARGETTYPE dll +EPOCALLOWDLLDATA +TARGETPATH /z/sys/bin +UID 0x1000af5a 0x01700a22 + +CAPABILITY EUNIT_CAPS +VENDORID VID_DEFAULT + +MACRO UNIT_TESTING + +SOURCEPATH ../../../data +RESOURCE musaiwprovider.rss + +// Stubs +SOURCEPATH ../src +//SOURCE musaiwresourcefinderstub.cpp +SOURCE musaiwproviderstubs.cpp + +SOURCEPATH ../../../../../tsrc/Apastub/src +SOURCE apgtask.cpp + +SOURCEPATH ../../../../../tsrc/resourcefilestub/src +SOURCE barsc.cpp + +SOURCEPATH ../../../../../tsrc/featmgrstub/src +SOURCE FeatMgr.cpp + +SOURCEPATH ../../../../../tsrc/propertystub/src +SOURCE e32property.cpp + +SOURCEPATH ../../../../../tsrc/musmanagerstub/src +SOURCE musmanagerstub.cpp +// Test classes +SOURCEPATH ../src +SOURCE ut_musaiwproviderdllmain.cpp +SOURCE ut_musaiwprovider.cpp + +// Tested classes +SOURCEPATH ../../../src +SOURCE musaiwprovidermain.cpp +SOURCE musaiwprovider.cpp + + +// Centrep Stub +SOURCEPATH ../../../../../tsrc/centralrepositorystub/src +SOURCE centralrepositorystub.cpp + + +// Stup User Includes +USERINCLUDE ../../../../../tsrc/resourcefilestub/inc +USERINCLUDE ../../../../../tsrc/propertystub/inc +USERINCLUDE ../../../../../tsrc/centralrepositorystub/inc + +// Actual User Includes +USERINCLUDE ../inc +USERINCLUDE ../../../inc + +// Test Includes. +USERINCLUDE ../../../../../tsrc/musmanagerstub/inc +USERINCLUDE ../../../../../tsrc/ututils/inc +USERINCLUDE ../../../../../inc +USERINCLUDE ../../../../../tsrc/Apastub/inc +USERINCLUDE ../../../../../tsrc/featmgrstub/inc + + + +// to replace FeatMgr.h with a stub +SYSTEMINCLUDE ../../../../../tsrc/featmgrstub/inc + +// to replace apgtask.h with a stub +SYSTEMINCLUDE ../../../../../tsrc/Apastub/inc + +// to replace barsc.h with a stub +SYSTEMINCLUDE ../../../../../tsrc/resourcefilestub/inc + +// to replace RProperty with a stub +SYSTEMINCLUDE ../../../../../tsrc/propertystub/inc + +// Centrep stub +SYSTEMINCLUDE ../../../../../tsrc/centralrepositorystub/inc + +// Default system include paths for application layer modules. +APP_LAYER_SYSTEMINCLUDE + + +LIBRARY euser.lib +LIBRARY aknnotify.lib +LIBRARY eiksrv.lib +LIBRARY bafl.lib +LIBRARY connmon.lib +LIBRARY ecom.lib +LIBRARY efsrv.lib +LIBRARY eikcoctl.lib +LIBRARY eikcore.lib +LIBRARY eunit.lib +LIBRARY charconv.lib +//LIBRARY centralrepository.lib +LIBRARY flogger.lib +LIBRARY servicehandler.lib // AIW Consumer API + + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaiwplugin/tsrc/ut_aiwplugin/inc/musaiwproviderstubs.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaiwplugin/tsrc/ut_aiwplugin/inc/musaiwproviderstubs.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,45 @@ +/* +* 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: +* +*/ + + +#ifndef MUSAIWPROVIDERSTUBS_H +#define MUSAIWPROVIDERSTUBS_H + + +#include + +class MusAiwResourceFinderStub + { +public: + /** + * Returns the file name of resource file from ROM. + * + * @return The resource filename, if in ROM. + */ + static const TDesC& ResourceFilenameRom(); + + /** + * Returns the file name of resource file from writable media. + * + * @return The resource filename, if in writable media. + */ + static const TDesC& ResourceFilenameRam(); + }; + + + +#endif // MUSAIWRESOURCEFINDER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaiwplugin/tsrc/ut_aiwplugin/inc/ut_musaiwprovider.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaiwplugin/tsrc/ut_aiwplugin/inc/ut_musaiwprovider.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,126 @@ +/* +* 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: Main plugin class +* +*/ + + +#ifndef MUSAIWPROVIDERTEST_H +#define MUSAIWPROVIDERTEST_H + + +#include +#include +#include + +class CMusAiwProvider; +class CAiwMenuPane; +class CEikMenuPane; + +/** + * Main plugin class + * + * @lib ut_musAiwProvider.dll + */ +class UT_CMusAiwProvider: public CEUnitTestSuiteClass, + public MEikMenuObserver, + public MAiwNotifyCallback + { + public: + + /** + * Symbian two-phase constructor. + * @return New UT_CMusAiwProvider instance + */ + static UT_CMusAiwProvider* NewL(); + + static UT_CMusAiwProvider* NewLC(); + + /** + * C++ destructor. + */ + ~UT_CMusAiwProvider(); + + + private: // constructors + + /** + * C++ constructor. + */ + UT_CMusAiwProvider(); + + /** + * Symbian second-phase constructor. + */ + void ConstructL(); + + + public: // Test case setup and teardown + + void SetupL(); + + void Teardown(); + + + public: // from MEikMenuObserver + + void SetEmphasis( CCoeControl* aMenuControl,TBool aEmphasis ); + + void ProcessCommandL( TInt aCommandId ); + + + public: // from MAiwNotifyCallback + + TInt HandleNotifyL( TInt aCmdId, + TInt aEventId, + CAiwGenericParamList& aEventParamList, + const CAiwGenericParamList& aInParamList); + + + public: // Tester functions + + void UT_CMusAiwProvider_InitialiseLL(); + void UT_CMusAiwProvider_HandleServiceCmdLL(); + void UT_CMusAiwProvider_InitializeMenuPaneLL(); + void UT_CMusAiwProvider_InitializeMenuPaneL2L(); + void UT_CMusAiwProvider_InitializeMenuPaneL3L(); + void UT_CMusAiwProvider_InitializeMenuPaneL4L(); + void UT_CMusAiwProvider_InitializeMenuPaneL5L(); + void UT_CMusAiwProvider_InitializeMenuPaneL6L(); + void UT_CMusAiwProvider_InitializeMenuPaneLFastModeL(); + void UT_CMusAiwProvider_InitializeMenuPaneLFastMode2L(); + + void UT_CMusAiwProvider_HandleMenuCmdLL(); + void UT_CMusAiwProvider_HandleMenuCmdLFastModeL(); + void UT_CMusAiwProvider_ApplicationRunningLL(); + void UT_CMusAiwProvider_ShowErrorNoteLL(); + void UT_CMusAiwProvider_ErrorNoteTextLCL(); + void UT_CMusAiwProvider_ErrorNoteText8LL(); + void UT_ImplementationGroupProxyL(); + void UT_HiddenFromFastSwapL(); + + + public: // Helpers + + CAiwMenuPane* CreateAiwMenuPaneLC( CEikMenuPane** aEikPane ); + + private: // data + + CMusAiwProvider* iProvider; + + EUNIT_DECLARE_TEST_TABLE; + + }; + +#endif // MUSAIWPROVIDERTEST_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaiwplugin/tsrc/ut_aiwplugin/inc/ut_musaiwresourcefinder.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaiwplugin/tsrc/ut_aiwplugin/inc/ut_musaiwresourcefinder.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,70 @@ +/* +* 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_MUSAIWRESOURCEFINDER_H__ +#define __UT_MUSAIWRESOURCEFINDER_H__ + +// EXTERNAL INCLUDES +#include + +// INTERNAL INCLUDES + + +// FORWARD DECLARATIONS + + +// CLASS DEFINITION + +NONSHARABLE_CLASS( UT_MusAiwResourceFinder ) + : public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static UT_MusAiwResourceFinder* NewL(); + static UT_MusAiwResourceFinder* NewLC(); + /** + * Destructor + */ + ~UT_MusAiwResourceFinder(); + + private: // Constructors and destructors + + UT_MusAiwResourceFinder(); + void ConstructL(); + + private: // Test case setup and teardown + + void SetupL(); + + void Teardown(); + + public: // Test cases + + void TestL(); + + private: // Data + + EUNIT_DECLARE_TEST_TABLE; + + }; + +#endif // __UT_MUSAIWRESOURCEFINDER_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaiwplugin/tsrc/ut_aiwplugin/src/musaiwproviderstubs.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaiwplugin/tsrc/ut_aiwplugin/src/musaiwproviderstubs.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,177 @@ +/* +* 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 "musresourcefinderutil.h" +#include +#include + +/* +HBufC* MusResourceFinderUtil::ResourcePathL( const TDesC& aFileName ) + { + return aFileName.AllocL(); + } +*/ + +const TUid uid = + { + 0x1234 + }; + + +CAknNotifyBase::CAknNotifyBase( TUid ) + { + + } + +void CAknNotifyBase::SetSecondaryDisplayData(CAknSDData* /*aData*/) + { + + } + +CAknNotifyBase::~CAknNotifyBase() + { + + } + + + +void CAknNotifyBase::ConstructL() + { + + } + +CAknGlobalNote::CAknGlobalNote() +: CAknNotifyBase( uid ) + { + + } + +/** +* Two-phased constructor. +* @return Pointer to new global note object. +*/ +CAknGlobalNote* CAknGlobalNote::NewL() + { + return new( ELeave ) CAknGlobalNote(); + } + +/** +* Two-phased constructor. +* @return Pointer to new global note object. +*/ +CAknGlobalNote* CAknGlobalNote::NewLC() + { + CAknGlobalNote* note = new( ELeave ) CAknGlobalNote(); + CleanupStack::PushL( note ); + return note; + } + +/** +* Destructor. +*/ +CAknGlobalNote::~CAknGlobalNote() + { + + } + +/** +* Enable or disable all text processing done by the dialog. +* This includes text wrapping, text truncation +* and reordering of bidirectional text. +* +* By default, it is enabled. +* +* If text processing is disabled, lines are broken only at explicit line +* end characters and they are not truncated, but drawn as long as they +* fit. Also, the dialog does not handle reordering of bidirectional text. +* +* @since Series 60 2.0 +* @param aEnabled Enable or disable all text processing. +*/ +void CAknGlobalNote::SetTextProcessing(TBool /*aEnabled*/) + { + + } + +/** +* Displays the global note. +* @param aType Note type. +* @param aNoteText Note text. +* @return Note ID. +*/ +TInt CAknGlobalNote::ShowNoteL( TAknGlobalNoteType /*aType*/, + const TDesC& /*aNoteText*/) + { + return KErrNone; + + } + +/** +* Displays the global note. +* @param aStatus Reference to request status. +* @param aType Note type. +* @param aNoteText Note text. +* @return Note ID. +*/ +TInt CAknGlobalNote::ShowNoteL(TRequestStatus& aStatus, + TAknGlobalNoteType /*aType*/, + const TDesC& /*aNoteText*/) + { + TRequestStatus* stat = &aStatus; + User::RequestComplete( stat, KErrNone ); + return KErrNone; + } + +/** +* Cancels the global note. +* @param aNoteId Note ID. +*/ +void CAknGlobalNote::CancelNoteL(TInt /*aNoteId*/) + { + + } + + +EXPORT_C MWsClientClass::MWsClientClass() + { + + } + +EXPORT_C RWsSession::RWsSession() + { + + } + +EXPORT_C TInt RWsSession::Connect() + { + return KErrNone; + } + + +EXPORT_C void RWsSession::Close() + { + + } + + + + + + + + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaiwplugin/tsrc/ut_aiwplugin/src/musaiwresourcefinderstub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaiwplugin/tsrc/ut_aiwplugin/src/musaiwresourcefinderstub.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,37 @@ +/* +* 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: The ECOM interface implementation. +* +*/ + + +#include "musaiwproviderstubs.h" + +// possible locations of compiled resource file + +_LIT( KMusAiwProviderResource1, "c:\\sys\\bin\\musaiwprovider2.rsc" ); +_LIT( KMusAiwProviderResource2, "c:\\sys\\bin\\musaiwprovider3.rsc" ); + +const TDesC& MusAiwResourceFinderStub::ResourceFilenameRom() + { + return KMusAiwProviderResource1(); + } + +const TDesC& MusAiwResourceFinderStub::ResourceFilenameRam() + { + return KMusAiwProviderResource2(); + } + + +// end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaiwplugin/tsrc/ut_aiwplugin/src/ut_musaiwprovider.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaiwplugin/tsrc/ut_aiwplugin/src/ut_musaiwprovider.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,1228 @@ +/* +* 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: +* +*/ + + +#include "ut_musaiwprovider.h" +#include "musaiwprovider.h" +#include "musaiwprovider.hrh" +#include "musmanagerstub.h" +#include "musmanagercommon.h" +#include "musindicatorapi.h" + +#include +#include "mussesseioninformationapi.h" +#include "mussettings.h" +#include "mustesthelp.h" +#include "mussessionproperties.h" +#define MUS_MEMORY_LEAVE_CHECKING_ON + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +// Next row is to disable warning emerging from EUnit code. +// Placement is due to a fact that most test case files +// include this file. Directive can be removed when +// EUnit is fixed. +#pragma warn_illtokenpasting off + +_LIT( KMusAiwProviderResource, "c:\\sys\\bin\\musaiwproviderui.rsc" ); +_LIT( KResourceFilenameRom,"z:\\sys\\bin\\musaiwproviderui.rsc" ); + +_LIT( KMusOnHold, "On hold" ); + +_LIT8( KMusOnHold8, "On hold" ); +_LIT8( KMusNetworkIncompatible8, "Network incompatible" ); +_LIT8( KMusConferenceCall8, "Conference call" ); +_LIT8( KMusRecipientIncapable8, "Recipient incapable" ); +_LIT8( KMusNoReg8, "No registration" ); +_LIT8( KMusGeneral, "Application error" ); + + +CMusIndicatorApi* CMusIndicatorApi::NewL() + { + CMusIndicatorApi* self = new (ELeave) CMusIndicatorApi( NULL ); + return self; + + } + + + +CMusIndicatorApi::CMusIndicatorApi( MMusIndicatorObserver* aObserver ) + : CActive( EPriorityStandard ), + iObserver( aObserver ) + { + } + +void CMusIndicatorApi::DoCancel() + { + } + + +TInt CMusIndicatorApi::RunError( TInt aError ) + { + return aError; + } + +void CMusIndicatorApi::RunL() + { + } + + +void CMusIndicatorApi::PlaySoundComplete( TInt /*aError*/ ) + { + } + +CMusIndicatorApi::~CMusIndicatorApi() + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusAiwProvider* UT_CMusAiwProvider::NewL() + { + UT_CMusAiwProvider* self = UT_CMusAiwProvider::NewLC(); + CleanupStack::Pop( self ); + return self; + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusAiwProvider* UT_CMusAiwProvider::NewLC() + { + UT_CMusAiwProvider* self = new (ELeave) UT_CMusAiwProvider(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusAiwProvider::~UT_CMusAiwProvider() + { + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusAiwProvider::UT_CMusAiwProvider() + { + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusAiwProvider::ConstructL() + { + CEUnitTestSuiteClass::ConstructL(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusAiwProvider::SetupL() + { + iProvider = CMusAiwProvider::NewL(); + CMusManager::SetUseCase( MultimediaSharing::EMusContinue ); + CMusManager::SetStartError( KErrNone ); + CMusManager::SetAvailability( KErrNone ); + MultimediaSharingSettings::SetPropertyValueL( + MusSettingsKeys::KFastStartupMode, MusSettingsKeys::EFastModeOff ); + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusAiwProvider::Teardown( ) + { + delete iProvider; + PropertyHelper::Close(); + } + + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusAiwProvider::SetEmphasis( CCoeControl* /*aMenuControl*/, + TBool /*aEmphasis*/ ) + { + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusAiwProvider::ProcessCommandL( TInt /*aCommandId*/ ) + { + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TInt UT_CMusAiwProvider::HandleNotifyL( + TInt /*aCmdId*/, + TInt /*aEventId*/, + CAiwGenericParamList& /*aEventParamList*/, + const CAiwGenericParamList& /*aInParamList*/) + { + return KErrNone; + } + + + +// ------- Tester functions ---------------------------------------------------- + +/* +RFs fs; + User::LeaveIfError( fs.Connect() ); + + CleanupClosePushL( fs ); + + BaflUtils::CopyFile( fs, KMusAiwProviderResource(), MusAiwResourceFinder::ResourceFilenameRom() ); + BaflUtils::CopyFile( fs, KMusAiwProviderResource(), MusAiwResourceFinder::ResourceFilenameRam() ); + + BaflUtils::DeleteFile( fs, MusAiwResourceFinder::ResourceFilenameRom() ); + + BaflUtils::DeleteFile( fs, MusAiwResourceFinder::ResourceFilenameRam() ); + + CleanupStack::PopAndDestroy(); // fs +*/ + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +void UT_CMusAiwProvider::UT_CMusAiwProvider_InitialiseLL() + { + // No implementation, so dummy test is enough + RCriteriaArray array; + iProvider->InitialiseL( *this, array ); + iProvider->DoInitialiseL(); + + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusAiwProvider::UT_CMusAiwProvider_HandleServiceCmdLL() + { + // HandleServiceCmdL just forwards request to HandleMenuCmdL + + CAiwGenericParamList* pl = CAiwGenericParamList::NewLC(); + + EUNIT_ASSERT( CMusManager::UseCase() == MultimediaSharing::EMusContinue ) + + iProvider->HandleServiceCmdL( EMusCommandLiveShare, *pl, *pl, 0, this ); + EUNIT_ASSERT( CMusManager::UseCase() == MultimediaSharing::EMusLiveVideo ) + + CleanupStack::PopAndDestroy( pl ); + + CMusManager::SetUseCase( MultimediaSharing::EMusContinue ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusAiwProvider::UT_CMusAiwProvider_InitializeMenuPaneLL() + { + RFs fs; + User::LeaveIfError( fs.Connect() ); + CleanupClosePushL( fs ); + + BaflUtils::CopyFile( fs, KMusAiwProviderResource(), + KResourceFilenameRom() ); + + CAiwGenericParamList* list = CAiwGenericParamList::NewLC(); + + CEikMenuPane* eikPane = NULL; + CAiwMenuPane* aiwPane = CreateAiwMenuPaneLC( &eikPane ); + + // ResourceFile is empty + delete iProvider->iResourceFileName; + + iProvider->iResourceFileName = NULL ; + + iProvider->InitializeMenuPaneL( *aiwPane, 0, 0, *list ); + EUNIT_ASSERT( iProvider->iResourceFileName != NULL ) + // Menu item counter + TInt menuPaneCount = eikPane->NumberOfItemsInPane(); + + // test "forbidden" feature: mus NOT allowed, operator variant set to operator + MultimediaSharingSettings::SetOperatorVariantSettingL( + MusSettingsKeys::EOperatorSpecific ); + RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMUSForbidden, + NMusSessionInformationApi::EMUSForbidden ); + EUNIT_ASSERT( eikPane->NumberOfItemsInPane() == menuPaneCount ) + + // set operator back to standard and allow mus + RProperty::Set( NMusSessionInformationApi::KCategoryUid , + NMusSessionInformationApi::KMUSForbidden , + NMusSessionInformationApi::EMUSAllowed ); + MultimediaSharingSettings::SetOperatorVariantSettingL( + MusSettingsKeys::EStandard ); + + //Some Negative Cases + CMusManager::SetAvailability( MultimediaSharing::EErrNoSipProfile ); + menuPaneCount = eikPane->NumberOfItemsInPane(); + iProvider->InitializeMenuPaneL( *aiwPane, 0, 0, *list ); + + EUNIT_ASSERT( eikPane->NumberOfItemsInPane() == menuPaneCount ) + EUNIT_ASSERT( iProvider->iResourceFileName != NULL ) + + CMusManager::SetAvailability( MultimediaSharing::EErrActivation ); + menuPaneCount = eikPane->NumberOfItemsInPane(); + iProvider->InitializeMenuPaneL( *aiwPane, 0, 0, *list ); + + EUNIT_ASSERT( eikPane->NumberOfItemsInPane() == menuPaneCount ) + EUNIT_ASSERT( iProvider->iResourceFileName != NULL ) + + CMusManager::SetAvailability( ( MultimediaSharing::TMusAvailabilityStatus ) KErrNone ); + menuPaneCount = eikPane->NumberOfItemsInPane(); + iProvider->InitializeMenuPaneL( *aiwPane, 0, 0, *list ); + + EUNIT_ASSERT( eikPane->NumberOfItemsInPane() == menuPaneCount ) + EUNIT_ASSERT( iProvider->iResourceFileName != NULL ) + + // Cases for "camera supported"! + FeatureManager::CameraSupported(); + // Set it live,clip Menu showing + + CMusManager::SetAvailability( MultimediaSharing::ESipRegistrationPending ); + menuPaneCount = eikPane->NumberOfItemsInPane(); + iProvider->InitializeMenuPaneL( *aiwPane, 0, 0, *list ); + + //EUNIT_ASSERT( eikPane->NumberOfItemsInPane() == menuPaneCount + 3 ) + MUS_CHECK_MEMORY_LEAVE( eikPane->NumberOfItemsInPane() == menuPaneCount + 3 ) + + CMusManager::SetAvailability( MultimediaSharing::EErrConferenceCall ); + menuPaneCount = eikPane->NumberOfItemsInPane(); + iProvider->InitializeMenuPaneL( *aiwPane, 0, 0, *list ); + + //EUNIT_ASSERT( eikPane->NumberOfItemsInPane() == menuPaneCount + 3 ) + MUS_CHECK_MEMORY_LEAVE( eikPane->NumberOfItemsInPane() == menuPaneCount + 3 ) + + // set camera support on + FeatureManager::CameraSupported(); + CleanupStack::PopAndDestroy( aiwPane ); + CleanupStack::PopAndDestroy( list ); + BaflUtils::DeleteFile( fs, KResourceFilenameRom() ); + + CleanupStack::PopAndDestroy(); // + } + +void UT_CMusAiwProvider::UT_CMusAiwProvider_InitializeMenuPaneL2L() + { + RFs fs; + User::LeaveIfError( fs.Connect() ); + CleanupClosePushL( fs ); + + BaflUtils::CopyFile( fs, KMusAiwProviderResource(), + KResourceFilenameRom() ); + + CAiwGenericParamList* list = CAiwGenericParamList::NewLC(); + + CEikMenuPane* eikPane = NULL; + CAiwMenuPane* aiwPane = CreateAiwMenuPaneLC( &eikPane ); + + // ResourceFile is empty + delete iProvider->iResourceFileName; + + iProvider->iResourceFileName = NULL ; + + iProvider->InitializeMenuPaneL( *aiwPane, 0, 0, *list ); + EUNIT_ASSERT( iProvider->iResourceFileName != NULL ) + + // Menu item counter + TInt menuPaneCount = eikPane->NumberOfItemsInPane(); + + // test "forbidden" feature: mus NOT allowed, operator variant set to operator + MultimediaSharingSettings::SetOperatorVariantSettingL( + MusSettingsKeys::EOperatorSpecific ); + RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMUSForbidden, + NMusSessionInformationApi::EMUSForbidden ); + EUNIT_ASSERT( eikPane->NumberOfItemsInPane() == menuPaneCount ) + + // set operator back to standard and allow mus + RProperty::Set( NMusSessionInformationApi::KCategoryUid , + NMusSessionInformationApi::KMUSForbidden , + NMusSessionInformationApi::EMUSAllowed ); + MultimediaSharingSettings::SetOperatorVariantSettingL( + MusSettingsKeys::EStandard ); + + + CMusManager::SetAvailability( MultimediaSharing::EErrCallOnHold ); + menuPaneCount = eikPane->NumberOfItemsInPane(); + iProvider->InitializeMenuPaneL( *aiwPane, 0, 0, *list ); + + //EUNIT_ASSERT( eikPane->NumberOfItemsInPane() == menuPaneCount + 3 ) + MUS_CHECK_MEMORY_LEAVE( eikPane->NumberOfItemsInPane() == menuPaneCount + 3 ) + + // set camera support on + FeatureManager::CameraSupported(); + CleanupStack::PopAndDestroy( aiwPane ); + CleanupStack::PopAndDestroy( list ); + BaflUtils::DeleteFile( fs, KResourceFilenameRom() ); + + CleanupStack::PopAndDestroy(); // fs + + } + + +void UT_CMusAiwProvider::UT_CMusAiwProvider_InitializeMenuPaneL3L() + { + RFs fs; + User::LeaveIfError( fs.Connect() ); + CleanupClosePushL( fs ); + + BaflUtils::CopyFile( fs, KMusAiwProviderResource(), + KResourceFilenameRom() ); + + CAiwGenericParamList* list = CAiwGenericParamList::NewLC(); + + CEikMenuPane* eikPane = NULL; + CAiwMenuPane* aiwPane = CreateAiwMenuPaneLC( &eikPane ); + + // ResourceFile is empty + delete iProvider->iResourceFileName; + + iProvider->iResourceFileName = NULL ; + iProvider->InitializeMenuPaneL( *aiwPane, 0, 0, *list ); + EUNIT_ASSERT( iProvider->iResourceFileName != NULL ) + // Menu item counter + TInt menuPaneCount = eikPane->NumberOfItemsInPane(); + + // test "forbidden" feature: mus NOT allowed, operator variant set to operator + MultimediaSharingSettings::SetOperatorVariantSettingL( + MusSettingsKeys::EOperatorSpecific ); + RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMUSForbidden, + NMusSessionInformationApi::EMUSForbidden ); + EUNIT_ASSERT( eikPane->NumberOfItemsInPane() == menuPaneCount ) + + // set operator back to standard and allow mus + RProperty::Set( NMusSessionInformationApi::KCategoryUid , + NMusSessionInformationApi::KMUSForbidden , + NMusSessionInformationApi::EMUSAllowed ); + MultimediaSharingSettings::SetOperatorVariantSettingL( + MusSettingsKeys::EStandard ); + + + CMusManager::SetAvailability(MultimediaSharing::ESipOptionsSent); + menuPaneCount = eikPane->NumberOfItemsInPane(); + iProvider->InitializeMenuPaneL( *aiwPane, 0, 0, *list ); + + //EUNIT_ASSERT( eikPane->NumberOfItemsInPane() == menuPaneCount + 3 ) + MUS_CHECK_MEMORY_LEAVE( eikPane->NumberOfItemsInPane() == menuPaneCount + 3 ) + + // set camera support on + FeatureManager::CameraSupported(); + CleanupStack::PopAndDestroy( aiwPane ); + CleanupStack::PopAndDestroy( list ); + BaflUtils::DeleteFile( fs, KResourceFilenameRom() ); + + CleanupStack::PopAndDestroy(); // fs + + } + + +void UT_CMusAiwProvider::UT_CMusAiwProvider_InitializeMenuPaneL4L() + { + RFs fs; + User::LeaveIfError( fs.Connect() ); + CleanupClosePushL( fs ); + + BaflUtils::CopyFile( fs, KMusAiwProviderResource(), + KResourceFilenameRom() ); + + CAiwGenericParamList* list = CAiwGenericParamList::NewLC(); + + CEikMenuPane* eikPane = NULL; + CAiwMenuPane* aiwPane = CreateAiwMenuPaneLC( &eikPane ); + + // ResourceFile is empty + delete iProvider->iResourceFileName; + + iProvider->iResourceFileName = NULL ; + iProvider->InitializeMenuPaneL( *aiwPane, 0, 0, *list ); + EUNIT_ASSERT( iProvider->iResourceFileName != NULL ) + + // Menu item counter + TInt menuPaneCount = eikPane->NumberOfItemsInPane(); + + // test "forbidden" feature: mus NOT allowed, operator variant set to operator + MultimediaSharingSettings::SetOperatorVariantSettingL( + MusSettingsKeys::EOperatorSpecific ); + RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMUSForbidden, + NMusSessionInformationApi::EMUSForbidden ); + EUNIT_ASSERT( eikPane->NumberOfItemsInPane() == menuPaneCount ) + + // set operator back to standard and allow mus + RProperty::Set( NMusSessionInformationApi::KCategoryUid , + NMusSessionInformationApi::KMUSForbidden , + NMusSessionInformationApi::EMUSAllowed ); + MultimediaSharingSettings::SetOperatorVariantSettingL( + MusSettingsKeys::EStandard ); + + + CMusManager::SetAvailability(MultimediaSharing::ESipOptionsNotSent); + menuPaneCount = eikPane->NumberOfItemsInPane(); + iProvider->InitializeMenuPaneL( *aiwPane, 0, 0, *list ); + + //EUNIT_ASSERT( eikPane->NumberOfItemsInPane() == menuPaneCount + 3 ) + MUS_CHECK_MEMORY_LEAVE( eikPane->NumberOfItemsInPane() == menuPaneCount + 3 ) + + // set camera support on + FeatureManager::CameraSupported(); + CleanupStack::PopAndDestroy( aiwPane ); + CleanupStack::PopAndDestroy( list ); + BaflUtils::DeleteFile( fs, KResourceFilenameRom() ); + + CleanupStack::PopAndDestroy(); // fs + + } + +void UT_CMusAiwProvider::UT_CMusAiwProvider_InitializeMenuPaneL5L() + { + RFs fs; + User::LeaveIfError( fs.Connect() ); + CleanupClosePushL( fs ); + + BaflUtils::CopyFile( fs, KMusAiwProviderResource(), + KResourceFilenameRom() ); + + CAiwGenericParamList* list = CAiwGenericParamList::NewLC(); + + CEikMenuPane* eikPane = NULL; + CAiwMenuPane* aiwPane = CreateAiwMenuPaneLC( &eikPane ); + + // ResourceFile is empty + delete iProvider->iResourceFileName; + + iProvider->iResourceFileName = NULL ; + iProvider->InitializeMenuPaneL( *aiwPane, 0, 0, *list ); + EUNIT_ASSERT( iProvider->iResourceFileName != NULL ) + // Menu item counter + TInt menuPaneCount = eikPane->NumberOfItemsInPane(); + + // test "forbidden" feature: mus NOT allowed, operator variant set to operator + MultimediaSharingSettings::SetOperatorVariantSettingL( + MusSettingsKeys::EOperatorSpecific ); + RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMUSForbidden, + NMusSessionInformationApi::EMUSForbidden ); + EUNIT_ASSERT( eikPane->NumberOfItemsInPane() == menuPaneCount ) + + // set operator back to standard and allow mus + RProperty::Set( NMusSessionInformationApi::KCategoryUid , + NMusSessionInformationApi::KMUSForbidden , + NMusSessionInformationApi::EMUSAllowed ); + MultimediaSharingSettings::SetOperatorVariantSettingL( + MusSettingsKeys::EStandard ); + + + CMusManager::SetAvailability(MultimediaSharing::EMultimediaSharingAvailable); + menuPaneCount = eikPane->NumberOfItemsInPane(); + iProvider->InitializeMenuPaneL( *aiwPane, 0, 0, *list ); + //EUNIT_ASSERT( eikPane->NumberOfItemsInPane() == menuPaneCount + 3 ) + + MUS_CHECK_MEMORY_LEAVE( eikPane->NumberOfItemsInPane() == menuPaneCount + 3 ) + + + + + // set camera support on + FeatureManager::CameraSupported(); + CleanupStack::PopAndDestroy( aiwPane ); + CleanupStack::PopAndDestroy( list ); + BaflUtils::DeleteFile( fs, KResourceFilenameRom() ); + + CleanupStack::PopAndDestroy(); // fs + + } + +void UT_CMusAiwProvider::UT_CMusAiwProvider_InitializeMenuPaneL6L() + { + RFs fs; + User::LeaveIfError( fs.Connect() ); + CleanupClosePushL( fs ); + + BaflUtils::CopyFile( fs, KMusAiwProviderResource(), + KResourceFilenameRom() ); + + CAiwGenericParamList* list = CAiwGenericParamList::NewLC(); + + CEikMenuPane* eikPane = NULL; + CAiwMenuPane* aiwPane = CreateAiwMenuPaneLC( &eikPane ); + + // ResourceFile is empty + delete iProvider->iResourceFileName; + + iProvider->iResourceFileName = NULL ; + iProvider->InitializeMenuPaneL( *aiwPane, 0, 0, *list ); + EUNIT_ASSERT( iProvider->iResourceFileName != NULL ) + // Menu item counter + TInt menuPaneCount = eikPane->NumberOfItemsInPane(); + + // test "forbidden" feature: mus NOT allowed, operator variant set to operator + MultimediaSharingSettings::SetOperatorVariantSettingL( + MusSettingsKeys::EOperatorSpecific ); + RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMUSForbidden, + NMusSessionInformationApi::EMUSForbidden ); + EUNIT_ASSERT( eikPane->NumberOfItemsInPane() == menuPaneCount ) + + // set operator back to standard and allow mus + RProperty::Set( NMusSessionInformationApi::KCategoryUid , + NMusSessionInformationApi::KMUSForbidden , + NMusSessionInformationApi::EMUSAllowed ); + MultimediaSharingSettings::SetOperatorVariantSettingL( + MusSettingsKeys::EStandard ); + + // Cases for "camera not supported"! + FeatureManager::CameraNotSupported(); + CMusManager::SetAvailability(MultimediaSharing::EMultimediaSharingAvailable); + menuPaneCount = eikPane->NumberOfItemsInPane(); + iProvider->InitializeMenuPaneL( *aiwPane, 0, 0, *list ); + + + //EUNIT_ASSERT( eikPane->NumberOfItemsInPane() == menuPaneCount + 1 ) + MUS_CHECK_MEMORY_LEAVE( eikPane->NumberOfItemsInPane() == menuPaneCount + 1 ) + + // set camera support on + FeatureManager::CameraSupported(); + CleanupStack::PopAndDestroy( aiwPane ); + CleanupStack::PopAndDestroy( list ); + BaflUtils::DeleteFile( fs, KResourceFilenameRom() ); + + CleanupStack::PopAndDestroy(); // fs + + } + +void UT_CMusAiwProvider::UT_CMusAiwProvider_InitializeMenuPaneLFastModeL() + { + RFs fs; + User::LeaveIfError( fs.Connect() ); + CleanupClosePushL( fs ); + + BaflUtils::CopyFile( fs, KMusAiwProviderResource(), + KResourceFilenameRom() ); + + CAiwGenericParamList* list = CAiwGenericParamList::NewLC(); + + CEikMenuPane* eikPane = NULL; + CAiwMenuPane* aiwPane = CreateAiwMenuPaneLC( &eikPane ); + + // ResourceFile is empty + delete iProvider->iResourceFileName; + + iProvider->iResourceFileName = NULL ; + iProvider->InitializeMenuPaneL( *aiwPane, 0, 0, *list ); + EUNIT_ASSERT( iProvider->iResourceFileName != NULL ) + // Menu item counter + TInt menuPaneCount = eikPane->NumberOfItemsInPane(); + + // set operator back to standard and allow mus + RProperty::Set( NMusSessionInformationApi::KCategoryUid , + NMusSessionInformationApi::KMUSForbidden , + NMusSessionInformationApi::EMUSAllowed ); + MultimediaSharingSettings::SetOperatorVariantSettingL( + MusSettingsKeys::EStandard ); + MultimediaSharingSettings::SetPropertyValueL( + MusSettingsKeys::KFastStartupMode, MusSettingsKeys::EFastModeOn ); + + // Options not enabled, mus shown in menu + // + MultimediaSharingSettings::SetCapabilityQuerySettingL( + MusSettingsKeys::ENoOptions ); + CMusManager::SetAvailability(MultimediaSharing::EMultimediaSharingAvailable); + menuPaneCount = eikPane->NumberOfItemsInPane(); + iProvider->InitializeMenuPaneL( *aiwPane, 0, 0, *list ); + + MUS_CHECK_MEMORY_LEAVE( eikPane->NumberOfItemsInPane() == menuPaneCount + 3 ) + + // Options supported, not yet available, mus not shown in menu + // + MultimediaSharingSettings::SetCapabilityQuerySettingL( + MusSettingsKeys::EParallel ); + CMusManager::SetAvailability(MultimediaSharing::ESipOptionsSent); + menuPaneCount = eikPane->NumberOfItemsInPane(); + iProvider->InitializeMenuPaneL( *aiwPane, 0, 0, *list ); + + MUS_CHECK_MEMORY_LEAVE( eikPane->NumberOfItemsInPane() == menuPaneCount ) + + CleanupStack::PopAndDestroy( aiwPane ); + CleanupStack::PopAndDestroy( list ); + BaflUtils::DeleteFile( fs, KResourceFilenameRom() ); + + CleanupStack::PopAndDestroy(); // fs + + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusAiwProvider::UT_CMusAiwProvider_InitializeMenuPaneLFastMode2L() + { + RFs fs; + User::LeaveIfError( fs.Connect() ); + CleanupClosePushL( fs ); + + BaflUtils::CopyFile( fs, KMusAiwProviderResource(), + KResourceFilenameRom() ); + + CAiwGenericParamList* list = CAiwGenericParamList::NewLC(); + + CEikMenuPane* eikPane = NULL; + CAiwMenuPane* aiwPane = CreateAiwMenuPaneLC( &eikPane ); + + // ResourceFile is empty + delete iProvider->iResourceFileName; + + iProvider->iResourceFileName = NULL ; + iProvider->InitializeMenuPaneL( *aiwPane, 0, 0, *list ); + EUNIT_ASSERT( iProvider->iResourceFileName != NULL ) + + // Options supported, available, mus shown in menu + // + MultimediaSharingSettings::SetPropertyValueL( + MusSettingsKeys::KFastStartupMode, MusSettingsKeys::EFastModeOn ); + + MultimediaSharingSettings::SetCapabilityQuerySettingL( + MusSettingsKeys::EParallel ); + + CMusManager::SetAvailability(MultimediaSharing::EMultimediaSharingAvailable); + TInt menuPaneCount = eikPane->NumberOfItemsInPane(); + iProvider->InitializeMenuPaneL( *aiwPane, 0, 0, *list ); + + MUS_CHECK_MEMORY_LEAVE( eikPane->NumberOfItemsInPane() == menuPaneCount + 3 ) + + CleanupStack::PopAndDestroy( aiwPane ); + CleanupStack::PopAndDestroy( list ); + BaflUtils::DeleteFile( fs, KResourceFilenameRom() ); + + CleanupStack::PopAndDestroy(); // fs + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusAiwProvider::UT_CMusAiwProvider_HandleMenuCmdLL() + { + CAiwGenericParamList* pl = CAiwGenericParamList::NewLC(); + + EUNIT_ASSERT( CMusManager::UseCase() == MultimediaSharing::EMusContinue ) + + iProvider->HandleMenuCmdL( EMusCommandLiveShare, *pl, *pl, 0, this ); + EUNIT_ASSERT( CMusManager::UseCase() == MultimediaSharing::EMusLiveVideo ) + + iProvider->HandleMenuCmdL( EMusCommandClipShare, *pl, *pl, 0, this ); + MUS_CHECK_MEMORY_LEAVE( CMusManager::UseCase() == MultimediaSharing::EMusClipVideo ) + EUNIT_ASSERT( CMusManager::UseCase() == MultimediaSharing::EMusClipVideo ) + + iProvider->HandleMenuCmdL( EMusCommandImageShare, *pl, *pl, 0, this ); + MUS_CHECK_MEMORY_LEAVE( CMusManager::UseCase() == MultimediaSharing::EMusStillImage ) + EUNIT_ASSERT( CMusManager::UseCase() == MultimediaSharing::EMusStillImage ) + + iProvider->HandleMenuCmdL( EMusCommandContinue, *pl, *pl, 0, this ); + MUS_CHECK_MEMORY_LEAVE( CMusManager::UseCase() == MultimediaSharing::EMusContinue ) + EUNIT_ASSERT( CMusManager::UseCase() == MultimediaSharing::EMusContinue ) + + CMusManager::SetStartError( + ( MultimediaSharing::TMusAvailabilityStatus ) KErrNotFound ); + + iProvider->HandleMenuCmdL( EMusCommandLiveShare, *pl, *pl, 0, this ); + EUNIT_ASSERT( CMusManager::UseCase() == MultimediaSharing::EMusContinue ) + + iProvider->HandleMenuCmdL( EMusCommandClipShare, *pl, *pl, 0, this ); + EUNIT_ASSERT( CMusManager::UseCase() == MultimediaSharing::EMusContinue ) + + iProvider->HandleMenuCmdL( EMusCommandImageShare, *pl, *pl, 0, this ); + EUNIT_ASSERT( CMusManager::UseCase() == MultimediaSharing::EMusContinue ) + + iProvider->HandleMenuCmdL( EMusCommandContinue, *pl, *pl, 0, this ); + EUNIT_ASSERT( CMusManager::UseCase() == MultimediaSharing::EMusContinue ) + + // revert it back to original state + CMusManager::SetStartError( + ( MultimediaSharing::TMusAvailabilityStatus ) KErrNone ); + + // Try with unknown command, should leave + + TRAPD( error, iProvider->HandleMenuCmdL( 500, *pl, *pl, 0, this ) ); + if ( error == KErrNoMemory ) + { + User::Leave( error ); + } + EUNIT_ASSERT( error == KErrArgument ) + EUNIT_ASSERT( CMusManager::UseCase() == MultimediaSharing::EMusContinue ) + + CleanupStack::PopAndDestroy( pl ); + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusAiwProvider::UT_CMusAiwProvider_HandleMenuCmdLFastModeL() + { + CAiwGenericParamList* pl = CAiwGenericParamList::NewLC(); + + MultimediaSharingSettings::SetPropertyValueL( + MusSettingsKeys::KFastStartupMode, MusSettingsKeys::EFastModeOn ); + + // Fast mode, start live sharing (handle normally) + CMusManager::SetUseCase( MultimediaSharing::EMusContinue ); + iProvider->HandleMenuCmdL( EMusCommandLiveShare, *pl, *pl, 0, this ); + MUS_CHECK_MEMORY_LEAVE( CMusManager::UseCase() == MultimediaSharing::EMusLiveVideo ) + EUNIT_ASSERT( CMusManager::UseCase() == MultimediaSharing::EMusLiveVideo ) + + // Fast mode, start clip sharing, app not running nor hidden (handle normally) + CMusManager::SetUseCase( MultimediaSharing::EMusContinue ); + iProvider->HandleMenuCmdL( EMusCommandClipShare, *pl, *pl, 0, this ); + MUS_CHECK_MEMORY_LEAVE( CMusManager::UseCase() == MultimediaSharing::EMusClipVideo ) + EUNIT_ASSERT( CMusManager::UseCase() == MultimediaSharing::EMusClipVideo ) + + // Fast mode, start clip sharing, app running and hidden (mus mgr is not + // used for starting application, only usecase P&S value is changed) + CMusManager::SetUseCase( MultimediaSharing::EMusContinue ); + + TApaTask::iApplicationExist = ETrue; + + TBuf16< 10 > listOkMus; + TUint16 upperBits = KMusUiUid >> 16; + listOkMus.Append( upperBits ); + listOkMus.Append( KMusUiUid ); + listOkMus.Append( 0 ); + listOkMus.Append( 0 ); + RProperty::Set( KPSUidUikon, KUikAppHiddenList, listOkMus ); + + RProperty::Set( NMusSessionApi::KCategoryUid, NMusSessionApi::KUseCase, MultimediaSharing::EMusContinue ); + + iProvider->HandleMenuCmdL( EMusCommandClipShare, *pl, *pl, 0, this ); + EUNIT_ASSERT( CMusManager::UseCase() == MultimediaSharing::EMusContinue ) + + TInt usecaseAfterFakeStart( 0 ); + RProperty::Get( NMusSessionApi::KCategoryUid, NMusSessionApi::KUseCase, usecaseAfterFakeStart ); + EUNIT_ASSERT( usecaseAfterFakeStart == MultimediaSharing::EMusClipVideo ); + + CleanupStack::PopAndDestroy( pl ); + + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusAiwProvider::UT_CMusAiwProvider_ApplicationRunningLL() + { + TApaTask::iApplicationExist = EFalse; + EUNIT_ASSERT( !iProvider->ApplicationRunningL() ) + + // Use stub to mimic the existence of application + TApaTask::iApplicationExist = ETrue; + + EUNIT_ASSERT( iProvider->ApplicationRunningL() ) + + // Revert back to old state + TApaTask::iApplicationExist = EFalse; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusAiwProvider::UT_CMusAiwProvider_ShowErrorNoteLL() + { + // Dummy test is enough ShowErrorNoteL does not contain any branches, + // does not return anything and does not have any side effects that could + // be asserted + iProvider->iIsWarning = ETrue ; + iProvider->ShowErrorNoteL( MultimediaSharing::EErrCallOnHold ); + iProvider->iIsWarning = EFalse ; + iProvider->ShowErrorNoteL( MultimediaSharing::EErrCallOnHold ); + + //Error Case + iProvider->ShowErrorNoteL( -1 ); // 100 should not be available + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusAiwProvider::UT_CMusAiwProvider_ErrorNoteTextLCL() + { + HBufC* errorNote = NULL; + + // It is enough to test with whatever error code since handling is same + // for all. + errorNote = iProvider->ErrorNoteTextLC( MultimediaSharing::EErrCallOnHold ); + + // NULL TEST, old way not support this comparistaion. + // Maybe to hard byte compare needed! + //EUNIT_ASSERT( *errorNote == KMusOnHold() ) + + CleanupStack::PopAndDestroy( errorNote ); + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusAiwProvider::UT_CMusAiwProvider_ErrorNoteText8LL() + { + RFs fs; + User::LeaveIfError( fs.Connect() ); + CleanupClosePushL( fs ); + + RResourceFile resourceFile; + resourceFile.OpenL( fs, KMusAiwProviderResource() ); + CleanupClosePushL( resourceFile ); + + HBufC8* errorNote = NULL; + + errorNote = iProvider->ErrorNoteText8L( MultimediaSharing::EErrCallOnHold, + resourceFile ); + CleanupStack::PushL( errorNote ); + EUNIT_ASSERT( *errorNote == KMusOnHold8() ) + CleanupStack::PopAndDestroy( errorNote ); + + + errorNote = iProvider->ErrorNoteText8L( MultimediaSharing::EErrNetwork, + resourceFile ); + CleanupStack::PushL( errorNote ); + EUNIT_ASSERT( *errorNote == KMusNetworkIncompatible8() ) + CleanupStack::PopAndDestroy( errorNote ); + + + errorNote = iProvider->ErrorNoteText8L( + MultimediaSharing::EErrConferenceCall, + resourceFile ); + CleanupStack::PushL( errorNote ); + EUNIT_ASSERT( *errorNote == KMusConferenceCall8() ) + CleanupStack::PopAndDestroy( errorNote ); + + + errorNote = iProvider->ErrorNoteText8L( + MultimediaSharing::ESipOptionsNotCapable, + resourceFile ); + CleanupStack::PushL( errorNote ); + EUNIT_ASSERT( *errorNote == KMusRecipientIncapable8() ) + CleanupStack::PopAndDestroy( errorNote ); + + + errorNote = iProvider->ErrorNoteText8L( + MultimediaSharing::EErrSipRegistration, + resourceFile ); + CleanupStack::PushL( errorNote ); + EUNIT_ASSERT( *errorNote == KMusNoReg8() ) + CleanupStack::PopAndDestroy( errorNote ); + + + errorNote = iProvider->ErrorNoteText8L( + MultimediaSharing::EErrNoActiveCall, + resourceFile ); + CleanupStack::PushL( errorNote ); + EUNIT_ASSERT( *errorNote == KMusGeneral() ) + CleanupStack::PopAndDestroy( errorNote ); + + CleanupStack::PopAndDestroy(); // resourceFile + + CleanupStack::PopAndDestroy(); // fs + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusAiwProvider::UT_ImplementationGroupProxyL() + { + // Dummy test just to raise coverage + TInt tableCount; + ImplementationGroupProxy( tableCount ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusAiwProvider::UT_HiddenFromFastSwapL() + { + // Normal mode + MultimediaSharingSettings::SetPropertyValueL( + MusSettingsKeys::KFastStartupMode, MusSettingsKeys::EFastModeOff ); + EUNIT_ASSERT( !iProvider->HiddenFromFastSwapL() ) + + // Fast mode + // + MultimediaSharingSettings::SetPropertyValueL( + MusSettingsKeys::KFastStartupMode, MusSettingsKeys::EFastModeOn ); + + // Key not found + PropertyHelper::SetErrorCode( KErrNotFound ); + EUNIT_ASSERT( !iProvider->HiddenFromFastSwapL() ) + + // Malformed key value + PropertyHelper::SetErrorCode( KErrNone ); + TBuf16< 5 > listMalformed; + listMalformed.Copy( _L("05645") ); + RProperty::Set( KPSUidUikon, KUikAppHiddenList, listMalformed ); + MUS_EUNIT_ASSERT_SPECIFIC_LEAVE( iProvider->HiddenFromFastSwapL(), KErrEof ); + + // No musuid in value list + TBuf16< 6 > listOkNoMus; + TUint32 uid1 = 10002000; + TUint32 uid2 = 20003000; + // avkoncapserver publishes values in following manner + TUint16 upperBits = uid1 >> 16; + listOkNoMus.Append( upperBits ); + listOkNoMus.Append( uid1 ); + upperBits = uid2 >> 16; + listOkNoMus.Append( upperBits ); + listOkNoMus.Append( uid2 ); + listOkNoMus.Append( 0 ); + listOkNoMus.Append( 0 ); + RProperty::Set( KPSUidUikon, KUikAppHiddenList, listOkNoMus ); + EUNIT_ASSERT( !iProvider->HiddenFromFastSwapL() ) + + // Musuid in value list + TBuf16< 10 > listOkMus; + TUint32 uid3 = 30005000; + upperBits = uid1 >> 16; + listOkMus.Append( upperBits ); + listOkMus.Append( uid1 ); + upperBits = uid2 >> 16; + listOkMus.Append( upperBits ); + listOkMus.Append( uid2 ); + + upperBits = KMusUiUid >> 16; + listOkMus.Append( upperBits ); + listOkMus.Append( KMusUiUid ); + + upperBits = uid3 >> 16; + listOkMus.Append( upperBits ); + listOkMus.Append( uid3 ); + + listOkMus.Append( 0 ); + listOkMus.Append( 0 ); + RProperty::Set( KPSUidUikon, KUikAppHiddenList, listOkMus ); + EUNIT_ASSERT( iProvider->HiddenFromFastSwapL() ) + } + +// HELPERS + +CAiwMenuPane* UT_CMusAiwProvider::CreateAiwMenuPaneLC( CEikMenuPane** aEikPane ) + { + CEikMenuPane* eikPane = new( ELeave ) CEikMenuPane( this ); + CleanupStack::PushL( eikPane ); + + // Constructing eikPane is not compulsory for testing and leads to a memory + // leak. + //eikPane->ConstructL( NULL, this ); + + CAiwMenuPane* aiwPane = new( ELeave ) CAiwMenuPane( *eikPane, 0 ); //Takes ownership + CleanupStack::Pop( eikPane ); + CleanupStack::PushL( aiwPane ); + *aEikPane = eikPane; + return aiwPane; + } + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusAiwProvider, + "CMusAiwProvider", + "UT_CMusAiwProvider" ) + +EUNIT_TEST( + "InitialiseL - test", + "CMusAiwProvider", + "InitialiseL", + "FUNCTIONALITY", + SetupL, UT_CMusAiwProvider_InitialiseLL, Teardown) + +EUNIT_TEST( + "HandleServiceCmdL - test", + "CMusAiwProvider", + "HandleServiceCmdL", + "FUNCTIONALITY", + SetupL, UT_CMusAiwProvider_HandleServiceCmdLL, Teardown) + +EUNIT_TEST( + "InitializeMenuPaneL - test", + "CMusAiwProvider", + "InitializeMenuPaneL", + "FUNCTIONALITY", + SetupL, UT_CMusAiwProvider_InitializeMenuPaneLL, Teardown) + +EUNIT_TEST( + "InitializeMenuPaneL - test2", + "CMusAiwProvider", + "InitializeMenuPaneL", + "FUNCTIONALITY", + SetupL, UT_CMusAiwProvider_InitializeMenuPaneL2L, Teardown) + +EUNIT_TEST( + "InitializeMenuPaneL - test3", + "CMusAiwProvider", + "InitializeMenuPaneL", + "FUNCTIONALITY", + SetupL, UT_CMusAiwProvider_InitializeMenuPaneL3L, Teardown) +EUNIT_TEST( + "InitializeMenuPaneL - test4", + "CMusAiwProvider", + "InitializeMenuPaneL", + "FUNCTIONALITY", + SetupL, UT_CMusAiwProvider_InitializeMenuPaneL4L, Teardown) +EUNIT_TEST( + "InitializeMenuPaneL - test5", + "CMusAiwProvider", + "InitializeMenuPaneL", + "FUNCTIONALITY", + SetupL, UT_CMusAiwProvider_InitializeMenuPaneL5L, Teardown) +EUNIT_TEST( + "InitializeMenuPaneL - test6", + "CMusAiwProvider", + "InitializeMenuPaneL", + "FUNCTIONALITY", + SetupL, UT_CMusAiwProvider_InitializeMenuPaneL6L, Teardown) + +EUNIT_TEST( + "InitializeMenuPaneL - fast mode", + "CMusAiwProvider", + "InitializeMenuPaneL", + "FUNCTIONALITY", + SetupL, UT_CMusAiwProvider_InitializeMenuPaneLFastModeL, Teardown) + +EUNIT_TEST( + "InitializeMenuPaneL - fast mode 2", + "CMusAiwProvider", + "InitializeMenuPaneL", + "FUNCTIONALITY", + SetupL, UT_CMusAiwProvider_InitializeMenuPaneLFastMode2L, Teardown) + +EUNIT_TEST( + "HandleMenuCmdL - test", + "CMusAiwProvider", + "HandleMenuCmdL", + "FUNCTIONALITY", + SetupL, UT_CMusAiwProvider_HandleMenuCmdLL, Teardown) + +EUNIT_TEST( + "HandleMenuCmdL - fastmode test", + "CMusAiwProvider", + "HandleMenuCmdL", + "FUNCTIONALITY", + SetupL, UT_CMusAiwProvider_HandleMenuCmdLFastModeL, Teardown) + +EUNIT_TEST( + "ApplicationRunningL - test", + "CMusAiwProvider", + "ApplicationRunningL", + "FUNCTIONALITY", + SetupL, UT_CMusAiwProvider_ApplicationRunningLL, Teardown) + +EUNIT_TEST( + "ShowErrorNoteL - test", + "CMusAiwProvider", + "ShowErrorNoteL", + "FUNCTIONALITY", + SetupL, UT_CMusAiwProvider_ShowErrorNoteLL, Teardown) + +EUNIT_TEST( + "ErrorNoteTextLC - test", + "CMusAiwProvider", + "ErrorNoteTextLC", + "FUNCTIONALITY", + SetupL, UT_CMusAiwProvider_ErrorNoteTextLCL, Teardown) + +EUNIT_TEST( + "ErrorNoteText8L - test", + "CMusAiwProvider", + "ErrorNoteText8L", + "FUNCTIONALITY", + SetupL, UT_CMusAiwProvider_ErrorNoteText8LL, Teardown) + +EUNIT_TEST( + "ImplementationGroupProxy", + "CMusAiwProvider", + "ImplementationGroupProxy", + "FUNCTIONALITY", + SetupL, UT_ImplementationGroupProxyL, Teardown) + +EUNIT_TEST( + "HiddenFromFastSwapL", + "CMusAiwProvider", + "HiddenFromFastSwapL", + "FUNCTIONALITY", + SetupL, UT_HiddenFromFastSwapL, Teardown) + +EUNIT_END_TEST_TABLE + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaiwplugin/tsrc/ut_aiwplugin/src/ut_musaiwproviderdllmain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaiwplugin/tsrc/ut_aiwplugin/src/ut_musaiwproviderdllmain.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,53 @@ +/* +* 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: +* +*/ + + +// USER INCLUDES +#include "ut_musaiwprovider.h" +#include "ut_musaiwresourcefinder.h" + +// SYSTEM INCLUDES +#include + + +/** + * Test suite factory function. + */ +EXPORT_C MEUnitTest* CreateTestSuiteL() + { + CEUnitTestSuite* rootSuite = CEUnitTestSuite::NewLC(_L("Mush AIWProvider")); + + // this class is removed and this uses a function from common. + //rootSuite->AddL( UT_MusAiwResourceFinder::NewLC() ); + //CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusAiwProvider::NewLC() ); + CleanupStack::Pop(); + + CleanupStack::Pop( rootSuite ); + return rootSuite; + } + + + +// END OF FILE + + + + + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaiwplugin/tsrc/ut_aiwplugin/src/ut_musaiwresourcefinder.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaiwplugin/tsrc/ut_aiwplugin/src/ut_musaiwresourcefinder.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,138 @@ +/* +* 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: +* +*/ + + + +#include "ut_musaiwresourcefinder.h" +#include "musaiwresourcefinder.h" + +#include + +// Next row is to disable warning emerging from EUnit code. +// Placement is due to a fact that most test case files +// include this file. Directive can be removed when +// EUnit is fixed. +#pragma warn_illtokenpasting off + + +_LIT( KMusAiwProviderResourceRom, "z:\\resource\\musaiwproviderui.rsc" ); +_LIT( KMusAiwProviderResourceRam, "c:\\resource\\musaiwproviderui.rsc" ); + + +// -------------------------------------------------------------------------- +// +// -------------------------------------------------------------------------- +// +UT_MusAiwResourceFinder* UT_MusAiwResourceFinder::NewL() + { + UT_MusAiwResourceFinder* self = new( ELeave ) UT_MusAiwResourceFinder; + CleanupStack::Pop( self ); + return self; + + } + + +// -------------------------------------------------------------------------- +// +// -------------------------------------------------------------------------- +// +UT_MusAiwResourceFinder* UT_MusAiwResourceFinder::NewLC() + { + UT_MusAiwResourceFinder* self = new( ELeave ) UT_MusAiwResourceFinder; + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// -------------------------------------------------------------------------- +// +// -------------------------------------------------------------------------- +// +UT_MusAiwResourceFinder::~UT_MusAiwResourceFinder() + { + } + + +// -------------------------------------------------------------------------- +// +// -------------------------------------------------------------------------- +// +UT_MusAiwResourceFinder::UT_MusAiwResourceFinder() + { + } + + +// -------------------------------------------------------------------------- +// +// -------------------------------------------------------------------------- +// +void UT_MusAiwResourceFinder::ConstructL() + { + } + + +// -------------------------------------------------------------------------- +// +// -------------------------------------------------------------------------- +// +void UT_MusAiwResourceFinder::SetupL() + { + } + + +// -------------------------------------------------------------------------- +// +// -------------------------------------------------------------------------- +// +void UT_MusAiwResourceFinder::Teardown() + { + } + + +// --- Test cases -------------------------------------------------------------- + + +// -------------------------------------------------------------------------- +// +// -------------------------------------------------------------------------- +// +void UT_MusAiwResourceFinder::TestL() + { + EUNIT_ASSERT( MusAiwResourceFinder::ResourceFilenameRom() == + KMusAiwProviderResourceRom() ) + EUNIT_ASSERT( MusAiwResourceFinder::ResourceFilenameRam() == + KMusAiwProviderResourceRam() ) + } + + + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_MusAiwResourceFinder, + "MusAiwResourceFinder", + "UT_MusAiwResourceFinder" ) + +EUNIT_TEST( + "TestL", + "MusAiwResourceFinder", + "ResourceFilenameRam, ResourceFilenameRom ", + "FUNCTIONALITY", + SetupL, TestL, Teardown) + +EUNIT_END_TEST_TABLE \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/data/musaoplugin.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/data/musaoplugin.rss Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,49 @@ +/* +* 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: Registry file of MultimediaSharing AO Plug-in. +* +*/ + +#include +#include "../../../inc/musversionnumbers.h" + +RESOURCE REGISTRY_INFO theInfo + { + // musaoplugin.dll uid + dll_uid = 0x1028238B; + interfaces = + { + INTERFACE_INFO + { + // CEComInterface interface UID + interface_uid = 0x101F85EC; + implementations = + { + IMPLEMENTATION_INFO + { + // AlwaysOnlineManager implementation UID + implementation_uid = 0x1028238B; + version_no = KMusEcomVersionNumber; + display_name = "MultimediaSharing ECom Plugin for AlwaysOnline"; + default_data = "mus"; + // Note : opaque_data MUST have @ least a single byte of data + // in this instance it is an empty string. + opaque_data = " "; + } + // Place additional interface implementations here + }; + } + // Place additional interfaces here + }; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/group/bld.inf Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,25 @@ +/* +* 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: project specification +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_MMPFILES +musaoplugin.mmp diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/group/musaoplugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/group/musaoplugin.mmp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,67 @@ +/* +* Copyright (c) 2005-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 +* +*/ + + +#include + +TARGET musaoplugin.dll +TARGETTYPE PLUGIN +UID 0x10009d8d 0x1028238B +VENDORID VID_DEFAULT +CAPABILITY CAP_ECOM_PLUGIN +LANG SC + +START RESOURCE ../data/musaoplugin.rss +TARGET musaoplugin.rsc +END + +SOURCEPATH ../src +SOURCE musaopluginmain.cpp +SOURCE musaoplugin.cpp +// Enable the below line if Kodiak Ptt has to be monitered +// SOURCE muspttcallmonitor.cpp +SOURCE muspropertymonitor.cpp +SOURCE mustsypropertymonitor.cpp +SOURCE muscallmonitor.cpp +SOURCE muscallmonitorbase.cpp +SOURCE muscalleventmonitor.cpp +SOURCE muscallstatusmonitor.cpp +SOURCE muscallconferencemonitor.cpp +SOURCE muscallconferenceeventmonitor.cpp +SOURCE musvoipcallmonitor.cpp + + +USERINCLUDE ../inc +USERINCLUDE ../../../inc + +APP_LAYER_SYSTEMINCLUDE + +// Symbian OS / S60 libraries: +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY etel.lib +LIBRARY etelmm.lib +LIBRARY centralrepository.lib +LIBRARY telephonyservice.lib +LIBRARY serviceprovidersettings.lib +// MultimediaSharing libraries: +LIBRARY musmanagerclient.lib +LIBRARY featmgr.lib + +DEBUGLIBRARY flogger.lib + +PAGED diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/inc/mmuscallstateobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/inc/mmuscallstateobserver.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,39 @@ +/* +* 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 observer class to monitor MuSh call state change +* +*/ + + +#ifndef MMUSCALLSTATEOBSERVER_H_ +#define MMUSCALLSTATEOBSERVER_H_ + + +/** + * The observer class for call state monitor + */ + +class MMusCallStateObserver + { +public: + /** + * Notify Mush call state changed + */ + virtual void MusCallStateChanged() = 0; + }; + +#endif /*MMUSCALLSTATEOBSERVER_H_*/ + + +// End of File. diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/inc/mmusptteventobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/inc/mmusptteventobserver.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,57 @@ +/* +* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 observer class for monitoring kodiak ptt call. +* +*/ + + +#ifndef MMUSPTTEVENTOBSERVER_H +#define MMUSPTTEVENTOBSERVER_H + +#include + + +#ifdef UNIT_TESTING // if unit testing + + const TUint KCTsyKodiakPtt = 1234; + enum TPSCTsyKodiakPtt + { + EPSCTsyKodiakPttActive, + EPSCTsyKodiakPttNotActive + }; + +#endif + +/** +* @publishedAll +* @released +* +* The observer class for monitoring Kodiak Ptt call events. +*/ +class MMusPttEventObserver + { +public: + + /** + * An event related to kodiak ptt call + * @param aVal value of kodiak ptt call state. + **/ + #ifdef UNIT_TESTING // if unit testing + virtual void PttCallEventOccuredL(TPSCTsyKodiakPtt& aVal) = 0; + #endif + + }; + +#endif // MMUSPTTEVENTOBSERVER_H + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/inc/mmustsypropertyobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/inc/mmustsypropertyobserver.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,39 @@ +/* +* Copyright (c) 2005-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: The observer class for observer monitor call states change +* +*/ + + +#ifndef MMUSTSYPROPERTYOBSERVER_H_ +#define MMUSTSYPROPERTYOBSERVER_H_ + +#include + +/** + * The observer class for monitor RMobileCall state change + */ +class MMusTsyPropertyObserver + { +public: + /** + * Notify call state changed + * @param aVal The call status + * @param aCallName The name of the call + */ + virtual void NotifyCallStateChanged( NMusSessionInformationApi::TMusCallEvent aVal, TName& aCallName ) = 0; + }; + +#endif /*MMUSPROPERTYOBSERVER_H_*/ + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/inc/musaoplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/inc/musaoplugin.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,179 @@ +/* +* 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: Main plugin class +* +*/ + + +#ifndef MUSAOPLUGIN_H +#define MUSAOPLUGIN_H + + +#include +#include +#include +#include +#include +#include + +#include "musunittesting.h" +#include "mmuscallstateobserver.h" +#include "musmanager.h" + +// Enable the below line if Kodiak Ptt has to be monitered +//class CMusPttCallMonitor; +class CMusPropertyMonitor; +class CMusTsyPropertyMonitor; + +IMPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount ); + +/** + * Main plugin class + * + * @lib musaoplugin.dll + */ +class CMusAoPlugin : public CAlwaysOnlineEComInterface, + public MMusCallStateObserver + { +public: + + /** + * Two-phased constructor + * + * @since S60 v3.2 + * @return New CMusAoPlugin instance + */ + static CMusAoPlugin* NewL(); + + /** + * C++ destructor. + */ + virtual ~CMusAoPlugin(); + + +public: // new API + + /** + * Define start up resource properties + * + * @since S60 v3.2 + */ + void DefinePropertiesL(); + + /** + * Delete when AO end + * + * @since S60 v3.2 + */ + + void DeleteProperties(); + + +public: // from MMusCallStateObserver + + void MusCallStateChanged(); + + +private: // constructors + + /** + * C++ constructor. + */ + CMusAoPlugin(); + + /** + * Symbian second-phase constructor. + */ + void ConstructL(); + + /** + * Utility function to define and set keys. + */ + void DefinePropertyL(TInt aKey,RProperty::TType aType,TInt aVal); + + /** + * Utility function to define and set keys. + */ + void DefinePropertyL(TInt aKey,RProperty::TType aType,const TDesC& aVal); + + /** + * Utility function to delete keys. + */ + void DeleteProperty(TInt aKey); + + /** + * Starts Mus Manager Client.In turn it will start Mus Manager + * Server and Availability Plugin. + */ + void StartMusClientL(); + + /* + * Stops Mus Manager Client. + */ + void StopMusClient(); + + +public: // from base class CAlwaysOnlineEComInterface + + /** + * Commands from alwaysonlinemanager to plugin + * + * @since S60 v3.2 + * @param aCommand, command Id + * @param aParameters, parameter pack + * @return return value + */ + virtual TAny* HandleServerCommandL( TInt aCommand, + TDesC8* aParameters ); + +private: // data + + /** + * Instance of MusManager Client. Owned. + */ + CMusManager* iManager; + + + /* Property Monitor */ + CMusPropertyMonitor* iPropertyMonitor; + + /** + * Telephony Property Key monitor. + * Monitors the call connect/disconnect events. + */ + CMusTsyPropertyMonitor* iTsyPropertyMonitor; + + /* Ptt Call Monitor */ + // Enable the below line if Kodiak Ptt has to be monitered + // CMusPttCallMonitor* iPttCallMonitor; + + /** + * RTelServer handle + */ + RTelServer iServer; + + /** + * RMobilePhone handle + */ + RMobilePhone iPhone; + + /** + * Error status. + */ + TInt iError; + + MUS_UNITTEST( UT_CMusAoPlugin ) + }; + +#endif // MUSAOPLUGIN_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/inc/musaoplugin.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/inc/musaoplugin.hrh Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,28 @@ +/* +* 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: General resource definitions. +* +*/ + + +#ifndef MUSAOPLUGIN_HRH +#define MUSAOPLUGIN_HRH + +// The AO plugin's implementation UID. +#define KMusAoPluginImplUid 0x10203354 + +// Identifier for AO Plug-ins +#define KAoPluginInterfaceUid 0x101F85EC + +#endif // MUSAOPLUGIN_HRH diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/inc/muscallconferenceeventmonitor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/inc/muscallconferenceeventmonitor.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,131 @@ +/* +* 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: Monitor the status of the call. +* +*/ + + + +#ifndef MUSCALLCONFERENCEEVENTMONITOR_H +#define MUSCALLCONFERENCEEVENTMONITOR_H + +#include "musunittesting.h" +#include "mussesseioninformationapi.h" +#include +#include + +#include "muscallmonitor.h" + +/** + * Monitors the event of call and set the state to property. + * + * @lib musaoplugin.dll + */ +class CMusCallConferenceEventMonitor : public CActive + { + + public: + /** + * Two-phased constructor. Leaves on failure. + * aCall is not owned. + * @return CMusCallConferenceEventMonitor object. + */ + static CMusCallConferenceEventMonitor* NewL( + RMobilePhone& aPhone, RMobileLine& aLine, + RPointerArray& aCallMonitorArray); + + /** + * Destructor. + */ + ~CMusCallConferenceEventMonitor(); + + private: + + /** + * C++ constructor. + */ + CMusCallConferenceEventMonitor( + RMobileLine& aLine, + RPointerArray& aCallMonitorArray ); + + /** + * Symbian 2nd-phase constructor. + */ + void ConstructL(RMobilePhone& aPhone); + + /** + * Sets the multimediasharing propery key value + * if the value is same before then dont report it. + */ + void SetStateL(NMusSessionInformationApi::TMusCallEvent aVal); + + /** + * Add / Remove Call Monitors based on Mus criteria + */ + void MonitorCallL(); + + private: + + /** + * Handles an active object's request completion event. + */ + void RunL(); + + /** + * cancels of an outstanding request + */ + void DoCancel(); + + /* + * Handles a leave occurring in the request completion + * event handler RunL(). + * Always return KErrNone since it must handle this error + * if it comes to this place. + */ + TInt RunError( TInt aError ); + + + private: + + /** + * Reference of RMobileLine.Not Owned. + */ + + RMobileLine& iLine; + + /** + * Reference of RMobileConferenceCall. + */ + RMobileConferenceCall iConfCall; + + /** + * Conference Event. + */ + RMobileConferenceCall::TMobileConferenceEvent iConfEvent; + + /** + * Array of Call Monitors.Not Owned + */ + RPointerArray& iCallMonitorArray; + + /** + * Name of the call affected by this event + */ + TName iCallName; + + MUS_UNITTEST( UT_CMusCallConferenceEventMonitor ) + + }; + +#endif // MUSCALLCONFERENCEEVENTMONITOR_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/inc/muscallconferencemonitor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/inc/muscallconferencemonitor.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,147 @@ +/* +* 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: Monitor the status of the call. +* +*/ + + + +#ifndef MUSCALLCONFERENCEMONITOR_H +#define MUSCALLCONFERENCEMONITOR_H + +#include "musunittesting.h" +#include "mussesseioninformationapi.h" +#include "muscallmonitor.h" + +#include +#include + +class CMusCallConferenceEventMonitor; + +/** + * Monitors the event of call and set the state to property. + * + * @lib musaoplugin.dll + */ +class CMusCallConferenceMonitor : public CActive + { + + public: + /** + * Two-phased constructor. Leaves on failure. + * aCall is not owned. + * @return CMusCallConferenceMonitor object. + */ + static CMusCallConferenceMonitor* NewL( + RMobilePhone& aPhone, RMobileLine& aLine, + RPointerArray& aCallMonitorArray); + + /** + * Destructor. + */ + ~CMusCallConferenceMonitor(); + + /** + * Checks the Conference Status and + * sets the multimediasharing propery key value + */ + void SetStateL(); + + /** + * Get Conference Call Status + */ + + RMobileConferenceCall::TMobileConferenceStatus GetConfStatus(); + + private: + + /** + * C++ constructor. + */ + CMusCallConferenceMonitor( + RMobileLine& aLine, + RPointerArray& aCallMonitorArray ); + + /** + * Symbian 2nd-phase constructor. + */ + void ConstructL(RMobilePhone& aPhone); + + /** + * Sets the multimediasharing propery key value + * if the value is same before then dont report it. + */ + void SetStateL(NMusSessionInformationApi::TMusCallEvent aVal); + + /** + * Add / Remove Call Monitors based on Mus criteria + */ + void MonitorCallL(); + + private: + + /** + * Handles an active object's request completion event. + */ + void RunL(); + + /** + * cancels of an outstanding request + */ + void DoCancel(); + + /* + * Handles a leave occurring in the request completion + * event handler RunL(). + * Always return KErrNone since it must handle this error + * if it comes to this place. + */ + TInt RunError( TInt aError ); + + + private: + + /** + * Reference of RMobileLine.Not Owned. + */ + + RMobileLine& iLine; + + /** + * Reference of RMobileConferenceCall. + */ + RMobileConferenceCall iConfCall; + + /** + * Conference Event. + */ + RMobileConferenceCall::TMobileConferenceStatus iConfStatus; + + /** + * Array of Call Monitors.Not Owned + */ + RPointerArray& iCallMonitorArray; + + /** + * Monitors the conference call events. For example a particular call + * which is in conference dropped will be reported as part of + * conference event. + */ + CMusCallConferenceEventMonitor* iConfCallEvent; + + MUS_UNITTEST( UT_CMusCallConferenceMonitor ) + MUS_UNITTEST( UT_CMusTsyPropertyMonitor ) + }; + +#endif // MUSCALLCONFERENCEMONITOR_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/inc/muscalleventmonitor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/inc/muscalleventmonitor.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,89 @@ +/* +* 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: Monitor the event of a call +* +*/ + + + +#ifndef MUSCALLEVENTMONITOR_H +#define MUSCALLEVENTMONITOR_H + +#include "musunittesting.h" +#include "muscallmonitorbase.h" +#include "mmuscallstateobserver.h" + +#include +#include + +/** + * Monitors the event of call and set the state to property. + * + * @lib musaoplugin.dll + */ +class CMusCallEventMonitor : public CMusCallMonitorBase + { + + public: + /** + * Two-phased constructor. Leaves on failure. + * aCall is not owned. + * @return CMusCallEventMonitor object. + */ + static CMusCallEventMonitor* NewL(const RMobileCall& aCall, + MMusTsyPropertyObserver& aObserver, + MMusCallStateObserver& aCallStateObserver ); + + /** + * Destructor. + */ + ~CMusCallEventMonitor(); + + private: + + /** + * C++ constructor. + */ + CMusCallEventMonitor( const RMobileCall& aCall, MMusTsyPropertyObserver& aObserver, + MMusCallStateObserver& aCallStateObserver ); + + /** + * Symbian 2nd-phase constructor. + */ + void ConstructL(); + + private: + + /** + * Handles an active object's request completion event. + */ + void RunL(); + + /** + * cancels of an outstanding request. + */ + void DoCancel(); + + + private: + /** + * Mobile Call Events. + */ + RMobileCall::TMobileCallEvent iCallEvent; + + MUS_UNITTEST( UT_CMusCallEventMonitor ) + + }; + +#endif // MUSCALLMONITOR_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/inc/muscallmonitor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/inc/muscallmonitor.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,149 @@ +/* +* Copyright (c) 2005-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: Monitors the multimediasharing property. +* +*/ + + + +#ifndef MUSAOCALLMONITOR_H +#define MUSAOCALLMONITOR_H + +#include "musunittesting.h" +#include "mustsypropertymonitor.h" +#include "mmuscallstateobserver.h" +#include +#include + +class CMusCallConferenceMonitor; +class CMusCallStatusMonitor; +class CMusCallEventMonitor; + +/** + * Monitor, which observes status of current cs call + * + * @lib musaoplugin.dll + */ +class CMusCallMonitor : public CBase + { + + public: // constructors and destructor + + /** + * Two-phased constructor. Leaves on failure. + */ + static CMusCallMonitor* NewL( TName& aCallName,TBool aPttCallExist ); + + /** + * Destructor. + */ + ~CMusCallMonitor(); + + public: + + /** + * Starts to monitor call status,event and conference. + */ + void StartMonitorL( RMobileLine& aLine, MMusTsyPropertyObserver& aObserver, + MMusCallStateObserver& aCallStateObserver ); + + /** + * Stops monitoring call status,event and conference. + */ + void StopMonitor(); + + /** + * Compares the name of the call. + */ + TBool IsEqual(TName& aName); + + /** + * Returns the CallName. + */ + const TName Name(); + + /** + * ETrue if monitoring stared already. Else otherwise + */ + TBool IsMonitored(); + + /* + * Returns the name of last call occured + */ + TName LastCallNameL(RMobileLine& aLine); + + /** + * Call CMusCallMonitorBase::SetStateL to set + * state of call status monitor and + * state of call event monitor + */ + void SetStateL(NMusSessionInformationApi::TMusCallEvent aVal); + + /** + * Checks from CS call f required data is ready. + */ + TBool IsDataReadyL(); + + + private: + + /** + * C++ constructor. + */ + CMusCallMonitor( TBool aPttCallExist ); + + /** + * Symbian 2nd-phase constructor. + */ + void ConstructL( TName& aCallName); + + /* + * Sets the call count based on callmonitors. + * ETrue to increase. EFalse to decrease. + */ + void SetCallCountL(TBool aIncrease); + + + private: + + /** + * Call status monitor, owned. + */ + CMusCallStatusMonitor* iCallStatusMonitor; + + /** + * Call event monitor, owned. + */ + CMusCallEventMonitor* iCallEventMonitor; + + /** + * RMobilePhone handle. + */ + RMobileCall iCall; + + /** + * Name of the call. + */ + TName iCallName; + + /** + * Existence of Ptt call when this cs call started. + */ + TBool iPttCallExist; + + MUS_UNITTEST( UT_CMusCallMonitor ) + + }; + +#endif // MUSAOCALLMONITOR_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/inc/muscallmonitorbase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/inc/muscallmonitorbase.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,119 @@ +/* +* Copyright (c) 2005-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: Monitors the multimediasharing property. +* +*/ + + + +#ifndef MUSAOCALLMONITORBASE_H +#define MUSAOCALLMONITORBASE_H + +#include "musunittesting.h" +#include "mussesseioninformationapi.h" +#include "mmustsypropertyobserver.h" +#include "mmuscallstateobserver.h" +#include +#include + +/** + * Monitor, which observes status of current cs call + * + * @lib musaoplugin.dll + */ +class CMusCallMonitorBase : public CActive + { + + public: // constructors and destructor + + /** + * Destructor. + */ + ~CMusCallMonitorBase(); + + public: + + /** + * Sets the state to PS Keys + */ + void SetStateL(NMusSessionInformationApi::TMusCallEvent aVal); + + /** + * Sets the Call Information. + */ + void SetCallInfoL(); + + /** + * CActive Implentation + */ + TInt RunError( TInt aError ); + + /** + * Checks if it the data is ready for the CS Call + */ + TBool IsDataReadyL(); + + + protected: + + /** + * C++ constructor. + */ + CMusCallMonitorBase( const RMobileCall& aCall, + MMusTsyPropertyObserver& aObserver, + MMusCallStateObserver& aCallStateObserver ); + + /** + * Notify observer that our state changed + */ + virtual void NotifyCallStateChanged( NMusSessionInformationApi::TMusCallEvent aVal ); + + + protected: + + /** + * RMobileCall handle. + */ + const RMobileCall& iCall; + + /** + * Store the remote state so that when local call events + * happen then we can still aware the remote terminal. + */ + RMobileCall::TMobileCallEvent iRemoteCallEvent; + + /** + * Store the local call event state so that when remote call events + * happen then we can still aware the local terminal. + */ + RMobileCall::TMobileCallEvent iLocalCallEvent; + + /** + * Observer to get nofitied when RCall status changed + */ + MMusTsyPropertyObserver& iTsyObserver; + + + /* + * Reference of callstate observer not owned + */ + MMusCallStateObserver& iCallStateObserver; + + + MUS_UNITTEST( UT_CMusCallMonitor ) + MUS_UNITTEST( UT_CMusCallEventMonitor ) + MUS_UNITTEST( UT_CMusCallStatusMonitor ) + }; + +#endif // MUSAOCALLMONITORBASE_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/inc/muscallstatusmonitor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/inc/muscallstatusmonitor.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,99 @@ +/* +* 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: Monitor the status of the call. +* +*/ + + + +#ifndef MUSCALLSTATUSMONITOR_H +#define MUSCALLSTATUSMONITOR_H + +#include "mussesseioninformationapi.h" +#include "muscallmonitorbase.h" +#include "musunittesting.h" +#include "mmuscallstateobserver.h" + +#include +#include + + +/** + * Monitors the event of call and set the state to property. + * + * @lib musaoplugin.dll + */ +class CMusCallStatusMonitor : public CMusCallMonitorBase + { + + public: + /** + * Two-phased constructor. Leaves on failure. + * aCall is not owned. + * @return CMusCallStatusMonitor object. + */ + static CMusCallStatusMonitor* NewL( const RMobileCall& aCall, + MMusTsyPropertyObserver& aObserver, + MMusCallStateObserver& aCallStateObserver ); + + /** + * Destructor. + */ + ~CMusCallStatusMonitor(); + + private: + + /** + * C++ constructor. + */ + CMusCallStatusMonitor(const RMobileCall& aCall, MMusTsyPropertyObserver& aObserver, + MMusCallStateObserver& aCallStateObserver ); + + /** + * Symbian 2nd-phase constructor. + */ + void ConstructL(); + + /** + * Checks the callstatus and sets the multimediasharing property + * key value. + */ + void CheckStateL(); + + private: + + /** + * Handles an active object's request completion event. + */ + void RunL(); + + /** + * cancels of an outstanding request + */ + void DoCancel(); + + + private: + + /** + * Call Status. + */ + RMobileCall::TMobileCallStatus iCallStatus; + + + MUS_UNITTEST( UT_CMusCallStatusMonitor ) + + }; + +#endif // MUSCALLSTATUSMONITOR_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/inc/muscallstatusmonitorobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/inc/muscallstatusmonitorobserver.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,38 @@ +/* +* 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: Observer for listening status of current cs call +* +*/ + + + +#ifndef MUSCALLSTATUSMONITOROBSERVER_H +#define MUSCALLSTATUSMONITOROBSERVER_H + + +/** + * Observer for the monitor any call status changes + * + * @lib musaoplugin.dll + */ +class MMusCallStatusMonitorObserver + { + +public: // type definitions + + virtual void StatusChanged() = 0; + + }; + +#endif // MUSCALLSTATUSMONITOROBSERVER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/inc/muspropertymonitor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/inc/muspropertymonitor.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,112 @@ +/* +* Copyright (c) 2005-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: Monitors the call. +* +*/ + + + +#ifndef MUSAOCALLMONITOR_H +#define MUSPROPERTYMONITOR_H + +#include "musunittesting.h" +#include "mmuscallstateobserver.h" +#include +#include +#include + +class CMusManager; + +/** + * Monitor, which observes status of current cs call + * + * @lib musaoplugin.dll + */ +class CMusPropertyMonitor : public CActive + { + + public: // constructors and destructor + + /** + * Two-phased constructor. Leaves on failure. + */ + static CMusPropertyMonitor* NewL( MMusCallStateObserver& aCallStateObserver ); + + /** + * Destructor. + */ + ~CMusPropertyMonitor(); + + + public: // other public functions + + /* + * Checks from P/S Keys about call state + * @return EFalse if call state is ENoCall otherwise ETrue + */ + TBool IsCallConnected(); + + + private: + + /** + * C++ constructor. + */ + CMusPropertyMonitor( MMusCallStateObserver& aCallStateObserve ); + + /** + * Symbian 2nd-phase constructor. + */ + void ConstructL(); + + + private: + + /** + * Handles an active object's request completion event. + */ + void RunL(); + + /** + * cancels of an outstanding request + */ + void DoCancel(); + + /* + * Handles a leave occurring in the request completion + * event handler RunL(). + * Always return KErrNone since it must handle this error + * if it comes to this place. + */ + TInt RunError( TInt aError ); + + + + private: + + /** + * Instance of RProperty. + */ + RProperty iPropertyEvent; + + /* + * Reference of callstate observer not owned + */ + MMusCallStateObserver& iCallStateObserver; + + MUS_UNITTEST( UT_CMusPropertyMonitor ) + + }; + +#endif // MUSPROPERTYMONITOR_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/inc/muspttcallmonitor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/inc/muspttcallmonitor.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,110 @@ +/* +* 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: Monitors the Kodiak Ptt call events. +* +*/ + + +#ifndef MUSPTTCALLMONITOR_H +#define MUSPTTCALLMONITOR_H + +#include "mmusptteventobserver.h" +#include "musunittesting.h" + +#include // CBase +#include // RProperty + + +/** + * this class is listening call monitor P&S keys + * + * @lib musaoplugin.dll + */ + +class CMusPttCallMonitor : public CActive + { + + public: + + /** + * Two-phased constructor + * + * @since S60 v3.2 + * @return New CMusAoPlugin instance + */ + static CMusPttCallMonitor* NewL(MMusPttEventObserver& aObserver); + + /** + * C++ destructor. + */ + virtual ~CMusPttCallMonitor(); + + + + private: // constructors + + /** + * C++ constructor. + */ + CMusPttCallMonitor(MMusPttEventObserver& aObserver); + + /** + * Symbian second-phase constructor. + */ + void ConstructL(); + + + public: //from base class CActive + + /** + * Handles an active object's request completion event. + */ + void RunL(); + + /** + * cancelsof an outstanding request + */ + void DoCancel(); + + /** + * Returns ETrue of PTT Call Exist else otherwise. + */ + TBool IsPTTCallExist(); + + /* + * Handles a leave occurring in the request completion + * event handler RunL(). + * Always return KErrNone since it must handle this error + * if it comes to this place. + */ + TInt RunError( TInt aError ); + + + private: // data + + /** + * properties for P&S + */ + RProperty iPropertyEvent; + + /** + * Observer for Kodiak Events + */ + MMusPttEventObserver& iObserver; + + + MUS_UNITTEST( UT_CMusPTTCallMonitor ) + }; + +#endif // MUSPTTCALLMONITOR_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/inc/mustsypropertymonitor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/inc/mustsypropertymonitor.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,257 @@ +/* +* Copyright (c) 2005-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: Monitor that observes the Line and create call monitor +* +*/ + + +#ifndef MUSTSYPROPERTYMONITOR_H +#define MUSTSYPROPERTYMONITOR_H + +// Enable the below line if Kodiak Ptt has to be monitered +// #include "mmusptteventobserver.h" +#include +#include +#include +#include +#include + +#include "musunittesting.h" +#include "mussesseioninformationapi.h" +#include "mmustsypropertyobserver.h" +#include "mmuscallstateobserver.h" + +class CMusCallMonitor; +class CMusVoipCallMonitor; +class CMusPTTCallMonitor; +class CMusCallConferenceMonitor; + +/** + * This class monitors the line event,if call is connected + * it creats new call event monitor . If call is disconnected + * it removes the call monitor . Also it responds to Ptt Events. + * + * @lib musaoplugin.dll + */ + +class CMusTsyPropertyMonitor : public CActive, + public MMusTsyPropertyObserver +// Enable the below line if Kodiak Ptt has to be monitered +// ,public MMusPttEventObserver + { + + public: // constructors and destructor + + /** + * Two-phased constructor. + */ + static CMusTsyPropertyMonitor* NewL( RMobilePhone& aPhone, + MMusCallStateObserver& aCallStateObserver ); + + /** + * Destructor. + */ + ~CMusTsyPropertyMonitor(); + + /* + * Returns the current call object. + */ + + const RCall& Call(); + + /** + * Function from MMusTsyPropertyObserver + */ + void NotifyCallStateChanged(NMusSessionInformationApi::TMusCallEvent aVal, TName& aCallName); + + /** + * Checks from the corresponding monitors if the data is ready. + */ + TBool IsDataReadyL(); + + private: + + /** + * C++ constructor. + */ + CMusTsyPropertyMonitor( RMobilePhone& aPhone, MMusCallStateObserver& aCallStateObserve ); + + /** + * Symbian 2nd-phase constructor. + */ + void ConstructL(); + + + private: // functions from base class CActive + + /** + * Handles an active object's request completion event. + */ + void RunL(); + + /** + * cancels of an outstanding request + */ + void DoCancel(); + + /* + * Handles a leave occurring in the request completion + * event handler RunL(). + * Always return KErrNone since it must handle this error + * if it comes to this place. + */ + TInt RunError( TInt aError ); + + + private: + /* + * If the call Monitor doesnt exist then it creats one new + * CMusCallMonitor class and add into array. + * Leavs if objects creation fails. + */ + void AddCallMonitorL( TName& aCallName ); + + /* + * It removs the CMusCallMonitor object from array + * based on the call name. + */ + + void RemoveCallMonitor( TName& aCallName ); + + /* + * It checks the property key of PTT call.If call exist ETrue + * else otherwise. + */ + TBool IsPttCallExist(); + + /** + * Sets the multimediasharing propery key value + * if the value is same before then dont report it. + */ + void SetStateL(NMusSessionInformationApi::TMusCallEvent aVal); + + /** + * Add / Remove Call Monitors based on Mus criteria + */ + void MonitorCallL(const TPSCTsyCallState& aCallState, + const TPSCTsyCallType& aCallType); + + /** + * Add / Remove Call Monitors based on Mus criteria + */ + void MonitorCSCallL(); + + private: // Voip related + /* + * If the call Monitor doesnt exist then it creats one new + * CMusCallMonitor class and add into array. + * Leavs if objects creation fails. + */ + void AddVoipCallMonitorL( TName& aCallName ); + + /* + * It removs the CMusCallMonitor object from array + * based on the call name. + */ + + void RemoveVoipCallMonitor( TName& aCallName ); + + /** + * Add / Remove Call Monitors based on Mus criteria + */ + void MonitorVoipCallL(const TPSCTsyCallState& aCallState); + + /** + * Removes and reset the voip call monitor array + */ + void RemoveAllVoipCallMonitors( ); + + /** + * Checks multimediasharing call criteria's + */ + void CheckCallCriteriaL(); + + + /** + * Delete all call monitor + */ + void RemoveAllCallMonitor(); + + /** + * Check Call Staus from Call. + */ + RMobileCall::TMobileCallStatus CallStatus(const TDesC& aCallName); + + /** + * Remove Unused Call monitorts. Sometime the call gets disconnected + * and call state goes unnoticed.so its good to check and remove unused + * call monitors. + */ + + void RemoveUnUsedCallMonitors(); + + private: + /* + * It will be called from CMusPttCallMonitor class incase any Ptt + * event occurs. It will stop or start call monitoring based on this. + * It could leave if start/stop of call monitor fails. + */ + + // Enable the below line if Kodiak Ptt has to be monitered + // void PttCallEventOccuredL( TPSCTsyKodiakPtt& aVal); + + + private: // Data + + /** + * RMobilePhone handle.It is not owned . So don't close it. + */ + RMobilePhone& iPhone; + + /** + * RMobileLine handle + */ + RMobileLine iLine; + + /** + * Array of Call Monitors. + */ + RPointerArray iCallMonitorArray; + + /** + * Array of voip Call Monitors. + */ + RPointerArray iVoipCallMonitorArray; + + /** + * Conference call monitor, owned. + */ + CMusCallConferenceMonitor* iConferenceMonitor; + + /** + * Instance of RProperty. + */ + RProperty iPropertyEvent; + + /* + * Reference of callstate observer not owned + */ + MMusCallStateObserver& iCallStateObserver; + + MUS_UNITTEST( UT_CMusTsyPropertyMonitor ) + MUS_UNITTEST( UT_CMusAoPlugin ) + + }; + +#endif // MUSTSYPROPERTYMONITOR_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/inc/musvoipcallmonitor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/inc/musvoipcallmonitor.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,155 @@ +/* +* Copyright (c) 2005-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: Monitors the VOIP calls. +* +*/ + + +#ifndef MUSVOIPCALLMONITOR_H_ +#define MUSVOIPCALLMONITOR_H_ + +#include + +#include +#include +#include + +#include "mussesseioninformationapi.h" +#include "musunittesting.h" +#include "mmuscallstateobserver.h" + +/** + * Monitors the Internet telephony calls ( VOIP ) + * Same condition of CS call criteria applies here to + * for Mush. + * @lib musaoplugin.dll + */ +class CMusVoipCallMonitor : public CActive + { + + public: // constructors and destructor + /** + * Symbian two-phased constructor. + */ + static CMusVoipCallMonitor* NewL( TName& aCallName, + MMusCallStateObserver& aCallStateObserver ); + + /** + * Symbian two-phased constructor. + */ + static CMusVoipCallMonitor* NewLC( TName& aCallName ); + + /** + * Destructor. + */ + ~CMusVoipCallMonitor(); + + private: // functions from base class CActive + + void RunL(); + + void DoCancel(); + + TInt RunError( TInt aError ); + + private: + + /** + * C++ constructor. + */ + CMusVoipCallMonitor( TName& aCallName, MMusCallStateObserver& aCallStateObserver ); + + /** + * Symbian 2nd-phase constructor. + */ + void ConstructL( ); + + public: + + /** + * Compares the call names (aName == iCallName) + * + * @return ETrue if matches else EFalse + */ + TBool IsEqual(TName& aName); + + /** + * Sets the call state PS Key value. + * + * @aVal one of the call event types + */ + void SetStateL(NMusSessionInformationApi::TMusCallEvent aVal); + + /** + * Checks from voip call monitor if required data is ready. + */ + TBool IsDataReadyL(); + + private: + + /** + * Sets the call Information like call direction and remote address + */ + void SetCallInfoL(); + + /** + * Sets the call Provider Information (CallProvider Name is PS Key) + */ + void SetCallProviderInfoL( TUint32 aServiceId ); + + TBool RemoteInfoExistsL(); + + void MonitorForRemoteInfoL(); + + void StopRemoteInfoMonitoring(); + + void ReportStateChangeL( NMusSessionInformationApi::TMusCallEvent aVal ); + + static TInt GuardTimerExpired( TAny* aPtr ); + + /** + * Returns current connected call Service ID. + * @return Current connected call service ID, if there is at least one + * call in connected state, otherwise KErrNotFound + */ + TUint32 CallServiceIdL(); + + void AddDomainFromOwnUsernameL( TUint32 aServiceId, TDes16& aUri ); + + // Resets the Call Provider Information. + void ResetCallProviderName(); + + + private: + /* + * Name of the call. + */ + TName& iCallName ; + + RProperty iPropertyEvent; + + /* + * Reference of callstate observer not owned + */ + MMusCallStateObserver& iCallStateObserver; + + CDeltaTimer* iGuardTimer; + TCallBack iGuardTimerCallBack; + TDeltaTimerEntry iGuardTimerEntry; + + MUS_UNITTEST( UT_CMusVoipCallMonitor ) + + }; + +#endif /* MUSVOIPCALLMONITOR_H_ */ diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/src/musaoplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/src/musaoplugin.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,321 @@ +/* +* Copyright (c) 2005-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: Main plugin class +* +*/ + + +#include "musmanager.h" +#include "musresourceproperties.h" +#include "mussesseioninformationapi.h" +#include "mussettingskeys.h" +#include "mussessionproperties.h" +#include "mussettings.inl" +#include "musaoplugin.h" +#include "mustsypropertymonitor.h" +// Enable the below line if Kodiak Ptt has to be monitered +// #include "muspttcallmonitor.h" +#include "muspropertymonitor.h" +#include "mustsypropertymonitor.h" +#include "muslogger.h" + +#include +#include +#include + +// ----------------------------------------------------------------------------- +// Symbian two-phase constructor. +// ----------------------------------------------------------------------------- +// +CMusAoPlugin* CMusAoPlugin::NewL() + { + MUS_LOG( "mus: [MUSAO] -> CMusAoPlugin::NewL" ) + CMusAoPlugin* self = new (ELeave) CMusAoPlugin(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + MUS_LOG( "mus: [MUSAO] <- CMusAoPlugin::NewL" ) + return self; + } + +// ----------------------------------------------------------------------------- +// C++ constructor. +// ----------------------------------------------------------------------------- +// +CMusAoPlugin::CMusAoPlugin() : + CAlwaysOnlineEComInterface() + { + } + +// ----------------------------------------------------------------------------- +// Symbian second-phase constructor. +// ----------------------------------------------------------------------------- +// +void CMusAoPlugin::ConstructL() + { + MUS_LOG( "mus: [MUSAO] -> CMusAoPlugin::ConstructL" ) + DefinePropertiesL(); + User::LeaveIfError( iServer.Connect() ); + User::LeaveIfError( iPhone.Open( iServer, KMmTsyPhoneName() ) ); + iTsyPropertyMonitor = CMusTsyPropertyMonitor::NewL(iPhone, *this ); + iPropertyMonitor = CMusPropertyMonitor::NewL(*this); + // Enable the below line if Kodiak Ptt has to be monitered + // iPttCallMonitor = CMusPttCallMonitor::NewL(*iLineMonitor); + + MUS_LOG( "mus: [MUSAO] <- CMusAoPlugin::ConstructL" ) + } + +// ----------------------------------------------------------------------------- +// C++ destructor. +// ----------------------------------------------------------------------------- +// +CMusAoPlugin::~CMusAoPlugin() + { + MUS_LOG( "-> CMusAoPlugin::~CMusAoPlugin" ) + // should never come here, because service should always be on + delete iManager; + delete iPropertyMonitor; + delete iTsyPropertyMonitor; + // Enable the below line if Kodiak Ptt has to be monitered + // delete iPttCallMonitor; + DeleteProperties(); + iPhone.Close(); + iServer.Close(); + MUS_LOG( "<- CMusAoPlugin::~CMusAoPlugin" ) + } + + +// ----------------------------------------------------------------------------- +// CMusAoPlugin::DefineResourcePropertiesL() +// Note : Ignore Define Errors . Because if define fails for sure Set +// will fail too . But there are some cases in Define Error should +// be ignored like KErrAlreadyExists , KErrPersmissionDenied.So It +// could be better if we dont care Define Error but care about Set Err. +// ----------------------------------------------------------------------------- +// +void CMusAoPlugin::DefinePropertiesL() + { + MUS_LOG( "mus: [MUSAO] -> CMusAoPlugin::DefineResourceProperties" ) + // define resource properties + // they need to be defined here to make them exist always + // Read from cenrep key about the availability of camera and keypad + // if the availability is dynamic then define a key else no. + MusSettingsKeys::TAvailability camera = MusSettingsKeys::EAvailabilityStatic; + MusSettingsKeys::TAvailability keypad = MusSettingsKeys::EAvailabilityStatic ; + MultimediaSharingSettings::ResourceAvailability(camera,keypad); + if( camera == MusSettingsKeys::EAvailabilityDynamic ) + { + DefinePropertyL(NMusResourceApi::KCameraAvailability, + RProperty::EInt,( TInt ) NMusResourceApi::ENotAvailable); + } + if( keypad == MusSettingsKeys::EAvailabilityDynamic ) + { + DefinePropertyL(NMusResourceApi::KKeypadAvailability, + RProperty::EInt,( TInt ) NMusResourceApi::ENotAvailable); + } + DefinePropertyL(NMusResourceApi::KCameraInformation, + RProperty::EInt,( TInt ) NMusResourceApi::EUsePrimaryCamera); + DefinePropertyL(NMusSessionInformationApi::KMusCallEvent, + RProperty::EInt,( TInt ) NMusSessionInformationApi::ENoCall); + DefinePropertyL(NMusSessionInformationApi::KMusCallCount,RProperty::EInt,0); + _LIT(KEmptyTelNumber,""); + DefinePropertyL(NMusSessionInformationApi::KMusTelNumber, + RProperty::EText,KEmptyTelNumber); + DefinePropertyL(NMusSessionInformationApi::KMUSForbidden, + RProperty::EInt,( TInt ) NMusSessionInformationApi::EMUSAllowed); + DefinePropertyL(NMusSessionInformationApi::KMusCallDirection, + RProperty::EInt,( TInt ) NMusSessionInformationApi::ENoDirection); + _LIT( KEmptyCallProvider,"" ); + DefinePropertyL(NMusSessionInformationApi::KMUSCallProvider, + RProperty::EText,KEmptyCallProvider); + + MUS_LOG( "mus: [MUSAO] <- CMusAoPlugin::DefineResourceProperties" ) + } + +// ----------------------------------------------------------------------------- +// CMusAoPlugin::DefineProperty() +// ----------------------------------------------------------------------------- +// +void CMusAoPlugin::DefinePropertyL(TInt aKey,RProperty::TType aType,TInt aVal) + { + MUS_LOG( "mus: [MUSAO] -> CMusAoPlugin::DefinePropertyL( intValue )" ) + + TInt error = RProperty::Define( NMusResourceApi::KCategoryUid, + aKey, + aType ); + MUS_LOG2( "mus: [MUSAO] Key=%d defining tried, return=%d", aKey, error ) + + if ( error == KErrNone ) + { + error = RProperty::Set( NMusResourceApi::KCategoryUid, aKey, aVal ); + MUS_LOG2( "mus: [MUSAO] RProperty value %d set, return = %d", + aVal, error ) + User::LeaveIfError( error ); + } + else + { + MUS_LOG( "mus: [MUSAO] Defining failed, do not set value" ) + } + + MUS_LOG( "mus: [MUSAO] <- CMusAoPlugin::DefinePropertyL( intValue )" ) + } + +// ----------------------------------------------------------------------------- +// CMusAoPlugin::DefineProperty() +// ----------------------------------------------------------------------------- +// +void CMusAoPlugin::DefinePropertyL( TInt aKey, + RProperty::TType aType, + const TDesC& aVal ) + { + MUS_LOG( "mus: [MUSAO] -> CMusAoPlugin::DefinePropertyL( DesCValue )" ) + + TInt error = RProperty::Define( NMusResourceApi::KCategoryUid, + aKey, + aType ); + MUS_LOG2( "mus: [MUSAO] Key=%d defining tried, return=%d", aKey, error ) + + if ( error == KErrNone ) + { + error = RProperty::Set( NMusResourceApi::KCategoryUid, aKey, aVal); + MUS_LOG_TDESC( "mus: [MUSAO] Tried to set RProperty value: ", aVal ) + MUS_LOG1("mus: [MUSAO] return value = %d",error ) + User::LeaveIfError( error ); + } + else + { + MUS_LOG( "mus: [MUSAO] Defining failed, do not set value" ) + } + + MUS_LOG( "mus: [MUSAO] <- CMusAoPlugin::DefinePropertyL( DesCValue )" ) + } + +// ----------------------------------------------------------------------------- +// CMusAoPlugin::DeleteResourceProperties() +// Note : There is no need of caring the return value in deleting +// This will be called when AO Plugin destroyed which is rare to happen +// Any unwanted deletion of AO Plugin should leave some PS Keys open. +// But this is OK if we ignore KErrAlreadyExists while defining next time. +// ----------------------------------------------------------------------------- +// +void CMusAoPlugin::DeleteProperties() + { + MUS_LOG( "mus: [MUSAO] -> CMusAoPlugin::DeleteResourcePropertiesL" ) + // Delete resource properties + // they need to be defined here to make them exist always + DeleteProperty(NMusResourceApi::KCameraAvailability); + DeleteProperty(NMusResourceApi::KKeypadAvailability); + DeleteProperty(NMusResourceApi::KCameraInformation); + DeleteProperty(NMusSessionInformationApi::KMusCallEvent); + DeleteProperty(NMusSessionInformationApi::KMusCallCount); + DeleteProperty(NMusSessionInformationApi::KMusTelNumber); + DeleteProperty(NMusSessionInformationApi::KMUSCallProvider); + DeleteProperty(NMusSessionInformationApi::KMUSForbidden); + DeleteProperty(NMusSessionInformationApi::KMusCallDirection); + MUS_LOG( "mus: [MUSAO] <- CMusAoPlugin::DeleteResourcePropertiesL" ) + } + +// ----------------------------------------------------------------------------- +// CMusAoPlugin::DeleteProperty() +// ----------------------------------------------------------------------------- +// +void CMusAoPlugin::DeleteProperty(TInt aKey) + { + TInt retVal = RProperty::Delete( NMusResourceApi::KCategoryUid,aKey); + MUS_LOG2( "mus: [MUSAO] RProperty::Delete Type=%d return=%d",\ + aKey, retVal ) + } + +// ----------------------------------------------------------------------------- +// CMusAoPlugin::HandleServerCommandL +// CallBack from base class. +// ----------------------------------------------------------------------------- +// +TAny* CMusAoPlugin::HandleServerCommandL( TInt /*aCommand*/, + TDesC8* /*aParameters*/ ) + { + MUS_LOG( "mus: [MUSAO] -> CMusAoPlugin::HandleServerCommandL" ) + MUS_LOG( "mus: [MUSAO] <- CMusAoPlugin::HandleServerCommandL: KErrNone" ) + return &iError;; + } + +// ----------------------------------------------------------------------------- +// CMusAoPlugin::StartMusClient() +// This will start the MusManager Client which inturn should start +// MusManager Server and Availability Plugin. +// ----------------------------------------------------------------------------- +// +void CMusAoPlugin::StartMusClientL() + { + MUS_LOG( "mus: [MUSAO] -> CMusAoPlugin::StartMusClient" ) + if( !iManager ) + { + iManager = CMusManager::NewL(); + } + iManager->ExamineAvailabilityL(); + MUS_LOG( "mus: [MUSAO] <- CMusAoPlugin::StartMusClient" ) + } + +// ----------------------------------------------------------------------------- +// CMusAoPlugin::StopMusClient() +// This will stop the MusManager Client which inturn should stop +// MusManager Server and Availability Plugin. +// ----------------------------------------------------------------------------- +// +void CMusAoPlugin::StopMusClient() + { + MUS_LOG( "mus: [MUSAO] -> CMusAoPlugin::StopMusClient" ) + if( iManager ) + { + delete iManager; + iManager = NULL; + } + MUS_LOG( "mus: [MUSAO] <- CMusAoPlugin::StopMusClient" ) + } + +// ----------------------------------------------------------------------------- +// From MMusCallStateObserver +// CMusAoPlugin::MusCallStateChanged() +// ----------------------------------------------------------------------------- +// +void CMusAoPlugin::MusCallStateChanged( ) + { + MUS_LOG( "mus: [MUSAO] -> CMusAoPlugin::MusCallStateChanged" ) + + TBool dataReady = EFalse; + TRAPD( error, dataReady = iTsyPropertyMonitor->IsDataReadyL() ) + + if ( error == KErrNone && + dataReady && + iPropertyMonitor->IsCallConnected() ) + { + MUS_LOG( "mus: [MUSAO] Starting Mush Client" ) + TRAP( error, StartMusClientL() ) + + MUS_LOG1("mus: [MUSAO] Error Ocurred = %d",error ) + + if ( error != KErrNone ) + { + StopMusClient(); + } + } + else + { + MUS_LOG( "mus: [MUSAO] Stopping Mush Client" ) + StopMusClient(); + } + MUS_LOG( "mus: [MUSAO] <- CMusAoPlugin::MusCallStateChanged" ) + } + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/src/musaopluginmain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/src/musaopluginmain.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,49 @@ +/* +* 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: DLL entry point +* +*/ + + + +#include +#include + +#include "musaoplugin.hrh" +#include "musaoplugin.h" + +// -------------------------------------------------------------------------- +// Exported proxy for instantiation method resolution. Use the interface +// UID (same as the DLL UID) and the implementation factory function as a +// pair for ECom instantiation. +// -------------------------------------------------------------------------- +// +const TImplementationProxy ImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( 0x1028238B, CMusAoPlugin::NewL ) + }; + + +// -------------------------------------------------------------------------- +// Give the table to the caller. +// -------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount ) + { + aTableCount = sizeof( ImplementationTable ) / sizeof( TImplementationProxy ); + return ImplementationTable; + } + +// End of file + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/src/muscallconferenceeventmonitor.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/src/muscallconferenceeventmonitor.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,226 @@ +/* +* 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: Monitor the status of CS Conference call +* +*/ + + +#include "mussesseioninformationapi.h" +#include "muslogger.h" +#include "muscallconferenceeventmonitor.h" + +#include +#include +#include +#include + + +// ----------------------------------------------------------------------------- +// Symbian two-phase constructor. +// ----------------------------------------------------------------------------- +// +CMusCallConferenceEventMonitor* CMusCallConferenceEventMonitor::NewL( RMobilePhone& aPhone, + RMobileLine& aLine, + RPointerArray& aCallMonitorArray ) + { + MUS_LOG( "mus: [MUSAO] -> CMusCallConferenceEventMonitor::NewL" ) + CMusCallConferenceEventMonitor* self = new (ELeave) + CMusCallConferenceEventMonitor(aLine,aCallMonitorArray); + CleanupStack::PushL( self ); + self->ConstructL( aPhone ); + CleanupStack::Pop( self ); + MUS_LOG( "mus: [MUSAO] <- CMusCallConferenceEventMonitor::NewL" ) + return self; + } + + +// ----------------------------------------------------------------------------- +// C++ destructor. +// ----------------------------------------------------------------------------- +// +CMusCallConferenceEventMonitor::~CMusCallConferenceEventMonitor() + { + MUS_LOG( "mus: [MUSAO] -> \ + CMusCallConferenceEventMonitor::~CMusCallConferenceEventMonitor" ) + Cancel(); + iConfCall.Close(); + MUS_LOG( "mus: [MUSAO] <- \ + CMusCallConferenceEventMonitor::~CMusCallConferenceEventMonitor" ) + } + +// ----------------------------------------------------------------------------- +// Symbian second-phase constructor. +// ----------------------------------------------------------------------------- +// +void CMusCallConferenceEventMonitor::ConstructL( RMobilePhone& aPhone ) + { + MUS_LOG( "mus: [MUSAO] -> CMusCallConferenceEventMonitor::ConstructL" ) + CActiveScheduler::Add( this ); + User::LeaveIfError(iConfCall.Open(aPhone)); + iConfCall.NotifyConferenceEvent(iStatus,iConfEvent,iCallName); + SetActive(); + MUS_LOG( "mus: [MUSAO] <- CMusCallConferenceEventMonitor::ConstructL" ) + } + + +// ----------------------------------------------------------------------------- +// C++ constructor. +// ----------------------------------------------------------------------------- +// +CMusCallConferenceEventMonitor::CMusCallConferenceEventMonitor(RMobileLine& aLine, + RPointerArray& aCallMonitorArray) + : CActive( EPriorityNormal ), + iLine(aLine), + iCallMonitorArray(aCallMonitorArray) + + + { + } + + +// -------------------------------------------------------------------------------- +// CMusCallConferenceEventMonitor::RunL() +// Implemented for CActive.It will be called any NotifyMobileLineStatusChange +// Event happens. +// -------------------------------------------------------------------------------- +// +void CMusCallConferenceEventMonitor::RunL() + { + MUS_LOG( "mus: [MUSAO] -> CMusCallConferenceEventMonitor::RunL" ) + iConfCall.NotifyConferenceEvent(iStatus,iConfEvent,iCallName); + SetActive(); + MUS_LOG1( "mus: [MUSAO] Conference->iConfEvent = %d", iConfEvent ) + switch(iConfEvent) + { + case RMobileConferenceCall::EConferenceCallAdded: + SetStateL( NMusSessionInformationApi::EConferenceCall ); + break; + case RMobileConferenceCall::EConferenceCallRemoved: + MonitorCallL(); + break; + case RMobileConferenceCall::EConferenceBuilt: + SetStateL( NMusSessionInformationApi::EConferenceCall ); + break; + case RMobileConferenceCall::EConferenceTerminated: + MonitorCallL(); + break; + case RMobileConferenceCall::EConferenceSwapped: + SetStateL( NMusSessionInformationApi::EConferenceCall ); + break; + case RMobileConferenceCall::EConferenceSplit: + SetStateL( NMusSessionInformationApi::EConferenceCall ); + break; + default: + break; + } + MUS_LOG( "mus: [MUSAO] <- CMusCallConferenceEventMonitor::RunL" ) + } + + +// -------------------------------------------------------------------------------- +// CMusCallConferenceEventMonitor::DoCancel() +// Implemented for CActive. +// Will be called when Cancel() method is called. +// -------------------------------------------------------------------------------- +// +void CMusCallConferenceEventMonitor::DoCancel() + { + MUS_LOG( "mus: [MUSAO] -> CMusCallConferenceEventMonitor::DoCancel" ) + iConfCall.CancelAsyncRequest( EMobileConferenceCallNotifyConferenceEvent ); + MUS_LOG( "mus: [MUSAO] <- CMusCallConferenceEventMonitor::DoCancel" ) + } + +// -------------------------------------------------------------------------------- +// CMusCallConferenceEventMonitor::RunError( TInt aError ) +// Implemented for CActive. +// Will be called automatically by framework when RunL Leaves. +// -------------------------------------------------------------------------------- +// + +TInt CMusCallConferenceEventMonitor::RunError( TInt aError ) + { + MUS_LOG1( "mus: [MUSAO] -> CMusCallConferenceEventMonitor::RunError, aError %d", \ + aError ) + aError = KErrNone; + MUS_LOG( "mus: [MUSAO] <- CMusCallConferenceEventMonitor::RunError" ) + return aError; + } + +// -------------------------------------------------------------------------------- +// CMusCallConferenceEventMonitor::SetStateL( TInt aError ) +// Sets the Call State to Property +// -------------------------------------------------------------------------------- +// +void CMusCallConferenceEventMonitor::SetStateL( + NMusSessionInformationApi::TMusCallEvent aVal) + { + MUS_LOG1( "mus: [MUSAO] -> CMusCallConferenceEventMonitor::SetStateL, aVal %d",\ + aVal ) + TInt currentVal; + User::LeaveIfError(RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent,currentVal)); + if(currentVal != (TInt)aVal) + { + User::LeaveIfError(RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + aVal )); + } + else + { + // No point of reporting it . + } + MUS_LOG( "mus: [MUSAO] <- CMusCallConferenceEventMonitor::SetStateL" ) + } + +// -------------------------------------------------------------------------------- +// CMusCallConferenceEventMonitor::MonitorCallL() +// If the call in conference is dropped that has to be removed. +// from call monitoring array.and start monitoring. +// -------------------------------------------------------------------------------- +// +void CMusCallConferenceEventMonitor::MonitorCallL() + { + MUS_LOG( "mus: [MUSAO] -> CMusCallConferenceEventMonitor::MonitorCallL") + TInt callCount; + iLine.EnumerateCall(callCount); + MUS_LOG1( "mus: [MUSAO] -> callCount = %d",callCount) + RLine::TCallInfo callInfo; + for(TInt i=0;iIsEqual( callInfo.iCallName ) ) + { + iCallMonitorArray[0]->StopMonitor(); + delete iCallMonitorArray[j]; + iCallMonitorArray.Remove(j); + break; + } + } + } + MUS_LOG( "mus: [MUSAO] -----------------------------------\n" ) + } + MUS_LOG( "mus: [MUSAO] -> CMusCallConferenceEventMonitor::CheckCallStatus") + } + +// End of file + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/src/muscallconferencemonitor.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/src/muscallconferencemonitor.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,263 @@ +/* +* 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: Monitor the status of CS Conference call +* +*/ + + +#include "mussesseioninformationapi.h" +#include "muslogger.h" +#include "muscallconferencemonitor.h" +#include "muscallconferenceeventmonitor.h" + +#include +#include +#include +#include + + +// ----------------------------------------------------------------------------- +// Symbian two-phase constructor. +// ----------------------------------------------------------------------------- +// +CMusCallConferenceMonitor* CMusCallConferenceMonitor::NewL( RMobilePhone& aPhone, + RMobileLine& aLine, + RPointerArray& aCallMonitorArray ) + { + MUS_LOG( "mus: [MUSAO] -> CMusCallConferenceMonitor::NewL" ) + CMusCallConferenceMonitor* self = new (ELeave) + CMusCallConferenceMonitor(aLine,aCallMonitorArray); + CleanupStack::PushL( self ); + self->ConstructL( aPhone ); + CleanupStack::Pop( self ); + MUS_LOG( "mus: [MUSAO] <- CMusCallConferenceMonitor::NewL" ) + return self; + } + + +// ----------------------------------------------------------------------------- +// C++ destructor. +// ----------------------------------------------------------------------------- +// +CMusCallConferenceMonitor::~CMusCallConferenceMonitor() + { + MUS_LOG( "mus: [MUSAO] -> \ + CMusCallConferenceMonitor::~CMusCallConferenceMonitor" ) + Cancel(); + iConfCall.Close(); + delete iConfCallEvent; + MUS_LOG( "mus: [MUSAO] <- \ + CMusCallConferenceMonitor::~CMusCallConferenceMonitor" ) + } + +// ----------------------------------------------------------------------------- +// Symbian second-phase constructor. +// ----------------------------------------------------------------------------- +// +void CMusCallConferenceMonitor::ConstructL( RMobilePhone& aPhone ) + { + MUS_LOG( "mus: [MUSAO] -> CMusCallConferenceMonitor::ConstructL" ) + CActiveScheduler::Add( this ); + User::LeaveIfError(iConfCall.Open(aPhone)); + iConfCall.NotifyConferenceStatusChange(iStatus,iConfStatus); + SetActive(); + iConfCallEvent = CMusCallConferenceEventMonitor::NewL(aPhone, + iLine, + iCallMonitorArray); + MUS_LOG( "mus: [MUSAO] <- CMusCallConferenceMonitor::ConstructL" ) + } + + +// ----------------------------------------------------------------------------- +// C++ constructor. +// ----------------------------------------------------------------------------- +// +CMusCallConferenceMonitor::CMusCallConferenceMonitor(RMobileLine& aLine, + RPointerArray& aCallMonitorArray) + : CActive( EPriorityNormal ), + iLine(aLine), + iCallMonitorArray(aCallMonitorArray) + + + { + } + + +// -------------------------------------------------------------------------------- +// CMusCallConferenceMonitor::RunL() +// Implemented for CActive.It will be called any NotifyMobileLineStatusChange +// Event happens. +// -------------------------------------------------------------------------------- +// +void CMusCallConferenceMonitor::RunL() + { + MUS_LOG( "mus: [MUSAO] -> CMusCallConferenceMonitor::RunL" ) + iConfCall.NotifyConferenceStatusChange(iStatus,iConfStatus); + SetActive(); + MUS_LOG1( "mus: [MUSAO] Conference->iCallStatus = %d", iConfStatus ) + switch(iConfStatus) + { + case RMobileConferenceCall::EConferenceIdle: + MonitorCallL(); + break; + case RMobileConferenceCall::EConferenceActive: + SetStateL( NMusSessionInformationApi::EConferenceCall ); + break; + case RMobileConferenceCall::EConferenceHold: + SetStateL(NMusSessionInformationApi::ECallHold); + break; + default: + break; + } + MUS_LOG( "mus: [MUSAO] <- CMusCallConferenceMonitor::RunL" ) + } + + +// -------------------------------------------------------------------------------- +// CMusCallConferenceMonitor::DoCancel() +// Implemented for CActive. +// Will be called when Cancel() method is called. +// -------------------------------------------------------------------------------- +// +void CMusCallConferenceMonitor::DoCancel() + { + MUS_LOG( "mus: [MUSAO] -> CMusCallConferenceMonitor::DoCancel" ) + iConfCall.CancelAsyncRequest( EMobileConferenceCallNotifyConferenceStatusChange ); + MUS_LOG( "mus: [MUSAO] <- CMusCallConferenceMonitor::DoCancel" ) + } + +// -------------------------------------------------------------------------------- +// CMusCallConferenceMonitor::RunError( TInt aError ) +// Implemented for CActive. +// Will be called automatically by framework when RunL Leaves. +// -------------------------------------------------------------------------------- +// + +TInt CMusCallConferenceMonitor::RunError( TInt aError ) + { + MUS_LOG1( "mus: [MUSAO] -> CMusCallConferenceMonitor::RunError, aError %d", \ + aError ) + aError = KErrNone; + MUS_LOG( "mus: [MUSAO] <- CMusCallConferenceMonitor::RunError" ) + return aError; + } + + +// -------------------------------------------------------------------------------- +// CMusCallConferenceMonitor::SetStateL() +// Sets the Call State to Property +// -------------------------------------------------------------------------------- +// +void CMusCallConferenceMonitor::SetStateL() + { + MUS_LOG( "mus: [MUSAO] -> CMusCallConferenceMonitor::SetStateL") + User::LeaveIfError(iConfCall.GetConferenceStatus(iConfStatus)); + MUS_LOG1( "mus: [MUSAO] Conference->iCallStatus = %d", iConfStatus ) + switch(iConfStatus) + { + case RMobileConferenceCall::EConferenceIdle: + break; + case RMobileConferenceCall::EConferenceActive: + SetStateL( NMusSessionInformationApi::EConferenceCall ); + break; + case RMobileConferenceCall::EConferenceHold: + SetStateL(NMusSessionInformationApi::ECallHold); + break; + default: + break; + } + MUS_LOG( "mus: [MUSAO] <- CMusCallConferenceMonitor::SetStateL" ) + } + + +// -------------------------------------------------------------------------------- +// CMusCallConferenceMonitor::SetStateL( TInt aError ) +// Sets the Call State to Property +// -------------------------------------------------------------------------------- +// +void CMusCallConferenceMonitor::SetStateL( + NMusSessionInformationApi::TMusCallEvent aVal) + { + MUS_LOG1( "mus: [MUSAO] -> CMusCallConferenceMonitor::SetStateL, aVal %d",\ + aVal ) + TInt currentVal; + User::LeaveIfError(RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent,currentVal)); + if(currentVal != (TInt)aVal) + { + User::LeaveIfError(RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + aVal )); + } + else + { + // No point of reporting it . + } + MUS_LOG( "mus: [MUSAO] <- CMusCallConferenceMonitor::SetStateL" ) + } + +// -------------------------------------------------------------------------------- +// CMusCallConferenceMonitor::MonitorCallL() +// If the call in conference is dropped that has to be removed. +// from call monitoring array.and start monitoring. +// -------------------------------------------------------------------------------- +// +void CMusCallConferenceMonitor::MonitorCallL() + { + MUS_LOG( "mus: [MUSAO] -> CMusCallConferenceMonitor::MonitorCallL") + TInt callCount; + iLine.EnumerateCall(callCount); + MUS_LOG1( "mus: [MUSAO] -> callCount = %d",callCount) + RLine::TCallInfo callInfo; + for(TInt i=0;iIsEqual( callInfo.iCallName ) ) + { + delete iCallMonitorArray[j]; + iCallMonitorArray.Remove(j); + break; + } + } + } + MUS_LOG( "mus: [MUSAO] -----------------------------------\n" ) + } + + MUS_LOG( "mus: [MUSAO] -> CMusCallConferenceMonitor::CheckCallStatus") + } + + +// -------------------------------------------------------------------------------- +// TMobileConferenceStatus GetCconfStatus() +// Get the Conference Call Status +// -------------------------------------------------------------------------------- +// +RMobileConferenceCall::TMobileConferenceStatus CMusCallConferenceMonitor::GetConfStatus() + { + return iConfStatus; + } + + + +// End of file + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/src/muscalleventmonitor.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/src/muscalleventmonitor.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,187 @@ +/* +* 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: Monitor the events of CS call +* +*/ + + +#include "mussesseioninformationapi.h" +#include "muscalleventmonitor.h" +#include "muslogger.h" + +#include +#include +#include +#include + + +// ------------------------------------------------------------------------------ +// Symbian two-phase constructor. +// ------------------------------------------------------------------------------ +// +CMusCallEventMonitor* CMusCallEventMonitor::NewL( const RMobileCall& aCall, + MMusTsyPropertyObserver& aObserver, + MMusCallStateObserver& aCallStateObserver ) + { + MUS_LOG( "mus: [MUSAO] -> CMusCallEventMonitor::NewL" ) + CMusCallEventMonitor* self = new (ELeave) CMusCallEventMonitor(aCall, aObserver, aCallStateObserver ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + MUS_LOG( "mus: [MUSAO] <- CMusCallEventMonitor::NewL" ) + return self; + } + + +// ------------------------------------------------------------------------------ +// C++ destructor. +// ------------------------------------------------------------------------------ +// +CMusCallEventMonitor::~CMusCallEventMonitor() + { + MUS_LOG( "mus: [MUSAO] -> CMusCallEventMonitor::~CMusCallEventMonitor" ) + Cancel(); + MUS_LOG( "mus: [MUSAO] <- CMusCallEventMonitor::~CMusCallEventMonitor" ) + } + +// ------------------------------------------------------------------------------ +// Symbian second-phase constructor. +// ------------------------------------------------------------------------------ +// +void CMusCallEventMonitor::ConstructL( ) + { + MUS_LOG( "mus: [MUSAO] -> CMusCallEventMonitor::ConstructL" ) + CActiveScheduler::Add( this ); + iCall.NotifyCallEvent( iStatus, iCallEvent ); + SetActive(); + MUS_LOG( "mus: [MUSAO] <- CMusCallEventMonitor::ConstructL" ) + } + + +// ------------------------------------------------------------------------------ +// C++ constructor. +// ------------------------------------------------------------------------------ +// +CMusCallEventMonitor::CMusCallEventMonitor( const RMobileCall& aCall, + MMusTsyPropertyObserver& aObserver, + MMusCallStateObserver& aCallStateObserver ) + : CMusCallMonitorBase(aCall, aObserver, aCallStateObserver) + + { + + } + + +// ----------------------------------------------------------------------------- +// CMusCallEventMonitor::RunL() +// From CActive.It will be called any NotifyMobileLineStatusChange +// Event happens. +// ----------------------------------------------------------------------------- +// +void CMusCallEventMonitor::RunL() + { + MUS_LOG( "mus: [MUSAO] -> CMusCallEventMonitor::RunL" ) + iCall.NotifyCallEvent( iStatus, iCallEvent ); + SetActive(); + MUS_LOG1( "mus: [MUSAO] iCallEvent = %d", iCallEvent ) + switch(iCallEvent) + { + case RMobileCall::ELocalHold: + iLocalCallEvent = RMobileCall::ELocalHold; + SetStateL( NMusSessionInformationApi::ECallHold ); + break; + case RMobileCall::ELocalResume: + iLocalCallEvent = RMobileCall::ELocalResume; + // when local resume happens , check the remote call state. + // without knowing remote call state we can not set the state + // to call connected. + if( iRemoteCallEvent == RMobileCall::ERemoteResume) + { + SetStateL( NMusSessionInformationApi::ECallConnected ); + } + else + { + SetStateL( NMusSessionInformationApi::ECallHold ); + } + break; + case RMobileCall::ELocalDeflectCall: + //SetStateL( NMusSessionInformationApi::ECallHold ); + break; + case RMobileCall::ELocalTransfer: + SetStateL( NMusSessionInformationApi::ENoCall ); + break; + case RMobileCall::ERemoteHold: + iRemoteCallEvent = RMobileCall::ERemoteHold; + SetStateL( NMusSessionInformationApi::ECallHold ); + break; + case RMobileCall::ERemoteResume: + iRemoteCallEvent = RMobileCall::ERemoteResume; + // when remote resume happens , check the local call state. + // without knowing local call state we can not set the state + // to call connected. + if( iLocalCallEvent == RMobileCall::ELocalResume) + { + SetStateL( NMusSessionInformationApi::ECallConnected ); + } + else + { + SetStateL( NMusSessionInformationApi::ECallHold ); + } + break; + case RMobileCall::ERemoteTerminated: + SetStateL( NMusSessionInformationApi::ENoCall ); + NotifyCallStateChanged( NMusSessionInformationApi::ENoCall ); + break; + case RMobileCall::ERemoteConferenceCreate: + SetStateL( NMusSessionInformationApi::EConferenceCall ); + break; + case RMobileCall::ERemoteTransferring: + //SetStateL( NMusSessionInformationApi::ECallHold ); + break; + case RMobileCall::ERemoteTransferAlerting: + //SetStateL( NMusSessionInformationApi::ECallHold ); + break; + case RMobileCall::ERemoteBarred: + //SetStateL( NMusSessionInformationApi::ECallHold ); + break; + case RMobileCall::ERemoteForwarding: + //SetStateL( NMusSessionInformationApi::ECallHold ); + break; + case RMobileCall::ERemoteWaiting: + //SetStateL( NMusSessionInformationApi::ECallHold ); + break; + case RMobileCall::ELocalBarred: + //SetStateL( NMusSessionInformationApi::ECallHold ); + break; + default: + break; + } + MUS_LOG( "mus: [MUSAO] <- CMusCallEventMonitor::RunL" ) + } + + +// ----------------------------------------------------------------------------- +// CMusCallEventMonitor::DoCancel() +// Implemented for CActive. +// Will be called when Cancel() method is called. +// ----------------------------------------------------------------------------- +// +void CMusCallEventMonitor::DoCancel() + { + MUS_LOG( "mus: [MUSAO] -> CMusCallEventMonitor::DoCancel" ) + iCall.CancelAsyncRequest( EMobileCallNotifyCallEvent ); + MUS_LOG( "mus: [MUSAO] <- CMusCallEventMonitor::DoCancel" ) + } + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/src/muscallmonitor.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/src/muscallmonitor.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,203 @@ +/* +* Copyright (c) 2005-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: Monitor that observes the status of the current CS call +* +*/ + + +#include "mussesseioninformationapi.h" +#include "muspttcallmonitor.h" +#include "muscallmonitor.h" +#include "muscallstatusmonitor.h" +#include "muscalleventmonitor.h" +#include "musresourceproperties.h" +#include "muslogger.h" + +#include +#include + + + +// ----------------------------------------------------------------------------- +// Symbian two-phase constructor. +// ----------------------------------------------------------------------------- +// +CMusCallMonitor* CMusCallMonitor::NewL( TName& aCallName,TBool aPttCallExist ) + { + MUS_LOG( "mus: [MUSAO] -> CMusCallMonitor::NewL" ) + CMusCallMonitor* self = new (ELeave) CMusCallMonitor( aPttCallExist ); + CleanupStack::PushL( self ); + self->ConstructL( aCallName ); + CleanupStack::Pop( self ); + MUS_LOG( "mus: [MUSAO] <- CMusCallMonitor::NewL" ) + return self; + } + + +// ----------------------------------------------------------------------------- +// C++ destructor. +// ----------------------------------------------------------------------------- +// +CMusCallMonitor::~CMusCallMonitor() + { + MUS_LOG( "mus: [MUSAO] -> CMusCallMonitor::~CMusCallMonitor" ) + delete iCallStatusMonitor; + delete iCallEventMonitor; + iCall.Close(); + // callcount decrease by one and if leave happens here mostly + // property Key not exist,so do not care. + TRAP_IGNORE(SetCallCountL (EFalse)); + MUS_LOG( "mus: [MUSAO] <- CMusCallMonitor::~CMusCallMonitor" ) + } + + +// ----------------------------------------------------------------------------- +// C++ constructor. +// ----------------------------------------------------------------------------- +// +CMusCallMonitor::CMusCallMonitor( TBool aPttCallExist ) + :iPttCallExist(aPttCallExist) + { + } + + +// ----------------------------------------------------------------------------- +// Symbian second-phase constructor. +// ----------------------------------------------------------------------------- +// +void CMusCallMonitor::ConstructL(TName& aCallName) + { + MUS_LOG( "mus: [MUSAO] -> CMusCallMonitor::ConstructL" ) + iCallName = aCallName; + SetCallCountL (ETrue); // increase by one. + MUS_LOG( "mus: [MUSAO] <- CMusCallMonitor::ConstructL" ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusCallMonitor::StartMonitorL(RMobileLine& aLine, + MMusTsyPropertyObserver& aObserver, + MMusCallStateObserver& aCallStateObserver) + { + MUS_LOG( "mus: [MUSAO] -> CMusCallMonitor::StartMonitorL" ) + if(IsMonitored())User::Leave(KErrAlreadyExists); + User::LeaveIfError( iCall.OpenExistingCall( aLine, iCallName ) ); + iCallStatusMonitor = CMusCallStatusMonitor::NewL( iCall, aObserver, aCallStateObserver ); + iCallEventMonitor = CMusCallEventMonitor::NewL( iCall, aObserver, aCallStateObserver ); + MUS_LOG( "mus: [MUSAO] <- CMusCallMonitor::StartMonitorL" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusCallMonitor::StopMonitor() + { + MUS_LOG( "mus: [MUSAO] -> CMusCallMonitor::StopMonitorL" ) + delete iCallStatusMonitor; + iCallStatusMonitor=NULL; + delete iCallEventMonitor; + iCallEventMonitor=NULL; + iCall.Close(); + MUS_LOG( "mus: [MUSAO] <- CMusCallMonitor::StopMonitorL" ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMusCallMonitor::IsEqual(TName& aName) + { + MUS_LOG( "mus: [MUSAO] -> CMusCallMonitor::IsEqual" ) + MUS_LOG_TDESC( "mus: [MUSAO] -> aName : ", aName ); + MUS_LOG_TDESC( "mus: [MUSAO] -> iCallName : ", iCallName ); + TBool val = EFalse ; + val = ( aName == iCallName ); + MUS_LOG1( "mus: [MUSAO] <- CMusCallMonitor::IsEqual = %d",val ) + return val; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +const TName CMusCallMonitor::Name() + { + MUS_LOG( "mus: [MUSAO] <-> CMusCallMonitor::Name" ) + MUS_LOG_TDESC( "mus: iCallName : ", iCallName ); + return iCallName; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMusCallMonitor::IsMonitored() + { + MUS_LOG( "mus: [MUSAO] <-> CMusCallMonitor::IsMonitored" ) + return (iCallStatusMonitor || iCallEventMonitor) + ?ETrue :EFalse; + } + +// ----------------------------------------------------------------------------- +// Sets the call count based on callmonitors. +// ETrue to increase. EFalse to decrease. +// ----------------------------------------------------------------------------- +// +void CMusCallMonitor::SetCallCountL(TBool aIncrease) + { + // Get Current Call count + TInt callCount = 0; + User::LeaveIfError(RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallCount,callCount)); + // Increment by one + ( aIncrease ) ? callCount++ : callCount--; + /* Publish this value through internal mush PS key.So that when + * other call events happen , we aware about number of active calls. + * Set this first.Once object is created. + */ + User::LeaveIfError(RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallCount, + callCount )); + } + +// ----------------------------------------------------------------------------- +// CMusCallMonitor::SetStateL() +// Set state of call status monitor and call event monitor +// ----------------------------------------------------------------------------- +// +void CMusCallMonitor::SetStateL(NMusSessionInformationApi::TMusCallEvent aVal) + { + iCallStatusMonitor->SetStateL( aVal ); + iCallEventMonitor->SetStateL( aVal ); + } + + +// -------------------------------------------------------------------------------- +// CMusCallMonitor::IsDataReadyL() +// Checks if Data is ready CS Call. +// -------------------------------------------------------------------------------- + +TBool CMusCallMonitor::IsDataReadyL() + { + // Wrapper Function for Monitoring CS Call Data + return iCallStatusMonitor->IsDataReadyL(); + } + +// End of file + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/src/muscallmonitorbase.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/src/muscallmonitorbase.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,283 @@ +/* +* 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: Monitor the events of CS call +* +*/ + + +#include "mussesseioninformationapi.h" +#include "muscallmonitorbase.h" +#include "muslogger.h" + +#include +#include +#include +#include +#include + + +// ----------------------------------------------------------------------------- +// C++ destructor. +// ----------------------------------------------------------------------------- +// +CMusCallMonitorBase::~CMusCallMonitorBase() + { + MUS_LOG( "mus: [MUSAO] -> CMusCallMonitorBase::~CMusCallMonitorBase" ) + MUS_LOG( "mus: [MUSAO] <- CMusCallMonitorBase::~CMusCallMonitorBase" ) + } + +// ----------------------------------------------------------------------------- +// C++ constructor. +// ----------------------------------------------------------------------------- +// +CMusCallMonitorBase::CMusCallMonitorBase(const RMobileCall& aCall, + MMusTsyPropertyObserver& aObserver, + MMusCallStateObserver& aCallStateObserver ) + : CActive( EPriorityNormal ),iCall(aCall),iTsyObserver( aObserver ), + iCallStateObserver( aCallStateObserver ) + + + { + // Intialize the remote call event state to Resume , means connected. + iRemoteCallEvent = RMobileCall::ERemoteResume; + // Intialize the local call event state to Resume , means connected. + iLocalCallEvent = RMobileCall::ELocalResume; + } + +// ----------------------------------------------------------------------------- +// CMusCallMonitorBase::SetStateL( TInt aError ) +// Sets the Call State to Property +// ----------------------------------------------------------------------------- +// +void CMusCallMonitorBase::SetStateL(NMusSessionInformationApi::TMusCallEvent aVal) + { + MUS_LOG1( "mus: [MUSAO] -> CMusCallMonitorBase::SetStateL, aVal %d", aVal ) + TInt callCount = 0; + User::LeaveIfError(RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallCount,callCount)); + MUS_LOG1( "mus: [MUSAO] - CallCount = %d",callCount ) + + RMobileCall::TMobileCallInfoV3 callInfo; + RMobileCall::TMobileCallInfoV3Pckg pckg( callInfo ); + iCall.GetMobileCallInfo( pckg ); + if( callInfo.iEmergency ) + { + User::LeaveIfError(RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + ( TInt ) NMusSessionInformationApi::ENoCall )); + } + /* + * CountOfCallMonitors is number of CallMonitor Objects.Static Reference Count. + * = No of active calls . + * React one and only if one call is present -> Mush Call criteria. + * if call count is more than one , should be taken care by conference call or + * multicall criteria. + */ + else if( callCount == 1 ) + { + TInt currentVal; + User::LeaveIfError(RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent,currentVal)); + MUS_LOG1( "mus: [MUSAO] - Remote State = %d",iRemoteCallEvent ) + /* If current event is callconnected and remote is not in hold set the + property value to CallConnected.Else set it to CallHold. + Note : We can be sure about Local is connected when it goes to + CallConnected State. But remote call events are just notified + in call event monitor. So this stores the last remotecall event + and checks it now. + */ + if( aVal==NMusSessionInformationApi::ECallConnected + && iRemoteCallEvent!=RMobileCall::ERemoteHold) + { + /* If the current property value is same of new value, there is no + point of setting it since it will cause lot of other processes. + */ + if(currentVal != (TInt)aVal) + { + User::LeaveIfError(RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + aVal )); + } + } + else if( aVal==NMusSessionInformationApi::ECallHold || iRemoteCallEvent==RMobileCall::ERemoteHold ) + { + User::LeaveIfError(RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + NMusSessionInformationApi::ECallHold )); + } + else if( aVal==NMusSessionInformationApi::ENoCall ) + { + User::LeaveIfError(RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + NMusSessionInformationApi::ENoCall )); + } + else if( aVal==NMusSessionInformationApi::EConferenceCall ) + { + User::LeaveIfError(RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + NMusSessionInformationApi::EConferenceCall )); + } + + /* + If Call is Connected then set the Call info. + */ + if( aVal==NMusSessionInformationApi::ECallConnected ) + { + SetCallInfoL(); + } + + // All P/S Keys are Set + //Check if preconditions are met to start or stop the MushClient. + iCallStateObserver.MusCallStateChanged(); + } + + MUS_LOG( "mus: [MUSAO] <- CMusCallMonitorBase::SetStateL" ) + } + +///----------------------------------------------------------------------------- +// CMusCallMonitorBase::SetCallInfoL( TInt aError ) +// ----------------------------------------------------------------------------- +// +void CMusCallMonitorBase::SetCallInfoL() + { + MUS_LOG( "mus: [MUSAO] -> CMusCallMonitorBase::SetCallInfoL ") + RMobileCall::TMobileCallInfoV3 callInfo; + RMobileCall::TMobileCallInfoV3Pckg callInfoPckg( callInfo ); + User::LeaveIfError(iCall.GetMobileCallInfo( callInfoPckg )); + RMobilePhone::TMobileAddress remoteNumber = + callInfo.iRemoteParty.iRemoteNumber; + // Set telephone number + HBufC* telNo( NULL ); + if( remoteNumber.iTelNumber.Length() > 0 ) + { + MUS_LOG( "mus: [MUSAO] remoteNumber.iTelNumber.Lenght > 0" ) + telNo = remoteNumber.iTelNumber.AllocLC(); + } + else + { + MUS_LOG( "mus: [CALLMN] remoteNumber.iTelNumber.Lenght =< 0" ) + RMobilePhone::TMobileAddress dialledParty = callInfo.iDialledParty; + telNo = dialledParty.iTelNumber.AllocLC(); + } + User::LeaveIfError(RProperty::Set( + NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusTelNumber, + *telNo )); + MUS_LOG_TDESC("mus: [MUSAO] telNo = ", (*telNo)) + CleanupStack::PopAndDestroy(telNo); + + // Set call direction. + RMobileCall::TMobileCallDirection direction = + callInfo.iRemoteParty.iDirection; + MUS_LOG1( "mus: [MUSAO] Call Direction = %d",direction ) + if( direction == RMobileCall::EMobileOriginated ) + { + User::LeaveIfError(RProperty::Set( + NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallDirection, + ( TInt ) NMusSessionInformationApi::ECallOrginated )); + } + else if ( direction == RMobileCall::EMobileTerminated ) + { + User::LeaveIfError(RProperty::Set( + NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallDirection, + ( TInt ) NMusSessionInformationApi::ECallTerminated )); + } + else + { + User::LeaveIfError(RProperty::Set( + NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallDirection, + ( TInt ) NMusSessionInformationApi::ENoDirection )); + } + + + /* Set the call provider information to some dummy Value */ + User::LeaveIfError(RProperty::Set( + NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMUSCallProvider, + KNullDesC)); + + MUS_LOG( "mus: [MUSAO] <- CMusCallMonitorBase::SetCallInfoL" ) + } + +// ----------------------------------------------------------------------------- +// CMusCallMonitorBase::RunError( TInt aError ) +// Implemented for CActive. +// Will be called automatically by framework when RunL Leaves. +// ----------------------------------------------------------------------------- +// + +TInt CMusCallMonitorBase::RunError( TInt aError ) + { + MUS_LOG1( "mus: [MUSAO] -> CMusCallMonitorBase::RunError, aError %d",\ + aError ) + aError = KErrNone; // just to avoid warnings. + MUS_LOG( "mus: [MUSAO] <- CMusCallMonitorBase::RunError" ) + return aError; + } + +// ----------------------------------------------------------------------------- +// CMusCallMonitorBase::NotifyCallStateChanged() +// Notify TSYobserver that our call status or call event state changed +// ----------------------------------------------------------------------------- +// +void CMusCallMonitorBase::NotifyCallStateChanged( NMusSessionInformationApi::TMusCallEvent aVal ) + { + RCall::TCallInfo callInfo; + iCall.GetInfo(callInfo); + iTsyObserver.NotifyCallStateChanged( aVal, callInfo.iCallName ); + } + + +// -------------------------------------------------------------------------------- +// CMusCallConferenceMonitor::IsDataReadyL() +// Checks if Data is ready CS Call. +// -------------------------------------------------------------------------------- + +TBool CMusCallMonitorBase::IsDataReadyL() + { + // This function need to be updated when new + // P/S key is published in Call monitor + + MUS_LOG( "mus: [MUSAO] -> CMusCallMonitorBase::IsDataReadyL" ) + + // Ensure there is tel Number. + HBufC* telNumInfo = HBufC::NewLC( RProperty::KMaxPropertySize ); + TPtr ptelInfo = telNumInfo->Des(); + TInt err = KErrNone; + + err = RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusTelNumber, + ptelInfo ); + + TBool telInfoExisit ( err == KErrNone && telNumInfo->Des().Length() > 0 ); + CleanupStack::PopAndDestroy( telNumInfo ); + + // Ensure Call direction info is there + TInt callDirection = NMusSessionInformationApi::ENoDirection; + err = RProperty::Get( + NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallDirection, + callDirection ); + + TBool callInfoExisit ( err == KErrNone && callDirection != NMusSessionInformationApi::ENoDirection ); + + MUS_LOG( "mus: [MUSAO] <- CMusCallMonitorBase::IsDataReadyL" ) + return telInfoExisit && callInfoExisit; + } + +// End of file + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/src/muscallstatusmonitor.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/src/muscallstatusmonitor.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,149 @@ +/* +* 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: Monitor the status of CS call +* +*/ + + +#include "muscallstatusmonitor.h" +#include "mussesseioninformationapi.h" +#include "muslogger.h" + +#include +#include + + +// ----------------------------------------------------------------------------- +// Symbian two-phase constructor. +// ----------------------------------------------------------------------------- +// +CMusCallStatusMonitor* CMusCallStatusMonitor::NewL( + const RMobileCall& aCall, + MMusTsyPropertyObserver& aObserver, + MMusCallStateObserver& aCallStateObserver ) + { + MUS_LOG( "mus: [MUSAO] -> CMusCallStatusMonitor::NewL" ) + CMusCallStatusMonitor* self = + new( ELeave )CMusCallStatusMonitor( aCall, aObserver, aCallStateObserver ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + MUS_LOG( "mus: [MUSAO] <- CMusCallStatusMonitor::NewL" ) + return self; + } + + +// ----------------------------------------------------------------------------- +// C++ destructor. +// ----------------------------------------------------------------------------- +// +CMusCallStatusMonitor::~CMusCallStatusMonitor() + { + MUS_LOG( "mus: [MUSAO] -> CMusCallStatusMonitor::~CMusCallStatusMonitor" ) + Cancel(); + MUS_LOG( "mus: [MUSAO] <- CMusCallStatusMonitor::~CMusCallStatusMonitor" ) + } + +// ----------------------------------------------------------------------------- +// Symbian second-phase constructor. +// ----------------------------------------------------------------------------- +// +void CMusCallStatusMonitor::ConstructL() + { + MUS_LOG( "mus: [MUSAO] -> CMusCallStatusMonitor::ConstructL" ) + CActiveScheduler::Add( this ); + User::LeaveIfError( iCall.GetMobileCallStatus(iCallStatus) ); + CheckStateL(); + iCall.NotifyMobileCallStatusChange( iStatus, iCallStatus ); + SetActive(); + MUS_LOG( "mus: [MUSAO] <- CMusCallStatusMonitor::ConstructL" ) + } + +// ----------------------------------------------------------------------------- +// C++ constructor. +// ----------------------------------------------------------------------------- +// +CMusCallStatusMonitor::CMusCallStatusMonitor( + const RMobileCall& aCall, + MMusTsyPropertyObserver& aObserver, + MMusCallStateObserver& aCallStateObserver ) + : CMusCallMonitorBase( aCall, aObserver, aCallStateObserver ) + { + } + + +// ----------------------------------------------------------------------------- +// CMusCallStatusMonitor::RunL() +// Implemented for CActive.It will be called any NotifyMobileLineStatusChange +// Event happens. +// ----------------------------------------------------------------------------- +// +void CMusCallStatusMonitor::RunL() + { + MUS_LOG( "mus: [MUSAO] -> CMusCallStatusMonitor::RunL" ) + iCall.NotifyMobileCallStatusChange( iStatus, iCallStatus ); + SetActive(); + CheckStateL(); + MUS_LOG( "mus: [MUSAO] <- CMusCallStatusMonitor::RunL" ) + } + + +// ----------------------------------------------------------------------------- +// CMusCallStatusMonitor::DoCancel() +// Implemented for CActive. +// Will be called when Cancel() method is called. +// ----------------------------------------------------------------------------- +// +void CMusCallStatusMonitor::DoCancel() + { + MUS_LOG( "mus: [MUSAO] -> CMusCallStatusMonitor::DoCancel" ) + iCall.CancelAsyncRequest( EMobileCallNotifyMobileCallStatusChange ); + MUS_LOG( "mus: [MUSAO] <- CMusCallStatusMonitor::DoCancel" ) + } + + +// ----------------------------------------------------------------------------- +// CMusCallStatusMonitor::SetIntialStateL() +// Sets the Call State to Property +// ----------------------------------------------------------------------------- +// + +void CMusCallStatusMonitor::CheckStateL() + { + MUS_LOG( "mus: [MUSAO] -> CMusCallStatusMonitor::CheckStateL" ) + MUS_LOG1( "mus: [MUSAO] Call->iCallStatus = %d", iCallStatus ) + switch ( iCallStatus ) + { + case RMobileCall::EStatusConnected: + SetStateL( NMusSessionInformationApi::ECallConnected ); + break; + case RMobileCall::EStatusDisconnecting: + case RMobileCall::EStatusDisconnectingWithInband: + SetStateL( NMusSessionInformationApi::ENoCall ); + // The following callback causes self deletion: + NotifyCallStateChanged( NMusSessionInformationApi::ENoCall ); + // Do not use the member variables after this point. + break; + case RMobileCall::EStatusHold: + SetStateL( NMusSessionInformationApi::ECallHold ); + break; + default: + break; // No actions + } + MUS_LOG( "mus: [MUSAO] <- CMusCallStatusMonitor::CheckStateL" ) + } + +// End of file + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/src/muspropertymonitor.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/src/muspropertymonitor.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,153 @@ +/* +* Copyright (c) 2005-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 to watch call monitor event properties +* +*/ + + +#include "muspropertymonitor.h" +#include "mussesseioninformationapi.h" +#include "muslogger.h" + + +// ----------------------------------------------------------------------------- +// Symbian two-phase constructor. +// ----------------------------------------------------------------------------- +// +CMusPropertyMonitor* CMusPropertyMonitor::NewL( MMusCallStateObserver& aCallStateObserver ) + { + MUS_LOG( "mus: [MUSAO] -> CMusPropertyMonitor::NewL" ) + CMusPropertyMonitor* self = new (ELeave) CMusPropertyMonitor( aCallStateObserver ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + MUS_LOG( "mus: [MUSAO] <- CMusPropertyMonitor::NewL" ) + return self; + } + +// ----------------------------------------------------------------------------- +// C++ constructor. +// ----------------------------------------------------------------------------- +// +CMusPropertyMonitor::CMusPropertyMonitor( MMusCallStateObserver& aCallStateObserver ) + :CActive( EPriorityNormal ), iCallStateObserver ( aCallStateObserver ) + { + } + +// ----------------------------------------------------------------------------- +// Symbian second-phase constructor. +// ----------------------------------------------------------------------------- +// +void CMusPropertyMonitor::ConstructL() + { + MUS_LOG( "mus: [MUSAO] -> CMusPropertyMonitor::ConstructL" ) + CActiveScheduler::Add(this); + User::LeaveIfError( + iPropertyEvent.Attach( + NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent ) ); + MUS_LOG( "mus: [MUSAO] Property attached to KMusCallEvent" ) + iPropertyEvent.Subscribe( iStatus ); + SetActive(); + MUS_LOG( "mus: [MUSAO] <- CMusPropertyMonitor::ConstructL" ) + } + +// ----------------------------------------------------------------------------- +// C++ destructor. +// ----------------------------------------------------------------------------- +// +CMusPropertyMonitor::~CMusPropertyMonitor() + { + MUS_LOG( "mus: [MUSAO] -> CMusPropertyMonitor::~CMusPropertyMonitor" ) + Cancel(); + iPropertyEvent.Close(); + MUS_LOG( "mus: [MUSAO] -> <- CMusPropertyMonitor::~CMusPropertyMonitor" ) + } + +// ----------------------------------------------------------------------------- +// CMusPropertyMonitor::RunL() +// Implemented for CActive.It will be called automatically +// when new property event occurs +// ----------------------------------------------------------------------------- +// +void CMusPropertyMonitor::RunL() + { + MUS_LOG( "mus: [MUSAO] -> CMusPropertyMonitor::RunL" ) + + // resubscribe before processing new value to prevent missing updates + iPropertyEvent.Subscribe( iStatus ); + SetActive(); + + //Check if preconditions are met to start or stop the MushClient. + iCallStateObserver.MusCallStateChanged(); + + MUS_LOG( "mus: [MUSAO] <- CMusPropertyMonitor::RunL" ) + } + + +// ----------------------------------------------------------------------------- +// CMusPropertyMonitor::DoCancel() +// Implemented for CActive.Will be called when Cancel() method called. +// ----------------------------------------------------------------------------- +// +void CMusPropertyMonitor::DoCancel() + { + MUS_LOG( "mus: [MUSAO] -> CMusPropertyMonitor::DoCancel" ) + iPropertyEvent.Cancel(); + MUS_LOG( "mus: [MUSAO] <- CMusPropertyMonitor::DoCancel" ) + } + +// ----------------------------------------------------------------------------- +// CMusPropertyMonitor::RunError() +// Implemented for CActive.It will be called automatically +// when a leave occurs in RunL() +// ----------------------------------------------------------------------------- +// +TInt CMusPropertyMonitor::RunError(TInt aError) + { + MUS_LOG1( "mus: [MUSAO] -> CMusPropertyMonitor::RunError = %d",aError ) + + // Monitoring Error Occurred, Terminate the MushSession. + TInt err = RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + NMusSessionInformationApi::ENoCall); + + iCallStateObserver.MusCallStateChanged(); + + aError = KErrNone; // We handled this error already. So return KErrNone. + MUS_LOG( "mus: [MUSAO] <- CMusPropertyMonitor::RunError " ) + return aError; + } + +// ----------------------------------------------------------------------------- +// CMusPropertyMonitor::IsCallConnected() +// Checks if the call is connected: +// ----------------------------------------------------------------------------- +// +TBool CMusPropertyMonitor::IsCallConnected() + { + MUS_LOG( "mus: [MUSAO] -> CMusPropertyMonitor::IsCallConnected" ) + TInt callState = ( TInt ) NMusSessionInformationApi::ENoCall; + TInt err = KErrNone; + + err = RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + callState ); + + MUS_LOG( "mus: [MUSAO] <- CMusPropertyMonitor::IsCallConnected" ) + + return ( err == KErrNone && callState != NMusSessionInformationApi::ENoCall ); + } + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/src/muspttcallmonitor.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/src/muspttcallmonitor.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,145 @@ +/* +* Copyright (c) 2005-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: Monitor that observes the status of the Kodiak PTT call +* +*/ + + +#include "muspttcallmonitor.h" +#include "muslogger.h" +#include + + +// -------------------------------------------------------------------------- +// Symbian two-phase constructor. +// -------------------------------------------------------------------------- +// +CMusPttCallMonitor* CMusPttCallMonitor::NewL(MMusPttEventObserver& aObserver) + { + MUS_LOG( "mus: [MUSAO] -> CMusPttCallMonitor::NewL" ) + CMusPttCallMonitor* self = new (ELeave) CMusPttCallMonitor(aObserver); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + MUS_LOG( "mus: [MUSAO] <- CMusPttCallMonitor::NewL" ) + return self; + } + + +// -------------------------------------------------------------------------- +// C++ destructor. +// -------------------------------------------------------------------------- +// +CMusPttCallMonitor::~CMusPttCallMonitor() + { + MUS_LOG( "mus: [MUSAO] -> CMusPttCallMonitor::~CMusPttCallMonitor" ) + Cancel(); + iPropertyEvent.Close(); + MUS_LOG( "mus: [MUSAO] <- CMusPttCallMonitor::~CMusPttCallMonitor" ) + } + + +// -------------------------------------------------------------------------- +// C++ constructor. +// -------------------------------------------------------------------------- +// +CMusPttCallMonitor::CMusPttCallMonitor(MMusPttEventObserver& aObserver) + :CActive( EPriorityNormal ),iObserver(aObserver) + { + + } + + +// -------------------------------------------------------------------------- +// Symbian second-phase constructor. +// -------------------------------------------------------------------------- +// +void CMusPttCallMonitor::ConstructL() + { + MUS_LOG( "mus: [MUSAO] -> CMusPttCallMonitor::ConstructL" ) + CActiveScheduler::Add(this); + + User::LeaveIfError( iPropertyEvent.Attach( + KPSUidCtsyCallInformation, + KCTsyKodiakPtt) ); + iPropertyEvent.Subscribe( iStatus ); + SetActive(); + + MUS_LOG( "mus: [MUSAO] <- CMusPttCallMonitor::ConstructL" ) + } + +// ----------------------------------------------------------------------------- +// CMusPttCallMonitor::RunL() +// ----------------------------------------------------------------------------- +// +void CMusPttCallMonitor::RunL() + { + MUS_LOG( "mus: [MUSAO] -> CMusPttCallMonitor::RunL" ) + // resubscribe before processing new value to prevent missing updates + + iPropertyEvent.Subscribe( iStatus ); + SetActive(); + TInt val = KErrNone; + User::LeaveIfError(iPropertyEvent.Get( val )); + iObserver.PttCallEventOccuredL((TPSCTsyKodiakPtt&)val); + + MUS_LOG( "mus: [MUSAO] <- CMusPttCallMonitor::RunL" ) + } + + +// ----------------------------------------------------------------------------- +// CMusPttCallMonitor::DoCancel() +// ----------------------------------------------------------------------------- +// +void CMusPttCallMonitor::DoCancel() + { + MUS_LOG( "mus: [MUSAO] -> CMusPttCallMonitor::DoCancel" ) + iPropertyEvent.Cancel(); + MUS_LOG( "mus: [MUSAO] <- CMusPttCallMonitor::DoCancel" ) + } + + +// ----------------------------------------------------------------------------- +// CMusPttCallMonitor::IsPTTCallExist() +// ----------------------------------------------------------------------------- +// +TBool CMusPttCallMonitor::IsPTTCallExist() + { + MUS_LOG( "mus: [MUSAO] -> CMusPttCallMonitor::IsPTTCallExist" ) + + TInt val = KErrNone; + TInt ret = iPropertyEvent.Get( val ); + MUS_LOG1( "mus: [MUSAO] iPropertyEvent.Get( val ) returns: %d",ret ) + MUS_LOG1( "mus: [MUSAO] <- CMusPttCallMonitor::IsPTTCallExist = %d",val ) + return ( val==EPSCTsyKodiakPttActive ) ? ETrue : EFalse; + } + +// ----------------------------------------------------------------------------- +// CMusCallEventMonitor::RunError( TInt aError ) +// Implemented for CActive. +// Will be called automatically by framework when RunL Leaves. +// ----------------------------------------------------------------------------- +// + +TInt CMusPttCallMonitor::RunError( TInt aError ) + { + MUS_LOG1( "mus: [MUSAO] -> CMusCallEventMonitor::RunError, aError %d", aError ) + aError = KErrNone; // just to avoid warnings. + MUS_LOG( "mus: [MUSAO] <- CMusCallEventMonitor::RunError" ) + return aError; + } + + + +//End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/src/mustsypropertymonitor.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/src/mustsypropertymonitor.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,681 @@ +/* +* Copyright (c) 2005-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: Monitor that observes the status of the current CS call +* +*/ + +#include "mussesseioninformationapi.h" +#include "mustsypropertymonitor.h" +#include "muscallconferencemonitor.h" +#include "muscallmonitor.h" +#include "musvoipcallmonitor.h" +#include "muslogger.h" +#include "musfactorysettings.h" + + +#include +#include +#include + + +// ----------------------------------------------------------------------------- +// Symbian two-phase constructor. +// ----------------------------------------------------------------------------- +// +CMusTsyPropertyMonitor* CMusTsyPropertyMonitor::NewL( RMobilePhone& aPhone, + MMusCallStateObserver& aCallStateObserver ) + { + MUS_LOG( "mus: [MUSAO] -> CMusTsyPropertyMonitor::NewL" ) + CMusTsyPropertyMonitor* self = new (ELeave) CMusTsyPropertyMonitor( aPhone, aCallStateObserver ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + MUS_LOG( "mus: [MUSAO] <- CMusTsyPropertyMonitor::NewL" ) + return self; + } + + +// ----------------------------------------------------------------------------- +// C++ destructor. +// ----------------------------------------------------------------------------- +// +CMusTsyPropertyMonitor::~CMusTsyPropertyMonitor() + { + MUS_LOG( "mus: [MUSAO] -> CMusTsyPropertyMonitor::~CMusTsyPropertyMonitor" ) + Cancel(); + delete iConferenceMonitor; + iCallMonitorArray.ResetAndDestroy(); + iCallMonitorArray.Close(); + RemoveAllVoipCallMonitors(); + iLine.Close(); + MUS_LOG( "mus: [MUSAO] <- CMusTsyPropertyMonitor::~CMusTsyPropertyMonitor" ) + } + +// ----------------------------------------------------------------------------- +// Symbian second-phase constructor. +// ----------------------------------------------------------------------------- +// +void CMusTsyPropertyMonitor::ConstructL() + { + MUS_LOG( "mus: [MUSAO] -> CMusTsyPropertyMonitor::ConstructL" ) + CActiveScheduler::Add(this); + User::LeaveIfError( iLine.Open( iPhone, KMmTsyVoice1LineName() ) ); + iConferenceMonitor = CMusCallConferenceMonitor::NewL( + iPhone,iLine,iCallMonitorArray); + User::LeaveIfError( iPropertyEvent.Attach( + KPSUidCtsyCallInformation, + KCTsyCallState ) ); + iPropertyEvent.Subscribe( iStatus ); + SetActive(); + MUS_LOG( "mus: [MUSAO] <- CMusTsyPropertyMonitor::ConstructL" ) + } + +// ----------------------------------------------------------------------------- +// C++ constructor. +// ----------------------------------------------------------------------------- +// +CMusTsyPropertyMonitor::CMusTsyPropertyMonitor(RMobilePhone& aPhone, MMusCallStateObserver& aCallStateObserver ) + : CActive( EPriorityNormal ),iPhone(aPhone), iCallStateObserver ( aCallStateObserver ) + { + } + +// ----------------------------------------------------------------------------- +// CMusTsyPropertyMonitor::RunL() +// Implemented for CActive.It will be called any NotifyMobileLineStatusChange +// Event happens. +// ----------------------------------------------------------------------------- +// +void CMusTsyPropertyMonitor::RunL() + { + MUS_LOG( "mus: [MUSAO] -> CMusTsyPropertyMonitor::RunL" ) + // subscribe , so that we dont miss any events. + iPropertyEvent.Subscribe( iStatus ); + SetActive(); + TPSCTsyCallState callState = EPSCTsyCallStateUninitialized; + User::LeaveIfError(iPropertyEvent.Get( (TInt&)callState )); + TPSCTsyCallType callType = EPSCTsyCallTypeUninitialized; + User::LeaveIfError(RProperty::Get(KPSUidCtsyCallInformation,KCTsyCallType, + (TInt&)callType)); + MUS_LOG1( "mus: [MUSAO] iTsyCallMonitor->CallState = %d",callState ) + switch(callState) + { + case EPSCTsyCallStateNone: + MUS_LOG( "mus: [MUSAO] EPSCTsyCallStateNone" ) + SetStateL(NMusSessionInformationApi::ENoCall); + // Sometimes disconnected call goes stright to this state + // so we have to call this function to remove call monitors. + MonitorCallL( callState,callType); + break; + case EPSCTsyCallStateDisconnecting: + MUS_LOG( "mus: [MUSAO] EPSCTsyCallStateDisconnecting" ) + MonitorCallL( callState,callType); + break; + case EPSCTsyCallStateAnswering: + MUS_LOG( "mus: [MUSAO] EPSCTsyCallStateAnswering" ) + MonitorCallL( callState,callType); + break; + case EPSCTsyCallStateConnected: + MUS_LOG( "mus: [MUSAO] EPSCTsyCallStateConnected" ) + MonitorCallL( callState,callType); + break; + case EPSCTsyCallStateHold: + MUS_LOG( "mus: [MUSAO] EPSCTsyCallStateHold" ) + SetStateL(NMusSessionInformationApi::ECallHold); + break; + default: + MUS_LOG( "mus: [MUSAO] Undesired CallState " ) + break; + } + MUS_LOG( "mus: [MUSAO] <- CMusTsyPropertyMonitor::RunL" ) + } + + +// ----------------------------------------------------------------------------- +// CMusTsyPropertyMonitor::DoCancel() +// Implemented for CActive. +// Will be called when Cancel() method is called. +// ----------------------------------------------------------------------------- +// +void CMusTsyPropertyMonitor::DoCancel() + { + MUS_LOG( "mus: [MUSAO] -> CMusTsyPropertyMonitor::DoCancel" ) + iPropertyEvent.Cancel(); + MUS_LOG( "mus: [MUSAO] <- CMusTsyPropertyMonitor::DoCancel" ) + } + +// ----------------------------------------------------------------------------- +// CMusTsyPropertyMonitor::RunError( TInt aError ) +// Implemented for CActive. +// Will be called automatically by framework when RunL Leaves. +// ----------------------------------------------------------------------------- +// +TInt CMusTsyPropertyMonitor::RunError( TInt aError ) + { + MUS_LOG1( "mus: [MUSAO] -> CMusTsyPropertyMonitor::RunError = %d", aError ) + aError = KErrNone; // Just to avoid compilation warnings. Dunno what we do. + MUS_LOG( "mus: [MUSAO] <- CMusTsyPropertyMonitor::RunError" ) + return aError; + } + +// ----------------------------------------------------------------------------- +// CMusTsyPropertyMonitor::AddCallMonitorL( TName aCallName ) +// Adds new call monitor if the call is not monitored already. +// ----------------------------------------------------------------------------- +// +void CMusTsyPropertyMonitor::AddCallMonitorL(TName& aCallName) + { + MUS_LOG_TDESC( "mus: [MUSAO] -> CMusTsyPropertyMonitor::AddCallMonitorL"\ + ,aCallName ) + TBool isCallExist = EFalse; + for ( TInt i = 0; i < iCallMonitorArray.Count() && !isCallExist; i++ ) + { + if( iCallMonitorArray[i]->IsEqual( aCallName ) ) + { + isCallExist = ETrue; + } + } + MUS_LOG1( "mus: [MUSAO] Call Exist = %d ",isCallExist ) + if( !isCallExist ) + { + CMusCallMonitor* callMonitor = CMusCallMonitor::NewL( aCallName, + IsPttCallExist() ); + CleanupStack::PushL( callMonitor ); + iCallMonitorArray.AppendL( callMonitor ); + CleanupStack::Pop( callMonitor ); + callMonitor->StartMonitorL(iLine, *this, iCallStateObserver ); + } + MUS_LOG( "mus: [MUSAO] <- CMusTsyPropertyMonitor::AddCallMonitorL" ) + } + + +// ----------------------------------------------------------------------------- +// CMusTsyPropertyMonitor::RemoveCallEventMonitorL( TName aCallName ) +// Remove the Call Monitor if it exist in array. +// ----------------------------------------------------------------------------- +// +void CMusTsyPropertyMonitor::RemoveCallMonitor( TName& aCallName ) + { + MUS_LOG_TDESC( "mus: [MUSAO] -> CMusTsyPropertyMonitor::RemoveCallMonitor " + ,aCallName ) + for ( TInt i = 0; i < iCallMonitorArray.Count(); i++ ) + { + if( iCallMonitorArray[i]->IsEqual( aCallName ) ) + { + delete iCallMonitorArray[i]; + iCallMonitorArray.Remove(i); + break; + } + } + MUS_LOG( "mus: [MUSAO] <- CMusTsyPropertyMonitor::RemoveCallMonitor" ) + } + +// ----------------------------------------------------------------------------- +// CMusTsyPropertyMonitor::RemoveCallEventMonitorL( TName aCallName ) +// Remove the Call Monitor if it exist in array. +// ----------------------------------------------------------------------------- +// +void CMusTsyPropertyMonitor::RemoveAllCallMonitor() + { + MUS_LOG( "mus: [MUSAO] -> CMusTsyPropertyMonitor::RemoveAllCallMonitor " ) + iCallMonitorArray.ResetAndDestroy(); + MUS_LOG( "mus: [MUSAO] <- CMusTsyPropertyMonitor::RemoveAllCallMonitor" ) + } +// ----------------------------------------------------------------------------- +// CMusTsyPropertyMonitor::IsPTTCallExist() +// Remove the Call Monitor if it exist in array. +// ----------------------------------------------------------------------------- +// +TBool CMusTsyPropertyMonitor::IsPttCallExist() + { + MUS_LOG( "mus: [MUSAO] -> CMusTsyPropertyMonitor::IsPTTCallExist") + TBool exist = EFalse; + /* + TInt val = 0; + TInt err = RProperty::Get(KPSUidCtsyCallInformation,KCTsyKodiakPtt,val ); + MUS_LOG2( "mus: [MUSAO] PTTCallValue = val Error = %d",val,err ) + if(!err && val== EPSCTsyKodiakPttActive ) + { + exist = ETrue; + } + else + { + // if there is an error dont know what to do. + // there could be cases like KodiakPTT is not supported + // So considering there is no PttCall. + exist = EFalse; + } + */ + MUS_LOG1( "mus: [MUSAO] <- CMusTsyPropertyMonitor::IsPTTCallExist = %d",\ + exist ) + return exist; + } + + +// ----------------------------------------------------------------------------- +// CMusTsyPropertyMonitor::IsPTTCallExist() +// Remove the Call Monitor if it exist in array. +// ----------------------------------------------------------------------------- +// + +// Enable the below line if Kodiak Ptt has to be monitered +/* +void CMusTsyPropertyMonitor::PttCallEventOccuredL( TPSCTsyKodiakPtt& aVal) + { + MUS_LOG1( "mus: [MUSAO] -> CMusTsyPropertyMonitor::PttCallEventOccured\ + = %d",aVal) + + + if (iCallMonitorArray.Count()>0) + { + if( aVal == EPSCTsyKodiakPttNotActive && iCallMonitorArray.Count()==1) + { + iCallMonitorArray[0]->StartMonitorL(iLine); + } + else + { + iCallMonitorArray[0]->StopMonitorL(); + } + } + else + { + // No CS call. Dont care this event. + } + MUS_LOG( "mus: [MUSAO] <- CMusTsyPropertyMonitor::PttCallEventOccured" ) + } +*/ + + +// ----------------------------------------------------------------------------- +// CMusTsyPropertyMonitor::SetStateL( TInt aError ) +// Sets the Call State to Property +// ----------------------------------------------------------------------------- +// +void CMusTsyPropertyMonitor::SetStateL( + NMusSessionInformationApi::TMusCallEvent aVal) + { + MUS_LOG1( "mus: [MUSAO] -> CMusTsyPropertyMonitor::SetStateL,aVal %d",aVal ) + TInt currentVal; + User::LeaveIfError(RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent,currentVal)); + if(currentVal != (TInt)aVal) + { + User::LeaveIfError(RProperty::Set( + NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + aVal )); + } + else + { + // No point of reporting it . + } + MUS_LOG( "mus: [MUSAO] <- CMusTsyPropertyMonitor::SetStateL" ) + } + +// ----------------------------------------------------------------------------- +// CMusTsyPropertyMonitor::MonitorCallL() +// Decides which call monitor (CS,VOIP etc ) has to be called. +// ----------------------------------------------------------------------------- +// +void CMusTsyPropertyMonitor::MonitorCallL( const TPSCTsyCallState& aCallState, + const TPSCTsyCallType& aCallType) + { + MUS_LOG( "mus: [MUSAO] -> CCMusTsyPropertyMonitor::MonitorCallL" ) + switch( aCallType ) + { + case EPSCTsyCallTypeUninitialized: + case EPSCTsyCallTypeNone: + case EPSCTsyCallTypeFax: + case EPSCTsyCallTypeData: + case EPSCTsyCallTypeHSCSD: + case EPSCTsyCallTypeH324Multimedia: + break;// dont care + case EPSCTsyCallTypeCSVoice: + MonitorCSCallL(); + break; + case EPSCTsyCallTypeVoIP: + { + // if error occured when reading factory setting key + // behave default ie all calls supported. + TBool supported = ETrue; + TRAP_IGNORE( supported = MusFactorySettings::IsSupportedL( aCallType ) ) + if( supported) + { + MonitorVoipCallL( aCallState ); + } + break; + } + default: + break; + } + // Check now for multimediasharing call criteria. + CheckCallCriteriaL(); + MUS_LOG( "mus: [MUSAO] <- CCMusTsyPropertyMonitor::MonitorCallL" ) + } +// ----------------------------------------------------------------------------- +// CMusTsyPropertyMonitor::MonitorCSCallL() +// Monitors the CS call and if needed adds/removes call monitor. +// ----------------------------------------------------------------------------- +// +void CMusTsyPropertyMonitor::MonitorCSCallL() + { + MUS_LOG( "mus: [MUSAO] -> CMusTsyPropertyMonitor::MonitorCallL") + TInt callCount; + iLine.EnumerateCall(callCount); + MUS_LOG1( "mus: [MUSAO] -> callCount = %d",callCount) + RLine::TCallInfo callInfo; + for(TInt i=0;i CMusTsyPropertyMonitor::MonitorVoipCallL") + // TODO : Call Name should be read from covergence api [CCE/CCH] + // which is not available as of now 22-Dec-2008 + TName callName(_L("Voip 1")); + switch(aCallState) + { + case EPSCTsyCallStateDisconnecting: + MUS_LOG( "mus: [MUSAO] EPSCTsyCallStateDisconnecting" ) + RemoveVoipCallMonitor(callName); + break; + case EPSCTsyCallStateAnswering: + case EPSCTsyCallStateConnected: + MUS_LOG( "mus: [MUSAO] EPSCTsyCallStateAnswering/EPSCTsyCallStateConnected" ) + AddVoipCallMonitorL(callName); + break; + default: + break; + } + MUS_LOG( "mus: [MUSAO] <- CMusTsyPropertyMonitor::MonitorVoipCallL") + } + +// ----------------------------------------------------------------------------- +// CMusTsyPropertyMonitor::AddVoipCallMonitorL( TName aCallName ) +// Adds new voip call monitor if the call is not monitored already. +// ----------------------------------------------------------------------------- +// +void CMusTsyPropertyMonitor::AddVoipCallMonitorL(TName& aCallName) + { + MUS_LOG_TDESC( "mus: [MUSAO] -> CMusTsyPropertyMonitor::AddCallMonitorL"\ + ,aCallName ) + TBool isCallExist = EFalse; + for ( TInt i = 0; i < iVoipCallMonitorArray.Count() && !isCallExist; i++ ) + { + if( iVoipCallMonitorArray[i]->IsEqual( aCallName ) ) + { + isCallExist = ETrue; + } + } + MUS_LOG1( "mus: [MUSAO] Call Exist = %d ",isCallExist ) + if( !isCallExist ) + { + CMusVoipCallMonitor* callMonitor = + CMusVoipCallMonitor::NewL( aCallName, iCallStateObserver ); + CleanupStack::PushL( callMonitor ); + iVoipCallMonitorArray.AppendL( callMonitor ); + CleanupStack::Pop( callMonitor ); + } + MUS_LOG( "mus: [MUSAO] <- CMusTsyPropertyMonitor::AddCallMonitorL" ) + } + + +// ----------------------------------------------------------------------------- +// CMusTsyPropertyMonitor::RemoveCallEventMonitorL( TName aCallName ) +// Remove the Call Monitor if it exist in array. +// ----------------------------------------------------------------------------- +// +void CMusTsyPropertyMonitor::RemoveVoipCallMonitor( TName& aCallName ) + { + MUS_LOG_TDESC( "mus: [MUSAO] -> CMusTsyPropertyMonitor::RemoveCallMonitor " + ,aCallName ) + for ( TInt i = 0; i < iVoipCallMonitorArray.Count(); i++ ) + { + if( iVoipCallMonitorArray[i]->IsEqual( aCallName ) ) + { + delete iVoipCallMonitorArray[i]; + iVoipCallMonitorArray.Remove(i); + break; + } + } + MUS_LOG( "mus: [MUSAO] <- CMusTsyPropertyMonitor::RemoveCallMonitor" ) + } + +// ----------------------------------------------------------------------------- +// CMusTsyPropertyMonitor::RemoveAllVoipCallMonitors +// Remove all voip call monitors +// ----------------------------------------------------------------------------- +// +void CMusTsyPropertyMonitor::RemoveAllVoipCallMonitors( ) + { + MUS_LOG( "mus: [MUSAO] -> CMusTsyPropertyMonitor::RemoveAllVoipCallMonitors ") + iVoipCallMonitorArray.ResetAndDestroy(); + iVoipCallMonitorArray.Close(); + MUS_LOG( "mus: [MUSAO] <- CMusTsyPropertyMonitor::RemoveAllVoipCallMonitors" ) + } + +// ----------------------------------------------------------------------------- +// CMusTsyPropertyMonitor::CheckCallCriteria +// Checks the Multimediasharing call criterias +// ----------------------------------------------------------------------------- +// +void CMusTsyPropertyMonitor::CheckCallCriteriaL() + { + TInt csCall = iCallMonitorArray.Count(); + TInt voipCall = iVoipCallMonitorArray.Count(); + switch( csCall ) + { + case 0 : + { + switch( voipCall ) + { + /* No cs call or voip call */ + case 0 : + { + User::LeaveIfError( + RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + 0 )); + SetStateL(NMusSessionInformationApi::ENoCall); + break; + } + /* No cs call but one voip call */ + case 1 : + { + iVoipCallMonitorArray[0]-> + SetStateL(NMusSessionInformationApi::ECallConnected); + break; + } + /* No cs call but more than one voip call */ + default: SetStateL(NMusSessionInformationApi::ECallHold); + break; + } + break; + } + case 1 : + { + switch( voipCall ) + { + /* One cs call but no voip call */ + case 0 : break;// Will be handled by cs call monitors. + /* One cs call and one or more voip calls */ + default : SetStateL(NMusSessionInformationApi::ECallHold); + break; + } + break; + } + default: // 2 or more CS calls + { + /* Sometimes when call get disconnected then call object disappears.So + * check the call state or open the call , if there is an error or undesired + * call state , remove that callmonitor from array. + */ + RemoveUnUsedCallMonitors(); + + /* It is already multicall so atleast one should be under hold. + * so set the state first to hold and then let the conference + * monitor decide the conference state. + */ + SetStateL(NMusSessionInformationApi::ECallHold); + + /* Still we dont know here about conference state so + * let the conference call monitor decide . + */ + iConferenceMonitor->SetStateL(); + break; + } + } + } + + +// ----------------------------------------------------------------------------- +// CMusTsyPropertyMonitor::CallStatusL() +// Somehow Line is not returning correct call info when call disconnected from +// remote,So open the call and ask call status +// ----------------------------------------------------------------------------- +// +RMobileCall::TMobileCallStatus CMusTsyPropertyMonitor::CallStatus(const TDesC& aCallName) + { + MUS_LOG_TDESC( "mus: [MUSAO] -> CMusTsyPropertyMonitor::CallStatusL",aCallName) + RMobileCall call; + TInt error = call.OpenExistingCall( iLine, aCallName ); + RMobileCall::TMobileCallStatus callStatus = RMobileCall::EStatusUnknown; + if(error==KErrNone) + { + // if error occur here , then leave the status to default. + call.GetMobileCallStatus(callStatus); + } + call.Close(); + MUS_LOG1( "mus: [MUSAO] <- CMusTsyPropertyMonitor::CallStatusL = %d",callStatus) + return callStatus; + } + +// ----------------------------------------------------------------------------- +// CMusTsyPropertyMonitor::RemoveUnUsedCallMonitors() +// ----------------------------------------------------------------------------- +// +void CMusTsyPropertyMonitor:: RemoveUnUsedCallMonitors() + { + MUS_LOG( "mus: [MUSAO] -> CMusTsyPropertyMonitor::RemoveUnUsedCallMonitors" ) + for ( TInt i = 0; i < iCallMonitorArray.Count(); i++ ) + { + if( CallStatus( iCallMonitorArray[i]->Name() ) == + RMobileCall::EStatusUnknown ) + { + MUS_LOG_TDESC("mus: [MUSAO] Removing = ",iCallMonitorArray[i]->Name()); + delete iCallMonitorArray[i]; + iCallMonitorArray[i] = NULL; + iCallMonitorArray.Remove(i); + // this lowers the call monitor index by one , so lower the i by one too + i--; + } + } + MUS_LOG( "mus: [MUSAO] <- CMusTsyPropertyMonitor::RemoveUnUsedCallMonitors" ) + } + +// ----------------------------------------------------------------------------- +// CMusTsyPropertyMonitor::NotifyCallStateChanged() +// ----------------------------------------------------------------------------- +// +void CMusTsyPropertyMonitor::NotifyCallStateChanged(NMusSessionInformationApi::TMusCallEvent aVal, TName& aCallName) + { + MUS_LOG( "mus: [MUSAO] -> CMusTsyPropertyMonitor::NotifyCallStateChanged" ) + + if(aVal == NMusSessionInformationApi::ENoCall ) + { + // Call has been disconnected, + // Remove call monitor from array + RemoveCallMonitor(aCallName); + if( iCallMonitorArray.Count() == 0 ) + { + SetStateL(NMusSessionInformationApi::ENoCall); + } + else if( iCallMonitorArray.Count() == 1) + { + // Only one call left, set its state to be ECallConnected here + // The real state of the call will be calculated by CMusCallMonitorBase + iCallMonitorArray[0]->SetStateL(NMusSessionInformationApi::ECallConnected); + } + else + { + // it is already multicall so atleast one should be hold. + // so set the state first to hold + SetStateL(NMusSessionInformationApi::ECallHold); + // still we dont know here about conference state so + // let the conference call monitor decide . + iConferenceMonitor->SetStateL(); + } + } + + MUS_LOG( "mus: [MUSAO] <- CMusTsyPropertyMonitor::NotifyCallStateChanged" ) + } + + + +// ----------------------------------------------------------------------------- +// CMusTsyPropertyMonitor::IsDataReadyL +// ----------------------------------------------------------------------------- +// +TBool CMusTsyPropertyMonitor::IsDataReadyL() + { + MUS_LOG( "mus: [MUSAO] -> CMusTsyPropertyMonitor::IsDataReadyL" ) + + TBool dataReady = EFalse; + TInt csCall = iCallMonitorArray.Count(); + TInt voipCall = iVoipCallMonitorArray.Count(); + + // In case of Conference Notify that data is ready. + if ( iConferenceMonitor->GetConfStatus() != RMobileConferenceCall::EConferenceIdle ) + { + MUS_LOG( "mus: [MUSAO] Conference CASE" ) + dataReady = ETrue; + } + else if ( csCall == 1 && !voipCall ) + { + MUS_LOG( "mus: [MUSAO] CS CALL" ) + dataReady = iCallMonitorArray[0]->IsDataReadyL(); + } + else if ( voipCall == 1 && !csCall ) + { + MUS_LOG( "mus: [MUSAO] VOIP CALL" ) + dataReady = iVoipCallMonitorArray[0]->IsDataReadyL(); + } + + MUS_LOG1( "mus: [MUSAO] <- CMusTsyPropertyMonitor::IsDataReadyL = %d",dataReady) + return dataReady; + } + +// End of file + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/src/musvoipcallmonitor.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/src/musvoipcallmonitor.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,502 @@ +/* +* Copyright (c) 2005-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: Monitors the VOIP calls. +* +*/ + + +#include +#include + +// Call Information API +#include + +// SP Settings +#include +#include +#include +#include + +#include "musvoipcallmonitor.h" +#include "mussesseioninformationapi.h" +#include "muslogger.h" + +const TUint KMusAoRemoteInfoMonitoringTimeout = 2000000; // 2 seconds +_LIT( KSipAt, "@" ); + +// ----------------------------------------------------------------------------- +// Symbian two-phase constructor. +// ----------------------------------------------------------------------------- +// +CMusVoipCallMonitor* CMusVoipCallMonitor::NewL( TName& aCallName, + MMusCallStateObserver& aCallStateObserver ) + { + MUS_LOG( "mus: [MUSAO] -> CMusVoipCallMonitor::NewL" ) + CMusVoipCallMonitor* self = + new (ELeave) CMusVoipCallMonitor( aCallName, aCallStateObserver ); + CleanupStack::PushL( self ); + self->ConstructL( ); + CleanupStack::Pop( self ); + MUS_LOG( "mus: [MUSAO] <- CMusVoipCallMonitor::NewL" ) + return self; + } + + +// ----------------------------------------------------------------------------- +// C++ destructor. +// ----------------------------------------------------------------------------- +// +CMusVoipCallMonitor::~CMusVoipCallMonitor() + { + MUS_LOG( "mus: [MUSAO] -> CMusVoipCallMonitor::~CMusVoipCallMonitor" ) + + ResetCallProviderName(); + + StopRemoteInfoMonitoring(); + + iPropertyEvent.Close(); + + delete iGuardTimer; + + MUS_LOG( "mus: [MUSAO] <- CMusVoipCallMonitor::~CMusVoipCallMonitor" ) + } + + +// ----------------------------------------------------------------------------- +// C++ constructor. +// ----------------------------------------------------------------------------- +// +CMusVoipCallMonitor::CMusVoipCallMonitor( TName& aCallName, + MMusCallStateObserver& aCallStateObserver ): + CActive( CActive::EPriorityStandard ), + iCallName ( aCallName ), + iCallStateObserver ( aCallStateObserver ), + iGuardTimerCallBack( GuardTimerExpired, this ) + { + CActiveScheduler::Add( this ); + + iGuardTimerEntry.Set( iGuardTimerCallBack ); + } + + +// ----------------------------------------------------------------------------- +// Symbian second-phase constructor. +// ----------------------------------------------------------------------------- +// +void CMusVoipCallMonitor::ConstructL( ) + { + MUS_LOG( "mus: [MUSAO] -> CMusVoipCallMonitor::ConstructL" ) + + User::LeaveIfError( iPropertyEvent.Attach( + KPSUidTelRemotePartyInformation, + KTelCLINumber ) ); + + iGuardTimer = CDeltaTimer::NewL( CActive::EPriorityStandard ); + + MUS_LOG( "mus: [MUSAO] <- CMusVoipCallMonitor::ConstructL" ) + } + +// ----------------------------------------------------------------------------- +// CMusVoipCallMonitor::SetStateL( ) +// Sets the call state property key.See mussesseioninformationapi.h +// Also sets the call information if call state is Connected. +// If call is connected but remote info cannot be found, information +// publishing is delayed until remote info comes available or monitoring +// for the info timeouts. In voip case, remote info should be basically +// always available, but in some cases it is not immediately available +// when call status changes to connected. +// ----------------------------------------------------------------------------- +// +void CMusVoipCallMonitor::SetStateL(NMusSessionInformationApi::TMusCallEvent aVal) + { + MUS_LOG1( "mus: [MUSAO] -> CMusVoipCallMonitor::SetStateL, aVal %d", aVal ) + // set the call state only if the call count is one else it should be decided + // by conference monitor or line/tsy monitor. + + TBool delayStateChange( EFalse ); + if ( aVal == NMusSessionInformationApi::ECallConnected ) + { + if ( !RemoteInfoExistsL() ) + { + MonitorForRemoteInfoL(); + delayStateChange = ETrue; + } + } + else + { + StopRemoteInfoMonitoring(); + } + + if ( delayStateChange ) + { + MUS_LOG( "mus: [MUSAO] state change delayed!" ) + } + else + { + ReportStateChangeL( aVal ); + } + + MUS_LOG( "mus: [MUSAO] <- CMusVoipCallMonitor::SetStateL" ) + } + +///----------------------------------------------------------------------------- +// CMusVoipCallMonitor::SetCallInfoL( ) +// ----------------------------------------------------------------------------- +// +void CMusVoipCallMonitor::SetCallInfoL() + { + MUS_LOG( "mus: [MUSAO] -> CMusVoipCallMonitor::SetCallInfoL") + + // Set Call Provider Information + TUint32 serviceId = CallServiceIdL(); + SetCallProviderInfoL( serviceId ); + + HBufC* remoteUri = HBufC::NewLC( RProperty::KMaxPropertySize ); + TPtr rUri = remoteUri->Des(); + TInt err = RProperty::Get( KPSUidTelRemotePartyInformation, + KTelCLINumber, + rUri ); + + if ( err == KErrNone && remoteUri->Des().Length() > 0 ) + { + MUS_LOG_TDESC( "mus: [MUSAO] voip remote name: ", remoteUri->Des()); + + // Add "sip:" prefix to remoteUri unless it already exists + _LIT( KSipPrefix, "sip:" ); + TPtr prefix = remoteUri->Des().LeftTPtr( KSipPrefix().Length() ); + if ( prefix.Compare( KSipPrefix ) != 0 ) + { + if ( remoteUri->Des().Length() + KSipPrefix().Length() > + remoteUri->Des().MaxLength() ) + { + User::Leave( KErrOverflow ); + } + remoteUri->Des().Insert( 0, KSipPrefix ); + } + //if domain not present, add domain from voip profile (username) + if ( remoteUri->Find( KSipAt ) == KErrNotFound ) + { + rUri.Set( remoteUri->Des() ); + AddDomainFromOwnUsernameL( serviceId, rUri ); + MUS_LOG_TDESC ( "mus: [MUSAO] full voip remote name:", (*remoteUri) ) + } + } + else + { + remoteUri->Des().Zero(); + } + + User::LeaveIfError( RProperty::Set( + NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusTelNumber, remoteUri->Des() ) ); + + CleanupStack::PopAndDestroy(remoteUri); + MUS_LOG( "mus: [MUSAO] <- CMusVoipCallMonitor::SetCallInfoL" ) + } + +///----------------------------------------------------------------------------- +// CMusVoipCallMonitor::AddDomainFromOwnUsernameL( ) +// ----------------------------------------------------------------------------- +// +void CMusVoipCallMonitor::AddDomainFromOwnUsernameL( + TUint32 /*aServiceId*/, + TDes16& /*aUri*/ ) + { + MUS_LOG( "mus: [MUSAO] -> CMusVoipCallMonitor::AddDomainFromOwnUsernameL") + MUS_LOG( "mus: [MUSAO] -> CMusVoipCallMonitor::AddDomainFromOwnUsernameL, NOT SUPPORTED") + MUS_LOG( "mus: [MUSAO] <- CMusVoipCallMonitor::AddDomainFromOwnUsernameL") + } + +///----------------------------------------------------------------------------- +// CMusVoipCallMonitor::CallServiceIdL( ) +// ----------------------------------------------------------------------------- +// +TUint32 CMusVoipCallMonitor::CallServiceIdL() + { + MUS_LOG( "mus: [MUSAO] -> CMusVoipCallMonitor::CallServiceIdL") + TUint32 serviceId( 0 ); + MUS_LOG( "mus: [MUSAO] <- CMusVoipCallMonitor::CallServiceIdL, NOT SUPPORTED") + MUS_LOG( "mus: [MUSAO] <- CMusVoipCallMonitor::CallServiceIdL") + return serviceId; + } + +///----------------------------------------------------------------------------- +// CMusVoipCallMonitor::SetCallProviderInfoL( ) +// ----------------------------------------------------------------------------- +// +void CMusVoipCallMonitor::SetCallProviderInfoL( TUint32 aServiceId ) + { + MUS_LOG( "mus: [MUSAO] -> CMusVoipCallMonitor::SetCallProviderInfoL") + CSPSettings* settings = CSPSettings::NewLC(); + CSPEntry* entry = CSPEntry::NewLC(); + + TInt errorCode = settings->FindEntryL( aServiceId, *entry ); + + if ( errorCode == KErrNone && entry != NULL ) + { + const TDesC& name = entry->GetServiceName(); + + MUS_LOG_TDESC ( "mus: [MUSAO]] CallProviderName IS -->", name ) + User::LeaveIfError(RProperty::Set( + NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMUSCallProvider, + name)); + } + + CleanupStack::PopAndDestroy( entry ); + CleanupStack::PopAndDestroy( settings ); + MUS_LOG( "mus: [MUSAO] <- CMusVoipCallMonitor::SetCallProviderInfoL" ) + } + + +// ----------------------------------------------------------------------------- +// Checks the aName is equal to this monitors name. +// @return ETrue if matches else EFalse +// ----------------------------------------------------------------------------- +// +TBool CMusVoipCallMonitor::IsEqual(TName& aName) + { + MUS_LOG( "mus: [MUSAO] -> CMusVoipCallMonitor::IsEqual" ) + MUS_LOG_TDESC( "mus: [MUSAO] -> aName : ", aName ); + MUS_LOG_TDESC( "mus: [MUSAO] -> iCallName : ", iCallName ); + TBool val = EFalse ; + val = ( aName == iCallName ); + MUS_LOG1( "mus: [MUSAO] <- CMusCallMonitor::IsEqual = %d",val ) + return val; + } + +// ----------------------------------------------------------------------------- +// CMusVoipCallMonitor::RunL +// ----------------------------------------------------------------------------- +// +void CMusVoipCallMonitor::RunL() + { + MUS_LOG( "mus: [MUSAO] -> CMusVoipCallMonitor::RunL" ) + + if ( RemoteInfoExistsL() ) + { + // Connected state reporting was delayed because not having + // remote info, now it can be reported and monitoring is not needed anymore + StopRemoteInfoMonitoring(); + ReportStateChangeL( NMusSessionInformationApi::ECallConnected ); + } + else + { + // resubscribe + iPropertyEvent.Subscribe( iStatus ); + SetActive(); + } + + MUS_LOG( "mus: [MUSAO] <- CMusVoipCallMonitor::RunL" ) + } + + +// ----------------------------------------------------------------------------- +// CMusVoipCallMonitor::DoCancel +// ----------------------------------------------------------------------------- +// +void CMusVoipCallMonitor::DoCancel() + { + MUS_LOG( "mus: [MUSAO] -> CMusVoipCallMonitor::DoCancel" ) + + iPropertyEvent.Cancel(); + + MUS_LOG( "mus: [MUSAO] <- CMusVoipCallMonitor::DoCancel" ) + } + +// ----------------------------------------------------------------------------- +// CMusVoipCallMonitor::RunError +// ----------------------------------------------------------------------------- +// +TInt CMusVoipCallMonitor::RunError( TInt aError ) + { + MUS_LOG1( "mus: [MUSAO] -> CMusVoipCallMonitor::RunError = %d", aError ) + if ( aError != KErrNoMemory ) + { + aError = KErrNone; + } + MUS_LOG( "mus: [MUSAO] <- CMusVoipCallMonitor::RunError" ) + return aError; + } + +// ----------------------------------------------------------------------------- +// CMusVoipCallMonitor::RemoteInfoExistsL +// ----------------------------------------------------------------------------- +// +TBool CMusVoipCallMonitor::RemoteInfoExistsL() + { + MUS_LOG( "mus: [MUSAO] -> CMusVoipCallMonitor::RemoteInfoExistsL" ) + + HBufC* remoteUri = HBufC::NewLC(RProperty::KMaxPropertySize); + TPtr rUri = remoteUri->Des(); + + TInt err = RProperty::Get( KPSUidTelRemotePartyInformation, + KTelCLINumber, + rUri ); + + TBool remoteInfoExists( err == KErrNone && remoteUri->Des().Length() > 0 ); + CleanupStack::PopAndDestroy(remoteUri); + + MUS_LOG1( "mus: [MUSAO] <- CMusVoipCallMonitor::RemoteInfoExistsL = %d", + remoteInfoExists ) + + return remoteInfoExists; + } + +// ----------------------------------------------------------------------------- +// CMusVoipCallMonitor::MonitorForRemoteInfoL +// Start monitoring remote info P&S key. Guard timer is started +// to prevent waiting for the infomation forever. +// ----------------------------------------------------------------------------- +// +void CMusVoipCallMonitor::MonitorForRemoteInfoL() + { + MUS_LOG( "mus: [MUSAO] -> CMusVoipCallMonitor::MonitorForRemoteInfoL" ) + + if ( !IsActive() ) + { + MUS_LOG( "mus: [MUSAO] activate" ) + + iGuardTimer->Remove( iGuardTimerEntry ); + TTimeIntervalMicroSeconds32 interval( KMusAoRemoteInfoMonitoringTimeout ); + iGuardTimer->Queue( interval, iGuardTimerEntry ); + + iPropertyEvent.Subscribe( iStatus ); + SetActive(); + } + + MUS_LOG( "mus: [MUSAO] <- CMusVoipCallMonitor::MonitorForRemoteInfoL" ) + } + +// ----------------------------------------------------------------------------- +// CMusVoipCallMonitor::MonitorForRemoteInfoL +// ----------------------------------------------------------------------------- +// +void CMusVoipCallMonitor::StopRemoteInfoMonitoring() + { + MUS_LOG( "mus: [MUSAO] -> CMusVoipCallMonitor::StopRemoteInfoMonitoring" ) + + if ( iGuardTimer ) + { + iGuardTimer->Remove( iGuardTimerEntry ); + } + + Cancel(); + + MUS_LOG( "mus: [MUSAO] <- CMusVoipCallMonitor::StopRemoteInfoMonitoring" ) + } + +// ----------------------------------------------------------------------------- +// CMusVoipCallMonitor::ReportStateChangeL +// ----------------------------------------------------------------------------- +// +void CMusVoipCallMonitor::ReportStateChangeL( + NMusSessionInformationApi::TMusCallEvent aVal ) + { + MUS_LOG( "mus: [MUSAO] -> CMusVoipCallMonitor::ReportStateChangeL" ) + + TInt currentVal = 0; + User::LeaveIfError(RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + currentVal)); + + + // Report only if the value changed else do not publish. + if(currentVal != (TInt)aVal) + { + User::LeaveIfError(RProperty::Set( + NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + aVal )); + } + // When call is connected and the callcount is one, + // set the call informations. + if( aVal==NMusSessionInformationApi::ECallConnected ) + { + SetCallInfoL(); + } + + iCallStateObserver.MusCallStateChanged(); + MUS_LOG( "mus: [MUSAO] <- CMusVoipCallMonitor::ReportStateChangeL" ) + } + +// ----------------------------------------------------------------------------- +// CMusVoipCallMonitor::GuardTimerExpired +// If timer expired, it took too long to get remote party information via +// P&S monitoring. Because of monitoring, call connected was not yet informed, +// inform it now. +// ----------------------------------------------------------------------------- +// +TInt CMusVoipCallMonitor::GuardTimerExpired( TAny* aPtr ) + { + MUS_LOG( "mus: [MUSAO] -> CMusVoipCallMonitor::GuardTimerExpired" ) + if ( aPtr ) + { + CMusVoipCallMonitor* self = reinterpret_cast( aPtr ); + self->StopRemoteInfoMonitoring(); + TRAP_IGNORE( + self->ReportStateChangeL( NMusSessionInformationApi::ECallConnected ) ) + } + MUS_LOG( "mus: [MUSAO] <- CMusVoipCallMonitor::GuardTimerExpired" ) + + return KErrNone; + } + +// -------------------------------------------------------------------------------- +// CMusCallConferenceMonitor::IsDataReadyL() +// Checks if Data is ready VoIP Call. +// -------------------------------------------------------------------------------- + +TBool CMusVoipCallMonitor::IsDataReadyL() + { + //This function need to updated if some other P/S Key is published + //to ensure correct behaviour. + + MUS_LOG( "mus: [MUSAO] -> CMusVoipCallMonitor::IsDataReadyL" ) + + // Ensure Provider Information is Availble. + HBufC* providerInfo = HBufC::NewLC( RProperty::KMaxPropertySize ); + TPtr pInfo = providerInfo->Des(); + TInt err = KErrNone; + + err = RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMUSCallProvider, + pInfo ); + + TBool providerInfoExisit ( err == KErrNone && providerInfo->Des().Length() > 0 ); + CleanupStack::PopAndDestroy( providerInfo ); + + MUS_LOG( "mus: [MUSAO] <- CMusVoipCallMonitor::IsDataReadyL" ) + return !IsActive() && providerInfoExisit; + } + + +// -------------------------------------------------------------------------------- +// Reset the Call Provider Information. +// -------------------------------------------------------------------------------- + +void CMusVoipCallMonitor::ResetCallProviderName( ) + { + MUS_LOG( "mus: [MUSAO] <- CMusVoipCallMonitor::ResetCallProviderName" ) + TInt errorCode = RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMUSCallProvider, + KNullDesC ); + + // Error Code is just for debug only + MUS_LOG1( "mus: [MUSAO] ErrorCode = %d", errorCode ) + MUS_LOG( "mus: [MUSAO] <- CMusVoipCallMonitor::ResetCallProviderName" ) + } + + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/BMARM/ut_aopluginu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/BMARM/ut_aopluginu.def Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,2 @@ +EXPORTS + CreateTestSuiteL__Fv @ 1 NONAME R3UNUSED ; CreateTestSuiteL(void) diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/BWINS/ut_aopluginu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/BWINS/ut_aopluginu.def Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,3 @@ +EXPORTS + ?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 1 NONAME ; class MEUnitTest * CreateTestSuiteL(void) + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/EABI/ut_aopluginu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/EABI/ut_aopluginu.def Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,137 @@ +EXPORTS + _Z16CreateTestSuiteLv @ 1 NONAME + _Z24ImplementationGroupProxyRi @ 2 NONAME + _ZN10RTelServer7ConnectEi @ 3 NONAME + _ZN10RTelServerC1Ev @ 4 NONAME + _ZN10RTelServerC2Ev @ 5 NONAME + _ZN11CMusManager10SetUseCaseEN17MultimediaSharing11TMusUseCaseE @ 6 NONAME + _ZN11CMusManager13AvailabilityLEv @ 7 NONAME + _ZN11CMusManager13SetStartErrorEi @ 8 NONAME + _ZN11CMusManager14HandleCommandLEN17MultimediaSharing12TCommandTypeE @ 9 NONAME + _ZN11CMusManager15SetAvailabilityEi @ 10 NONAME + _ZN11CMusManager16CancelMonitoringEv @ 11 NONAME + _ZN11CMusManager16StopApplicationLEv @ 12 NONAME + _ZN11CMusManager17HandleSipRequestLENS_12TRequestTypeE @ 13 NONAME + _ZN11CMusManager17StartApplicationLEN17MultimediaSharing11TMusUseCaseE @ 14 NONAME + _ZN11CMusManager20ExamineAvailabilityLEv @ 15 NONAME + _ZN11CMusManager20MonitorAvailabilityLER14TRequestStatusRN17MultimediaSharing22TMusAvailabilityStatusE @ 16 NONAME + _ZN11CMusManager4NewLEv @ 17 NONAME + _ZN11CMusManager5NewLCEv @ 18 NONAME + _ZN11CMusManager7UseCaseEv @ 19 NONAME + _ZN11CRepository16StartTransactionENS_16TTransactionModeE @ 20 NONAME + _ZN11CRepository17CommitTransactionERm @ 21 NONAME + _ZN11CRepository3GetEmR5TDes8 @ 22 NONAME + _ZN11CRepository3GetEmR6TDes16 @ 23 NONAME + _ZN11CRepository3GetEmRi @ 24 NONAME + _ZN11CRepository3SetEmRK6TDesC8 @ 25 NONAME + _ZN11CRepository3SetEmRK7TDesC16 @ 26 NONAME + _ZN11CRepository3SetEmi @ 27 NONAME + _ZN11CRepository4NewLE4TUid @ 28 NONAME + _ZN11CRepository5FindLEmmR6RArrayImE @ 29 NONAME + _ZN11CRepository5NewLCE4TUid @ 30 NONAME + _ZN11CRepository6CreateEmRK6TDesC8 @ 31 NONAME + _ZN11CRepository6CreateEmi @ 32 NONAME + _ZN11CRepository6DeleteEmmRm @ 33 NONAME + _ZN11CRepository7FindEqLEmmRK6TDesC8R6RArrayImE @ 34 NONAME + _ZN11CRepositoryD0Ev @ 35 NONAME + _ZN11CRepositoryD1Ev @ 36 NONAME + _ZN11CRepositoryD2Ev @ 37 NONAME + _ZN11RMobileCall10ConstructLEv @ 38 NONAME + _ZN11RMobileCall17TMobileCallInfoV1C1Ev @ 39 NONAME + _ZN11RMobileCall17TMobileCallInfoV1C2Ev @ 40 NONAME + _ZN11RMobileCall17TMobileCallInfoV3C1Ev @ 41 NONAME + _ZN11RMobileCall17TMobileCallInfoV3C2Ev @ 42 NONAME + _ZN11RMobileCall28TMobileCallRemotePartyInfoV1C1Ev @ 43 NONAME + _ZN11RMobileCall28TMobileCallRemotePartyInfoV1C2Ev @ 44 NONAME + _ZN11RMobileCall8DestructEv @ 45 NONAME + _ZN11RMobileCallC1Ev @ 46 NONAME + _ZN11RMobileCallC2Ev @ 47 NONAME + _ZN11RMobileLine10ConstructLEv @ 48 NONAME + _ZN11RMobileLine8DestructEv @ 49 NONAME + _ZN11RMobileLineC1Ev @ 50 NONAME + _ZN11RMobileLineC2Ev @ 51 NONAME + _ZN12RMobilePhone10ConstructLEv @ 52 NONAME + _ZN12RMobilePhone14TMobileAddressC1Ev @ 53 NONAME + _ZN12RMobilePhone14TMobileAddressC2Ev @ 54 NONAME + _ZN12RMobilePhone14TMultimodeTypeC1Ev @ 55 NONAME + _ZN12RMobilePhone14TMultimodeTypeC2Ev @ 56 NONAME + _ZN12RMobilePhone8DestructEv @ 57 NONAME + _ZN12RMobilePhoneC1Ev @ 58 NONAME + _ZN12RMobilePhoneC2Ev @ 59 NONAME + _ZN18RTelSubSessionBaseC1Ev @ 60 NONAME + _ZN18RTelSubSessionBaseC2Ev @ 61 NONAME + _ZN21RMobileConferenceCall4OpenER12RMobilePhone @ 62 NONAME + _ZN21RMobileConferenceCall5CloseEv @ 63 NONAME + _ZN21RMobileConferenceCallC1Ev @ 64 NONAME + _ZN21RMobileConferenceCallC2Ev @ 65 NONAME + _ZN5RCall10ConstructLEv @ 66 NONAME + _ZN5RCall16OpenExistingCallER5RLineRK7TDesC16 @ 67 NONAME + _ZN5RCall5CloseEv @ 68 NONAME + _ZN5RCall8DestructEv @ 69 NONAME + _ZN5RCall9TCallInfoC1Ev @ 70 NONAME + _ZN5RCall9TCallInfoC2Ev @ 71 NONAME + _ZN5RCallC1Ev @ 72 NONAME + _ZN5RCallC2Ev @ 73 NONAME + _ZN5RLine10ConstructLEv @ 74 NONAME + _ZN5RLine4OpenER6RPhoneRK7TDesC16 @ 75 NONAME + _ZN5RLine5CloseEv @ 76 NONAME + _ZN5RLine8DestructEv @ 77 NONAME + _ZN5RLineC1Ev @ 78 NONAME + _ZN5RLineC2Ev @ 79 NONAME + _ZN6RPhone10ConstructLEv @ 80 NONAME + _ZN6RPhone4OpenER10RTelServerRK7TDesC16 @ 81 NONAME + _ZN6RPhone5CloseEv @ 82 NONAME + _ZN6RPhone8DestructEv @ 83 NONAME + _ZN6RPhoneC1Ev @ 84 NONAME + _ZN6RPhoneC2Ev @ 85 NONAME + _ZNK11RMobileCall15NotifyCallEventER14TRequestStatusRNS_16TMobileCallEventE @ 86 NONAME + _ZNK11RMobileCall17GetMobileCallInfoER5TDes8 @ 87 NONAME + _ZNK11RMobileCall19GetMobileCallStatusERNS_17TMobileCallStatusE @ 88 NONAME + _ZNK11RMobileCall28NotifyMobileCallStatusChangeER14TRequestStatusRNS_17TMobileCallStatusE @ 89 NONAME + _ZNK11RMobileLine28NotifyMobileLineStatusChangeER14TRequestStatusRN11RMobileCall17TMobileCallStatusE @ 90 NONAME + _ZNK18RTelSubSessionBase18CancelAsyncRequestEi @ 91 NONAME + _ZNK21RMobileConferenceCall19GetConferenceStatusERNS_23TMobileConferenceStatusE @ 92 NONAME + _ZNK21RMobileConferenceCall21NotifyConferenceEventER14TRequestStatusRNS_22TMobileConferenceEventER4TBufILi128EE @ 93 NONAME + _ZNK21RMobileConferenceCall28NotifyConferenceStatusChangeER14TRequestStatusRNS_23TMobileConferenceStatusE @ 94 NONAME + _ZNK5RCall7GetInfoERNS_9TCallInfoE @ 95 NONAME + _ZNK5RLine11GetCallInfoEiRNS_9TCallInfoE @ 96 NONAME + _ZNK5RLine13EnumerateCallERi @ 97 NONAME + _ZTI11CMusManager @ 98 NONAME ; ## + _ZTI11CRepository @ 99 NONAME ; ## + _ZTI11RMobileCall @ 100 NONAME ; ## + _ZTI11RMobileLine @ 101 NONAME ; ## + _ZTI12CMusAoPlugin @ 102 NONAME ; ## + _ZTI12RMobilePhone @ 103 NONAME ; ## + _ZTI15CMusCallMonitor @ 104 NONAME ; ## + _ZTI18CMusPttCallMonitor @ 105 NONAME ; ## + _ZTI19CMusCallMonitorBase @ 106 NONAME ; ## + _ZTI19CMusCallMonitorMock @ 107 NONAME ; ## + _ZTI19CMusPropertyMonitor @ 108 NONAME ; ## + _ZTI20CMusCallEventMonitor @ 109 NONAME ; ## + _ZTI21CMusCallStatusMonitor @ 110 NONAME ; ## + _ZTI22CMusTsyPropertyMonitor @ 111 NONAME ; ## + _ZTI25CMusCallConferenceMonitor @ 112 NONAME ; ## + _ZTI30CMusCallConferenceEventMonitor @ 113 NONAME ; ## + _ZTI5RCall @ 114 NONAME ; ## + _ZTI5RLine @ 115 NONAME ; ## + _ZTI6RPhone @ 116 NONAME ; ## + _ZTV11CMusManager @ 117 NONAME ; ## + _ZTV11CRepository @ 118 NONAME ; ## + _ZTV11RMobileCall @ 119 NONAME ; ## + _ZTV11RMobileLine @ 120 NONAME ; ## + _ZTV12CMusAoPlugin @ 121 NONAME ; ## + _ZTV12RMobilePhone @ 122 NONAME ; ## + _ZTV15CMusCallMonitor @ 123 NONAME ; ## + _ZTV18CMusPttCallMonitor @ 124 NONAME ; ## + _ZTV19CMusCallMonitorBase @ 125 NONAME ; ## + _ZTV19CMusCallMonitorMock @ 126 NONAME ; ## + _ZTV19CMusPropertyMonitor @ 127 NONAME ; ## + _ZTV20CMusCallEventMonitor @ 128 NONAME ; ## + _ZTV21CMusCallStatusMonitor @ 129 NONAME ; ## + _ZTV22CMusTsyPropertyMonitor @ 130 NONAME ; ## + _ZTV25CMusCallConferenceMonitor @ 131 NONAME ; ## + _ZTV30CMusCallConferenceEventMonitor @ 132 NONAME ; ## + _ZTV5RCall @ 133 NONAME ; ## + _ZTV5RLine @ 134 NONAME ; ## + _ZTV6RPhone @ 135 NONAME ; ## + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/Stubs/inc/callinformation.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/Stubs/inc/callinformation.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,153 @@ +/* +* Copyright (c) 2008-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: Call state information +* +*/ + + +#ifndef CALLINFORMATION_H +#define CALLINFORMATION_H + +#include +#include + +/** The category UID for the messages in this header file. */ +const TUid KCatCallInformation = { 0x102078FD }; + +/** Version number of this API */ +const TInt KCallInformationVersionMajor( 1 ); +const TInt KCallInformationVersionMinor( 0 ); +const TInt KCallInformationVersionBuild( 0 ); + +#include + +/** + * Holds single calls information. + * + * @since S60 v5.1 + */ +NONSHARABLE_CLASS( TCallInfo ) : public MCall + { +public: + + TInt CallIndex() const { return iIndex; } + + CCPCall::TCallType CallType() const { return iType; } + + CCPCall::TCallState CallState() const { return iState; } + + TUint32 ServiceId() const { return iServiceId; } + + CCPCall::TCallDirection CallDirection() const { return iDirection; } + + CCPCall::TCallState iState; + CCPCall::TCallType iType; + CCPCall::TCallDirection iDirection; + TInt iIndex; + TInt iIdentifier; + TUint32 iServiceId; + }; + + +/** + * Class holding information about calls. + * Can be packed for IPC purposes. + * + * @since S60 v5.1 + */ +NONSHARABLE_CLASS( CCallInfos ) : public CBase + { +public: + + /** + * Two-phased constructor. + */ + static CCallInfos* NewL(); + + /** + * Two-phased constructor. + */ + static CCallInfos* NewLC(); + + /** + * Destructor. + */ + virtual ~CCallInfos(); + + /** + * Adds information about a call. + * + * @since S60 v5.1 + * @param aCallInfo Call information to be added. + */ + inline void AddL( TCallInfo& aCallInfo ); + + /** + * Returns information about all calls. + * + * @since S60 v5.1 + * @return Reference to call info array + */ + inline const RArray& CallInfos() const; + + /** + * Packages this class for IPC transfer. + * + * @since S60 v5.1 + * @return Pointer to descriptor holding the class. + */ + inline HBufC8* ExternalizeL() const; + + /** + * Intializes the class from descriptor + * + * @since S60 v5.1 + * @param aCallInfos Reference to descriptor containg the class data. + */ + inline void InternalizeL( const TDesC8& aCallInfos ); + + + // Helper function for the STUB ONLY: + inline void AddCallInfosL(); + +private: + + inline CCallInfos(); + + +private: + RArray iCallInfos; + }; + +/** + * Commands + */ +enum TCallInformationCommands + { + EGetAllCallStates = 0 + }; + +/** + * Events + */ +enum TCallInformationEvents + { + EChangesInCallStates = 0 + }; + + +// Implementation is stubed. +#include "ccallinfos_stub.inl" + +#endif // CALLINFORMATION_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/Stubs/inc/ccallinfoiter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/Stubs/inc/ccallinfoiter.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,137 @@ +/* +* 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: Iterator class for going through ongoing calls. +* +*/ + + +#ifndef C_CALLINFOITER_H +#define C_CALLINFOITER_H + +// INCLUDES +#include +#include + +// forward declarations +class CCallInfos; +class MCall; + +// CLASS DECLARATION + +/** + * Class to be used for going through ongoing calls. + * + * @code + * 1) Go trough all calls, no need to call Count() first. + * CCallInfoIter& iter = iCallInfo->GetCallsL(); + * + * for( iter.First(); !iter.IsDone(); iter.Next() ) + * { + * const MCall& call( iter.Current() ); + * DoSomethingWhenCallDetected( call ); + * } + * + * 2) Check if there are any calls + * CCallInfoIter& iter = iCallInfo->GetCallsL(); + * TInt amountOfCalls = iter.Count(); + * + * if ( amountOfCalls == 0) + * { + * DoSomethingBecauseAllCallsHaveEnded(); + * } + * + * @endcode + * + * @lib telephonyservice.lib + * @since S60 v5.1 + */ +NONSHARABLE_CLASS( CCallInfoIter ) : public CBase + { +public: + + /** + * Two-phased constructor. + * @param aCallInfos Container for call information. + */ + static CCallInfoIter* NewL( CCallInfos& aCallInfos ); + + /** + * Two-phased constructor. + * @param aCallInfos Container for call information. + */ + static CCallInfoIter* NewLC( CCallInfos& aCallInfos ); + + /** + * Destructor. + */ + ~CCallInfoIter(); + + /** + * Intializes the current call to the first call + * + * @since S60 v5.1 + */ + IMPORT_C void First(); + + /** + * Tests whether all calls are went through + * + * @since S60 v5.1 + */ + IMPORT_C TBool IsDone() const; + + /** + * Advances the current call to the next call + * + * @since S60 v5.1 + */ + IMPORT_C void Next(); + + /** + * Returns the count of calls + * + * @since S60 v5.1 + * @return Amount of calls + */ + IMPORT_C TInt Count() const; + + /** + * Returns the current call. Panic happens if there are no calls. + * + * @since S60 v5.1 + * @return Reference to the call. + */ + IMPORT_C const MCall& Current() const; + +private: + + /** + * Constructor for performing 1st stage construction + */ + CCallInfoIter( CCallInfos& aCallInfos ); + + /** + * EPOC default constructor for performing 2nd stage construction + */ + void ConstructL(); + +private: // data + + CCallInfos& iCallInfos; + + TInt iCurrentIndex; + + }; + +#endif // C_CALLINFOITER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/Stubs/inc/ccallinformation.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/Stubs/inc/ccallinformation.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,116 @@ +/* +* 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: Provides information about ongoing calls. +* +*/ + + +#ifndef C_CALLINFORMATION_H +#define C_CALLINFORMATION_H + +#include +#include "callinformation.h" +#include "mcall.h" + + +// forward declarations +class MCallInformationObserver; +class CCallInformationImpl; +class CCallInfoIter; + + +/** + * Class to be used for receiving information about ongoing calls. + * + * @code + * // create the CCallInformation instance e.g. when the client component is created + * iCallInfo = CCallInformation::NewL(); + * iCallInfo->NotifyCallInformationChanges(*iObserver); + * + * // and use it when needed + * CCallInfoIter& iter = iCallInfo->GetCallsL(); + * @endcode + * + * @lib telephonyservice.lib + * @since S60 v5.1 + */ +NONSHARABLE_CLASS( CCallInformation ) : public CBase + { + +public: + + /** + * Two-phased constructor. + */ + IMPORT_C static CCallInformation* NewL(); + + + /** + * Destructor. + */ + virtual ~CCallInformation(); + + /** + * Allows a client to be notified when there are changes in current calls. + * There can be only one observer per CCallInformation instance. + * + * @since S60 v5.1 + * @param aObserver Observer for notifications. + */ + IMPORT_C void NotifyCallInformationChanges( MCallInformationObserver& aObserver ); + + /** + * Used to cancel previously placed NotifyCallInformationChanges call. + * + * @since S60 v5.1 + */ + IMPORT_C void CancelNotification(); + + /** + * Gets the snapshot of ongoing calls. + * + * @since S60 v5.1 + * @return Ongoing calls. + */ + IMPORT_C CCallInfoIter& GetCallsL( ); + + /** + * Get calls by given state. + * + * @since S60 v5.1 + * @param aState Specifies a call state that is used as a search key. + * @return Calls in state aSate, e.g. in case of conference call several + * calls have the same state. + */ + IMPORT_C CCallInfoIter& GetCallsL( CCPCall::TCallState aState ); + + +private: + + CCallInformation(); + + void ConstructL(); + + +private: // data + + CCallInformationImpl* iImpl; + + // Helper Data Needed by STUB Implemenation. + CCallInfoIter* iInfoIter; + CCallInfos* iInfos; + }; + + +#endif // C_CALLINFORMATION_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/Stubs/inc/ccallinfos_stub.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/Stubs/inc/ccallinfos_stub.inl Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,89 @@ +/* +* 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: ?Description +* +*/ + + +#include + +const TInt KCallServiceId = 5; + +// --------------------------------------------------------------------------- +// C++ constructor +// --------------------------------------------------------------------------- +// +CCallInfos::CCallInfos() + { + //Nothing to be done Here. + } + +// ----------------------------------------------------------------------------- +// Constructor. +// ----------------------------------------------------------------------------- +// +inline CCallInfos* CCallInfos::NewL() + { + return new( ELeave )CCallInfos(); + } + +// ----------------------------------------------------------------------------- +// Constructor. +// ----------------------------------------------------------------------------- +// +inline CCallInfos* CCallInfos::NewLC() + { + CCallInfos* self = new( ELeave )CCallInfos(); + CleanupStack::PushL( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// Desctructor. +// ----------------------------------------------------------------------------- +// +inline CCallInfos::~CCallInfos() + { + if ( iCallInfos.Count()) + { + iCallInfos.Reset(); + } + iCallInfos.Close(); + } + +// ----------------------------------------------------------------------------- +// Returns information about all calls. +// ----------------------------------------------------------------------------- +// +inline const RArray& CCallInfos::CallInfos( ) const + { + return iCallInfos; + } + + + +// ----------------------------------------------------------------------------- +// Add Dummy Call Info. +// ----------------------------------------------------------------------------- +// +inline void CCallInfos::AddCallInfosL( ) + { + } + + +// End of File. + + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/Stubs/inc/cch.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/Stubs/inc/cch.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,142 @@ +/* +* 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: The new cch client api class +* +*/ + + + +#ifndef C_CCH_H +#define C_CCH_H + +#include + +//class CCchImpl; +class CCchServiceStub; + +const TInt KServiceId = 5; + +/** + * Class for cch service management + * + * CCchService is used for launching various kinds of service functions + * @code + * ?good_class_usage_example(s) + * @endcode + * + * @lib ?library + */ +class CCchService : public CBase + { + +public: + + +protected: + + virtual ~CCchService() { }; + }; + +/** + * Class for basic cch functionality, getting services + * + * @code + * ?good_class_usage_example(s) + * @endcode + * + * @lib cch + */ +class CCch : public CBase + { + +public: + + /** + * Two-phased constructor. + */ + IMPORT_C static CCch* NewL(); + + /** + * Two-phased constructor. + */ + IMPORT_C static CCch* NewLC(); + + /** + * Destructor. + */ + ~CCch(); + + /** + * Returns one service + * + * @param aId Service id + * @return Service or NULL if not found. Ownership is not transferred. + */ + IMPORT_C CCchService* GetService( TInt aId ); + + /** + * Returns service ids of all configured services + * + * @param aIds Array of TInt to be filled with ids + * @return Symbian error code + */ + IMPORT_C TInt GetServiceIds( RArray& aIds ) const; + + /** + * Returns ETrue if connectivity dialogs are allowed in service enabling. + * + * @return ETrue if connectivity dialogs are allowed in service enabling + */ + IMPORT_C TBool ConnectivityDialogsAllowed() const; + + /** + * For allowing/disallowing connectivity dialogs showing in + * service enabling. + * + * @param aConnectivityDialogsAllowed Boolean to set connectivity dialogs + * allowed/disallowed + */ + IMPORT_C void SetConnectivityDialogsAllowed( + TBool aConnectivityDialogsAllowed ); + + + +protected: + + /** + * The constructor + */ + CCch(); + +private: + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + +private: // data + + CCchServiceStub* iServiceStub; + }; + + +class HelpData + { +public: + static HBufC* iUserName; + static TInt iGetConnectionParamError; + }; + +#endif // C_CCH_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/Stubs/inc/spentry.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/Stubs/inc/spentry.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,238 @@ +/* +* Copyright (c) Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Service Provider Settings entry +* +*/ + + +#ifndef C_SPENTRY_H +#define C_SPENTRY_H + +#include + +#include "spdefinitions.h" + +class CSPProperty; + + +/** + * Service Provider Settings entry. + * Container class for service attributes and settings properties + * + * @lib serviceprovidersettings.lib + * @since S60 V3.2 + */ +NONSHARABLE_CLASS( CSPEntry ): public CBase + { + + public: // Constructors and destructor + /** + * Two-phased constructor. + */ + IMPORT_C static CSPEntry* NewL(); + + /** + * Two-phased constructor. + */ + IMPORT_C static CSPEntry* NewLC(); + + /** + * Destructors. + */ + IMPORT_C virtual ~CSPEntry(); + + public: // Member functions + /** + * Returns service Id of this entry. + * + * @since S60 V3.2 + * @return Service ID + */ + IMPORT_C TServiceId GetServiceId() const; + + /** + * Sets unique service provider ID for this entry. + * This ID is generated automatically when new entry is added. + * Service ID is also required when user updates entry in service table + * + * @since S60 V3.2 + * @param aServiceId service ID + */ + void SetServiceId( TServiceId aServiceId ); + + /** + * Returns service name of this entry. + * + * @since S60 V3.2 + * @return Service name + */ + IMPORT_C const TDesC& GetServiceName() const; + + /** + * Sets service name for this entry. + * + * @since S60 V3.2 + * @param aServiceName service name + */ + IMPORT_C TInt SetServiceName( const TDesC& aServiceName ); + + /** + * Adds new property to this entry. + * + * @since S60 V3.2 + * @param aProperty new property pointer + * @return KErrNone if addition succeeded, + * system wide error code otherwise. + */ + IMPORT_C TInt AddPropertyL( const CSPProperty& aProperty ); + + /** + * Updates content of property in this entry. + * + * @since S60 V3.2 + * @param aPropertyName property name + * @param aValue new TInt value + * @return KErrNone if update succeeded. + */ + IMPORT_C TInt UpdateProperty( TServicePropertyName aPropertyName, TInt aValue ); + + /** + * Updates content of property in this entry. + * + * @since S60 V3.2 + * @param aPropertyName property name + * @param aValue new TDesC value + * @return KErrNone if update succeeded. + */ + IMPORT_C TInt UpdateProperty( TServicePropertyName aPropertyName, const TDesC& aValue ); + + /** + * Updates content of property in this entry. + * + * @since S60 V3.2 + * @param aPropertyName property name + * @param aValue new TOnOff value + * @return KErrNone if update succeeded. + */ + IMPORT_C TInt UpdateProperty( TServicePropertyName aPropertyName, TOnOff aValue ); + + /** + * Returns property of this entry by property name. + * + * @since S60 V3.2 + * @param aProperty On return, reference to requested property + * @param aPropertyName Name of requested property + * @return error code + */ + IMPORT_C TInt GetProperty( const CSPProperty*& aProperty, + TServicePropertyName aPropertyName ) const; + + /** + * Returns property of this entry by property index. + * + * @since S60 V3.2 + * @param aProperty On return, reference to requested property + * @param aIndex index of requested property + * @return error code + */ + IMPORT_C TInt GetProperty( const CSPProperty*& aProperty, + TInt aIndex ) const; + + /** + * Deletes property from this entry by index. + * + * @since S60 V3.2 + * @param aIndex index of requested property + * @return error code + */ + IMPORT_C TInt DeleteProperty( TInt aIndex ); + + /** + * Deletes property from this entry by property name. + * + * @since S60 V3.2 + * @param aProperty property name + * @return error code + */ + IMPORT_C TInt DeleteProperty( TServicePropertyName aProperty ); + + /** + * Returns all properties of this entry. + * + * @since S60 V3.2 + * @return Reference to array of properties + */ + IMPORT_C const RPropertyArray& GetAllProperties() const; + + /** + * Returns count of properties in this entry + * + * @since S60 V3.2 + * @return Count of properties + */ + IMPORT_C TInt PropertyCount() const; + + /** + * reset service entry + * + * @since S60 V3.2 + * @return Count of properties + */ + IMPORT_C void Reset(); + + + private: + + /** + * C++ default constructor. + */ + CSPEntry(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + /** + * Search index of requested property in iPropertyArray + * + * @since S60 ?S60_version + * @param aProperty + * @return Index of property or KErrNotFound + */ + TInt SearchProperty( TServicePropertyName aProperty ) const; + + private: // data + + /** + * Id of service settings entry ( unique ) + */ + TServiceId iServiceId; + + /** + * Name of settings entry ( unique ) + * Own. + */ + RBuf iServiceName; + + /** + * Service settings properties owned by this entry + * Own. + */ + RPropertyArray iPropertyArray; + + }; + + +#endif // C_SPENTRY_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/Stubs/inc/spsettings.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/Stubs/inc/spsettings.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,313 @@ +/* +* Copyright (c) Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Service Provider Settings API +* +*/ + + +#ifndef C_SPSETTINGS_H +#define C_SPSETTINGS_H + +#include +#include + +#include "spdefinitions.h" + +class CSPSettingsEngine; +class CSPEntry; +class CSPProperty; + +/** + * Service provider settings API class + * + * Main class of managing service provider settings + * + * @code example code of how to add a new service entry to service table + * CSPEntry* entry = CSPEntry::NewL(); + * TInt err = entry->SetServiceName( _L("somename" ) ); + * CSPProperty* property = CSPProperty::NewL(); + * err = property->SetName( EPropertyServiceAttributeMask ); + * property->SetValue( 100 ); + * err = entry->AddProperty( property ); + * // iSettings is instance of CSPSettings + * TInt err = iSettings->AddEntryL( *entry ); + * @endcode + * + * @lib serviceprovidersettings.lib + * @since S60 v3.2 + */ +NONSHARABLE_CLASS( CSPSettings ): public CBase + { + + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CSPSettings* NewL(); + + /** + * Two-phased constructor. + */ + IMPORT_C static CSPSettings* NewLC(); + + /** + * Destructors. + */ + IMPORT_C virtual ~CSPSettings(); + + public: + + /** + * Stores new service provider settings entry, + * service Id is returned inside aEntry object + * + * @since S60 v3.2 + * @param aEntry New service provider settings entry, on return service Id is filled in + * @return error code + */ + IMPORT_C TInt AddEntryL( CSPEntry& aEntry ); + + /** + * Search service provider settings entry by service ID. + * + * @since S60 v3.2 + * @param aServiceId Id of requested xSP settings entry + * @param aEntry on return, SP settings entry corresponding to aServiceId. + * @return error code, KErrNone if succeeded, otherwise system wide error code + */ + IMPORT_C TInt FindEntryL( TServiceId aServiceId, CSPEntry& aEntry ); + + + /** + * Updates service provider settings entry to settings storage. + * Service ID must be set to entry before update. + * + * @since S60 v3.2 + * @param aEntry Updated service provider settings entry + * @return error code, KErrNone if update succeeded, otherwise system wide error code + */ + IMPORT_C TInt UpdateEntryL( const CSPEntry& aEntry ); + + /** + * Deletes service provider settings entry from storage by service ID. + * + * @since S60 v3.2 + * @param aEntryId Id of settings entry which is going to be deleted + * @return error code, KErrNone if delete succeeded, otherwise system wide error code + */ + IMPORT_C TInt DeleteEntryL( TServiceId aServiceId ); + + /** + * Search property of service provider settings entry from storage. + * + * @since S60 v3.2 + * @param aServiceId The service ID of requested service entry + * @param aPropertyName property name to be found + * @param aProperty on return, requested property + * @return error code, KErrNone if succeeded, otherwise system wide error code + */ + IMPORT_C TInt FindPropertyL( TServiceId aServiceId, + TServicePropertyName aPropertyName, + CSPProperty& aProperty ); + + /** + * Add or update properties of service provider settings entry to storage. + * If property name exists, update property. If property doesn't exist, + * add property + * + * @since S60 v3.2 + * @param aServiceId The ID of updated service entry + * @param aPropertyArray new properties to be added or updated + * @return error code, KErrNone if update succeeded, otherwise system wide error code + */ + IMPORT_C TInt AddOrUpdatePropertiesL( TServiceId aServiceId, + const RPropertyArray& aPropertyArray ); + + + /** + * Add or update one property of service provider settings entry to storage. + * If property name exists, update property. If property doesn't exist, + * add property + * + * @since S60 v3.2 + * @param aServiceId The ID of updated service entry + * @param aProperty new property to be added or updated + * @return error code, KErrNone if update succeeded, otherwise system wide error code + */ + IMPORT_C TInt AddOrUpdatePropertyL( TServiceId aServiceId, + const CSPProperty& aProperty ); + + /** + * Return count of service provider settings entries in storage. + * + * @since S60 v3.2 + * @return Count of stored service provider settings. + */ + IMPORT_C TInt SettingsCountL(); + + /** + * Search all service provider IDs from storage + * + * @since S60 v3.2 + * @param aServiceIds An array containing returned service IDs + * @return error code + */ + IMPORT_C TInt FindServiceIdsL( RIdArray& aServiceIds ); + + + /** + * Search all service names from settings storage by given service IDs. + * Removes ID from array if it is not found from settings storage. + * + * @since S60 v3.2 + * @param aServiceIds An array of service IDs + * @param aServiceNames on return, array which saves found service names + * @return error code + */ + IMPORT_C TInt FindServiceNamesL( RIdArray& aServiceIds, + CDesCArray& aServiceNames ); + + + /** + * Search subservice properties of requested service provider settings entry by ID + * and subservice type + * + * @since S60 v3.2 + * @param aServiceId The ID of requested service entry + * @param aPropertyType property type of sub service + * @param aPropertyArray on return, array which saves found subservice properties + * @return error code + */ + IMPORT_C TInt FindSubServicePropertiesL( TServiceId aServiceId, + TSPItemType aPropertyType, + RPropertyArray& aPropertyArray ); + + /** + * Deletes service properties by service ID and property name. + * + * @since S60 v3.2 + * @param aServiceId The service ID of requested service entry + * @param aNameArray name of properties to be deleted + * @return error code + */ + IMPORT_C TInt DeleteServicePropertiesL( TServiceId aServiceId, + const RPropertyNameArray& aNameArray ); + + /** + * Find service IDs with same properties + * + * @since S60 v3.2 + * @param aPropertyArray property array + * @param on return, service Ids with same properties + * @return error code + */ + IMPORT_C TInt FindServiceIdsFromPropertiesL( const RPropertyArray& aPropertyArray, + RIdArray& aServiceIds ); + + /** + * Get SIP VoIP software version. + * + * @since S60 v3.2 + * @return SIP VoIP software version + */ + IMPORT_C static const TDesC& GetSIPVoIPSWVersion(); + + /** + * Check feature is supported or not + * + * @since S60 v3.2 + * @return SIP VoIP software version + */ + IMPORT_C TBool IsFeatureSupported( TSPServiceFeature aFeature ); + + private: + + /** + * C++ default constructor. + */ + CSPSettings(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + /** + * Commit or rollback transaction + * @since S60 v3.2 + * @param aError error code of CenRep operation + * @param aServiceId changed service Id + * @return error code + */ + TInt CommitOrRollbackL( TInt aError, TServiceId aServiceId ); + + /** + * Check is VoIP Service Id and then are Properties VoIP related + * + * @since S60 v3.2.3 + * @return KErrNotSupported if VoIP not supported and checking + * of Service Id and Properties gives true + */ + TInt CheckSupportedL( TServiceId aServiceId, const RPropertyNameArray& aNameArray ); + + /** + * Check is VoIP Service Id + * + * @since S60 v3.2.3 + * @return KErrNotSupported if VoIP not supported and checking + * of Service Id gives true + */ + TInt CheckSupportedL( TServiceId aServiceId ); + + /** + * Check is SP item type VoIP related + * + * @since S60 v3.2.3 + * @return KErrNotSupported if VoIP not supported and checking + * of SP item type gives true + */ + TInt CheckSupportedL( TSPItemType aPropertyType ); + + /** + * Check does an array have Properties VoIP related + * + * @since S60 v3.2.3 + * @return KErrNotSupported if VoIP not supported and checking + * of the array gives true + */ + TInt CheckSupportedL( const RPropertyArray& aPropertyArray ); + + private: // data + + /** + * Settings engine + * Own. + */ + CSPSettingsEngine* iSettingsEngine; + + + /** + * Feature manager support VoIP + * Own. + */ + TBool iFeatureManagerSupportVoIP; + /** + * Writing settings allowed + */ + TBool iSettingsWriteAllowed; + + }; + +#endif // C_SPSETTINGS_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/Stubs/src/ccallinfoiter_stub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/Stubs/src/ccallinfoiter_stub.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,104 @@ +/* +* Copyright (c) Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Iterator class for going through ongoing calls. +* +*/ + + +#include //Call Information Mediator API +#include "ccallinfoiter.h" +#include "mcall.h" + + +// ======== MEMBER FUNCTIONS ======== + + +// --------------------------------------------------------------------------- +// C++ constructor. +// --------------------------------------------------------------------------- +// +CCallInfoIter::CCallInfoIter( CCallInfos& aCallInfos ): iCallInfos( aCallInfos ) + { + First(); + } + +// --------------------------------------------------------------------------- +// Destructor +// --------------------------------------------------------------------------- +// +CCallInfoIter::~CCallInfoIter() + { + } + +// --------------------------------------------------------------------------- +// Two-phased constructor. +// --------------------------------------------------------------------------- +// +CCallInfoIter* CCallInfoIter::NewLC( CCallInfos& aCallInfos ) + { + CCallInfoIter* self = new (ELeave)CCallInfoIter( aCallInfos ); + CleanupStack::PushL(self); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------------------------- +// Two-phased constructor. +// --------------------------------------------------------------------------- +// +CCallInfoIter* CCallInfoIter::NewL( CCallInfos& aCallInfos ) + { + CCallInfoIter* self = CCallInfoIter::NewLC( aCallInfos ); + CleanupStack::Pop(self); + return self; + } + +// --------------------------------------------------------------------------- +// Symbian second-phase constructor. +// --------------------------------------------------------------------------- +// +void CCallInfoIter::ConstructL() + { + } + +// --------------------------------------------------------------------------- +// Returns the amount of calls +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CCallInfoIter::Count() const + { + TUint count = 1; + return count; + } + +// --------------------------------------------------------------------------- +// Returns the current call. +// --------------------------------------------------------------------------- +// +EXPORT_C const MCall& CCallInfoIter::Current() const + { + return iCallInfos.CallInfos()[iCurrentIndex]; + } + +// --------------------------------------------------------------------------- +// Intializes the current call to the first call. +// --------------------------------------------------------------------------- +// +EXPORT_C void CCallInfoIter::First() + { + iCurrentIndex = 0; + } + + +// End of File. diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/Stubs/src/ccallinformation_stub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/Stubs/src/ccallinformation_stub.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,90 @@ +/* +* 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: Provides information about ongoing calls. +* +*/ + +#include "ccallinformation.h" +#include "callinformation.h" +#include "ccallinfoiter.h" + +// --------------------------------------------------------------------------- +// C++ constructor. +// --------------------------------------------------------------------------- +// +CCallInformation::CCallInformation() + { + } + +// --------------------------------------------------------------------------- +// Symbian second-phase constructor. +// --------------------------------------------------------------------------- +// +void CCallInformation::ConstructL() + { + //iImpl = CCallInformationImpl::NewL(); + + iInfos = CCallInfos::NewL(); + iInfoIter = CCallInfoIter::NewL( *iInfos ); + } + + +// --------------------------------------------------------------------------- +// Two-phased constructor. +// --------------------------------------------------------------------------- +// +EXPORT_C CCallInformation* CCallInformation::NewL() + { + CCallInformation* self = new (ELeave) CCallInformation( ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +// --------------------------------------------------------------------------- +// Destructor +// --------------------------------------------------------------------------- +// +CCallInformation::~CCallInformation() + { + //delete iImpl; + if ( iInfos ) + { + delete iInfos; + iInfos = NULL; + } + if ( iInfoIter ) + { + delete iInfoIter; + iInfoIter = NULL; + } + } + + +// --------------------------------------------------------------------------- +// Get calls by given state. +// --------------------------------------------------------------------------- +// + +EXPORT_C CCallInfoIter& CCallInformation::GetCallsL( CCPCall::TCallState aState ) + { + //return iImpl->GetCallsL( aState ); + // Add dummy data to call infos + iInfos->AddCallInfosL(); + return *iInfoIter; + } + +// End of File. diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/Stubs/src/spentry_stub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/Stubs/src/spentry_stub.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,87 @@ +/* +* Copyright (c) Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Service Provider Settings entry. +* +*/ + +#include "spentry.h" +#include "spproperty.h" +//#include "spdefaultvalues.h" + + +// ======== MEMBER FUNCTIONS ======== + + +// --------------------------------------------------------------------------- +// Constructor +// --------------------------------------------------------------------------- +// +CSPEntry::CSPEntry() + { + } + +// --------------------------------------------------------------------------- +// Constructor +// --------------------------------------------------------------------------- +// +void CSPEntry::ConstructL() + { + } + +// --------------------------------------------------------------------------- +// Constructor +// --------------------------------------------------------------------------- +// +EXPORT_C CSPEntry* CSPEntry::NewL() + { + CSPEntry* self = CSPEntry::NewLC(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// Constructor +// --------------------------------------------------------------------------- +// +EXPORT_C CSPEntry* CSPEntry::NewLC() + { + CSPEntry* self = new( ELeave ) CSPEntry; + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------------------------- +// Destructor +// --------------------------------------------------------------------------- +// +EXPORT_C CSPEntry::~CSPEntry() + { + iServiceName.Close(); + iPropertyArray.ResetAndDestroy(); + iPropertyArray.Close(); + } + +// --------------------------------------------------------------------------- +// Returns service name of this entry +// --------------------------------------------------------------------------- +// +EXPORT_C const TDesC& CSPEntry::GetServiceName() const + { + _LIT( KTestProvideName, "VoIP" ); + return KTestProvideName; + } + + +// End of File. diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/Stubs/src/spsettings_stub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/Stubs/src/spsettings_stub.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,88 @@ +/* +* 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: STUB implementation for SP Settings. +* +*/ + +#include "spsettings.h" + + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// Default Constructor +// --------------------------------------------------------------------------- +// +CSPSettings::CSPSettings() + { + // Nothing to be done + } + +// --------------------------------------------------------------------------- +// Destructor +// --------------------------------------------------------------------------- +// +EXPORT_C CSPSettings::~CSPSettings() + { + // Nothing to be done + } + + +// --------------------------------------------------------------------------- +// Constructor +// --------------------------------------------------------------------------- +// +EXPORT_C CSPSettings* CSPSettings::NewL() + { + CSPSettings* self = CSPSettings::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// --------------------------------------------------------------------------- +// Constructor +// --------------------------------------------------------------------------- +// +EXPORT_C CSPSettings* CSPSettings::NewLC() + { + CSPSettings* self = new( ELeave ) CSPSettings; + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------------------------- +// Constructor +// --------------------------------------------------------------------------- +// +void CSPSettings::ConstructL() + { + //Nothing to be done + } + +// --------------------------------------------------------------------------- +// Find service provider settings entry by service ID +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CSPSettings::FindEntryL( TServiceId aServiceId, CSPEntry& /*aEntry*/ ) + { + TInt serviceID = 5; + aServiceId = serviceID; + return KErrNone; + } + + +// End of File + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/group/bld.inf Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,19 @@ +/* +* 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: +* +*/ + +PRJ_MMPFILES +ut_aoplugin.mmp \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/group/ut_aoplugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/group/ut_aoplugin.mmp Thu Jul 22 16:32:26 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: +* +*/ + + +#include +#include + +TARGET ut_aoplugin.dll +TARGETTYPE dll +EPOCALLOWDLLDATA +TARGETPATH /DigiaEUnit/Tests +UID 0x1000af5a 0x01700a21 + +CAPABILITY EUNIT_CAPS +VENDORID VID_DEFAULT + +MACRO UNIT_TESTING +SOURCEPATH ../src +SOURCE ut_aopluginDllMain.cpp +SOURCE ut_musaoplugin.cpp +SOURCE ut_muspropertymonitor.cpp +SOURCE ut_muspttcallmonitor.cpp +SOURCE ut_muscallconferencemonitor.cpp +SOURCE ut_muscallstatusmonitor.cpp +SOURCE ut_muscalleventmonitor.cpp +SOURCE ut_muscallmonitor.cpp +SOURCE ut_mustsypropertymonitor.cpp +SOURCE ut_musresourcefinderutil.cpp +SOURCE ut_muscallconferenceeventmonitor.cpp +SOURCE ut_muscallmonitorbase.cpp +SOURCE ut_musfactorysettings.cpp + +// STUBs for telephonyservice and serviceprovidersettings +SOURCEPATH ../Stubs/src +SOURCE ccallinfoiter_stub.cpp +SOURCE ccallinformation_stub.cpp +SOURCE spentry_stub.cpp +SOURCE spsettings_stub.cpp + + +SOURCEPATH ../../../src +SOURCE musaopluginmain.cpp +SOURCE musaoplugin.cpp +SOURCE muspropertymonitor.cpp +SOURCE muspttcallmonitor.cpp +SOURCE mustsypropertymonitor.cpp +SOURCE muscallmonitor.cpp +SOURCE muscallmonitorbase.cpp +SOURCE muscalleventmonitor.cpp +SOURCE muscallstatusmonitor.cpp +SOURCE muscallconferencemonitor.cpp +SOURCE muscallconferenceeventmonitor.cpp +SOURCE musvoipcallmonitor.cpp + +SOURCEPATH ../../../../../tsrc/etelstub/src +SOURCE etelstub.cpp +SOURCEPATH ../../../../../tsrc/propertystub/src +SOURCE e32property.cpp +SOURCEPATH ../../../../../tsrc/centralrepositorystub/src +SOURCE centralrepositorystub.cpp +SOURCEPATH ../../../../../tsrc/musmanagerstub/src +SOURCE musmanagerstub.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../../inc +USERINCLUDE ../Stubs/inc +USERINCLUDE ../../../../../tsrc/propertystub/inc +USERINCLUDE ../../../../../tsrc/etelstub/inc +USERINCLUDE ../../../../../tsrc/centralrepositorystub/inc +USERINCLUDE ../../../../../tsrc/musmanagerstub/inc + +SYSTEMINCLUDE ../../../inc +SYSTEMINCLUDE ../../../../../inc +SYSTEMINCLUDE ../../../../../tsrc/etelstub/inc +SYSTEMINCLUDE ../../../../../tsrc/propertystub/inc +SYSTEMINCLUDE ../../../../../tsrc/centralrepositorystub/inc +SYSTEMINCLUDE ../../../../../tsrc/musmanagerstub/inc +SYSTEMINCLUDE /epoc32/include/platform/digia/eunit + +APP_LAYER_SYSTEMINCLUDE + +LIBRARY connmon.lib +LIBRARY ecom.lib +LIBRARY eunit.lib +LIBRARY euser.lib +LIBRARY bafl.lib +LIBRARY efsrv.lib +LIBRARY charconv.lib + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/muscommonstubs.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/muscommonstubs.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,84 @@ +/* +* 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: +* +*/ + + +#ifndef UT_MUSCOMMONSTUBS_H +#define UT_MUSCOMMONSTUBS_H + + +#include "muscallmonitorobserver.h" + + +#include +#include + +/** +* +* @lib musengine.lib +* @since S60 v3.2 +*/ +class CMusCommonObserverStub : public CBase, + public MMusCallMonitorObserver + { + + public: + + CMusCommonObserverStub(); + + ~CMusCommonObserverStub(); + + // From MMusCallMonitorObserver + + void CallConnectedL( const TDesC& aTelNumber, TBool aIsSipUri ); + void CallHoldL( const TDesC& aTelNumber, TBool aIsSipUri ); + void ConferenceCallL(); + void NoActiveCallL(); + + + public: // Helpers + + /** + * ETrue if all boolean member variables are set to EFalse and all the + * pointers are NULL + */ + TBool IsReseted(); + + /** + * Resets all the boolean member variable values to EFalse and deletes + * and nullifies all the pointer variables. + */ + void Reset(); + + public: // Data + + TBool iCallConnectedCalled; + TBool iCallHoldCalled; + TBool iConferenceCallCalled; + TBool iNoActiveCallCalled; + TBool iIsSipUri; + + HBufC* iTelNumber; + RMobileCall::TMobileCallEvent iCallEvent; + + + }; + + + + +#endif // UT_MUSCOMMONSTUBS_H + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_musaocalleventmonitor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_musaocalleventmonitor.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,110 @@ +/* +* 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: Monitor that observes the status of the current CS call +* +*/ + + +#ifndef UT_MUSAOCALLEVENTMONITOR_H +#define UT_MUSAOCALLEVENTMONITOR_H + +#include "muscallmonitorobserver.h" + +#include +#include + + +class CMusAoCallEventMonitor; + +/** + * Monitor, which observes status of current cs call + * Observers will be notified, when call status is idle + * i.e. call has ended. + * + * @lib ut_mushaoplugin.dll + */ +NONSHARABLE_CLASS( UT_CMusAoCallEventMonitor ) + : public CEUnitTestSuiteClass, public MMusCallMonitorObserver + { + +public: // constructors and destructor + + /** + * Destructor. + */ + ~UT_CMusAoCallEventMonitor(); + + /** + * Two-phased constructor. Leaves on failure. + * @return The constructed CMusAoCallMonitorTest object. + */ + static UT_CMusAoCallEventMonitor* NewLC(); + +private: + + /** + * C++ constructor. + */ + UT_CMusAoCallEventMonitor(); + + /** + * Symbian 2nd-phase constructor. + */ + void ConstructL(); + + +private: // test MMusCallMonitorObserver + + virtual void CallConnectedL( const TDesC& aTelNumber, TBool aIsSipUri ); + + virtual void CallHoldL( const TDesC& aTelNumber, TBool aIsSipUri ); + + virtual void ConferenceCallL(); + + virtual void NoActiveCallL(); + + +public: + + void UT_ConnectedCallCountLL(); + + void UT_RunLL(); + + void UT_ExamineEventLL(); + +private: + + void SetupL(); + + void Teardown(); + + void ResetObserverFlags(); + +private: // data + + CMusAoCallEventMonitor* iMonitor; + + EUNIT_DECLARE_TEST_TABLE; + + TBool iCallConnected; + + TBool iCallHold; + + TBool iConferenceCall; + + TBool iNoActiveCall; + + }; + +#endif // UT_MUSAOCALLEVENTMONITOR_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_musaoplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_musaoplugin.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,88 @@ +/* +* 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: Main plugin class +* +*/ + + +#ifndef MUSAOPLUGINTEST_H +#define MUSAOPLUGINTEST_H + + +#include // CBase +#include + +class CMusAoPlugin; + +/** + * Main plugin class + * + * @lib ut_musaoplugin.dll + */ +NONSHARABLE_CLASS( UT_CMusAoPlugin ) : public CEUnitTestSuiteClass + { + +public: + + /** + * Symbian two-phase constructor. + * @return New UT_CMusAoPlugin instance + */ + static UT_CMusAoPlugin* NewLC(); + + /** + * C++ destructor. + */ + virtual ~UT_CMusAoPlugin(); + + +private: // constructors + + /** + * C++ constructor. + */ + UT_CMusAoPlugin(); + + /** + * Symbian second-phase constructor. + */ + void ConstructL(); + +public: // setup functions + + void SetupL(); + + void Teardown(); + +public: // test functions + + void DefinePropertiesLL(); + void DefinePropertyL_IntPropertyL(); + void DefinePropertyL_DesCPropertyL(); + void DeletePropertiesL(); + + void UT_HandleServerCommandLL(); + void UT_StartMusClientL(); + void UT_StopMusClientL(); + void UT_MusCallStateChangedL(); + +private: // data + + CMusAoPlugin* iPlugin; + + EUNIT_DECLARE_TEST_TABLE; + + }; + +#endif // MUSAOPLUGINTEST_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_muscallconferenceeventmonitor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_muscallconferenceeventmonitor.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,89 @@ +/* +* 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_CMUSCONFERENCECALLEVENTMONITOR_H__ +#define __UT_CMUSCONFERENCECALLEVENTMONITOR_H__ + + +// EXTERNAL INCLUDES +#include +#include +#include + +// FORWARD DECLARATIONS +class CMusCallConferenceEventMonitor; +class CMusCallMonitor; + +// Next row is to disable warning emerging from EUnit code. +// Placement is due to a fact that most test case files +// include this file. Directive can be removed when +// EUnit is fixed. +#pragma warn_illtokenpasting off + +// CLASS DEFINITION +/** + * Tester class for MusConferenceCallMonitor. + * + */ +NONSHARABLE_CLASS( UT_CMusCallConferenceEventMonitor ): public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static UT_CMusCallConferenceEventMonitor* NewL(); + static UT_CMusCallConferenceEventMonitor* NewLC(); + + /** + * Destructor + */ + ~UT_CMusCallConferenceEventMonitor(); + + private: // Constructors and destructors + + UT_CMusCallConferenceEventMonitor(); + void ConstructL(); + + private: // Test case setup and teardown + + void SetupL(); + void Teardown(); + + private: // Test methdods + + void UT_CMusCallConferenceEventMonitor_NewLL(); + void UT_CMusCallConferenceEventMonitor_RunLL(); + void UT_CMusCallConferenceEventMonitor_DoCancelL(); + void UT_CMusCallConferenceEventMonitor_RunErrorL(); + void UT_CMusCallConferenceEventMonitor_MonitorCallLL(); + + private: // Data + + CMusCallConferenceEventMonitor* iConferenceCallEventMonitor; + RMobilePhone iMobilePhone; + RMobileLine iLine; + RPointerArray iCallMonitorArray; + + EUNIT_DECLARE_TEST_TABLE; + + }; + +#endif // __UT_CMusCallConferenceEventMonitor_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_muscallconferencemonitor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_muscallconferencemonitor.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,91 @@ +/* +* 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_CMUSCONFERENCECALLMONITOR_H__ +#define __UT_CMUSCONFERENCECALLMONITOR_H__ + + +// EXTERNAL INCLUDES +#include +#include +#include + +// FORWARD DECLARATIONS +class CMusCallConferenceMonitor; +class CMusCallMonitor; + +// Next row is to disable warning emerging from EUnit code. +// Placement is due to a fact that most test case files +// include this file. Directive can be removed when +// EUnit is fixed. +#pragma warn_illtokenpasting off + +// CLASS DEFINITION +/** + * Tester class for MusConferenceCallMonitor. + * + */ +NONSHARABLE_CLASS( UT_CMusCallConferenceMonitor ): public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static UT_CMusCallConferenceMonitor* NewL(); + static UT_CMusCallConferenceMonitor* NewLC(); + + /** + * Destructor + */ + ~UT_CMusCallConferenceMonitor(); + + private: // Constructors and destructors + + UT_CMusCallConferenceMonitor(); + void ConstructL(); + + private: // Test case setup and teardown + + void SetupL(); + void Teardown(); + + private: // Test methdods + + void UT_CMusCallConferenceMonitor_NewLL(); + void UT_CMusCallConferenceMonitor_RunLL(); + void UT_CMusCallConferenceMonitor_DoCancelL(); + void UT_CMusCallConferenceMonitor_RunErrorL(); + void UT_CMusCallConferenceMonitor_MonitorCallLL(); + void UT_CMusCallConferenceMonitor_GetConfStatus(); + + private: // Data + + CMusCallConferenceMonitor* iConferenceCallMonitor; + RMobilePhone iMobilePhone; + RMobileLine iLine; + RPointerArray iCallMonitorArray; + + + EUNIT_DECLARE_TEST_TABLE; + + }; + +#endif // __UT_CMusCallConferenceMonitor_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_muscalleventmonitor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_muscalleventmonitor.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,104 @@ +/* +* 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_CMusCallEventMonitor_H__ +#define __UT_CMusCallEventMonitor_H__ + + +// EXTERNAL INCLUDES +#include +#include +#include "etelmm.h" +#include "mussesseioninformationapi.h" +#include "mmustsypropertyobserver.h" +#include "mmuscallstateobserver.h" + +// FORWARD DECLARATIONS +class CMusCallEventMonitor; + +// Next row is to disable warning emerging from EUnit code. +// Placement is due to a fact that most test case files +// include this file. Directive can be removed when +// EUnit is fixed. +#pragma warn_illtokenpasting off + +// CLASS DEFINITION +/** + * Tester class for MusCallMonitor. + * + */ +NONSHARABLE_CLASS( UT_CMusCallEventMonitor ): public CEUnitTestSuiteClass, + MMusTsyPropertyObserver, + MMusCallStateObserver + + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static UT_CMusCallEventMonitor* NewL(); + static UT_CMusCallEventMonitor* NewLC(); + + /** + * Destructor + */ + ~UT_CMusCallEventMonitor(); + + public: // from MMusTsyPropertyObserver. + + /** + * Notify call state changed + * @param aVal The call status + * @param aCallName The name of the call + */ + virtual void NotifyCallStateChanged( NMusSessionInformationApi::TMusCallEvent aVal, + TName& aCallName ); + + public: // from MMusCallStateObserver. + + virtual void MusCallStateChanged(); + + + private: // Constructors and destructors + + UT_CMusCallEventMonitor(); + void ConstructL(); + + private: // Test case setup and teardown + + void SetupL(); + void Teardown(); + + private: // Test methdods + + void UT_CMusCallEventMonitor_NewLL(); + void UT_CMusCallEventMonitor_RunLL(); + void UT_CMusCallEventMonitor_DoCancelL(); + void UT_CMusCallEventMonitor_RunErrorL(); + private: // Data + CMusCallEventMonitor* iCallEventMonitor; + RMobileCall iCall; + + EUNIT_DECLARE_TEST_TABLE; + + }; + +#endif // __UT_CMusCallEventMonitor_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_muscallmonitor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_muscallmonitor.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,96 @@ +/* +* 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_CMusCallMonitor_H__ +#define __UT_CMusCallMonitor_H__ + + +// EXTERNAL INCLUDES +#include +#include +#include "etelmm.h" +#include "mussesseioninformationapi.h" +#include "mmustsypropertyobserver.h" +#include "mmuscallstateobserver.h" + +// Forward declaration +class CMusCallMonitor; + + +// Next row is to disable warning emerging from EUnit code. +// Placement is due to a fact that most test case files +// include this file. Directive can be removed when +// EUnit is fixed. +#pragma warn_illtokenpasting off + +// CLASS DEFINITION +/** + * Tester class for CMusCallMonitorBase. + * + */ +NONSHARABLE_CLASS( UT_CMusCallMonitor ): public CEUnitTestSuiteClass, + MMusTsyPropertyObserver, + MMusCallStateObserver + { + public: + //Two phase construction + static UT_CMusCallMonitor* NewL(); + static UT_CMusCallMonitor* NewLC(); + // Destructor + ~UT_CMusCallMonitor(); + + public: // from MMusTsyPropertyObserver. + + /** + * Notify call state changed + * @param aVal The call status + * @param aCallName The name of the call + */ + virtual void NotifyCallStateChanged( NMusSessionInformationApi::TMusCallEvent aVal, + TName& aCallName ); + + public: // from MMusCallStateObserver. + + virtual void MusCallStateChanged(); + + + private: // Constructor + UT_CMusCallMonitor(); + void ConstructL(); + + private: // Test case setup and teardown + void SetupL(); + void Teardown(); + + private: // Test methdods + void UT_CMusCallMonitor_StartMonitorLL(); + void UT_CMusCallMonitor_StopMonitorLL(); + void UT_CMusCallMonitor_IsEqualL(); + void UT_CMusCallMonitor_IsMonitoredL(); + + private: // Data + CMusCallMonitor* iCallMonitor; + RMobileLine iLine; + + EUNIT_DECLARE_TEST_TABLE; + + }; + +#endif // __UT_CMusCallMonitor_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_muscallmonitorbase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_muscallmonitorbase.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,117 @@ +/* +* 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_CMusCallMonitorBase_H__ +#define __UT_CMusCallMonitorBase_H__ + + +// EXTERNAL INCLUDES +#include +#include +#include "etelmm.h" +#include "muscallmonitorbase.h" +#include "mussesseioninformationapi.h" +#include "mmustsypropertyobserver.h" +#include "mmuscallstateobserver.h" + + +// Forward declaration + +// Next row is to disable warning emerging from EUnit code. +// Placement is due to a fact that most test case files +// include this file. Directive can be removed when +// EUnit is fixed. +#pragma warn_illtokenpasting off + +class CMusCallMonitorMock : public CMusCallMonitorBase + + { +public: + + CMusCallMonitorMock( const RMobileCall& aCall, + MMusTsyPropertyObserver& aObserver, + MMusCallStateObserver& aCallStateObserver ); + ~CMusCallMonitorMock(); + + private: + + void RunL(); + void DoCancel(); + }; + + + +// CLASS DEFINITION +/** + * Tester class for CMusCallMonitorBase. + * + */ +NONSHARABLE_CLASS( UT_CMusCallMonitorBase ): public CEUnitTestSuiteClass, + MMusTsyPropertyObserver, + MMusCallStateObserver + { + public: + //Two phase construction + static UT_CMusCallMonitorBase* NewL(); + static UT_CMusCallMonitorBase* NewLC(); + // Destructor + ~UT_CMusCallMonitorBase(); + + public: // from MMusTsyPropertyObserver. + + /** + * Notify call state changed + * @param aVal The call status + * @param aCallName The name of the call + */ + virtual void NotifyCallStateChanged( NMusSessionInformationApi::TMusCallEvent aVal, + TName& aCallName ); + + public: // from MMusCallStateObserver. + virtual void MusCallStateChanged(); + + + private: // Constructor + UT_CMusCallMonitorBase(); + void ConstructL(); + + private: // Test case setup and teardown + void SetupL(); + void Setup2L(); + + void Teardown(); + + private: // Test methdods + void UT_SetStateLL(); + void UT_SetCallInfoLL(); + void UT_RunErrorL(); + void UT_CMusCallMonitorBase_IsDataReadyLL(); + + + private: // Data + CMusCallMonitorBase* iCallMonitorBase; + RMobileCall iCall; + TBool iCallStateObserverInvoked; + + EUNIT_DECLARE_TEST_TABLE; + + }; + +#endif // __UT_CMusCallMonitorBase_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_muscallstatusmonitor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_muscallstatusmonitor.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,106 @@ +/* +* 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_CMusCallStatusMonitor_H__ +#define __UT_CMusCallStatusMonitor_H__ + + +// EXTERNAL INCLUDES +#include +#include +#include "etelmm.h" +#include "mussesseioninformationapi.h" +#include "mmustsypropertyobserver.h" +#include "mmuscallstateobserver.h" + +// FORWARD DECLARATIONS +class CMusCommonObserverStub; +class CMusCallStatusMonitor; + +// Next row is to disable warning emerging from EUnit code. +// Placement is due to a fact that most test case files +// include this file. Directive can be removed when +// EUnit is fixed. +#pragma warn_illtokenpasting off + +// CLASS DEFINITION +/** + * Tester class for MusCallMonitor. + * + */ +NONSHARABLE_CLASS( UT_CMusCallStatusMonitor ): public CEUnitTestSuiteClass, + MMusTsyPropertyObserver, + MMusCallStateObserver + + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static UT_CMusCallStatusMonitor* NewL(); + static UT_CMusCallStatusMonitor* NewLC(); + + /** + * Destructor + */ + ~UT_CMusCallStatusMonitor(); + + public: // from MMusTsyPropertyObserver. + + /** + * Notify call state changed + * @param aVal The call status + * @param aCallName The name of the call + */ + virtual void NotifyCallStateChanged( NMusSessionInformationApi::TMusCallEvent aVal, + TName& aCallName ); + + public: // from MMusCallStateObserver. + + virtual void MusCallStateChanged(); + + private: // Constructors and destructors + + UT_CMusCallStatusMonitor(); + void ConstructL(); + + private: // Test case setup and teardown + + void SetupL(); + void Teardown(); + + private: // Test methdods + + void UT_CMusCallStatusMonitor_NewLL(); + void UT_CMusCallStatusMonitor_CheckStateLL(); + void UT_CMusCallStatusMonitor_RunLL(); + void UT_CMusCallStatusMonitor_DoCancelL(); + void UT_CMusCallStatusMonitor_RunErrorL(); + private: // Data + CMusCallStatusMonitor* iCallStatusMonitor; + RMobileCall iCall; + + + EUNIT_DECLARE_TEST_TABLE; + + }; + +#endif // __UT_CMusCallStatusMonitor_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_musconferencecallmonitor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_musconferencecallmonitor.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,101 @@ +/* +* 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: Monitor that observes the status of the current CS call +* +*/ + + + +#ifndef UT_MUSCONFERENCECALLMONITOR_H +#define UT_MUSCONFERENCECALLMONITOR_H + +#include "muscallstatusmonitorobserver.h" + +#include +#include + + +class CMusConferenceCallMonitor; + +/** + * Monitor, which observes status of current cs call + * Observers will be notified, when call status is idle + * i.e. call has ended. + * + * @lib ut_mushaoplugin.dll + */ +NONSHARABLE_CLASS( UT_CMusConferenceCallMonitor ) + : public CEUnitTestSuiteClass, public MMusCallStatusMonitorObserver + { + +public: // constructors and destructor + + /** + * Destructor. + */ + ~UT_CMusConferenceCallMonitor(); + + /** + * Two-phased constructor. Leaves on failure. + * @return The constructed CMusAoCallMonitorTest object. + */ + static UT_CMusConferenceCallMonitor* NewLC(); + +private: + + /** + * C++ constructor. + */ + UT_CMusConferenceCallMonitor(); + + /** + * Symbian 2nd-phase constructor. + */ + void ConstructL(); + + +private: // test MMusCallStatusMonitorObserver + + virtual void StatusChanged(); + + +public: + + void UT_IsEqual(); + + void UT_GetLastEventL(); + + void UT_RunL(); + + void UT_DoCancel(); + + void UT_RunError(); + + +private: + void SetupL(); + + void Teardown(); + +private: // data + + CMusConferenceCallMonitor* iMonitor; + + EUNIT_DECLARE_TEST_TABLE; + + TBool iStatusChanged; + + }; + +#endif // UT_MUSCONFERENCECALLMONITOR_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_musfactorysettings.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_musfactorysettings.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,71 @@ +/* +* 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_CMusFactorySettings_H__ +#define __UT_CMusFactorySettings_H__ + + +// EXTERNAL INCLUDES +#include +#include + + +// Forward declaration +class MusFactorySettings; +class CRepository; + +// Next row is to disable warning emerging from EUnit code. +// Placement is due to a fact that most test case files +// include this file. Directive can be removed when +// EUnit is fixed. +#pragma warn_illtokenpasting off + +// CLASS DEFINITION +/** + * Tester class for CMusCallMonitorBase. + * + */ +NONSHARABLE_CLASS( UT_CMusFactorySettings ): public CEUnitTestSuiteClass + { + public: + //Two phase construction + static UT_CMusFactorySettings* NewL(); + static UT_CMusFactorySettings* NewLC(); + // Destructor + ~UT_CMusFactorySettings(); + + private: // Constructor + UT_CMusFactorySettings(); + void ConstructL(); + + private: // Test case setup and teardown + void SetupL(); + void Teardown(); + + private: // Test methdods + void UT_CMusFactorySettings_IsSupportedLL(); + + private: // Data + CRepository* iMusCentralRepository ; + EUNIT_DECLARE_TEST_TABLE; + + }; + +#endif // __UT_CMusFactorySettings_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_muslineeventmonitor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_muslineeventmonitor.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,101 @@ +/* +* 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: Monitor that observes the status of the current CS call +* +*/ + + + +#ifndef MUSLINEEVENTMONITORTEST_H +#define MUSLINEEVENTMONITORTEST_H + +//#include +#include + +//#include "ut_musaocallmonitor.h" +#include "muscallstatusmonitorobserver.h" + +class CMusLineEventMonitor; + +/** + * Monitor, which observes status of current cs call + * Observers will be notified, when call status is idle + * i.e. call has ended. + * + * @lib ut_mushaoplugin.dll + */ +NONSHARABLE_CLASS( UT_CMusLineEventMonitor ) + : public CEUnitTestSuiteClass, public MMusCallStatusMonitorObserver + { + +public: // constructors and destructor + + /** + * Destructor. + */ + ~UT_CMusLineEventMonitor(); + + /** + * Two-phased constructor. Leaves on failure. + * @return The constructed UT_CMusAoCallMonitorTest object. + */ + static UT_CMusLineEventMonitor* NewLC(); + +private: + + /** + * C++ constructor. + */ + UT_CMusLineEventMonitor(); + + /** + * Symbian 2nd-phase constructor. + */ + void ConstructL(); + + +private: // test MMusCallStatusMonitorObserver + + virtual void StatusChanged(); + +public: // Unit test functions + + void UT_GetLineL(); + + void UT_RemoteHoldCountL(); + + void UT_RunLL(); + + void UT_DoCancelL(); + + void UT_RunErrorL(); + + void UT_AddCallEventMonitorLL(); + + void UT_RemoveCallEventMonitorLL(); + +private: + void SetupL(); + + void Teardown(); + +private: // data + + CMusLineEventMonitor* iMonitor; + + EUNIT_DECLARE_TEST_TABLE; + + }; + +#endif // MUSLINEEVENTMONITORTEST_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_muspropertymonitor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_muspropertymonitor.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,96 @@ +/* +* 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_CMusPropertyMonitor_H__ +#define __UT_CMusPropertyMonitor_H__ + + +// USER INCLUDES + +#include "mmuscallstateobserver.h" + +// EXTERNAL INCLUDES +#include +#include + +// FORWARD DECLARATIONS +class CMusPropertyMonitor; + +// Next row is to disable warning emerging from EUnit code. +// Placement is due to a fact that most test case files +// include this file. Directive can be removed when +// EUnit is fixed. +#pragma warn_illtokenpasting off + +// CLASS DEFINITION +/** + * Tester class for CMusTsyPropertyMonitor. + * + */ +NONSHARABLE_CLASS( UT_CMusPropertyMonitor ): public CEUnitTestSuiteClass, + MMusCallStateObserver + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static UT_CMusPropertyMonitor* NewL(); + static UT_CMusPropertyMonitor* NewLC(); + + /** + * Destructor + */ + ~UT_CMusPropertyMonitor(); + + + public: // MMusCallStateObserver + + virtual void MusCallStateChanged(); + + + private: // Constructors and destructors + + UT_CMusPropertyMonitor(); + void ConstructL(); + + private: // Test case setup and teardown + + void SetupL(); + + void Teardown(); + + private: // Test methdods + + void UT_CMusPropertyMonitor_RunLL(); + void UT_CMusPropertyMonitor_DoCancelL(); + void UT_CMusPropertyMonitor_RunErrorL(); + void UT_CMusPropertyMonitor_IsCallConnected(); + + private: // Data + CMusPropertyMonitor* iMusPropertyMonitor; + TBool iMusCallStateObserverInovked; + + + EUNIT_DECLARE_TEST_TABLE; + + }; + +#endif // __UT_CMusPropertyMonitor_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_muspttcallmonitor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_muspttcallmonitor.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,86 @@ +/* +* 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: Monitor that observes the status of the current CS call +* +*/ + + + +#ifndef UT_MUSPTTCALLMONITOR_H +#define UT_MUSPTTCALLMONITOR_H + +#include +#include "mmusptteventobserver.h" + +class CMusPttCallMonitor; + +/** + * Monitor, which observes status of Kodiak PTT Call * + * @lib ut_mushaoplugin.dll + */ +NONSHARABLE_CLASS( UT_CMusPTTCallMonitor ) + : public CEUnitTestSuiteClass,MMusPttEventObserver + { + +public: // constructors and destructor + /** + * Two-phased constructor. Leaves on failure. + * @return The constructed CMusAoCallMonitorTest object. + */ + static UT_CMusPTTCallMonitor* NewLC(); + + /** + * Destructor. + */ + ~UT_CMusPTTCallMonitor(); + +private: + + /** + * C++ constructor. + */ + UT_CMusPTTCallMonitor(); + + /** + * Symbian 2nd-phase constructor. + */ + void ConstructL(); + + void PttCallEventOccuredL(TPSCTsyKodiakPtt& /*aVal*/) + { + + }; + +public: + + void UT_RunLL(); + + void UT_IsPTTCallExistL(); + + void UT_DoCancelL(); + +private: + + void SetupL(); + + void Teardown(); + +private: // data + + CMusPttCallMonitor* iMonitor; + + EUNIT_DECLARE_TEST_TABLE; + }; + +#endif // UT_MUSPTTCALLMONITOR_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_musresourcefinderutil.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_musresourcefinderutil.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,81 @@ +/* +* 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_MUSRESOURCEFINDERUTIL_H__ +#define __UT_MUSRESOURCEFINDERUTIL_H__ + + +// EXTERNAL INCLUDES +#include +#include + +// FORWARD DECLARATIONS + +// Next row is to disable warning emerging from EUnit code. +// Placement is due to a fact that most test case files +// include this file. Directive can be removed when +// EUnit is fixed. +#pragma warn_illtokenpasting off + +// CLASS DEFINITION +/** + * Tester class for MusResourceFinderUtil. + * + */ +NONSHARABLE_CLASS( UT_MusResourceFinderUtil ): public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static UT_MusResourceFinderUtil* NewL(); + static UT_MusResourceFinderUtil* NewLC(); + + /** + * Destructor + */ + ~UT_MusResourceFinderUtil(); + + private: // Constructors and destructors + + UT_MusResourceFinderUtil(); + void ConstructL(); + + private: // Test case setup and teardown + + void SetupL(); + + void Teardown(); + + private: // Test methdods + + void UT_MusResourceFinderUtil_ResourcePathLL(); + void UT_MusResourceFinderUtil_AppResourcePathLL(); + void UT_MusResourceFinderUtil_IsExistLL(); + + private: // Data + + + EUNIT_DECLARE_TEST_TABLE; + + }; + +#endif // __UT_MUSRESOURCEFINDERUTIL_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_mustsypropertymonitor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_mustsypropertymonitor.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,105 @@ +/* +* 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_CMusTsyPropertyMonitor_H__ +#define __UT_CMusTsyPropertyMonitor_H__ + + +// USER INCLUDE +#include "mmuscallstateobserver.h" + +// EXTERNAL INCLUDES +#include +#include + +// FORWARD DECLARATIONS +class CMusCommonObserverStub; +class CMusTsyPropertyMonitor; +class CRepository; + +// Next row is to disable warning emerging from EUnit code. +// Placement is due to a fact that most test case files +// include this file. Directive can be removed when +// EUnit is fixed. +#pragma warn_illtokenpasting off + +// CLASS DEFINITION +/** + * Tester class for CMusTsyPropertyMonitor. + * + */ +NONSHARABLE_CLASS( UT_CMusTsyPropertyMonitor ): public CEUnitTestSuiteClass, + MMusCallStateObserver + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static UT_CMusTsyPropertyMonitor* NewL(); + static UT_CMusTsyPropertyMonitor* NewLC(); + + /** + * Destructor + */ + ~UT_CMusTsyPropertyMonitor(); + + + public: // MMusCallStateObserver + + virtual void MusCallStateChanged(); + + + private: // Constructors and destructors + + UT_CMusTsyPropertyMonitor(); + void ConstructL(); + + private: // Test case setup and teardown + + void SetupL(); + void Teardown(); + + private: // Test methdods + + void UT_CMusTsyPropertyMonitor_NewLL(); + void UT_CMusTsyPropertyMonitor_RunLL(); + void UT_CMusTsyPropertyMonitor_DoCancelL(); + void UT_CMusTsyPropertyMonitor_RunErrorL(); + void UT_CMusTsyPropertyMonitor_AddCallMonitorLL(); + void UT_CMusTsyPropertyMonitor_RemoveCallMonitorL(); + void UT_CMusTsyPropertyMonitor_MonitorCSCallLL(); + void UT_CMusTsyPropertyMonitor_MonitorVoipCallLL(); + void UT_CMusTsyPropertyMonitor_MonitorCallLL(); + void UT_CMusTsyPropertyMonitor_RemoveUnUsedCallMonitorsL(); + void UT_CMusTsyPropertyMonitor_CheckCallCriteriaLL(); + void UT_CMusTsyPropertyMonitor_IsDataReadyLL(); + + private: // Data + CMusTsyPropertyMonitor* iMusTsyPropertyMonitor; + RMobilePhone iPhone; + CRepository* iMusCentralRepository ; + + + EUNIT_DECLARE_TEST_TABLE; + + }; + +#endif // __UT_CMusTsyPropertyMonitor_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_musvoipcallmonitor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/inc/ut_musvoipcallmonitor.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,93 @@ +/* +* 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_CMusVoipCallMonitor_H__ +#define __UT_CMusVoipCallMonitor_H__ + +// USER INCLUDE +#include "mmuscallstateobserver.h" + +// EXTERNAL INCLUDES +#include +#include +#include + +// INTERNAL INCLUDES + +// Forward declaration +class CMusVoipCallMonitor; + + +// Next row is to disable warning emerging from EUnit code. +// Placement is due to a fact that most test case files +// include this file. Directive can be removed when +// EUnit is fixed. +#pragma warn_illtokenpasting off + +// CLASS DEFINITION +/** + * Tester class for CMusCallMonitorBase. + * + */ +NONSHARABLE_CLASS( UT_CMusVoipCallMonitor ): public CEUnitTestSuiteClass, + MMusCallStateObserver + { + public: + //Two phase construction + static UT_CMusVoipCallMonitor* NewL(); + static UT_CMusVoipCallMonitor* NewLC(); + // Destructor + ~UT_CMusVoipCallMonitor(); + + public: // From MMusCallStateObserver + + virtual void MusCallStateChanged(); + + private: // Constructor + UT_CMusVoipCallMonitor(); + void ConstructL(); + + private: // Test case setup and teardown + void SetupL(); + void Teardown(); + + private: // Test methdods + void UT_CMusVoipCallMonitor_IsEqualL(); + void UT_CMusVoipCallMonitor_SetStateLL(); + void UT_CMusVoipCallMonitor_SetCallInfoLL(); + void UT_CMusVoipCallMonitor_SetCallInfoLOverflowL(); + + void TestSetCallInfoLL( const TDesC& aSipUriFromTelephony, + const TDesC& aSipUriPassedToMus ); + void UT_CMusVoipCallMonitor_SetCallProviderInfoLL(); + void UT_CMusVoipCallMonitor_AddDomainFromOwnUsernameLL(); + + void UT_CMusVoipCallMonitor_IsDataReadyLL(); + void UT_CMusVoipCallMonitor_ResetCallProviderNameL(); + + private: // Data + CMusVoipCallMonitor* iVoipCallMonitor; + RTelServer iTelServer; + + EUNIT_DECLARE_TEST_TABLE; + + }; + +#endif // __UT_CMusVoipCallMonitor_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/muscommonstubs.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/muscommonstubs.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,136 @@ +/* +* Copyright (c) 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: +* +*/ + + +#include "muscommonstubs.h" + + +// ---- MEMBER FUNCTIONS OF CMusEngObserverStub -------------------------------- + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusCommonObserverStub::CMusCommonObserverStub() + :iCallEvent( static_cast(-1) ) + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusCommonObserverStub::~CMusCommonObserverStub() + { + delete iTelNumber; + iTelNumber = NULL; + } + + +// ----- From MMusCallMonitorObserver ------------------------------------------ + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusCommonObserverStub::CallConnectedL( const TDesC& aTelNumber, + TBool aIsSipUri ) + { + delete iTelNumber; + iTelNumber = NULL; + iTelNumber = aTelNumber.AllocL(); + iCallConnectedCalled = ETrue; + iIsSipUri = aIsSipUri; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusCommonObserverStub::CallHoldL( const TDesC& aTelNumber, + TBool aIsSipUri ) + { + delete iTelNumber; + iTelNumber = NULL; + iTelNumber = aTelNumber.AllocL(); + iCallHoldCalled = ETrue; + iIsSipUri = aIsSipUri; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusCommonObserverStub::ConferenceCallL() + { + iConferenceCallCalled = ETrue; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusCommonObserverStub::NoActiveCallL() + { + iNoActiveCallCalled = ETrue; + } + + + + +// ----- HELPERS --------------------------------------------------------------- + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMusCommonObserverStub::IsReseted() + { + return ( iCallConnectedCalled == EFalse && + iCallHoldCalled == EFalse && + iConferenceCallCalled == EFalse && + iNoActiveCallCalled == EFalse && + !iTelNumber && + iCallEvent == -1 ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusCommonObserverStub::Reset() + { + iCallConnectedCalled = EFalse; + iCallHoldCalled = EFalse; + iConferenceCallCalled = EFalse; + iNoActiveCallCalled = EFalse; + + delete iTelNumber; + iTelNumber = NULL; + + iCallEvent = static_cast(-1); + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_aopluginDllMain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_aopluginDllMain.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,90 @@ +/* +* 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: +* +*/ + +// EXTERNAL INCLUDES +#include + +#include "ut_musaoplugin.h" +#include "ut_muspropertymonitor.h" +#include "ut_muspttcallmonitor.h" +#include "ut_muscallmonitor.h" +#include "ut_muscallstatusmonitor.h" +#include "ut_muscalleventmonitor.h" +#include "ut_muscallconferenceeventmonitor.h" +#include "ut_muscallconferencemonitor.h" +#include "ut_muscallmonitorbase.h" +#include "ut_musresourcefinderutil.h" +#include "ut_mustsypropertymonitor.h" +#include "ut_musvoipcallmonitor.h" +#include "ut_musfactorysettings.h" + +/** + * Test suite factory function. + */ +EXPORT_C MEUnitTest* CreateTestSuiteL() + { + CEUnitTestSuite* rootSuite = CEUnitTestSuite::NewLC(_L("Mush AOPlugin")); + + rootSuite->AddL( UT_CMusAoPlugin::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusPropertyMonitor::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusPTTCallMonitor::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusCallConferenceMonitor::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusCallStatusMonitor::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusCallEventMonitor::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusCallMonitor::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusTsyPropertyMonitor::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_MusResourceFinderUtil::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusCallConferenceEventMonitor::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusCallMonitorBase::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusFactorySettings::NewLC() ); + CleanupStack::Pop(); + + CleanupStack::Pop( rootSuite ); + return rootSuite; + } + + + +// END OF FILE + + + + + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_musaocalleventmonitor.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_musaocalleventmonitor.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,286 @@ +/* +* 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: Monitor that observes the status of the current CS call +* +*/ + +#include "ut_musaocalleventmonitor.h" +#include "musaocalleventmonitor.h" +#include "mussesseioninformationapi.h" + +/* +#include "muscallmonitor.h" +#include "muscalleventmonitor.h" +#include "musaoplugin.h" +#include "ut_muscalleventmonitor.h" +#include "mussesseioninformationapi.h" +*/ + +#include +#include +#include +#include + + +#pragma warn_illtokenpasting off + +_LIT( KEmptyTelNumber, ""); + + +// ----------------------------------------------------------------------------- +// Symbian two-phase constructor. +// ----------------------------------------------------------------------------- +// +UT_CMusAoCallEventMonitor* UT_CMusAoCallEventMonitor::NewLC() + { + UT_CMusAoCallEventMonitor* self = new (ELeave) UT_CMusAoCallEventMonitor(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// ----------------------------------------------------------------------------- +// Symbian second-phase constructor. +// ----------------------------------------------------------------------------- +// +void UT_CMusAoCallEventMonitor::ConstructL() + { + CEUnitTestSuiteClass::ConstructL(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusAoCallEventMonitor::CallConnectedL( const TDesC& /*aTelNumber*/, + TBool /*aIsSipUri*/ ) + { + iCallConnected = ETrue; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusAoCallEventMonitor::CallHoldL( const TDesC& /*aTelNumber*/, + TBool /*aIsSipUri*/ ) + { + iCallHold = ETrue; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusAoCallEventMonitor::ConferenceCallL() + { + iConferenceCall = ETrue; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusAoCallEventMonitor::NoActiveCallL() + { + iNoActiveCall = ETrue; + } + + +// ----------------------------------------------------------------------------- +// C++ constructor. +// ----------------------------------------------------------------------------- +// +UT_CMusAoCallEventMonitor::UT_CMusAoCallEventMonitor() + : CEUnitTestSuiteClass() + { + // nothing + } + + +// ----------------------------------------------------------------------------- +// C++ destructor. +// ----------------------------------------------------------------------------- +// +UT_CMusAoCallEventMonitor::~UT_CMusAoCallEventMonitor() + { + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusAoCallEventMonitor::UT_ConnectedCallCountLL() + { + iMonitor->iCallCount = 2; + iMonitor->ConnectedCallCountL(); + EUNIT_ASSERT_EQUALS( iMonitor->ConnectedCallCountL(), 2); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusAoCallEventMonitor::UT_RunLL() + { + ResetObserverFlags(); + iMonitor->RunL(); + iMonitor->Cancel(); + EUNIT_ASSERT( iNoActiveCall ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusAoCallEventMonitor::UT_ExamineEventLL() + { + + ResetObserverFlags(); + iMonitor->ExamineEventL( NMusSessionInformationApi::ENoCall ); + EUNIT_ASSERT( iNoActiveCall ) + + ResetObserverFlags(); + iMonitor->ExamineEventL( NMusSessionInformationApi::EConferenceCall ); + EUNIT_ASSERT( iConferenceCall ) + + // Without telephony number + ResetObserverFlags(); + iMonitor->ExamineEventL( NMusSessionInformationApi::ECallConnected ); + EUNIT_ASSERT( iNoActiveCall ) + + ResetObserverFlags(); + iMonitor->ExamineEventL( NMusSessionInformationApi::ECallHold ); + EUNIT_ASSERT( iNoActiveCall ) + + + // 6. telephone number + RProperty::Define( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusTelNumber, + RProperty::EText, + 0 ); + User::LeaveIfError( RProperty::Set( + NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusTelNumber, + KEmptyTelNumber ) ); + + + // With telephony number + ResetObserverFlags(); + iMonitor->ExamineEventL( NMusSessionInformationApi::ECallConnected ); + EUNIT_ASSERT( iCallConnected ) + + ResetObserverFlags(); + iMonitor->ExamineEventL( NMusSessionInformationApi::ECallHold ); + EUNIT_ASSERT( iCallHold ) + + // 6. telephone number + RProperty::Delete( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusTelNumber ); + + RProperty::Delete( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallCount ); + + + // 7. call count + RProperty::Define( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallCount, + RProperty::EInt, + 0 ); + ResetObserverFlags(); + iMonitor->ExamineEventL( KErrNotFound ); + EUNIT_ASSERT( iNoActiveCall ); + + // 7. call count + RProperty::Delete( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallCount ); + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusAoCallEventMonitor::SetupL() + { + RMobilePhone phone; + iMonitor = CMusAoCallEventMonitor::NewL( *this ); + iMonitor->Cancel(); + + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusAoCallEventMonitor::Teardown() + { + delete iMonitor; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusAoCallEventMonitor::ResetObserverFlags() + { + iCallConnected = EFalse; + iCallHold = EFalse; + iConferenceCall = EFalse; + iNoActiveCall = EFalse; + } + + +// test table + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusAoCallEventMonitor, + "UT_CMusAoCallEventMonitor", + "UNIT" ) + +EUNIT_TEST( + "UT_ConnectedCallCountL", + "CMusCallEventMonitor", + "ConnectedCallCountL", + "FUNCTIONALITY", + SetupL, UT_ConnectedCallCountLL, Teardown) + +EUNIT_TEST( + "UT_RunL", + "CMusCallEventMonitor", + "RunL", + "FUNCTIONALITY", + SetupL, UT_RunLL, Teardown) + +EUNIT_TEST( + "UT_ExamineEventL", + "CMusCallEventMonitor", + "ExamineEventL", + "FUNCTIONALITY", + SetupL, UT_ExamineEventLL, Teardown) + + +EUNIT_END_TEST_TABLE diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_musaoplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_musaoplugin.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,541 @@ +/* +* 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: Main plugin class +* +*/ + + +#include "ut_musaoplugin.h" +#include "muscallmonitor.h" +#include "musaoplugin.h" +#include "mustsypropertymonitor.h" +#include "musresourceproperties.h" +#include "mussesseioninformationapi.h" +#include "mussettings.inl" + + +#include +#include +#include +#include + +#pragma warn_illtokenpasting off + +_LIT( KEmptyTelNumber, ""); +_LIT( KEmptyProviderName, ""); + +_LIT(KTestTelNumber,"+3585050"); + + +// ----------------------------------------------------------------------------- +// Symbian two-phase constructor. +// ----------------------------------------------------------------------------- +// +UT_CMusAoPlugin* UT_CMusAoPlugin::NewLC() + { + UT_CMusAoPlugin* self = new (ELeave) UT_CMusAoPlugin(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// ----------------------------------------------------------------------------- +// C++ destructor. +// ----------------------------------------------------------------------------- +// +UT_CMusAoPlugin::~UT_CMusAoPlugin() + { + } + + +// ----------------------------------------------------------------------------- +// C++ constructor. +// ----------------------------------------------------------------------------- +// +UT_CMusAoPlugin::UT_CMusAoPlugin() + : CEUnitTestSuiteClass() + { + } + + +// ----------------------------------------------------------------------------- +// Symbian second-phase constructor. +// ----------------------------------------------------------------------------- +// +void UT_CMusAoPlugin::ConstructL() + { + CEUnitTestSuiteClass::ConstructL(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusAoPlugin::SetupL( ) + { + TInt keyValue = 0; + MultimediaSharingSettings::SetPropertyValueL( + MusSettingsKeys::KProductModeVariation,keyValue); + iPlugin = CMusAoPlugin::NewL(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusAoPlugin::Teardown( ) + { + delete iPlugin; + iPlugin = NULL ; + PropertyHelper::Close(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusAoPlugin::DefinePropertiesLL() + { +/* Test 1 */ + TInt res = KErrNone; + TInt err = KErrNone; + /* Set Product Mode variation key value to + 00 - VideoPlayer always available + 0-Keypad available dynamic + 00-Keypad Usuable in portrait + 0-Camera available static + 00-Usuable Always + 00000000 = 0 (Int) + */ + TInt keyValue = 0; + MultimediaSharingSettings::SetPropertyValueL( + MusSettingsKeys::KProductModeVariation,keyValue); + iPlugin->DefinePropertiesL(); + // It should not configure any PS keys for camera + // Check the stub whether define is called. + err = RProperty::Get( NMusResourceApi::KCategoryUid, + NMusResourceApi::KCameraAvailability, + keyValue ); + EUNIT_ASSERT(keyValue == KErrNotFound ); + // Keypad availability is static . + // Check the stub whether define is called. + err = RProperty::Get( NMusResourceApi::KCategoryUid, + NMusResourceApi::KKeypadAvailability, + keyValue ); + + EUNIT_ASSERT(keyValue == KErrNotFound ); + + iPlugin->DeleteProperties(); + + +/* Test 2 */ + + /* Set Product Mode variation key value to + 11 - VideoPlayer always available + 1-Keypad available dynamic + 11-Keypad Usuable in portrait + 1-Camera available static + 11-Usuable Always + 11111111 = 255 (Int) + */ + keyValue = 255; + MultimediaSharingSettings::SetPropertyValueL( + MusSettingsKeys::KProductModeVariation,keyValue); + PropertyHelper::SetErrorCode(KErrNone); + iPlugin->DefinePropertiesL(); + // It should configure any PS keys for Keypad + // Check the stub whether define is called. + err = RProperty::Get( NMusResourceApi::KCategoryUid, + NMusResourceApi::KKeypadAvailability, + keyValue ); + EUNIT_ASSERT(keyValue ==NMusResourceApi::ENotAvailable ); + + // camera availability is dynamic . + // so it must define a property + // Check the stub whether define is called. + err = RProperty::Get( NMusResourceApi::KCategoryUid, + NMusResourceApi::KCameraAvailability, + keyValue ); + EUNIT_ASSERT(keyValue == NMusResourceApi::ENotAvailable ); + iPlugin->DeleteProperties(); + + /* Test 3 */ + + iPlugin->DefinePropertiesL(); + + res = KErrNone; + // camera information property + res = RProperty::Get( NMusResourceApi::KCategoryUid, + NMusResourceApi::KCameraInformation, + keyValue ); + EUNIT_ASSERT_EQUALS( keyValue, NMusResourceApi::EUsePrimaryCamera ) + + // call event + RProperty::Get(NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + keyValue ); + EUNIT_ASSERT_EQUALS( keyValue, NMusSessionInformationApi::ENoCall ) + + // phone number + TBuf<15> telnumber; // TODO change to des + User::LeaveIfError( RProperty::Get( + NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusTelNumber, + telnumber ) ); + EUNIT_ASSERT_EQUALS( telnumber.Compare( KEmptyTelNumber ), KErrNone ) + + // callprovider + TBuf<15> callprovider; + User::LeaveIfError( RProperty::Get( + NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMUSCallProvider, + callprovider ) ); + EUNIT_ASSERT_EQUALS( callprovider.Compare( KEmptyProviderName ), KErrNone ) + + + + + // Mus allowed + RProperty::Get(NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMUSForbidden, + keyValue ) ; + EUNIT_ASSERT_EQUALS( keyValue, NMusSessionInformationApi::EMUSAllowed ) + + // Call direction + RProperty::Get(NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallDirection, + keyValue ) ; + EUNIT_ASSERT_EQUALS( keyValue, NMusSessionInformationApi::ENoDirection ) + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusAoPlugin::DefinePropertyL_IntPropertyL() + { + // Normal succcesfull case + const TInt KTestAvailability( 0x10282300 ); // Imaginary test value + const TInt KTestValue = 50; // Imaginary test value + iPlugin->DefinePropertyL( KTestAvailability, RProperty::EInt, KTestValue ); + + TInt keyValueInPS( 0 ); + User::LeaveIfError( RProperty::Get( NMusSessionInformationApi::KCategoryUid, + KTestAvailability, + keyValueInPS ) ); + EUNIT_ASSERT_EQUALS( keyValueInPS, KTestValue ) + + // When trying to define existing property, we are not supposed to + // overwrite already existing value + const TInt KTestValue100 = 100; // Imaginary test value + PropertyHelper::SetErrorCode( KErrAlreadyExists ); + iPlugin->DefinePropertyL( KTestAvailability, + RProperty::EInt, + KTestValue100 ); + PropertyHelper::SetErrorCode( KErrNone ); + + User::LeaveIfError( RProperty::Get( NMusSessionInformationApi::KCategoryUid, + KTestAvailability, + keyValueInPS ) ); + EUNIT_ASSERT_EQUALS( keyValueInPS, KTestValue ) // Value not changed + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusAoPlugin::DefinePropertyL_DesCPropertyL() + { + // Normal succcesfull case + const TInt KTestAvailability( 0x10282300 ); // Imaginary test value + _LIT( KTestValue, "TestValue" ); // Imaginary test value + iPlugin->DefinePropertyL( KTestAvailability, RProperty::EText, KTestValue ); + + TBuf<100> keyValueInPS( KNullDesC ); + User::LeaveIfError( RProperty::Get( NMusSessionInformationApi::KCategoryUid, + KTestAvailability, + keyValueInPS ) ); + EUNIT_ASSERT_EQUALS( keyValueInPS, KTestValue ) + + // When trying to define existing property, we are not supposed to + // overwrite already existing value + _LIT( KNewTestValue, "NewTestValue" ); // Imaginary test value + PropertyHelper::SetErrorCode( KErrAlreadyExists ); + iPlugin->DefinePropertyL( KTestAvailability, + RProperty::EText, + KNewTestValue ); + PropertyHelper::SetErrorCode( KErrNone ); + + User::LeaveIfError( RProperty::Get( NMusSessionInformationApi::KCategoryUid, + KTestAvailability, + keyValueInPS ) ); + EUNIT_ASSERT_EQUALS( keyValueInPS, KTestValue ) // Value not changed + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusAoPlugin::DeletePropertiesL() + { + // Initialize + iPlugin->DefinePropertiesL(); + // and delete all + iPlugin->DeleteProperties(); + + TInt res = KErrNone; + TInt ret = KErrNone; + // camera availability + ret = RProperty::Get( NMusResourceApi::KCategoryUid, + NMusResourceApi::KCameraAvailability, + res ); + EUNIT_ASSERT_EQUALS( ret, KErrNotFound ) + ret = KErrNone; + + + // keybad availability + ret = RProperty::Get( NMusResourceApi::KCategoryUid, + NMusResourceApi::KKeypadAvailability, + res ); + EUNIT_ASSERT_EQUALS( ret, KErrNotFound ) + ret = KErrNone; + + // videoplayer availability + ret = RProperty::Get( NMusResourceApi::KCategoryUid, + NMusResourceApi::KVideoPlayerAvailability, + res ); + EUNIT_ASSERT_EQUALS( ret, KErrNotFound ) + ret = KErrNone; + + // camera information property + ret = RProperty::Get( NMusResourceApi::KCategoryUid, + NMusResourceApi::KCameraInformation, + res ); + EUNIT_ASSERT_EQUALS( ret, KErrNotFound ) + ret = KErrNone; + + // call event + ret = RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + res ); + EUNIT_ASSERT_EQUALS( ret, KErrNotFound ) + ret = KErrNone; + + // phone number + /* hard to provide stub impl + TBuf<15> telnumber; // TODO change to des + ret = RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusTelNumber, + telnumber ); + EUNIT_ASSERT_EQUALS( ret, KErrNotFound ) + */ + + ret = KErrNone; + + // Mus allowed + ret = RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMUSForbidden, + res ); + EUNIT_ASSERT_EQUALS( ret, KErrNotFound ) + ret = KErrNone; + + // Call direction + ret = RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallDirection, + res ); + EUNIT_ASSERT_EQUALS( ret, KErrNotFound ) + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusAoPlugin::UT_HandleServerCommandLL() + { + TAny* a = iPlugin->HandleServerCommandL( EAOManagerPluginStart, NULL ); + EUNIT_ASSERT( a ) + } + + + +// ----------------------------------------------------------------------------- +// Test Starting MushClient +// ----------------------------------------------------------------------------- +// + +void UT_CMusAoPlugin::UT_StartMusClientL() + { + // Ensure MushAO Plugin Exisit + EUNIT_ASSERT( iPlugin); + // Mush Manager Client process is not Created + EUNIT_ASSERT( !iPlugin->iManager ); + + // Test1: Ensure Start really creates the MushClient process + iPlugin->StartMusClientL(); + EUNIT_ASSERT( iPlugin->iManager ); + + // Test2: Trying to Create Client process again if it already exisit. + iPlugin->StartMusClientL(); + EUNIT_ASSERT( iPlugin->iManager ); + + //Reset Plugin Data. + iPlugin->StopMusClient(); + } + + +// ----------------------------------------------------------------------------- +// Test Starting MushClient +// ----------------------------------------------------------------------------- +// + +void UT_CMusAoPlugin::UT_StopMusClientL() + { + EUNIT_ASSERT( iPlugin); + EUNIT_ASSERT( !iPlugin->iManager ); + + // Test1: Deleteing Mush Cient when it does not exisit + iPlugin->StopMusClient(); + EUNIT_ASSERT( !iPlugin->iManager ); + + // Create Mush Client process + iPlugin->StartMusClientL(); + EUNIT_ASSERT( iPlugin->iManager ); + + // Test2: Deleting Mush Client when it Exisit. + iPlugin->StopMusClient(); + EUNIT_ASSERT( !iPlugin->iManager ); + } + + +// ----------------------------------------------------------------------------- +// From MMusCallStateObserver +// Test MushCall State Changed +// ----------------------------------------------------------------------------- +// + +void UT_CMusAoPlugin::UT_MusCallStateChangedL() + { + TName cs_call_1(_L("cs_call_1")); + + // Test 1: Data Ready: Call Connected: -> Start Mush + + // Add Some dummy CS Call + // Set Call Connected: + // Set the Required Data. + iPlugin->iTsyPropertyMonitor->AddCallMonitorL( cs_call_1); + + User::LeaveIfError(RProperty::Set( + NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + NMusSessionInformationApi::ECallConnected )); + + User::LeaveIfError( RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusTelNumber, + KTestTelNumber )); + + User::LeaveIfError( RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallDirection, + NMusSessionInformationApi::ECallOrginated )); + + // This can not be tested easily wit M-ALLOC + EUNIT_DISABLE_ALLOC_DECORATOR; + iPlugin->MusCallStateChanged(); + + EUNIT_ASSERT( iPlugin->iManager ) + EUNIT_ENABLE_ALLOC_DECORATOR; + + // Test 2: Data Not Ready: Call Connected: -> Stop Mush + User::LeaveIfError(RProperty::Set( + NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + NMusSessionInformationApi::ENoCall )); + + iPlugin->MusCallStateChanged(); + EUNIT_ASSERT( !iPlugin->iManager ) + } + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusAoPlugin, + "UT_CMusAoPlugin", + "UNIT") + +EUNIT_TEST( + "DefinePropertiesLL", + "CMusAoPlugin", + "DefinePropertiesL", + "FUNCTIONALITY", + SetupL, DefinePropertiesLL, Teardown) + +EUNIT_TEST( + "DefinePropertyL (int param)", + "CMusAoPlugin", + "DefinePropertyL", + "FUNCTIONALITY", + SetupL, DefinePropertyL_IntPropertyL, Teardown) + +EUNIT_TEST( + "DefinePropertyL (desc param)", + "CMusAoPlugin", + "DefinePropertyL", + "FUNCTIONALITY", + SetupL, DefinePropertyL_DesCPropertyL, Teardown) + +EUNIT_TEST( + "DeleteProperties", + "CMusAoPlugin", + "DeleteProperties", + "FUNCTIONALITY", + SetupL, DeletePropertiesL, Teardown) + +EUNIT_TEST( + "HandleServerCommandL", + "CMusAoPlugin", + "HandleServerCommandL", + "FUNCTIONALITY", + SetupL, UT_HandleServerCommandLL, Teardown) + +EUNIT_TEST( + "StartMusClient", + "CMusAoPlugin", + "StartMusClient", + "FUNCTIONALITY", + SetupL, UT_StartMusClientL, Teardown) + +EUNIT_TEST( + "StopMusClient", + "CMusAoPlugin", + "StopMusClient", + "FUNCTIONALITY", + SetupL, UT_StopMusClientL, Teardown) + +EUNIT_TEST( + "MusCallStateChanged", + "CMusAoPlugin", + "MusCallStateChanged", + "FUNCTIONALITY", + SetupL, UT_MusCallStateChangedL, Teardown) + + +EUNIT_END_TEST_TABLE diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_musaopluginmain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_musaopluginmain.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,131 @@ +/* +* 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: Main plugin class +* +*/ + + + + +#include +#include +#include + +#include "musaocallmonitor.h" +#include "musaoplugin.h" +#include "musaoplugintest.h" +#include "muslogger.h" +#include "musmanager.h" + +// -------------------------------------------------------------------------- +// C++ constructor. +// -------------------------------------------------------------------------- +// +CMusAoPluginTest::CMusAoPluginTest() + { + } + + +// -------------------------------------------------------------------------- +// Symbian two-phase constructor. +// -------------------------------------------------------------------------- +// +CMusAoPluginTest* CMusAoPluginTest::NewL() + { + CMusAoPluginTest* self = new (ELeave) CMusAoPluginTest(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +// -------------------------------------------------------------------------- +// Symbian second-phase constructor. +// -------------------------------------------------------------------------- +// +void CMusAoPluginTest::ConstructL() + { + } + + +// -------------------------------------------------------------------------- +// C++ destructor. +// -------------------------------------------------------------------------- +// +CMusAoPluginTest::~CMusAoPluginTest() + { + } + +// -------------------------------------------------------------------------- +// -------------------------------------------------------------------------- +// +void CMusAoPluginTest::HandleServerCommandL() + { + iPlugin->HandleServerCommandL( EAOManagerPluginStart, NULL ); + iPlugin->HandleServerCommandL( EAOManagerPluginStop, NULL ); + iPlugin->HandleServerCommandL( EAOManagerNWOpsNotAllowed, NULL ); + iPlugin->HandleServerCommandL( EAOManagerNWOpsAllowed, NULL ); + iPlugin->HandleServerCommandL( EAOManagerStartedRoaming, NULL ); + iPlugin->HandleServerCommandL( EAOManagerStoppedRoaming, NULL ); + iPlugin->HandleServerCommandL( EAOManagerDiskSpaceAboveCritical, NULL ); + iPlugin->HandleServerCommandL( EAOManagerDiskSpaceBelowCritical, NULL ); + } + + +// -------------------------------------------------------------------------- +// From base class MMusAoCallMonitorObserver. +// -------------------------------------------------------------------------- +// +void CMusAoPluginTest::LineStatusChange() + { + iPlugin->LineStatusChange( MMusAoCallMonitorObserver::ELineConnected ); + iPlugin->LineStatusChange( MMusAoCallMonitorObserver::ELineDisconnected ); + iPlugin->LineStatusChange( MMusAoCallMonitorObserver::EUnknown ); + } + +void CMusAoPluginTest::SetupL( ) + { + iPlugin = CMusAoPlugin::NewL(); + } + +void CMusAoPluginTest::Teardown( ) + { + delete iPlugin; + } + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + CMusAoPluginTest, + "CMusAoPluginTest", + "CMusAoPluginTest" ) + +EUNIT_TEST( + "CMusAoPluginTest", + "CMusAoPluginTest", + "HandleServerCommandL", + "FUNCTIONALITY", + SetupL, HandleServerCommandL, Teardown) + +EUNIT_TEST( + "CMusAoPluginTest", + "CMusAoPluginTest", + "LineStatusChange", + "FUNCTIONALITY", + SetupL, LineStatusChange, Teardown) + + +EUNIT_END_TEST_TABLE + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_muscallconferenceeventmonitor.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_muscallconferenceeventmonitor.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,297 @@ +/* +* 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: +* +*/ + + +// INTERNAL INCLUDES +#include "ut_muscallconferenceeventmonitor.h" +#include "muscallconferenceeventmonitor.h" +#include "e32property.h" +//#include "muscommonstubs.h" + +// SYSTEM INCLUDES +#include + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusCallConferenceEventMonitor* UT_CMusCallConferenceEventMonitor::NewL() + { + UT_CMusCallConferenceEventMonitor* self = UT_CMusCallConferenceEventMonitor::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusCallConferenceEventMonitor* UT_CMusCallConferenceEventMonitor::NewLC() + { + UT_CMusCallConferenceEventMonitor* self = new( ELeave ) UT_CMusCallConferenceEventMonitor(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusCallConferenceEventMonitor::~UT_CMusCallConferenceEventMonitor() + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// Default constructor +// ----------------------------------------------------------------------------- +// +UT_CMusCallConferenceEventMonitor::UT_CMusCallConferenceEventMonitor() + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// Second phase construct +// ----------------------------------------------------------------------------- +// +void UT_CMusCallConferenceEventMonitor::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusCallConferenceEventMonitor::SetupL() + { + + //setup + /* + RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallCount, + 1 ); + */ + RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + 0 ); + + iConferenceCallEventMonitor = + CMusCallConferenceEventMonitor::NewL( iMobilePhone, + iLine , + iCallMonitorArray ); + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusCallConferenceEventMonitor::Teardown() + { + delete iConferenceCallEventMonitor; + PropertyHelper::Close(); + iMobilePhone.Close(); + iLine.Close(); + iCallMonitorArray.ResetAndDestroy(); + + + } + + + +// TEST CASES + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusCallConferenceEventMonitor::UT_CMusCallConferenceEventMonitor_NewLL() + { + EUNIT_ASSERT( iConferenceCallEventMonitor ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusCallConferenceEventMonitor::UT_CMusCallConferenceEventMonitor_RunLL() + { + TInt val = RMobileConferenceCall::EConferenceCallRemoved ; + EUNIT_ASSERT( iConferenceCallEventMonitor ); + + RTelHelper::SetConfEvent( RMobileConferenceCall::EConferenceCallRemoved ); + iConferenceCallEventMonitor->SetStateL( NMusSessionInformationApi::ENoCall ); + iConferenceCallEventMonitor->Cancel(); // Cancel the active object + iConferenceCallEventMonitor->RunL(); + RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + val ); + EUNIT_ASSERT( val==NMusSessionInformationApi::ENoCall); + + RTelHelper::SetConfEvent ( RMobileConferenceCall::EConferenceBuilt); + iConferenceCallEventMonitor->Cancel(); // Cancel the active object + iConferenceCallEventMonitor->RunL(); + RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + val ); + EUNIT_ASSERT( val==NMusSessionInformationApi::EConferenceCall); + + RTelHelper::SetConfEvent( RMobileConferenceCall::EConferenceTerminated ); + iConferenceCallEventMonitor->SetStateL( NMusSessionInformationApi::ENoCall ); + iConferenceCallEventMonitor->Cancel(); // Cancel the active object + iConferenceCallEventMonitor->RunL(); + RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + val ); + EUNIT_ASSERT( val==NMusSessionInformationApi::ENoCall); + + RTelHelper::SetConfEvent( RMobileConferenceCall::EConferenceSwapped ); + iConferenceCallEventMonitor->SetStateL( NMusSessionInformationApi::ENoCall ); + iConferenceCallEventMonitor->Cancel(); // Cancel the active object + iConferenceCallEventMonitor->RunL(); + RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + val ); + EUNIT_ASSERT( val==NMusSessionInformationApi::EConferenceCall); + + RTelHelper::SetConfEvent( RMobileConferenceCall::EConferenceSplit); + iConferenceCallEventMonitor->SetStateL( NMusSessionInformationApi::ENoCall ); + iConferenceCallEventMonitor->Cancel(); // Cancel the active object + iConferenceCallEventMonitor->RunL(); + RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + val ); + EUNIT_ASSERT( val==NMusSessionInformationApi::EConferenceCall ); + + RTelHelper::SetConfEvent( (RMobileConferenceCall::TMobileConferenceEvent)152090 ); + iConferenceCallEventMonitor->SetStateL( NMusSessionInformationApi::ENoCall ); + iConferenceCallEventMonitor->SetStateL( NMusSessionInformationApi::ENoCall ); + iConferenceCallEventMonitor->Cancel(); // Cancel the active object + iConferenceCallEventMonitor->RunL(); + RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + val ); + EUNIT_ASSERT( val==NMusSessionInformationApi::ENoCall ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusCallConferenceEventMonitor::UT_CMusCallConferenceEventMonitor_DoCancelL() + { + EUNIT_ASSERT( iConferenceCallEventMonitor ); + iConferenceCallEventMonitor->DoCancel(); + EUNIT_ASSERT( RTelHelper::GetCalledFunction() == + RTelSubSessionBase::ECancelAsyncRequest ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusCallConferenceEventMonitor::UT_CMusCallConferenceEventMonitor_RunErrorL() + { + EUNIT_ASSERT( iConferenceCallEventMonitor ); + TInt error = KErrNotFound; + iConferenceCallEventMonitor->RunError(error); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusCallConferenceEventMonitor::UT_CMusCallConferenceEventMonitor_MonitorCallLL() + { + EUNIT_ASSERT( iConferenceCallEventMonitor ); + EUNIT_ASSERT( iConferenceCallEventMonitor->iCallMonitorArray.Count() == 0 ); + + iConferenceCallEventMonitor->MonitorCallL(); + EUNIT_ASSERT( iConferenceCallEventMonitor->iCallMonitorArray.Count() == 0 ); + + RTelHelper::SetCallStatus( RMobileCall::EStatusConnected ); + iConferenceCallEventMonitor->MonitorCallL(); + EUNIT_ASSERT( iConferenceCallEventMonitor->iCallMonitorArray.Count() == 0 ); + + } + + + + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusCallConferenceEventMonitor, + "UT_CMusCallConferenceEventMonitor", + "UNIT" ) + +EUNIT_TEST( + "NewL - test ", + "CMusCallConferenceEventMonitor", + "NewL", + "FUNCTIONALITY", + SetupL, UT_CMusCallConferenceEventMonitor_NewLL, Teardown) + +EUNIT_TEST( + "RunL - test ", + "CMusCallConferenceEventMonitor", + "RunL", + "FUNCTIONALITY", + SetupL, UT_CMusCallConferenceEventMonitor_RunLL, Teardown) + +EUNIT_TEST( + "DoCancel - test ", + "CMusCallConferenceEventMonitor", + "DoCancel", + "FUNCTIONALITY", + SetupL, UT_CMusCallConferenceEventMonitor_DoCancelL, Teardown) + +EUNIT_TEST( + "RunError - test ", + "CMusCallConferenceEventMonitor", + "RunError", + "FUNCTIONALITY", + SetupL, UT_CMusCallConferenceEventMonitor_RunErrorL, Teardown) + +EUNIT_TEST( + "MonitorCallL - test ", + "CMusCallConferenceEventMonitor", + "MonitorCallL", + "FUNCTIONALITY", + SetupL, UT_CMusCallConferenceEventMonitor_MonitorCallLL, Teardown) + +EUNIT_END_TEST_TABLE + +// END OF FILE + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_muscallconferencemonitor.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_muscallconferencemonitor.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,286 @@ +/* +* 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: +* +*/ + + +// INTERNAL INCLUDES +#include "e32property.h" +#include "etel.h" +#include "etelmm.h" +#include "ut_muscallconferencemonitor.h" +#include "muscallconferencemonitor.h" + +// SYSTEM INCLUDES +#include + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusCallConferenceMonitor* UT_CMusCallConferenceMonitor::NewL() + { + UT_CMusCallConferenceMonitor* self = UT_CMusCallConferenceMonitor::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusCallConferenceMonitor* UT_CMusCallConferenceMonitor::NewLC() + { + UT_CMusCallConferenceMonitor* self = new( ELeave ) UT_CMusCallConferenceMonitor(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusCallConferenceMonitor::~UT_CMusCallConferenceMonitor() + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// Default constructor +// ----------------------------------------------------------------------------- +// +UT_CMusCallConferenceMonitor::UT_CMusCallConferenceMonitor() + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// Second phase construct +// ----------------------------------------------------------------------------- +// +void UT_CMusCallConferenceMonitor::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusCallConferenceMonitor::SetupL() + { + //setup + /* + RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallCount, + 1 ); + */ + + RTelHelper::SetConfStatus( RMobileConferenceCall::EConferenceIdle ); + + RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + 0 ); + + iConferenceCallMonitor = + CMusCallConferenceMonitor::NewL( iMobilePhone, + iLine , + iCallMonitorArray ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusCallConferenceMonitor::Teardown() + { + delete iConferenceCallMonitor; + PropertyHelper::Close(); + iMobilePhone.Close(); + iLine.Close(); + iCallMonitorArray.ResetAndDestroy(); + + } + + + +// TEST CASES + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusCallConferenceMonitor::UT_CMusCallConferenceMonitor_NewLL() + { + EUNIT_ASSERT( iConferenceCallMonitor ); + EUNIT_ASSERT( iConferenceCallMonitor->IsActive() ); + EUNIT_ASSERT( iConferenceCallMonitor->iConfCallEvent ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusCallConferenceMonitor::UT_CMusCallConferenceMonitor_RunLL() + { + TInt val = RMobileCall::EStatusUnknown; + EUNIT_ASSERT( iConferenceCallMonitor ); + + iConferenceCallMonitor->Cancel(); // Cancel the active object + RTelHelper::SetConfStatus( RMobileConferenceCall::EConferenceIdle ); + iConferenceCallMonitor->RunL(); + RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + val ); + EUNIT_ASSERT( val == RMobileCall::EStatusUnknown ); + + RTelHelper::SetConfStatus( RMobileConferenceCall::EConferenceActive ); + iConferenceCallMonitor->Cancel(); // Cancel the active object + iConferenceCallMonitor->RunL(); + RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + val ); + EUNIT_ASSERT( val==NMusSessionInformationApi::EConferenceCall); + + RTelHelper::SetConfStatus( RMobileConferenceCall::EConferenceHold ); + iConferenceCallMonitor->Cancel(); // Cancel the active object + iConferenceCallMonitor->RunL(); + RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + val ); + EUNIT_ASSERT( val==NMusSessionInformationApi::ECallHold); + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusCallConferenceMonitor::UT_CMusCallConferenceMonitor_DoCancelL() + { + EUNIT_ASSERT( iConferenceCallMonitor ); + iConferenceCallMonitor->DoCancel(); + EUNIT_ASSERT( RTelHelper::GetCalledFunction() == + RTelSubSessionBase::ECancelAsyncRequest ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusCallConferenceMonitor::UT_CMusCallConferenceMonitor_RunErrorL() + { + EUNIT_ASSERT( iConferenceCallMonitor ); + TInt error = KErrNotFound; + iConferenceCallMonitor->RunError(error); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusCallConferenceMonitor::UT_CMusCallConferenceMonitor_MonitorCallLL() + { + EUNIT_ASSERT( iConferenceCallMonitor ); + EUNIT_ASSERT( iConferenceCallMonitor->iCallMonitorArray.Count() == 0 ); + + iConferenceCallMonitor->MonitorCallL(); + EUNIT_ASSERT( iConferenceCallMonitor->iCallMonitorArray.Count() == 0 ); + + RTelHelper::SetCallStatus( RMobileCall::EStatusConnected ); + iConferenceCallMonitor->MonitorCallL(); + EUNIT_ASSERT( iConferenceCallMonitor->iCallMonitorArray.Count() == 0 ); + + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusCallConferenceMonitor::UT_CMusCallConferenceMonitor_GetConfStatus() + { + EUNIT_ASSERT( iConferenceCallMonitor->GetConfStatus() == RMobileConferenceCall::EConferenceIdle ); + } + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusCallConferenceMonitor, + "UT_CMusCallConferenceMonitor", + "UNIT" ) + +EUNIT_TEST( + "NewL - test ", + "CMusConferenceCallMonitor", + "NewL", + "FUNCTIONALITY", + SetupL, UT_CMusCallConferenceMonitor_NewLL, Teardown) + +EUNIT_TEST( + "RunL - test ", + "CMusConferenceCallMonitor", + "RunL", + "FUNCTIONALITY", + SetupL, UT_CMusCallConferenceMonitor_RunLL, Teardown) + +EUNIT_TEST( + "DoCancel - test ", + "CMusConferenceCallMonitor", + "DoCancel", + "FUNCTIONALITY", + SetupL, UT_CMusCallConferenceMonitor_DoCancelL, Teardown) + +EUNIT_TEST( + "RunError - test ", + "CMusConferenceCallMonitor", + "RunError", + "FUNCTIONALITY", + SetupL, UT_CMusCallConferenceMonitor_RunErrorL, Teardown) + +EUNIT_TEST( + "MonitorCallL - test ", + "CMusConferenceCallMonitor", + "MonitorCallL", + "FUNCTIONALITY", + SetupL, UT_CMusCallConferenceMonitor_MonitorCallLL, Teardown) + +EUNIT_TEST( + "GetCconfStatusL - test ", + "CMusConferenceCallMonitor", + "GetCconfStatus", + "FUNCTIONALITY", + SetupL, UT_CMusCallConferenceMonitor_GetConfStatus, Teardown) + + +EUNIT_END_TEST_TABLE + +// END OF FILE + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_muscalleventmonitor.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_muscalleventmonitor.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,341 @@ +/* +* 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: +* +*/ + + +// INTERNAL INCLUDES +#include "e32property.h" +#include "ut_muscalleventmonitor.h" +#include "muscalleventmonitor.h" + + +// SYSTEM INCLUDES +#include + +_LIT(KTelNo,"1234"); + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusCallEventMonitor* UT_CMusCallEventMonitor::NewL() + { + UT_CMusCallEventMonitor* self = UT_CMusCallEventMonitor::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusCallEventMonitor* UT_CMusCallEventMonitor::NewLC() + { + UT_CMusCallEventMonitor* self = new( ELeave ) UT_CMusCallEventMonitor(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusCallEventMonitor::~UT_CMusCallEventMonitor() + { + } + + +// ----------------------------------------------------------------------------- +// Default constructor +// ----------------------------------------------------------------------------- +// +UT_CMusCallEventMonitor::UT_CMusCallEventMonitor() + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// Second phase construct +// ----------------------------------------------------------------------------- +// +void UT_CMusCallEventMonitor::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + +// ----------------------------------------------------------------------------- +// UT_CMusCallEventMonitor::NotifyCallStateChanged() +// ----------------------------------------------------------------------------- +// +void UT_CMusCallEventMonitor::NotifyCallStateChanged( + NMusSessionInformationApi::TMusCallEvent /*aVal*/, + TName& /*aCallName*/ ) + { + } + + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusCallEventMonitor::SetupL() + { + + //setup + /* + RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallCount, + 1 ); + */ + RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + 0 ); + + iCallEventMonitor = CMusCallEventMonitor::NewL( iCall, *this, *this ); + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusCallEventMonitor::Teardown() + { + delete iCallEventMonitor; + PropertyHelper::Close(); + iCall.Close(); + } + + + +// TEST CASES + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusCallEventMonitor::UT_CMusCallEventMonitor_RunLL() + { + /* Test configurations */ + iCallEventMonitor->iRemoteCallEvent = RMobileCall::ERemoteResume; + iCallEventMonitor->iLocalCallEvent = RMobileCall::ELocalResume; + + // Test : Local is on hold + TInt val = RMobileCall::EStatusUnknown; + EUNIT_ASSERT( iCallEventMonitor ); + iCallEventMonitor->Cancel(); + RTelHelper::SetCallEvent( RMobileCall::ELocalHold ); + if ( RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallCount, + 1 ) != KErrNone ) + { + User::Leave( KErrNoMemory ); + } + + iCallEventMonitor->RunL(); + RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + val ); + EUNIT_ASSERT( val==NMusSessionInformationApi::ECallHold); + + // Test : Local resumed from hold + iCallEventMonitor->Cancel(); + RTelHelper::SetCallEvent( RMobileCall::ELocalResume ); + iCallEventMonitor->RunL(); + RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + val ); + EUNIT_ASSERT( val==NMusSessionInformationApi::ECallConnected); + + // Test : Local Transfered. Means no call. + iCallEventMonitor->Cancel(); + RTelHelper::SetCallEvent( RMobileCall::ELocalTransfer ); + iCallEventMonitor->RunL(); + RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + val ); + + EUNIT_ASSERT( val==NMusSessionInformationApi::ENoCall); + + // Test : Remote is on hold + iCallEventMonitor->Cancel(); + RTelHelper::SetCallEvent( RMobileCall::ERemoteHold ); + iCallEventMonitor->RunL(); + RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + val ); + EUNIT_ASSERT( val==NMusSessionInformationApi::ECallHold); + + // Test : Remote resumed + iCallEventMonitor->Cancel(); + RTelHelper::SetCallEvent( RMobileCall::ERemoteResume ); + iCallEventMonitor->RunL(); + RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + val ); + EUNIT_ASSERT( val==NMusSessionInformationApi::ECallConnected); + + /*. When call goes to Nocall state , call info not needed to + to be checked.Bug exist in both 5.0 and MCL . Should be fixed in + both the branches. Else this unit case will fail 19.12.2008 + + //Test : Remote terminated + iCallEventMonitor->Cancel(); + RTelHelper::SetCallEvent( RMobileCall::ERemoteTerminated ); + iCallEventMonitor->RunL(); + RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + val ); + EUNIT_ASSERT( val==NMusSessionInformationApi::ENoCall); + */ + + // Test : Remote is on conference + iCallEventMonitor->Cancel(); + RTelHelper::SetCallEvent( RMobileCall::ERemoteConferenceCreate ); + iCallEventMonitor->RunL(); + RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + val ); + EUNIT_ASSERT( val==NMusSessionInformationApi::EConferenceCall); + + // Test : Remote conference transfer + iCallEventMonitor->Cancel(); + RTelHelper::SetCallEvent( RMobileCall::ERemoteTransferring ); + iCallEventMonitor->RunL(); + RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + val ); + EUNIT_ASSERT( val==NMusSessionInformationApi::EConferenceCall);//Previous state. + + // remote is connected state and local resume + iCallEventMonitor->Cancel(); + RTelHelper::SetCallEvent( RMobileCall::ELocalResume ); + iCallEventMonitor->iRemoteCallEvent = RMobileCall::ERemoteResume; + iCallEventMonitor->RunL(); + RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + val ); + EUNIT_ASSERT( val==NMusSessionInformationApi::ECallConnected); + + // remote is in hold state and local resume. + iCallEventMonitor->Cancel(); + RTelHelper::SetCallEvent( RMobileCall::ELocalResume ); + iCallEventMonitor->iRemoteCallEvent = RMobileCall::ERemoteResume; + iCallEventMonitor->RunL(); + RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + val ); + EUNIT_ASSERT( val==NMusSessionInformationApi::ECallConnected ); + + //local hold state and remote resumed + iCallEventMonitor->Cancel(); + RTelHelper::SetCallEvent( RMobileCall::ERemoteResume ); + iCallEventMonitor->iLocalCallEvent = RMobileCall::ELocalHold; + iCallEventMonitor->RunL(); + RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + val ); + EUNIT_ASSERT( val==NMusSessionInformationApi::ECallHold); + + //local connected state and remote resumed + iCallEventMonitor->Cancel(); + RTelHelper::SetCallEvent( RMobileCall::ERemoteResume ); + iCallEventMonitor->iLocalCallEvent = RMobileCall::ELocalResume; + iCallEventMonitor->RunL(); + RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + val ); + EUNIT_ASSERT( val==NMusSessionInformationApi::ECallConnected); + } + + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusCallEventMonitor::UT_CMusCallEventMonitor_DoCancelL() + { + EUNIT_ASSERT( iCallEventMonitor ); + iCallEventMonitor->DoCancel(); + EUNIT_ASSERT( RTelHelper::GetCalledFunction() == + RTelSubSessionBase::ECancelAsyncRequest ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusCallEventMonitor::UT_CMusCallEventMonitor_RunErrorL() + { + EUNIT_ASSERT( iCallEventMonitor ); + TInt error = KErrNotFound; + iCallEventMonitor->RunError(error); + } + + +// ----------------------------------------------------------------------------- +// MusCallStateChanged from the MusCallStateObserver +// ----------------------------------------------------------------------------- +// +void UT_CMusCallEventMonitor::MusCallStateChanged() + { + //NOP: + } + + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusCallEventMonitor, + "UT_CMusCallEventMonitor", + "UNIT" ) + +EUNIT_TEST( + "RunL - test", + "CMusCallStatusMonitor", + "RunL", + "FUNCTIONALITY", + SetupL, UT_CMusCallEventMonitor_RunLL, Teardown) + +EUNIT_TEST( + "DoCancel - test", + "CMusCallStatusMonitor", + "RunL", + "FUNCTIONALITY", + SetupL, UT_CMusCallEventMonitor_DoCancelL, Teardown) + +EUNIT_TEST( + "RunError - test", + "CMusCallStatusMonitor", + "RunErrorL", + "FUNCTIONALITY", + SetupL, UT_CMusCallEventMonitor_RunErrorL, Teardown) + +EUNIT_END_TEST_TABLE + +// END OF FILE + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_muscallmonitor.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_muscallmonitor.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,254 @@ +/* +* 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: +* +*/ + + +// INTERNAL INCLUDES +#include "e32property.h" +#include "ut_muscallmonitor.h" +#include "muscallmonitor.h" + + +// SYSTEM INCLUDES +#include + +_LIT(KTelNo,"1234"); + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusCallMonitor* UT_CMusCallMonitor::NewL() + { + UT_CMusCallMonitor* self = UT_CMusCallMonitor::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusCallMonitor* UT_CMusCallMonitor::NewLC() + { + UT_CMusCallMonitor* self = new( ELeave ) UT_CMusCallMonitor(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// ----------------------------------------------------------------------------- +// UT_CMusCallMonitor::NotifyCallStateChanged() +// ----------------------------------------------------------------------------- +// +void UT_CMusCallMonitor::NotifyCallStateChanged( + NMusSessionInformationApi::TMusCallEvent /*aVal*/, + TName& /*aCallName*/ ) + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusCallMonitor::~UT_CMusCallMonitor() + { + } + + +// ----------------------------------------------------------------------------- +// Default constructor +// ----------------------------------------------------------------------------- +// +UT_CMusCallMonitor::UT_CMusCallMonitor() + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// Second phase construct +// ----------------------------------------------------------------------------- +// +void UT_CMusCallMonitor::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusCallMonitor::SetupL() + { + TName callName = KTelNo(); + TBool pttCallExist = EFalse; + if ( RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallCount, + 0 ) != KErrNone ) + { + User::Leave( KErrNoMemory ); + } + iCallMonitor = CMusCallMonitor::NewL( callName, pttCallExist ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusCallMonitor::Teardown() + { + delete iCallMonitor; + iLine.Close(); + PropertyHelper::Close(); + + } + + + +// TEST CASES + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusCallMonitor::UT_CMusCallMonitor_StartMonitorLL() + { + + EUNIT_ASSERT( !iCallMonitor->iCallStatusMonitor ); + EUNIT_ASSERT( !iCallMonitor->iCallEventMonitor ); + iCallMonitor->StartMonitorL( iLine, *this, *this ); + + EUNIT_ASSERT( iCallMonitor->iCallStatusMonitor ); + EUNIT_ASSERT( iCallMonitor->iCallEventMonitor ); + + EUNIT_ASSERT_LEAVE( iCallMonitor->StartMonitorL( iLine, *this , *this) ); + } + + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusCallMonitor::UT_CMusCallMonitor_StopMonitorLL() + { + + EUNIT_ASSERT( !iCallMonitor->iCallStatusMonitor ); + EUNIT_ASSERT( !iCallMonitor->iCallEventMonitor ); + iCallMonitor->StopMonitor(); + EUNIT_ASSERT( !iCallMonitor->iCallStatusMonitor ); + EUNIT_ASSERT( !iCallMonitor->iCallEventMonitor ); + + iCallMonitor->StartMonitorL( iLine, *this, *this ); + + EUNIT_ASSERT( iCallMonitor->iCallStatusMonitor ); + EUNIT_ASSERT( iCallMonitor->iCallEventMonitor ); + iCallMonitor->StopMonitor(); + EUNIT_ASSERT( !iCallMonitor->iCallStatusMonitor ); + EUNIT_ASSERT( !iCallMonitor->iCallEventMonitor ); + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusCallMonitor::UT_CMusCallMonitor_IsEqualL() + { + TName test = KNullDesC(); + + EUNIT_ASSERT( !iCallMonitor->IsEqual( test ) ); + + test = iCallMonitor->Name(); + EUNIT_ASSERT( iCallMonitor->IsEqual( test ) ); + + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusCallMonitor::UT_CMusCallMonitor_IsMonitoredL() + { + + EUNIT_ASSERT( !iCallMonitor->IsMonitored() ); + + iCallMonitor->StartMonitorL( iLine, *this, *this ); + EUNIT_ASSERT( iCallMonitor->IsMonitored() ); + + + } + + +// ----------------------------------------------------------------------------- +// MusCallStateChanged from the MusCallStateObserver +// ----------------------------------------------------------------------------- +// +void UT_CMusCallMonitor::MusCallStateChanged() + { + // NOP + } + + + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusCallMonitor, + "UT_CMusCallMonitor", + "UNIT" ) + +EUNIT_TEST( + "StartMonitorL - test", + "CMusCallStatusMonitor", + "StartMonitorL", + "FUNCTIONALITY", + SetupL, UT_CMusCallMonitor_StartMonitorLL, Teardown) + +EUNIT_TEST( + "StopMonitorL - test", + "CMusCallStatusMonitor", + "StopMonitorL", + "FUNCTIONALITY", + SetupL, UT_CMusCallMonitor_StopMonitorLL, Teardown) + +EUNIT_TEST( + "IsEqual - test", + "CMusCallStatusMonitor", + "IsEqual", + "FUNCTIONALITY", + SetupL, UT_CMusCallMonitor_IsEqualL, Teardown) + +EUNIT_TEST( + "IsMonitored - test", + "CMusCallStatusMonitor", + "IsMonitored", + "FUNCTIONALITY", + SetupL, UT_CMusCallMonitor_IsMonitoredL, Teardown) + + +EUNIT_END_TEST_TABLE + +// END OF FILE + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_muscallmonitorbase.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_muscallmonitorbase.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,379 @@ +/* +* 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: +* +*/ + + +// INTERNAL INCLUDES +#include "e32property.h" +#include "ut_muscallmonitorbase.h" +#include "mussesseioninformationapi.h" + +// SYSTEM INCLUDES +#include + +// Test configurations +_LIT(KEmptyProvider,""); +_LIT(KTestTelNumber,"+3585050"); + + + +CMusCallMonitorMock::CMusCallMonitorMock( const RMobileCall& aCall, + MMusTsyPropertyObserver& aObserver, + MMusCallStateObserver& aCallStateObserver ) + : CMusCallMonitorBase( aCall, aObserver, aCallStateObserver ) + { + } + + +void CMusCallMonitorMock::RunL() + { + } + +void CMusCallMonitorMock::DoCancel() + { + } + +CMusCallMonitorMock::~CMusCallMonitorMock() + { + Cancel(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusCallMonitorBase* UT_CMusCallMonitorBase::NewL() + { + UT_CMusCallMonitorBase* self = UT_CMusCallMonitorBase::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusCallMonitorBase* UT_CMusCallMonitorBase::NewLC() + { + UT_CMusCallMonitorBase* self = new( ELeave ) UT_CMusCallMonitorBase(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusCallMonitorBase::~UT_CMusCallMonitorBase() + { + // None + } + + +// ----------------------------------------------------------------------------- +// Default constructor +// ----------------------------------------------------------------------------- +// +UT_CMusCallMonitorBase::UT_CMusCallMonitorBase() + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// Second phase construct +// ----------------------------------------------------------------------------- +// +void UT_CMusCallMonitorBase::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + + +// ----------------------------------------------------------------------------- +// UT_CMusCallMonitorBase::NotifyCallStateChanged() +// ----------------------------------------------------------------------------- +// +void UT_CMusCallMonitorBase::NotifyCallStateChanged( + NMusSessionInformationApi::TMusCallEvent /*aVal*/, + TName& /*aCallName*/ ) + { + } + + + +// ----------------------------------------------------------------------------- +// MusCallStateChanged from the MusCallStateObserver +// ----------------------------------------------------------------------------- +// +void UT_CMusCallMonitorBase::MusCallStateChanged() + { + iCallStateObserverInvoked = ETrue; + } + + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusCallMonitorBase::SetupL() + { + RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + 0 ); + RTelHelper::SetCallDirection( RMobileCall::EDirectionUnknown ); + iCallMonitorBase = new CMusCallMonitorMock( iCall, *this, *this ); + iCallStateObserverInvoked = EFalse; + } + + +void UT_CMusCallMonitorBase::Setup2L() + { + iCallStateObserverInvoked = EFalse; + iCallMonitorBase = new CMusCallMonitorMock( iCall, *this, *this ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusCallMonitorBase::Teardown() + { + delete iCallMonitorBase; + PropertyHelper::Close(); + iCall.Close(); + } + + + +// TEST CASES + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusCallMonitorBase::UT_SetStateLL() + { + TInt tmp; + EUNIT_ASSERT ( RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, tmp ) != KErrNone ); + + EUNIT_ASSERT_LEAVE( iCallMonitorBase->SetStateL( NMusSessionInformationApi::ECallHold ) ); + + if ( RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + 0 ) != KErrNone ) + { + User::Leave( KErrNoMemory ); + } + if ( RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallCount, + 1 ) != KErrNone ) + { + User::Leave( KErrNoMemory ); + } + + EUNIT_ASSERT (!iCallStateObserverInvoked ) + + iCallMonitorBase->SetStateL( NMusSessionInformationApi::ECallHold ); + + EUNIT_ASSERT ( iCallStateObserverInvoked ) + + RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + tmp ); + EUNIT_ASSERT( tmp==NMusSessionInformationApi::ECallHold); + + iCallMonitorBase->SetStateL( NMusSessionInformationApi::ECallHold ); + RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + tmp ); + EUNIT_ASSERT( tmp==NMusSessionInformationApi::ECallHold); + + iCallMonitorBase->SetStateL( NMusSessionInformationApi::ECallConnected ); + RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + tmp ); + EUNIT_ASSERT( tmp==NMusSessionInformationApi::ECallConnected ); + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusCallMonitorBase::UT_SetCallInfoLL() + { + _LIT( KTelnro, "1234" ); + TName telnro; + TInt direction; + + iCallMonitorBase->SetCallInfoL(); + + RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusTelNumber, + telnro ); + + EUNIT_ASSERT( telnro == KTelnro ); + + RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallDirection, + direction ); + + EUNIT_ASSERT( direction == NMusSessionInformationApi::ENoDirection ); + + RTelHelper::SetCallDirection( RMobileCall::EMobileOriginated ); + + iCallMonitorBase->SetCallInfoL(); + + RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusTelNumber, + telnro ); + + EUNIT_ASSERT( telnro == KTelnro ); + + RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallDirection, + direction ); + + EUNIT_ASSERT( direction == NMusSessionInformationApi::ECallOrginated ); + + RTelHelper::SetCallDirection( RMobileCall::EMobileTerminated ); + iCallMonitorBase->SetCallInfoL(); + + RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusTelNumber, + telnro ); + + EUNIT_ASSERT( telnro == KTelnro ); + + RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallDirection, + direction ); + + EUNIT_ASSERT( direction == NMusSessionInformationApi::ECallTerminated ); + + /* Test for call provider */ + // Call Provider info is only Set for VoIP Calls + iCallMonitorBase->SetCallInfoL(); + TBuf provider; + RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMUSCallProvider, + provider ); + + + EUNIT_ASSERT( provider == KEmptyProvider ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusCallMonitorBase::UT_RunErrorL() + { + EUNIT_ASSERT( iCallMonitorBase->RunError( KErrNotFound ) == KErrNone ); + } + + +// ----------------------------------------------------------------------------- +// UT_CMusCallMonitorBase::UT_CMusCallMonitorBase_IsDataReadyLL() +// Test if required Data is ready for CS calls +// ----------------------------------------------------------------------------- +// +void UT_CMusCallMonitorBase::UT_CMusCallMonitorBase_IsDataReadyLL() + { + TBool dataReady = EFalse; + + //Test-1: Date Ready: + User::LeaveIfError( RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusTelNumber, + KTestTelNumber )); + + User::LeaveIfError( RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallDirection, + NMusSessionInformationApi::ECallOrginated )); + + dataReady = iCallMonitorBase->IsDataReadyL(); + EUNIT_ASSERT_EQUALS( dataReady, ETrue ) + + //Test-2: Partial Data is Ready + User::LeaveIfError( RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusTelNumber, + KNullDesC )); + dataReady = iCallMonitorBase->IsDataReadyL(); + EUNIT_ASSERT_EQUALS( dataReady, EFalse ) + + + //Test-3: Data Not Ready. + User::LeaveIfError(RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + ( TInt ) NMusSessionInformationApi::ENoCall )); + + dataReady = iCallMonitorBase->IsDataReadyL(); + EUNIT_ASSERT_EQUALS( dataReady, EFalse ) + } + + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusCallMonitorBase, + "UT_CMusCallMonitorBase", + "UNIT" ) + +EUNIT_TEST( + "SetStateL - test", + "CMusCallMonitorBase", + "SetStateL", + "FUNCTIONALITY", + Setup2L, UT_SetStateLL, Teardown) + +EUNIT_TEST( + "SetCallInfoL - test", + "CMusCallMonitorBase", + "SetCallInfoL", + "FUNCTIONALITY", + SetupL, UT_SetCallInfoLL, Teardown) + +EUNIT_TEST( + "RunError - test", + "CMusCallMonitorBase", + "RunError", + "FUNCTIONALITY", + SetupL, UT_RunErrorL, Teardown) + + +EUNIT_TEST( + "IsDataReadyL - test", + "CMusCallMonitorBase", + "IsDataReadyL", + "FUNCTIONALITY", + SetupL, UT_CMusCallMonitorBase_IsDataReadyLL, Teardown) + + +EUNIT_END_TEST_TABLE + +// END OF FILE diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_muscallstatusmonitor.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_muscallstatusmonitor.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,346 @@ +/* +* 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: +* +*/ + + +// INTERNAL INCLUDES +#include "e32property.h" +#include "ut_muscallstatusmonitor.h" +#include "muscallstatusmonitor.h" + + +// SYSTEM INCLUDES +#include + +_LIT(KTelNo,"1234"); + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusCallStatusMonitor* UT_CMusCallStatusMonitor::NewL() + { + UT_CMusCallStatusMonitor* self = UT_CMusCallStatusMonitor::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusCallStatusMonitor* UT_CMusCallStatusMonitor::NewLC() + { + UT_CMusCallStatusMonitor* self = new( ELeave ) UT_CMusCallStatusMonitor(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// ----------------------------------------------------------------------------- +// UT_CMusCallStatusMonitor::NotifyCallStateChanged() +// ----------------------------------------------------------------------------- +// +void UT_CMusCallStatusMonitor::NotifyCallStateChanged( + NMusSessionInformationApi::TMusCallEvent aVal, + TName& /*aCallName*/ ) + { + if ( aVal == NMusSessionInformationApi::ENoCall ) + { + // Simulate the actual observer in case of no call + delete iCallStatusMonitor; + iCallStatusMonitor = NULL; + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusCallStatusMonitor::~UT_CMusCallStatusMonitor() + { + } + + +// ----------------------------------------------------------------------------- +// Default constructor +// ----------------------------------------------------------------------------- +// +UT_CMusCallStatusMonitor::UT_CMusCallStatusMonitor() + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// Second phase construct +// ----------------------------------------------------------------------------- +// +void UT_CMusCallStatusMonitor::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusCallStatusMonitor::SetupL() + { + RTelHelper::SetCallStatus( RMobileCall::EStatusIdle ); + + RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + NMusSessionInformationApi::ENoCall ); + + iCallStatusMonitor = CMusCallStatusMonitor::NewL( iCall, *this, *this ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusCallStatusMonitor::Teardown() + { + delete iCallStatusMonitor; + PropertyHelper::Close(); + iCall.Close(); + } + + + +// TEST CASES + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusCallStatusMonitor::UT_CMusCallStatusMonitor_CheckStateLL() + { + User::LeaveIfError( + RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallCount, + 1 ) ); + User::LeaveIfError( + RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + NMusSessionInformationApi::ENoCall ) ); + TInt callEvent( NMusSessionInformationApi::ENoCall ); + + // No actions: RMobileCall::EStatusIdle + iCallStatusMonitor->iCallStatus = RMobileCall::EStatusIdle; + iCallStatusMonitor->CheckStateL(); + EUNIT_ASSERT_EQUALS( RMobileCall::EStatusIdle, + iCallStatusMonitor->iCallStatus ) + User::LeaveIfError( + RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + callEvent ) ); + EUNIT_ASSERT_EQUALS( + static_cast< TInt >( NMusSessionInformationApi::ENoCall ), + callEvent) + + // RMobileCall::EStatusConnected + iCallStatusMonitor->iCallStatus = RMobileCall::EStatusConnected; + iCallStatusMonitor->CheckStateL(); + EUNIT_ASSERT_EQUALS( RMobileCall::EStatusConnected, + iCallStatusMonitor->iCallStatus ) + User::LeaveIfError( + RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + callEvent ) ); + EUNIT_ASSERT_EQUALS( + static_cast< TInt >( NMusSessionInformationApi::ECallConnected ), + callEvent ) + + // RMobileCall::EStatusDisconnecting + iCallStatusMonitor->iCallStatus = RMobileCall::EStatusDisconnecting; + iCallStatusMonitor->CheckStateL(); + User::LeaveIfError( + RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + callEvent ) ); + EUNIT_ASSERT_EQUALS( + static_cast< TInt >( NMusSessionInformationApi::ENoCall ), + callEvent ) + EUNIT_ASSERT( iCallStatusMonitor == NULL ) + + // RMobileCall::EStatusDisconnectingWithInband + // iCallStatusMonitor was deleted by the previous call + iCallStatusMonitor = CMusCallStatusMonitor::NewL( iCall, *this, *this ); + iCallStatusMonitor->iCallStatus = RMobileCall::EStatusDisconnectingWithInband; + iCallStatusMonitor->CheckStateL(); + User::LeaveIfError( + RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + callEvent ) ); + EUNIT_ASSERT_EQUALS( + static_cast< TInt >( NMusSessionInformationApi::ENoCall ), + callEvent ) + EUNIT_ASSERT( iCallStatusMonitor == NULL ) + + // RMobileCall::EStatusHold + // iCallStatusMonitor was deleted by the previous call + iCallStatusMonitor = CMusCallStatusMonitor::NewL( iCall, *this, *this ); + iCallStatusMonitor->iCallStatus = RMobileCall::EStatusHold; + iCallStatusMonitor->CheckStateL(); + User::LeaveIfError( + RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + callEvent ) ); + EUNIT_ASSERT_EQUALS( + static_cast< TInt >( NMusSessionInformationApi::ECallHold ), + callEvent ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusCallStatusMonitor::UT_CMusCallStatusMonitor_RunLL() + { + if ( RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallCount, + 0 ) != KErrNone ) + { + User::Leave( KErrNoMemory ); + } + TInt val = RMobileCall::EStatusUnknown; + EUNIT_ASSERT( iCallStatusMonitor ); + iCallStatusMonitor->Cancel(); + RTelHelper::SetCallStatus( RMobileCall::EStatusAnswering ); + iCallStatusMonitor->RunL(); + RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + val ); + EUNIT_ASSERT( val==NMusSessionInformationApi::ENoCall); + if ( RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallCount, + 1 ) != KErrNone ) + { + User::Leave( KErrNoMemory ); + } + + iCallStatusMonitor->Cancel(); + RTelHelper::SetCallStatus( RMobileCall::EStatusConnected ); + iCallStatusMonitor->RunL(); + RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + val ); + EUNIT_ASSERT( val==NMusSessionInformationApi::ECallConnected); + + iCallStatusMonitor->Cancel(); + RTelHelper::SetCallStatus( RMobileCall::EStatusHold ); + iCallStatusMonitor->RunL(); + RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + val ); + EUNIT_ASSERT( val==NMusSessionInformationApi::ECallHold); + + iCallStatusMonitor->Cancel(); + RTelHelper::SetCallStatus( RMobileCall::EStatusTransferring ); + iCallStatusMonitor->RunL(); + RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + val ); + EUNIT_ASSERT( val==NMusSessionInformationApi::ECallHold); //previous state. + + } + + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusCallStatusMonitor::UT_CMusCallStatusMonitor_DoCancelL() + { + EUNIT_ASSERT( iCallStatusMonitor ); + iCallStatusMonitor->DoCancel(); + EUNIT_ASSERT( RTelHelper::GetCalledFunction() == + RTelSubSessionBase::ECancelAsyncRequest ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusCallStatusMonitor::UT_CMusCallStatusMonitor_RunErrorL() + { + EUNIT_ASSERT( iCallStatusMonitor ); + TInt error = KErrNotFound; + iCallStatusMonitor->RunError(error); + } + + +// ----------------------------------------------------------------------------- +// MusCallStateChanged from the MusCallStateObserver +// ----------------------------------------------------------------------------- +// +void UT_CMusCallStatusMonitor::MusCallStateChanged() + { + // NOP + } + + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusCallStatusMonitor, + "UT_CMusCallStatusMonitor", + "UNIT" ) + +EUNIT_TEST( + "CheckStateL - test", + "CMusCallStatusMonitor", + "CheckStateL", + "FUNCTIONALITY", + SetupL, UT_CMusCallStatusMonitor_CheckStateLL, Teardown) + +EUNIT_TEST( + "RunL - test", + "CMusCallStatusMonitor", + "RunL", + "FUNCTIONALITY", + SetupL, UT_CMusCallStatusMonitor_RunLL, Teardown) + +EUNIT_TEST( + "DoCancel - test", + "CMusCallStatusMonitor", + "RunL", + "FUNCTIONALITY", + SetupL, UT_CMusCallStatusMonitor_DoCancelL, Teardown) + +EUNIT_TEST( + "RunError - test", + "CMusCallStatusMonitor", + "RunErrorL", + "FUNCTIONALITY", + SetupL, UT_CMusCallStatusMonitor_RunErrorL, Teardown) + +EUNIT_END_TEST_TABLE + +// END OF FILE + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_muscommondllmain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_muscommondllmain.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,76 @@ +/* +* 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: +* +*/ + +// USER INCLUDES +#include "ut_muscallmonitor.h" +#include "ut_musvoipcallmonitor.h" +#include "ut_muscallstatusmonitor.h" +#include "ut_muscalleventmonitor.h" +#include "ut_muscallconferenceeventmonitor.h" +#include "ut_muscallconferencemonitor.h" +#include "ut_muscallmonitorbase.h" +#include "ut_musresourcefinderutil.h" +#include "ut_mustsypropertymonitor.h" +#include "ut_musfactorysettings.h" + +// SYSTEM INCLUDES +#include + + +// ----------------------------------------------------------------------------- +// Test suite factory function. +// ----------------------------------------------------------------------------- +// +EXPORT_C MEUnitTest* CreateTestSuiteL() + { + + CEUnitTestSuite* rootSuite = CEUnitTestSuite::NewLC( _L( "Mush Common" ) ); + + rootSuite->AddL( UT_CMusCallConferenceMonitor::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusCallStatusMonitor::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusCallEventMonitor::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusCallMonitor::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusTsyPropertyMonitor::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_MusResourceFinderUtil::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusCallConferenceEventMonitor::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusCallMonitorBase::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusVoipCallMonitor::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusFactorySettings::NewLC() ); + CleanupStack::Pop(); + + CleanupStack::Pop( rootSuite ); + + return rootSuite; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_musconferencecallmonitor.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_musconferencecallmonitor.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,182 @@ +/* +* 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: Monitor that observes the status of the current CS call +* +*/ + + +#include "ut_musconferencecallmonitor.h" +#include "musconferencecallmonitor.h" + +/* +#include "muscallmonitor.h" +#include "muscalleventmonitor.h" +#include "musaoplugin.h" +#include "ut_muscalleventmonitor.h" +#include "mussesseioninformationapi.h" +*/ + +#include +#include +#include +#include + + +#pragma warn_illtokenpasting off + +// Constants +_LIT( KMusTestCallName , "Voice1"); + + +// ----------------------------------------------------------------------------- +// Symbian two-phase constructor. +// ----------------------------------------------------------------------------- +// +UT_CMusConferenceCallMonitor* UT_CMusConferenceCallMonitor::NewLC() + { + UT_CMusConferenceCallMonitor* self = new (ELeave) UT_CMusConferenceCallMonitor(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// ----------------------------------------------------------------------------- +// Symbian second-phase constructor. +// ----------------------------------------------------------------------------- +// +void UT_CMusConferenceCallMonitor::ConstructL() + { + CEUnitTestSuiteClass::ConstructL(); + } + + +// ----------------------------------------------------------------------------- +// Observer function +// ----------------------------------------------------------------------------- +// +void UT_CMusConferenceCallMonitor::StatusChanged() + { + // Function called flag + iStatusChanged = ETrue; + } + + +// ----------------------------------------------------------------------------- +// C++ constructor. +// ----------------------------------------------------------------------------- +// +UT_CMusConferenceCallMonitor::UT_CMusConferenceCallMonitor() + : CEUnitTestSuiteClass() + { + // nothing + } + + +// ----------------------------------------------------------------------------- +// C++ destructor. +// ----------------------------------------------------------------------------- +// +UT_CMusConferenceCallMonitor::~UT_CMusConferenceCallMonitor() + { + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusConferenceCallMonitor::UT_RunL() + { + iStatusChanged = EFalse; + iMonitor->RunL(); + iMonitor->Cancel(); + EUNIT_ASSERT( iStatusChanged ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusConferenceCallMonitor::UT_DoCancel() + { + iMonitor->DoCancel(); + EUNIT_ASSERT(RTelHelper::GetCalledFunction() == + RTelSubSessionBase::ECancelAsyncRequest ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusConferenceCallMonitor::UT_RunError() + { + EUNIT_ASSERT_EQUALS( iMonitor->RunError( KErrNone ), + KErrNone ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusConferenceCallMonitor::SetupL() + { + RMobilePhone phone; + iMonitor = CMusConferenceCallMonitor::NewL( phone, *this ); + iMonitor->Cancel(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusConferenceCallMonitor::Teardown() + { + delete iMonitor; + + } + +// test table + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusConferenceCallMonitor, + "UT_CMusConferenceCallMonitor", + "UNIT" ) + +EUNIT_TEST( + "UT_RunL", + "CMusCallEventMonitor", + "RunL", + "FUNCTIONALITY", + SetupL, UT_RunL, Teardown) + +EUNIT_TEST( + "UT_DoCancel", + "CMusCallEventMonitor", + "DoCancel", + "FUNCTIONALITY", + SetupL, UT_DoCancel, Teardown) + +EUNIT_TEST( + "UT_RunError", + "CMusCallEventMonitor", + "RunError", + "FUNCTIONALITY", + SetupL, UT_RunError, Teardown) + + +EUNIT_END_TEST_TABLE diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_musfactorysettings.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_musfactorysettings.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,194 @@ +/* +* 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: +* +*/ + + +// INTERNAL INCLUDES +#include +#include "etelmm.h" +#include "ut_musfactorysettings.h" +#include "musfactorysettings.h" +#include "centralrepository.h" +#include "e32property.h" + + +// SYSTEM INCLUDES +#include + +// ----------------------------------------------------------------------------- +// Two phase symbian constructor +// ----------------------------------------------------------------------------- +// +UT_CMusFactorySettings* UT_CMusFactorySettings::NewL() + { + UT_CMusFactorySettings* self = UT_CMusFactorySettings::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// Two phase symbian constructor +// ----------------------------------------------------------------------------- +// +UT_CMusFactorySettings* UT_CMusFactorySettings::NewLC() + { + UT_CMusFactorySettings* self = new( ELeave ) UT_CMusFactorySettings(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// ----------------------------------------------------------------------------- +// Destructor +// ----------------------------------------------------------------------------- +// +UT_CMusFactorySettings::~UT_CMusFactorySettings() + { + + } + + +// ----------------------------------------------------------------------------- +// Default constructor +// ----------------------------------------------------------------------------- +// +UT_CMusFactorySettings::UT_CMusFactorySettings() + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// Second phase construct +// ----------------------------------------------------------------------------- +// +void UT_CMusFactorySettings::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusFactorySettings::SetupL() + { + iMusCentralRepository = CRepository::NewL( MusSettingsKeys::KRepositoryUid ); + CRepository::ResetStubGlobal(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusFactorySettings::Teardown() + { + delete iMusCentralRepository; + iMusCentralRepository = NULL; + CRepository::ResetStubGlobal(); + PropertyHelper::Close(); // CRepository puts stuff to RProperty static + } + +// TEST CASES + +// ----------------------------------------------------------------------------- +// SetCallInfo test function +// ----------------------------------------------------------------------------- +// +void UT_CMusFactorySettings::UT_CMusFactorySettings_IsSupportedLL() + { + // call cases + // all call types allowed + TPSCTsyCallType callType = EPSCTsyCallTypeCSVoice; + User::LeaveIfError( CRepository::SetStubGlobal(MusSettingsKeys::KAllowOnlyWithActiveCSCall, + MusSettingsKeys::EAllowedAllCalls) ); + EUNIT_ASSERT( MusFactorySettings::IsSupportedL( callType )); + + // allowed csonly and call type is voip + callType = EPSCTsyCallTypeVoIP; + User::LeaveIfError( CRepository::SetStubGlobal(MusSettingsKeys::KAllowOnlyWithActiveCSCall, + MusSettingsKeys::EAllowedCSOnly) ); + EUNIT_ASSERT( !MusFactorySettings::IsSupportedL( callType )); + + // allowed csonly and call type is cs + callType = EPSCTsyCallTypeCSVoice; + User::LeaveIfError( CRepository::SetStubGlobal(MusSettingsKeys::KAllowOnlyWithActiveCSCall, + MusSettingsKeys::EAllowedCSOnly) ); + EUNIT_ASSERT( MusFactorySettings::IsSupportedL( callType )); + + // allowed csonly and call type is EPSCTsyCallTypeNone + callType = EPSCTsyCallTypeNone; + User::LeaveIfError( CRepository::SetStubGlobal(MusSettingsKeys::KAllowOnlyWithActiveCSCall, + MusSettingsKeys::EAllowedCSOnly) ); + EUNIT_ASSERT( !MusFactorySettings::IsSupportedL( callType )); + + // network cases + // all bearer types allowed + RMobilePhone::TMobilePhoneNetworkMode networkType = RMobilePhone::ENetworkModeGsm; + User::LeaveIfError( CRepository::SetStubGlobal(MusSettingsKeys::KAllowOnlyIn3GNetwork, + MusSettingsKeys::EAllowedAllBearers) ); + EUNIT_ASSERT( MusFactorySettings::IsSupportedL( networkType )); + + // 3g only and network type is gsm + networkType = RMobilePhone::ENetworkModeGsm; + User::LeaveIfError( CRepository::SetStubGlobal(MusSettingsKeys::KAllowOnlyIn3GNetwork, + MusSettingsKeys::EAllowed3GOnly) ); + EUNIT_ASSERT( !MusFactorySettings::IsSupportedL( networkType )); + + // 3g only and network type is 3g + networkType = RMobilePhone::ENetworkModeWcdma; + User::LeaveIfError( CRepository::SetStubGlobal(MusSettingsKeys::KAllowOnlyIn3GNetwork, + MusSettingsKeys::EAllowed3GOnly) ); + EUNIT_ASSERT( MusFactorySettings::IsSupportedL( networkType )); + + // if allowed3gonly setting cenrep key not found + // then function should not leave and should behave like in default + // case ie all bearer supported. so it should return ETrue + networkType = RMobilePhone::ENetworkModeGsm; + User::LeaveIfError( CRepository::SetStubGlobal(MusSettingsKeys::KAllowOnlyIn3GNetwork, + MusSettingsKeys::EAllowed3GOnly) ); + CRepository::iForceFailWithCode = KErrNotFound; + TBool supported = EFalse; + EUNIT_ASSERT_NO_LEAVE( supported = MusFactorySettings::IsSupportedL( networkType )) + EUNIT_ASSERT( supported ); + } + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusFactorySettings, + "UT_CMusFactorySettings", + "UNIT" ) + +EUNIT_TEST( + "IsSupportedL - test", + "CMusFactorySettings", + "IsSupportedL", + "FUNCTIONALITY", + SetupL, UT_CMusFactorySettings_IsSupportedLL, Teardown) + +EUNIT_END_TEST_TABLE + +// END OF FILE + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_muslineeventmonitor.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_muslineeventmonitor.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,369 @@ +/* +* 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: Monitor that observes the status of the current CS call +* +*/ + + +#include "ut_muslineeventmonitor.h" +#include "muslineeventmonitor.h" +#include "muscalleventmonitor.h" +#include "muspttcallmonitor.h" + +//#include "musmanagerstub.h" +//#include "muscallmonitorobserver.h" + +#include +#include +#include +#include + +#ifdef RD_KODIAK_POC + #include +#else + //just for compilation . we never use this. + const TUid KPSUidCtsyCallInformation = {0x102029AC}; + const TUint32 KCTsyKodiakPtt = 0x00000003; + enum TPSCTsyKodiakPtt + { + EPSCTsyKodiakPttNotActive, + EPSCTsyKodiakPttActive + }; +#endif + +#pragma warn_illtokenpasting off + +// ----------------------------------------------------------------------------- +// Symbian two-phase constructor. +// ----------------------------------------------------------------------------- +// +UT_CMusLineEventMonitor* UT_CMusLineEventMonitor::NewLC() + { + UT_CMusLineEventMonitor* self = new (ELeave) UT_CMusLineEventMonitor(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// ----------------------------------------------------------------------------- +// Symbian second-phase constructor. +// ----------------------------------------------------------------------------- +// +void UT_CMusLineEventMonitor::ConstructL() + { + CEUnitTestSuiteClass::ConstructL(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusLineEventMonitor::StatusChanged() + { + } + + +// ----------------------------------------------------------------------------- +// C++ constructor. +// ----------------------------------------------------------------------------- +// +UT_CMusLineEventMonitor::UT_CMusLineEventMonitor() + : CEUnitTestSuiteClass() + { + // nothing + } + + +// ----------------------------------------------------------------------------- +// C++ destructor. +// ----------------------------------------------------------------------------- +// +UT_CMusLineEventMonitor::~UT_CMusLineEventMonitor() + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusLineEventMonitor::UT_GetLineL() + { + RMobileLine& line = iMonitor->GetLine(); + + // Just check something is returned.. + RLine::TCallInfo callInfo; + User::LeaveIfError( line.GetCallInfo( 0, callInfo ) ); + EUNIT_ASSERT( callInfo.iStatus ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusLineEventMonitor::UT_RemoteHoldCountL() + { + + // without any calls + EUNIT_ASSERT( iMonitor->RemoteHoldCount() == 0 ) + + // Local hold + _LIT( callname, "MyCall" ); + CMusCallEventMonitor* callEventMonitor = + CMusCallEventMonitor::NewL( iMonitor->GetLine(), + callname, + *this ); + CleanupStack::PushL( callEventMonitor ); + + callEventMonitor->iCallEvent = RMobileCall::ELocalHold; + iMonitor->iCallEventArray.AppendL( callEventMonitor ); + CleanupStack::Pop( callEventMonitor ); + EUNIT_ASSERT( iMonitor->RemoteHoldCount() == 0 ) + + // Remote hold + callEventMonitor = CMusCallEventMonitor::NewL( iMonitor->GetLine(), + callname, + *this ); + + CleanupStack::PushL( callEventMonitor ); + callEventMonitor->iCallEvent = RMobileCall::ERemoteHold; + iMonitor->iCallEventArray.AppendL( callEventMonitor ); + CleanupStack::Pop( callEventMonitor ); + EUNIT_ASSERT( iMonitor->RemoteHoldCount() == 1 ) + + // Cleanup + iMonitor->iCallEventArray.ResetAndDestroy(); + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusLineEventMonitor::UT_RunLL() + { + + //RCall::whatever + RTelHelper::SetCallStatus( RMobileCall::EStatusHold ); + iMonitor->RunL(); + EUNIT_ASSERT_EQUALS( iMonitor->iCallEventArray.Count(), 0 ); + iMonitor->Cancel(); + + //RCall::EStatusConnected + RTelHelper::SetCallStatus( RMobileCall::EStatusConnected ); + iMonitor->RunL(); + EUNIT_ASSERT_EQUALS( iMonitor->iCallEventArray.Count(), 1 ); + iMonitor->Cancel(); + + //RCall::EStatusIdle + RTelHelper::SetCallStatus( RMobileCall::EStatusIdle ); + iMonitor->RunL(); + EUNIT_ASSERT_EQUALS( iMonitor->iCallEventArray.Count(), 0 ); + iMonitor->Cancel(); + + //RCall::EStatusConnected + RTelHelper::SetCallStatus( RMobileCall::EStatusConnected ); + iMonitor->RunL(); + iMonitor->Cancel(); + + //RCall::EStatusHangingUp + RTelHelper::SetCallStatus( RMobileCall::EStatusDisconnecting ); + iMonitor->RunL(); + EUNIT_ASSERT_EQUALS( iMonitor->iCallEventArray.Count(), 0 ); + iMonitor->Cancel(); + + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusLineEventMonitor::UT_DoCancelL() + { + iMonitor->DoCancel(); + EUNIT_ASSERT( RTelHelper::GetCalledFunction()== + RTelSubSessionBase::ECancelAsyncRequest ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusLineEventMonitor::UT_RunErrorL() + { + EUNIT_ASSERT_EQUALS( iMonitor->RunError( KErrNone ), KErrNone ); + // Make sure RunError handles the error compleatly and returns + // KErrNone + EUNIT_ASSERT( iMonitor->RunError( KErrGeneral ) == KErrNone ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusLineEventMonitor::UT_AddCallEventMonitorLL() + { + RProperty::Set(KPSUidCtsyCallInformation, KCTsyKodiakPtt, + EPSCTsyKodiakPttActive ); + iMonitor->iPTTCallMonitor->Cancel(); + iMonitor->iPTTCallMonitor->RunL(); + iMonitor->iPTTCallMonitor->Cancel(); + // Add first call + _LIT( KCallName, "FirstCall" ); + iMonitor->AddCallEventMonitorL( KCallName() ); + EUNIT_ASSERT_EQUALS( iMonitor->iCallEventArray.Count(), 1 ); + + // Trying add same call again + iMonitor->AddCallEventMonitorL( KCallName() ); + EUNIT_ASSERT_EQUALS( iMonitor->iCallEventArray.Count(), 1 ); + + // Add second call + _LIT( KCallName2, "SecondCall" ); + iMonitor->AddCallEventMonitorL( KCallName2() ); + EUNIT_ASSERT_EQUALS( iMonitor->iCallEventArray.Count(), 2 ); + + RProperty::Set(KPSUidCtsyCallInformation, KCTsyKodiakPtt, + EPSCTsyKodiakPttNotActive ); + iMonitor->iPTTCallMonitor->RunL(); + iMonitor->iPTTCallMonitor->Cancel(); + // Add first call + iMonitor->AddCallEventMonitorL( KCallName() ); + EUNIT_ASSERT_EQUALS( iMonitor->iCallEventArray.Count(), 0 ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusLineEventMonitor::UT_RemoveCallEventMonitorLL() + { + + // Precondition add call + _LIT( KCallName, "FirstCall" ); + iMonitor->AddCallEventMonitorL( KCallName() ); + EUNIT_ASSERT_EQUALS( iMonitor->iCallEventArray.Count(), 1 ); + + _LIT( KCallName2, "SecondCall" ); + iMonitor->AddCallEventMonitorL( KCallName2() ); + EUNIT_ASSERT_EQUALS( iMonitor->iCallEventArray.Count(), 2 ); + + // Remove call with wrong name + _LIT( KCallName3, "ThirdCall" ); + iMonitor->RemoveCallEventMonitorL( KCallName3() ); + EUNIT_ASSERT_EQUALS( iMonitor->iCallEventArray.Count(), 2 ); + + // Remove second call remove + iMonitor->RemoveCallEventMonitorL( KCallName2() ); + EUNIT_ASSERT_EQUALS( iMonitor->iCallEventArray.Count(), 1 ); + + // Remove added call + iMonitor->RemoveCallEventMonitorL( KCallName() ); + EUNIT_ASSERT_EQUALS( iMonitor->iCallEventArray.Count(), 0 ); + + // Trying overload remove + iMonitor->RemoveCallEventMonitorL( KCallName() ); + EUNIT_ASSERT_EQUALS( iMonitor->iCallEventArray.Count(), 0 ); + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusLineEventMonitor::SetupL() + { + RMobilePhone phone; + iMonitor = CMusLineEventMonitor::NewL( phone, *this ); + iMonitor->Cancel(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusLineEventMonitor::Teardown() + { + delete iMonitor; + } + +// test table + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusLineEventMonitor, + "UT_CMusLineEventMonitor", + "UNIT" ) + +EUNIT_TEST( + "GetLine - test", + "CMusAoCallMonitor", + "GetLine", + "FUNCTIONALITY", + SetupL, UT_GetLineL, Teardown) + +EUNIT_TEST( + "RemoteHoldCount - test", + "CMusAoCallMonitor", + "RemoteHoldCount", + "FUNCTIONALITY", + SetupL, UT_RemoteHoldCountL, Teardown) + +EUNIT_TEST( + "RunL - test", + "CMusAoCallMonitor", + "RunL", + "FUNCTIONALITY", + SetupL, UT_RunLL, Teardown) + +EUNIT_TEST( + "DoCancel - test", + "CMusAoCallMonitor", + "DoCancel", + "FUNCTIONALITY", + SetupL, UT_DoCancelL, Teardown) + +EUNIT_TEST( + "RunError - test", + "CMusAoCallMonitor", + "RunError", + "FUNCTIONALITY", + SetupL, UT_RunErrorL, Teardown) + +EUNIT_TEST( + "AddCallEventMonitorL - test", + "CMusAoCallMonitor", + "AddCallEventMonitorL", + "FUNCTIONALITY", + SetupL, UT_AddCallEventMonitorLL, Teardown) + +EUNIT_TEST( + "RemoveCallEventMonitorL - test", + "CMusAoCallMonitor", + "RemoveCallEventMonitorL", + "FUNCTIONALITY", + SetupL, UT_RemoveCallEventMonitorLL, Teardown) + + + + + +EUNIT_END_TEST_TABLE diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_muspropertymonitor.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_muspropertymonitor.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,254 @@ +/* +* 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: +* +*/ + + +// INTERNAL INCLUDES +#include "etelmm.h" +#include "e32property.h" +#include "ut_muspropertymonitor.h" +#include "muspropertymonitor.h" +#include "mussesseioninformationapi.h" + + +// SYSTEM INCLUDES +#include + +_LIT(KTelNo,"1234"); + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusPropertyMonitor* UT_CMusPropertyMonitor::NewL() + { + UT_CMusPropertyMonitor* self = UT_CMusPropertyMonitor::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusPropertyMonitor* UT_CMusPropertyMonitor::NewLC() + { + UT_CMusPropertyMonitor* self = new( ELeave ) UT_CMusPropertyMonitor(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusPropertyMonitor::~UT_CMusPropertyMonitor() + { + } + + +// ----------------------------------------------------------------------------- +// Default constructor +// ----------------------------------------------------------------------------- +// +UT_CMusPropertyMonitor::UT_CMusPropertyMonitor() + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// Second phase construct +// ----------------------------------------------------------------------------- +// +void UT_CMusPropertyMonitor::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusPropertyMonitor::SetupL() + { + iMusPropertyMonitor = CMusPropertyMonitor::NewL(*this); + iMusPropertyMonitor->iPropertyEvent.iPValue = NMusSessionInformationApi::ENoCall; + iMusCallStateObserverInovked = EFalse; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusPropertyMonitor::Teardown() + { + delete iMusPropertyMonitor; + PropertyHelper::Close(); + } + + +// TEST CASES + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusPropertyMonitor::UT_CMusPropertyMonitor_RunLL() + { + EUNIT_ASSERT( iMusPropertyMonitor); + EUNIT_ASSERT( !iMusCallStateObserverInovked ); + iMusPropertyMonitor->iPropertyEvent.iPValue = NMusSessionInformationApi::ENoCall; + iMusPropertyMonitor->Cancel(); + iMusPropertyMonitor->RunL(); + EUNIT_ASSERT( iMusCallStateObserverInovked ); + } + + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusPropertyMonitor::UT_CMusPropertyMonitor_DoCancelL() + { + EUNIT_ASSERT( iMusPropertyMonitor ); + iMusPropertyMonitor->DoCancel(); + EUNIT_ASSERT( PropertyHelper::GetCalledFunction() == + RProperty::ECancel ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusPropertyMonitor::UT_CMusPropertyMonitor_RunErrorL() + { + EUNIT_ASSERT( !iMusCallStateObserverInovked ); + EUNIT_ASSERT( iMusPropertyMonitor ); + TInt CallState; + TInt error = KErrNotFound; + + // Call is Established: + User::LeaveIfError( RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + NMusSessionInformationApi::ECallConnected ) ); + + // Test1: Invoking Error Situation, Ensure Calll is disconected. + User::LeaveIfError( iMusPropertyMonitor->RunError(error)); + User::LeaveIfError( RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + CallState ) ); + EUNIT_ASSERT( CallState == NMusSessionInformationApi::ENoCall ); + EUNIT_ASSERT( iMusCallStateObserverInovked ); + } + + +// ----------------------------------------------------------------------------- +// UT_CMusPropertyMonitor::UT_CMusPropertyMonitor_IsCallConnected() +// Checks from the P/S keys if the Call is connected. +// ----------------------------------------------------------------------------- +// +void UT_CMusPropertyMonitor::UT_CMusPropertyMonitor_IsCallConnected() + { + // Test1: Call Not Connected: + TBool callConnected = EFalse; + User::LeaveIfError( RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + NMusSessionInformationApi::ENoCall ) ); + + callConnected = iMusPropertyMonitor->IsCallConnected(); + EUNIT_ASSERT( callConnected == EFalse ); + + // Test2: Call Connected: + User::LeaveIfError( RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + NMusSessionInformationApi::ECallConnected ) ); + + callConnected = iMusPropertyMonitor->IsCallConnected(); + EUNIT_ASSERT( callConnected == ETrue ); + + + // Test3: Hold and Conference are concidered as call connected + User::LeaveIfError( RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + NMusSessionInformationApi::ECallHold ) ); + + callConnected = iMusPropertyMonitor->IsCallConnected(); + EUNIT_ASSERT( callConnected == ETrue ); + } + + +// ----------------------------------------------------------------------------- +// MusCallStateChanged from the MusCallStateObserver +// ----------------------------------------------------------------------------- +// +void UT_CMusPropertyMonitor::MusCallStateChanged() + { + iMusCallStateObserverInovked = ETrue; + } + + + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusPropertyMonitor, + "UT_CMusPropertyMonitor", + "UNIT" ) + +EUNIT_TEST( + "RunL - test", + "CMusCallStatusMonitor", + "RunL", + "FUNCTIONALITY", + SetupL, UT_CMusPropertyMonitor_RunLL, Teardown) + +EUNIT_TEST( + "DoCancel - test", + "CMusCallStatusMonitor", + "DoCancel", + "FUNCTIONALITY", + SetupL, UT_CMusPropertyMonitor_DoCancelL, Teardown) + +EUNIT_TEST( + "RunError - test", + "CMusCallStatusMonitor", + "RunErrorL", + "FUNCTIONALITY", + SetupL, UT_CMusPropertyMonitor_RunErrorL, Teardown) + +EUNIT_TEST( + "IsCallConnected - test", + "CMusCallStatusMonitor", + "IsCallConnected", + "FUNCTIONALITY", + SetupL, UT_CMusPropertyMonitor_IsCallConnected, Teardown) + +EUNIT_END_TEST_TABLE + +// END OF FILE + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_muspttcallmonitor.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_muspttcallmonitor.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,167 @@ +/* +* 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: Monitors the Kodiak Phone Call +* +*/ + + + +#include +#include +#include +#include "muspttcallmonitor.h" +#include "ut_muspttcallmonitor.h" + +#pragma warn_illtokenpasting off + +// ----------------------------------------------------------------------------- +// Symbian two-phase constructor. +// ----------------------------------------------------------------------------- +// +UT_CMusPTTCallMonitor* UT_CMusPTTCallMonitor::NewLC() + { + UT_CMusPTTCallMonitor* self = new (ELeave) UT_CMusPTTCallMonitor(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// ----------------------------------------------------------------------------- +// Symbian second-phase constructor. +// ----------------------------------------------------------------------------- +// +void UT_CMusPTTCallMonitor::ConstructL() + { + CEUnitTestSuiteClass::ConstructL(); + } + +// ----------------------------------------------------------------------------- +// C++ constructor. +// ----------------------------------------------------------------------------- +// +UT_CMusPTTCallMonitor::UT_CMusPTTCallMonitor() + : CEUnitTestSuiteClass() + { + // nothing + } + + +// ----------------------------------------------------------------------------- +// C++ destructor. +// ----------------------------------------------------------------------------- +// +UT_CMusPTTCallMonitor::~UT_CMusPTTCallMonitor() + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusPTTCallMonitor::UT_RunLL() + { + + iMonitor->RunL(); + iMonitor->Cancel(); + EUNIT_ASSERT( iMonitor->IsPTTCallExist()); + + // case 2. + iMonitor->iPropertyEvent.iPValue = EPSCTsyKodiakPttNotActive; + iMonitor->RunL(); + iMonitor->Cancel(); + EUNIT_ASSERT( !iMonitor->IsPTTCallExist() ); + + // case 3 + iMonitor->iPropertyEvent.iPValue = EPSCTsyKodiakPttActive; + iMonitor->RunL(); + iMonitor->Cancel(); + EUNIT_ASSERT( iMonitor->IsPTTCallExist() ); + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusPTTCallMonitor::UT_IsPTTCallExistL() + { + iMonitor->iPropertyEvent.iPValue = EPSCTsyKodiakPttNotActive; + EUNIT_ASSERT( !iMonitor->IsPTTCallExist()); + + iMonitor->iPropertyEvent.iPValue = EPSCTsyKodiakPttActive; + EUNIT_ASSERT( iMonitor->IsPTTCallExist()); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusPTTCallMonitor::UT_DoCancelL() + { + iMonitor->Cancel(); + EUNIT_ASSERT(!iMonitor->IsActive()); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusPTTCallMonitor::SetupL() + { + iMonitor = CMusPttCallMonitor::NewL(*this); + iMonitor->Cancel(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusPTTCallMonitor::Teardown() + { + delete iMonitor; + } + +// test table + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusPTTCallMonitor, + "UT_CMusPTTCallMonitor", + "UNIT" ) + +EUNIT_TEST( + "RunL - test", + "CMusPTTCallMonitor", + "RunL", + "FUNCTIONALITY", + SetupL, UT_RunLL, Teardown) + +EUNIT_TEST( + "IsPTTCallExist - test", + "CMusPTTCallMonitor", + "IsPTTCallExist", + "FUNCTIONALITY", + SetupL, UT_IsPTTCallExistL, Teardown) + +EUNIT_TEST( + "DoCancel - test", + "CMusPTTCallMonitor", + "DoCancel", + "FUNCTIONALITY", + SetupL, UT_DoCancelL, Teardown) + +EUNIT_END_TEST_TABLE + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_musresourcefinderutil.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_musresourcefinderutil.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,183 @@ +/* +* 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: +* +*/ + + +// INTERNAL INCLUDES +#include "ut_musresourcefinderutil.h" +#include "musresourcefinderutil.h" + + +// SYSTEM INCLUDES +#include + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_MusResourceFinderUtil* UT_MusResourceFinderUtil::NewL() + { + UT_MusResourceFinderUtil* self = UT_MusResourceFinderUtil::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_MusResourceFinderUtil* UT_MusResourceFinderUtil::NewLC() + { + UT_MusResourceFinderUtil* self = new( ELeave ) UT_MusResourceFinderUtil(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_MusResourceFinderUtil::~UT_MusResourceFinderUtil() + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// Default constructor +// ----------------------------------------------------------------------------- +// +UT_MusResourceFinderUtil::UT_MusResourceFinderUtil() + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// Second phase construct +// ----------------------------------------------------------------------------- +// +void UT_MusResourceFinderUtil::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_MusResourceFinderUtil::SetupL() + { + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_MusResourceFinderUtil::Teardown() + { + + } + + + +// TEST CASES + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_MusResourceFinderUtil::UT_MusResourceFinderUtil_ResourcePathLL() + { + _LIT( reourceFile, "noway"); + HBufC* name = MusResourceFinderUtil::ResourcePathL( reourceFile ); + CleanupStack::PushL( name ); + EUNIT_ASSERT( name ); + CleanupStack::PopAndDestroy( name ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_MusResourceFinderUtil::UT_MusResourceFinderUtil_AppResourcePathLL() + { + _LIT( reourceFile, "noway"); + HBufC* name = MusResourceFinderUtil::AppResourcePathL( reourceFile ); + CleanupStack::PushL( name ); + EUNIT_ASSERT( name ); + CleanupStack::PopAndDestroy( name ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_MusResourceFinderUtil::UT_MusResourceFinderUtil_IsExistLL() + { + _LIT( reourceFile, "noway"); + EUNIT_ASSERT( !MusResourceFinderUtil::IsExistL( reourceFile ) ); + } + + + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_MusResourceFinderUtil, + "UT_MusResourceFinderUtil", + "UNIT" ) + +EUNIT_TEST( + "ResourcePathL - test ", + "MusResourceFinderUtil", + "ResourcePathL", + "FUNCTIONALITY", + SetupL, UT_MusResourceFinderUtil_ResourcePathLL, Teardown) + +EUNIT_TEST( + "AppResourcePathL - test ", + "MusResourceFinderUtil", + "AppResourcePathL", + "FUNCTIONALITY", + SetupL, UT_MusResourceFinderUtil_AppResourcePathLL, Teardown) + +EUNIT_TEST( + "IsExistL - test ", + "MusResourceFinderUtil", + "IsExistL", + "FUNCTIONALITY", + SetupL, UT_MusResourceFinderUtil_IsExistLL, Teardown) + + + +EUNIT_END_TEST_TABLE + +// END OF FILE + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_mustsypropertymonitor.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_mustsypropertymonitor.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,736 @@ +/* +* 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: +* +*/ + + +// INTERNAL INCLUDES +#include "etelmm.h" +#include "e32property.h" +#include "centralrepository.h" +#include "ut_mustsypropertymonitor.h" +#include "mustsypropertymonitor.h" +#include "muscallmonitor.h" +#include "musvoipcallmonitor.h" +#include "muscallconferencemonitor.h" + +// SYSTEM INCLUDES +#include +#include +#include + + +_LIT(KTelNo,"1234"); +_LIT( KTestProvideName, "VoIP" ); +_LIT( KDefaultSipUri, "sip:default@uri" ); + +TName cs_call_1(_L("cs_call_1")); +TName cs_call_2(_L("cs_call_2")); +TName voip_call_1(_L("voip_call_1")); +TName voip_call_2(_L("voip_call_2")); + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusTsyPropertyMonitor* UT_CMusTsyPropertyMonitor::NewL() + { + UT_CMusTsyPropertyMonitor* self = UT_CMusTsyPropertyMonitor::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusTsyPropertyMonitor* UT_CMusTsyPropertyMonitor::NewLC() + { + UT_CMusTsyPropertyMonitor* self = new( ELeave ) UT_CMusTsyPropertyMonitor(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusTsyPropertyMonitor::~UT_CMusTsyPropertyMonitor() + { + } + + +// ----------------------------------------------------------------------------- +// Default constructor +// ----------------------------------------------------------------------------- +// +UT_CMusTsyPropertyMonitor::UT_CMusTsyPropertyMonitor() + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// Second phase construct +// ----------------------------------------------------------------------------- +// +void UT_CMusTsyPropertyMonitor::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusTsyPropertyMonitor::SetupL() + { + iMusCentralRepository = CRepository::NewL( MusSettingsKeys::KRepositoryUid ); + RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + 0 ); + + iMusTsyPropertyMonitor = CMusTsyPropertyMonitor::NewL( iPhone, *this ); + iMusTsyPropertyMonitor->iPropertyEvent.iPValue = EPSCTsyCallStateUninitialized; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusTsyPropertyMonitor::Teardown() + { + delete iMusCentralRepository; + iMusCentralRepository = NULL; + delete iMusTsyPropertyMonitor; + PropertyHelper::Close(); + iPhone.Close(); + + } + + + +// TEST CASES + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusTsyPropertyMonitor::UT_CMusTsyPropertyMonitor_RunLL() + { + + // Set intial call type too unintialiazed. + if ( RProperty::Set( KPSUidCtsyCallInformation,KCTsyCallType, + EPSCTsyCallTypeUninitialized )) + { + User::Leave( KErrNoMemory ); + } + // Set intial call count + if ( RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallCount, + 0 ) != KErrNone ) + { + User::Leave( KErrNoMemory ); + } + + EUNIT_ASSERT( iMusTsyPropertyMonitor); + TInt val = KErrNone; + + iMusTsyPropertyMonitor->Cancel(); + iMusTsyPropertyMonitor->RunL(); + + EUNIT_ASSERT( iMusTsyPropertyMonitor->iCallMonitorArray.Count() == 0 ); + + + iMusTsyPropertyMonitor->iPropertyEvent.iPValue = EPSCTsyCallStateNone; + iMusTsyPropertyMonitor->SetStateL( NMusSessionInformationApi::ENoCall ); + + iMusTsyPropertyMonitor->Cancel(); + iMusTsyPropertyMonitor->RunL(); + + RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + val ); + EUNIT_ASSERT( val==NMusSessionInformationApi::ENoCall); + + + iMusTsyPropertyMonitor->iPropertyEvent.iPValue = EPSCTsyCallStateDisconnecting; + iMusTsyPropertyMonitor->SetStateL( NMusSessionInformationApi::ENoCall ); + + iMusTsyPropertyMonitor->Cancel(); + iMusTsyPropertyMonitor->RunL(); + + RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + val ); + EUNIT_ASSERT( val==NMusSessionInformationApi::ENoCall); + + + iMusTsyPropertyMonitor->iPropertyEvent.iPValue = EPSCTsyCallStateAnswering; + iMusTsyPropertyMonitor->SetStateL( NMusSessionInformationApi::ENoCall ); + + iMusTsyPropertyMonitor->Cancel(); + iMusTsyPropertyMonitor->RunL(); + + RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + val ); + EUNIT_ASSERT( val==NMusSessionInformationApi::ENoCall); + + iMusTsyPropertyMonitor->iPropertyEvent.iPValue = EPSCTsyCallStateConnected; + iMusTsyPropertyMonitor->SetStateL( NMusSessionInformationApi::ENoCall ); + + iMusTsyPropertyMonitor->Cancel(); + iMusTsyPropertyMonitor->RunL(); + + RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + val ); + EUNIT_ASSERT( val==NMusSessionInformationApi::ENoCall); + + iMusTsyPropertyMonitor->iPropertyEvent.iPValue = EPSCTsyCallStateHold; + iMusTsyPropertyMonitor->SetStateL( NMusSessionInformationApi::ENoCall ); + if ( RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallCount, + 1 ) != KErrNone ) + { + User::Leave( KErrNoMemory ); + } + //simulate multicall scenario + TName callName(_L("Voice1")); + iMusTsyPropertyMonitor->AddCallMonitorL( callName ); + callName.Copy(_L("Voice2")); + iMusTsyPropertyMonitor->AddCallMonitorL( callName ); + iMusTsyPropertyMonitor->Cancel(); + iMusTsyPropertyMonitor->RunL(); + // + RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + val ); + EUNIT_ASSERT( val==NMusSessionInformationApi::ECallHold); + + } + + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusTsyPropertyMonitor::UT_CMusTsyPropertyMonitor_DoCancelL() + { + EUNIT_ASSERT( iMusTsyPropertyMonitor ); + iMusTsyPropertyMonitor->Cancel(); + EUNIT_ASSERT( PropertyHelper::GetCalledFunction() == + RProperty::ECancel ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusTsyPropertyMonitor::UT_CMusTsyPropertyMonitor_RunErrorL() + { + EUNIT_ASSERT( iMusTsyPropertyMonitor ); + TInt error = KErrNotFound; + iMusTsyPropertyMonitor->RunError(error); + } + + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusTsyPropertyMonitor::UT_CMusTsyPropertyMonitor_AddCallMonitorLL() + { + TName name = KTelNo(); + if ( RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallCount, + 0 ) != KErrNone ) + { + User::Leave( KErrNoMemory ); + } + iMusTsyPropertyMonitor->AddCallMonitorL( name ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusTsyPropertyMonitor::UT_CMusTsyPropertyMonitor_RemoveCallMonitorL() + { + TName name = KTelNo(); + iMusTsyPropertyMonitor->RemoveCallMonitor( name ); + + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusTsyPropertyMonitor::UT_CMusTsyPropertyMonitor_MonitorCSCallLL() + { + if ( RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallCount, + 0 ) != KErrNone ) + { + User::Leave( KErrNoMemory ); + } + RTelHelper::SetCallStatus( (RMobileCall::TMobileCallStatus)RCall::EStatusIdle ); + EUNIT_ASSERT( iMusTsyPropertyMonitor->iCallMonitorArray.Count() == 0 ); + iMusTsyPropertyMonitor->MonitorCSCallL(); + EUNIT_ASSERT( iMusTsyPropertyMonitor->iCallMonitorArray.Count() == 0 ); + + RTelHelper::SetCallStatus( (RMobileCall::TMobileCallStatus)RCall::EStatusHangingUp ); + iMusTsyPropertyMonitor->MonitorCSCallL(); + EUNIT_ASSERT( iMusTsyPropertyMonitor->iCallMonitorArray.Count() == 0 ); + + RTelHelper::SetCallStatus( (RMobileCall::TMobileCallStatus)RCall::EStatusConnected ); + iMusTsyPropertyMonitor->MonitorCSCallL(); + EUNIT_ASSERT( iMusTsyPropertyMonitor->iCallMonitorArray.Count() == 1 ); + + iMusTsyPropertyMonitor->iCallMonitorArray.ResetAndDestroy(); + RTelHelper::SetCallStatus( (RMobileCall::TMobileCallStatus)RCall::EStatusAnswering ); + iMusTsyPropertyMonitor->MonitorCSCallL(); + EUNIT_ASSERT( iMusTsyPropertyMonitor->iCallMonitorArray.Count() == 1 ); + + iMusTsyPropertyMonitor->iCallMonitorArray.ResetAndDestroy(); + RTelHelper::SetCallStatus( (RMobileCall::TMobileCallStatus)RCall::EStatusIdle ); + iMusTsyPropertyMonitor->MonitorCSCallL(); + EUNIT_ASSERT( iMusTsyPropertyMonitor->iCallMonitorArray.Count() == 0 ); + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusTsyPropertyMonitor::UT_CMusTsyPropertyMonitor_MonitorVoipCallLL() + { + EUNIT_ASSERT( iMusTsyPropertyMonitor->iVoipCallMonitorArray.Count() == 0 ); + if ( RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallCount, + 0 ) != KErrNone ) + { + User::Leave( KErrNoMemory ); + } + + // State connected + TPSCTsyCallState callState = EPSCTsyCallStateConnected; + iMusTsyPropertyMonitor->MonitorVoipCallL( callState ); + EUNIT_ASSERT( iMusTsyPropertyMonitor->iVoipCallMonitorArray.Count() == 1 ); + + // State answering + iMusTsyPropertyMonitor->iVoipCallMonitorArray.ResetAndDestroy(); + EUNIT_ASSERT( iMusTsyPropertyMonitor->iVoipCallMonitorArray.Count() == 0 ); + callState = EPSCTsyCallStateAnswering ; + iMusTsyPropertyMonitor->MonitorVoipCallL( callState ); + EUNIT_ASSERT( iMusTsyPropertyMonitor->iVoipCallMonitorArray.Count() == 1 ); + + // State disconnecting ( Atleast one previous voip call is present ) + callState = EPSCTsyCallStateDisconnecting; + iMusTsyPropertyMonitor->MonitorVoipCallL( callState ); + EUNIT_ASSERT( iMusTsyPropertyMonitor->iVoipCallMonitorArray.Count() == 0 ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusTsyPropertyMonitor::UT_CMusTsyPropertyMonitor_MonitorCallLL() + { + TInt tmp = 0; + if ( RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallCount, + 0 ) != KErrNone ) + { + User::Leave( KErrNoMemory ); + } + iMusTsyPropertyMonitor->iCallMonitorArray.ResetAndDestroy(); + iMusTsyPropertyMonitor->iVoipCallMonitorArray.ResetAndDestroy(); + // Test : Cs call and call state is connected + TPSCTsyCallState callState = EPSCTsyCallStateConnected; + RTelHelper::SetCallStatus( (RMobileCall::TMobileCallStatus)RCall::EStatusConnected ); + TPSCTsyCallType callType = EPSCTsyCallTypeCSVoice; + iMusTsyPropertyMonitor->MonitorCallL(callState,callType); + EUNIT_ASSERT( iMusTsyPropertyMonitor->iCallMonitorArray.Count() == 1 ); + EUNIT_ASSERT( iMusTsyPropertyMonitor->iVoipCallMonitorArray.Count() == 0 ); + RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + tmp ); + EUNIT_ASSERT( tmp==NMusSessionInformationApi::ECallConnected); + + // Test : unknown call type + iMusTsyPropertyMonitor->iCallMonitorArray.ResetAndDestroy(); + callType = EPSCTsyCallTypeNone; + iMusTsyPropertyMonitor->MonitorCallL(callState,callType); + EUNIT_ASSERT( iMusTsyPropertyMonitor->iCallMonitorArray.Count() == 0 ); + EUNIT_ASSERT( iMusTsyPropertyMonitor->iVoipCallMonitorArray.Count() == 0 ); + RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + tmp ); + EUNIT_ASSERT( tmp==NMusSessionInformationApi::ENoCall); + + // Test : Voip call and call state is connected and factory settings not found + // if key not found then it should behave default = AllowedAllCalls. + callState = EPSCTsyCallStateConnected; + callType = EPSCTsyCallTypeVoIP; + iMusTsyPropertyMonitor->MonitorCallL(callState,callType); + EUNIT_ASSERT( iMusTsyPropertyMonitor->iCallMonitorArray.Count() == 0 ); + EUNIT_ASSERT( iMusTsyPropertyMonitor->iVoipCallMonitorArray.Count() == 1 ); + RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + tmp ); + EUNIT_ASSERT( tmp==NMusSessionInformationApi::ECallConnected); + + + // Test : Voip call and call state is connected and factory settings set to + // all call supported. + iMusTsyPropertyMonitor->iVoipCallMonitorArray.ResetAndDestroy(); + iMusCentralRepository->Set(MusSettingsKeys::KAllowOnlyWithActiveCSCall, + MusSettingsKeys::EAllowedAllCalls); + callState = EPSCTsyCallStateConnected; + callType = EPSCTsyCallTypeVoIP; + iMusTsyPropertyMonitor->MonitorCallL(callState,callType); + EUNIT_ASSERT( iMusTsyPropertyMonitor->iCallMonitorArray.Count() == 0 ); + EUNIT_ASSERT( iMusTsyPropertyMonitor->iVoipCallMonitorArray.Count() == 1 ); + RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + tmp ); + EUNIT_ASSERT( tmp==NMusSessionInformationApi::ECallConnected); + + // Test : Voip call and call state is connected but factory settings are cs only + iMusTsyPropertyMonitor->iVoipCallMonitorArray.ResetAndDestroy(); + iMusCentralRepository->Set(MusSettingsKeys::KAllowOnlyWithActiveCSCall,MusSettingsKeys::EAllowedCSOnly); + callState = EPSCTsyCallStateConnected; + callType = EPSCTsyCallTypeVoIP; + iMusTsyPropertyMonitor->MonitorCallL(callState,callType); + EUNIT_ASSERT( iMusTsyPropertyMonitor->iCallMonitorArray.Count() == 0 ); + if ( iMusTsyPropertyMonitor->iVoipCallMonitorArray.Count() != 0 ) + { + User::Leave( KErrNoMemory ); // Call was not removed because of memory running out was "silenty" handled. + } + EUNIT_ASSERT( iMusTsyPropertyMonitor->iVoipCallMonitorArray.Count() == 0 ); + RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + tmp ); + EUNIT_ASSERT( tmp==NMusSessionInformationApi::ENoCall); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusTsyPropertyMonitor::UT_CMusTsyPropertyMonitor_RemoveUnUsedCallMonitorsL() + { + TName callName(_L("Voice1")); + if ( RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallCount, + 0 ) != KErrNone ) + { + User::Leave( KErrNoMemory ); + } + iMusTsyPropertyMonitor->AddCallMonitorL( callName ); + callName.Copy(_L("Voice2")); + iMusTsyPropertyMonitor->AddCallMonitorL( callName ); + RTelHelper::SetCallStatus(RMobileCall::EStatusUnknown); + iMusTsyPropertyMonitor->RemoveUnUsedCallMonitors(); + EUNIT_ASSERT( iMusTsyPropertyMonitor->iCallMonitorArray.Count()==0 ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusTsyPropertyMonitor::UT_CMusTsyPropertyMonitor_CheckCallCriteriaLL() + { + if ( RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallCount, + 0 ) != KErrNone ) + { + User::Leave( KErrNoMemory ); + } + TInt tmp = 0; + iMusTsyPropertyMonitor->iCallMonitorArray.ResetAndDestroy(); + iMusTsyPropertyMonitor->iVoipCallMonitorArray.ResetAndDestroy(); + + User::LeaveIfError( RProperty::Set( KPSUidTelRemotePartyInformation, + KTelCLINumber, + _L( "sip:somebody@somewhere" ) ) ); + + // Test : no cs call , one voip call + iMusTsyPropertyMonitor->AddVoipCallMonitorL( voip_call_1 ); + iMusTsyPropertyMonitor->CheckCallCriteriaL(); + RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + tmp ); + EUNIT_ASSERT( tmp==NMusSessionInformationApi::ECallConnected); + // Test : one cs call , multiple voip calls + iMusTsyPropertyMonitor->iCallMonitorArray.ResetAndDestroy(); + iMusTsyPropertyMonitor->iVoipCallMonitorArray.ResetAndDestroy(); + iMusTsyPropertyMonitor->AddCallMonitorL( cs_call_1 ); + iMusTsyPropertyMonitor->AddVoipCallMonitorL( voip_call_1 ); + iMusTsyPropertyMonitor->AddVoipCallMonitorL( voip_call_2 ); + iMusTsyPropertyMonitor->CheckCallCriteriaL(); + RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + tmp ); + EUNIT_ASSERT( tmp==NMusSessionInformationApi::ECallHold); + // Test: multiple cs call, one voip call + iMusTsyPropertyMonitor->iCallMonitorArray.ResetAndDestroy(); + iMusTsyPropertyMonitor->iVoipCallMonitorArray.ResetAndDestroy(); + iMusTsyPropertyMonitor->AddCallMonitorL( cs_call_1 ); + iMusTsyPropertyMonitor->AddCallMonitorL( cs_call_2 ); + iMusTsyPropertyMonitor->AddVoipCallMonitorL( voip_call_1 ); + iMusTsyPropertyMonitor->CheckCallCriteriaL(); + RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + tmp ); + EUNIT_ASSERT( tmp==NMusSessionInformationApi::ECallHold); + + // Test : multiple cs call , multiple voip calls + iMusTsyPropertyMonitor->iCallMonitorArray.ResetAndDestroy(); + iMusTsyPropertyMonitor->iVoipCallMonitorArray.ResetAndDestroy(); + iMusTsyPropertyMonitor->AddCallMonitorL( cs_call_1 ); + iMusTsyPropertyMonitor->AddCallMonitorL( cs_call_2 ); + iMusTsyPropertyMonitor->AddVoipCallMonitorL( voip_call_1 ); + iMusTsyPropertyMonitor->AddVoipCallMonitorL( voip_call_2 ); + iMusTsyPropertyMonitor->CheckCallCriteriaL(); + RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + tmp ); + EUNIT_ASSERT( tmp==NMusSessionInformationApi::ECallHold); + // Test : one cs call , one voip call + iMusTsyPropertyMonitor->iCallMonitorArray.ResetAndDestroy(); + iMusTsyPropertyMonitor->iVoipCallMonitorArray.ResetAndDestroy(); + iMusTsyPropertyMonitor->AddCallMonitorL( cs_call_1 ); + iMusTsyPropertyMonitor->AddVoipCallMonitorL( voip_call_1 ); + iMusTsyPropertyMonitor->CheckCallCriteriaL(); + RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + tmp ); + EUNIT_ASSERT( tmp==NMusSessionInformationApi::ECallHold); + // Test: one cs call , no voip call + iMusTsyPropertyMonitor->iCallMonitorArray.ResetAndDestroy(); + iMusTsyPropertyMonitor->iVoipCallMonitorArray.ResetAndDestroy(); + RTelHelper::SetCallStatus( RMobileCall::EStatusConnected ); + iMusTsyPropertyMonitor->AddCallMonitorL( cs_call_1 ); + iMusTsyPropertyMonitor->CheckCallCriteriaL(); + RProperty::Get( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallEvent, + tmp ); + EUNIT_ASSERT( tmp==NMusSessionInformationApi::ECallConnected); + } + + + +// ----------------------------------------------------------------------------- +// UT_CMusTsyPropertyMonitor::UT_CMusTsyPropertyMonitor_IsDataReadyLL() +// Test to query from corresponding monitors if they are ready. +// ----------------------------------------------------------------------------- +// + + +void UT_CMusTsyPropertyMonitor::UT_CMusTsyPropertyMonitor_IsDataReadyLL() + { + TBool dataReady = EFalse; + + // Test-1: CS Call Ready: + iMusTsyPropertyMonitor->iCallMonitorArray.ResetAndDestroy(); + iMusTsyPropertyMonitor->iVoipCallMonitorArray.ResetAndDestroy(); + + if ( RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallCount, + 0 ) != KErrNone ) + { + User::Leave( KErrNoMemory ); + } + + User::LeaveIfError( RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusTelNumber, + KTelNo )); + + User::LeaveIfError( RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusCallDirection, + NMusSessionInformationApi::ECallOrginated )); + + iMusTsyPropertyMonitor->AddCallMonitorL( cs_call_1 ); + dataReady = iMusTsyPropertyMonitor->IsDataReadyL(); + EUNIT_ASSERT_EQUALS( dataReady, ETrue ) + + // Test-2: CS Call NotReady: + User::LeaveIfError( RProperty::Set( NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusTelNumber, + KNullDesC )); + + dataReady = iMusTsyPropertyMonitor->IsDataReadyL(); + EUNIT_ASSERT_EQUALS( dataReady, EFalse ) + + // Test-3 VoIP Call Ready + iMusTsyPropertyMonitor->iCallMonitorArray.ResetAndDestroy(); + iMusTsyPropertyMonitor->AddVoipCallMonitorL( voip_call_1 ); + + User::LeaveIfError( RProperty::Set( + NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMusTelNumber, + KDefaultSipUri )); + + User::LeaveIfError(RProperty::Set( + NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMUSCallProvider, + KTestProvideName )); + + dataReady = iMusTsyPropertyMonitor->IsDataReadyL(); + EUNIT_ASSERT_EQUALS( dataReady, ETrue ) + + + // Test-4 VoIP Call Not Ready + User::LeaveIfError( RProperty::Set( + NMusSessionInformationApi::KCategoryUid, + NMusSessionInformationApi::KMUSCallProvider, + KNullDesC )); + + dataReady = iMusTsyPropertyMonitor->IsDataReadyL(); + + EUNIT_ASSERT_EQUALS( dataReady, EFalse ) + + // Test-5: Conference Case + iMusTsyPropertyMonitor->iCallMonitorArray.ResetAndDestroy(); + iMusTsyPropertyMonitor->iVoipCallMonitorArray.ResetAndDestroy(); + + iMusTsyPropertyMonitor->AddVoipCallMonitorL( voip_call_1 ); + iMusTsyPropertyMonitor->AddVoipCallMonitorL( voip_call_2 ); + + dataReady = iMusTsyPropertyMonitor->IsDataReadyL(); + EUNIT_ASSERT_EQUALS( dataReady, EFalse ) + iMusTsyPropertyMonitor->iVoipCallMonitorArray.ResetAndDestroy(); + + // Test-3 Handling conference case. + iMusTsyPropertyMonitor->iConferenceMonitor->iConfStatus = RMobileConferenceCall::EConferenceActive; + dataReady = iMusTsyPropertyMonitor->IsDataReadyL(); + EUNIT_ASSERT_EQUALS( dataReady, ETrue ) + iMusTsyPropertyMonitor->iConferenceMonitor->iConfStatus = RMobileConferenceCall::EConferenceIdle; + } + + +// ----------------------------------------------------------------------------- +// MusCallStateChanged from the MusCallStateObserver +// ----------------------------------------------------------------------------- +// +void UT_CMusTsyPropertyMonitor::MusCallStateChanged() + { + // NOP + } + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusTsyPropertyMonitor, + "UT_CMusTsyPropertyMonitor", + "UNIT" ) + +EUNIT_TEST( + "RunL - test", + "CMusTsyPropertyMonitor", + "RunL", + "FUNCTIONALITY", + SetupL, UT_CMusTsyPropertyMonitor_RunLL, Teardown) + +EUNIT_TEST( + "DoCancel - test", + "CMusTsyPropertyMonitor", + "DoCancel", + "FUNCTIONALITY", + SetupL, UT_CMusTsyPropertyMonitor_DoCancelL, Teardown) + +EUNIT_TEST( + "RunError - test", + "CMusTsyPropertyMonitor", + "RunError", + "FUNCTIONALITY", + SetupL, UT_CMusTsyPropertyMonitor_RunErrorL, Teardown) + +EUNIT_TEST( + "UT_CMusTsyPropertyMonitor_RemoveUnUsedCallMonitorsL", + "CMusCallStatusMonitor", + "RemoveUnUsedCallMonitors", + "FUNCTIONALITY", + SetupL, UT_CMusTsyPropertyMonitor_RemoveUnUsedCallMonitorsL, Teardown) + +EUNIT_TEST( + "AddCallMonitorL - test", + "CMusTsyPropertyMonitor", + "AddCallMonitorL", + "FUNCTIONALITY", + SetupL, UT_CMusTsyPropertyMonitor_AddCallMonitorLL, Teardown) + +EUNIT_TEST( + "RemoveCallMonitor - test", + "CMusTsyPropertyMonitor", + "RemoveCallMonitor", + "FUNCTIONALITY", + SetupL, UT_CMusTsyPropertyMonitor_RemoveCallMonitorL, Teardown) + +EUNIT_TEST( + "MonitorCallL - test", + "CMusTsyPropertyMonitor", + "MonitorCallL", + "FUNCTIONALITY", + SetupL, UT_CMusTsyPropertyMonitor_MonitorCallLL, Teardown) + +EUNIT_TEST( + "MonitorCsCallL - test", + "CMusTsyPropertyMonitor", + "MonitorCsCallL", + "FUNCTIONALITY", + SetupL, UT_CMusTsyPropertyMonitor_MonitorCSCallLL, Teardown) + +EUNIT_TEST( + "MonitorVoipCallL - test", + "CMusTsyPropertyMonitor", + "MonitorVoipCallL", + "FUNCTIONALITY", + SetupL, UT_CMusTsyPropertyMonitor_MonitorVoipCallLL, Teardown) + +EUNIT_TEST( + "CheckCallCriteriaL - test", + "CMusTsyPropertyMonitor", + "CheckCallCriteriaL", + "FUNCTIONALITY", + SetupL, UT_CMusTsyPropertyMonitor_CheckCallCriteriaLL, Teardown) + +EUNIT_TEST( + "IsDataReadyL - test", + "CMusTsyPropertyMonitor", + "IsDataReadyL", + "FUNCTIONALITY", + SetupL, UT_CMusTsyPropertyMonitor_IsDataReadyLL, Teardown) + +EUNIT_END_TEST_TABLE + +// END OF FILE + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshsettingsuiplugin/data/1028238F.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshsettingsuiplugin/data/1028238F.rss Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,43 @@ +/* +* Copyright (c) 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: ECOM plugin resource file for MUSSettingsPlugin. +* +*/ + +#include +#include "../../../inc/musversionnumbers.h" + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = 0x1028238F; + interfaces = + { + INTERFACE_INFO + { + interface_uid = 0x10207236; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x1028238F; + version_no = KMusEcomVersionNumber; + display_name = "Video Sharing Settings Plugin"; + default_data = "0x10207250"; // Parent UID - Connection Settings + opaque_data = "100"; // Order number + } + }; + } + }; + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshsettingsuiplugin/data/mussettingsuirsc.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshsettingsuiplugin/data/mussettingsuirsc.rss Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,531 @@ +/* +* Copyright (c) 2006-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: Resource file for MUSSettingsPlugin. +* Version : %version: 19 % << Don't touch! Updated by Synergy at check-out. +* +*/ + + + +NAME MUSH // 4 letter ID + + +#include "mussettingsplugin.hrh" +#include // MUSH localized strings +#include //localization +#include +#include +#include +#include // Avkon localized strings +#include +#include +#include +#include +#include +#include +#include +#include // CommonDialogs Enumerations +#include // CommonDialogs Resource structures +#include + + +RESOURCE RSS_SIGNATURE {} + + +// --------------------------------------------------------------------------- +// r_gs_vssettings_view_title +// VS Settings view's title. +// --------------------------------------------------------------------------- +// +RESOURCE TITLE_PANE r_gs_vssettings_view_title + { + txt = qtn_msh_set_title ; + } + +// --------------------------------------------------------------------------- +// r_gs_vs_plugin_caption +// VS Plugin caption. +// --------------------------------------------------------------------------- +// +RESOURCE TBUF r_gs_vs_plugin_caption + { + buf = qtn_set_folder_video_sharing; + } + +// --------------------------------------------------------------------------- +// r_gs_vs_view +// Video Sharing view. +// --------------------------------------------------------------------------- +// +RESOURCE AVKON_VIEW r_gs_vs_view + { + menubar = r_vs_menubar_change_exit; + cba = R_GS_SOFTKEYS_OPTIONS_BACK_CHANGE; + } + +// --------------------------------------------------------------------------- +// r_vs_lbx_resource +// Video sharing view's listbox resource. +// --------------------------------------------------------------------------- +// +RESOURCE LISTBOX r_vs_lbx_resource + { + array_id = r_vs_lbx; + flags = EEikListBoxMultipleSelection; + } + +// --------------------------------------------------------------------------- +// r_vs_lbx +// Video sharing view's listbox. +// --------------------------------------------------------------------------- +// +RESOURCE GS_FEATURE_ARRAY r_vs_lbx + { + items = + { + GS_FEATURE + { + txt = " \t"qtn_msh_set_activation_title"\t\t"; + item = KGSSettIdVSActivation; + }, + GS_FEATURE + { + txt = " \t"qtn_msh_set_profile_title"\t\t"; + item = KGSSettIdSIPProfile; + }, + GS_FEATURE + { + txt = " \t"qtn_msh_set_saving_title"\t\t"; + item = KGSSettIdAutoRecord; + }, + GS_FEATURE + { + txt = " \t"qtn_msh_set_storage_title"\t\t"; + item = KGSSettIdRecordedVideoSaving; + }, + GS_FEATURE + { + txt = " \t"qtn_msh_set_audio_title"\t\t"; + item = KGSSettIdNote; + } + }; + } + +// --------------------------------------------------------------------------- +// r_vs_lbx_operator +// Video sharing view's listbox. +// --------------------------------------------------------------------------- +// +RESOURCE GS_FEATURE_ARRAY r_vs_lbx_operator + { + items = + { + GS_FEATURE + { + txt = " \t"qtn_msh_set_activation_title"\t\t"; + item = KGSSettIdVSActivation; + }, + GS_FEATURE + { + txt = " \t"qtn_msh_set_profile_title"\t\t"; + item = KGSSettIdSIPProfile; + }, + GS_FEATURE + { + txt = " \t"qtn_msh_set_saving_title"\t\t"; + item = KGSSettIdAutoRecord; + }, + GS_FEATURE + { + txt = " \t"qtn_msh_set_storage_title"\t\t"; + item = KGSSettIdRecordedVideoSaving; + }, + GS_FEATURE + { + txt = " \t"qtn_msh_set_note_title"\t\t"; + item = KGSSettIdNote; + } + }; + } + +// --------------------------------------------------------------------------- +// r_vs_lbx_restricted +// Video Sharing view's listbox. +// --------------------------------------------------------------------------- +// +RESOURCE GS_FEATURE_ARRAY r_vs_lbx_restricted + { + items = + { + GS_FEATURE + { + txt = " \t"qtn_msh_set_profile_title"\t\t"; + item = KGSSettIdSIPProfile; + } + }; + } + +// --------------------------------------------------------------------------- +// r_activation_setting_page +// Activation setting page. +// --------------------------------------------------------------------------- +// +RESOURCE AVKON_SETTING_PAGE r_activation_setting_page + { + number = EAknSettingPageNoOrdinalDisplayed; + label = qtn_msh_set_activation_title; + softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; + type = EAknSetListBox; + editor_resource_id = r_setting_listbox; + } + +// --------------------------------------------------------------------------- +// r_vs_profile_setting_page +// Attach setting page. +// --------------------------------------------------------------------------- +// +RESOURCE AVKON_SETTING_PAGE r_vs_profile_setting_page + { + number = EAknSettingPageNoOrdinalDisplayed; + label = qtn_msh_set_profile_title; + softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; + type = EAknSetListBox; + editor_resource_id = r_setting_listbox; + } + +// --------------------------------------------------------------------------- +// r_vs_sip_profile_list_view_select_setting_page +// Pop-up page to select the profile on profile list view +// --------------------------------------------------------------------------- +// +RESOURCE AVKON_SETTING_PAGE r_vs_sip_profile_list_view_select_setting_page + { + number = EAknSettingPageNoOrdinalDisplayed; + label = qtn_msh_set_profile_select_title; + softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL; + type = EAknSetListBox; + editor_resource_id = r_sip_select_setting_page_control; + } + +// --------------------------------------------------------------------------- +// r_sip_select_setting_page_control +// The radio button list control for the select profile pop-up page +// --------------------------------------------------------------------------- +// +RESOURCE LISTBOX r_sip_select_setting_page_control + { + flags = EEikListBoxMultipleSelection; + } + +// --------------------------------------------------------------------------- +// r_vs_video_saving_setting_page +// Video saving setting page. +// --------------------------------------------------------------------------- +// +RESOURCE AVKON_SETTING_PAGE r_vs_video_saving_setting_page + { + number = EAknSettingPageNoOrdinalDisplayed; + label = qtn_msh_set_saving_title; + softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; + type = EAknSetListBox; + editor_resource_id = r_setting_listbox; + } + +// --------------------------------------------------------------------------- +// r_vs_recorded_video_saving_setting_page +// Recorded video saving setting page. +// --------------------------------------------------------------------------- +// +RESOURCE MEMORYSELECTIONDIALOG r_vs_recorded_video_saving_setting_page + { + title = qtn_msh_set_storage_title; + softkey_1 = text_softkey_ok; + softkey_2 = text_softkey_cancel; + + locations = + { + LOCATION { root_path = text_phone_memory_root_path; }, + LOCATION { root_path = text_memory_card_root_path; } + }; + } + +// --------------------------------------------------------------------------- +// r_vs_note_setting_page +// Note setting page. +// --------------------------------------------------------------------------- +// +RESOURCE AVKON_SETTING_PAGE r_vs_note_setting_page + { + number = EAknSettingPageNoOrdinalDisplayed; + label = qtn_msh_set_note_title; + softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; + type = EAknSetListBox; + editor_resource_id = r_setting_listbox; + } + +// --------------------------------------------------------------------------- +// r_vs_audio_setting_page +// Note setting page. +// --------------------------------------------------------------------------- +// +RESOURCE AVKON_SETTING_PAGE r_vs_audio_setting_page + { + number = EAknSettingPageNoOrdinalDisplayed; + label = qtn_msh_set_audio_title; + softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; + type = EAknSetListBox; + editor_resource_id = r_setting_listbox; + } + +// --------------------------------------------------------------------------- +// r_operator_activation_setting_page_lbx +// Operator specific activation setting page's listbox. +// --------------------------------------------------------------------------- +// +RESOURCE ARRAY r_operator_activation_setting_page_lbx + { + items = + { + LBUF + { + txt = qtn_msh_set_activation_always; + }, + LBUF + { + txt = qtn_msh_set_activation_off; + } + }; + } + +// --------------------------------------------------------------------------- +// r_activation_setting_page_lbx +// Activation setting page's listbox. +// --------------------------------------------------------------------------- +// +RESOURCE ARRAY r_activation_setting_page_lbx + { + items = + { + LBUF + { + txt = qtn_msh_set_activation_always; + }, + LBUF + { + txt = qtn_msh_set_activation_homentw; + }, + LBUF + { + txt = qtn_msh_set_activation_off; + } + }; + } + +// --------------------------------------------------------------------------- +// r_sip_profile_setting_page_lbx +// Attach setting page's listbox. +// --------------------------------------------------------------------------- +// +RESOURCE ARRAY r_sip_profile_setting_page_lbx + { + items = + { + LBUF + { + txt = qtn_msh_set_profile_default; + }, + LBUF + { + txt = qtn_msh_set_profile_select; + }, + LBUF + { + txt = qtn_msh_set_profile_not_selected; + } + }; + } + +// --------------------------------------------------------------------------- +// r_vs_video_saving_setting_page_lbx +// Auto recording setting page's listbox. +// --------------------------------------------------------------------------- +// +RESOURCE ARRAY r_vs_video_saving_setting_page_lbx + { + items = + { + LBUF + { + txt = qtn_msh_set_saving_auto; + }, + LBUF + { + txt = qtn_msh_set_saving_off; + } + }; + } + +// --------------------------------------------------------------------------- +// r_vs_note_setting_page_lbx +// Alerts setting page's listbox. +// --------------------------------------------------------------------------- +// +RESOURCE ARRAY r_vs_note_setting_page_lbx + { + items = + { + LBUF + { + txt = qtn_msh_set_note_on; + }, + LBUF + { + txt = qtn_msh_set_note_off; + } + }; + } + +// --------------------------------------------------------------------------- +// r_vs_audio_setting_page_lbx +// Capability auditory note setting page's listbox. +// --------------------------------------------------------------------------- +// +RESOURCE ARRAY r_vs_audio_setting_page_lbx + { + items = + { + LBUF + { + txt = qtn_msh_set_audio_on; + }, + LBUF + { + txt = qtn_msh_set_audio_off; + } + }; + } + +// --------------------------------------------------------------------------- +// r_vs_settings_menubar_change_exit +// Options menu with 'Change' and 'Exit' items. +// --------------------------------------------------------------------------- +// +RESOURCE MENU_BAR r_vs_menubar_change_exit + { + titles = + { + MENU_TITLE + { + menu_pane = r_vs_menu_item_exit; + }, + MENU_TITLE + { + menu_pane = r_vs_menu_item_change; + } + }; + } + +// --------------------------------------------------------------------------- +// r_vs_settings_menu_item_exit +// Options menu items 'Help' and 'Exit'. +// Used instead of plain 'Exit' when help is wanted +// to be shown in UI. +// --------------------------------------------------------------------------- +// +RESOURCE MENU_PANE r_vs_menu_item_exit + { + items = + { +#ifdef __SERIES60_HELP + MENU_ITEM + { + command = EAknCmdHelp; + txt = qtn_options_help; + }, +#endif // __SERIES60_HELP + MENU_ITEM + { + command = EAknCmdExit; + txt = qtn_options_exit; + } + }; + } + +// --------------------------------------------------------------------------- +// r_vs_settings_menu_item_change +// Options menu item 'Change'. +// --------------------------------------------------------------------------- +// +RESOURCE MENU_PANE r_vs_menu_item_change + { + items = + { + MENU_ITEM + { + command = EGSCmdAppChange; + txt = qtn_options_change; + } + }; + } + +// --------------------------------------------------------------------------- +// r_setting_listbox +// Common listbox editor resource for setting pages. +// --------------------------------------------------------------------------- +// +RESOURCE LISTBOX r_setting_listbox + { + flags = EEikListBoxMultipleSelection; + } + +// --------------------------------------------------------------------------- +// r_qtn_msh_set_profile_empty +// Notification for user no sip profiles defined. +// --------------------------------------------------------------------------- +// +RESOURCE TBUF r_qtn_msh_set_profile_empty + { + buf = qtn_msh_set_profile_empty; + } + +// --------------------------------------------------------------------------- +// r_qtn_msh_set_profile_note +// Notification for user new profile active after the call. +// --------------------------------------------------------------------------- +// +RESOURCE TBUF r_qtn_msh_set_profile_note + { + buf = qtn_msh_set_profile_note; + } + +// --------------------------------------------------------------------------- +// r_qtn_msh_set_storage_card +// Video location in memory card. +// --------------------------------------------------------------------------- +// +RESOURCE TBUF r_qtn_msh_set_storage_card + { + buf = qtn_msh_set_storage_card; + } + +// --------------------------------------------------------------------------- +// r_qtn_msh_set_storage_phone +// Video location in phone memory. +// --------------------------------------------------------------------------- +// +RESOURCE TBUF r_qtn_msh_set_storage_phone + { + buf = qtn_msh_set_storage_phone; + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshsettingsuiplugin/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshsettingsuiplugin/group/bld.inf Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,34 @@ +/* +* 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: Information required for building MUSSettingsPlugin. +* +*/ +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES +mussettingsplugin.mmp + +PRJ_EXTENSIONS +START EXTENSION s60/mifconv +OPTION TARGETFILE mussettingsplugin.mif +OPTION HEADERFILE mussettingsplugin.mbg +OPTION SOURCES -c8,8 qgn_prop_set_video_sharing +END + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshsettingsuiplugin/group/mussettingsplugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshsettingsuiplugin/group/mussettingsplugin.mmp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,98 @@ +/* +* Copyright (c) 2006-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 file for MUSSettingsPlugin. +* +*/ + + +#include +#include //this is needed for RESOURCE_FILES_DIR + +CAPABILITY CAP_ECOM_PLUGIN +TARGET mussettingsui.dll +TARGETTYPE PLUGIN +UID 0x10009D8D 0x1028238F +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE mussettingscontainer.cpp +SOURCE mussettingsmodel.cpp +SOURCE mussettingsplugin.cpp +SOURCE mussettingspluginimplementationtable.cpp +SOURCE mussipprofilemodel.cpp + +USERINCLUDE ../data +USERINCLUDE ../inc +USERINCLUDE ../../../inc + +APP_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE . + +SOURCEPATH ../data + +//ECOM resource definition +START RESOURCE 1028238F.rss +TARGET mussettingsui.rsc +TARGETPATH ECOM_RESOURCE_DIR +END // ECOM resource definition + +//MUS resources +START RESOURCE mussettingsuirsc.rss +DEPENDS gsapp.rsg +HEADER +TARGETPATH RESOURCE_FILES_DIR +LANGUAGE_IDS +END // MUS resources + +LIBRARY aknskins.lib // AknsUtils.h +LIBRARY avkon.lib +LIBRARY bafl.lib +LIBRARY charconv.lib +LIBRARY commdb.lib +LIBRARY commonengine.lib // RConeResourceLoader +LIBRARY cone.lib +LIBRARY ecom.lib +LIBRARY efsrv.lib +LIBRARY egul.lib // CGulIcon +LIBRARY eikcoctl.lib +LIBRARY eikcore.lib +LIBRARY etel.lib // RPhone +LIBRARY etelpckt.lib // RPacketService +LIBRARY euser.lib +LIBRARY featmgr.lib // FeatureManager +LIBRARY flogger.lib // RFileLogger +LIBRARY gsecomplugin.lib +LIBRARY gsframework.lib // Base classes +LIBRARY gslistbox.lib // CGSListBoxItemTextArray +LIBRARY hlplch.lib // HlpLauncher +LIBRARY platformenv.lib // PathInfo +LIBRARY centralrepository.lib //settings values +LIBRARY commondialogs.lib +LIBRARY aknnotify.lib //CAknGlobalNote +LIBRARY eiksrv.lib //CAknGlobalNote +LIBRARY disknotifyhandler.lib //CDiskNotifyHandler + +// Libraries for SIP settings. +LIBRARY sipprofilecli.lib +LIBRARY inetprotutil.lib + +//Documents. Defining these is optional. Used only by IDE's file browser. +SOURCEPATH ../data +DOCUMENT 1028238F.rss +DOCUMENT mussettingsuirsc.rss + +SOURCEPATH ../inc +DOCUMENT mussettingsplugin.hrh + +PAGED diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshsettingsuiplugin/inc/mmussipprofilehandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshsettingsuiplugin/inc/mmussipprofilehandler.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,75 @@ +/* +* Copyright (c) 2003-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: Mixin-class that provides functionality for manipulating +* MuS specific settings. +* +*/ + + +#ifndef M_MMUSSIPPROFILEHANDLER_H +#define M_MMUSSIPPROFILEHANDLER_H + +#include + +/** +* MMusSIPProfileHandler class +* Mixin class for SIP profile manipulation. +* Handles SIP profile manipulations. +* @since S60 v3.2 +*/ +class MMusSIPProfileHandler + { +public: + + /** + * Returns the index of the default SIP profile. + * @return KErrNotFound, if one does not exist, otherwise index of the + * default SIP profile. + */ + virtual TInt DefaultProfileIndex() = 0; + + /** + * Returns pointer to the SIP profile array, does not change ownership. + * Note that previously returned value goes out of scope after a new + * call to ProfileArrayL. So it is not advised to store return value + * in long persistent variable, but rather to be used like stack + * variables for safety. + * + * @return Pointer to internally cached SIP profile array. + */ + virtual CArrayPtr* ProfileArrayL() = 0; + + /** + * Returns the id of the default SIP profile. + * @return KErrNotFound, if one does not exist, otherwise id of the + * default SIP profile. + */ + virtual TUint32 DefaultProfileId() = 0; + + /** + * Returns profile id based on index. + * @param aIndex Profile index + * @return Profile id or KUnknownProfileId if no matching profile is found. + */ + virtual TInt ProfileIndexByIdL( TUint32 aId ) = 0; + + /** + * Returns SIP profile index on locally cached array based on id. + * @param aId Profile id + * @return Profile index or KErrNotFound if no matching profile is found. + */ + virtual TUint32 ProfileIdByIndex( TUint aIndex ) = 0; + }; + +#endif // M_MMUSSIPPROFILEHANDLER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshsettingsuiplugin/inc/mussettingscontainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshsettingsuiplugin/inc/mussettingscontainer.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,199 @@ +/* +* Copyright (c) 2006-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: Container for MUSSettingsPlugin. +* +*/ + + + +#ifndef C_CMUSSETTINGSCONTAINER_H +#define C_CMUSSETTINGSCONTAINER_H + + +#include "mussettings.h" +#include +#include + + +class CGSListBoxItemTextArray; +class CEikTextListBox; +class CMusSettingsModel; + + +/** Buffer size for general settings menu items */ +const TInt KGSBufSize128 = 128; + + +/** + * CMusSettingsContainer container class. + * Container class for MUSSettingsPlugin. + * + * @since S60 v3.2 + */ +class CMusSettingsContainer : public CGSBaseContainer + { +public: + + /** + * C++ constructor, public since no NewL factory function implemented. + * + * @param aModel Reference to CMuSSettingsModel class. + */ + CMusSettingsContainer( CMusSettingsModel& aModel ); + + /** + * Symbian OS second phase constructor. Public for owner to specify size + * of client rectangle. + * + * @param aRect Rectangle of container area. + */ + void ConstructL( const TRect& aRect ); + + /** + * Destructor. + */ + ~CMusSettingsContainer(); + + /** + * Updates listbox's item's value. + * + * @param aFeatureId An item which is updated. + */ + void UpdateListBoxL( TInt aFeatureId ); + + /** + * Retrieves the currently selected listbox feature id. + * @return feature id. + */ + TInt CurrentFeatureId() const; + + /** + * Shows notification of newly selected SIP profile taken to use after + * active call. + */ + void ShowNewProfileActiveAfterCallL(); + +protected: + +// from base class CGSBaseContainer. + + /** + * From CGSBaseContainer. + * Creates listbox. See baseclass for further description. + * + * @param aResLbxId Resource identifier for listbox to be created. + */ + virtual void ConstructListBoxL( TInt aResLbxId ); + +private: + + /** + * Add an item to list of settings. + */ + void AddItemL( TInt aId, const TPtrC aText ); + + /** + * Create settings list items. + */ + void CreateListBoxItemsL(); + + /** + * Create VS activation settings list item. + */ + void MakeActivationItemL(); + + /** + * Create Operator VS activation settings list item. + */ + void MakeOperatorActivationItemL(); + + /** + * Create SIP profile settings list item. + */ + void MakeSIPProfileItemL(); + + /** + * Create autorecord settings list item. + */ + void MakeAutoRecordItemL(); + + /** + * Create note settings list item. + */ + void MakeNoteItemL(); + + /** + * Create save recorded video settings list item. + */ + void MakeRecordedVideoSavingItemL(); + + /** + * Required for help. + */ + void GetHelpContext( TCoeHelpContext& aContext ) const; + + /** + * Hide some itesm if needed in operator variant mode + */ + void HideItemsL( TInt aItemIndex ); + +private: // data + + /** + * Reference to data model. + */ + CMusSettingsModel& iModel; + + /** + * List items in VS activation mode. + * Own. + */ + CDesCArrayFlat* iActivationItems; + + /** + * List items in SIP profile mode. + * Own. + */ + CDesCArrayFlat* iProfileItems; + + /** + * List items in autorecord mode. + * Own. + */ + CDesCArrayFlat* iAutoRecordItems; + + /** + * List items in note. + * Own. + */ + CDesCArrayFlat* iNoteItems; + + /** + * Operator variant current value. + */ + MusSettingsKeys::TOperatorVariant iOperatorVariant; + + /** + * VS activation current value. + */ + MusSettingsKeys::TActivation iVSActication; + + /** + * Listbox items. + */ + CGSListBoxItemTextArray* iListboxItemArray; + + }; + +#endif // C_CMUSSETTINGSCONTAINER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshsettingsuiplugin/inc/mussettingsmodel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshsettingsuiplugin/inc/mussettingsmodel.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,225 @@ +/* +* Copyright (c) 2006-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: MUSSettingsPlugin model class. +* +*/ + + + +#ifndef C_MUSSETTINGSMODEL_H +#define C_MUSSETTINGSMODEL_H + +#include "mussettings.h" + +class MMusSIPProfileHandler; +class CMusSIPProfileModel; +class MultimediaSharingSettings; + +class CAknMemorySelectionDialogMultiDrive; + + +/** + * CMusSettingsModel is the model class of GS application. + * It provides functions to get and set setting values. + * + * @since S60 v3.2 + */ +class CMusSettingsModel : public CBase + { +public: + + /** + * Two-phased constructor. + * @param aHandler Reference to SIP profile manipulator class. + * return Returns pointer to a new instance of CMusSettings class. + */ + static CMusSettingsModel* NewL( MMusSIPProfileHandler& aHandler ); + + /** + * Destructor. + */ + ~CMusSettingsModel(); + + /** + * Returns operator variant mode. + * @return 0: Standard (MusSettingsKeys::EStandard) + * 1: Operator Specific (MusSettingsKeys::EOperatorSpecific) + */ + MusSettingsKeys::TOperatorVariant VSSettingsOperatorVariantL(); + + /** + * Returns VS activation mode. + * @return 0: Always (MusSettingsKeys::EAlwaysActive) + * 1: Automatic (MusSettingsKeys::EActiveInHomeNetworks) + * 2: Off (MusSettingsKeys::ENever) + */ + MusSettingsKeys::TActivation VSSettingsActivationL(); + + /** + * Returns SIP profile mode. + * @return 0: Use default SIP profile. + * 1: Use user selected SIP profile. + */ + TInt VSSettingsProfileL(); + + /** + * Returns video autorecord mode. + * @return 0: on (MusSettingsKeys::EAutoRecordOn) + * 1: off (MusSettingsKeys::EAutoRecordOff) + */ + MusSettingsKeys::TAutoRecord VSSettingsAutoRecordL(); + + /** + * Returns recorded video saving mode. + * @return 2: phone memory + * 4: memory card + */ + TInt VSSettingsRecordedVideoSavingL(); + + /** + * Returns state of note (on/off). This setting is called "Capability + * auditory note" in standard variant and "Alerts" in operator specific + * variant. + * @return 0: enabled (MusSettingsKeys::EAuditoryNotificationOn) + * 1: disabled (MusSettingsKeys::EAuditoryNotificationOff) + */ + MusSettingsKeys::TAuditoryNotification VSSettingsNoteL(); + + /** + * Sets packet data VS activation mode. + * @param aActivation Activation mode. + */ + void SetVSSettingsActivationL( + const MusSettingsKeys::TActivation aActivation ); + + /** + * Sets SIP profile mode. + * @param aProfile Profile id. + */ + void SetVSSettingsProfileL( const TInt aProfile ); + + /** + * Sets video autorecord mode. + * @param aAutoRecord save mode of video. + */ + void SetVSSettingsAutoRecordL( + const MusSettingsKeys::TAutoRecord aAutoRecord ); + + /** + * Sets location of video saving. + * @param aVideoLocation location of video + */ + void SetVSSettingsRecordedVideoSavingL( const TInt aVideoLocation ); + + /** + * Sets mode of note ("Capability auditory note" in standard variant and + * "Alerts" in operator specific variant). + * @param aValue New state for note (enabled/disabled). + */ + void SetVSSettingsNoteL( + const MusSettingsKeys::TAuditoryNotification aValue ); + + /** + * Returns the array containing the profile names. + * NOTE! The ownership of the array is transferred to the caller. + * @return Array consisting of the names of the SIP profiles. + */ + CDesCArray* ListOfProfileNamesL(); + + /** + * Gets a SIP profile name by ID. + * Ownership is transferred to caller. + * @return SIP profile name. + */ + HBufC* ProfileNameL( TInt aId ); + + /** + * Gets the index of the default SIP profile. + * @return KErrNotFound, if one does not exist, otherwise index of the + * default SIP profile. + */ + TInt DefaultProfileIndex(); + + /** + * Gets the id of the default SIP profile. + * @return KErrNotFound, if one does not exist, otherwise id of the + * default SIP profile. + */ + TUint32 DefaultProfileId(); + + /** + * Returns SIP profile index on locally cached array based on id. + * @param aId Profile id + * @return Profile index or KErrNotFound if no matching profile is found. + */ + TInt ProfileIndexByIdL( TUint32 aId ); + + /** + * Returns profile id based on index. + * @param aIndex Profile index + * @return Profile id or KUnknownProfileId if no matching profile is found. + */ + TUint32 ProfileIdByIndex( TUint aIndex ); + + + /** + * Returns memory section dialog + * @return Memory selction dialog reference + */ + CAknMemorySelectionDialogMultiDrive* MemorySelectionDialogLC(); + + +public: // constants + + /** + * Default SIP profile. + */ + static const TInt KVsSipProfileDefault; + + /** + * SIP profile select. + */ + static const TInt KVsSipProfileSelect; + + /** + * Null selection SIP profile. + */ + static const TInt KVsSipProfileSelectNone; + +private: + + /** + * C++ constructor. + * @param aHandler Reference to SIP profile manipulator. + */ + CMusSettingsModel( MMusSIPProfileHandler& aHandler ); + + void ConstructL(); + +private: // data + + /** + * SIP profile handler. + */ + MMusSIPProfileHandler& iHandler; + + /** + * Central repository keys of video sharing. + * Own. + */ + MultimediaSharingSettings* iMSSettingsKeys; + + }; + +#endif // C_MUSSETTINGSMODEL_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshsettingsuiplugin/inc/mussettingsplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshsettingsuiplugin/inc/mussettingsplugin.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,269 @@ +/* +* Copyright (c) 2006-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: MUSSettingsPlugin implementation. +* +*/ + + + +#ifndef C_MUSSETTINGSPLUGIN_H +#define C_MUSSETTINGSPLUGIN_H + + +#include +#include +#include +#include +#include +#include + + +class CMusSettingsContainer; +class CAknNavigationDecorator; +class CAknViewAppUi; +class CMusSettingsModel; +class CMusSIPProfileModel; + + +/** UID of *this* plugin. */ +const TUid KGSVSSettingsPluginUID = { 0x1028238F }; + +/** VS resource filename. */ +_LIT( KVSSettingsResourceFileName, "mussettingsuirsc.rsc" ); + +/** Name of icon of *this* plugin. Directory is KDC_BITMAP_DIR. */ +_LIT( KGSVSSettingsPluginIconDirAndName, "mussettingsplugin.mif"); + + +/** + * CMusSettingsPlugin view class. + * This class implements view of VS settings plugin. + * + * @since S60 v3.2 + */ +class CMusSettingsPlugin : public CGSBaseView, public MDiskNotifyHandlerCallback + { +public: + + /** + * Two-phased constructor. + * @param aInitParams Params from framework. Not used. + * @return Newly created instance of CMusSettingsPlugin class. + */ + static CMusSettingsPlugin* NewL( TAny* aInitParams ); + + /** + * Destructor. + */ + ~CMusSettingsPlugin(); + + /** + * Returns CGSBaseContainer sub-class. + * Hides non-virtual base class function. (PC-Lint warning #1511). + * @return CGSBaseContainer sub-class. + */ + CMusSettingsContainer* Container(); + +public: // From CAknView. + + /** + * From CAknView. + * Returns views id. + * @return id for this view. + */ + virtual TUid Id() const; + + /** + * From CAknView. + * Command handling function. Handles user initiated commands. + * @param aCommand ID of the command to respond to. + */ + virtual void HandleCommandL( TInt aCommand ); + +public: // From CGSPluginInterface. + + /** + * From CGSPluginInterface. + * Method for getting caption of this plugin. This should be the + * localized name of the settings view to be shown in parent view. + * + * @param aCaption Reference to descriptor to store caption. + */ + virtual void GetCaptionL( TDes& aCaption ) const; + + /** + * From CGSPluginInterface. + * Creates a new icon of desired type. Overrided to provide custom + * icons. Ownership of the created icon is transferred to the caller. + * + * Icon type UIDs (use these defined constants): + * KGSIconTypeLbxItem - ListBox item icon. + * KGSIconTypeTab - Tab icon. + * + * @param aIconType UID Icon type UID of the icon to be created. + * @return Pointer of the icon. NOTE: Ownership of this icon is + * transferred to the caller. + */ + virtual CGulIcon* CreateIconL( const TUid aIconType ); + + /** + * From CGSPluginInterface. + * Method for reading the ID of the plugin provider category. See + * TGSPluginProviderCategory. PluginProviderCategory is used for + * sorting plugins. + * + * @return Plugin provider category ID defined in + * TGSPluginProviderCategory. + */ + virtual TInt PluginProviderCategory() const; + + +public: // From MEikMenuObserver + + void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); + +public: // From observer interface + void HandleNotifyDisk( TInt aError, const TDiskEvent& aEvent ); + +protected: + + CMusSettingsPlugin(); + + void ConstructL(); + + /** + * Hides non-virtual member from base class CGSBaseView. + * (PC-Lint warning #1511). + * Handles a change in client rectangle. + */ + void HandleClientRectChange(); + +// from base class CAknView. + + /** + * From CAknView. + * Handles a view activation and passes the message of type + * @c aCustomMessageId. This function is called by @c AknViewActivatedL(). + * @param aPrevViewId Specifies the view previously active. + * @param aCustomMessageId Specifies the message type. + * @param aCustomMessage The activation message. + */ + virtual void DoActivateL( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ); + + /** + * From CAknView. + * This function is called by AknViewDeactivated() to indicate + * deactivation of *this* view. + */ + virtual void DoDeactivate(); + +// from base class CGSBaseView. + + /** + * From CGSBaseView. + * Creates a container for *this* view. Called by DoActivateL(). + */ + virtual void NewContainerL(); + +private: + + /** + * Shows VS activation Setting dialog. + */ + void ShowVSSettingsActivationSettingDialogL(); + + /** + * Shows Operator specific VS activation Setting dialog. + */ + void ShowOperatorSpecificActivationSettingDialogL(); + + /** + * Shows Profile Setting dialog. + */ + void ShowVSSettingsProfileSettingDialogL(); + + /** + * Shows SIP profile selection dialog. + */ + void ShowVSSettingsSelectSipProfileDialogL(); + + /** + * Shows Recorded Video Saving Setting dialog. + */ + void ShowVSSettingsRecordedVideoSavingSettingDialogL(); + + /** + * Shows note setting dialog. In standard branch this is the "Capability + * auditory note" setting and in operator variant this is the "Alerts" + * setting displayed to user. + */ + void ShowVSSettingsNoteSettingDialogL(); + + /** + * Shows notification of no profiles defined. + */ + void ShowNoProfilesNotificationL(); + + /** + * Switches between two possible values from one to another. + * Leaves with KErrArgument if setting is not recognised, otherwise + * tries to toggle specified setting value and on failure leaves on + * systemwide errorcode. + * @param aValue Id of setting to toggle. + */ + void SwitchOnOffValueL( TInt aValue ); + + void ShowGlobalInformationDialogL( TInt aResourceId ); + +// from base class CGSBaseView. + + /** + * From CGSBaseView. + * Handles listbox selection. Called by HandleListBoxEventL. + */ + virtual void HandleListBoxSelectionL(); + +protected: // data + + /** + * Instance of SIP profile handler to manage SIP profiles. + * Own. + */ + CMusSIPProfileModel* iHandler; + + /** + * Instance of SIP profile handler to manage SIP profiles. + * Own. + */ + + /** + * Pointer of model class of this application. + * Own. + */ + CMusSettingsModel* iModel; + + /** + * Resource loader to load resources. + */ + RConeResourceLoader iResources; + + /** + * Disk notify handler + */ + CDiskNotifyHandler* iDiskNotifyHandler; + }; + +#endif // C_MUSSETTINGSPLUGIN_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshsettingsuiplugin/inc/mussettingsplugin.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshsettingsuiplugin/inc/mussettingsplugin.hrh Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,54 @@ +/* +* Copyright (c) 2006-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: Resource headers for project MUSSettingsPlugin. +* +*/ + + + +#ifndef MUSSETTINGSPLUGIN_HRH +#define MUSSETTINGSPLUGIN_HRH + + +/** Data query max length */ +#define KGSMaxDataLength 21 + + +/** GSUi's commands */ +enum TGSVSSettingsMenuCommands + { + EGSCmdShowVSSettingsAttachSettingPage, + EGSCmdShowDialupAPNameSettingPage + }; + + +/** Identifiers for provided settings */ +enum { + KGSSettIdVSActivation, + KGSSettIdSIPProfile, + KGSSettIdAutoRecord, + KGSSettIdRecordedVideoSaving, + KGSSettIdNote + }; + + +/** SIP profile setting type identifiers */ +enum TGSVSProfileIDs + { + EGSVSProfileDefault = 0, + EGSVSProfileSelect + }; + + +#endif // MUSSETTINGSPLUGIN_HRH diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshsettingsuiplugin/inc/mussipprofilemodel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshsettingsuiplugin/inc/mussipprofilemodel.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,172 @@ +/* +* Copyright (c) 2006-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 implementing SIP profile model. +* +*/ + + + +#ifndef C_MUSSIPPROFILEMODEL_H +#define C_MUSSIPPROFILEMODEL_H + + +#include "mmussipprofilehandler.h" +#include +#include +#include +#include + + +class CSIPManagedProfileRegistry; + + +/** + * CMusSIPProfileModel model class. + * Model class implementing SIP profile model. + * + * @since S60 v3.2 + */ +class CMusSIPProfileModel + :public CBase, + public MSIPProfileRegistryObserver, + public MMusSIPProfileHandler + { +public: + + static CMusSIPProfileModel* NewL(); + + /** + * Destructor. + */ + virtual ~CMusSIPProfileModel(); + +public: // From base class MMusSIPProfileHandler. + + /** + * From MMusSIPProfileHandler. + * Returns the index of the default SIP profile. + * @return KErrNotFound, if one does not exist, otherwise index of the + * default SIP profile. + */ + virtual TInt DefaultProfileIndex(); + + /** + * From MMusSIPProfileHandler. + * Returns the id of the default SIP profile. + * @return KErrNotFound, if one does not exist, otherwise id of the + * default SIP profile. + */ + virtual TUint32 DefaultProfileId(); + + /** + * From MMusSIPProfileHandler. + * Returns SIP profile index on locally cached array based on id. + * @param aId Profile id + * @return Profile index or KErrNotFound if no matching profile is found. + */ + virtual TInt ProfileIndexByIdL( TUint32 aId ); + + /** + * From MMusSIPProfileHandler. + * Returns profile id based on index. + * @param aIndex Profile index + * @return Profile id or KUnknownProfileId if no matching profile is found. + */ + virtual TUint32 ProfileIdByIndex( TUint aIndex ); + + /** + * From MMusSIPProfileHandler. + * Returns pointer to the SIP profile array, does not change ownership. + * Note that previously returned value goes out of scope after a new + * call to ProfileArrayL. So it is not advised to store return value + * in long persistent variable, but rather to be used like stack + * variables for safety. + * + * @return Pointer to internally cached SIP profile array. + */ + virtual CArrayPtr* ProfileArrayL(); + +public: // From base class MSIPProfileRegistryObserver. + + /** + * From MSIPProfileRegistryObserver. + * SIP profile information event. + * @param aProfileId Id of SIP profile in question. + * @param aEvent Type of information event. + */ + virtual void ProfileRegistryEventOccurred( + TUint32 aSIPProfileId, + TEvent aEvent ); + + /** + * From MSIPProfileRegistryObserver. + * An asynchronous error has occurred related to SIP profile. + * @param aSIPProfileId Id of the failed profile. + * @param aError An error code. + */ + virtual void ProfileRegistryErrorOccurred( + TUint32 aSIPProfileId, + TInt aError ); + +protected: + + /** + * Reads the profile array from SIP Profile Client. + */ + void ReadArrayFromEngineL(); + + /** + * Sorts internal array of SIP profiles by id. + */ + void SortProfilesL(); + + /** + * Deletes internally cached profiles. + */ + void DeleteProfiles(); + + /** + * Reads profile list from the engine; if reading fails, + * keeps the old list safe. + */ + void ReadProfileListFromEngineSafeL(); + +private: + + CMusSIPProfileModel(); + + void ConstructL(); + + /** + * For deleting RPointerArray in case of leave. + */ + static void ResetAndDestroy( TAny* aPointerArray ); + +private: // data + + /** + * Instance of the SIP profile registry engine for managing SIP profiles. + * Own. + */ + CSIPManagedProfileRegistry* iEngine; + + /** + * Locally cached array of SIP profiles. + * Own. + */ + CArrayPtrFlat* iProfiles; + + }; + +#endif // C_MUSSIPPROFILEMODEL_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshsettingsuiplugin/src/mussettingscontainer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshsettingsuiplugin/src/mussettingscontainer.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,470 @@ +/* +* Copyright (c) 2006-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: Container for MUSSettingsPlugin. +* +*/ + + + +#include "mussettingscontainer.h" +#include "mussettingsplugin.h" +#include "mussettingsmodel.h" +#include "gslistbox.h" +#include "mussettingsplugin.hrh" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#include + + +/** default SIP profile is selected */ +const TInt KDefaultSipProfile = 0; + +/** No SIP profile is selected */ +const TInt KNoSipProfileSelected = -1; + +// UID of Multimedia Sharing. +// This UID is used for accessing the help IDs controlled by MUSH help files +const TUid KUidMUSH = { 0x10282391 }; + +// ======== MEMBER FUNCTIONS ======== + + +CMusSettingsContainer::CMusSettingsContainer( CMusSettingsModel& aModel ) : + iModel( aModel ) + { + MUS_LOG( "[MUSSET] <- CMusSettingsContainer::CMusSettingsContainer()" ) + } + + +void CMusSettingsContainer::ConstructL( const TRect& aRect ) + { + MUS_LOG( "[MUSSET] -> CMusSettingsContainer::ConstructL()" ) + + iOperatorVariant = iModel.VSSettingsOperatorVariantL(); + + iListBox = new( ELeave ) CAknSettingStyleListBox; + + if ( iOperatorVariant == MusSettingsKeys::EStandard ) + { + BaseConstructL( aRect, R_GS_VSSETTINGS_VIEW_TITLE, R_VS_LBX ); + } + else + { + BaseConstructL( aRect, R_GS_VSSETTINGS_VIEW_TITLE, R_VS_LBX_OPERATOR ); + } + + MUS_LOG( "[MUSSET] <- CMusSettingsContainer::ConstructL()" ) + } + + +CMusSettingsContainer::~CMusSettingsContainer() + { + MUS_LOG( "[MUSSET] -> CMusSettingsContainer::~CMusSettingsContainer()" ) + delete iActivationItems; + delete iProfileItems; + delete iAutoRecordItems; + delete iListboxItemArray; + delete iNoteItems; + MUS_LOG( "[MUSSET] <- CMusSettingsContainer::~CMusSettingsContainer()" ) + } + + +// --------------------------------------------------------------------------- +// Constructs a listbox from a specified resource id. +// --------------------------------------------------------------------------- +// +void CMusSettingsContainer::ConstructListBoxL( TInt aResLbxId ) + { + MUS_LOG( "[MUSSET] -> CMusSettingsContainer::ConstructListBoxL()" ) + iListBox->ConstructL( this, EAknListBoxSelectionList ); + iListboxItemArray = CGSListBoxItemTextArray::NewL( + aResLbxId, *iListBox, *iCoeEnv ); + iListBox->Model()->SetItemTextArray( iListboxItemArray ); + iListBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray ); + + if ( iOperatorVariant == MusSettingsKeys::EStandard ) + { + iActivationItems = iCoeEnv->ReadDesC16ArrayResourceL( + R_ACTIVATION_SETTING_PAGE_LBX ); + } + else + { + iActivationItems = + iCoeEnv->ReadDesC16ArrayResourceL( + R_OPERATOR_ACTIVATION_SETTING_PAGE_LBX ); + } + + iAutoRecordItems = iCoeEnv->ReadDesC16ArrayResourceL( + R_VS_VIDEO_SAVING_SETTING_PAGE_LBX ); + + iProfileItems = iCoeEnv->ReadDesC16ArrayResourceL( + R_SIP_PROFILE_SETTING_PAGE_LBX ); + + if ( iOperatorVariant == MusSettingsKeys::EStandard ) + { + iNoteItems = iCoeEnv->ReadDesC16ArrayResourceL( + R_VS_AUDIO_SETTING_PAGE_LBX ); + } + else + { + iNoteItems = iCoeEnv->ReadDesC16ArrayResourceL( + R_VS_NOTE_SETTING_PAGE_LBX ); + } + + CreateListBoxItemsL(); + + // Operator variant mode needs some item should not be visible to user. + // Hide those items. + if ( iOperatorVariant == MusSettingsKeys::EOperatorSpecific ) + { + // Hide VS Activation Settings. If needed in future it can be made + // visible. + HideItemsL( KGSSettIdVSActivation ); + // Hide SIP Profile choosing option.If needed in future it can be made + // visible. + HideItemsL( KGSSettIdSIPProfile ); + } + MUS_LOG( "[MUSSET] <- CMusSettingsContainer::ConstructListBoxL()" ) + } + + +// --------------------------------------------------------------------------- +// Populates listbox items. +// --------------------------------------------------------------------------- +// +void CMusSettingsContainer::CreateListBoxItemsL() + { + MUS_LOG( "[MUSSET] -> CMusSettingsContainer::CreateListBoxItemsL()" ) + if ( iOperatorVariant == MusSettingsKeys::EStandard ) + { + MakeActivationItemL(); + } + else + { + MakeOperatorActivationItemL(); + } + MakeSIPProfileItemL(); + MakeAutoRecordItemL(); + MakeRecordedVideoSavingItemL(); + MakeNoteItemL(); + MUS_LOG( "[MUSSET] <- CMusSettingsContainer::CreateListBoxItemsL()" ) + } + + +// --------------------------------------------------------------------------- +// Updates a specified feature (item in listbox). +// --------------------------------------------------------------------------- +// +void CMusSettingsContainer::UpdateListBoxL( TInt aFeatureId ) + { + MUS_LOG1( "[MUSSET] <- CMusSettingsContainer::UpdateListBoxL()( %d )", + aFeatureId ) + switch ( aFeatureId ) + { + case KGSSettIdVSActivation: + if ( iOperatorVariant == MusSettingsKeys::EStandard ) + { + MakeActivationItemL(); + } + else + { + MakeOperatorActivationItemL(); + } + break; + case KGSSettIdSIPProfile: + MakeSIPProfileItemL(); + break; + case KGSSettIdAutoRecord: + MakeAutoRecordItemL(); + break; + case KGSSettIdRecordedVideoSaving: + MakeRecordedVideoSavingItemL(); + break; + case KGSSettIdNote: + MakeNoteItemL(); + break; + default: + break; + } + + iListBox->HandleItemAdditionL(); + MUS_LOG( "[MUSSET] <- CMusSettingsContainer::UpdateListBoxL()" ) + } + + +// --------------------------------------------------------------------------- +// Generic method to add an item to listbox and make it visible. +// --------------------------------------------------------------------------- +// +void CMusSettingsContainer::AddItemL( TInt aId, const TPtrC aText ) + { + MUS_LOG( "[MUSSET] -> CMusSettingsContainer::AddItemL()" ) + iListboxItemArray->SetDynamicTextL( aId, aText ); + iListboxItemArray->SetItemVisibilityL( aId, + CGSListBoxItemTextArray::EVisible ); + MUS_LOG( "[MUSSET] <- CMusSettingsContainer::AddItemL()" ) + } + + +// --------------------------------------------------------------------------- +// Adds activation setting item to listbox. +// --------------------------------------------------------------------------- +// +void CMusSettingsContainer::MakeActivationItemL() + { + MUS_LOG( "[MUSSET] -> CMusSettingsContainer::MakeActivationItemL()" ) + + iVSActication = iModel.VSSettingsActivationL(); + AddItemL( KGSSettIdVSActivation, ( *iActivationItems )[ iVSActication ] ); + + MUS_LOG( "[MUSSET] <- CMusSettingsContainer::MakeActivationItemL()" ) + } + + +// --------------------------------------------------------------------------- +// Adds operator specific activation setting item to listbox. +// --------------------------------------------------------------------------- +// +void CMusSettingsContainer::MakeOperatorActivationItemL() + { + MUS_LOG( "[MUSSET] -> CMusSettingsContainer::MakeOperatorActivationItemL()" ) + + iVSActication = iModel.VSSettingsActivationL(); + if ( iVSActication == MusSettingsKeys::ENever ) // ==2 + { // operator specific one is different from usual one + iVSActication = MusSettingsKeys::EActiveInHomeNetworks; //==1 + } + + AddItemL( KGSSettIdVSActivation, ( *iActivationItems )[ iVSActication ] ); + + MUS_LOG( "[MUSSET] <- CMusSettingsContainer::MakeOperatorActivationItemL()" ) + } + + +// --------------------------------------------------------------------------- +// Adds SIP profile setting item to settings listbox. Item will contain +// indication of [no SIP profile selected], [using default SIP profile] or +// [name of SIP profile specified to be used] +// --------------------------------------------------------------------------- +// +void CMusSettingsContainer::MakeSIPProfileItemL() + { + MUS_LOG( "[MUSSET] -> CMusSettingsContainer::MakeSIPProfileItemL()" ) + + TInt profile = iModel.VSSettingsProfileL(); + + if ( profile != KDefaultSipProfile && profile != KNoSipProfileSelected ) + { + // profile id defined, get profile name + HBufC* name = iModel.ProfileNameL( profile ); + + if ( name ) + { + CleanupStack::PushL( name ); + AddItemL( KGSSettIdSIPProfile, *name ); + CleanupStack::PopAndDestroy( name ); + } + else + { + // show profile value not selected + AddItemL( KGSSettIdSIPProfile, + ( *iProfileItems )[ CMusSettingsModel::KVsSipProfileSelectNone ] ); + } + } + else if ( profile == KNoSipProfileSelected ) + { + AddItemL( KGSSettIdSIPProfile, + ( *iProfileItems )[ CMusSettingsModel::KVsSipProfileSelectNone ] ); + } + else + { + AddItemL( + KGSSettIdSIPProfile, + ( *iProfileItems )[ CMusSettingsModel::KVsSipProfileDefault ] ); + } + + MUS_LOG( "[MUSSET] <- CMusSettingsContainer::MakeSIPProfileItemL()" ) + } + + +// --------------------------------------------------------------------------- +// Adds autorecord item to listbox. +// --------------------------------------------------------------------------- +// +void CMusSettingsContainer::MakeAutoRecordItemL() + { + MUS_LOG( "[MUSSET] -> CMusSettingsContainer::MakeAutoRecordItemL()" ) + TInt autoRecordMode = iModel.VSSettingsAutoRecordL(); + + MUS_LOG1( "[MUSSET] autoRecordMode: %d", autoRecordMode ) + MUS_LOG1( "[MUSSET] iAutoRecordItems.Count: %d", iAutoRecordItems->Count() ) + + if ( autoRecordMode > iAutoRecordItems->Count() - 1 ) + { + MUS_LOG2( "[MUSSET] autoRecordMode too big: %d, should be max %d => leave", + autoRecordMode, iAutoRecordItems->Count() -1 ); + User::Leave( KErrOverflow ); + } + + AddItemL( KGSSettIdAutoRecord, ( *iAutoRecordItems )[ autoRecordMode ] ); + + MUS_LOG( "[MUSSET] <- CMusSettingsContainer::MakeAutoRecordItemL()" ) + } + + +// --------------------------------------------------------------------------- +// Adds recorded video saving item to listbox. +// --------------------------------------------------------------------------- +// +void CMusSettingsContainer::MakeRecordedVideoSavingItemL() + { + MUS_LOG( + "[MUSSET] -> CMusSettingsContainer::MakeRecordedVideoSavingItemL()" ) + + TInt savingMode = iModel.VSSettingsRecordedVideoSavingL(); + + CAknMemorySelectionDialogMultiDrive* dlg = + iModel.MemorySelectionDialogLC(); + TDriveNumber driveNumber = ( TDriveNumber )savingMode; + TInt index = dlg->FindIndexByDrive( driveNumber ); + + if ( index == KErrNotFound ) + { + MUS_LOG( "[MUSSET] -> preferred drive doesn't exist anymore \ +(e.g. remote drive deleted), taking system drive..." ) + + driveNumber = RFs::GetSystemDrive(); + index = dlg->FindIndexByDrive( driveNumber ); + iModel.SetVSSettingsRecordedVideoSavingL( driveNumber ); + } + + TFileName item( KNullDesC ); + dlg->GetItem( index, item ); + MUS_LOG1( "[MUSSET] Current drive:%d", driveNumber ) + MUS_LOG_TDESC( "[MUSSET] pref. mem: " , item ) + + AddItemL( KGSSettIdRecordedVideoSaving, item ); + CleanupStack::PopAndDestroy( dlg ); + + MUS_LOG( + "[MUSSET] <- CMusSettingsContainer::MakeRecordedVideoSavingItemL()" ) + } + + +// --------------------------------------------------------------------------- +// Adds note item to listbox. (Alerts setting). Present only with operator +// variant set. +// --------------------------------------------------------------------------- +// +void CMusSettingsContainer::MakeNoteItemL() + { + MUS_LOG( + "[MUSSET] -> CMusSettingsContainer::MakeNoteItemL()" ) + + TInt savingMode = iModel.VSSettingsNoteL(); + + MUS_LOG1( "[MUSSET] -> CMusSettingsContainer::Mode:%d()", savingMode ); + + // If unset, use and set default value + if ( savingMode < 0 || savingMode > 1 ) + { + savingMode = 0; + iModel.SetVSSettingsNoteL( + MusSettingsKeys::EAuditoryNotificationOff ); + } + + AddItemL( KGSSettIdNote, ( *iNoteItems )[ savingMode ] ); + + MUS_LOG( + "[MUSSET] <- CMusSettingsContainer::MakeNoteItemL()" ) + } + + +// --------------------------------------------------------------------------- +// Gets help context. +// --------------------------------------------------------------------------- +// +void CMusSettingsContainer::GetHelpContext( TCoeHelpContext& aContext ) const + { + MUS_LOG( "[MUSSET] -> CMusSettingsContainer::GetHelpContext()" ) + aContext.iMajor = KUidMUSH; + aContext.iContext = KMSH_HLP_SETTINGS; + MUS_LOG( "[MUSSET] <- CMusSettingsContainer::GetHelpContext()" ) + } + + +// --------------------------------------------------------------------------- +// Returns currently selected feature (listbox item). +// --------------------------------------------------------------------------- +// +TInt CMusSettingsContainer::CurrentFeatureId() const + { + MUS_LOG( "[MUSSET] <- CMusSettingsContainer::CurrentFeatureId()" ) + return iListboxItemArray->CurrentFeature( ); + } + + +// ---------------------------------------------------------------------------- +// If call is on, informs user with note that new profile is going to be active +// after current call. +// ---------------------------------------------------------------------------- +// +void CMusSettingsContainer::ShowNewProfileActiveAfterCallL() + { + MUS_LOG( + "[MUSSET] -> CMusSettingsContainer::ShowNewProfileActiveAfterCallL()" ) + TPSCTsyCallState callState; + User::LeaveIfError( RProperty::Get( KPSUidCtsyCallInformation, + KCTsyCallState, + (TInt&)callState) ); + if ( callState == EPSCTsyCallStateAlerting || + callState == EPSCTsyCallStateRinging || + callState == EPSCTsyCallStateDialling || + callState == EPSCTsyCallStateAnswering || + callState == EPSCTsyCallStateDisconnecting || + callState == EPSCTsyCallStateConnected || + callState == EPSCTsyCallStateHold) + { + HBufC* infoTxt = StringLoader::LoadLC( R_QTN_MSH_SET_PROFILE_NOTE ); + CAknInformationNote* note = new ( ELeave ) CAknInformationNote( ETrue ); + note->ExecuteLD( infoTxt->Des() ); + CleanupStack::PopAndDestroy( infoTxt ); + MUS_LOG( + "[MUSSET] <- CMusSettingsContainer::ShowNewProfileActiveAfterCallL()" ) + } + } + +// ---------------------------------------------------------------------------- +// void CMusSettingsContainer::HideItemsL(TInt aItemIndex) +// Some items are unwanted by operators.Hide those items from listbox item +// ---------------------------------------------------------------------------- +// +void CMusSettingsContainer::HideItemsL(TInt aItemIndex) + { + MUS_LOG1("[MUSSET] -> CMusSettingsContainer::HideItemsL() %d",aItemIndex ) + iListboxItemArray->SetItemVisibilityL( aItemIndex, + CGSListBoxItemTextArray::EInvisible ); + MUS_LOG("[MUSSET] <- CMusSettingsContainer::HideItemsL()" ) + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshsettingsuiplugin/src/mussettingsmodel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshsettingsuiplugin/src/mussettingsmodel.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,398 @@ +/* +* Copyright (c) 2006-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: Document model class for MUSSettingsPlugin. +* +*/ + + + +#include "mmussipprofilehandler.h" +#include "mussettingsmodel.h" +#include "mussipprofilemodel.h" +#include "muslogger.h" +#include +#include + +#include +#include +#include // GUI Resource + + + +const TInt CMusSettingsModel::KVsSipProfileDefault = 0; +const TInt CMusSettingsModel::KVsSipProfileSelect = 1; +const TInt CMusSettingsModel::KVsSipProfileSelectNone = 2; +const TInt KSIPGranularity = 5; + + +// ======== MEMBER FUNCTIONS ======== + + +CMusSettingsModel* CMusSettingsModel::NewL( MMusSIPProfileHandler& aHandler ) + { + MUS_LOG( "[MUSSET] -> CMusSettingsModel::NewL()" ) + CMusSettingsModel* self = new( ELeave ) CMusSettingsModel( aHandler ); + CleanupStack::PushL( self ); + self->ConstructL(); + + CleanupStack::Pop( self ); + MUS_LOG( "[MUSSET] <- CMusSettingsModel::NewL()" ) + return self; + } + + +CMusSettingsModel::CMusSettingsModel( MMusSIPProfileHandler& aHandler ) + : iHandler( aHandler ) + { + MUS_LOG( "[MUSSET] <- CMusSettingsModel::CMusSettingsModel()" ) + } + + +void CMusSettingsModel::ConstructL() + { + MUS_LOG( "[MUSSET] -> CMusSettingsModel::ConstructL()" ) + iMSSettingsKeys = new (ELeave) MultimediaSharingSettings; + MUS_LOG( "[MUSSET] <- CMusSettingsModel::ConstructL()" ) + } + + +CMusSettingsModel::~CMusSettingsModel() + { + MUS_LOG( "[MUSSET] -> CMusSettingsModel::~CMusSettingsModel()" ) + delete iMSSettingsKeys; + iMSSettingsKeys = NULL; + MUS_LOG( "[MUSSET] <- CMusSettingsModel::~CMusSettingsModel()" ) + } + + +// ---------------------------------------------------------------------------- +// Returns operator variant mode (normal or operator specific. This is used for +// runtime variation of Settings UI. +// ---------------------------------------------------------------------------- +// +MusSettingsKeys::TOperatorVariant CMusSettingsModel::VSSettingsOperatorVariantL() + { + MUS_LOG( "[MUSSET] -> CMusSettingsModel::VSSettingsOperatorVariantL()" ) + + MusSettingsKeys::TOperatorVariant operatorVariant = + iMSSettingsKeys->OperatorVariantSettingL(); + + MUS_LOG1( + "[MUSSET] <- CMusSettingsContainer::VSSettingsOperatorVariantL()( %d )", + operatorVariant ) + return operatorVariant; + } + + +// ---------------------------------------------------------------------------- +// Returns VS activation mode. +// ---------------------------------------------------------------------------- +// +MusSettingsKeys::TActivation CMusSettingsModel::VSSettingsActivationL() + { + MUS_LOG( "[MUSSET] -> CMusSettingsModel::VSSettingsActivationL()" ) + MusSettingsKeys::TActivation activationMode = + iMSSettingsKeys->ActivationSettingL(); + MUS_LOG1( + "[MUSSET] <- CMusSettingsContainer::VSSettingsActivationL()( %d )", + activationMode ) + return activationMode; + } + + +// ---------------------------------------------------------------------------- +// Returns SIP profile mode. +// ---------------------------------------------------------------------------- +// +TInt CMusSettingsModel::VSSettingsProfileL() + { + MUS_LOG( "[MUSSET] -> CMusSettingsModel::VSSettingsProfileL()" ) + TInt vsProfileMode = iMSSettingsKeys->SipProfileSettingL(); + MUS_LOG1( + "[MUSSET] <- CMusSettingsContainer::VSSettingsProfileL()( %d )", + vsProfileMode ) + return vsProfileMode; + } + + +// ---------------------------------------------------------------------------- +// Returns video autorecord mode. +// ---------------------------------------------------------------------------- +// +MusSettingsKeys::TAutoRecord CMusSettingsModel::VSSettingsAutoRecordL() + { + MUS_LOG( "[MUSSET] -> CMusSettingsModel::VSSettingsAutoRecordL()" ) + MusSettingsKeys::TAutoRecord vsAutoRecordMode = + iMSSettingsKeys->AutoRecordSettingL(); + MUS_LOG1( + "[MUSSET] <- CMusSettingsContainer::VSSettingsAutoRecordL()( %d )", + vsAutoRecordMode ) + return vsAutoRecordMode; + } + + +// ---------------------------------------------------------------------------- +// Returns recorded video saving mode. +// ---------------------------------------------------------------------------- +// +TInt CMusSettingsModel::VSSettingsRecordedVideoSavingL() + { + MUS_LOG( "[MUSSET] -> CMusSettingsModel::VSSettingsRecordedVideoSavingL()" ) + TInt vsVideoLocationMode = iMSSettingsKeys->VideoLocationSettingL(); + MUS_LOG1( + "[MUSSET] <- CMusSettingsContainer::VSSettingsRecordedVideoSavingL()( %d )", + vsVideoLocationMode ) + return vsVideoLocationMode; + } + + +// ---------------------------------------------------------------------------- +// Returns mode of audible note. +// ---------------------------------------------------------------------------- +// +MusSettingsKeys::TAuditoryNotification CMusSettingsModel::VSSettingsNoteL() + { + MUS_LOG( "[MUSSET] -> CMusSettingsModel::VSSettingsNoteL()" ) + MusSettingsKeys::TAuditoryNotification vsNoteMode = + iMSSettingsKeys->AuditoryNotificationSettingL(); + MUS_LOG1( + "[MUSSET] <- CMusSettingsContainer::VSSettingsNoteL()( %d )", + vsNoteMode ) + return vsNoteMode; + } + + +// ---------------------------------------------------------------------------- +// Sets VS activation mode. +// ---------------------------------------------------------------------------- +// +void CMusSettingsModel::SetVSSettingsActivationL( + const MusSettingsKeys::TActivation aActivation) + { + MUS_LOG1( + "[MUSSET] -> CMusSettingsContainer::SetVSSettingsActivationL()( %d )", + aActivation ) + iMSSettingsKeys->SetActivationSettingL( aActivation ); + MUS_LOG( "[MUSSET] <- CMusSettingsModel::SetVSSettingsActivationL()" ) + } + + +// ---------------------------------------------------------------------------- +// Sets SIP Profile mode. +// ---------------------------------------------------------------------------- +// +void CMusSettingsModel::SetVSSettingsProfileL( const TInt aProfile ) + { + MUS_LOG1( + "[MUSSET] -> CMusSettingsContainer::SetVSSettingsProfileL()( %d )", + aProfile ) + iMSSettingsKeys->SetSipProfileSettingL( aProfile ); + MUS_LOG( "[MUSSET] <- CMusSettingsModel::SetVSSettingsProfileL()" ) + } + + +// ---------------------------------------------------------------------------- +// Sets video autorecord mode. +// ---------------------------------------------------------------------------- +// +void CMusSettingsModel::SetVSSettingsAutoRecordL( + const MusSettingsKeys::TAutoRecord aAutoRecord ) + { + MUS_LOG1( + "[MUSSET] -> CMusSettingsContainer::SetVSSettingsAutoRecordL()( %d )", + aAutoRecord ) + iMSSettingsKeys->SetAutoRecordSettingL( aAutoRecord ); + MUS_LOG( "[MUSSET] <- CMusSettingsModel::SetVSSettingsAutoRecordL()" ) + } + + +// ---------------------------------------------------------------------------- +// Sets video location. +// ---------------------------------------------------------------------------- +// +void CMusSettingsModel::SetVSSettingsRecordedVideoSavingL( + const TInt aVideoLocation ) + { + MUS_LOG1( + "[MUSSET] -> CMusSettingsContainer::SetVSSettingsRecordedVideoSavingL()( %d )", + aVideoLocation ) + iMSSettingsKeys->SetVideoLocationSettingL( aVideoLocation ); + MUS_LOG( + "[MUSSET] <- CMusSettingsModel::SetVSSettingsRecordedVideoSavingL()" ) + } + + +// ---------------------------------------------------------------------------- +// Sets mode of auditory note. In operator specific variants auditory note also +// sets mode of popup notification setting. +// ---------------------------------------------------------------------------- +// +void CMusSettingsModel::SetVSSettingsNoteL( + const MusSettingsKeys::TAuditoryNotification aValue ) + { + MUS_LOG1( + "[MUSSET] -> CMusSettingsContainer::SetVSSettingsNoteL()( %d )", aValue ) + iMSSettingsKeys->SetAuditoryNotificationSettingL( aValue ); + + if ( VSSettingsOperatorVariantL() == MusSettingsKeys::EOperatorSpecific ) + { + if ( MusSettingsKeys::EAuditoryNotificationOn == aValue ) + { + iMSSettingsKeys->SetPopupNotificationSettingL( + MusSettingsKeys::EPopupNotificationOn ); + } + else + { + iMSSettingsKeys->SetPopupNotificationSettingL( + MusSettingsKeys::EPopupNotificationOff ); + } + } + } + + +// ----------------------------------------------------------------------------- +// Returns the list of profile names +// ----------------------------------------------------------------------------- +CDesCArray* CMusSettingsModel::ListOfProfileNamesL() + { + MUS_LOG( "[MUSSET] -> CMusSettingsModel::ListOfProfileNamesL()" ) + CArrayPtr* list = iHandler.ProfileArrayL(); + + CDesCArray* array = new ( ELeave ) CDesCArrayFlat( KSIPGranularity ); + CleanupStack::PushL( array ); + + for ( TInt i = 0; i < list->Count(); i++ ) + { + const TDesC8* providerName = 0; + User::LeaveIfError( + list->At(i)->GetParameter( KSIPProviderName, providerName ) ); + + HBufC8* decodedProvider = + EscapeUtils::EscapeDecodeL( *providerName ); + CleanupStack::PushL( decodedProvider ); + + HBufC* providerName16 = + EscapeUtils::ConvertToUnicodeFromUtf8L( decodedProvider->Des() ); + CleanupStack::PushL( providerName16 ); + + array->AppendL( providerName16->Des() ); + + CleanupStack::PopAndDestroy( providerName16 ); + CleanupStack::PopAndDestroy( decodedProvider ); + } + + CleanupStack::Pop( array ); + MUS_LOG( "[MUSSET] <- CMusSettingsModel::ListOfProfileNamesL()" ) + return array; + } + + +// ----------------------------------------------------------------------------- +// Returns the SIP profile name. Returns NULL buffer if no profile is found. +// ----------------------------------------------------------------------------- +HBufC* CMusSettingsModel::ProfileNameL( TInt aId ) + { + MUS_LOG1( + "[MUSSET] -> CMusSettingsContainer::ProfileNameL()( %d )", + aId ) + const TDesC8* providerName = 0; + TInt index = ProfileIndexByIdL( aId ); + HBufC* buf = NULL; + + if ( index >= 0 ) + { + if ( KErrNone == iHandler.ProfileArrayL()->At( index )-> + GetParameter( KSIPProviderName, providerName ) ) + { + HBufC8* decodedProvider = + EscapeUtils::EscapeDecodeL( *providerName ); + CleanupStack::PushL( decodedProvider ); + buf = EscapeUtils::ConvertToUnicodeFromUtf8L( *providerName ); + CleanupStack::PopAndDestroy( decodedProvider ); + } + } + + if ( buf ) + { + MUS_LOG_TDESC( "[MUSSET] <- CMusSettingsModel::ProfileNameL(): Profile name: ", buf->Des() ) + } + else + { + MUS_LOG( "[MUSSET] <- CMusSettingsModel::ProfileNameL(): No profile found! " ) + } + return buf; + } + + +// ---------------------------------------------------------------------------- +// Returns default SIP profile index. +// ---------------------------------------------------------------------------- +TInt CMusSettingsModel::DefaultProfileIndex() + { + MUS_LOG( "[MUSSET] <- CMusSettingsModel::DefaultProfileIndex()" ) + return iHandler.DefaultProfileIndex(); + } + + +// ---------------------------------------------------------------------------- +// Returns id of default SIP profile. +// ---------------------------------------------------------------------------- +TUint32 CMusSettingsModel::DefaultProfileId() + { + MUS_LOG( "[MUSSET] <- CMusSettingsModel::DefaultProfileId()" ) + return iHandler.DefaultProfileId(); + } + + +// ---------------------------------------------------------------------------- +// Returns SIP profile index based on the Id of SIP profile. +// ---------------------------------------------------------------------------- +TInt CMusSettingsModel::ProfileIndexByIdL( TUint32 aId ) + { + MUS_LOG( "[MUSSET] <- CMusSettingsModel::ProfileIndexByIdL()" ) + return iHandler.ProfileIndexByIdL( aId ); + } + + +// ---------------------------------------------------------------------------- +// Returns SIP profile Id based on the index of SIP profile. +// ---------------------------------------------------------------------------- +TUint32 CMusSettingsModel::ProfileIdByIndex( TUint aIndex ) + { + MUS_LOG( "[MUSSET] <- CMusSettingsModel::ProfileIdByIndex()" ) + return iHandler.ProfileIdByIndex( aIndex ); + } + + +// ---------------------------------------------------------------------------- +// Returns memory selction dialog pointer. +// ---------------------------------------------------------------------------- +CAknMemorySelectionDialogMultiDrive* CMusSettingsModel::MemorySelectionDialogLC() + { + MUS_LOG( "[MUSSET] -> CMusSettingsModel::MemorySelectionDialogLC()" ) + TInt supportedMemTypes( AknCommonDialogsDynMem::EMemoryTypePhone| + AknCommonDialogsDynMem::EMemoryTypeInternalMassStorage| + AknCommonDialogsDynMem::EMemoryTypeMMCExternal| + AknCommonDialogsDynMem::EMemoryTypeRemote ); + CAknMemorySelectionDialogMultiDrive* dlg = + CAknMemorySelectionDialogMultiDrive::NewL( + ECFDDialogTypeNormal, + R_VS_RECORDED_VIDEO_SAVING_SETTING_PAGE, + ETrue, + supportedMemTypes ); + CleanupStack::PushL( dlg ); + MUS_LOG( "[MUSSET] <- CMusSettingsModel::MemorySelectionDialogLC()" ) + return dlg; + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshsettingsuiplugin/src/mussettingsplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshsettingsuiplugin/src/mussettingsplugin.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,904 @@ +/* +* Copyright (c) 2006-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: MUSSettingsPlugin implementation. +* +*/ + + + +#include "mussettingsplugin.h" +#include "mussettingscontainer.h" +#include "mussettingsmodel.h" +#include "mussettingsplugin.hrh" +#include "mussipprofilemodel.h" +#include "muslogger.h" +#include "musresourcefinderutil.h" +#include "mussesseioninformationapi.h" +#include +#include // Icons +#include // GUI Resource +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // HlpLauncher +#include + +#include + +#include +#include + +#include + +// #include + + + +// ======== MEMBER FUNCTIONS ======== + + +CMusSettingsPlugin::CMusSettingsPlugin() + : iResources( *iCoeEnv ) + { + MUS_LOG( "[MUSSET] <- CMusSettingsPlugin::CMusSettingsPlugin()" ) + } + + +CMusSettingsPlugin::~CMusSettingsPlugin() + { + MUS_LOG( "[MUSSET] -> CMusSettingsPlugin::~CMusSettingsPlugin()" ) + FeatureManager::UnInitializeLib(); + if( iContainer ) + { + AppUi()->RemoveFromViewStack( *this, iContainer ); + delete iContainer; + iContainer = NULL; + } + + iResources.Close(); + + delete iModel; + iModel = NULL; + delete iHandler; + iHandler = NULL; + delete iDiskNotifyHandler; + MUS_LOG( "[MUSSET] <- CMusSettingsPlugin::~CMusSettingsPlugin()" ) + } + + +void CMusSettingsPlugin::ConstructL() + { + MUS_LOG( "[MUSSET] -> CMusSettingsPlugin::ConstructL()" ) + FeatureManager::InitializeLibL(); + + HBufC* fileName = MusResourceFinderUtil::ResourcePathL( + KVSSettingsResourceFileName ); + TFileName fName(*fileName); + delete fileName; + MUS_LOG_TDESC( "[MUSSET] Resource FileName ",fName ) + iResources.OpenL(fName); + MUS_LOG( "[MUSSET] Constructing the Base " ) + BaseConstructL( R_GS_VS_VIEW ); + iHandler = CMusSIPProfileModel::NewL(); + MUS_LOG( "[MUSSET] CMusSettingsPlugin::ConstructL() 2" ) + iModel = CMusSettingsModel::NewL( *iHandler ); + iDiskNotifyHandler = CDiskNotifyHandler::NewL( *this, + iEikonEnv->FsSession() ); + User::LeaveIfError( iDiskNotifyHandler->NotifyDisk() ); // Subscribe disk notifications + MUS_LOG( "[MUSSET] <- CMusSettingsPlugin::ConstructL()" ) + } + + +CMusSettingsPlugin* CMusSettingsPlugin::NewL( TAny* /*aInitParams*/ ) + { + MUS_LOG( "[MUSSET] -> CMusSettingsPlugin::NewL()" ) + CMusSettingsPlugin* self = new( ELeave ) CMusSettingsPlugin(); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + MUS_LOG( "[MUSSET] <- CMusSettingsPlugin::NewL()" ) + return self; + } + + +// ---------------------------------------------------------------------------- +// From class CAknView. +// Returns UID of *this* settings plugin. +// ---------------------------------------------------------------------------- +// +TUid CMusSettingsPlugin::Id() const + { + MUS_LOG1( "[MUSSET] <- CMusSettingsPlugin::Id()( %d )", + KGSVSSettingsPluginUID.iUid ) + return KGSVSSettingsPluginUID; + } + + +// ---------------------------------------------------------------------------- +// Hides non-virtual member from base class CGSBaseView. +// Handles a change in client rectangle size. +// ---------------------------------------------------------------------------- +// +void CMusSettingsPlugin::HandleClientRectChange() + { + MUS_LOG( "[MUSSET] -> CMusSettingsPlugin::HandleClientRectChange()" ) + if ( iContainer && iContainer->iListBox ) + { + iContainer->SetRect( ClientRect() ); + } + MUS_LOG( "[MUSSET] <- CMusSettingsPlugin::HandleClientRectChange()" ) + } + + +// ---------------------------------------------------------------------------- +// From class CAknView. +// Called by framework when *this* control is to be activated/focused. +// ---------------------------------------------------------------------------- +// +void CMusSettingsPlugin::DoActivateL( + const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ) + { + MUS_LOG( "[MUSSET] -> CMusSettingsPlugin::DoActivateL()" ) + CGSBaseView::DoActivateL( aPrevViewId, aCustomMessageId, aCustomMessage ); + MUS_LOG( "[MUSSET] <- CMusSettingsPlugin::DoActivateL()" ) + } + + +// ---------------------------------------------------------------------------- +// From class CAknView. +// Called by framework when *this* control is to be deactivated. +// ---------------------------------------------------------------------------- +// +void CMusSettingsPlugin::DoDeactivate() + { + MUS_LOG( "[MUSSET] -> CMusSettingsPlugin::DoDeactivate()" ) + CGSBaseView::DoDeactivate(); + MUS_LOG( "[MUSSET] <- CMusSettingsPlugin::DoDeactivate()" ) + } + + +// ---------------------------------------------------------------------------- +// From class CAknView. +// Handles a user selected menu command. +// ---------------------------------------------------------------------------- +// +void CMusSettingsPlugin::HandleCommandL( TInt aCommand ) + { + MUS_LOG1( "[MUSSET] -> CMusSettingsPlugin::HandleCommandL()( %d )", + aCommand ) + CMusSettingsContainer& container = + *static_cast( iContainer ); + const TInt currentItem = container.CurrentFeatureId(); + + switch ( aCommand ) + { + case EGSMSKCmdAppChange: + case EGSCmdAppChange: + { + if ( currentItem == KGSSettIdVSActivation + && aCommand == EGSCmdAppChange ) + { + if ( iModel->VSSettingsOperatorVariantL() == + MusSettingsKeys::EOperatorSpecific ) + { + ShowOperatorSpecificActivationSettingDialogL(); + } + else + { + ShowVSSettingsActivationSettingDialogL(); + } + } + else if ( currentItem == KGSSettIdRecordedVideoSaving + && aCommand == EGSCmdAppChange ) + { + ShowVSSettingsRecordedVideoSavingSettingDialogL(); + } + else if ( KGSSettIdNote == currentItem + && EGSCmdAppChange == aCommand ) + { + ShowVSSettingsNoteSettingDialogL(); + } + else + { + HandleListBoxSelectionL(); + } + break; + } + + case EAknSoftkeyBack: + { + AppUi()->ActivateLocalViewL( iPrevViewId.iViewUid ); + break; + } + + case EAknCmdHelp: + { + if( FeatureManager::FeatureSupported( KFeatureIdHelp ) ) + { + HlpLauncher::LaunchHelpApplicationL( + iEikonEnv->WsSession(), AppUi()->AppHelpContextL()); + } + break; + } + + default: + { + AppUi()->HandleCommandL( aCommand ); + break; + } + } + MUS_LOG( "[MUSSET] <- CMusSettingsPlugin::HandleCommandL()" ) + } + + +// ---------------------------------------------------------------------------- +// From class CGSPluginInterface. +// Gets caption text of *this* plugin. +// ---------------------------------------------------------------------------- +// +void CMusSettingsPlugin::GetCaptionL( TDes& aCaption ) const + { + MUS_LOG( "[MUSSET] -> CMusSettingsPlugin::GetCaptionL()" ) + HBufC* result = StringLoader::LoadL( R_GS_VS_PLUGIN_CAPTION ); + aCaption.Copy( *result ); + delete result; + MUS_LOG( "[MUSSET] <- CMusSettingsPlugin::GetCaptionL()" ) + } + + +// ---------------------------------------------------------------------------- +// From class CGSPluginInterface. +// Returns provider category of *this* plugin. +// ---------------------------------------------------------------------------- +// +TInt CMusSettingsPlugin::PluginProviderCategory() const + { + MUS_LOG( "[MUSSET] <- CMusSettingsPlugin::PluginProviderCategory()" ) + return KGSPluginProviderInternal; + } + + +// ---------------------------------------------------------------------------- +// From class MEikMenuObserver. +// Called by framework before creating menus +// ---------------------------------------------------------------------------- +// +void CMusSettingsPlugin::DynInitMenuPaneL( TInt aResourceId, + CEikMenuPane* aMenuPane ) + { + // Delete Help item if feature is not supported + if( aResourceId == R_VS_MENU_ITEM_EXIT ) + { + if( !FeatureManager::FeatureSupported( KFeatureIdHelp ) ) + { + aMenuPane->DeleteMenuItem( EAknCmdHelp ); + } + } + } + + +// ---------------------------------------------------------------------------- +// From MDiskNotifyHandlerCallback +// Called by framework When disk status changed +// ---------------------------------------------------------------------------- +// +void CMusSettingsPlugin::HandleNotifyDisk( TInt /*aError*/, + const TDiskEvent& /*aEvent*/ ) + { + MUS_LOG( "[MUSSET] -> CMusSettingsPlugin::HandleNotifyDisk()" ) + + // Since the plugin is created immediately after opening GS but container + // will be created only after opening the VS view, this function may be + // called before the creation of container. In such a case we simply ignore + // the notification. + if ( Container() ) + { + TRAP_IGNORE( + Container()->UpdateListBoxL( KGSSettIdRecordedVideoSaving ) ) + } + + MUS_LOG( "[MUSSET] <- CMusSettingsPlugin::HandleNotifyDisk()" ) + } + + +// ---------------------------------------------------------------------------- +// From class CGSBaseView. +// Called by GS framework to create a GS container for *this* plugin. +// ---------------------------------------------------------------------------- +// +void CMusSettingsPlugin::NewContainerL() + { + MUS_LOG( "[MUSSET] <- CMusSettingsPlugin::NewContainerL()" ) + iContainer = new( ELeave ) CMusSettingsContainer( *iModel ); + } + + +// ---------------------------------------------------------------------------- +// From class CGSBaseView. +// Handles users "middle click" aka MSK on selected feature. +// ---------------------------------------------------------------------------- +// +void CMusSettingsPlugin::HandleListBoxSelectionL() + { + MUS_LOG( "[MUSSET] -> CMusSettingsPlugin::HandleListBoxSelectionL()" ) + CMusSettingsContainer& container = + *static_cast( iContainer ); + const TInt currentItem = container.CurrentFeatureId(); + + RDebug::Print( _L( + "[CMusSettingsPlugin] Item selected: %d" ), + currentItem ); + + MusSettingsKeys::TOperatorVariant operatorVarValue = + iModel->VSSettingsOperatorVariantL(); + + switch ( currentItem ) + { + case KGSSettIdVSActivation: + { + if ( operatorVarValue == MusSettingsKeys::EOperatorSpecific ) + { + SwitchOnOffValueL( KGSSettIdVSActivation ); + container.UpdateListBoxL( KGSSettIdVSActivation ); + } + else + { + ShowVSSettingsActivationSettingDialogL(); + } + break; + } + + case KGSSettIdSIPProfile: + { + ShowVSSettingsProfileSettingDialogL(); + break; + } + + case KGSSettIdAutoRecord: + { + SwitchOnOffValueL( KGSSettIdAutoRecord ); + container.UpdateListBoxL( KGSSettIdAutoRecord ); + break; + } + + case KGSSettIdRecordedVideoSaving: + { + + ShowVSSettingsRecordedVideoSavingSettingDialogL(); + +// SwitchOnOffValueL( KGSSettIdRecordedVideoSaving ); +// container.UpdateListBoxL( KGSSettIdRecordedVideoSaving ); + + break; + } + + case KGSSettIdNote: + { + SwitchOnOffValueL( KGSSettIdNote ); + container.UpdateListBoxL( KGSSettIdNote ); + break; + } + + default: + { + break; + } + } + MUS_LOG( "[MUSSET] <- CMusSettingsPlugin::HandleListBoxSelectionL()" ) + } + + +// ---------------------------------------------------------------------------- +// From class CGSBaseView. +// Returns container class of *this* plugin. iContainer is always garanteed to +// be of type CMusSettingsContainer*. +// ---------------------------------------------------------------------------- +// +CMusSettingsContainer* CMusSettingsPlugin::Container() + { + MUS_LOG( "[MUSSET] <- CMusSettingsPlugin::Container()" ) + return static_cast( iContainer ); + } + + +// ---------------------------------------------------------------------------- +// Shows a dialog for user to modify VS activation setting. Note that this +// method has an alternative method for operator specific variant. +// ---------------------------------------------------------------------------- +// +void CMusSettingsPlugin::ShowVSSettingsActivationSettingDialogL() + { + MUS_LOG( + "[MUSSET] -> CMusSettingsPlugin::ShowVSSettingsActivationSettingDialogL()" + ) + + MusSettingsKeys::TActivation currentValue = + iModel->VSSettingsActivationL(); + + CDesCArrayFlat* items = iCoeEnv->ReadDesC16ArrayResourceL( + R_ACTIVATION_SETTING_PAGE_LBX ); + + CleanupStack::PushL( items ); + TInt intCurrentValue = static_cast( currentValue ); + + CAknRadioButtonSettingPage* dlg = + new ( ELeave ) CAknRadioButtonSettingPage( + R_ACTIVATION_SETTING_PAGE, + intCurrentValue, + items); + + if ( dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ) ) + { + currentValue = + static_cast( intCurrentValue ); + + iModel->SetVSSettingsActivationL( currentValue ); + Container()->UpdateListBoxL( KGSSettIdVSActivation ); + } + + CleanupStack::PopAndDestroy( items ); + MUS_LOG( + "[MUSSET] <- CMusSettingsPlugin::ShowVSSettingsActivationSettingDialogL()" ) + } + + +// ---------------------------------------------------------------------------- +// Shows a dialog for user to modify VS activation setting. Note that this +// method is used only for operator specific variant. Alternative method for +// "standard" variant exists. Note that because standard variant contains 3 +// different values and operator variant contains only 2 values (0,2) the value +// 2 (MusSettingsKeys::ENever) is converted to value 1 +// (MusSettingsKeys::EActiveInHomeNetworks) in operator variant just before +// showing the dialog. After showing the dialog the conversion mentioned above +// is reversed. This temporarily conversion is done solely to use values 0 and +// 1 for direct mapping to items array. +// ---------------------------------------------------------------------------- +// +void CMusSettingsPlugin::ShowOperatorSpecificActivationSettingDialogL() + { + MUS_LOG( + "[MUSSET] -> CMusSettingsPlugin::ShowOperatorSpecificActivationSettingDialogL()" + ) + + MusSettingsKeys::TActivation currentValue = + iModel->VSSettingsActivationL(); + + if ( currentValue == MusSettingsKeys::ENever ) + { + currentValue = MusSettingsKeys::EActiveInHomeNetworks; + } + + CDesCArrayFlat* items = iCoeEnv->ReadDesC16ArrayResourceL( + R_OPERATOR_ACTIVATION_SETTING_PAGE_LBX); + + CleanupStack::PushL( items ); + TInt intCurrentValue = static_cast(currentValue); + + CAknRadioButtonSettingPage* dlg = + new ( ELeave ) CAknRadioButtonSettingPage( + R_ACTIVATION_SETTING_PAGE, + intCurrentValue, + items ); + + if ( dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ) ) + { + currentValue = + static_cast( intCurrentValue ); + if ( currentValue == MusSettingsKeys::EActiveInHomeNetworks ) + { + currentValue = MusSettingsKeys::ENever; + } + iModel->SetVSSettingsActivationL( currentValue ); + Container()->UpdateListBoxL( KGSSettIdVSActivation ); + } + + CleanupStack::PopAndDestroy( items ); + MUS_LOG( + "[MUSSET] <- CMusSettingsPlugin::ShowOperatorSpecificActivationSettingDialogL()" ) + } + + +// ---------------------------------------------------------------------------- +// Shows SIP profile setting dialog (i.e. "use default profile" or "select +// profile from list"). If select profile from list is selected, a list of +// SIP profiles is provided for user to choose wanted SIP profile. +// ---------------------------------------------------------------------------- +// +void CMusSettingsPlugin::ShowVSSettingsProfileSettingDialogL() + { + MUS_LOG( + "[MUSSET] -> CMusSettingsPlugin::ShowVSSettingsProfileSettingDialogL()" ) + TInt cenRepValue = iModel->VSSettingsProfileL(); + TInt profileMode = CMusSettingsModel::KVsSipProfileDefault; + if ( cenRepValue != CMusSettingsModel::KVsSipProfileDefault ) + { + profileMode = CMusSettingsModel::KVsSipProfileSelect; + } + TInt oldProfileMode( profileMode ); + + CDesCArrayFlat* items = iCoeEnv->ReadDesC16ArrayResourceL( + R_SIP_PROFILE_SETTING_PAGE_LBX); + CleanupStack::PushL( items ); + items->Delete( CMusSettingsModel::KVsSipProfileSelectNone ); + + CAknRadioButtonSettingPage* dlg = new ( ELeave ) + CAknRadioButtonSettingPage( R_VS_PROFILE_SETTING_PAGE, + profileMode, + items); + + if ( dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ) ) + { + if ( profileMode == CMusSettingsModel::KVsSipProfileDefault ) + { + if ( oldProfileMode != profileMode ) + { + iModel->SetVSSettingsProfileL( + CMusSettingsModel::KVsSipProfileDefault ); + Container()->ShowNewProfileActiveAfterCallL(); + Container()->UpdateListBoxL( KGSSettIdSIPProfile ); + } + } + else + { + ShowVSSettingsSelectSipProfileDialogL(); + } + } + CleanupStack::PopAndDestroy( items ); + MUS_LOG( + "[MUSSET] <- CMusSettingsPlugin::ShowVSSettingsProfileSettingDialogL()" ) + } + +// ---------------------------------------------------------------------------- +// Provides user a list of SIP profiles to select from. If no SIP profiles +// exist an error note is displayed. +// ---------------------------------------------------------------------------- +// +void CMusSettingsPlugin::ShowVSSettingsSelectSipProfileDialogL() + { + // Get the array of the profile names, ownership changes + CDesCArray* array = iModel->ListOfProfileNamesL(); + CleanupStack::PushL( array ); + + if ( array->Count() < 1 ) + { + ShowNoProfilesNotificationL(); + } + else + { + TInt selectedIndex = iModel->ProfileIndexByIdL( + iModel->VSSettingsProfileL() ); + TInt currentIndex ( selectedIndex ); + + if ( selectedIndex == KErrNotFound ) + { + // first profile in the list + selectedIndex = CMusSettingsModel::KVsSipProfileDefault; + } + + // Create and display the pop-up list + CAknRadioButtonSettingPage* defaultPopUp = + new ( ELeave ) CAknRadioButtonSettingPage( + R_VS_SIP_PROFILE_LIST_VIEW_SELECT_SETTING_PAGE, + selectedIndex, + array ); + if ( defaultPopUp->ExecuteLD( + CAknSettingPage::EUpdateWhenChanged ) ) + { + if ( selectedIndex != currentIndex ) + { + // User has changed the selected profile, set new + // setting to persistent storage + TUint newValue = iModel->ProfileIdByIndex( selectedIndex ); + iModel->SetVSSettingsProfileL( newValue ); + Container()->ShowNewProfileActiveAfterCallL(); + Container()->UpdateListBoxL( KGSSettIdSIPProfile ); + } + } + } + + CleanupStack::PopAndDestroy( array ); // array + } + + +// ---------------------------------------------------------------------------- +// Provides a dialog for user to choose saving location for recorderded video. +// (locations are naturally phone memory or memory card). +// ---------------------------------------------------------------------------- +// +void CMusSettingsPlugin::ShowVSSettingsRecordedVideoSavingSettingDialogL() + { + MUS_LOG( + "[MUSSET] -> CMusSettingsPlugin::ShowVSSettingsRecordedVideoSavingSettingDialogL()" ) + TDriveUnit phoneMemUnit( + TParsePtrC( PathInfo::PhoneMemoryRootPath() ).Drive() ); + TDriveUnit mmcUnit( TParsePtrC( PathInfo::MemoryCardRootPath() ).Drive() ); + TInt currentValue = iModel->VSSettingsRecordedVideoSavingL(); + + + CAknMemorySelectionDialogMultiDrive* dlg = + iModel->MemorySelectionDialogLC(); + + // Use ECFDDialogTypeSave to have double list box in the query +/* CAknMemorySelectionDialog* dlg = CAknMemorySelectionDialog::NewL( + ECFDDialogTypeSave, + R_VS_RECORDED_VIDEO_SAVING_SETTING_PAGE, + EFalse ); + CleanupStack::PushL( dlg ); +*/ + + + + TBool result( EFalse ); + TDriveNumber driveNumber((TDriveNumber)currentValue); + result = dlg->ExecuteL( driveNumber, NULL, NULL ); + + if ( result != CAknCommonDialogsBase::TReturnKey( + CAknCommonDialogsBase::ERightSoftkey) ) + { + if ( ( TInt ) driveNumber != currentValue ) + { + iModel->SetVSSettingsRecordedVideoSavingL( ( TInt ) driveNumber ); + } + Container()->UpdateListBoxL( KGSSettIdRecordedVideoSaving ); + } + +/* CAknMemorySelectionDialog::TMemory mem; + if ( currentValue == ( TInt )mmcUnit ) + { + mem = CAknMemorySelectionDialog::EMemoryCard; + } + else + { + mem = CAknMemorySelectionDialog::EPhoneMemory; + } + + TFileName ignore; + TFileName path; + + if ( dlg->ExecuteL( mem, &path, &ignore ) ) + { + if ( mem == CAknMemorySelectionDialog::EPhoneMemory + && currentValue != ( TInt ) phoneMemUnit ) + { + iModel->SetVSSettingsRecordedVideoSavingL( ( TInt )phoneMemUnit ); + Container()->UpdateListBoxL( KGSSettIdRecordedVideoSaving ); + } + else if ( mem == CAknMemorySelectionDialog::EMemoryCard + && currentValue != ( TInt )mmcUnit ) + { + iModel->SetVSSettingsRecordedVideoSavingL( ( TInt )mmcUnit ); + Container()->UpdateListBoxL( KGSSettIdRecordedVideoSaving ); + } + } +*/ + + CleanupStack::PopAndDestroy(dlg); + MUS_LOG( + "[MUSSET] <- CMusSettingsPlugin::ShowVSSettingsRecordedVideoSavingSettingDialogL()" ) + } + + +// ---------------------------------------------------------------------------- +// In standard variant provides user a "Capability auditory note" setting +// dialog, and in operator variant provides user an "Alerts" setting dialog. +// Note that in both variants the different dialogs toggle the same setting. +// ---------------------------------------------------------------------------- +// +void CMusSettingsPlugin::ShowVSSettingsNoteSettingDialogL() + { + MUS_LOG( + "[MUSSET] -> CMusSettingsPlugin::ShowVSSettingsNoteSettingDialogL()" ) + MusSettingsKeys::TAuditoryNotification currentValue = + iModel->VSSettingsNoteL(); + TInt intCurrentValue = static_cast( currentValue ); + + CAknRadioButtonSettingPage* dlg; + CDesCArrayFlat* items; + + if ( iModel->VSSettingsOperatorVariantL() == MusSettingsKeys::EStandard ) + { + items = iCoeEnv->ReadDesC16ArrayResourceL( + R_VS_AUDIO_SETTING_PAGE_LBX ); + CleanupStack::PushL( items ); + dlg = new ( ELeave ) CAknRadioButtonSettingPage( + R_VS_AUDIO_SETTING_PAGE, + intCurrentValue, + items ); + } + else + { + items = iCoeEnv->ReadDesC16ArrayResourceL( + R_VS_NOTE_SETTING_PAGE_LBX ); + CleanupStack::PushL( items ); + dlg = new ( ELeave ) CAknRadioButtonSettingPage( + R_VS_NOTE_SETTING_PAGE, + intCurrentValue, + items ); + } + + if ( dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ) ) + { + currentValue = + static_cast + ( intCurrentValue ); + iModel->SetVSSettingsNoteL( currentValue ); + Container()->UpdateListBoxL( KGSSettIdNote ); + } + + CleanupStack::PopAndDestroy( items ); + MUS_LOG( + "[MUSSET] <- CMusSettingsPlugin::ShowVSSettingsNoteSettingDialogL()" ) + } + + +// ---------------------------------------------------------------------------- +// Shows a notifications that no SIP profiles exists. +// ---------------------------------------------------------------------------- +// +void CMusSettingsPlugin::ShowNoProfilesNotificationL() + { + MUS_LOG( "[MUSSET] -> CMusSettingsPlugin::ShowNoProfilesNotificationL()" ) + HBufC* infoTxt = StringLoader::LoadLC( R_QTN_MSH_SET_PROFILE_EMPTY ); + CAknInformationNote* note = new ( ELeave ) CAknInformationNote( ETrue ); + note->ExecuteLD( infoTxt->Des() ); + CleanupStack::PopAndDestroy( infoTxt ); + MUS_LOG( "[MUSSET] <- CMusSettingsPlugin::ShowNoProfilesNotificationL()" ) + } + + +// --------------------------------------------------------------------------- +// Switches between two possible values from one to another (i.e. toggles a +// setting on/off). Toggled setting is passed in aValue parameter. +// --------------------------------------------------------------------------- +// +void CMusSettingsPlugin::SwitchOnOffValueL( TInt aValue ) + { + switch( aValue ) + { + case KGSSettIdVSActivation: + { + if ( MusSettingsKeys::EAlwaysActive + == iModel->VSSettingsActivationL() ) + { + iModel->SetVSSettingsActivationL( MusSettingsKeys::ENever ); + } + else + { + iModel->SetVSSettingsActivationL( + MusSettingsKeys::EAlwaysActive ); + } + break; + } + case KGSSettIdAutoRecord: + { + if ( MusSettingsKeys::EAutoRecordOff == + iModel->VSSettingsAutoRecordL() ) + { + iModel->SetVSSettingsAutoRecordL( + MusSettingsKeys::EAutoRecordOn ); + } + else + { + iModel->SetVSSettingsAutoRecordL( + MusSettingsKeys::EAutoRecordOff ); + } + break; + } + case KGSSettIdRecordedVideoSaving: + { + TDriveUnit phoneMemUnit( + TParsePtrC( PathInfo::PhoneMemoryRootPath() ).Drive() ); + TDriveUnit mmcUnit( + TParsePtrC( PathInfo::MemoryCardRootPath() ).Drive() ); + + if ( ( TInt )phoneMemUnit + == iModel->VSSettingsRecordedVideoSavingL() ) + { + iModel->SetVSSettingsRecordedVideoSavingL( ( TInt )mmcUnit ); + } + else + { + iModel->SetVSSettingsRecordedVideoSavingL( ( TInt )phoneMemUnit ); + } + break; + } + case KGSSettIdNote: + { + if ( MusSettingsKeys::EAuditoryNotificationOn + == iModel->VSSettingsNoteL() ) + { + iModel->SetVSSettingsNoteL( + MusSettingsKeys::EAuditoryNotificationOff ); + } + else + { + iModel->SetVSSettingsNoteL( + MusSettingsKeys::EAuditoryNotificationOn ); + } + break; + } + default: + { + MUS_LOG( "[MUSSET] -> CMusSettingsPlugin::SwitchOnOffValueL() - error unknown setting" ) + User::Leave( KErrArgument ); + } + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusSettingsPlugin::ShowGlobalInformationDialogL( TInt aResourceId ) + { + CAknGlobalNote* dlg = CAknGlobalNote::NewLC(); + HBufC* dlgPrompt = StringLoader::LoadLC( aResourceId ); + TRequestStatus status; + dlg->ShowNoteL( status, EAknGlobalInformationNote, *dlgPrompt ); + User::WaitForRequest( status ); + CleanupStack::PopAndDestroy( dlgPrompt ); + CleanupStack::PopAndDestroy( dlg ); + } + +// ---------------------------------------------------------------------------- +// From class CGSPluginInterface. +// Creates a new icon of desired type. Overrided to provide custom icons. +// Ownership of the created icon is transferred to the caller. +// ---------------------------------------------------------------------------- +// +CGulIcon* CMusSettingsPlugin::CreateIconL( const TUid aIconType ) + { + MUS_LOG( "[MUSSET] -> CMusSettingsPlugin::CreateIconL()" ) + + CGulIcon* icon; + + if( aIconType == KGSIconTypeLbxItem ) + { + // Create a custom icon + TParse* fp = new( ELeave ) TParse(); + CleanupStack::PushL( fp ); + HBufC* fileName = MusResourceFinderUtil::AppResourcePathL( + KGSVSSettingsPluginIconDirAndName ); + CleanupStack::PushL(fileName); + fp->Set( *fileName , &KDC_BITMAP_DIR, NULL ); + CleanupStack::PopAndDestroy( fileName ); + + icon = AknsUtils::CreateGulIconL( + AknsUtils::SkinInstance(), + KAknsIIDQgnPropSetVideoSharing, + fp->FullName(), + EMbmMussettingspluginQgn_prop_set_video_sharing, + EMbmMussettingspluginQgn_prop_set_video_sharing_mask ); + + CleanupStack::PopAndDestroy( fp ); + } + else + { + // Use default icon from base class CGSPluginInterface. + icon = CGSPluginInterface::CreateIconL( aIconType ); + } + + MUS_LOG( "[MUSSET] <- CMusSettingsPlugin::CreateIconL()" ) + + return icon; + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshsettingsuiplugin/src/mussettingspluginimplementationtable.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshsettingsuiplugin/src/mussettingspluginimplementationtable.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,48 @@ +/* +* Copyright (c) 2006-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: ECOM proxy table for MUSSettingsPlugin. +* +*/ + + + +#include "mussettingsplugin.h" +#include +#include + + +// ======== LOCAL FUNCTIONS ======== + + +const TImplementationProxy KGSVSSettingsPluginImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( 0x1028238F, CMusSettingsPlugin::NewL ) + }; + + +// ======== GLOBAL FUNCTIONS ======== + + +// --------------------------------------------------------------------------- +// Returns implementation table of this plugin to ECom framework. +// --------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( + TInt& aTableCount ) + { + RDebug::Print(_L("[GSLog] ImplementationGroupProxy()" )); + aTableCount = sizeof(KGSVSSettingsPluginImplementationTable) + / sizeof(TImplementationProxy); + return KGSVSSettingsPluginImplementationTable; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshsettingsuiplugin/src/mussipprofilemodel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshsettingsuiplugin/src/mussipprofilemodel.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,343 @@ +/* +* Copyright (c) 2006-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: Model for managing SIP profiles. +* +*/ + + + +#include "mussipprofilemodel.h" +#include "muslogger.h" +#include +#include +#include +#include + + +const TInt KSIPGranularity = 5; +const TInt KUnknownProfileId = 0; + + +// ======== MEMBER FUNCTIONS ======== + + +CMusSIPProfileModel::CMusSIPProfileModel() + { + MUS_LOG( "[MUSSET] <- CMusSIPProfileModel::CMusSIPProfileModel()" ) + } + + +void CMusSIPProfileModel::ConstructL() + { + MUS_LOG( "[MUSSET] <- CMusSIPProfileModel::ConstructL()" ) + iEngine = CSIPManagedProfileRegistry::NewL( *this ); + ReadArrayFromEngineL(); + } + + +CMusSIPProfileModel* CMusSIPProfileModel::NewL() + { + MUS_LOG( "[MUSSET] -> CMusSIPProfileModel::NewL()" ) + CMusSIPProfileModel* self = new( ELeave ) CMusSIPProfileModel(); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + MUS_LOG( "[MUSSET] <- CMusSIPProfileModel::NewL()" ) + return self; + } + + +CMusSIPProfileModel::~CMusSIPProfileModel() + { + MUS_LOG( "[MUSSET] -> CMusSIPProfileModel::~CMusSIPProfileModel()" ) + DeleteProfiles(); + delete iEngine; + iEngine = NULL; + MUS_LOG( "[MUSSET] <- CMusSIPProfileModel::~CMusSIPProfileModel()" ) + } + + +// ---------------------------------------------------------------------------- +// Returns pointer to the locally cached SIP profile array. +// ---------------------------------------------------------------------------- +// +CArrayPtr* CMusSIPProfileModel::ProfileArrayL() + { + MUS_LOG( "[MUSSET] -> CMusSIPProfileModel::ProfileArrayL()" ) + ReadProfileListFromEngineSafeL(); + MUS_LOG( "[MUSSET] <- CMusSIPProfileModel::ProfileArrayL()" ) + return iProfiles; + } + + +// ---------------------------------------------------------------------------- +// Returns index to the default SIP profile in locally cached array. +// ---------------------------------------------------------------------------- +// +TInt CMusSIPProfileModel::DefaultProfileIndex() + { + MUS_LOG( "[MUSSET] -> CMusSIPProfileModel::DefaultProfileIndex()" ) + TInt index( KErrNotFound ); + + for ( TInt i = 0; i < iProfiles->Count(); i++ ) + { + TBool defProfile( EFalse ); + if ( + KErrNone == + iProfiles->At( i )->GetParameter( KSIPDefaultProfile, defProfile ) + && defProfile ) + { + index = i; + break; + } + } + + MUS_LOG1( "[MUSSET] <- CMusSIPProfileModel::DefaultProfileIndex()( %d )", + index ) + return index; + } + + +// ---------------------------------------------------------------------------- +// Returns id of the default SIP profile. If default SIP profile is not found +// KUnknownProfileId is returned. +// ---------------------------------------------------------------------------- +// +TUint32 CMusSIPProfileModel::DefaultProfileId() + { + MUS_LOG( "[MUSSET] -> CMusSIPProfileModel::DefaultProfileId()" ) + TUint32 id( KUnknownProfileId ); + + for ( TInt i = 0; i < iProfiles->Count(); i++ ) + { + TBool defProfile( EFalse ); + if ( + KErrNone == + iProfiles->At( i )->GetParameter( KSIPDefaultProfile, defProfile ) + && defProfile ) + { + iProfiles->At( i )->GetParameter( KSIPProfileId, id ); + break; + } + } + + MUS_LOG1( "[MUSSET] <- CMusSIPProfileModel::DefaultProfileId()( %d )", + id ) + return id; + } + + +// ---------------------------------------------------------------------------- +// Returns index of the default SIP profile on locally cached array. If default +// SIP profile is not found, KErrNotFound is returned. +// ---------------------------------------------------------------------------- +// +TInt CMusSIPProfileModel::ProfileIndexByIdL( TUint32 aId ) + { + MUS_LOG( "[MUSSET] -> CMusSIPProfileModel::ProfileIndexByIdL()" ) + TInt index( KErrNotFound ); + + ReadProfileListFromEngineSafeL(); + for ( TInt i = 0; i < iProfiles->Count(); i++ ) + { + TUint32 id( KUnknownProfileId ); + + if ( KErrNone == iProfiles->At( i )->GetParameter( KSIPProfileId, id ) + && id == aId ) + { + index = i; + break; + } + } + + MUS_LOG1( "[MUSSET] <- CMusSIPProfileModel::ProfileIndexByIdL()( %d )", + index ) + return index; + } + + +// ---------------------------------------------------------------------------- +// Returns profile ID by index. +// ---------------------------------------------------------------------------- +// +TUint32 CMusSIPProfileModel::ProfileIdByIndex( TUint aIndex ) + { + MUS_LOG1( "[MUSSET] -> CMusSIPProfileModel::ProfileIdByIndex()( %d )", + aIndex ) + TUint32 profileId( KUnknownProfileId ); + if ( iProfiles->Count() > aIndex ) + { + if ( iProfiles->At( aIndex )->GetParameter( + KSIPProfileId, profileId ) ) + { + profileId = KUnknownProfileId; + } + } + + MUS_LOG( "[MUSSET] <- CMusSIPProfileModel::ProfileIdByIndex()" ) + return profileId; + } + + +// ---------------------------------------------------------------------------- +// Reads SIP profiles from SIP Profile Client array to locally cached array. +// ---------------------------------------------------------------------------- +// +void CMusSIPProfileModel::ReadArrayFromEngineL() + { + MUS_LOG( "[MUSSET] -> CMusSIPProfileModel::ReadArrayFromEngineL()" ) + + DeleteProfiles(); + + // Create the profile pointer array + iProfiles = + new ( ELeave ) CArrayPtrFlat( KSIPGranularity ); + + RPointerArray profilePointerArray; + TCleanupItem clItem( ResetAndDestroy, &profilePointerArray ); + CleanupStack::PushL( clItem ); + + iEngine->ProfilesL( profilePointerArray ); + for ( TInt i = 0; i < profilePointerArray.Count(); i++ ) + { + iProfiles->AppendL( + static_cast( profilePointerArray[i] ) ); + } + + profilePointerArray.Reset(); + CleanupStack::PopAndDestroy(); // clItem (profilePointerArray) + + SortProfilesL(); + + MUS_LOG( "[MUSSET] <- CMusSIPProfileModel::ReadArrayFromEngineL()" ) + } + + +// ---------------------------------------------------------------------------- +// Sorts internal array of SIP profiles by id. Used algorithm is generally +// slower than quicksort and selectionsort but very feasible for expected +// amount of items to be sorted and complexity vise. +// ---------------------------------------------------------------------------- +// +void CMusSIPProfileModel::SortProfilesL() + { + TUint32 profileIdFirst( 0 ); + TUint32 profileIdSecond( 0 ); + for ( TInt a = 0; a < iProfiles->Count() - 1; a++ ) + { + for ( TInt b = a + 1; b < iProfiles->Count(); b++ ) + { + User::LeaveIfError( iProfiles->At( a )->GetParameter( + KSIPProfileId, profileIdFirst ) ); + User::LeaveIfError( iProfiles->At( b )->GetParameter( + KSIPProfileId, profileIdSecond ) ); + if ( profileIdFirst > profileIdSecond ) + { + CSIPManagedProfile* tmp = iProfiles->At( b ); + iProfiles->At( b ) = iProfiles->At( a ); + iProfiles->At( a ) = tmp; + } + } + } + } + + +// ---------------------------------------------------------------------------- +// Deletes internally cached SIP profiles. +// ---------------------------------------------------------------------------- +// +void CMusSIPProfileModel::DeleteProfiles() + { + if ( iProfiles ) + { + iProfiles->ResetAndDestroy(); + delete iProfiles; + iProfiles = NULL; + } + } + + +// ---------------------------------------------------------------------------- +// From class MSIPProfileRegistryObserver. +// Notifies of an event in SIP profile registry. +// ---------------------------------------------------------------------------- +// +void CMusSIPProfileModel::ProfileRegistryEventOccurred( + TUint32 /*aSIPProfileId*/, TEvent /*aEvent*/ ) + { + MUS_LOG( "[MUSSET] <- CMusSIPProfileModel::ProfileRegistryEventOccurred()" ) + } + + +// ---------------------------------------------------------------------------- +// From class MSIPProfileRegistryObserver. +// An asynchronous error has occurred related to SIP profile +// ---------------------------------------------------------------------------- +// +void CMusSIPProfileModel::ProfileRegistryErrorOccurred( + TUint32 /*aSIPProfileId*/, + TInt /*aError*/ ) + { + MUS_LOG( "[MUSSET] <- CMusSIPProfileModel::ProfileRegistryErrorOccurred()" ) + } + + +// ---------------------------------------------------------------------------- +// Reads SIP profile list from engine; if reading fails, old cached list is +// kept and returned. +// ---------------------------------------------------------------------------- +// +void CMusSIPProfileModel::ReadProfileListFromEngineSafeL() + { + MUS_LOG( + "[MUSSET] -> CMusSIPProfileModel::ReadProfileListFromEngineSafeL()" ) + // To prevent complete disaster it we'll save the pointer of the old array + CArrayPtrFlat* profiles = iProfiles; + iProfiles = 0; + TRAPD( error, ReadArrayFromEngineL() ); + + if ( error ) + { + // Problems with re-reading profiles; use existing array + DeleteProfiles(); + iProfiles = profiles; + User::Leave( error ); + } + else + { + // No problems; delete backup array + profiles->ResetAndDestroy(); + delete profiles; + } + MUS_LOG( + "[MUSSET] <- CMusSIPProfileModel::ReadProfileListFromEngineSafeL()" ) + } + + +// ---------------------------------------------------------------------------- +// For deleting RPointerArray in case of leave (used in association with +// TCleanupItem). +// ---------------------------------------------------------------------------- +// +void CMusSIPProfileModel::ResetAndDestroy( TAny* aPointerArray ) + { + MUS_LOG( "[MUSSET] -> CMusSIPProfileModel::ResetAndDestroy()" ) + RPointerArray* array = + static_cast*>( aPointerArray ); + array->ResetAndDestroy(); + array->Close(); + MUS_LOG( "[MUSSET] <- CMusSIPProfileModel::ResetAndDestroy()" ) + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshsettingsuiplugin/tsrc/Install/sis_udeb.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshsettingsuiplugin/tsrc/Install/sis_udeb.bat Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,17 @@ +rem +rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +rem All rights reserved. +rem This component and the accompanying materials are made available +rem under the terms of "Eclipse Public License v1.0" +rem which accompanies this distribution, and is available +rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +rem +rem Initial Contributors: +rem Nokia Corporation - initial contribution. +rem +rem Contributors: +rem +rem Description: +rem + +makesis vs_settingsui_udeb.pkg vs_settingsui.sis diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshsettingsuiplugin/tsrc/Install/sis_urel.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshsettingsuiplugin/tsrc/Install/sis_urel.bat Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,17 @@ +rem +rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +rem All rights reserved. +rem This component and the accompanying materials are made available +rem under the terms of "Eclipse Public License v1.0" +rem which accompanies this distribution, and is available +rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +rem +rem Initial Contributors: +rem Nokia Corporation - initial contribution. +rem +rem Contributors: +rem +rem Description: +rem + +makesis vs_settingsui_urel.pkg vs_settingsui.sis diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshsettingsuiplugin/tsrc/Install/vs_settingsui_udeb.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshsettingsuiplugin/tsrc/Install/vs_settingsui_udeb.pkg Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,41 @@ +; +; 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: +; +; A package file for creating an installation file for Vs settings ui + +; Supported languages +&en + +#{"vssettingsui"},(0x1028238F),2,0,0,TYPE=SA + +%{"Vendor-EN"} +:"Nokia" + +(0x101F6F88), 0, 0, 0, {"Series60ProductID"} + +; ----------------------------------------------------------------------------------- + +;MUS FILES +;for S60 3.2 + +;MUS CENREP KEY +;"\epoc32\DATA\Z\private\10202be9\1028238b.txt"-"!:\private\10202BE9\1028238b.txt" + +;SETTINGS UI +"\epoc32\release\armv5\udeb\mussettingsui.dll"-"!:\sys\bin\mussettingsui.dll" +"\EPOC32\DATA\Z\Resource\Plugins\mussettingsui.RSC"-"!:\resource\plugins\mussettingsui.RSC" +"\EPOC32\DATA\Z\Resource\mussettingsuirsc.RSC"-"!:\resource\mussettingsuirsc.RSC" +"\EPOC32\DATA\Z\Resource\apps\mussettingsplugin.mif"-"!:\resource\apps\mussettingsplugin.mif" + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshsettingsuiplugin/tsrc/Install/vs_settingsui_urel.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshsettingsuiplugin/tsrc/Install/vs_settingsui_urel.pkg Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,41 @@ +; +; 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: +; +; A package file for creating an installation file for Vs settings ui + +; Supported languages +&en + +#{"vssettingsui"},(0x1028238F),2,0,0,TYPE=SA + +%{"Vendor-EN"} +:"Nokia" + +(0x101F6F88), 0, 0, 0, {"Series60ProductID"} + +; ----------------------------------------------------------------------------------- + +;MUS FILES +;for S60 3.2 + +;MUS CENREP KEY +;"\epoc32\DATA\Z\private\10202be9\1028238b.txt"-"!:\private\10202BE9\1028238b.txt" + +;SETTINGS UI +"\epoc32\release\armv5\urel\mussettingsui.dll"-"!:\sys\bin\mussettingsui.dll" +"\EPOC32\DATA\Z\Resource\Plugins\mussettingsui.RSC"-"!:\resource\plugins\mussettingsui.RSC" +"\EPOC32\DATA\Z\Resource\mussettingsuirsc.RSC"-"!:\resource\mussettingsuirsc.RSC" +"\EPOC32\DATA\Z\Resource\apps\mussettingsplugin.mif"-"!:\resource\apps\mussettingsplugin.mif" + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshsipcrplugin/data/mussipcrplugin.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshsipcrplugin/data/mussipcrplugin.rss Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,51 @@ +/* +* 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: ECom resource file. +* +*/ + + + +//#include + +#include "mussipcrplugin.hrh" +#include "../../../inc/musversionnumbers.h" +#include + +// ------------------------------------------------------------------------- +// ECOM registry information +// ------------------------------------------------------------------------- +RESOURCE REGISTRY_INFO theInfo + { + + dll_uid = KMusSipCrPluginImplementationUid; + interfaces = + { + INTERFACE_INFO + { + interface_uid = KSipClientInterfaceUid; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = KMusSipCrPluginImplementationUid; + version_no = KMusEcomVersionNumber; + display_name = "multimediasharing"; + default_data = "1028238A"; + opaque_data = ""; + } + }; + } + }; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshsipcrplugin/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshsipcrplugin/group/bld.inf Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,29 @@ +/* +* 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: project specification +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + + +PRJ_EXPORTS + + +PRJ_MMPFILES +mussipcrplugin.mmp \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshsipcrplugin/group/mussipcrplugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshsipcrplugin/group/mussipcrplugin.mmp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,59 @@ +/* +* 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: Subsystem's project specification. +* +*/ + + +#include + +TARGET mussipcrplugin.dll +TARGETTYPE PLUGIN +UID 0x10009d8D 0x1028238A +VENDORID VID_DEFAULT +CAPABILITY CAP_ECOM_PLUGIN +LANG SC + +SOURCEPATH ../data +RESOURCE mussipcrplugin.rss + +SOURCEPATH ../src +SOURCE mussipcrplugin.cpp +SOURCE mussipcrpluginmain.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../../inc + +APP_LAYER_SYSTEMINCLUDE + +// MultimediaSharing libraries +LIBRARY musmanagerclient.lib + +// SymbianOS/Series60 libraries +LIBRARY euser.lib +LIBRARY apgrfx.lib // Application Architecture +LIBRARY apparc.lib +LIBRARY bafl.lib // Basic Application Framework Library +LIBRARY cone.lib +LIBRARY ecom.lib +LIBRARY efsrv.lib +LIBRARY sipclient.lib // SIP Client API +LIBRARY sipprofilecli.lib // SIP Profile Agent Client API +LIBRARY sipcodec.lib // SIP Codec +LIBRARY sdpcodec.lib // SDP Codec +LIBRARY centralrepository.lib // for MultimediaSharingSettings + +DEBUGLIBRARY flogger.lib // file logger + +PAGED diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshsipcrplugin/inc/mussipcrplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshsipcrplugin/inc/mussipcrplugin.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,107 @@ +/* +* 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: +* +*/ + + +#ifndef MUSSIPCRPLUGIN_H +#define MUSSIPCRPLUGIN_H + +#include "musunittesting.h" + +#include +#include +#include + +class CMusManager; +class CSdpMediaField; + +IMPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount ); + +/** + * CMusSipCrPlugin + */ +class CMusSipCrPlugin : public CSIPResolvedClient + { + MUS_UNITTEST( CMusSipCrPluginTest ) + +public: // constructors and destructor + + static CMusSipCrPlugin* NewL(); + + virtual ~CMusSipCrPlugin(); + +private: // constructors + + CMusSipCrPlugin(); + + void ConstructL(); + +public: // from CSIPResolvedClient + + /** + * Returns the SIP client's channel UID that indicates client's + * channel UID for connection with SIP e.g. CSIP::NewL() + * @param aMethod the method of the SIP request + * @param aRequestUri the request-URI of the SIP request + * @param aHeaders all the headers in the SIP request + * @param aContent SIP request body; zero-length descriptor if not present + * @param aContentType the content-type of the SIP request. + * Zero-pointer if body is not present. + * @return SIP client's communication channel's UID + */ + TUid ChannelL( RStringF aMethod, + const TDesC8& aRequestUri, + const RPointerArray& aHeaders, + const TDesC8& aContent, + const CSIPContentTypeHeader* aContentType=0 ); + + + /** + * Requests the client to connect to SIP with resolved + * UID in case there's no connection with resolved channel UID. + * @param aUid previously resolved channel UID + * @leave KErrNoMemory if out of memory + * @leave KErrNotFound in case non-existing channel UID was provided + */ + void ConnectL( TUid aUid ); + + /** + * Requests the implementation to provide capabilities in XML format + * in case they were not defined in the ECOM resource file. The cabablities + * to be returned must be defined according to the same DTD. + * This function will be invoked only if the capabilities are not + * defined in the ECOM resource file. + */ + const TDesC8& Capabilities(); + +private: // New functions + + /** + * Check whether video field has sendrecv attribute + * @return ETrue if video has sendrecv attribute, EFalse otherwise + */ + TBool CheckForSendRecvAttributeL( + RPointerArray& aFields ) const; + +private: // data + + CMusManager* iManager; + TBool iCloseStringPool; + + }; + + +#endif // MUSSIPCRPLUGIN_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshsipcrplugin/inc/mussipcrplugin.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshsipcrplugin/inc/mussipcrplugin.hrh Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,28 @@ +/* +* 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: enumerations and UID constants +* +*/ + + +#ifndef MUSSIPCRPLUGIN_HRH +#define MUSSIPCRPLUGIN_HRH + +// the uid of the the binary +#define KMusSipCrPluginImplementationUid 0x1028238A + +// the uid of sip plugin type +#define KSipClientInterfaceUid 0x102010DD + +#endif // MUSSIPCRPLUGIN_HRH diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshsipcrplugin/src/mussipcrplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshsipcrplugin/src/mussipcrplugin.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,297 @@ +/* +* 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: The Mus ECOM interface implementation of the SIP +* stack client. +* +*/ + + + +#include "mussipcrplugin.h" +#include "muscommon.h" +#include "muslogger.h" +#include "musmanager.h" +#include "musuid.hrh" +#include "musunittesting.h" +#include "mussettings.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +_LIT8( KSendRecv, "sendrecv"); // For attribute checks +_LIT8( KRecvOnly, "recvonly"); // For attribute checks +_LIT8( KSendOnly, "sendonly" ); // For attribute checks + +_LIT8(KCapabilities, +"\ +\ +\ +\ +\ +\ +\ +\ +\ +\ +\ +\ +\ +"); + + +// ------------------------------------------------------------------------- +// Two-phased constructor. +// ------------------------------------------------------------------------- +// +CMusSipCrPlugin* CMusSipCrPlugin::NewL() + { + MUS_LOG( "mus: [MUSSCR] -> CMusSipCrPlugin::NewL()" ); + CMusSipCrPlugin* self = new(ELeave) CMusSipCrPlugin; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + MUS_LOG( "mus: [MUSSCR] <- CMusSipCrPlugin::NewL()" ); + return self; + } + + +// ------------------------------------------------------------------------- +// C++ destructor. +// ------------------------------------------------------------------------- +// +CMusSipCrPlugin::~CMusSipCrPlugin() + { + MUS_LOG( "mus: [MUSSCR] -> CMusSipCrPlugin::~CMusSipCrPlugin()" ); + delete iManager; + if ( iCloseStringPool ) + { + SdpCodecStringPool::Close(); + } + MUS_LOG( "mus: [MUSSCR] <- CMusSipCrPlugin::~CMusSipCrPlugin()" ); + } + + +// ------------------------------------------------------------------------- +// C++ constructor. +// ------------------------------------------------------------------------- +// +CMusSipCrPlugin::CMusSipCrPlugin() + { + } + + +// ------------------------------------------------------------------------- +// Symbian second-phase constructor. +// ------------------------------------------------------------------------- +// +void CMusSipCrPlugin::ConstructL() + { + MUS_LOG( "mus: [MUSSCR] -> CMusSipCrPlugin::ConstructL()" ); + iManager = CMusManager::NewL(); + + TRAPD( err, SdpCodecStringPool::OpenL() ); + + switch ( err ) + { + case KErrNone: + { + //close pool at destructor, not opened by others + iCloseStringPool = ETrue; + break; + } + + case KErrAlreadyExists: + { + //already opened, do not try to close at destructor + iCloseStringPool = EFalse; + break; + } + + default: + { + User::Leave( err ); + } + } + + MUS_LOG( "mus: [MUSSCR] <- CMusSipCrPlugin::ConstructL()" ); + } + + +// ------------------------------------------------------------------------- +// CMusSipCrPlugin::ChannelL +// ------------------------------------------------------------------------- +// +TUid CMusSipCrPlugin::ChannelL( RStringF aMethod, + const TDesC8& /*aRequestUri*/, + const RPointerArray& /*aHeaders*/, + const TDesC8& aContent, + const CSIPContentTypeHeader* /*aContentType*/ ) + { + MUS_LOG( "mus: [MUSSCR] -> CMusSipCrPlugin::ChannelL()" ); + + if ( aMethod == SIPStrings::StringF( SipStrConsts::EOptions ) ) + { + TUid uid; + uid.iUid = ( TInt ) CMusManager::ESipOptions; + MUS_LOG1( "mus: [MUSSCR] <- CMusSipCrPlugin::ChannelL(): KSipOptions %d", + uid.iUid ); + return uid; + } + else + { + MultimediaSharing::TMusAvailabilityStatus capability + = iManager->AvailabilityL(); + + if( capability < KErrNone || + capability >= MultimediaSharing::EErrServerShutDown ) + { + TUid uid; + uid.iUid = ( TInt ) CMusManager::ESipInviteNotDesired; + MUS_LOG1( "mus: [MUSSCR] <- CMusSipCrPlugin::ChannelL(): \ + KNotAllowedSipInvite %d", uid.iUid ); + return uid; + } + else + { + TUid uid; + uid.iUid = ( TInt ) CMusManager::ESipInviteDesired; + TBool twoWaySupported = MultimediaSharingSettings::VideoDirectionL() == + MusSettingsKeys::ETwoWayVideo; + + if ( ( aContent.Length() > 0 ) && twoWaySupported ) + { + MUS_LOG( "mus: [MUSSCR] 2 way supported, parsing SDP..." ); + CSdpDocument* sdpDocument = CSdpDocument::DecodeLC( aContent ); + TBool sendRecv = CheckForSendRecvAttributeL( sdpDocument->MediaFields() ); + if ( sendRecv ) + { + uid.iUid = ( TInt ) CMusManager::ESipInviteDesired2WayVideo; + } + + CleanupStack::PopAndDestroy( sdpDocument ); + } + + MUS_LOG1( "mus: [MUSSCR] <- CMusSipCrPlugin::ChannelL(): \ + KAllowedSipInvite %d", uid.iUid ); + return uid; + } + } + } + +// ------------------------------------------------------------------------- +// CMusSipCrPlugin::CheckForSendRecvAttribute +// ------------------------------------------------------------------------- +// +TBool CMusSipCrPlugin::CheckForSendRecvAttributeL( + RPointerArray& aFields ) const + { + MUS_LOG( "mus: [MUSSCR] -> CMusSipCrPlugin::CheckForSendRecvAttribute()" ); + + TBool sendRecv = EFalse; + TBool sendAttrFound = EFalse; + TBool videoFound = EFalse; + RStringF videoType = SdpCodecStringPool::StringPoolL().StringF( + SdpCodecStringConstants::EMediaVideo, + SdpCodecStringPool::StringTableL() ); + const TInt fieldcount = aFields.Count(); + + for ( TInt i = 0; i < fieldcount && !videoFound; i++ ) + { + CSdpMediaField* mField = aFields[i]; + + //only check video fields + videoFound = mField->Media() == videoType; + + if ( videoFound ) + { + RPointerArray< CSdpAttributeField > attrList = + mField->AttributeFields(); + + TInt attrCount = attrList.Count(); + for (TInt j = 0; j < attrCount && !sendAttrFound; j++ ) + { + CSdpAttributeField* attributeField = attrList[j]; + RStringF attribute = attributeField->Attribute(); + + if ( KErrNotFound != attribute.DesC().FindF( KSendRecv ) ) + { + sendRecv = ETrue; + sendAttrFound = ETrue; + MUS_LOG( "mus: [MUSSCR] attribute found!" ); + } + else if ( ( KErrNotFound != attribute.DesC().FindF( KSendOnly ) ) || + ( KErrNotFound != attribute.DesC().FindF( KRecvOnly ) ) ) + { + MUS_LOG( "mus: [MUSSCR] / attribute found!" ); + sendAttrFound = ETrue; + } + } + + if ( !sendAttrFound ) + { + MUS_LOG( "mus: [MUSSCR] no send/recv related attributes found!" ); + sendRecv = ETrue; + } + } + } + MUS_LOG1( "mus: [MUSSCR] <- CMusSipCrPlugin::CheckForSendRecvAttribute(), \ + sendrecv: %d", sendRecv ); + + return sendRecv; + } + +// ------------------------------------------------------------------------- +// CMusSipCrPlugin::ConnectL +// ------------------------------------------------------------------------- +// +void CMusSipCrPlugin::ConnectL( TUid aUid ) + { + MUS_LOG1( "mus: [MUSSCR] -> CMusSipCrPlugin::ConnectL( %d )", aUid.iUid ); + if ( aUid.iUid == CMusManager::ESipOptions || + aUid.iUid == CMusManager::ESipInviteDesired || + aUid.iUid == CMusManager::ESipInviteDesired2WayVideo || + aUid.iUid == CMusManager::ESipInviteNotDesired ) + { + iManager->HandleSipRequestL(( CMusManager::TRequestType ) aUid.iUid ); + } + else + { + MUS_LOG( "mus: [MUSSCR] <- CMusSipCrPlugin::ChannelL()\ + ( User::Leave KErrNotSupported )" ); + User::Leave( KErrNotSupported ); + } + MUS_LOG( "mus: [MUSSCR] <- CMusSipCrPlugin::ConnectL()" ); + } + + +// ------------------------------------------------------------------------- +// CMusSipCrPlugin::Capabilities() +// ------------------------------------------------------------------------- +// +const TDesC8& CMusSipCrPlugin::Capabilities() + { + MUS_LOG( "mus: [MUSSCR] -> CMusSipCrPlugin::Capabilities()" ); + MUS_LOG( "mus: [MUSSCR] <- CMusSipCrPlugin::Capabilities()" ); + return KCapabilities; + } + + + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshsipcrplugin/src/mussipcrpluginmain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshsipcrplugin/src/mussipcrpluginmain.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,50 @@ +/* +* 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: Global functions. +* +*/ + + +#include "musunittesting.h" +#include "mussipcrplugin.h" +#include "mussipcrplugin.hrh" +#include "muscommon.h" +#include "muslogger.h" + +#include +#include + +/** + * Holds the implementation table. + */ +const TImplementationProxy KMusSipCrPluginImplementationTable[] = + { +// disable PC-Lint warning for "suspicious typecast", caused by +// Symbian's ECom declarations, by "lint -e611" + IMPLEMENTATION_PROXY_ENTRY( KMusSipCrPluginImplementationUid, //lint -e611 + CMusSipCrPlugin::NewL ) + }; + +/** + * Returns the implementation table and updates the aTableCount parameter + * to hold the number of elements in the table. + */ +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount ) + { + MUS_LOG( "mus: [MUSSCR] -> TImplementationProxy* ImplementationGroupProxy" ); + aTableCount = sizeof( KMusSipCrPluginImplementationTable ) / + sizeof( TImplementationProxy ); + MUS_LOG( "mus: [MUSSCR] <- TImplementationProxy* ImplementationGroupProxy" ); + return KMusSipCrPluginImplementationTable; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshsipcrplugin/tsrc/ut_sipcrplugin/BWINS/ut_sipcrpluginu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshsipcrplugin/tsrc/ut_sipcrplugin/BWINS/ut_sipcrpluginu.def Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,4 @@ +EXPORTS + ?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 1 NONAME ; class MEUnitTest * CreateTestSuiteL(void) + ?ImplementationGroupProxy@@YAPBUTImplementationProxy@@AAH@Z @ 2 NONAME ; struct TImplementationProxy const * ImplementationGroupProxy(int &) + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshsipcrplugin/tsrc/ut_sipcrplugin/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshsipcrplugin/tsrc/ut_sipcrplugin/group/bld.inf Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,19 @@ +/* +* 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: +* +*/ + +PRJ_MMPFILES +ut_sipcrplugin.mmp \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshsipcrplugin/tsrc/ut_sipcrplugin/group/ut_sipcrplugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshsipcrplugin/tsrc/ut_sipcrplugin/group/ut_sipcrplugin.mmp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,69 @@ +/* +* 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: +* +*/ + + +#include +#include + +TARGET ut_sipcrplugin.dll +TARGETTYPE dll +EPOCALLOWDLLDATA +TARGETPATH /DigiaEUnit/Tests +UID 0x1000af5a 0x01700a21 + +CAPABILITY EUNIT_CAPS +VENDORID VID_DEFAULT + +MACRO UNIT_TESTING + +SOURCEPATH ../src +SOURCE ut_mussipcrplugindllmain.cpp +SOURCE mussipcrplugintest.cpp + +SOURCEPATH ../../../src +SOURCE mussipcrplugin.cpp +SOURCE mussipcrpluginmain.cpp + +SOURCEPATH ../../../../../tsrc/musmanagerstub/src +SOURCE musmanagerstub.cpp + +SOURCEPATH ../../../../../tsrc/multimediasharingsettingsstub/src +SOURCE mussettings.cpp + +USERINCLUDE ../../../../../tsrc/multimediasharingsettingsstub/inc +USERINCLUDE ../inc +USERINCLUDE ../../../inc +USERINCLUDE ../../../../../inc +USERINCLUDE ../../../../../tsrc/musmanagerstub/inc + +APP_LAYER_SYSTEMINCLUDE + +LIBRARY connmon.lib +LIBRARY ecom.lib +LIBRARY eunit.lib +LIBRARY euser.lib +LIBRARY flogger.lib +LIBRARY sipclient.lib // SIP Client API +LIBRARY sipprofilecli.lib // SIP Profile Agent Client API +LIBRARY sipcodec.lib // SIP Codec +LIBRARY sdpcodec.lib // SDP Codec +LIBRARY bafl.lib // Basic Application Framework Library + + +EXPORTUNFROZEN + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshsipcrplugin/tsrc/ut_sipcrplugin/inc/mussipcrplugintest.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshsipcrplugin/tsrc/ut_sipcrplugin/inc/mussipcrplugintest.h Thu Jul 22 16:32:26 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: Main plugin class +* +*/ + + +#ifndef MUSAOPLUGINTEST_H +#define MUSAOPLUGINTEST_H + + + +#include + +class CMusSipCrPlugin; + + +/** + * Main plugin class + * + * @lib ut_musaoplugin.dll + */ +class CMusSipCrPluginTest + : public CEUnitTestSuiteClass + { + +public: + + /** + * Symbian two-phase constructor. + * @return New CMusSipCrPluginTest instance + */ + static CMusSipCrPluginTest* NewL(); + + /** + * C++ destructor. + */ + virtual ~CMusSipCrPluginTest(); + +private: // constructors + + /** + * C++ constructor. + */ + CMusSipCrPluginTest(); + + /** + * Symbian second-phase constructor. + */ + void ConstructL(); + + +public: // Test functions + + void UT_ConstructL(); + + void UT_ChannelL(); + + void UT_ConnectL(); + + void UT_Capabilities(); + + void UT_ImplementationGroupProxy(); + + void UT_CheckForSendRecvAttributeL(); + +public: + void SetupL(); + void Teardown(); + + +private: // data + + CMusSipCrPlugin* iPlugin; + + EUNIT_DECLARE_TEST_TABLE; + + }; + +#endif // MUSAOPLUGINTEST_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshsipcrplugin/tsrc/ut_sipcrplugin/src/mussipcrplugintest.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshsipcrplugin/tsrc/ut_sipcrplugin/src/mussipcrplugintest.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,412 @@ +/* +* 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: Main plugin class +* +*/ + + +#include "musunittesting.h" +#include "musmanagerstub.h" +#include "mussipcrplugin.h" +#include "mussipcrplugintest.h" +#include "muslogger.h" +#include "musmanager.h" +#include "mussettings.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +// Next row is to disable warning emerging from EUnit code. +#pragma warn_illtokenpasting off + +_LIT8( KSdpSendOnly, "v=0\r\n\ +o=Inviter2008 63241204263093750 132223800 IN IP4 10.0.0.6\r\n\ +s=-\r\n\ +c=IN IP4 10.0.0.6\r\n\ +t=0 0\r\n\ +m=video 49152 RTP/AVP 98\r\n\ +a=sendonly\r\n\ +a=rtpmap:98 H264/90000\r\n" ); + +_LIT8( KSdpSendRecv, "v=0\r\n\ +o=Inviter2008 63241204263093750 132223800 IN IP4 10.0.0.6\r\n\ +s=-\r\n\ +c=IN IP4 10.0.0.6\r\n\ +t=0 0\r\n\ +m=video 49152 RTP/AVP 98\r\n\ +a=sendrecv\r\n\ +a=rtpmap:98 H264/90000\r\n" ); + +_LIT8( KSdpNoMedia, "v=0\r\n\ +o=Inviter2008 63241204263093750 132223800 IN IP4 10.0.0.6\r\n\ +s=-\r\n\ +c=IN IP4 10.0.0.6\r\n\ +t=0 0\r\n" ); + +_LIT8( KSdpNoVideo, "v=0\r\n\ +o=Inviter2008 63241204263093750 132223800 IN IP4 10.0.0.6\r\n\ +s=-\r\n\ +c=IN IP4 10.0.0.6\r\n\ +t=0 0\r\n\ +m=audio 5000 RTP/AVP 106 8 0\r\n\ +a=sendrecv\r\n\ +a=rtpmap:106 AMR/8000\r\n" ); + +_LIT8( KSdpVideoNoAttributes, "v=0\r\n\ +o=Inviter2008 63241204263093750 132223800 IN IP4 10.0.0.6\r\n\ +s=-\r\n\ +c=IN IP4 10.0.0.6\r\n\ +t=0 0\r\n\ +m=video 49152 RTP/AVP 98\r\n" ); + +_LIT8( KSdpRecvOnly, "v=0\r\n\ +o=Inviter2008 63241204263093750 132223800 IN IP4 10.0.0.6\r\n\ +s=-\r\n\ +c=IN IP4 10.0.0.6\r\n\ +t=0 0\r\n\ +m=video 49152 RTP/AVP 98\r\n\ +a=recvonly\r\n\ +a=rtpmap:98 H264/90000\r\n" ); + + +// -------------------------------------------------------------------------- +// C++ constructor. +// -------------------------------------------------------------------------- +// +CMusSipCrPluginTest::CMusSipCrPluginTest() + : CEUnitTestSuiteClass() + { + } + + +// -------------------------------------------------------------------------- +// Symbian two-phase constructor. +// -------------------------------------------------------------------------- +// +CMusSipCrPluginTest* CMusSipCrPluginTest::NewL() + { + CMusSipCrPluginTest* self = new (ELeave) CMusSipCrPluginTest(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +// -------------------------------------------------------------------------- +// Symbian second-phase constructor. +// -------------------------------------------------------------------------- +// +void CMusSipCrPluginTest::ConstructL() + { + CEUnitTestSuiteClass::ConstructL(); + } + + +// -------------------------------------------------------------------------- +// C++ destructor. +// -------------------------------------------------------------------------- +// +CMusSipCrPluginTest::~CMusSipCrPluginTest() + { + } + + + +// ------------------------ Test case setup begin --------------------------- + + +// -------------------------------------------------------------------------- +// +// -------------------------------------------------------------------------- +// +void CMusSipCrPluginTest::SetupL( ) + { + iPlugin = CMusSipCrPlugin::NewL(); + SIPStrings::OpenL(); + } + + +// -------------------------------------------------------------------------- +// +// -------------------------------------------------------------------------- +// +void CMusSipCrPluginTest::Teardown( ) + { + SIPStrings::Close(); + delete iPlugin; + } + + + +// ------------------------- Test functions begin --------------------------- + +// -------------------------------------------------------------------------- +// +// -------------------------------------------------------------------------- +// +void CMusSipCrPluginTest::UT_ConstructL() + { + // 1. String pool was opend by us + EUNIT_ASSERT( iPlugin->iCloseStringPool ); + + // 2. String pool was already opened by someone else, KErrAlreadyExists + delete iPlugin; + iPlugin = NULL; + SdpCodecStringPool::OpenL(); + TRAPD( err, iPlugin = CMusSipCrPlugin::NewL() ); + if ( err != KErrNone ) + { + SdpCodecStringPool::Close(); + User::Leave(err); + } + EUNIT_ASSERT( !iPlugin->iCloseStringPool ); + SdpCodecStringPool::Close(); + } + + +// -------------------------------------------------------------------------- +// +// -------------------------------------------------------------------------- +// +void CMusSipCrPluginTest::UT_ChannelL() + { + RPointerArray array; + + TUid response; + + // Options + response = iPlugin->ChannelL( + SIPStrings::StringF( SipStrConsts::EOptions ), + KNullDesC8(), + array, + KNullDesC8(), + NULL ); + + EUNIT_ASSERT( response.iUid == CMusManager::ESipOptions ) + + // Everything is OK, 2-way video not supported + CMusManager::SetAvailability( + ( MultimediaSharing::TMusAvailabilityStatus ) KErrNone ); + + response = iPlugin->ChannelL( SIPStrings::StringF( SipStrConsts::EMessage ), + KNullDesC8(), + array, + KNullDesC8(), + NULL ); + + EUNIT_ASSERT( response.iUid == CMusManager::ESipInviteDesired ) + + // Server is shut down + CMusManager::SetAvailability( MultimediaSharing::EErrServerShutDown ); + + response = iPlugin->ChannelL( SIPStrings::StringF( SipStrConsts::EMessage ), + KNullDesC8(), + array, + KNullDesC8(), + NULL ); + + EUNIT_ASSERT( response.iUid == CMusManager::ESipInviteNotDesired ) + + // Mus is not supported + CMusManager::SetAvailability( + ( MultimediaSharing::TMusAvailabilityStatus ) KErrNotSupported ); + + response = iPlugin->ChannelL( SIPStrings::StringF( SipStrConsts::EMessage ), + KNullDesC8(), + array, + KNullDesC8(), + NULL ); + + EUNIT_ASSERT( response.iUid == CMusManager::ESipInviteNotDesired ) + + // 2-way video is supported and sendrecv not present in SDP + MultimediaSharingSettings::iVideoDirection = MusSettingsKeys::ETwoWayVideo; + CMusManager::SetAvailability( + ( MultimediaSharing::TMusAvailabilityStatus ) KErrNone ); + + response = iPlugin->ChannelL( SIPStrings::StringF( SipStrConsts::EMessage ), + KNullDesC8(), + array, + KSdpSendOnly(), + NULL ); + + EUNIT_ASSERT( response.iUid == CMusManager::ESipInviteDesired ) + + // 2-way video is supported and sendrecv is present in SDP + response = iPlugin->ChannelL( SIPStrings::StringF( SipStrConsts::EMessage ), + KNullDesC8(), + array, + KSdpSendRecv(), + NULL ); + + EUNIT_ASSERT( response.iUid == CMusManager::ESipInviteDesired2WayVideo ) + } + + +// -------------------------------------------------------------------------- +// +// -------------------------------------------------------------------------- +// +void CMusSipCrPluginTest::UT_ConnectL() + { + // Options + TUid uid; + uid.iUid = CMusManager::ESipOptions; + iPlugin->ConnectL( uid ); + EUNIT_ASSERT_EQUALS( iPlugin->iManager->iHandleSipRequestLCalledWithParam, + CMusManager::ESipOptions ) + + // Desired invite + uid.iUid = CMusManager::ESipInviteDesired; + iPlugin->ConnectL( uid ); + EUNIT_ASSERT_EQUALS( iPlugin->iManager->iHandleSipRequestLCalledWithParam, + CMusManager::ESipInviteDesired ) + + // Not desired invite + uid.iUid = CMusManager::ESipInviteNotDesired; + iPlugin->ConnectL( uid ); + EUNIT_ASSERT_EQUALS( iPlugin->iManager->iHandleSipRequestLCalledWithParam, + CMusManager::ESipInviteNotDesired ) + + // Unknown case, manager is not called and value does not change + uid.iUid = KErrNone; + EUNIT_ASSERT_SPECIFIC_LEAVE( iPlugin->ConnectL( uid ), KErrNotSupported ) + EUNIT_ASSERT_EQUALS( iPlugin->iManager->iHandleSipRequestLCalledWithParam, + CMusManager::ESipInviteNotDesired ) + } + + +// -------------------------------------------------------------------------- +// +// -------------------------------------------------------------------------- +// +void CMusSipCrPluginTest::UT_Capabilities() + { + // Dummy test is enough + iPlugin->Capabilities(); + } + + +// -------------------------------------------------------------------------- +// +// -------------------------------------------------------------------------- +// +void CMusSipCrPluginTest::UT_ImplementationGroupProxy() + { + // Dummy test + TInt tableCount; + + ImplementationGroupProxy( tableCount ); + } + + +// -------------------------------------------------------------------------- +// +// -------------------------------------------------------------------------- +// +void CMusSipCrPluginTest::UT_CheckForSendRecvAttributeL() + { + CSdpDocument* sdpDocument; + TBool sendRecv; + + // 1. SDP doesn't have a single media field + sdpDocument = CSdpDocument::DecodeLC( KSdpNoMedia() ); + sendRecv = iPlugin->CheckForSendRecvAttributeL( sdpDocument->MediaFields() ); + CleanupStack::PopAndDestroy( sdpDocument ); + EUNIT_ASSERT( !sendRecv ); + + // 2. SDP has audio field, but no video + sdpDocument = CSdpDocument::DecodeLC( KSdpNoVideo() ); + sendRecv = iPlugin->CheckForSendRecvAttributeL( sdpDocument->MediaFields() ); + CleanupStack::PopAndDestroy( sdpDocument ); + EUNIT_ASSERT( !sendRecv ); + + // 3. SDP has video field without any attributes + sdpDocument = CSdpDocument::DecodeLC( KSdpVideoNoAttributes() ); + sendRecv = iPlugin->CheckForSendRecvAttributeL( sdpDocument->MediaFields() ); + CleanupStack::PopAndDestroy( sdpDocument ); + EUNIT_ASSERT( sendRecv ); + + // 4. SDP has video with "sendrecv" attribute + sdpDocument = CSdpDocument::DecodeLC( KSdpSendRecv() ); + sendRecv = iPlugin->CheckForSendRecvAttributeL( sdpDocument->MediaFields() ); + CleanupStack::PopAndDestroy( sdpDocument ); + EUNIT_ASSERT( sendRecv ); + + // 5. SDP has video with "recvonly" attribute + sdpDocument = CSdpDocument::DecodeLC( KSdpRecvOnly() ); + sendRecv = iPlugin->CheckForSendRecvAttributeL( sdpDocument->MediaFields() ); + CleanupStack::PopAndDestroy( sdpDocument ); + EUNIT_ASSERT( !sendRecv ); + } + + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + CMusSipCrPluginTest, + "CMusSipCrPluginTest", + "CMusSipCrPluginTest" ) + +EUNIT_TEST( + "ConstructL - test", + "CMusSipCrPluginTest", + "UT_ConstructL", + "FUNCTIONALITY", + SetupL, UT_ConstructL, Teardown) + +EUNIT_TEST( + "CMusSipCrPluginTest", + "CMusSipCrPluginTest", + "ConnectL", + "FUNCTIONALITY", + SetupL, UT_ConnectL, Teardown) + +EUNIT_TEST( + "CMusSipCrPluginTest", + "CMusSipCrPluginTest", + "ChannelL", + "FUNCTIONALITY", + SetupL, UT_ChannelL, Teardown) + +EUNIT_TEST( + "CMusSipCrPluginTest", + "CMusSipCrPluginTest", + "Capabilities", + "FUNCTIONALITY", + SetupL, UT_Capabilities, Teardown) + +EUNIT_TEST( + "CMusSipCrPluginTest", + "CMusSipCrPluginTest", + "ImplementationGroupProxyTest", + "FUNCTIONALITY", + SetupL, UT_ImplementationGroupProxy, Teardown) + +EUNIT_TEST( + "CheckForSendRecvAttribute - stest", + "CMusSipCrPluginTest", + "UT_CheckForSendRecvAttribute", + "FUNCTIONALITY", + SetupL, UT_CheckForSendRecvAttributeL, Teardown) + +EUNIT_END_TEST_TABLE + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshsipcrplugin/tsrc/ut_sipcrplugin/src/ut_mussipcrplugindllmain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshsipcrplugin/tsrc/ut_sipcrplugin/src/ut_mussipcrplugindllmain.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,45 @@ +/* +* 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: +* +*/ + + +// EXTERNAL INCLUDES +#include + +#include "mussipcrplugintest.h" + +/** + * Test suite factory function. + */ +EXPORT_C MEUnitTest* CreateTestSuiteL() + { + CEUnitTestSuite* rootSuite = CEUnitTestSuite::NewLC(_L("Mush SIPCRPlugin")); + + rootSuite->AddL( CMusSipCrPluginTest::NewL() ); + + CleanupStack::Pop( rootSuite ); + return rootSuite; + } + + + +// END OF FILE + + + + + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshwpadapterplugin/data/10282390.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshwpadapterplugin/data/10282390.rss Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,57 @@ +/* +* 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: project specification +* +*/ + + + +#include "muswpadapteruids.h" +#include "../../../inc/musversionnumbers.h" +#include + + + + +// ----------------------------------------------------------------------------- +// Resource defining the ProvisioningAdapter plugin. +// ----------------------------------------------------------------------------- +// +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = KMUSWPADAPTERDLLUID3; + interfaces = + { + INTERFACE_INFO + { + interface_uid = KPROVISIONINGADAPTERINTERFACE; + implementations = + { + IMPLEMENTATION_INFO + { + // In this case implementation UID is the same as DLL UID + implementation_uid = KMUSWPADAPTERDLLUID3; + version_no = KMusEcomVersionNumber; + display_name = "Multimedia Sharing provisioning||Implements a MUS Provisioning Adapter||Copyright © 2006 Nokia."; + default_data = ""; + // opaque_data field determines priority order of dependent + // adapters. Mus is dependent on SIP Adapter and thus uses + // randomly chosen value bigger than SIP Adapter's 10. + opaque_data = "15"; // 15 is + } + + }; + } + }; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshwpadapterplugin/data/muswpadapterresource.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshwpadapterplugin/data/muswpadapterresource.rss Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,36 @@ +/* +* 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: project specification +* +*/ + + + +// INCLUDES + +#include +#include + +// Rich text labels + +// --------------------------------------------------------------------------- +// Summary title for MuS settings in provisioning message +// --------------------------------------------------------------------------- +// +RESOURCE LBUF r_mus_wp_summarytitle + { + txt = qtn_msh_set_title; + } + +// End of file. diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshwpadapterplugin/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshwpadapterplugin/group/bld.inf Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,27 @@ +/* +* 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: project specification +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_MMPFILES +muswpadapter.mmp + +PRJ_TESTMMPFILES diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshwpadapterplugin/group/muswpadapter.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshwpadapterplugin/group/muswpadapter.mmp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,67 @@ +/* +* 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: project specification +* +*/ + + +#include +#include + +#include "../inc/muswpadapteruids.h" + + +TARGET muswpadapter.dll +TARGETTYPE PLUGIN +UID KMUSWPADAPTERDLLUID2 KMUSWPADAPTERDLLUID3 +VENDORID VID_DEFAULT +CAPABILITY CAP_ECOM_PLUGIN +LANG SC + + +SOURCEPATH ../data + +//ECOM resource definition +START RESOURCE 10282390.rss +TARGET muswpadapter.rsc +TARGETPATH ECOM_RESOURCE_DIR +END //ECOM resource definition + +//MUS resources +START RESOURCE muswpadapterresource.rss +HEADER +TARGET muswpadapterresource.rsc +TARGETPATH RESOURCE_FILES_DIR +LANGUAGE_IDS +END // MUS resources + +SOURCEPATH ../src +SOURCE muswpadapter.cpp +SOURCE muswpitem.cpp +SOURCE muswpadaptergroupproxy.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../../inc + +APP_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY provisioningengine.lib +LIBRARY centralrepository.lib +LIBRARY sipprofilecli.lib +LIBRARY charconv.lib +LIBRARY bafl.lib +DEBUGLIBRARY flogger.lib + +PAGED diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshwpadapterplugin/inc/muswpadapter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshwpadapterplugin/inc/muswpadapter.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,202 @@ +/* +* 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: project specification +* +*/ + + + +#ifndef MUSWPADAPTER_H +#define MUSWPADAPTER_H + + +#include "musunittesting.h" + +#include + + +class CWPCharacteristic; +class CMusWpItem; + + +/** + * CMusWpAdapter handles application-specific OTA (Over-The-Air) settings + * of Mus. + */ +class CMusWpAdapter : public CWPAdapter + { + MUS_UNITTEST( UT_CMusWpAdapter ) + + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CMusWpAdapter* NewL(); + + /** + * Destructor. + */ + virtual ~CMusWpAdapter(); + + + public: // from CWPAdapter, pure virtual in base class + + /** + * Check the number of settings items. + * + * @return Number of items + */ + TInt ItemCount() const; + + /** + * Returns the title of the nth summary line. + * + * @param aIndex Number of summary line + * @return Summary line title + */ + const TDesC16& SummaryTitle(TInt aIndex) const; + + /** + * Returns the text of the nth summary line. + * + * @param aIndex Number of summary line + * @return Summary line text + */ + const TDesC16& SummaryText(TInt aIndex) const; + + /** + * Saves one setting handled by the adapter. + * + * @param Setting number + */ + void SaveL( TInt aItem ); + + /** + * Returns ETrue if the adapter can set the settings as default. + * + * @param Setting number + * @return ETrue if the setting can be made default + */ + TBool CanSetAsDefault( TInt aItem ) const; + + /** + * Adapter sets the settings as default. + * + * @param Setting number + */ + void SetAsDefaultL( TInt aItem ); + + /** + * Calls the pair visitor for each detail line of an item. + * + * @param aItem Item whose details are needed + * @param aVisitor Pair visitor + * @return KErrNotSupported if not supported + */ + TInt DetailsL( TInt aItem, MWPPairVisitor& aVisitor ); + + + public: // from CWPAdapter, empty implementations in base class + + /** + * Informs the adapters of the saved settings. + * + * @param TDesC8& aAppIdOfSavingItem. UID of the adapter component. + * @param HBufC8& aAppRef. APPREF of the saved settings. + * @param HBufC8& aStorageIdValue. Value that identifies the settings in + * its storage. + * @param TBool& aIsLastOfItsType. ETrue is gotten if the saved set + * was last of its type. + */ + void SettingsSavedL ( const TDesC8& aAppIdOfSavingItem, + const TDesC8& aAppRef, + const TDesC8& aStorageIdValue ); + + /** + * Informs the adapters of the finalization of saving. + */ + void SavingFinalizedL(); + + + public: // from CWPAdapter, which derives them from MWPVisitor + + /** + * Called for each characteristic found. + * + * @param aCharacteristic The characteristic found + */ + void VisitL(CWPCharacteristic& aElement); + + /** + * Called for each parameter found. + * + * @param aParameter The parameter found + */ + void VisitL(CWPParameter& aElement); + + /** + * Called for each link to a logical proxy or access point. + * No implementation needed. + * + * @param aCharacteristic The characteristic found by following the + * link. + */ + void VisitLinkL(CWPCharacteristic& aLink ); + + + private: // Constructors + + /** + * C++ default constructor. + */ + CMusWpAdapter(); + + /** + * 2nd phase constructor. + */ + void ConstructL(); + + + private: // data + + // Title to be shown in provisioning message + HBufC* iSummaryTitle; + + // The application id of the current characteristic. + HBufC* iAppID; + + // Settings + CMusWpItem* iWpItem; + + // Parsed settings + CMusWpItem* iNewWpItem; + + // ETrue if we have profile id to save + TBool iProfileIdReceived; + + + private: // saved settings + + /** + * Profile Id of SIP profile saved by SIPAdapter meant + * to be used with Mus. + */ + TUint32 iProfileId; + + + }; + + +#endif // MUSWPADAPTER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshwpadapterplugin/inc/muswpadapteruids.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshwpadapterplugin/inc/muswpadapteruids.h Thu Jul 22 16:32:26 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: project specification +* +*/ + + +#ifndef MUSWPADAPTERUID_H +#define MUSWPADAPTERUID_H + +#include "../../../inc/musuid.hrh" + +// The next two UIDs are copies from the non-public header +// ProvisioningUIDs.h. They are defined again in this file because +// MusAdapter is not going to be part of S60 Provisioning package +// and thus can't require provisioning source codes. + +// ECOM plugin +#define KECOMUID2 0x10009D8D + +/// UID of the Provisisioning Adapter plugin interface +#define KPROVISIONINGADAPTERINTERFACE 0x101F84D5 + + +// The following UIDs are for MusAdapter + +// UID2 for the MusAdapter. ECOM plug-in. +#define KMUSWPADAPTERDLLUID2 KECOMUID2 + +/// UID3 for the MusAdapter DLL +#define KMUSWPADAPTERDLLUID3 KMusWpAdapterUid + + +#endif // MUSWPADAPTERUID_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshwpadapterplugin/inc/muswpitem.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshwpadapterplugin/inc/muswpitem.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,148 @@ +/* +* 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: project specification +* +*/ + + + +#ifndef MUSWPITEM_H +#define MUSWPITEM_H + + +#include "mussettingskeys.h" +#include "musunittesting.h" +#include + +/** + * + */ +class CMusWpItem : public CBase + { + MUS_UNITTEST( UT_CMusWpItem ) + MUS_UNITTEST( UT_CMusWpAdapter ) + + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CMusWpItem* NewL(); + + /** + * Destructor. + */ + virtual ~CMusWpItem(); + + + public: // API + + /** + * Gets PROVIDER-ID param + */ + const TDesC& ProviderId() const; + + /** + * Sets PROVIDER-ID param + */ + void SetProviderIdL( const TDesC& aProviderId ); + + /** + * Gets name + */ + const TDesC& Name() const; + + /** + * Sets name + */ + void SetNameL( const TDesC& aName); + + /** + * Gets TO-APPREF param + */ + const TDesC& ToAppRef() const; + + /** + * Sets TO-APPREF param + */ + void SetToAppRefL( const TDesC& aToAppRef ); + + /** + * Sets EDGEDTM param + */ + void SetEdgeDtmSupport( TBool aEdgeDtm ); + + /** + * Sets INTERNETSIGNALING param + */ + void SetForceInternetSignaling( TBool aInternetSignaling ); + + /** + * Sets QUERY param + */ + void SetCapabilityQuery( const TDesC& aValue ); + + /** + * Sets CONDITION param + */ + void SetActivationCondition( const TDesC& aValue ); + + /** + * Saves this set of settings. + */ + void SaveL(); + + + private: // Constructors + + /** + * C++ default constructor. + */ + CMusWpItem(); + + /** + * 2nd phase constructor. + */ + void ConstructL(); + + + private: // data + + // Identity of video sharing settings provider. Own. + HBufC* iProviderId; + + /** + * User displayable name for multimedia sharing, e.g. + * "Multimedia Sharing settings". Own. + */ + HBufC* iName; + + /** + * The APPREF of sip profile that is referenced from + * multimeida sharing's TO-APPREF parameter. Own. + */ + HBufC* iToAppRef; + + + private: // saved settings + + MusSettingsKeys::TEdgeDtmSupport iEdgeDtmSupport; + MusSettingsKeys::TForceInternetSignaling iForceInternetSignaling; + MusSettingsKeys::TCapabilityQuery iCapabilityQuery; + MusSettingsKeys::TActivation iActivationCondition; + + }; + + +#endif // MUSWPITEM_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshwpadapterplugin/src/muswpadapter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshwpadapterplugin/src/muswpadapter.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,404 @@ +/* +* 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: project specification +* +*/ + + + +// USER +#include "muswpadapter.h" +#include "muswpitem.h" +#include "mussettings.h" +#include "muslogger.h" + +// SYSTEM +#include +#include +#include +#include +#include + + + + +// CONSTANTS + +_LIT( KMusAppID, "w9017" ); +_LIT8( KSipAppID8, "w9010" ); + +_LIT( KMusWpAdapterName, "muswpadapterresource" ); + +_LIT( KMUsWpCharacteristicNameCapability, "CAPABILITY" ); +_LIT( KMUsWpCharacteristicNameActivation, "ACTIVATION" ); + +_LIT( KMusWpParamNameEdgeDtm, "EDGEDTM" ); +_LIT( KMusWpParamNameInternetSignaling, "INTERNETSIGNALING" ); +_LIT( KMusWpParamNameQuery, "QUERY" ); +_LIT( KMusWpParamNameCondition, "CONDITION" ); + +const TUint32 KMusWpNotSet = 0; + + + +// ----------------------------------------------------------------------------- +// Symbian two-phased constructor. +// ----------------------------------------------------------------------------- +// +CMusWpAdapter* CMusWpAdapter::NewL() + { + MUS_LOG( "mus: [MUSWP] -> CMusWpAdapter::NewL" ) + CMusWpAdapter* self = new( ELeave ) CMusWpAdapter; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + MUS_LOG( "mus: [MUSWP] <- CMusWpAdapter::NewL" ) + return self; + } + + +// ----------------------------------------------------------------------------- +// Destructor. +// ----------------------------------------------------------------------------- +// +CMusWpAdapter::~CMusWpAdapter() + { + MUS_LOG( "mus: [MUSWP] -> CMusWpAdapter::~CMusWpAdapter" ) + delete iAppID; + delete iWpItem; + delete iNewWpItem; + delete iSummaryTitle; + MUS_LOG( "mus: [MUSWP] <- CMusWpAdapter::~CMusWpAdapter" ) + } + + +// ----------------------------------------------------------------------------- +// From base class CWAdapter. Definition of the pure virtual function. +// ----------------------------------------------------------------------------- +// +TInt CMusWpAdapter::ItemCount() const + { + MUS_LOG( "mus: [MUSWP] -> CMusWpAdapter::ItemCount()" ) + MUS_LOG( "mus: [MUSWP] <- CMusWpAdapter::ItemCount()" ) + + if ( iWpItem ) + { + return 1; + } + + return 0; + } + + +// ----------------------------------------------------------------------------- +// From base class CWAdapter. Definition of the pure virtual function. +// ----------------------------------------------------------------------------- +// +const TDesC16& CMusWpAdapter::SummaryTitle( TInt /*aIndex*/ ) const + { + MUS_LOG( "mus: [MUSWP] -> CMusWpAdapter::SummaryTitle()" ) + MUS_LOG( "mus: [MUSWP] <- CMusWpAdapter::SummaryTitle()" ) + + return *iSummaryTitle; + } + + +// ----------------------------------------------------------------------------- +// From base class CWAdapter. Definition of the pure virtual function. +// ----------------------------------------------------------------------------- +// +const TDesC16& CMusWpAdapter::SummaryText( TInt /*aIndex*/ ) const + { + MUS_LOG( "mus: [MUSWP] -> CMusWpAdapter::SummaryText( ... )" ) + if( iWpItem ) + { + return iWpItem->Name(); + } + + MUS_LOG( "mus: [MUSWP] <- CMusWpAdapter::SummaryText( ... )" ) + return *iSummaryTitle; + } + + +// ----------------------------------------------------------------------------- +// From base class CWAdapter. Definition of the pure virtual function. +// ----------------------------------------------------------------------------- +// +void CMusWpAdapter::SaveL( TInt /*aItem*/ ) + { + MUS_LOG( "mus: [MUSWP] -> CMusWpAdapter::SaveL" ) + + if ( iWpItem ) + { + iWpItem->SaveL(); + } + + MUS_LOG( "mus: [MUSWP] <- CMusWpAdapter::SaveL" ) + } + + +// ----------------------------------------------------------------------------- +// From base class CWAdapter. Definition of the pure virtual function. +// ----------------------------------------------------------------------------- +// +TBool CMusWpAdapter::CanSetAsDefault( TInt /*aIndex*/ ) const + { + return EFalse; + } + + +// ----------------------------------------------------------------------------- +// From base class CWAdapter. Definition of the pure virtual function. +// ----------------------------------------------------------------------------- +// +void CMusWpAdapter::SetAsDefaultL( TInt /*aIndex*/ ) + { + User::Leave( KErrNotSupported ); + } + + +// ----------------------------------------------------------------------------- +// From base class CWAdapter. Definition of the pure virtual function. +// ----------------------------------------------------------------------------- +// +TInt CMusWpAdapter::DetailsL( TInt /*aItem*/, MWPPairVisitor& /*aVisitor */ ) + { + return KErrNotSupported; + } + + +// ----------------------------------------------------------------------------- +// From base class CWPAdapter. Overrides the empty implementation of that class. +// ----------------------------------------------------------------------------- +// +void CMusWpAdapter::SettingsSavedL( const TDesC8& aAppIdOfSavingItem, + const TDesC8& aAppRef, + const TDesC8& aStorageIdValue ) + { + MUS_LOG( "mus: [MUSWP] -> CMusWpAdapter::SettingsSavedL" ) + + // If settings are saved by SIPAdapter... + if ( aAppIdOfSavingItem == KSipAppID8 ) + { + // ...and are ment for us... + if ( iWpItem ) + { + HBufC8* tmpValue = HBufC8::NewLC( 4*iWpItem->ToAppRef().Length() ); + TPtr8 ptrTmpValue( tmpValue->Des() ); + CnvUtfConverter::ConvertFromUnicodeToUtf8( ptrTmpValue, + iWpItem->ToAppRef() ); + + if ( aAppRef == *tmpValue ) + { + MUS_LOG( " CMusWpAdapter, Prepared to save setting" ) + // ...prepare to save profile Id + TLex8 lex( aStorageIdValue ); + User::LeaveIfError( lex.Val( iProfileId, EDecimal ) ); + iProfileIdReceived = ETrue; + } + + CleanupStack::PopAndDestroy( tmpValue ); + } + } + + MUS_LOG( "mus: [MUSWP] <- CMusWpAdapter::SettingsSavedL" ) + }; + + +// ----------------------------------------------------------------------------- +// From base class CWPAdapter. Overrides the empty implementation of that class. +// ----------------------------------------------------------------------------- +// +void CMusWpAdapter::SavingFinalizedL() + { + MUS_LOG( "mus: [MUSWP] -> CMusWpAdapter::SavingFinalizedL" ) + + if ( iProfileIdReceived ) + { + MultimediaSharingSettings::SetSipProfileSettingL( + static_cast(iProfileId) ); + } + + MUS_LOG( "mus: [MUSWP] <- CMusWpAdapter::SavingFinalizedL" ) + } + + +// ----------------------------------------------------------------------------- +// From base class CWPAdapter, which derives this from MWPVisitor. +// Definition of the pure virtual function. +// ----------------------------------------------------------------------------- +// +void CMusWpAdapter::VisitL( CWPCharacteristic& aCharacteristic ) + { + MUS_LOG( "mus: [MUSWP] -> CMusWpAdapter::VisitL (Characteristic)" ) + switch ( aCharacteristic.Type() ) + { + case KWPApplication: + { + iNewWpItem = CMusWpItem::NewL(); + + aCharacteristic.AcceptL( *this ); + + // If Mus settings, store information + if( iAppID && *iAppID == KMusAppID ) + { + MUS_LOG( " CMusWpAdapter, Mus Settings found" ) + delete iWpItem; + iWpItem = iNewWpItem; + } + else + { + delete iNewWpItem; + } + + iNewWpItem = NULL; + break; + } + case KWPNamedCharacteristic: + { + if ( iNewWpItem ) + { + // We are inside APPLICATION-characteristic + if ( aCharacteristic.Name() == + KMUsWpCharacteristicNameCapability() || + aCharacteristic.Name() == + KMUsWpCharacteristicNameActivation() ) + { + aCharacteristic.AcceptL( *this ); + } + } + break; + } + default: + { + break; + } + } + MUS_LOG( "mus: [MUSWP] <- CMusWpAdapter::VisitL (Characteristic)" ) + } + + +// ----------------------------------------------------------------------------- +// From base class CWPAdapter, which derives this from MWPVisitor. +// Definition of the pure virtual function. +// ----------------------------------------------------------------------------- +// +void CMusWpAdapter::VisitL( CWPParameter& aParameter ) + { + MUS_LOG( "mus: [MUSWP] -> CMusWpAdapter::VisitL (Parameter)" ) + + switch ( aParameter.ID() ) + { + case EWPNamedParameter: // Name is used instead of ID + { + if ( aParameter.Name() == KMusWpParamNameEdgeDtm() ) + { + iNewWpItem->SetEdgeDtmSupport( ETrue ); + } + else if ( aParameter.Name() == KMusWpParamNameInternetSignaling() ) + { + iNewWpItem->SetForceInternetSignaling( ETrue ); + } + else if ( aParameter.Name() == KMusWpParamNameQuery() ) + { + iNewWpItem->SetCapabilityQuery( aParameter.Value() ); + } + else if ( aParameter.Name() == KMusWpParamNameCondition() ) + { + iNewWpItem->SetActivationCondition( aParameter.Value() ); + } + else + { + // To keep PC-Lint happy + } + break; + } + case EWPParameterAppID: // APPLICATION/APPID + { + delete iAppID; + iAppID = NULL; + iAppID = aParameter.Value().AllocL(); + break; + } + case EWPParameterProviderID: // APPLICATION/PROVIDER-ID + { + iNewWpItem->SetProviderIdL( aParameter.Value() ); + break; + } + case EWPParameterName: // APPLICATION/NAME + { + iNewWpItem->SetNameL( aParameter.Value() ); + break; + } + case EWPParameterToAppRef: // APPLICATION/TO-APPREF + { + iNewWpItem->SetToAppRefL( aParameter.Value() ); + break; + } + default: + { + break; + } + } + + MUS_LOG( "mus: [MUSWP] <- CMusWpAdapter::VisitL (Parameter)" ) + } + + +// ----------------------------------------------------------------------------- +// From base class CWPAdapter, which derives this from MWPVisitor. +// Definition of the pure virtual function. +// ----------------------------------------------------------------------------- +// +void CMusWpAdapter::VisitLinkL(CWPCharacteristic& /*aLink*/ ) + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// C++ default constructor +// ----------------------------------------------------------------------------- +// +CMusWpAdapter::CMusWpAdapter() + :CWPAdapter(), + iProfileIdReceived( EFalse ), + iProfileId( KMusWpNotSet ) + { + } + + +// ----------------------------------------------------------------------------- +// Symbian 2nd phase constructor +// ----------------------------------------------------------------------------- +// +void CMusWpAdapter::ConstructL() + { + MUS_LOG( "mus: [MUSWP] -> CMusWpAdapter::ConstructL" ) + + TFileName fileName; + Dll::FileName(fileName); + + iSummaryTitle = WPAdapterUtil::ReadHBufCL( fileName, + KMusWpAdapterName, + R_MUS_WP_SUMMARYTITLE ); + + MUS_LOG( "mus: [MUSWP] <- CMusWpAdapter::ConstructL" ) + } + + + + + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshwpadapterplugin/src/muswpadaptergroupproxy.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshwpadapterplugin/src/muswpadaptergroupproxy.cpp Thu Jul 22 16:32:26 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: project specification +* +*/ + + +#include "muswpadapteruids.h" +#include "muswpadapter.h" + +#include + + +// -------------------------------------------------------------------------- +// Exported proxy for instantiation method resolution. Use the interface +// UID (same as the DLL UID) and the implementation factory function as a +// pair for ECom instantiation. +// -------------------------------------------------------------------------- +// +const TImplementationProxy ImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( KMUSWPADAPTERDLLUID3, + CMusWpAdapter::NewL ) + }; + + +// -------------------------------------------------------------------------- +// Implementation factory function. +// Returns: TImplementationProxy*: pointer to TImplementationProxy +// -------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( + TInt& aTableCount ) + { + aTableCount = sizeof( ImplementationTable ) / + sizeof( TImplementationProxy ); + return ImplementationTable; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshwpadapterplugin/src/muswpitem.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshwpadapterplugin/src/muswpitem.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,272 @@ +/* +* 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: project specification +* +*/ + + + +// USER +#include "muswpitem.h" +#include "mussettings.h" +#include "muslogger.h" + +_LIT( KMusWpCapabilityQueryParallel, "1" ); // (from w9017.txt) +_LIT( KMusWpCapabilityQuerySequential, "2" ); // (from w9017.txt) + +_LIT( KMusWpActivationConditionAlways, "1" ); // (from w9017.txt) +_LIT( KMusWpActivationConditionInHome, "2" ); // (from w9017.txt) +_LIT( KMusWpActivationConditionNever, "3" ); // (from w9017.txt) + +// ----------------------------------------------------------------------------- +// Symbian two-phased constructor. +// ----------------------------------------------------------------------------- +// +CMusWpItem* CMusWpItem::NewL() + { + MUS_LOG( "mus: [MUSWP] -> CMusWpItem::NewL" ) + CMusWpItem* self = new( ELeave ) CMusWpItem; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + MUS_LOG( "mus: [MUSWP] <- CMusWpItem::NewL" ) + return self; + } + + +// ----------------------------------------------------------------------------- +// Destructor. +// ----------------------------------------------------------------------------- +// +CMusWpItem::~CMusWpItem() + { + MUS_LOG( "mus: [MUSWP] -> CMusWpItem::~CMusWpItem" ) + + delete iProviderId; + delete iName; + delete iToAppRef; + + MUS_LOG( "mus: [MUSWP] <- CMusWpItem::~CMusWpItem" ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +const TDesC& CMusWpItem::ProviderId() const + { + if ( iProviderId ) + { + return *iProviderId; + } + + return KNullDesC; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusWpItem::SetProviderIdL( const TDesC& aProviderId ) + { + HBufC* newProviderId = aProviderId.AllocL(); + delete iProviderId; + iProviderId = newProviderId; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +const TDesC& CMusWpItem::Name() const + { + if ( iName ) + { + return *iName; + } + + return KNullDesC; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusWpItem::SetNameL( const TDesC& aName) + { + HBufC* newName = aName.AllocL(); + delete iName; + iName = newName; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +const TDesC& CMusWpItem::ToAppRef() const + { + if ( iToAppRef ) + { + return *iToAppRef; + } + + return KNullDesC; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusWpItem::SetToAppRefL( const TDesC& aToAppRef ) + { + HBufC* newToAppRef = aToAppRef.AllocL(); + delete iToAppRef; + iToAppRef = newToAppRef; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusWpItem::SetEdgeDtmSupport( TBool aEdgeDtmSupport ) + { + if ( aEdgeDtmSupport ) + { + iEdgeDtmSupport = MusSettingsKeys::EDtmModeAllowed; + } + else + { + iEdgeDtmSupport = MusSettingsKeys::EDtmModeNotAllowed; + } + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusWpItem::SetForceInternetSignaling( TBool aInternetSignaling ) + { + if ( aInternetSignaling ) + { + iForceInternetSignaling = MusSettingsKeys::EForceInternetSignaling; + } + else + { + iForceInternetSignaling = MusSettingsKeys::EFollowProfileConfiguration; + } + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusWpItem::SetCapabilityQuery( const TDesC& aValue ) + { + if ( aValue == KMusWpCapabilityQueryParallel() ) + { + iCapabilityQuery = MusSettingsKeys::EParallel; + } + else if ( aValue == KMusWpCapabilityQuerySequential() ) + { + iCapabilityQuery = MusSettingsKeys::ESequential; + } + else + { + // To keep PC-Lint happy + } + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusWpItem::SetActivationCondition( const TDesC& aValue ) + { + if ( aValue == KMusWpActivationConditionAlways() ) + { + iActivationCondition = MusSettingsKeys::EAlwaysActive; + } + else if ( aValue == KMusWpActivationConditionInHome() ) + { + iActivationCondition = MusSettingsKeys::EActiveInHomeNetworks; + } + else if ( aValue == KMusWpActivationConditionNever ) + { + iActivationCondition = MusSettingsKeys::ENever; + } + else + { + // To keep PC-Lint happy + } + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusWpItem::SaveL() + { + MUS_LOG( "mus: [MUSWP] -> CMusWpItem::SaveL" ) + + // Uncomment next line to enable provisioning of EDGE / DTM setting + // MultimediaSharingSettings::SetEdgeDtmSupportSettingL( iEdgeDtmSupport ); + MultimediaSharingSettings::SetForceInternetSignalingSettingL( + iForceInternetSignaling ); + MultimediaSharingSettings::SetCapabilityQuerySettingL( iCapabilityQuery ); + MultimediaSharingSettings::SetActivationSettingL( iActivationCondition ); + + MUS_LOG( "mus: [MUSWP] <- CMusWpItem::SaveL" ) + } + + +// ----------------------------------------------------------------------------- +// C++ default constructor +// Default setting for activation is temporarily changed to EAlways +// ----------------------------------------------------------------------------- +// +CMusWpItem::CMusWpItem() + :iEdgeDtmSupport( MusSettingsKeys::EDtmModeNotAllowed ), + iForceInternetSignaling( MusSettingsKeys::EFollowProfileConfiguration ), + iCapabilityQuery( MusSettingsKeys::ENoOptions ), + //iActivationCondition( MusSettingsKeys::EActiveInHomeNetworks ) + iActivationCondition( MusSettingsKeys::EAlwaysActive ) + { + } + + +// ----------------------------------------------------------------------------- +// Symbian 2nd phase constructor +// ----------------------------------------------------------------------------- +// +void CMusWpItem::ConstructL() + { + } + + + + + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshwpadapterplugin/tsrc/ut_wpadapterplugin/BWINS/ut_muswpadapterU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshwpadapterplugin/tsrc/ut_wpadapterplugin/BWINS/ut_muswpadapterU.DEF Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,64 @@ +EXPORTS + ?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 1 NONAME ; class MEUnitTest * CreateTestSuiteL(void) + ??1CRepository@@UAE@XZ @ 2 NONAME ; CRepository::~CRepository(void) + ?StartTransaction@CRepository@@QAEHW4TTransactionMode@1@@Z @ 3 NONAME ; int CRepository::StartTransaction(enum CRepository::TTransactionMode) + ?ProfileL@CSIPProfileRegistryBase@@QAEPAVCSIPProfile@@K@Z @ 4 NONAME ; class CSIPProfile * CSIPProfileRegistryBase::ProfileL(unsigned long) + ?SetNameL@CWPCharacteristic@@QAEXABVTDesC16@@@Z @ 5 NONAME ; void CWPCharacteristic::SetNameL(class TDesC16 const &) + ?Name@CWPParameter@@QBEABVTDesC16@@XZ @ 6 NONAME ; class TDesC16 const & CWPParameter::Name(void) const + ?Connection@CSIP@@QBEPAVCSIPConnection@@K@Z @ 7 NONAME ; class CSIPConnection * CSIP::Connection(unsigned long) const + ?NewLC@CRepository@@SAPAV1@VTUid@@@Z @ 8 NONAME ; class CRepository * CRepository::NewLC(class TUid) + ?Create@CRepository@@QAEHKABVTDesC8@@@Z @ 9 NONAME ; int CRepository::Create(unsigned long, class TDesC8 const &) + ?NewL@CSIPManagedProfileRegistry@@SAPAV1@AAVMSIPProfileRegistryObserver@@@Z @ 10 NONAME ; class CSIPManagedProfileRegistry * CSIPManagedProfileRegistry::NewL(class MSIPProfileRegistryObserver &) + ??1CSIPProfileRegistryBase@@UAE@XZ @ 11 NONAME ; CSIPProfileRegistryBase::~CSIPProfileRegistryBase(void) + ?DefaultProfileL@CSIPProfileRegistryBase@@QAEPAVCSIPProfile@@XZ @ 12 NONAME ; class CSIPProfile * CSIPProfileRegistryBase::DefaultProfileL(void) + ?ProfilesL@CSIPProfileRegistryBase@@QAEXABVTDesC8@@AAV?$RPointerArray@VCSIPProfile@@@@@Z @ 13 NONAME ; void CSIPProfileRegistryBase::ProfilesL(class TDesC8 const &, class RPointerArray &) + ?NewL@CSIP@@SAPAV1@ABVTUid@@AAVMSIPObserver@@@Z @ 14 NONAME ; class CSIP * CSIP::NewL(class TUid const &, class MSIPObserver &) + ??1CWPAdapter@@UAE@XZ @ 15 NONAME ; CWPAdapter::~CWPAdapter(void) + ?Create@CRepository@@QAEHKH@Z @ 16 NONAME ; int CRepository::Create(unsigned long, int) + ?GetParameter@CSIPProfile@@QBEHKAAPBVTDesC8@@@Z @ 17 NONAME ; int CSIPProfile::GetParameter(unsigned long, class TDesC8 const * &) const + ??1CSIPProfileRegistry@@UAE@XZ @ 18 NONAME ; CSIPProfileRegistry::~CSIPProfileRegistry(void) + ?SetNameL@CWPParameter@@QAEXABVTDesC16@@@Z @ 19 NONAME ; void CWPParameter::SetNameL(class TDesC16 const &) + ?GetParameter@CSIPProfile@@QBEHKAAPBVMDesC8Array@@@Z @ 20 NONAME ; int CSIPProfile::GetParameter(unsigned long, class MDesC8Array const * &) const + ?NewL@CSIPProfileRegistry@@SAPAV1@AAVCSIP@@AAVMSIPProfileRegistryObserver@@@Z @ 21 NONAME ; class CSIPProfileRegistry * CSIPProfileRegistry::NewL(class CSIP &, class MSIPProfileRegistryObserver &) + ?NewL@CRepository@@SAPAV1@VTUid@@@Z @ 22 NONAME ; class CRepository * CRepository::NewL(class TUid) + ?SetParameter@CSIPManagedProfile@@QAEHKABVMDesC8Array@@@Z @ 23 NONAME ; int CSIPManagedProfile::SetParameter(unsigned long, class MDesC8Array const &) + ?Get@CRepository@@QAEHKAAH@Z @ 24 NONAME ; int CRepository::Get(unsigned long, int &) + ?SupportedSecurityMechanismsL@CSIP@@QBEPAVCDesC8Array@@XZ @ 25 NONAME ; class CDesC8Array * CSIP::SupportedSecurityMechanismsL(void) const + ?ProfilesL@CSIPProfileRegistryBase@@QAEXABVTSIPProfileTypeInfo@@AAV?$RPointerArray@VCSIPProfile@@@@@Z @ 26 NONAME ; void CSIPProfileRegistryBase::ProfilesL(class TSIPProfileTypeInfo const &, class RPointerArray &) + ?Type@CSIPProfile@@QBEABVTSIPProfileTypeInfo@@XZ @ 27 NONAME ; class TSIPProfileTypeInfo const & CSIPProfile::Type(void) const + ?NegotiatedSecurityMechanismL@CSIP@@QAEPAVHBufC8@@ABVTDesC8@@@Z @ 28 NONAME ; class HBufC8 * CSIP::NegotiatedSecurityMechanismL(class TDesC8 const &) + ?GetParameter@CSIPProfile@@QBEHKAAK@Z @ 29 NONAME ; int CSIPProfile::GetParameter(unsigned long, unsigned long &) const + ?SaveL@CSIPManagedProfileRegistry@@QAEXAAVCSIPProfile@@@Z @ 30 NONAME ; void CSIPManagedProfileRegistry::SaveL(class CSIPProfile &) + ?Set@CRepository@@QAEHKH@Z @ 31 NONAME ; int CRepository::Set(unsigned long, int) + ??1CSIP@@UAE@XZ @ 32 NONAME ; CSIP::~CSIP(void) + ??1CSIPManagedProfile@@UAE@XZ @ 33 NONAME ; CSIPManagedProfile::~CSIPManagedProfile(void) + ?Get@CRepository@@QAEHKAAVTDes16@@@Z @ 34 NONAME ; int CRepository::Get(unsigned long, class TDes16 &) + ?SetValueL@CWPParameter@@QAEXABVTDesC16@@@Z @ 35 NONAME ; void CWPParameter::SetValueL(class TDesC16 const &) + ?FindL@CRepository@@QAEHKKAAV?$RArray@K@@@Z @ 36 NONAME ; int CRepository::FindL(unsigned long, unsigned long, class RArray &) + ?NewLC@CSIPProfileRegistry@@SAPAV1@AAVCSIP@@AAVMSIPProfileRegistryObserver@@@Z @ 37 NONAME ; class CSIPProfileRegistry * CSIPProfileRegistry::NewLC(class CSIP &, class MSIPProfileRegistryObserver &) + ?NewL@CWPParameter@@SAPAV1@XZ @ 38 NONAME ; class CWPParameter * CWPParameter::NewL(void) + ??1CSIPProfile@@UAE@XZ @ 39 NONAME ; CSIPProfile::~CSIPProfile(void) + ?InsertL@CWPCharacteristic@@QAEXPAVMWPElement@@@Z @ 40 NONAME ; void CWPCharacteristic::InsertL(class MWPElement *) + ?IsSigCompSupportedL@CSIP@@QBEHXZ @ 41 NONAME ; int CSIP::IsSigCompSupportedL(void) const + ?NewLC@CSIP@@SAPAV1@ABVTUid@@AAVMSIPObserver@@@Z @ 42 NONAME ; class CSIP * CSIP::NewLC(class TUid const &, class MSIPObserver &) + ?ProfilesL@CSIPProfileRegistryBase@@QAEXAAV?$RPointerArray@VCSIPProfile@@@@@Z @ 43 NONAME ; void CSIPProfileRegistryBase::ProfilesL(class RPointerArray &) + ?NewLC@CWPParameter@@SAPAV1@XZ @ 44 NONAME ; class CWPParameter * CWPParameter::NewLC(void) + ?AcceptL@CWPCharacteristic@@QAEXAAVMWPVisitor@@@Z @ 45 NONAME ; void CWPCharacteristic::AcceptL(class MWPVisitor &) + ?Set@CRepository@@QAEHKABVTDesC16@@@Z @ 46 NONAME ; int CRepository::Set(unsigned long, class TDesC16 const &) + ?SetID@CWPParameter@@QAEXH@Z @ 47 NONAME ; void CWPParameter::SetID(int) + ?EnableL@CSIPProfileRegistry@@QAEXAAVCSIPProfile@@AAVMSIPConnectionObserver@@@Z @ 48 NONAME ; void CSIPProfileRegistry::EnableL(class CSIPProfile &, class MSIPConnectionObserver &) + ?IsEnabled@CSIPProfileRegistry@@QBEHABVCSIPProfile@@@Z @ 49 NONAME ; int CSIPProfileRegistry::IsEnabled(class CSIPProfile const &) const + ??1CSIPManagedProfileRegistry@@UAE@XZ @ 50 NONAME ; CSIPManagedProfileRegistry::~CSIPManagedProfileRegistry(void) + ?GetParameter@CSIPProfile@@QBEHKAAH@Z @ 51 NONAME ; int CSIPProfile::GetParameter(unsigned long, int &) const + ?Value@CWPParameter@@QBEABVTDesC16@@XZ @ 52 NONAME ; class TDesC16 const & CWPParameter::Value(void) const + ?ID@CWPParameter@@QBEHXZ @ 53 NONAME ; int CWPParameter::ID(void) const + ?NewLC@CSIPManagedProfileRegistry@@SAPAV1@AAVMSIPProfileRegistryObserver@@@Z @ 54 NONAME ; class CSIPManagedProfileRegistry * CSIPManagedProfileRegistry::NewLC(class MSIPProfileRegistryObserver &) + ?LastRegistrationError@CSIPProfileRegistryBase@@QBEHABVCSIPProfile@@@Z @ 55 NONAME ; int CSIPProfileRegistryBase::LastRegistrationError(class CSIPProfile const &) const + ?SupportedProfileTypesL@CSIPProfileRegistryBase@@QAEXAAV?$RArray@VTSIPProfileTypeInfo@@@@@Z @ 56 NONAME ; void CSIPProfileRegistryBase::SupportedProfileTypesL(class RArray &) + ?FindEqL@CRepository@@QAEHKKABVTDesC8@@AAV?$RArray@K@@@Z @ 57 NONAME ; int CRepository::FindEqL(unsigned long, unsigned long, class TDesC8 const &, class RArray &) + ?Name@CWPCharacteristic@@QBEABVTDesC16@@XZ @ 58 NONAME ; class TDesC16 const & CWPCharacteristic::Name(void) const + ?Disable@CSIPProfileRegistry@@QAEHAAVCSIPProfile@@@Z @ 59 NONAME ; int CSIPProfileRegistry::Disable(class CSIPProfile &) + ?SIP@CSIPProfileRegistry@@QBEAAVCSIP@@XZ @ 60 NONAME ; class CSIP & CSIPProfileRegistry::SIP(void) const + ?Delete@CRepository@@QAEHKKAAK@Z @ 61 NONAME ; int CRepository::Delete(unsigned long, unsigned long, unsigned long &) + ?CommitTransaction@CRepository@@QAEHAAK@Z @ 62 NONAME ; int CRepository::CommitTransaction(unsigned long &) + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshwpadapterplugin/tsrc/ut_wpadapterplugin/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshwpadapterplugin/tsrc/ut_wpadapterplugin/group/bld.inf Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,20 @@ +/* +* 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: +* +*/ + +PRJ_MMPFILES + +ut_muswpadapter.mmp diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshwpadapterplugin/tsrc/ut_wpadapterplugin/group/ut_muswpadapter.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshwpadapterplugin/tsrc/ut_wpadapterplugin/group/ut_muswpadapter.mmp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,102 @@ +/* +* 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 + +TARGET ut_muswpadapter.dll +TARGETTYPE dll +EPOCALLOWDLLDATA +TARGETPATH /DigiaEUnit/Tests +UID 0x1000af5a 0x10282395 + +CAPABILITY EUNIT_CAPS +VENDORID VID_DEFAULT + +MACRO UNIT_TESTING + +// Test suite classes +SOURCEPATH ../src +SOURCE ut_muswpadapterdllmain.cpp + +// Defines, stubs and other test helpers + +SOURCEPATH ../../../../../tsrc/centralrepositorystub/src +SOURCE centralrepositorystub.cpp + +SOURCEPATH ../../../../../tsrc/provisioningenginestub/src +SOURCE cwpadapterstub.cpp +SOURCE cwpcharacteristicstub.cpp +SOURCE cwpparameterstub.cpp + +SOURCEPATH ../../../../../tsrc/sipprofilestub/src +SOURCE sipmanagedprofileregistrystub.cpp +SOURCE sipprofileregistrystub.cpp +SOURCE sipprofileregistrybasestub.cpp +SOURCE sipmanagedprofilestub.cpp +SOURCE sipprofilestub.cpp +SOURCE sipstub.cpp + +SOURCEPATH ../src +SOURCE muswpadapterstubs.cpp + +// Test classes +SOURCEPATH ../src +SOURCE ut_muswpadapter.cpp +SOURCE ut_muswpitem.cpp + +// Tested classes +SOURCEPATH ../../../src +SOURCE muswpadapter.cpp +SOURCE muswpitem.cpp + +// Includes + +USERINCLUDE ../inc +USERINCLUDE ../../../inc +USERINCLUDE ../../../../../inc +USERINCLUDE ../../../../../tsrc/centralrepositorystub/inc +USERINCLUDE ../../../../../tsrc/sipprofilestub/inc + +// to replace profile with a stub +SYSTEMINCLUDE ../../../../../tsrc/sipprofilestub/inc +// to replace cenrep with a stub +SYSTEMINCLUDE ../../../../../tsrc/centralrepositorystub/inc +// to replace provisioning engine with a stub +SYSTEMINCLUDE ../../../../../tsrc/provisioningenginestub/inc + +APP_LAYER_SYSTEMINCLUDE + +//MUS resources +SOURCEPATH ../../../data +START RESOURCE muswpadapterresource.rss +HEADER +TARGET muswpadapterresource.rsc +TARGETPATH RESOURCE_FILES_DIR +LANGUAGE_IDS +END // MUS resources + +LIBRARY euser.lib +LIBRARY charconv.lib +LIBRARY eunit.lib +LIBRARY bafl.lib + +DEBUGLIBRARY flogger.lib + +//EXPORTUNFROZEN + + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshwpadapterplugin/tsrc/ut_wpadapterplugin/inc/muswpadapterstubs.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshwpadapterplugin/tsrc/ut_wpadapterplugin/inc/muswpadapterstubs.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,57 @@ +/* +* 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: project specification +* +*/ + + +#ifndef __MUSWPADAPTERSTUBS_H__ +#define __MUSWPADAPTERSTUBS_H__ + +#include +#include +#include + +class TPairVisitorStub : public MWPPairVisitor + { +public: + + void VisitPairL(const TDesC16& /*aName*/, const TDesC16& /*aValue*/); + + }; + + + + +_LIT( KMusSummaryTitle, "Video sharing" ); + +/** + * Stub for a class WPAdapterUtil which is located in library ProvisioningEngine + * Stub does not contain all the functions present in original version. + */ +class WPAdapterUtil + { + public: // New functions + + /** + * Stubbed version returns a const value despite of params + */ + static HBufC* ReadHBufCL( const TDesC& aDllPath, + const TDesC& aAdapterName, TInt aResourceId ); + + }; + + + +#endif // __MUSWPADAPTERSTUBS_H__ diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshwpadapterplugin/tsrc/ut_wpadapterplugin/inc/ut_muswpadapter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshwpadapterplugin/tsrc/ut_wpadapterplugin/inc/ut_muswpadapter.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,90 @@ +/* +* 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_MUSWPADAPTER_H__ +#define UT_MUSWPADAPTER_H__ + +// Next row is to disable warning emerging from EUnit code. +// Directive can be removed when EUnit is fixed. +#pragma warn_illtokenpasting off + +// EXTERNAL INCLUDES +#include +#include + +// FORWARD DECLARATIONS +class CMusWpAdapter; + +// CLASS DEFINITION +/** + * Tester class for CMusWpAdapter. + * + */ +NONSHARABLE_CLASS( UT_CMusWpAdapter ): public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static UT_CMusWpAdapter* NewL(); + static UT_CMusWpAdapter* NewLC(); + + /** + * Destructor + */ + ~UT_CMusWpAdapter(); + + private: // Constructors and destructors + + UT_CMusWpAdapter(); + void ConstructL(); + + private: // Test case setup and teardown + + void SetupL(); + + void Teardown(); + + private: // Test methods + + void UT_CMusWpAdapter_NewLL(); + void UT_CMusWpAdapter_ItemCountL(); + void UT_CMusWpAdapter_SummaryTitleL(); + void UT_CMusWpAdapter_SummaryTextL(); + void UT_CMusWpAdapter_SaveLL(); + void UT_CMusWpAdapter_CanSetAsDefaultL(); + void UT_CMusWpAdapter_SetAsDefaultLL(); + void UT_CMusWpAdapter_DetailsLL(); + void UT_CMusWpAdapter_SettingsSavedLL(); + void UT_CMusWpAdapter_SavingFinalizedLL(); + void UT_CMusWpAdapter_VisitCharacteristicLL(); + void UT_CMusWpAdapter_VisitParameterLL(); + void UT_CMusWpAdapter_VisitLinkLL(); + + private: // Data + + CMusWpAdapter* iWpAdapter; + + EUNIT_DECLARE_TEST_TABLE; + + }; + +#endif // UT_MUSWPADAPTER_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshwpadapterplugin/tsrc/ut_wpadapterplugin/inc/ut_muswpitem.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshwpadapterplugin/tsrc/ut_wpadapterplugin/inc/ut_muswpitem.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,89 @@ +/* +* 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_MUSWPITEM_H__ +#define UT_MUSWPITEM_H__ + +// Next row is to disable warning emerging from EUnit code. +// Directive can be removed when EUnit is fixed. +#pragma warn_illtokenpasting off + +// EXTERNAL INCLUDES +#include +#include + +// FORWARD DECLARATIONS +class CMusWpItem; + +// CLASS DEFINITION +/** + * Tester class for CMusWpItem. + * + */ +NONSHARABLE_CLASS( UT_CMusWpItem ): public CEUnitTestSuiteClass + { + public: // Constructors and destructors + + /** + * Two phase construction + */ + static UT_CMusWpItem* NewL(); + static UT_CMusWpItem* NewLC(); + + /** + * Destructor + */ + ~UT_CMusWpItem(); + + private: // Constructors and destructors + + UT_CMusWpItem(); + void ConstructL(); + + private: // Test case setup and teardown + + void SetupL(); + + void Teardown(); + + private: // Test methods + + void UT_CMusWpItem_NewLL(); + void UT_CMusWpItem_ProviderIdL(); + void UT_CMusWpItem_SetProviderIdLL(); + void UT_CMusWpItem_NameL(); + void UT_CMusWpItem_SetNameLL(); + void UT_CMusWpItem_ToAppRefL(); + void UT_CMusWpItem_SetToAppRefLL(); + void UT_CMusWpItem_SetEdgeDtmSupportL(); + void UT_CMusWpItem_SetForceInternetSignalingL(); + void UT_CMusWpItem_SetCapabilityQueryL(); + void UT_CMusWpItem_SetActivationConditionL(); + void UT_CMusWpItem_SaveLL(); + + private: // Data + + CMusWpItem* iWpItem; + + EUNIT_DECLARE_TEST_TABLE; + + }; + +#endif // UT_MUSWPITEM_H__ + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshwpadapterplugin/tsrc/ut_wpadapterplugin/src/muswpadapterstubs.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshwpadapterplugin/tsrc/ut_wpadapterplugin/src/muswpadapterstubs.cpp Thu Jul 22 16:32:26 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: project specification +* +*/ + + + +#include "muswpadapterstubs.h" + +// -------- TPairVisitor ------------------------------------------------------- + +void TPairVisitorStub::VisitPairL( const TDesC16& /*aName*/, + const TDesC16& /*aValue*/) + { + } + + + +// -------- WPAdapterUtil ------------------------------------------------------ + +HBufC* WPAdapterUtil::ReadHBufCL( const TDesC& /*aDllPath*/, + const TDesC& /*aAdapterName*/, + TInt /*aResourceId*/ ) + { + return KMusSummaryTitle().AllocL(); + } \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshwpadapterplugin/tsrc/ut_wpadapterplugin/src/ut_muswpadapter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshwpadapterplugin/tsrc/ut_wpadapterplugin/src/ut_muswpadapter.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,736 @@ +/* +* 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: +* +*/ + + +// INTERNAL INCLUDES +#include "ut_muswpadapter.h" +#include "muswpadapterstubs.h" + +#include "muswpadapter.h" +#include "muswpitem.h" + +// SYSTEM INCLUDES +#include +#include +#include + + + +_LIT( KMusSomeName, "Some name" ); +_LIT( KMusSomeProvider, "SomeProvider" ); +_LIT( KMusSomeToAppRef, "SomeToAppRef" ); +_LIT( KMusOurToAppRef, "OurToAppRef" ); +_LIT( KMusAppID, "w9017" ); +_LIT( KSipAppID, "w9010" ); +_LIT( KMUsWpCharacteristicNameCapability, "CAPABILITY" ); +_LIT( KMUsWpCharacteristicNameActivation, "ACTIVATION" ); +_LIT( KMUsWpCharacteristicNameUnknown, "UNKNOWN" ); +_LIT( KMusWpParamNameEdgeDtm, "EDGEDTM" ); +_LIT( KMusWpParamNameInternetSignaling, "INTERNETSIGNALING" ); +_LIT( KMusWpParamNameQuery, "QUERY" ); +_LIT( KMusWpParamNameCondition, "CONDITION" ); +_LIT( KMusWpParamNameUnknown, "UNKNOWN" ); +_LIT( KMusWpParamValue1, "1" ); +_LIT( KMusWpParamValue2, "2" ); +_LIT( KMusWpParamValue3, "3" ); + +_LIT8( KMusSomeAppID8, "w0000" ); +_LIT8( KSipAppID8, "w9010" ); +_LIT8( KMusSomeStorageIdValue8, "9999" ); +_LIT8( KMusSomeToAppRef8, "SomeToAppRef" ); +_LIT8( KMusOurToAppRef8, "OurToAppRef" ); + +const TUint32 KMusWpNotSet = 0; +const TUint32 KMusSomeStorageIdValueAsTUint = 9999; + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusWpAdapter* UT_CMusWpAdapter::NewL() + { + UT_CMusWpAdapter* self = UT_CMusWpAdapter::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusWpAdapter* UT_CMusWpAdapter::NewLC() + { + UT_CMusWpAdapter* self = new( ELeave ) UT_CMusWpAdapter(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusWpAdapter::~UT_CMusWpAdapter() + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// Default constructor +// ----------------------------------------------------------------------------- +// +UT_CMusWpAdapter::UT_CMusWpAdapter() + :iWpAdapter( NULL ) + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// Second phase construct +// ----------------------------------------------------------------------------- +// +void UT_CMusWpAdapter::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusWpAdapter::SetupL() + { + iWpAdapter = CMusWpAdapter::NewL(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusWpAdapter::Teardown() + { + delete iWpAdapter; + } + + + +// TEST CASES + + + + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusWpAdapter::UT_CMusWpAdapter_NewLL() + { + EUNIT_ASSERT( iWpAdapter ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusWpAdapter::UT_CMusWpAdapter_ItemCountL() + { + EUNIT_ASSERT( iWpAdapter->ItemCount() == 0 ) + + iWpAdapter->iWpItem = CMusWpItem::NewL(); + + EUNIT_ASSERT( iWpAdapter->ItemCount() == 1 ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusWpAdapter::UT_CMusWpAdapter_SummaryTitleL() + { + EUNIT_ASSERT( iWpAdapter->SummaryTitle( 0 ) == KMusSummaryTitle ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusWpAdapter::UT_CMusWpAdapter_SummaryTextL() + { + // Try to get text when no settings received, default returned + EUNIT_ASSERT( !iWpAdapter->iWpItem ) + EUNIT_ASSERT( iWpAdapter->SummaryText( 0 ) == KMusSummaryTitle ) + + // Try to get text when name received, name returned + iWpAdapter->iWpItem = CMusWpItem::NewL(); + iWpAdapter->iWpItem->iName = KMusSomeName().AllocL(); + + EUNIT_ASSERT( iWpAdapter->SummaryText( 0 ) == KMusSomeName() ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusWpAdapter::UT_CMusWpAdapter_SaveLL() + { + // dummy, we cannot assert anything + iWpAdapter->SaveL( 0 ); + iWpAdapter->iWpItem = CMusWpItem::NewL(); + iWpAdapter->SaveL( 0 ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusWpAdapter::UT_CMusWpAdapter_CanSetAsDefaultL() + { + EUNIT_ASSERT( iWpAdapter->CanSetAsDefault( 0 ) == EFalse ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusWpAdapter::UT_CMusWpAdapter_SetAsDefaultLL() + { + TRAPD( error, iWpAdapter->SetAsDefaultL( 0 ) ) + EUNIT_ASSERT( error == KErrNotSupported ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusWpAdapter::UT_CMusWpAdapter_DetailsLL() + { + TPairVisitorStub visitor; + + EUNIT_ASSERT( iWpAdapter->DetailsL( 0, visitor ) == KErrNotSupported ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusWpAdapter::UT_CMusWpAdapter_SettingsSavedLL() + { + // Try to tell that some other adapter than SIPAdapter has saved something, + // do nothing + + iWpAdapter->SettingsSavedL( KMusSomeAppID8(), + KMusSomeToAppRef8(), + KMusSomeStorageIdValue8() ); + EUNIT_ASSERT( !iWpAdapter->iProfileIdReceived ); + EUNIT_ASSERT( iWpAdapter->iProfileId == KMusWpNotSet ); + + // Try to tell that sip adapter has saved profile for some other app, + // and we have not received any settings, do nothing + iWpAdapter->SettingsSavedL( KSipAppID8(), + KMusSomeToAppRef8(), + KMusSomeStorageIdValue8() ); + EUNIT_ASSERT( !iWpAdapter->iProfileIdReceived ); + EUNIT_ASSERT( iWpAdapter->iProfileId == KMusWpNotSet ); + + // Try to tell that sip adapter has saved profile for some other app, + // and we have also received settings, but not TO-APPREF, do nothing + iWpAdapter->iWpItem = CMusWpItem::NewL(); + + iWpAdapter->SettingsSavedL( KSipAppID8(), + KMusSomeToAppRef8(), + KMusSomeStorageIdValue8() ); + EUNIT_ASSERT( !iWpAdapter->iProfileIdReceived ); + EUNIT_ASSERT( iWpAdapter->iProfileId == KMusWpNotSet ); + + // Try to tell that sip adapter has saved profile for us, prepare to save + iWpAdapter->iWpItem->iToAppRef = KMusOurToAppRef().AllocL(); + + iWpAdapter->SettingsSavedL( KSipAppID8(), + KMusOurToAppRef8(), + KMusSomeStorageIdValue8() ); + EUNIT_ASSERT( iWpAdapter->iProfileIdReceived ); + EUNIT_ASSERT( iWpAdapter->iProfileId == KMusSomeStorageIdValueAsTUint ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusWpAdapter::UT_CMusWpAdapter_SavingFinalizedLL() + { + // dummy, we cannot assert anything + iWpAdapter->SavingFinalizedL(); + iWpAdapter->iProfileIdReceived = ETrue; + iWpAdapter->SavingFinalizedL(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusWpAdapter::UT_CMusWpAdapter_VisitCharacteristicLL() + { + // Try without name and with unknown type, does nothing + CWPCharacteristic* characteristic = CWPCharacteristic::NewLC( -1 ); + iWpAdapter->VisitL( *characteristic ); + CleanupStack::PopAndDestroy( characteristic ); + + // Try with named characteristic outside application-characteristic + characteristic = CWPCharacteristic::NewLC( KWPNamedCharacteristic ); + iWpAdapter->VisitL( *characteristic ); + CleanupStack::PopAndDestroy( characteristic ); + + // Try with application characteristic, but without any id + characteristic = CWPCharacteristic::NewLC( KWPApplication ); + + iWpAdapter->VisitL( *characteristic ); + EUNIT_ASSERT( !iWpAdapter->iAppID ) + EUNIT_ASSERT( !iWpAdapter->iWpItem ) + + CleanupStack::PopAndDestroy( characteristic ); + + // Try with application characteristic, but without our id (w9017) + characteristic = CWPCharacteristic::NewLC( KWPApplication ); + + CWPParameter* param = CWPParameter::NewLC(); + param->SetID( EWPParameterAppID ); + param->SetValueL( KSipAppID() ); + characteristic->InsertL( param ); + CleanupStack::Pop( param ); + + param = CWPParameter::NewLC(); + param->SetID( EWPParameterName ); + param->SetValueL( KMusSomeName() ); + characteristic->InsertL( param ); + CleanupStack::Pop( param ); + + iWpAdapter->VisitL( *characteristic ); + EUNIT_ASSERT( *iWpAdapter->iAppID == KSipAppID() ) + EUNIT_ASSERT( !iWpAdapter->iWpItem ) + + CleanupStack::PopAndDestroy( characteristic ); + + // Try with application, capability, activation and unknown + // characteristic, our id and proper params + characteristic = CWPCharacteristic::NewLC( KWPApplication ); + + param = CWPParameter::NewLC(); + param->SetID( EWPParameterAppID ); + param->SetValueL( KMusAppID() ); + characteristic->InsertL( param ); + CleanupStack::Pop( param ); + + param = CWPParameter::NewLC(); + param->SetID( EWPParameterProviderID ); + param->SetValueL( KMusSomeProvider() ); + characteristic->InsertL( param ); + CleanupStack::Pop( param ); + + param = CWPParameter::NewLC(); + param->SetID( EWPParameterName ); + param->SetValueL( KMusSomeName() ); + characteristic->InsertL( param ); + CleanupStack::Pop( param ); + + param = CWPParameter::NewLC(); + param->SetID( EWPParameterToAppRef ); + param->SetValueL( KMusSomeToAppRef() ); + characteristic->InsertL( param ); + CleanupStack::Pop( param ); + + CWPCharacteristic* capabilityCharacteristic = + CWPCharacteristic::NewLC( KWPNamedCharacteristic ); + capabilityCharacteristic->SetNameL( KMUsWpCharacteristicNameCapability() ); + characteristic->InsertL( capabilityCharacteristic ); + CleanupStack::Pop( capabilityCharacteristic ); + + CWPCharacteristic* activityCharacteristic = + CWPCharacteristic::NewLC( KWPNamedCharacteristic ); + activityCharacteristic->SetNameL( KMUsWpCharacteristicNameActivation() ); + characteristic->InsertL( activityCharacteristic ); + CleanupStack::Pop( activityCharacteristic ); + + CWPCharacteristic* unknownCharacteristic = + CWPCharacteristic::NewLC( KWPNamedCharacteristic ); + unknownCharacteristic->SetNameL( KMUsWpCharacteristicNameUnknown() ); + characteristic->InsertL( unknownCharacteristic ); + CleanupStack::Pop( unknownCharacteristic ); + + iWpAdapter->VisitL( *characteristic ); + EUNIT_ASSERT( *iWpAdapter->iAppID == KMusAppID() ) + EUNIT_ASSERT( iWpAdapter->iWpItem ) + EUNIT_ASSERT( *iWpAdapter->iWpItem->iProviderId == KMusSomeProvider() ) + EUNIT_ASSERT( *iWpAdapter->iWpItem->iName == KMusSomeName() ) + EUNIT_ASSERT( *iWpAdapter->iWpItem->iToAppRef == KMusSomeToAppRef() ) + + CleanupStack::PopAndDestroy( characteristic ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusWpAdapter::UT_CMusWpAdapter_VisitParameterLL() + { + iWpAdapter->iNewWpItem = CMusWpItem::NewL(); + + // Named parameter EDGEDTM + CWPParameter* param = CWPParameter::NewLC(); + param->SetID( EWPNamedParameter ); + param->SetNameL( KMusWpParamNameEdgeDtm() ); + iWpAdapter->VisitL( *param ); + EUNIT_ASSERT( !iWpAdapter->iAppID ) + EUNIT_ASSERT( !iWpAdapter->iNewWpItem->iProviderId ) + EUNIT_ASSERT( !iWpAdapter->iNewWpItem->iName ) + EUNIT_ASSERT( !iWpAdapter->iNewWpItem->iToAppRef ) + EUNIT_ASSERT( iWpAdapter->iNewWpItem->iEdgeDtmSupport == + MusSettingsKeys::EDtmModeAllowed) + EUNIT_ASSERT( iWpAdapter->iNewWpItem->iForceInternetSignaling == + MusSettingsKeys::EFollowProfileConfiguration ) + EUNIT_ASSERT( iWpAdapter->iNewWpItem->iCapabilityQuery == + MusSettingsKeys::ENoOptions ) + // Default value is changed for a while so test is conformed to that + //EUNIT_ASSERT( iWpAdapter->iNewWpItem->iActivationCondition == + // MusSettingsKeys::EActiveInHomeNetworks ) + EUNIT_ASSERT( iWpAdapter->iNewWpItem->iActivationCondition == + MusSettingsKeys::EAlwaysActive ) + CleanupStack::PopAndDestroy( param ); + + // Named parameter INTERNETSIGNALING + param = CWPParameter::NewLC(); + param->SetID( EWPNamedParameter ); + param->SetNameL( KMusWpParamNameInternetSignaling() ); + iWpAdapter->VisitL( *param ); + EUNIT_ASSERT( !iWpAdapter->iAppID ) + EUNIT_ASSERT( !iWpAdapter->iNewWpItem->iProviderId ) + EUNIT_ASSERT( !iWpAdapter->iNewWpItem->iName ) + EUNIT_ASSERT( !iWpAdapter->iNewWpItem->iToAppRef ) + EUNIT_ASSERT( iWpAdapter->iNewWpItem->iEdgeDtmSupport == + MusSettingsKeys::EDtmModeAllowed) + EUNIT_ASSERT( iWpAdapter->iNewWpItem->iForceInternetSignaling == + MusSettingsKeys::EForceInternetSignaling ) + EUNIT_ASSERT( iWpAdapter->iNewWpItem->iCapabilityQuery == + MusSettingsKeys::ENoOptions ) + // Default value is changed for a while so test is conformed to that + //EUNIT_ASSERT( iWpAdapter->iNewWpItem->iActivationCondition == + // MusSettingsKeys::EActiveInHomeNetworks ) + EUNIT_ASSERT( iWpAdapter->iNewWpItem->iActivationCondition == + MusSettingsKeys::EAlwaysActive ) + CleanupStack::PopAndDestroy( param ); + + // Named parameter QUERY + param = CWPParameter::NewLC(); + param->SetID( EWPNamedParameter ); + param->SetNameL( KMusWpParamNameQuery() ); + param->SetValueL( KMusWpParamValue2() ); // Sequential + iWpAdapter->VisitL( *param ); + EUNIT_ASSERT( !iWpAdapter->iAppID ) + EUNIT_ASSERT( !iWpAdapter->iNewWpItem->iProviderId ) + EUNIT_ASSERT( !iWpAdapter->iNewWpItem->iName ) + EUNIT_ASSERT( !iWpAdapter->iNewWpItem->iToAppRef ) + EUNIT_ASSERT( iWpAdapter->iNewWpItem->iEdgeDtmSupport == + MusSettingsKeys::EDtmModeAllowed) + EUNIT_ASSERT( iWpAdapter->iNewWpItem->iForceInternetSignaling == + MusSettingsKeys::EForceInternetSignaling ) + EUNIT_ASSERT( iWpAdapter->iNewWpItem->iCapabilityQuery == + MusSettingsKeys::ESequential ) + // Default value is changed for a while so test is conformed to that + //EUNIT_ASSERT( iWpAdapter->iNewWpItem->iActivationCondition == + // MusSettingsKeys::EActiveInHomeNetworks ) + EUNIT_ASSERT( iWpAdapter->iNewWpItem->iActivationCondition == + MusSettingsKeys::EAlwaysActive ) + CleanupStack::PopAndDestroy( param ); + + // Named parameter CONDITION + param = CWPParameter::NewLC(); + param->SetID( EWPNamedParameter ); + param->SetNameL( KMusWpParamNameCondition() ); + param->SetValueL( KMusWpParamValue3() ); // Never + iWpAdapter->VisitL( *param ); + EUNIT_ASSERT( !iWpAdapter->iAppID ) + EUNIT_ASSERT( !iWpAdapter->iNewWpItem->iProviderId ) + EUNIT_ASSERT( !iWpAdapter->iNewWpItem->iName ) + EUNIT_ASSERT( !iWpAdapter->iNewWpItem->iToAppRef ) + EUNIT_ASSERT( iWpAdapter->iNewWpItem->iEdgeDtmSupport == + MusSettingsKeys::EDtmModeAllowed) + EUNIT_ASSERT( iWpAdapter->iNewWpItem->iForceInternetSignaling == + MusSettingsKeys::EForceInternetSignaling ) + EUNIT_ASSERT( iWpAdapter->iNewWpItem->iCapabilityQuery == + MusSettingsKeys::ESequential ) + EUNIT_ASSERT( iWpAdapter->iNewWpItem->iActivationCondition == + MusSettingsKeys::ENever ) + CleanupStack::PopAndDestroy( param ); + + // Unknown named parameter + param = CWPParameter::NewLC(); + param->SetID( EWPNamedParameter ); + param->SetNameL( KMusWpParamNameUnknown() ); + iWpAdapter->VisitL( *param ); + EUNIT_ASSERT( !iWpAdapter->iAppID ) + EUNIT_ASSERT( !iWpAdapter->iNewWpItem->iProviderId ) + EUNIT_ASSERT( !iWpAdapter->iNewWpItem->iName ) + EUNIT_ASSERT( !iWpAdapter->iNewWpItem->iToAppRef ) + EUNIT_ASSERT( iWpAdapter->iNewWpItem->iEdgeDtmSupport == + MusSettingsKeys::EDtmModeAllowed) + EUNIT_ASSERT( iWpAdapter->iNewWpItem->iForceInternetSignaling == + MusSettingsKeys::EForceInternetSignaling ) + EUNIT_ASSERT( iWpAdapter->iNewWpItem->iCapabilityQuery == + MusSettingsKeys::ESequential ) + EUNIT_ASSERT( iWpAdapter->iNewWpItem->iActivationCondition == + MusSettingsKeys::ENever ) + CleanupStack::PopAndDestroy( param ); + + // Id + param = CWPParameter::NewLC(); + param->SetID( EWPParameterAppID ); + param->SetValueL( KMusAppID() ); + iWpAdapter->VisitL( *param ); + EUNIT_ASSERT( *iWpAdapter->iAppID == KMusAppID() ) + EUNIT_ASSERT( !iWpAdapter->iNewWpItem->iProviderId ) + EUNIT_ASSERT( !iWpAdapter->iNewWpItem->iName ) + EUNIT_ASSERT( !iWpAdapter->iNewWpItem->iToAppRef ) + EUNIT_ASSERT( iWpAdapter->iNewWpItem->iEdgeDtmSupport == + MusSettingsKeys::EDtmModeAllowed) + EUNIT_ASSERT( iWpAdapter->iNewWpItem->iForceInternetSignaling == + MusSettingsKeys::EForceInternetSignaling ) + EUNIT_ASSERT( iWpAdapter->iNewWpItem->iCapabilityQuery == + MusSettingsKeys::ESequential ) + EUNIT_ASSERT( iWpAdapter->iNewWpItem->iActivationCondition == + MusSettingsKeys::ENever ) + CleanupStack::PopAndDestroy( param ); + + // Provider Id + param = CWPParameter::NewLC(); + param->SetID( EWPParameterProviderID ); + param->SetValueL( KMusSomeProvider() ); + iWpAdapter->VisitL( *param ); + EUNIT_ASSERT( *iWpAdapter->iAppID == KMusAppID() ) + EUNIT_ASSERT( *iWpAdapter->iNewWpItem->iProviderId == KMusSomeProvider() ) + EUNIT_ASSERT( !iWpAdapter->iNewWpItem->iName ) + EUNIT_ASSERT( !iWpAdapter->iNewWpItem->iToAppRef ) + EUNIT_ASSERT( iWpAdapter->iNewWpItem->iEdgeDtmSupport == + MusSettingsKeys::EDtmModeAllowed) + EUNIT_ASSERT( iWpAdapter->iNewWpItem->iForceInternetSignaling == + MusSettingsKeys::EForceInternetSignaling ) + EUNIT_ASSERT( iWpAdapter->iNewWpItem->iCapabilityQuery == + MusSettingsKeys::ESequential ) + EUNIT_ASSERT( iWpAdapter->iNewWpItem->iActivationCondition == + MusSettingsKeys::ENever ) + CleanupStack::PopAndDestroy( param ); + + // Name + param = CWPParameter::NewLC(); + param->SetID( EWPParameterName ); + param->SetValueL( KMusSomeName() ); + iWpAdapter->VisitL( *param ); + EUNIT_ASSERT( *iWpAdapter->iAppID == KMusAppID() ) + EUNIT_ASSERT( *iWpAdapter->iNewWpItem->iProviderId == KMusSomeProvider() ) + EUNIT_ASSERT( *iWpAdapter->iNewWpItem->iName == KMusSomeName() ) + EUNIT_ASSERT( !iWpAdapter->iNewWpItem->iToAppRef ) + EUNIT_ASSERT( iWpAdapter->iNewWpItem->iEdgeDtmSupport == + MusSettingsKeys::EDtmModeAllowed) + EUNIT_ASSERT( iWpAdapter->iNewWpItem->iForceInternetSignaling == + MusSettingsKeys::EForceInternetSignaling ) + EUNIT_ASSERT( iWpAdapter->iNewWpItem->iCapabilityQuery == + MusSettingsKeys::ESequential ) + EUNIT_ASSERT( iWpAdapter->iNewWpItem->iActivationCondition == + MusSettingsKeys::ENever ) + CleanupStack::PopAndDestroy( param ); + + // To-AppRef + param = CWPParameter::NewLC(); + param->SetID( EWPParameterToAppRef ); + param->SetValueL( KMusSomeToAppRef() ); + iWpAdapter->VisitL( *param ); + EUNIT_ASSERT( *iWpAdapter->iAppID == KMusAppID() ) + EUNIT_ASSERT( *iWpAdapter->iNewWpItem->iProviderId == KMusSomeProvider() ) + EUNIT_ASSERT( *iWpAdapter->iNewWpItem->iName == KMusSomeName() ) + EUNIT_ASSERT( *iWpAdapter->iNewWpItem->iToAppRef == KMusSomeToAppRef() ) + EUNIT_ASSERT( iWpAdapter->iNewWpItem->iEdgeDtmSupport == + MusSettingsKeys::EDtmModeAllowed) + EUNIT_ASSERT( iWpAdapter->iNewWpItem->iForceInternetSignaling == + MusSettingsKeys::EForceInternetSignaling ) + EUNIT_ASSERT( iWpAdapter->iNewWpItem->iCapabilityQuery == + MusSettingsKeys::ESequential ) + EUNIT_ASSERT( iWpAdapter->iNewWpItem->iActivationCondition == + MusSettingsKeys::ENever ) + CleanupStack::PopAndDestroy( param ); + + // Unknown, maps to default, nothing changes + param = CWPParameter::NewLC(); + param->SetID( EWPLastParameter ); + iWpAdapter->VisitL( *param ); + EUNIT_ASSERT( *iWpAdapter->iAppID == KMusAppID() ) + EUNIT_ASSERT( *iWpAdapter->iNewWpItem->iProviderId == KMusSomeProvider() ) + EUNIT_ASSERT( *iWpAdapter->iNewWpItem->iName == KMusSomeName() ) + EUNIT_ASSERT( *iWpAdapter->iNewWpItem->iToAppRef == KMusSomeToAppRef() ) + EUNIT_ASSERT( iWpAdapter->iNewWpItem->iEdgeDtmSupport == + MusSettingsKeys::EDtmModeAllowed) + EUNIT_ASSERT( iWpAdapter->iNewWpItem->iForceInternetSignaling == + MusSettingsKeys::EForceInternetSignaling ) + EUNIT_ASSERT( iWpAdapter->iNewWpItem->iCapabilityQuery == + MusSettingsKeys::ESequential ) + EUNIT_ASSERT( iWpAdapter->iNewWpItem->iActivationCondition == + MusSettingsKeys::ENever ) + CleanupStack::PopAndDestroy( param ); + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusWpAdapter::UT_CMusWpAdapter_VisitLinkLL() + { + // Dummy case + CWPCharacteristic* characteristic = CWPCharacteristic::NewLC( 0 ); + iWpAdapter->VisitLinkL( *characteristic ); + CleanupStack::PopAndDestroy( characteristic ); + } + + + + + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusWpAdapter, + "UT_CMusWpAdapter", + "UNIT" ) + +EUNIT_TEST( + "NewL - test ", + "CMusWpAdapter", + "NewL", + "FUNCTIONALITY", + SetupL, UT_CMusWpAdapter_NewLL, Teardown) + +EUNIT_TEST( + "ItemCount - test ", + "CMusWpAdapter", + "ItemCount", + "FUNCTIONALITY", + SetupL, UT_CMusWpAdapter_ItemCountL, Teardown) + +EUNIT_TEST( + "SummaryTitle - test ", + "CMusWpAdapter", + "SummaryTitle", + "FUNCTIONALITY", + SetupL, UT_CMusWpAdapter_SummaryTitleL, Teardown) + +EUNIT_TEST( + "SummaryText - test ", + "CMusWpAdapter", + "SummaryText", + "FUNCTIONALITY", + SetupL, UT_CMusWpAdapter_SummaryTextL, Teardown) + +EUNIT_TEST( + "SaveL - test ", + "CMusWpAdapter", + "SaveL", + "FUNCTIONALITY", + SetupL, UT_CMusWpAdapter_SaveLL, Teardown) + +EUNIT_TEST( + "CanSetAsDefault - test ", + "CMusWpAdapter", + "CanSetAsDefault", + "FUNCTIONALITY", + SetupL, UT_CMusWpAdapter_CanSetAsDefaultL, Teardown) + +EUNIT_TEST( + "SetAsDefaultL - test ", + "CMusWpAdapter", + "SetAsDefaultL", + "FUNCTIONALITY", + SetupL, UT_CMusWpAdapter_SetAsDefaultLL, Teardown) + +EUNIT_TEST( + "DetailsL - test ", + "CMusWpAdapter", + "DetailsL", + "FUNCTIONALITY", + SetupL, UT_CMusWpAdapter_DetailsLL, Teardown) + +EUNIT_TEST( + "SettingsSavedL - test ", + "CMusWpAdapter", + "SettingsSavedL", + "FUNCTIONALITY", + SetupL, UT_CMusWpAdapter_SettingsSavedLL, Teardown) + +EUNIT_TEST( + "SavingFinalizedL - test ", + "CMusWpAdapter", + "SavingFinalizedL", + "FUNCTIONALITY", + SetupL, UT_CMusWpAdapter_SavingFinalizedLL, Teardown) + +EUNIT_TEST( + "VisitCharacteristicL - test ", + "CMusWpAdapter", + "VisitCharacteristicL", + "FUNCTIONALITY", + SetupL, UT_CMusWpAdapter_VisitCharacteristicLL, Teardown) + +EUNIT_TEST( + "VisitParameterL - test ", + "CMusWpAdapter", + "VisitParameterL", + "FUNCTIONALITY", + SetupL, UT_CMusWpAdapter_VisitParameterLL, Teardown) + +EUNIT_TEST( + "VisitLinkL - test ", + "CMusWpAdapter", + "VisitLinkL", + "FUNCTIONALITY", + SetupL, UT_CMusWpAdapter_VisitLinkLL, Teardown) + + + + + +EUNIT_END_TEST_TABLE + +// END OF FILE + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshwpadapterplugin/tsrc/ut_wpadapterplugin/src/ut_muswpadapterdllmain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshwpadapterplugin/tsrc/ut_wpadapterplugin/src/ut_muswpadapterdllmain.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,44 @@ +/* +* 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: +* +*/ + +// USER INCLUDES +#include "ut_muswpadapter.h" +#include "ut_muswpitem.h" + +// SYSTEM INCLUDES +#include + + +// ----------------------------------------------------------------------------- +// Test suite factory function. +// ----------------------------------------------------------------------------- +// +EXPORT_C MEUnitTest* CreateTestSuiteL() + { + + CEUnitTestSuite* rootSuite = CEUnitTestSuite::NewLC( _L( "Mush WPAdapterplugin" ) ); + + rootSuite->AddL( UT_CMusWpAdapter::NewLC() ); + CleanupStack::Pop(); + + rootSuite->AddL( UT_CMusWpItem::NewLC() ); + CleanupStack::Pop(); + + CleanupStack::Pop( rootSuite ); + + return rootSuite; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/mmshwpadapterplugin/tsrc/ut_wpadapterplugin/src/ut_muswpitem.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/mmshwpadapterplugin/tsrc/ut_wpadapterplugin/src/ut_muswpitem.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,400 @@ +/* +* 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: +* +*/ + + +// INTERNAL INCLUDES +#include "ut_muswpitem.h" + +#include "muswpitem.h" + +// SYSTEM INCLUDES +#include + +// CONSTANTS +_LIT( KMusSomeName, "Some name" ); +_LIT( KMusSomeProvider, "SomeProvider" ); +_LIT( KMusSomeToAppRef, "SomeToAppRef" ); + +_LIT( KMusWpParamValue0, "0" ); +_LIT( KMusWpParamValue1, "1" ); +_LIT( KMusWpParamValue2, "2" ); +_LIT( KMusWpParamValue3, "3" ); + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusWpItem* UT_CMusWpItem::NewL() + { + UT_CMusWpItem* self = UT_CMusWpItem::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusWpItem* UT_CMusWpItem::NewLC() + { + UT_CMusWpItem* self = new( ELeave ) UT_CMusWpItem(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +UT_CMusWpItem::~UT_CMusWpItem() + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// Default constructor +// ----------------------------------------------------------------------------- +// +UT_CMusWpItem::UT_CMusWpItem() + :iWpItem( NULL ) + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// Second phase construct +// ----------------------------------------------------------------------------- +// +void UT_CMusWpItem::ConstructL() + { + // The ConstructL from the base class CEUnitTestSuiteClass must be called. + // It generates the test case table. + CEUnitTestSuiteClass::ConstructL(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusWpItem::SetupL() + { + iWpItem = CMusWpItem::NewL(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusWpItem::Teardown() + { + delete iWpItem; + } + + + +// TEST CASES + + + + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusWpItem::UT_CMusWpItem_NewLL() + { + EUNIT_ASSERT( iWpItem ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusWpItem::UT_CMusWpItem_ProviderIdL() + { + EUNIT_ASSERT( iWpItem->ProviderId() == KNullDesC() ) + iWpItem->iProviderId = KMusSomeProvider().AllocL(); + EUNIT_ASSERT( iWpItem->ProviderId() == KMusSomeProvider() ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusWpItem::UT_CMusWpItem_SetProviderIdLL() + { + EUNIT_ASSERT( !iWpItem->iProviderId ) + iWpItem->SetProviderIdL( KMusSomeProvider() ); + EUNIT_ASSERT( *iWpItem->iProviderId == KMusSomeProvider() ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusWpItem::UT_CMusWpItem_NameL() + { + EUNIT_ASSERT( iWpItem->Name() == KNullDesC() ) + iWpItem->iName = KMusSomeName().AllocL(); + EUNIT_ASSERT( iWpItem->Name() == KMusSomeName() ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusWpItem::UT_CMusWpItem_SetNameLL() + { + EUNIT_ASSERT( !iWpItem->iName ) + iWpItem->SetNameL( KMusSomeName() ); + EUNIT_ASSERT( *iWpItem->iName == KMusSomeName() ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusWpItem::UT_CMusWpItem_ToAppRefL() + { + EUNIT_ASSERT( iWpItem->ToAppRef() == KNullDesC() ) + iWpItem->iToAppRef = KMusSomeToAppRef().AllocL(); + EUNIT_ASSERT( iWpItem->ToAppRef() == KMusSomeToAppRef() ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusWpItem::UT_CMusWpItem_SetToAppRefLL() + { + EUNIT_ASSERT( !iWpItem->iToAppRef ) + iWpItem->SetToAppRefL( KMusSomeToAppRef() ); + EUNIT_ASSERT( *iWpItem->iToAppRef == KMusSomeToAppRef() ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusWpItem::UT_CMusWpItem_SetEdgeDtmSupportL() + { + EUNIT_ASSERT( iWpItem->iEdgeDtmSupport == + MusSettingsKeys::EDtmModeNotAllowed ) + iWpItem->SetEdgeDtmSupport( ETrue ); + EUNIT_ASSERT( iWpItem->iEdgeDtmSupport == + MusSettingsKeys::EDtmModeAllowed ) + iWpItem->SetEdgeDtmSupport( EFalse ); + EUNIT_ASSERT( iWpItem->iEdgeDtmSupport == + MusSettingsKeys::EDtmModeNotAllowed ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusWpItem::UT_CMusWpItem_SetForceInternetSignalingL() + { + EUNIT_ASSERT( iWpItem->iForceInternetSignaling == + MusSettingsKeys::EFollowProfileConfiguration ) + iWpItem->SetForceInternetSignaling( ETrue ); + EUNIT_ASSERT( iWpItem->iForceInternetSignaling == + MusSettingsKeys::EForceInternetSignaling ) + iWpItem->SetForceInternetSignaling( EFalse ); + EUNIT_ASSERT( iWpItem->iForceInternetSignaling == + MusSettingsKeys::EFollowProfileConfiguration ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusWpItem::UT_CMusWpItem_SetCapabilityQueryL() + { + EUNIT_ASSERT( iWpItem->iCapabilityQuery == + MusSettingsKeys::ENoOptions ) + iWpItem->SetCapabilityQuery( KMusWpParamValue0() ); // Unknown + EUNIT_ASSERT( iWpItem->iCapabilityQuery == + MusSettingsKeys::ENoOptions ) + iWpItem->SetCapabilityQuery( KMusWpParamValue1() ); // Parallel + EUNIT_ASSERT( iWpItem->iCapabilityQuery == + MusSettingsKeys::EParallel ) + iWpItem->SetCapabilityQuery( KMusWpParamValue2() ); // Sequential + EUNIT_ASSERT( iWpItem->iCapabilityQuery == + MusSettingsKeys::ESequential ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusWpItem::UT_CMusWpItem_SetActivationConditionL() + { + // Default value is changed for a while so test is conformed to that + + //EUNIT_ASSERT( iWpItem->iActivationCondition == + // MusSettingsKeys::EActiveInHomeNetworks ) + EUNIT_ASSERT( iWpItem->iActivationCondition == + MusSettingsKeys::EAlwaysActive ) + iWpItem->SetActivationCondition( KMusWpParamValue0() ); // Unknown + //EUNIT_ASSERT( iWpItem->iActivationCondition == + // MusSettingsKeys::EActiveInHomeNetworks ) + EUNIT_ASSERT( iWpItem->iActivationCondition == + MusSettingsKeys::EAlwaysActive ) + iWpItem->SetActivationCondition( KMusWpParamValue1() ); // Always + EUNIT_ASSERT( iWpItem->iActivationCondition == + MusSettingsKeys::EAlwaysActive ) + iWpItem->SetActivationCondition( KMusWpParamValue2() ); // Home + EUNIT_ASSERT( iWpItem->iActivationCondition == + MusSettingsKeys::EActiveInHomeNetworks ) + iWpItem->SetActivationCondition( KMusWpParamValue3() ); // Never + EUNIT_ASSERT( iWpItem->iActivationCondition == + MusSettingsKeys::ENever ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void UT_CMusWpItem::UT_CMusWpItem_SaveLL() + { + // Dummy test + iWpItem->SaveL(); + } + + + + + +// TEST TABLE + +EUNIT_BEGIN_TEST_TABLE( + UT_CMusWpItem, + "UT_CMusWpItem", + "UNIT" ) + +EUNIT_TEST( + "NewL - test ", + "CMusWpItem", + "NewL", + "FUNCTIONALITY", + SetupL, UT_CMusWpItem_NewLL, Teardown) + +EUNIT_TEST( + "ProviderId - test ", + "CMusWpItem", + "ProviderId", + "FUNCTIONALITY", + SetupL, UT_CMusWpItem_ProviderIdL, Teardown) + +EUNIT_TEST( + "SetProviderIdL - test ", + "CMusWpItem", + "SetProviderIdL", + "FUNCTIONALITY", + SetupL, UT_CMusWpItem_SetProviderIdLL, Teardown) + +EUNIT_TEST( + "Name - test ", + "CMusWpItem", + "Name", + "FUNCTIONALITY", + SetupL, UT_CMusWpItem_NameL, Teardown) + +EUNIT_TEST( + "SetNameL - test ", + "CMusWpItem", + "SetNameL", + "FUNCTIONALITY", + SetupL, UT_CMusWpItem_SetNameLL, Teardown) + +EUNIT_TEST( + "ToAppRef - test ", + "CMusWpItem", + "ToAppRef", + "FUNCTIONALITY", + SetupL, UT_CMusWpItem_ToAppRefL, Teardown) + +EUNIT_TEST( + "SetToAppRefL - test ", + "CMusWpItem", + "SetToAppRefL", + "FUNCTIONALITY", + SetupL, UT_CMusWpItem_SetToAppRefLL, Teardown) + +EUNIT_TEST( + "SetEdgeDtmSupport - test ", + "CMusWpItem", + "SetEdgeDtmSupport", + "FUNCTIONALITY", + SetupL, UT_CMusWpItem_SetEdgeDtmSupportL, Teardown) + +EUNIT_TEST( + "SetForceInternetSignaling - test ", + "CMusWpItem", + "SetForceInternetSignaling", + "FUNCTIONALITY", + SetupL, UT_CMusWpItem_SetForceInternetSignalingL, Teardown) + +EUNIT_TEST( + "SetCapabilityQuery - test ", + "CMusWpItem", + "SetCapabilityQuery", + "FUNCTIONALITY", + SetupL, UT_CMusWpItem_SetCapabilityQueryL, Teardown) + +EUNIT_TEST( + "SetActivationCondition - test ", + "CMusWpItem", + "SetActivationCondition", + "FUNCTIONALITY", + SetupL, UT_CMusWpItem_SetActivationConditionL, Teardown) + +EUNIT_TEST( + "SaveL - test ", + "CMusWpItem", + "SaveL", + "FUNCTIONALITY", + SetupL, UT_CMusWpItem_SaveLL, Teardown) + + + + + +EUNIT_END_TEST_TABLE + +// END OF FILE + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 mmshplugins/tsrc/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmshplugins/tsrc/group/bld.inf Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,34 @@ +/* +* 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: project specification +* +*/ + + + + + +PRJ_PLATFORMS +DEFAULT + + +PRJ_EXPORTS + + +PRJ_TESTMMPFILES +#include "../../mmshwpadapterplugin/tsrc/ut_wpadapterplugin/group/bld.inf" +#include "../../mmshaoplugin/tsrc/ut_aoplugin/group/bld.inf" +#include "../../mmshsipcrplugin/tsrc/ut_sipcrplugin/group/bld.inf" +#include "../../mmshaiwplugin/tsrc/ut_aiwplugin/group/bld.inf" +#include "../../mmcctranscoder/tsrc/ut_transcoder/group/bld.inf" diff -r e8be2c2e049d -r 7a2f5f2dfe61 rom/multimediasharing.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/rom/multimediasharing.iby Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,103 @@ +/* +* Copyright (c) 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: +* +*/ + + + +#ifndef __MULTIMEDIASHARING_IBY__ +#define __MULTIMEDIASHARING_IBY__ + + +#if defined(__MULTIMEDIA_SHARING) || defined(__CS_VIDEO_TELEPHONY) + +/*======================================================================== +* Livecomms UI dll for both MUS and VT +* ======================================================================== +*/ +file=ABI_DIR\UREL\livecommsui.dll SHARED_LIB_DIR\livecommsui.dll + +/*======================================================================== +* MUS SIS stub +* ======================================================================== +*/ +data=DATAZ_\system\install\multimediasharing_stub.sis system\install\multimediasharing_stub.sis + +#endif + + +#ifdef __MULTIMEDIA_SHARING + +/*======================================================================== +* MUS UI +* ======================================================================== +*/ + +//file=ABI_DIR\UREL\musui.exe PROGRAMS_DIR\musui.exe +//data=DATAZ_\resource\apps\musui.rsc \resource\apps\musui.rsc +//data=DATAZ_\private\10003a3f\import\apps\musui_reg.rsc \private\10003a3f\import\apps\musui_reg.rsc + + +/*======================================================================== +* MUS General +* ======================================================================== +*/ +//file=ABI_DIR\UREL\musmanagerserver.exe PROGRAMS_DIR\musmanagerserver.exe +//file=ABI_DIR\UREL\musmanagerclient.dll SHARED_LIB_DIR\musmanagerclient.dll +//file=ABI_DIR\UREL\musindicator.dll SHARED_LIB_DIR\musindicator.dll +//data=DATAZ_\private\1028238D\tone.amr private\1028238D\tone.amr +//data=DATAZ_\BITMAP_DIR\musindicatoricons.mif BITMAP_DIR\musindicatoricons.mif +//data=DATAZ_\BITMAP_DIR\musindicatoricons.mbm BITMAP_DIR\musindicatoricons.mbm + +/*======================================================================== +* MUS Ecom Plugins +* ======================================================================== +*/ +//ECOM_PLUGIN(musaoplugin.dll,musaoplugin.rsc) + +//ECOM_PLUGIN(musaiwprovider.dll,musaiwprovider.rsc) +//ECOM_PLUGIN(musavailabilityplugin.dll,musavailabilityplugin.rsc) +//ECOM_PLUGIN(muswpadapter.dll,muswpadapter.rsc) +//ECOM_PLUGIN(mmcctranscoder.dll,10282896.rsc) +//ECOM_PLUGIN(musengineplugin.dll,musengineplugin.rsc) + +// In __VOIP terminals, MuS uses same client resolver plugin as VoIP. +// In all other terminals, a separate resolver plugin is needed +#ifndef __VOIP +//ECOM_PLUGIN(mussipcrplugin.dll,mussipcrplugin.rsc) +#endif + + +/*======================================================================== +* MUS Settings UI +* ======================================================================== +*/ +//ECOM_PLUGIN( mussettingsui.dll,mussettingsui.rsc ) +//data=DATAZ_\BITMAP_DIR\mussettingsplugin.mif BITMAP_DIR\mussettingsplugin.mif + + +/*======================================================================== +* Export backup registration xml file to register multimediasharing settings +* to be securely backedup as part of symbian secure backup restore operation +* here data owner will be musmanager server process but the real data stored +* in centralrepository. Hence central repositary uid should be specified as proxy data owner. +* ======================================================================== +*/ +//data=DATAZ_\private\1028238D\backup_registration.xml private\1028238D\backup_registration.xml + +#endif + + +#endif \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 rom/multimediasharing_stub.SIS Binary file rom/multimediasharing_stub.SIS has changed diff -r e8be2c2e049d -r 7a2f5f2dfe61 rom/multimediasharingresources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/rom/multimediasharingresources.iby Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,67 @@ +/* +* Copyright (c) 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: +* +*/ + + + +#ifndef __MULTIMEDIASHARINGRESOURCES_IBY__ +#define __MULTIMEDIASHARINGRESOURCES_IBY__ + +#if defined(__MULTIMEDIA_SHARING) || defined(__CS_VIDEO_TELEPHONY) +data=DATAZ_\data\others\lcvtview.docml data\others\lcvtview.docml +#endif + +#ifdef __MULTIMEDIA_SHARING + +/*======================================================================== +* MUS UI DOCML +* ======================================================================== +*/ +data=DATAZ_\data\others\lcidleview.docml data\others\lcidleview.docml +data=DATAZ_\data\others\lcreceiveview.docml data\others\lcreceiveview.docml +data=DATAZ_\data\others\lcsendview.docml data\others\lcsendview.docml +data=DATAZ_\data\others\lctwowayview.docml data\others\lctwowayview.docml +data=DATAZ_\data\others\lcreceiveonlyview.docml data\others\lcreceiveonlyview.docml + + +/*======================================================================== +* MUS Settings UI +* ======================================================================== +*/ +//data=DATAZ_\RESOURCE_FILES_DIR\mussettingsuirsc.rsc RESOURCE_FILES_DIR\mussettingsuirsc.rsc + +/*======================================================================== +* MUS wireless provisioning adapter +* ======================================================================== +*/ +//data=DATAZ_\RESOURCE_FILES_DIR\muswpadapterresource.rsc RESOURCE_FILES_DIR\muswpadapterresource.rsc + +/*======================================================================== +* MUS AIW Provider Ecom Plugin +* ======================================================================== +*/ +//data=DATAZ_\RESOURCE_FILES_DIR\musaiwproviderui.rsc RESOURCE_FILES_DIR\musaiwproviderui.rsc + +/*======================================================================== +* MUS Indicator dll +* ======================================================================== +*/ +//data=DATAZ_\RESOURCE_FILES_DIR\musindicator.rsc RESOURCE_FILES_DIR\musindicator.rsc + +#endif + +#endif + diff -r e8be2c2e049d -r 7a2f5f2dfe61 sysdef_1_4_0.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sysdef_1_4_0.dtd Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 sysdef_1_5_1.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sysdef_1_5_1.dtd Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/Apastub/inc/apacmdln.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/Apastub/inc/apacmdln.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,181 @@ +/* +* Copyright (c) 1997-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: +* +*/ + + +#if !defined(__APACMDLN_H__) +#define __APACMDLN_H__ + +#if !defined(__E32BASE_H__) +#include +#endif + +#if !defined(__APADEF_H__) +#include +#endif + +#if !defined(__F32FILE_H__) +#include +#endif + +#if !defined(__S32STRM_H__) +#include +#endif + + +class CApaCommandLine : public CBase +/** Information for launching an application. + +This is often referred to as a command line and contains: + +the name of an application EXE to be launched, + +a document name, + +a command code that defines the way the application is launched + +trailing data; the structure of this depends on the application to be launched. + +The information is held in a buffer implemented by a heap descriptor. + +@publishedAll +@released */ + { +public: + // construction/destruction + IMPORT_C static CApaCommandLine* NewL(); + IMPORT_C static CApaCommandLine* NewLC(); + IMPORT_C ~CApaCommandLine(); + + // Getting/setting the CApaCommandLine to/from process environment-slots + IMPORT_C void SetProcessEnvironmentL(RProcess& aProcess) const; + IMPORT_C static TInt GetCommandLineFromProcessEnvironment(CApaCommandLine*& aCommandLine); + + // Getting/setting the CApaCommandLine to/from a server IPC-message + IMPORT_C void GetIpcArgsLC(TIpcArgs& aIpcArgs) const; + IMPORT_C void ConstructCmdLineFromMessageL(const RMessage2& aMessage); + + // operations on the document name + IMPORT_C void SetDocumentNameL(const TDesC& aDocName); + IMPORT_C TPtrC DocumentName() const; + + // operations on the executable name + IMPORT_C void SetExecutableNameL(const TDesC& aAppName); + IMPORT_C TPtrC ExecutableName() const; + + IMPORT_C void SetOpaqueDataL(const TDesC8& aOpaqueData); + IMPORT_C TPtrC8 OpaqueData() const; + + // operations on the tail end + IMPORT_C void SetTailEndL(const TDesC8& aTailEnd); + IMPORT_C TPtrC8 TailEnd() const; + + // operations on the command + IMPORT_C void SetCommandL(TApaCommand aCommand); + IMPORT_C TApaCommand Command() const; + + // operations on the parent process id + IMPORT_C void SetParentProcessId(TProcessId aProcessId); + IMPORT_C TProcessId ParentProcessId() const; + + // operations on the file passed by handle + IMPORT_C void SetFileByHandleL(const RFile& aFile); + IMPORT_C void GetFileByHandleL(RFile& aFile) const; +public: + + // operations on the server requirement/differentiator number - 0 means no server, non-zero sets the differentiator for the server name + IMPORT_C void SetServerNotRequiredL(); + IMPORT_C void SetServerRequiredL(TUint aServerDifferentiator); + IMPORT_C TUint ServerRequired() const; + + // operations to support starting an application with a specific screen number + IMPORT_C void SetDefaultScreenL(TInt aDefaultScreenNumber); + IMPORT_C TInt DefaultScreen() const; + IMPORT_C TBool IsDefaultScreenSet() const; + + // Operations to support window chaining + IMPORT_C void SetParentWindowGroupID(TInt aParentWindowGroupID); + IMPORT_C TInt ParentWindowGroupID() const; + + // operations to support passing memory-allocation failure settings in to applications + IMPORT_C void SetDebugMemFailL(TInt aDebugMemFail); + IMPORT_C TInt DebugMemFail() const; + + // operations to support the instrumentation (i.e. profiling) of application startup + IMPORT_C void SetAppStartupInstrumentationEventIdBaseL(TInt aEventIdBase); + IMPORT_C TInt AppStartupInstrumentationEventIdBase() const; + + IMPORT_C static TInt EnvironmentSlotForPublicUse(TInt aIndex); + +private: + struct SOption + { + const TDesC* iToken; + TInt* iResult; + TRadix iRadix; + HBufC8* iHBufC8Result; + }; + +private: + CApaCommandLine(); + void SetServerDifferentiatorL(TUint aServerDifferentiator); + void ExternalizeL(RWriteStream& aStream) const; + void InternalizeL(RReadStream& aStream); + HBufC8* StreamableAttributesLC() const; + void GetCommandLineFromProcessEnvironmentL(); + TInt Parse(const TDesC& aCmdLine); + TPtrC StripQuotes(const TDesC& aDes) const; + +private: + enum + { + EEnvironmentSlotUnused=0, + + EEnvironmentSlotMain=1, + EEnvironmentSlotFsSession=2, + EEnvironmentSlotFile=3, + + EFirstEnvironmentSlotForPublicUse=8, + ENumberOfEnvironmentSlotsForPublicUse=4 + }; + + enum + { + EIpcSlotMain=0, + EIpcSlotFsSession=1, + EIpcSlotFile=2 + }; +public: + enum + { + EIpcFirstFreeSlot=3 + }; +private: + HBufC* iDocumentName; + HBufC* iExecutableName; + HBufC8* iOpaqueData; + HBufC8* iTailEnd; + TApaCommand iCommand; + TUint iServerDifferentiator; + TInt iDefaultScreenNumber; + TInt iParentWindowGroupID; + TInt iDebugMemFail; + TInt iAppStartupInstrumentationEventIdBase; + RFile iFile; + TProcessId iParentProcessId; + }; + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/Apastub/inc/apgcli.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/Apastub/inc/apgcli.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,304 @@ +/* +* Copyright (c) 1997-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: +* +*/ + + +#if !defined(__APGCLI_H__) +#define __APGCLI_H__ + +#if !defined(__E32BASE_H__) +#include +#endif +#if !defined(__APMSTD_H__) +#include +#endif +#if !defined(__APMREC_H__) +#include +#endif +#if !defined(__APAID_H__) +#include +#endif +#if !defined(__BADESCA_H__) +#include +#endif +#if !defined(__F32FILE_H__) +#include +#endif + +// classes referenced +class CApaCommandLine; +class CApaMaskedBitmap; +class TApaAppInfo_7_0; +class MArrayFiller; +class RFile; + +class CApaLsSessionExtension; + +class CDataRecognitionResultArrayEntry; +class CApaRegistrationResourceFileWriter; +class CApaLocalisableResourceFileWriter; + +class CDataRecognitionResultArray : public CBase +/** +This class holds the recognition results of a recognized directory. +@publishedAll +@released +*/ + { +public: // exported functions + IMPORT_C CDataRecognitionResultArray(); + IMPORT_C virtual ~CDataRecognitionResultArray(); + IMPORT_C const TFileName& Path() const; + IMPORT_C TUint Count() const; + IMPORT_C void GetDataRecognitionResultL(TDataRecognitionResult& aResult, const TUint aIndex) const; + IMPORT_C void GetFileNameL(TFileName& aFileName, const TUint aIndex) const; +public: // dll internally + TUint InternalizeL(const CBufFlat& aBuffer); + void SetPath(const TFileName& aPath); +private: + TFileName iPath; + RPointerArray iEntries; + }; + + + +//////////////////////////////////// +// RApaLsSession +//////////////////////////////////// + +class RApaLsSession : public RSessionBase +/** A session with the application architecture server. + +The server provides access to a cached list of the applications on the device. + +To use this class, clients first need to connect to the server. + +Then, one of GetAllApps(), GetEmbeddableApps() or GetFilteredApps() needs to be called. +These functions do some initialisation of server data in preparation for returning the +application list (which is owned by the server). + +Then, GetNextApp() is called in a loop. The first time around, it populates the session's +application list and retrieves the first application in the list. Further calls to GetNextApp() +retrieve the remaining applications in the list, until RApaLsSession::ENoMoreAppsInList is +returned. + +The session should be closed when it is no longer needed, before it goes out of scope. + +Various functions in RApaLsSession need to access the application list, and may return +RApaLsSession::EAppListInvalid to indicate that the function was called before the initial +population of the list is complete. If this occurs, you could try again after a short delay. + +This class provides many other functions, for instance launching applications, querying +application-specific information, recognising data. + +@publishedAll +@released */ + { + friend class CApaLsSessionExtension; +public: + enum { + /** A possible return value from GetNextApp(), to indicate that there are no more + applications in the list. */ + ENoMoreAppsInList=1, + /** Indicates that an RApaLsSession member function was called before the session's + application list is fully populated. */ + EAppListInvalid + }; + /** Defines the way an application is launched. */ + enum TLaunchType { + /** Launches a new instance of the application. */ + ELaunchNewApp=1, + /** Launches a new instance of the application if no existing instance of the application + is running. If an instance of the application is already running, then it + is brought to the foreground. */ + ESwitchFiles + }; + +public: + IMPORT_C RApaLsSession(); + // + IMPORT_C void Close(); + IMPORT_C TInt Connect(); + IMPORT_C TVersion Version() const; + // + /*IMPORT_C TInt AppCount(TInt& aCount) const; // returns error + IMPORT_C TInt EmbeddableAppCount(TInt& aCount) const; // returns error + // + IMPORT_C TInt GetAllApps() const; // Call to initialize + IMPORT_C TInt GetAllApps(TInt aScreenMode) const; // Call to initialize + IMPORT_C TInt GetEmbeddableApps() const; // Call to initialize + IMPORT_C TInt GetEmbeddableApps(TInt aScreenMode) const; // Call to initialize + // 7.0s + IMPORT_C TInt GetFilteredApps(const TApaEmbeddabilityFilter& aFilter) const; // Call to initialize + IMPORT_C TInt GetFilteredApps(const TApaEmbeddabilityFilter& aFilter, TInt aScreenMode) const; // Call to initialize + // 8.1 + IMPORT_C TInt GetFilteredApps(TUint aCapabilityAttributeMask, TUint aCapabilityAttributeValue) const; // Call to initialize + IMPORT_C TInt GetFilteredApps(TUint aCapabilityAttributeMask, TUint aCapabilityAttributeValue, TInt aScreenMode) const; // Call to initialize + // 9.0 + IMPORT_C TInt GetServerApps(TUid aServiceUid) const; // Call to initialize + IMPORT_C TInt GetServerApps(TUid aServiceUid, TInt aScreenMode) const; // Call to initialize + // + IMPORT_C TInt GetNextApp(TApaAppInfo& aInfo) const; // call repeatedly, returns err (inc ENoMoreAppsInList,EAppListInvalid) + IMPORT_C TInt GetNextApp(TApaAppInfo& aInfo,TInt aScreenMode) const; // call repeatedly, returns err (inc ENoMoreAppsInList,EAppListInvalid) + // + */ + IMPORT_C TInt GetAppInfo(TApaAppInfo& aInfo,TUid aAppUid) const; + /* + IMPORT_C TInt SetAppShortCaption(const TDesC& aShortCaption, TLanguage aLanguage, TUid aAppUid); + IMPORT_C TInt GetDefaultScreenNumber(TInt& aDefaultScreenNumber, TUid aAppUid) const; +private: + // + // 7.0 Binary compatible replacement functions + IMPORT_C TInt GetNextApp_7_0(TApaAppInfo_7_0& aInfo) const; // call repeatedly, returns err (inc ENoMoreAppsInList,EAppListInvalid) + IMPORT_C TInt GetNextApp_7_0(TApaAppInfo_7_0& aInfo,TInt aScreenMode) const; // call repeatedly, returns err (inc ENoMoreAppsInList,EAppListInvalid) + IMPORT_C TInt GetAppInfo_7_0(TApaAppInfo_7_0& aInfo,TUid aAppUid) const; +public: + IMPORT_C TInt GetAppCapability(TDes8& aCapabilityBuf,TUid aAppUid) const; + */ + IMPORT_C TInt StartApp(const CApaCommandLine& aCommandLine); // This is only recommended for non document based apps + IMPORT_C TInt StartApp(const CApaCommandLine& aCommandLine,TThreadId& aThreadId); + IMPORT_C TInt StartApp(const CApaCommandLine& aCommandLine,TThreadId& aThreadId,TRequestStatus* aRequestStatusForRendezvous); + // + /* + IMPORT_C TInt RecognizeData(const TDesC& aName, const TDesC8& aBuffer, TDataRecognitionResult& aDataType) const; + IMPORT_C TInt RecognizeData(const RFile& aFile, TDataRecognitionResult& aDataType) const; + IMPORT_C TInt RecognizeSpecificData(const TDesC& aName, const TDesC8& aBuffer, const TDataType& aDataType, TBool& aResult) const; + IMPORT_C TInt RecognizeSpecificData(const RFile& aFile, const TDataType& aDataType, TBool& aResult) const; + // + IMPORT_C TInt AppForDataType(const TDataType& aDataType, TUid& aAppUid) const; + IMPORT_C TInt StartDocument(const TDesC& aFileName, TThreadId& aThreadId, TLaunchType aLaunchType=ELaunchNewApp); + IMPORT_C TInt StartDocument(RFile& aFile, TThreadId& aThreadId, TRequestStatus* aRequestStatusForRendezvous=NULL); + IMPORT_C TInt StartDocument(const TDesC& aFileName, const TDataType& aDataType, TThreadId& aThreadId, TLaunchType aLaunchType=ELaunchNewApp); + IMPORT_C TInt StartDocument(RFile& aFile, const TDataType& aDataType, TThreadId& aThreadId, TRequestStatus* aRequestStatusForRendezvous=NULL); + */ + IMPORT_C TInt StartDocument(const TDesC& aFileName, TUid aAppUid, TThreadId& aThreadId, TLaunchType aLaunchType=ELaunchNewApp); + /* + IMPORT_C TInt StartDocument(RFile& aFile, TUid aAppUid, TThreadId& aThreadId, TRequestStatus* aRequestStatusForRendezvous=NULL); + IMPORT_C TInt CreateDocument(const TDesC& aFileName, TUid aAppUid, TThreadId& aThreadId, TLaunchType aLaunchType=ELaunchNewApp); + // + IMPORT_C TInt GetAppIcon(TUid aAppUid, TInt aSize, CApaMaskedBitmap& aAppBitmap) const; + // + IMPORT_C TInt AppForDocument(const TDesC& aFileName, TUid& aAppUid, TDataType& aDataType) const; + IMPORT_C TInt AppForDocument(const RFile& aFile, TUid& aAppUid, TDataType& aDataType) const; + IMPORT_C TInt IsProgram(const TDesC& aFileName, TBool& aProgram) const; + IMPORT_C TInt GetAcceptedConfidence(TInt& aConfidence) const; + IMPORT_C TInt SetAcceptedConfidence(TInt aConfidence); + IMPORT_C TInt GetMaxDataBufSize(TInt& aBufSize) const; + IMPORT_C TInt SetMaxDataBufSize(TInt aBufSize); + IMPORT_C TInt GetPreferredBufSize(TInt& aPreferredBufSize) const; + IMPORT_C TInt GetSupportedDataTypesL(CDataTypeArray& aDataTypes) const; + // + IMPORT_C TInt GetAppIconSizes(TUid aAppUid, CArrayFixFlat& aArrayToFill) const; + IMPORT_C TInt GetAppIcon(TUid aAppUid, TSize aSize, CApaMaskedBitmap& aAppBitmap) const; + // + IMPORT_C TInt GetAppViews(CApaAppViewArray& aAppViews, TUid aAppUid) const; + IMPORT_C TInt GetAppViewIcon(TUid aAppUid, TUid aViewUid, const TSize& aSize, CApaMaskedBitmap& aViewBitmap) const; + IMPORT_C TInt GetAppOwnedFiles(CDesCArray& aAppOwnedFiles, TUid aAppUid) const; + // + IMPORT_C TInt NumberOfOwnDefinedIcons(TUid aAppUid, TInt& aCount) const; + // + IMPORT_C TInt GetAppIcon(TUid aAppUid, HBufC*& aFullFileName) const; + IMPORT_C TInt GetAppViewIcon(TUid aAppUid, TUid aViewUid, HBufC*& aFullFileName) const; + IMPORT_C TInt InsertDataMapping(const TDataType& aDataType, TDataTypePriority aPriority, TUid aUid); + IMPORT_C TInt InsertDataMappingIfHigher(const TDataType& aDataType, TDataTypePriority aPriority, TUid aUid, TBool& aInserted); + IMPORT_C TInt DeleteDataMapping(const TDataType& aDataType); + IMPORT_C TInt InsertDataMapping(const TDataType& aDataType, TDataTypePriority aPriority, + TUid aUid, TUid aServiceUid); + IMPORT_C TInt DeleteDataMapping(const TDataType& aDataType, TUid aServiceUid); + IMPORT_C TInt GetAppByDataType(const TDataType& aDataType, TUid aServiceUid, TUid& aAppUid) const; + +public: + // + IMPORT_C CApaAppServiceInfoArray* GetAppServicesLC(TUid aAppUid) const; + IMPORT_C CApaAppServiceInfoArray* GetServiceImplementationsLC(TUid aServiceUid) const; + IMPORT_C CApaAppServiceInfoArray* GetServiceImplementationsLC(TUid aServiceUid, const TDataType& aDataType) const; + IMPORT_C void GetAppServicesL(TUid aAppUid, CArrayFixFlat& aServiceUids) const; + IMPORT_C CApaAppServiceInfoArray* GetAppServiceOpaqueDataLC(TUid aAppUid, TUid aServiceUid) const; + IMPORT_C TInt AppForDataTypeAndService(const TDataType& aDataType, TUid aServiceUid, TUid& aAppUid) const; + IMPORT_C TInt AppForDocumentAndService(const TDesC& aFileName, TUid aServiceUid, TUid& aAppUid, TDataType& aDataType) const; + IMPORT_C TInt AppForDocumentAndService(const RFile& aFile, TUid aServiceUid, TUid& aAppUid, TDataType& aDataType) const; + IMPORT_C TInt ApplicationLanguage(TUid aAppUid, TLanguage& aLanguage) const; + IMPORT_C void Close(); //lint !e1511 Member hides non-virtual member + + IMPORT_C void RegisterListPopulationCompleteObserver(TRequestStatus& aStatus) const; + IMPORT_C TInt CancelListPopulationCompleteObserver() const; + IMPORT_C TInt MatchesSecurityPolicy(TBool& aMatches, TUid aAppUid, const TSecurityPolicy& aSecurityPolicy) const; + IMPORT_C TInt RecognizeFilesL(const TDesC& aPath, CDataRecognitionResultArray& aResult) const; + IMPORT_C void RecognizeFilesL(const TDesC& aPath, CDataRecognitionResultArray& aResult, TRequestStatus& aStatus); + IMPORT_C TInt RecognizeFilesL(const TDesC& aPath, const TDesC8& aDataType, CDataRecognitionResultArray& aResult) const; + IMPORT_C void RecognizeFilesL(const TDesC& aPath, const TDesC8& aDataType, CDataRecognitionResultArray& aResult, TRequestStatus& aStatus); + IMPORT_C void CancelRecognizeFiles(); + + IMPORT_C void RegisterNonNativeApplicationTypeL(TUid aApplicationType, const TDesC& aNativeExecutable); + IMPORT_C void DeregisterNonNativeApplicationTypeL(TUid aApplicationType); + IMPORT_C void PrepareNonNativeApplicationsUpdatesL(); + IMPORT_C void RegisterNonNativeApplicationL(TUid aApplicationType, const TDriveUnit& aDrive, CApaRegistrationResourceFileWriter& aRegistrationResourceFile, CApaLocalisableResourceFileWriter* aLocalisableResourceFile, const RFile* aIconFile); + IMPORT_C void DeregisterNonNativeApplicationL(TUid aApplication); + IMPORT_C void CommitNonNativeApplicationsUpdatesL(); + IMPORT_C TInt RollbackNonNativeApplicationsUpdates(); + IMPORT_C void NotifyOnDataMappingChange(TRequestStatus& aRequestStatus); + IMPORT_C void CancelNotifyOnDataMappingChange(); + IMPORT_C TInt GetAppType(TUid& aTypeUid, TUid aAppUid) const; + + IMPORT_C TInt ForceRegistration(const RPointerArray& aRegFiles); + +public: + // not for public use + IMPORT_C static void SetFsSessionL(RFs& aFsSession); + IMPORT_C static void ClearFsSession(); + IMPORT_C static RFs* FsSession(); + IMPORT_C void SetNotify(TBool aCompleteImmediatelyIfNoScanImpendingOrInProgress, TRequestStatus& aStatus); + IMPORT_C void CancelNotify(); + +private: // Reserved for future use + IMPORT_C virtual void RApaLsSession_Reserved1(); + IMPORT_C virtual void RApaLsSession_Reserved2(); + +private: + void DoGetAppOwnedFilesL(CDesCArray& aArrayToFill, TUid aAppUid) const; + void DoGetAppViewsL(CApaAppViewArray& aArrayToFill, TUid aAppUid) const; + void DoGetAppIconSizesL(TUid aAppUid, CArrayFixFlat& aArrayToFill) const; + TInt DoAppCount(TInt& aCount,TInt aCommand) const; + void FetchArrayL(MArrayFiller& aArrayFiller,TUid aAppUid, TInt aOpcode, TInt aInitialBufSize) const; + CBufBase* GetServiceBufferLC(TInt aOpcode, TUid aUid1, TUid aUid2=KNullUid) const; + TInt StartAndCreate(TInt aRqst,const TDesC& aFileName, TUid aAppUid, TThreadId& aThreadId, TLaunchType aLaunchType); + CBufBase* GetServiceBufferLC(TInt aOpcode, TUid aUid1, const TDataType& aDataType) const; + TInt ReconnectToServer(TInt aErr,TBool& aTriedOnce) const; + TInt SendReceiveWithReconnect(TInt aFunction,const TIpcArgs& aIpcArgs) const; + TInt TransferAndInternalizeDataL(const TDesC& aPath, const TInt aRequiredBufferSize, CDataRecognitionResultArray& aResult) const; + TInt GetExecutableName(TDes& aNativeExecutableName, TDes& aLogicalExecutableName, HBufC8*& aOpaqueData, TIpcArgs& aIpcArgs, TInt aOpcode) const; + TInt GetOpaqueData(HBufC8*& aOpaqueData, TInt aLengthOfOpaqueData) const; + TInt StartApplicationPassingFileHandle(const TDesC& aNativeExecutableName, const TDesC& aLogicalExecutableName, const TDesC8* aOpaqueData, const RFile& aFile, TThreadId& aThreadId, TRequestStatus* aRequestStatusForRendezvous); + TInt StartApplicationPassingDocumentName(const TDesC& aNativeExecutableName, const TDesC& aLogicalExecutableName, const TDesC8* aOpaqueData, const TDesC& aDocumentName, TThreadId& aThreadId,TApaCommand aCommand, TRequestStatus* aRequestStatusForRendezvous); + void StartApplicationL(const TDesC& aNativeExecutableName, const CApaCommandLine& aCommandLine, TThreadId& aThreadId, TRequestStatus* aRequestStatusForRendezvous); + TInt DoAppForDocumentOptionallySpecifyingService(const TDesC& aFileName, TUid aServiceUid, TUid& aAppUid, TDataType& aDataType, TInt aOpcode) const; + TInt DoAppForDocumentOptionallySpecifyingService(const RFile& aFile, TUid aServiceUid, TUid& aAppUid, TDataType& aDataType, TInt aOpcode) const; + TInt GetBufferFromFile(HBufC8*& aBuffer, const TDesC& aFileName) const; + TInt DoStartApp(const CApaCommandLine& aCommandLine, TThreadId* aThreadId,TRequestStatus* aRequestStatusForRendezvous); + void DoStartAppL(const CApaCommandLine& aCommandLine, TThreadId* aThreadId,TRequestStatus* aRequestStatusForRendezvous); + static void GetThreadIdL(TThreadId& aThreadId, const RProcess& aProcess); + static void DeletePointerToPointerToTAny(TAny* aPointerToPointerToTAny); + static CBufFlat* CreateRegFilesBufferL(const RPointerArray& aRegFiles); + */ +public: // data + //CApaLsSessionExtension* iExtension; // friend! + TBool iConnected; + + }; + + +#endif + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/Apastub/inc/apgtask.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/Apastub/inc/apgtask.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,230 @@ +/* +* Copyright (c) 1997-1999 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#if !defined(__APGTASK_H__) +#define __APGTASK_H__ + +#if !defined(__E32BASE_H__) +#include +#endif + +#include + +class RWsSession; +struct TKeyEvent; + +/** @internalTechnology */ +static const TInt KApaSystemEventsWithPowerMgmtCapabilityStart = 100; +/** @internalTechnology */ +static const TInt KApaSystemEventsWithPowerMgmtCapabilityEnd = 199; + +/** Defines the event types that a TApaTask object can send to its window group. + +The events are sent by TApaTask::SendSystemEvent() and are handled by CEikAppUi::HandleSystemEventL(). + +@publishedAll +@released +@see TApaTask::SendSystemEvent() +@see CEikAppUi +@see CCoeAppUi::HandleSystemEventL() */ +enum TApaSystemEvent + { + /** The task is being closed. */ + EApaSystemEventShutdown=1, + /** Reserved for future use. */ + EApaSystemEventBackupStarting, + /** Reserved for future use. */ + EApaSystemEventBackupComplete, + /** The task is being brought to the foreground. */ + EApaSystemEventBroughtToForeground, + /** Close any tasks including system tasks. + Events in the range @c KApaSystemEventsWithPowerMgmtCapabilityStart to + @c KApaSystemEventsWithPowerMgmtCapabilityEnd requires capability PowerMgmt*/ + EApaSystemEventSecureShutdown = KApaSystemEventsWithPowerMgmtCapabilityStart + }; + +#ifdef _UNICODE +/** +@publishedAll +@released +*/ +#define KUidApaMessageSwitchOpenFile KUidApaMessageSwitchOpenFile16 + +/** +@publishedAll +@released +*/ +#define KUidApaMessageSwitchCreateFile KUidApaMessageSwitchCreateFile16 + +/** +@publishedAll +@released +*/ +#define KUidApaMessageSwitchOpenFileValue KUidApaMessageSwitchOpenFileValue16 + +/** +@publishedAll +@released +*/ +#define KUidApaMessageSwitchCreateFileValue KUidApaMessageSwitchCreateFileValue16 +#else +#define KUidApaMessageSwitchOpenFile KUidApaMessageSwitchOpenFile8 +#define KUidApaMessageSwitchCreateFile KUidApaMessageSwitchCreateFile8 +#define KUidApaMessageSwitchOpenFileValue KUidApaMessageSwitchOpenFileValue8 +#define KUidApaMessageSwitchCreateFileValue KUidApaMessageSwitchCreateFileValue8 +#endif + +/** +@internalComponent +*/ +const TInt KUidApaMessageSwitchOpenFileValue16=0x10003A39; + +/** +@internalComponent +*/ +const TUid KUidApaMessageSwitchOpenFile16={KUidApaMessageSwitchOpenFileValue16}; + +/** +@internalComponent +*/ +const TInt KUidApaMessageSwitchCreateFileValue16=0x10003A3A; + +/** +@internalComponent +*/ +const TUid KUidApaMessageSwitchCreateFile16={KUidApaMessageSwitchCreateFileValue16}; + +class TApaTask +/** Application task. + +A task is a running application. At any one time, for any given application, +there may be zero, one, or more tasks running on a device. + +A task is identified by its association with the running application's window +group. + +An instance of the TApaTaskList class is used to find and access specific +tasks. + +@publishedAll +@released +@see TApaTaskList +@see RWindowGroup +@see RWsSession */ + { +public: + + IMPORT_C TApaTask(RWsSession& aWsSession); + IMPORT_C void SetWgId(TInt aWgId); + IMPORT_C TInt WgId() const; + IMPORT_C TBool Exists(); + IMPORT_C TThreadId ThreadId() const; + IMPORT_C void BringToForeground(); + IMPORT_C void SendToBackground(); + IMPORT_C void EndTask(); + IMPORT_C void KillTask(); + IMPORT_C void SendKey(TInt aKeyCode,TInt aModifiers); + IMPORT_C void SendKey(const TKeyEvent& aKey); + IMPORT_C void SendSystemEvent(TApaSystemEvent aEvent); + IMPORT_C TInt SwitchOpenFile(const TDesC& aFilename); + IMPORT_C TInt SwitchCreateFile(const TDesC& aFilename); + IMPORT_C TInt SendMessage(TUid aUid, const TDesC8& aParams); + +private: + TInt CheckSwitchFile() const; + void SendSystemEvent(TApaSystemEvent aEvent, TEventCode aType); + +public: // Stubbed data + RWsSession& iWsSession; + TInt iWgId; + TInt iTApaTask_Reserved1; + + enum KApaTaskCalledFunction + { + ENone, + EFindApp, + EExists, + EBringToForeground, + ESendToBackground, + EEndTask, + EKillTask + }; + + + + static TBool iApplicationExist; + static TInt iApaTaskCalledFunction; + + + }; + +class TApaTaskList +/** Accesses tasks running on a device. + +Tasks can be identified by document, application specific UID or by caption +name. + +Users of this class can also cycle through a set of tasks running a specific +application, bringing each one, in turn, into the foreground. + +@publishedAll +@released +@see TApaTask */ + { +public: + /** Defines the direction in which tasks are cycled to the foreground. This is used + by the CycleTasks() function. + + @see TApaTaskList::CycleTasks() */ + enum TCycleDirection + { + /** Cycles the task list forwards, i.e. the foreground task is moved to background, + bringing the next foremost task to the foreground. */ + EForwards, + /** Cycles the list backwards, i.e. the task furthest from the foreground is brought + to the foreground, pushing what was the foremost task to the next ordinal + position. */ + EBackwards + }; +public: + IMPORT_C TApaTaskList(RWsSession& aWsSession); + IMPORT_C TApaTask FindApp(const TDesC& aAppName); + IMPORT_C TApaTask FindDoc(const TDesC& aDocName); + IMPORT_C TApaTask FindByPos(TInt aPos); + IMPORT_C TApaTask FindApp(TUid aAppUid); + IMPORT_C TInt CycleTasks(TUid aAppUid,TCycleDirection aDirection=EForwards); + +private: + void FindByPosL(TApaTask& aTask,TInt aPos); +public: + RWsSession& iWsSession; + TInt iTApaTaskList_Reserved1; + + enum KCalledFunction + { + ENone, + EFindApp + }; + + + + static TInt iCalledFunction; + }; + + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/Apastub/src/apacmdln.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/Apastub/src/apacmdln.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,40 @@ +/* +* 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 "apacmdln.h" + + +CApaCommandLine* CApaCommandLine::NewLC() + { + CApaCommandLine* line = new(ELeave ) CApaCommandLine(); + CleanupStack::PushL( line ); + + return line; + } + +CApaCommandLine::CApaCommandLine() + { + + } + +void CApaCommandLine::SetExecutableNameL( const TDesC& ) + { + + } + + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/Apastub/src/apgcli.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/Apastub/src/apgcli.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,73 @@ +/* +* 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 "apgcli.h" + +RApaLsSession::RApaLsSession() + { + iConnected = EFalse; + } + + + void RApaLsSession::Close() + { + iConnected = EFalse; + } + + + TInt RApaLsSession::Connect() + { + iConnected = ETrue; + return KErrNone; + } + + + TVersion RApaLsSession::Version() const + { + return TVersion(); + + } + + + TInt RApaLsSession::GetAppInfo(TApaAppInfo& aInfo,TUid aAppUid) const + { + return KErrNone; + + } + + + TInt RApaLsSession::StartApp(const CApaCommandLine& aCommandLine) + { + return KErrNone; + + }// This is only recommended for non document based apps + + + TInt RApaLsSession::StartApp(const CApaCommandLine& aCommandLine,TThreadId& aThreadId) + { + return KErrNone; + } + + + TInt RApaLsSession::StartApp(const CApaCommandLine& aCommandLine,TThreadId& aThreadId,TRequestStatus* aRequestStatusForRendezvous) + { + return KErrNone; + } + + TInt RApaLsSession::StartDocument( const TDesC& /*aFileName*/, TUid /*aAppUid*/, TThreadId& /*aThreadId*/, TLaunchType /*aLaunchType*/ ) + { + return KErrNone; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/Apastub/src/apgtask.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/Apastub/src/apgtask.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,98 @@ +/* +* 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 "apgtask.h" + + +// ============================================================================= +// Stub variables for TApaTask +// ============================================================================= + +TBool TApaTask::iApplicationExist = EFalse; + +TInt TApaTask::iApaTaskCalledFunction = 0; + + +// ============================================================================= +// Stub functions for TApaTask +// ============================================================================= + +TApaTask::TApaTask(RWsSession& aWsSession) + : iWsSession( aWsSession ) + { + + } + +TBool TApaTask::Exists() + { + iApaTaskCalledFunction = EExists; + return iApplicationExist; + } + + void TApaTask::BringToForeground() + { + iApaTaskCalledFunction = EBringToForeground; + } + void TApaTask::SendToBackground() + { + iApaTaskCalledFunction = ESendToBackground; + } + void TApaTask::EndTask() + { + iApaTaskCalledFunction = EEndTask; + } +void TApaTask::KillTask() + { + iApaTaskCalledFunction = EKillTask; + } + + + + + +// ============================================================================= +// Stub functions for TApaTaskList +// ============================================================================= + +TInt TApaTaskList::iCalledFunction = 0; + + +TApaTaskList::TApaTaskList(RWsSession& aWsSession) + : iWsSession (aWsSession) + { + } + + +TApaTask TApaTaskList::FindApp(const TDesC& /*aAppName*/ ) + { + return TApaTask( iWsSession ); + } + +TApaTask TApaTaskList::FindDoc(const TDesC& /*aDocName*/ ) + { + return TApaTask( iWsSession ); + } + +TApaTask TApaTaskList::FindByPos(TInt /*aPos*/ ) + { + return TApaTask( iWsSession ); + } + +TApaTask TApaTaskList::FindApp(TUid /*aAppUid*/ ) + { + iCalledFunction = EFindApp; + return TApaTask( iWsSession ); + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/CenrepEditor/Src/cenrepeditorapp.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/CenrepEditor/Src/cenrepeditorapp.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,68 @@ +/* +* Copyright (c) 2002-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: +* +*/ + + +// INCLUDE FILES +#include +#include "cenrepeditorapp.h" +#include "cenrepeditordocument.h" + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------- +// CCenrepEditorApp::AppDllUid() +// Returns application UID +// --------------------------------------------------------- +// +TUid CCenrepEditorApp::AppDllUid() const + { + return KUidAiwTestApp; + } + +// --------------------------------------------------------- +// CCenrepEditorApp::CreateDocumentL() +// Creates CCenrepEditorDocument object +// --------------------------------------------------------- +// +CApaDocument* CCenrepEditorApp::CreateDocumentL() + { + return CCenrepEditorDocument::NewL( *this ); + } + +// --------------------------------------------------------- +// CCenrepEditorApp::NewApplication() +// Creates NewApplication +// --------------------------------------------------------- +// +LOCAL_C CApaApplication* NewApplication() + { + return new CCenrepEditorApp; + } + +// --------------------------------------------------------- +// E32Main() +// Main startup entry point +// Returns: KErrNone +// --------------------------------------------------------- +// +GLDEF_C TInt E32Main() + { + return EikStart::RunApplication(NewApplication); + } + +// End of File + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/CenrepEditor/Src/cenrepeditorappui.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/CenrepEditor/Src/cenrepeditorappui.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,228 @@ +/* +* Copyright (c) 2002-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: +* +*/ + + +// INCLUDE FILES +#include "cenrepeditorappui.h" +#include "cenrepeditorview1.h" +#include "cenrepeditorview2.h" +#include "cenrepeditorview3.h" +#include +#include "cenrepeditor.hrh" +#include +#include + +#include +#include + +#include +#include +#include +#include "musmanagercommon.h" +#include + +// ================= MEMBER FUNCTIONS ======================= +// +// ---------------------------------------------------------- +// CCenrepEditorAppUi::ConstructL() +// +// ---------------------------------------------------------- +// +void CCenrepEditorAppUi::ConstructL() + { + BaseConstructL(EAknEnableSkin); + + // Show tabs for main views from resources + CEikStatusPane* sp = StatusPane(); + sp->MakeVisible(ETrue); + // Fetch pointer to the default navi pane control + iNaviPane = (CAknNavigationControlContainer*)sp->ControlL( + TUid::Uid(EEikStatusPaneUidNavi)); + iNaviPane->MakeVisible(ETrue); + + // Tabgroup has been read from resource and it were pushed to the navi pane. + // Get pointer to the navigation decorator with the ResourceDecorator() function. + // Application owns the decorator and it has responsibility to delete the object. + iDecoratedTabGroup = iNaviPane->ResourceDecorator(); + iDecoratedTabGroup->MakeVisible(ETrue); + if (iDecoratedTabGroup) + { + iTabGroup = (CAknTabGroup*) iDecoratedTabGroup->DecoratedControl(); + } + iPhoneResources = CPhoneResources::NewL(); + + CCenrepEditorView1* view1 = new (ELeave) CCenrepEditorView1; + CleanupStack::PushL( view1 ); + view1->ConstructL(); + AddViewL( view1 ); // transfer ownership to CAknViewAppUi + CleanupStack::Pop(); // view1 + + iOtherResources = COtherResources::NewL(); + + CCenrepEditorView2* view2 = new (ELeave) CCenrepEditorView2; + CleanupStack::PushL( view2 ); + view2->ConstructL(); + AddViewL( view2 ); // transfer ownership to CAknViewAppUi + CleanupStack::Pop(); // view1 + + iMusApplication = CMusApplication::NewL(); + CCenrepEditorView3* view3 = new (ELeave) CCenrepEditorView3; + CleanupStack::PushL( view3 ); + view3->ConstructL(); + AddViewL( view3 ); // transfer ownership to CAknViewAppUi + CleanupStack::Pop(); // view1 + SetDefaultViewL(*view1); + iTabGroup->SetActiveTabByIndex( 0); + + + } + +// ---------------------------------------------------- +// CCenrepEditorAppUi::~CCenrepEditorAppUi() +// Destructor +// Frees reserved resources +// ---------------------------------------------------- +// +CCenrepEditorAppUi::~CCenrepEditorAppUi() + { + delete iPhoneResources; + delete iOtherResources; + delete iMusApplication; + delete iDecoratedTabGroup; + + iDecoratedTabGroup=NULL; + iNaviPane=NULL ; // not owned + iTabGroup = NULL ; // not owned + + } + +// ------------------------------------------------------------------------------ +// CCenrepEditorAppUi::DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane) +// This function is called by the EIKON framework just before it displays +// a menu pane. Its default implementation is empty, and by overriding it, +// the application can set the state of menu items dynamically according +// to the state of application data. +// ------------------------------------------------------------------------------ +// +void CCenrepEditorAppUi::DynInitMenuPaneL(TInt /*aResourceId*/, CEikMenuPane* /*aMenuPane*/) + { + + } + +// ---------------------------------------------------- +// CCenrepEditorAppUi::HandleKeyEventL(const TKeyEvent& aKeyEvent, +// TEventCode aType) +// Takes care of key event handling. +// ---------------------------------------------------- +// +TKeyResponse CCenrepEditorAppUi::HandleKeyEventL(const TKeyEvent& aKeyEvent, + TEventCode /*aType*/) + { + if ( iTabGroup == NULL ) + { + return EKeyWasNotConsumed; + } + + TInt active = iTabGroup->ActiveTabIndex(); + + switch ( aKeyEvent.iCode ) + { + case EKeyLeftArrow: + if ( active == 1 ) + { + iTabGroup->SetActiveTabByIndex( 0); + ActivateLocalViewL(KViewId1); + } + else if ( active == 2 ) + { + iTabGroup->SetActiveTabByIndex( 1); + ActivateLocalViewL(KViewId2); + } + break; + case EKeyRightArrow: + if( active == 0 ) + { + iTabGroup->SetActiveTabByIndex( 1 ); + ActivateLocalViewL(KViewId2); + } + else if( active == 1 ) + { + iTabGroup->SetActiveTabByIndex( 2 ); + ActivateLocalViewL(KViewId3); + } + break; + default: + return EKeyWasNotConsumed; + } + + return EKeyWasConsumed; + + } + +// ---------------------------------------------------- +// CCenrepEditorAppUi::HandleCommandL(TInt aCommand) +// Takes care of command handling. +// ---------------------------------------------------- +// +void CCenrepEditorAppUi::HandleCommandL(TInt aCommand) + { + switch ( aCommand ) + { + case EAknSoftKeyExit: // fallthrough + case EEikCmdExit: + { + + Exit(); + break; + } + default: + break; + } + } + +// ---------------------------------------------------- +// CCenrepEditorAppUi::PhoneResouces() +// Takes care of command handling. +// ---------------------------------------------------- +// +CPhoneResources* CCenrepEditorAppUi::PhoneResouces() + { + return iPhoneResources; + } + +// ---------------------------------------------------- +// CCenrepEditorAppUi::OtherResouces() +// Takes care of command handling. +// ---------------------------------------------------- +// +COtherResources* CCenrepEditorAppUi::OtherResouces() + { + return iOtherResources; + } + +// ---------------------------------------------------- +// CCenrepEditorAppUi::MusApplication() +// Takes care of command handling. +// ---------------------------------------------------- +// +CMusApplication* CCenrepEditorAppUi::MusApplication() + { + return iMusApplication; + } + + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/CenrepEditor/Src/cenrepeditordocument.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/CenrepEditor/Src/cenrepeditordocument.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,79 @@ +/* +* Copyright (c) 2002-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: +* +*/ + + +// INCLUDE FILES +#include "cenrepeditordocument.h" +#include "cenrepeditorappui.h" + +// ================= MEMBER FUNCTIONS ======================= + +// ----------------------------------------------------------------------------- +// CCenrepEditorDocument::CCenrepEditorDocument(CEikApplication& aApp) +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CCenrepEditorDocument::CCenrepEditorDocument(CEikApplication& aApp) +: CAknDocument(aApp) + { + } + +// ----------------------------------------------------------------------------- +// CCenrepEditorDocument::~CCenrepEditorDocument() +// Destructor. +// ----------------------------------------------------------------------------- +// +CCenrepEditorDocument::~CCenrepEditorDocument() + { + + } + +// ----------------------------------------------------------------------------- +// CCenrepEditorDocument::ConstructL() +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CCenrepEditorDocument::ConstructL() + { + + } + +// ----------------------------------------------------------------------------- +// CCenrepEditorDocument::NewL(CEikApplication& aApp) +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CCenrepEditorDocument* CCenrepEditorDocument::NewL(CEikApplication& aApp) // CCenrepEditorApp reference + { + CCenrepEditorDocument* self = new (ELeave) CCenrepEditorDocument( aApp ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + return self; + } + +// ---------------------------------------------------- +// CCenrepEditorDocument::CreateAppUiL() +// Constructs CCenrepEditorAppUi. +// ---------------------------------------------------- +// +CEikAppUi* CCenrepEditorDocument::CreateAppUiL() + { + return new (ELeave) CCenrepEditorAppUi; + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/CenrepEditor/Src/cenrepeditorlistbox.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/CenrepEditor/Src/cenrepeditorlistbox.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,99 @@ +/* +* Copyright (c) 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: +* +*/ + + +// INCLUDE FILES +#include "cenrepeditorListbox.h" + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------- +// CPhoneResourcesListbox::CreateSettingItemL( TInt aIdentifier ) +// --------------------------------------------------------- +// +CAknSettingItem* CPhoneResourcesListbox::CreateSettingItemL( TInt aIdentifier ) + { + CAknSettingItem* settingItem = NULL; + + // create a setting item for each setting list resource + switch (aIdentifier) + { + case EPhoneResouceCamera: + settingItem = ConstructByValueL(aIdentifier,iPhoneResources->iCameraAvailability); + break; + case EPhoneResouceKeypad: + settingItem = ConstructByValueL(aIdentifier, iPhoneResources->iKeypadAvailability); + break; + case EPhoneResouceVideoPlayer: + settingItem = ConstructByValueL(aIdentifier, iPhoneResources->iVideoPlayerAvailability); + break; + case EPhoneResouceCameraInformation: + settingItem = ConstructByValueL(aIdentifier, iPhoneResources->iCameraInformation); + break; + case EKodiakPhoneCall: + settingItem = ConstructByValueL(aIdentifier, iPhoneResources->iKodiakPhoneCall); + break; + default: + break; + } + return settingItem; + } + +// ------------------------------------------------------------------ +// CPhoneResourcesListbox::SetData(CPhoneResources* aPhoneResources) +// ------------------------------------------------------------------ +// +void CPhoneResourcesListbox::SetData(CPhoneResources* aPhoneResources) + { + iPhoneResources = aPhoneResources; + } + +// ------------------------------------------------------------------ +// CPhoneResourcesListbox::SizeChanged() +// ------------------------------------------------------------------ +// + +void CPhoneResourcesListbox::SizeChanged() + { + if (ListBox()) + { + ListBox()->SetRect(Rect()); + } + } + +// ------------------------------------------------------------------ +// CPhoneResourcesListbox::ConstructByValueL( aIdentifier, ) +// ------------------------------------------------------------------ +// + +CAknSettingItem* CPhoneResourcesListbox::ConstructByValueL( TInt aIdentifier, + TInt& aVal ) + { + CAknSettingItem* settingItem = NULL ; + if(aVal<0 ) + { + settingItem = new (ELeave) CAknSettingItem( aIdentifier ); + settingItem->SetProtectionState(CAknSettingItem::ESettingItemProtected); + } + else + { + settingItem = new (ELeave) + CAknEnumeratedTextPopupSettingItem(aIdentifier,aVal); + } + return settingItem ; + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/CenrepEditor/Src/cenrepeditorlistbox2.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/CenrepEditor/Src/cenrepeditorlistbox2.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,128 @@ +/* +* 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 + +#include "cenrepeditorListbox2.h" + + +CAknSettingItem* COtherResourcesListbox::CreateSettingItemL( TInt aIdentifier ) + { + CAknSettingItem* settingItem = NULL; + + // create a setting item for each setting list resource + switch (aIdentifier) + { + case EOtherResourceActivation: + settingItem=ConstructByValueL( aIdentifier,iOtherResources->iActivation); + break; + case EOtherResourceOperatorVariant: + settingItem=ConstructByValueL( aIdentifier,iOtherResources->iOperatorVariant); + break; + case EOtherResourceAuditoryNotification: + settingItem=ConstructByValueL( aIdentifier,iOtherResources->iAuditoryNotification); + break; + case EOtherResourcePopupNotification: + settingItem=ConstructByValueL( aIdentifier,iOtherResources->iPopupNotification); + break; + case EOtherResourcePopupNotificationType: + settingItem=ConstructByValueL( aIdentifier,iOtherResources->iPopupNotificationType); + break; + case EOtherResourceEdgeDtmSupport: + settingItem=ConstructByValueL( aIdentifier,iOtherResources->iEdgeDtmSupport); + break; + case EOtherResourceSessionSetupMethod: + settingItem=ConstructByValueL( aIdentifier,iOtherResources->iSessionSetupMethod); + break; + case EOtherResourceAutoRecord: + settingItem=ConstructByValueL( aIdentifier,iOtherResources->iAutoRecord); + break; + case EOtherResourceVideoLocation: + settingItem=new (ELeave) + CAknIntegerEdwinSettingItem(aIdentifier,iOtherResources->iVideoLocation); + break; + case EOtherResourceSipProfileId: + settingItem = new (ELeave) + CAknIntegerEdwinSettingItem(aIdentifier, iOtherResources->iSipProfileId); + break; + case EOtherResourceUiOrientation: + settingItem=ConstructByValueL( aIdentifier,iOtherResources->iUiOrientation); + break; + case EOtherResourceCapabilityQuery: + settingItem=ConstructByValueL( aIdentifier,iOtherResources->iCapabilityQuery); + break; + case EOtherResourceProductModeVariationKey: + settingItem = new (ELeave) + CAknIntegerEdwinSettingItem( aIdentifier, iOtherResources->iProductModeVariation); + break; + case EOtherResourceEncoderConfigurationInfo: + settingItem = new (ELeave) + CAknTextSettingItem( aIdentifier, iOtherResources->iEncoderInfo ); + settingItem->SetSettingPageFlags(CAknTextSettingPage::EZeroLengthAllowed); + + break; + case EOtherResourceEncodingDevice: + settingItem = new (ELeave) + CAknTextSettingItem( aIdentifier, iOtherResources->iEncodingDeviceStr ); + settingItem->SetSettingPageFlags(CAknTextSettingPage::EZeroLengthAllowed); + break; + case EOtherResourceAllowOnlyWithActiveCSCall: + settingItem=ConstructByValueL( aIdentifier,iOtherResources->iOnlyWithActiveCSCall ); + break; + case EOtherResourceAllowOnlyIn3GNetwork: + settingItem=ConstructByValueL( aIdentifier,iOtherResources->iOnlyIn3GNetwork ); + break; + case EOtherResourceCameraUsage: + settingItem=ConstructByValueL( aIdentifier,iOtherResources->iCameraUsage ); + break; + case EOtherResourceVideoDirection: + settingItem=ConstructByValueL( aIdentifier,iOtherResources->iVideoDirection ); + break; + case EOtherResourceVideoBandwidth: + settingItem = new (ELeave) + CAknIntegerEdwinSettingItem( aIdentifier,iOtherResources->iVideoBandwidth ); + break; + case EOtherResourceFastMode: + settingItem = ConstructByValueL( aIdentifier, iOtherResources->iFastMode ); + break; + default: + break; + } + return settingItem; + } + + +void COtherResourcesListbox::SetData(COtherResources* aOtherResources) + { + iOtherResources = aOtherResources; + } + +void COtherResourcesListbox::SizeChanged() + { + if (ListBox()) + { + ListBox()->SetRect(Rect()); + } + } + + +CAknSettingItem* COtherResourcesListbox::ConstructByValueL( + TInt aIdentifier, + TInt& aVal) + { + return new (ELeave) CAknEnumeratedTextPopupSettingItem(aIdentifier,aVal); + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/CenrepEditor/Src/cenrepeditorlistbox3.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/CenrepEditor/Src/cenrepeditorlistbox3.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,77 @@ +/* +* 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 "cenrepeditorListbox3.h" + + +CAknSettingItem* CMusApplicationListbox::CreateSettingItemL( TInt aIdentifier ) + { + CAknSettingItem* settingItem = NULL; + switch (aIdentifier) + { + case EApplicationStartStop: + settingItem = new (ELeave) + CAknEnumeratedTextPopupSettingItem(aIdentifier,iMusApplication->iUseCase); + break; + default: + break; + } + return settingItem; + } + + +void CMusApplicationListbox::SetData(CMusApplication* aMusApplication) + { + iMusApplication = aMusApplication; + } + +void CMusApplicationListbox::SizeChanged() + { + if (ListBox()) + { + ListBox()->SetRect(Rect()); + } + } + +/** + * Handle the "Change" option on the Options menu. This is an + * alternative to the Selection key that forces the settings page + * to come up rather than changing the value in place (if possible). + */ +void CMusApplicationListbox::ChangeSelectedItemL() + { + if ( ListBox()->CurrentItemIndex() >= 0 ) + EditItemL( ListBox()->CurrentItemIndex(), ETrue ); + } + + +TKeyResponse CMusApplicationListbox::OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ) + { + if ( aKeyEvent.iCode == EKeyLeftArrow || aKeyEvent.iCode == EKeyRightArrow ) + { + return EKeyWasNotConsumed; + } + + return CAknSettingItemList::OfferKeyEventL( aKeyEvent, aType ); + } + + +void CMusApplicationListbox::EditItemL ( TInt aIndex, TBool aCalledFromMenu ) + { + CAknSettingItemList::EditItemL( aIndex, aCalledFromMenu ); + } + +//End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/CenrepEditor/Src/cenrepeditormodel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/CenrepEditor/Src/cenrepeditormodel.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,447 @@ +/* +* Copyright (c) 2002-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: +* +*/ + + +// INCLUDE FILES +#include "cenrepeditormodel.h" +#include "musresourceproperties.h" +#include "mussettingskeys.h" +#include +#include +#include +#ifdef _KODIAK_PHONE_CALL +#include +#else +const TUid KPSUidCtsyCallInformation = {0x102029AC}; +const TUint32 KCTsyKodiakPtt = 0x00000003; +enum TPSCTsyKodiakPtt + { + EPSCTsyKodiakPttNotActive, + EPSCTsyKodiakPttActive + }; +#endif + + +// ================= MEMBER FUNCTIONS ======================= + +CPhoneResources* CPhoneResources::NewLC() + { + CPhoneResources* self = new (ELeave) CPhoneResources(); + CleanupStack::PushL(self); + self->ConstructL(); + return self; + } + +CPhoneResources* CPhoneResources::NewL() + { + CPhoneResources* self = CPhoneResources::NewLC(); + CleanupStack::Pop(); + return self; + } + +CPhoneResources::~CPhoneResources() + { + } + +void CPhoneResources::ConstructL() + { + // If a P&S key is not found, set it to KErrNotFound. + // This is why the RProperty::Get return values are not handled below. + iCameraAvailability = KErrNotFound; + RProperty::Get(NMusResourceApi::KCategoryUid, + NMusResourceApi::KCameraAvailability, + iCameraAvailability); + + iKeypadAvailability = KErrNotFound; + RProperty::Get(NMusResourceApi::KCategoryUid, + NMusResourceApi::KKeypadAvailability, + iKeypadAvailability); + + iVideoPlayerAvailability = KErrNotFound; + RProperty::Get(NMusResourceApi::KCategoryUid, + NMusResourceApi::KVideoPlayerAvailability, + iVideoPlayerAvailability ); + + iCameraInformation = KErrNotFound; + RProperty::Get(NMusResourceApi::KCategoryUid, + NMusResourceApi::KCameraInformation, + iCameraInformation ); + + iKodiakPhoneCall = KErrNotFound; + TInt err = RProperty::Get(KPSUidCtsyCallInformation, + KCTsyKodiakPtt, + iKodiakPhoneCall ); + if (err != KErrNone) + { + iKodiakPhoneCall = EPSCTsyKodiakPttNotActive; + RProperty::Define(KPSUidCtsyCallInformation,KCTsyKodiakPtt,EPSCTsyKodiakPttNotActive); + } + } + +void CPhoneResources::SaveL() + { + SetValueL(NMusResourceApi::KCategoryUid, + NMusResourceApi::KCameraAvailability, + iCameraAvailability); + + SetValueL(NMusResourceApi::KCategoryUid, + NMusResourceApi::KKeypadAvailability, + iKeypadAvailability); + + SetValueL(NMusResourceApi::KCategoryUid, + NMusResourceApi::KVideoPlayerAvailability, + iVideoPlayerAvailability); + + SetValueL(NMusResourceApi::KCategoryUid, + NMusResourceApi::KCameraInformation, + iCameraInformation); + + SetValueL(KPSUidCtsyCallInformation, + KCTsyKodiakPtt, + iKodiakPhoneCall); + } + +void CPhoneResources::SetValueL(TUid aCategory, TUint aKey, TInt aValue) + { + // Don't care if the key is not found initially + if (aValue >= 0) + { + User::LeaveIfError(RProperty::Set(aCategory, aKey, aValue)); + } + } + +COtherResources* COtherResources::NewLC() + { + COtherResources* self = new (ELeave) COtherResources(); + CleanupStack::PushL(self); + self->ConstructL(); + return self; + } + +COtherResources* COtherResources::NewL() + { + COtherResources* self = COtherResources::NewLC(); + CleanupStack::Pop(); + return self; + } + +void COtherResources::ConstructL() + { + iRepository = CRepository::NewL(MusSettingsKeys::KRepositoryUid); + + // If a CenRep key is not found, set it to KErrNotFound. + // This is why the CRepository::Get return values are not handled below. + iActivation = KErrNotFound; + iRepository->Get(MusSettingsKeys::KActivation, iActivation); + + iOperatorVariant = KErrNotFound; + iRepository->Get(MusSettingsKeys::KOperatorVariant,iOperatorVariant); + + iAuditoryNotification = KErrNotFound; + iRepository->Get(MusSettingsKeys::KAuditoryNotification, iAuditoryNotification); + + iPopupNotification = KErrNotFound; + iRepository->Get(MusSettingsKeys::KPopupNotification, iPopupNotification); + + iPopupNotificationType = KErrNotFound; + iRepository->Get(MusSettingsKeys::KPopupNotificationType, iPopupNotificationType); + + iEdgeDtmSupport = KErrNotFound; + iRepository->Get(MusSettingsKeys::KEdgeDtmSupport, iEdgeDtmSupport); + + iSessionSetupMethod = KErrNotFound; + iRepository->Get(MusSettingsKeys::KForceInternetSignaling, iSessionSetupMethod); + + iAutoRecord = KErrNotFound; + iRepository->Get(MusSettingsKeys::KAutoRecord, iAutoRecord); + + iVideoLocation = KErrNotFound; + iRepository->Get(MusSettingsKeys::KVideoLocation, iVideoLocation); + + iSipProfileId = KErrNotFound; + iRepository->Get(MusSettingsKeys::KSipProfileId, iSipProfileId); + + iUiOrientation = KErrNotFound; + iRepository->Get(MusSettingsKeys::KUiOrientation, iUiOrientation); + + iCapabilityQuery = KErrNotFound; + iRepository->Get(MusSettingsKeys::KCapabilityQuery, iCapabilityQuery); + + iProductModeVariation = KErrNotFound; + iRepository->Get(MusSettingsKeys::KProductModeVariation, iProductModeVariation); + + iRepository->Get(MusSettingsKeys::KEncoderConfigurationInfo, iEncoderInfo ); + + iEncodingDevice = KErrNotFound; + iRepository->Get(MusSettingsKeys::KEncodingDevice, iEncodingDevice ); + iEncodingDeviceStr.Zero(); + if ( iEncodingDevice >= 0 ) + { + iEncodingDeviceStr.AppendNum(iEncodingDevice, EHex); + } + + iOnlyWithActiveCSCall = KErrNotFound; + iRepository->Get(MusSettingsKeys::KAllowOnlyWithActiveCSCall, iOnlyWithActiveCSCall); + + iOnlyIn3GNetwork = KErrNotFound; + iRepository->Get(MusSettingsKeys::KAllowOnlyIn3GNetwork, iOnlyIn3GNetwork); + + iCameraUsage = KErrNotFound; + iRepository->Get(MusSettingsKeys::KCameraUsage, iCameraUsage); + + iVideoDirection = KErrNotFound; + iRepository->Get(MusSettingsKeys::KVideoDirection, iVideoDirection); + + iVideoBandwidth = KErrNotFound; + iRepository->Get(MusSettingsKeys::KVideoBandwidth, iVideoBandwidth); + + iFastMode = KErrNotFound; + iRepository->Get(MusSettingsKeys::KFastStartupMode, iFastMode); + } + +COtherResources::~COtherResources() + { + delete iRepository; + } + +void COtherResources::SaveL() + { + User::LeaveIfError( + iRepository->StartTransaction(CRepository::EConcurrentReadWriteTransaction)); + iRepository->CleanupCancelTransactionPushL(); + + SetKeyValueL(MusSettingsKeys::KActivation, iActivation); + SetKeyValueL(MusSettingsKeys::KOperatorVariant, iOperatorVariant); + SetKeyValueL(MusSettingsKeys::KAuditoryNotification, iAuditoryNotification); + SetKeyValueL(MusSettingsKeys::KPopupNotification, iPopupNotification); + SetKeyValueL(MusSettingsKeys::KPopupNotificationType, iPopupNotificationType); + SetKeyValueL(MusSettingsKeys::KEdgeDtmSupport, iEdgeDtmSupport); + SetKeyValueL(MusSettingsKeys::KForceInternetSignaling, iSessionSetupMethod); + SetKeyValueL(MusSettingsKeys::KAutoRecord, iAutoRecord); + SetKeyValueL(MusSettingsKeys::KVideoLocation, iVideoLocation); + SetKeyValueL(MusSettingsKeys::KSipProfileId, iSipProfileId); + SetKeyValueL(MusSettingsKeys::KUiOrientation, iUiOrientation); + SetKeyValueL(MusSettingsKeys::KCapabilityQuery, iCapabilityQuery); + SetKeyValueL(MusSettingsKeys::KProductModeVariation, iProductModeVariation); + User::LeaveIfError( + iRepository->Set(MusSettingsKeys::KEncoderConfigurationInfo, iEncoderInfo)); + TLex lex( iEncodingDeviceStr ); + TUint tmpUid; + lex.SkipSpace(); + if ( lex.Val(tmpUid, EHex) == KErrNone ) + { + iEncodingDevice = tmpUid; + } + else + { + iEncodingDevice = KErrNotFound; + } + SetKeyValueL(MusSettingsKeys::KEncodingDevice, iEncodingDevice); + SetKeyValueL(MusSettingsKeys::KAllowOnlyWithActiveCSCall, iOnlyWithActiveCSCall); + SetKeyValueL(MusSettingsKeys::KAllowOnlyIn3GNetwork, iOnlyIn3GNetwork); + SetKeyValueL(MusSettingsKeys::KCameraUsage, iCameraUsage); + SetKeyValueL(MusSettingsKeys::KVideoDirection, iVideoDirection); + SetKeyValueL(MusSettingsKeys::KVideoBandwidth, iVideoBandwidth); + SetKeyValueL(MusSettingsKeys::KFastStartupMode, iFastMode); + + TUint32 modifiedKeyCount(0); + User::LeaveIfError(iRepository->CommitTransaction(modifiedKeyCount)); + CleanupStack::Pop(); // transaction + } + +void COtherResources::SetKeyValueL( + const TUint32& aKey, + TInt& aVal) + { + TBool keyExistsInRepository(EFalse); + TInt tmpVal(0); + keyExistsInRepository = (iRepository->Get(aKey,tmpVal) == KErrNone); + if (aVal < 0) + { + if (keyExistsInRepository) + { + User::LeaveIfError(iRepository->Delete(aKey)); + } + } + else + { + if (keyExistsInRepository) + { + User::LeaveIfError(iRepository->Set(aKey,aVal)); + } + else + { + User::LeaveIfError(iRepository->Create(aKey,aVal)); + } + } + } + +CMusApplication* CMusApplication::NewLC() + { + CMusApplication* self = new (ELeave) CMusApplication(); + CleanupStack::PushL(self); + self->ConstructL(); + return self; + } + +CMusApplication* CMusApplication::NewL() + { + CMusApplication* self = CMusApplication::NewLC(); + CleanupStack::Pop(); + return self; + } + +void CMusApplication::ConstructL() + { + iUseCase = MultimediaSharing::EMusLiveVideo; + iMultimediasharing=CMusManager::NewL(); + iMultimediasharing->ExamineAvailabilityL(); + } + +CMusApplication::~CMusApplication() + { + delete iMultimediasharing; + iMultimediasharing=NULL; + } + +void CMusApplication::HandleError(TInt aError , TPtrC aVal ) + { + CAknErrorNote *dlg = new CAknErrorNote(ETrue); + TBuf<100> buf; + buf.Append(aVal); + buf.Append(_L(" Error ")); + buf.AppendNum(aError); + dlg->ExecuteLD(buf); + } + +TBool CMusApplication::Start(TInt aUseCase) + { + TRAPD(err,iMultimediasharing->StartApplicationL( + MultimediaSharing::TMusUseCase(aUseCase))); + if(err)HandleError(err,_L("MusStart ")); + return (err)?EFalse :ETrue; + } + +TBool CMusApplication::Stop() + { + TRAPD(err,iMultimediasharing->StopApplicationL()); + if(err)HandleError(err,_L("MusStop ")); + return (err)?EFalse :ETrue; + } + +TInt CMusApplication::Availability() + { + TInt status=-1; + TRAPD(err,status=iMultimediasharing->AvailabilityL()); + if(err)HandleError(err,_L("MusAvailability ")); + return status; + } +TInt CMusApplication::MonitorAvailability() + { + return KErrGeneral; + } + +TBool CMusApplication::AvailabilityInfo() + { + TBuf<100> buf(_L("Availability Info: ")); + TBool available = EFalse ; + switch(Availability()) + { + case MultimediaSharing::ESipRegistrationPending: + buf.Append(_L("SipRegistrationPending ")); + break; + + case MultimediaSharing::ESipOptionsSent: + buf.Append(_L("SipOptionsSent ")); + available = ETrue ; + break; + + case MultimediaSharing::ESipOptionsNotCapable: + buf.Append(_L("SipOptionsNotCapable ")); + available = ETrue ; + break; + + case MultimediaSharing::ESipOptionsNotSent: + buf.Append(_L("SipOptionsNotSent ")); + available = ETrue ; + break; + + case MultimediaSharing::EErrSipRegistration: + buf.Append(_L("ErrSipRegistration ")); + break; + + case MultimediaSharing::EErrNoActiveCall: + buf.Append(_L("ErrNoActiveCall ")); + break; + + case MultimediaSharing::EErrCallOnHold: + buf.Append(_L("ErrCallOnHold ")); + break; + + case MultimediaSharing::EErrConferenceCall: + buf.Append(_L("ErrConferenceCall ")); + break; + + case MultimediaSharing::EErrRoaming: + buf.Append(_L("ErrRoaming ")); + break; + + case MultimediaSharing::EErrNetwork: + buf.Append(_L("ErrNetwork ")); + break; + + default: + buf.Append(_L("Error Occured ")); + break; + + } + CAknErrorNote *dlg = new CAknErrorNote(ETrue); + dlg->ExecuteLD(buf); + return available; + } + +void CMusApplication::MusUseCaseInfo(TBool aStart) + { + CAknErrorNote *dlg = new CAknErrorNote(ETrue); + TBuf<50> buf; + switch (iUseCase) + { + case MultimediaSharing::EMusLiveVideo: + buf.Append(_L("MusLiveVideo ")); + break; + case MultimediaSharing::EMusClipVideo: + buf.Append(_L("MusClipVideo ")); + break; + case MultimediaSharing::EMusStillImage: + buf.Append(_L("MusStillImage ")); + break; + case MultimediaSharing::EMusReceive: + buf.Append(_L("MusReceive ")); + break; + case MultimediaSharing::EMusContinue: + buf.Append(_L("MusContinue ")); + break; + default : + buf.Append(_L("Unknown Usecase ")); + break; + } + (aStart) ? buf.Append(_L("Started")) : buf.Append(_L("Stoped")); + dlg->ExecuteLD(buf); + } + +// End of File + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/CenrepEditor/Src/cenrepeditorview1.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/CenrepEditor/Src/cenrepeditorview1.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,161 @@ +/* +* Copyright (c) 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: +* +*/ + +// INCLUDE FILES +#include +#include +#include +#include +#include +#include +#include "cenrepeditorappui.h" +#include "cenrepeditordocument.h" +#include "cenrepeditormodel.h" +#include "cenrepeditorview1.h" +#include "cenrepeditorview1container.h" + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------- +// CCenrepEditorView1::ConstructL(const TRect& aRect) +// EPOC two-phased constructor +// --------------------------------------------------------- +// +void CCenrepEditorView1::ConstructL() + { + BaseConstructL( R_CENREPEDITOR_VIEW1 ); + } + +// --------------------------------------------------------- +// CCenrepEditorView1::~CCenrepEditorView1() +// destructor +// --------------------------------------------------------- +// +CCenrepEditorView1::~CCenrepEditorView1() + { + if ( iContainer ) + { + AppUi()->RemoveFromViewStack( *this, iContainer ); + } + + delete iContainer; + } + +// --------------------------------------------------------- +// TUid CCenrepEditorView1::Id() +// +// --------------------------------------------------------- +// +TUid CCenrepEditorView1::Id() const + { + return KViewId1; + } + +// --------------------------------------------------------- +// CCenrepEditorView1::HandleCommandL(TInt aCommand) +// takes care of view command handling +// --------------------------------------------------------- +// +void CCenrepEditorView1::HandleCommandL(TInt aCommand) + { + + + + + iContainer->StoreSettingsL(); + + CPhoneResources * phoneResources = static_cast(AppUi())->PhoneResouces(); + TRAPD(err,phoneResources->SaveL()); + + TBuf<50> buf; + + if(err) + { + CAknErrorNote *dlg = new CAknErrorNote(ETrue); + buf.Copy(_L("Unable to Save ")); + buf.AppendNum(err); + dlg->ExecuteLD(buf); + } + else + { + CAknInformationNote *dlg = new CAknInformationNote(ETrue); + buf.Copy(_L("Saved")); + dlg->ExecuteLD(buf); + } + + + AppUi()->HandleCommandL( aCommand ); + + } + +// --------------------------------------------------------- +// CCenrepEditorView1::HandleClientRectChange() +// --------------------------------------------------------- +// +void CCenrepEditorView1::HandleClientRectChange() + { + if ( iContainer ) + { + iContainer->SetRect( ClientRect() ); + } + } + +CCenrepEditorView1Container * CCenrepEditorView1::Container() +{ + return iContainer; +} +// --------------------------------------------------------- +// CCenrepEditorView1::DoActivateL(...) +// +// --------------------------------------------------------- +// +void CCenrepEditorView1::DoActivateL( + const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/, + const TDesC8& /*aCustomMessage*/) + { + CCenrepEditorAppUi* appUI= static_cast(iEikonEnv->EikAppUi()); + CPhoneResources* phoneResources=appUI->PhoneResouces(); + if (!iContainer) + { + iContainer = new (ELeave) CCenrepEditorView1Container; + iContainer->SetMopParent(this); + iContainer->ConstructL( ClientRect(),R_PHONE_RESOURCE_DETAILS_SETTINGS_LIST, phoneResources); + AppUi()->AddToViewStackL( *this, iContainer ); + iContainer->MakeVisible( ETrue ); + } + + iContainer->DrawNow(); + } + +// --------------------------------------------------------- +// CCenrepEditorView1::DoDeactivate() +// +// --------------------------------------------------------- +// +void CCenrepEditorView1::DoDeactivate() + { + if ( iContainer ) + { + AppUi()->RemoveFromViewStack( *this, iContainer ); + } + + delete iContainer; + iContainer = NULL; + } + +// End of File + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/CenrepEditor/Src/cenrepeditorview1container.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/CenrepEditor/Src/cenrepeditorview1container.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,150 @@ +/* +* Copyright (c) 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: +* +*/ + + +// INCLUDE FILES +#include "cenrepeditorview1container.h" +#include "cenrepeditordocument.h" +#include "cenrepeditorappui.h" +#include "cenrepeditormodel.h" + + + +#include // for example label control + + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------- +// CCenrepEditorView1Container::ConstructL(const TRect& aRect) +// EPOC two phased constructor +// --------------------------------------------------------- +// +void CCenrepEditorView1Container::ConstructL(const TRect& aRect,TInt aResourceId, CPhoneResources* aPhoneResources) + { + CreateWindowL(); + iPhoneResourceListBox = new(ELeave)CPhoneResourcesListbox; + // and put the data in the list + iPhoneResourceListBox->SetData(aPhoneResources); + // setting list is constructed from resources + iPhoneResourceListBox->ConstructFromResourceL(aResourceId); + SetRect(aRect); + iPhoneResourceListBox->MakeVisible(ETrue); + iPhoneResourceListBox->SetRect(aRect); + iPhoneResourceListBox->LoadSettingsL(); + iPhoneResourceListBox->ActivateL(); + ActivateL(); + } + +// Destructor +CCenrepEditorView1Container::~CCenrepEditorView1Container() + { + iPhoneResourceListBox->StoreSettingsL(); + delete iPhoneResourceListBox; + iPhoneResourceListBox = NULL; + } + +// --------------------------------------------------------- +// CCenrepEditorView1Container::SizeChanged() +// Called by framework when the view size is changed +// --------------------------------------------------------- +// +void CCenrepEditorView1Container::SizeChanged() + { + // TODO: Add here control resize code etc. + iPhoneResourceListBox->SetRect(Rect()); + } + +// --------------------------------------------------------- +// CCenrepEditorView1Container::CountComponentControls() const +// --------------------------------------------------------- +// +TInt CCenrepEditorView1Container::CountComponentControls() const + { + TInt count = 0; + if(iPhoneResourceListBox) + count++; + return count; + } + +// --------------------------------------------------------- +// CCenrepEditorView1Container::ComponentControl(TInt aIndex) const +// --------------------------------------------------------- +// +CCoeControl* CCenrepEditorView1Container::ComponentControl(TInt /*aIndex*/) const + { + return iPhoneResourceListBox; + } + +// --------------------------------------------------------- +// CCenrepEditorView1Container::Draw(const TRect& aRect) const +// --------------------------------------------------------- +// +void CCenrepEditorView1Container::Draw(const TRect& aRect) const + { + CWindowGc& gc = SystemGc(); + gc.SetPenStyle( CGraphicsContext::ENullPen ); + gc.SetBrushColor( KRgbGray ); + gc.SetBrushStyle( CGraphicsContext::ESolidBrush ); + gc.DrawRect( aRect ); + + } + +// --------------------------------------------------------- +// CCenrepEditorView1Container::OfferKeyEventL( +// const TKeyEvent& aKeyEvent, +// TEventCode aType ) +// --------------------------------------------------------- +// +TKeyResponse CCenrepEditorView1Container::OfferKeyEventL( + const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + if(aType != EEventKey) // Is not key event? + { + return EKeyWasNotConsumed; + } + switch (aKeyEvent.iCode) + { + case EKeyLeftArrow: + case EKeyRightArrow: + return EKeyWasNotConsumed; + default: + if(iPhoneResourceListBox) + { + return iPhoneResourceListBox->OfferKeyEventL( aKeyEvent, aType ); + } + else + { + return EKeyWasNotConsumed; + } + + } + } + +// --------------------------------------------------------- +// CCenrepEditorView1Container::StoreSettingsL() +// Store the Settings to Variable +// --------------------------------------------------------- +// +void CCenrepEditorView1Container::StoreSettingsL() + { + iPhoneResourceListBox->StoreSettingsL(); + } + + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/CenrepEditor/Src/cenrepeditorview2.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/CenrepEditor/Src/cenrepeditorview2.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,154 @@ +/* +* Copyright (c) 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: +* +*/ + + +// INCLUDE FILES +#include +#include +#include +#include +#include +#include +#include "cenrepeditorappui.h" +#include "cenrepeditordocument.h" +#include "cenrepeditormodel.h" +#include "cenrepeditorview2.h" +#include "cenrepeditorview2container.h" + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------- +// CCenrepEditorView2::ConstructL(const TRect& aRect) +// EPOC two-phased constructor +// --------------------------------------------------------- +// +void CCenrepEditorView2::ConstructL() + { + BaseConstructL( R_CENREPEDITOR_VIEW1 ); + } + +// --------------------------------------------------------- +// CCenrepEditorView2::~CCenrepEditorView2() +// destructor +// --------------------------------------------------------- +// +CCenrepEditorView2::~CCenrepEditorView2() + { + if ( iContainer ) + { + AppUi()->RemoveFromViewStack( *this, iContainer ); + } + + delete iContainer; + } + +// --------------------------------------------------------- +// TUid CCenrepEditorView2::Id() +// +// --------------------------------------------------------- +// +TUid CCenrepEditorView2::Id() const + { + return KViewId2; + } + +// --------------------------------------------------------- +// CCenrepEditorView2::HandleCommandL(TInt aCommand) +// takes care of view command handling +// --------------------------------------------------------- +// +void CCenrepEditorView2::HandleCommandL(TInt aCommand) + { + + iContainer->StoreSettingsL(); + + COtherResources * otherResources = static_cast(AppUi())->OtherResouces(); + TRAPD(err,otherResources->SaveL()); + + TBuf<50> buf; + + if(err) + { + CAknErrorNote *dlg = new CAknErrorNote(ETrue); + buf.Copy(_L("Unable to Save ")); + buf.AppendNum(err); + dlg->ExecuteLD(buf); + } + else + { + CAknInformationNote *dlg = new CAknInformationNote(ETrue); + buf.Copy(_L("Saved")); + dlg->ExecuteLD(buf); + } + + AppUi()->HandleCommandL( aCommand ); + + } + +// --------------------------------------------------------- +// CCenrepEditorView2::HandleClientRectChange() +// --------------------------------------------------------- +// +void CCenrepEditorView2::HandleClientRectChange() + { + if ( iContainer ) + { + iContainer->SetRect( ClientRect() ); + } + } + +// --------------------------------------------------------- +// CCenrepEditorView2::DoActivateL(...) +// +// --------------------------------------------------------- +// +void CCenrepEditorView2::DoActivateL( + const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/, + const TDesC8& /*aCustomMessage*/) + { + CCenrepEditorAppUi* appUI= static_cast(iEikonEnv->EikAppUi()); + COtherResources* otherResources=appUI->OtherResouces(); + if (!iContainer) + { + iContainer = new (ELeave) CCenrepEditorView2Container; + iContainer->SetMopParent(this); + iContainer->ConstructL( ClientRect(),R_OTHER_RESOURCE_DETAILS_SETTINGS_LIST, otherResources); + AppUi()->AddToViewStackL( *this, iContainer ); + iContainer->MakeVisible( ETrue ); + } + + iContainer->DrawNow(); + } + +// --------------------------------------------------------- +// CCenrepEditorView2::DoDeactivate() +// +// --------------------------------------------------------- +// +void CCenrepEditorView2::DoDeactivate() + { + if ( iContainer ) + { + AppUi()->RemoveFromViewStack( *this, iContainer ); + } + + delete iContainer; + iContainer = NULL; + } + +// End of File + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/CenrepEditor/Src/cenrepeditorview2container.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/CenrepEditor/Src/cenrepeditorview2container.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,147 @@ +/* +* Copyright (c) 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: +* +*/ + + +// INCLUDE FILES +#include "cenrepeditorview2container.h" +#include "cenrepeditordocument.h" +#include "cenrepeditorappui.h" +#include "cenrepeditormodel.h" + + + +#include // for example label control + + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------- +// CCenrepEditorView2Container::ConstructL(const TRect& aRect) +// EPOC two phased constructor +// --------------------------------------------------------- +// +void CCenrepEditorView2Container::ConstructL(const TRect& aRect,TInt aResourceId, COtherResources* aOtherResources) + { + CreateWindowL(); + iOtherResourceListBox = new(ELeave)COtherResourcesListbox; + // and put the data in the list + iOtherResourceListBox->SetData(aOtherResources); + // setting list is constructed from resources + iOtherResourceListBox->ConstructFromResourceL(aResourceId); + SetRect(aRect); + iOtherResourceListBox->MakeVisible(ETrue); + iOtherResourceListBox->SetRect(aRect); + iOtherResourceListBox->LoadSettingsL(); + iOtherResourceListBox->ActivateL(); + ActivateL(); + } + +// Destructor +CCenrepEditorView2Container::~CCenrepEditorView2Container() + { + //don't call StoreSettingsL here!, it'll result in copying data + //to iOtherResources, which was already deleted + //iOtherResourceListBox->StoreSettingsL(); + delete iOtherResourceListBox; + iOtherResourceListBox = NULL; + } + +// --------------------------------------------------------- +// CCenrepEditorView2Container::SizeChanged() +// Called by framework when the view size is changed +// --------------------------------------------------------- +// +void CCenrepEditorView2Container::SizeChanged() + { + // TODO: Add here control resize code etc. + iOtherResourceListBox->SetRect(Rect()); + } + +// --------------------------------------------------------- +// CCenrepEditorView2Container::CountComponentControls() const +// --------------------------------------------------------- +// +TInt CCenrepEditorView2Container::CountComponentControls() const + { + TInt count = 0; + if(iOtherResourceListBox) + count++; + return count; + } + +// --------------------------------------------------------- +// CCenrepEditorView2Container::ComponentControl(TInt aIndex) const +// --------------------------------------------------------- +// +CCoeControl* CCenrepEditorView2Container::ComponentControl(TInt /*aIndex*/) const + { + return iOtherResourceListBox; + } + +// --------------------------------------------------------- +// CCenrepEditorView2Container::Draw(const TRect& aRect) const +// --------------------------------------------------------- +// +void CCenrepEditorView2Container::Draw(const TRect& aRect) const + { + CWindowGc& gc = SystemGc(); + gc.SetPenStyle( CGraphicsContext::ENullPen ); + gc.SetBrushColor( KRgbGray ); + gc.SetBrushStyle( CGraphicsContext::ESolidBrush ); + gc.DrawRect( aRect ); + + } + + +TKeyResponse CCenrepEditorView2Container::OfferKeyEventL( + const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + if(aType != EEventKey) // Is not key event? + { + return EKeyWasNotConsumed; + } + switch (aKeyEvent.iCode) + { + case EKeyLeftArrow: + case EKeyRightArrow: + return EKeyWasNotConsumed; + default: + if(iOtherResourceListBox) + { + return iOtherResourceListBox->OfferKeyEventL( aKeyEvent, aType ); + } + else + { + return EKeyWasNotConsumed; + } + + } + } + +// --------------------------------------------------------- +// CCenrepEditorView2Container::StoreSettingsL() +// Store the Settings to Variable +// --------------------------------------------------------- +// +void CCenrepEditorView2Container::StoreSettingsL() + { + iOtherResourceListBox->StoreSettingsL(); + } + + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/CenrepEditor/Src/cenrepeditorview3.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/CenrepEditor/Src/cenrepeditorview3.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,175 @@ +/* +* Copyright (c) 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: +* +*/ + + +// INCLUDE FILES +#include +#include +#include +#include +#include +#include +#include "cenrepeditorappui.h" +#include "cenrepeditordocument.h" +#include "cenrepeditormodel.h" +#include "cenrepeditorview3.h" +#include "cenrepeditorview3container.h" + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------- +// CCenrepEditorView3::ConstructL(const TRect& aRect) +// EPOC two-phased constructor +// --------------------------------------------------------- +// +void CCenrepEditorView3::ConstructL() + { + BaseConstructL( R_CENREPEDITOR_VIEW3 ); + } + +// --------------------------------------------------------- +// CCenrepEditorView3::~CCenrepEditorView3() +// destructor +// --------------------------------------------------------- +// +CCenrepEditorView3::~CCenrepEditorView3() + { + if ( iContainer ) + { + AppUi()->RemoveFromViewStack( *this, iContainer ); + } + + delete iContainer; + } + +// --------------------------------------------------------- +// TUid CCenrepEditorView3::Id() +// +// --------------------------------------------------------- +// +TUid CCenrepEditorView3::Id() const + { + return KViewId3; + } + +// --------------------------------------------------------- +// CCenrepEditorView3::HandleCommandL(TInt aCommand) +// takes care of view command handling +// --------------------------------------------------------- +// +void CCenrepEditorView3::HandleCommandL(TInt aCommand) + { + switch ( aCommand ) + { + case EAknSoftKeyStart: + { + iContainer->StoreSettingsL(); + CCenrepEditorAppUi* appUI= static_cast(iEikonEnv->EikAppUi()); + CMusApplication* musApplication=appUI->MusApplication(); + if(!musApplication-> AvailabilityInfo())/*break*/; // Mus Not available to start.Dont care + TBool result=musApplication->Start(musApplication->iUseCase); + if(result) + { + Cba()->SetCommandSetL(R_CENREPEDITOR_SOFTKEYS_STOP_EXIT); + Cba()->MakeVisible(ETrue); + Cba()->DrawDeferred(); + musApplication->MusUseCaseInfo(ETrue); + } + musApplication->MusUseCaseInfo(ETrue); + break; + } + case EAknSoftKeyStop: + { + iContainer->StoreSettingsL(); + CCenrepEditorAppUi* appUI= static_cast(iEikonEnv->EikAppUi()); + CMusApplication* musApplication=appUI->MusApplication(); + TBool result=musApplication->Stop(); + if(result) + { + Cba()->SetCommandSetL(R_CENREPEDITOR_SOFTKEYS_START_EXIT); + Cba()->MakeVisible(ETrue); + Cba()->DrawDeferred(); + musApplication->MusUseCaseInfo(EFalse); + } + musApplication->MusUseCaseInfo(EFalse); + break; + } + default: + { + + + AppUi()->HandleCommandL( aCommand ); + break; + } + } + } + +// --------------------------------------------------------- +// CCenrepEditorView3::HandleClientRectChange() +// --------------------------------------------------------- +// +void CCenrepEditorView3::HandleClientRectChange() + { + if ( iContainer ) + { + iContainer->SetRect( ClientRect() ); + } + } + +// --------------------------------------------------------- +// CCenrepEditorView3::DoActivateL(...) +// +// --------------------------------------------------------- +// +void CCenrepEditorView3::DoActivateL( + const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/, + const TDesC8& /*aCustomMessage*/) + { + CCenrepEditorAppUi* appUI= static_cast(iEikonEnv->EikAppUi()); + CMusApplication* musApplication=appUI->MusApplication(); + if (!iContainer) + { + iContainer = new (ELeave) CCenrepEditorView3Container; + iContainer->SetMopParent(this); + iContainer->ConstructL( ClientRect(),R_CENREPEDITOR_START_STOP_SETTINGS_LIST,musApplication); + AppUi()->AddToViewStackL( *this, iContainer ); + iContainer->MakeVisible( ETrue ); + } + + iContainer->DrawNow(); + } + +// --------------------------------------------------------- +// CCenrepEditorView3::DoDeactivate() +// +// --------------------------------------------------------- +// +void CCenrepEditorView3::DoDeactivate() + { + + if ( iContainer ) + { + AppUi()->RemoveFromViewStack( *this, iContainer ); + } + + delete iContainer; + iContainer = NULL; + } + + +// End of File + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/CenrepEditor/Src/cenrepeditorview3container.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/CenrepEditor/Src/cenrepeditorview3container.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,146 @@ +/* +* Copyright (c) 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: +* +*/ + + +// INCLUDE FILES +#include "cenrepeditorview3container.h" +#include "cenrepeditordocument.h" +#include "cenrepeditorappui.h" +#include "cenrepeditormodel.h" + + + +#include // for example label control + + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------- +// CCenrepEditorView3Container::ConstructL(const TRect& aRect) +// EPOC two phased constructor +// --------------------------------------------------------- +// +void CCenrepEditorView3Container::ConstructL(const TRect& aRect,TInt aResourceId, CMusApplication* aMusApplication) + { + CreateWindowL(); + iMusApplicationListbox = new(ELeave)CMusApplicationListbox; + // and put the data in the list + iMusApplicationListbox->SetData(aMusApplication); + // setting list is constructed from resources + iMusApplicationListbox->ConstructFromResourceL(aResourceId); + SetRect(aRect); + iMusApplicationListbox->MakeVisible(ETrue); + iMusApplicationListbox->SetRect(aRect); + iMusApplicationListbox->LoadSettingsL(); + iMusApplicationListbox->ActivateL(); + ActivateL(); + } + +// Destructor +CCenrepEditorView3Container::~CCenrepEditorView3Container() + { + iMusApplicationListbox->StoreSettingsL(); + delete iMusApplicationListbox; + iMusApplicationListbox = NULL; + } + +// --------------------------------------------------------- +// CCenrepEditorView3Container::StoreSettingsL() +// Store the Settings to Variable +// --------------------------------------------------------- +// +void CCenrepEditorView3Container::StoreSettingsL() + { + iMusApplicationListbox->StoreSettingsL(); + } + +// --------------------------------------------------------- +// CCenrepEditorView3Container::SizeChanged() +// Called by framework when the view size is changed +// --------------------------------------------------------- +// +void CCenrepEditorView3Container::SizeChanged() + { + // TODO: Add here control resize code etc. + iMusApplicationListbox->SetRect(Rect()); + } + +// --------------------------------------------------------- +// CCenrepEditorView3Container::CountComponentControls() const +// --------------------------------------------------------- +// +TInt CCenrepEditorView3Container::CountComponentControls() const + { + TInt count = 0; + if(iMusApplicationListbox) + count++; + return count; + } + +// --------------------------------------------------------- +// CCenrepEditorView3Container::ComponentControl(TInt aIndex) const +// --------------------------------------------------------- +// +CCoeControl* CCenrepEditorView3Container::ComponentControl(TInt /*aIndex*/) const + { + return iMusApplicationListbox; + } + +// --------------------------------------------------------- +// CCenrepEditorView3Container::Draw(const TRect& aRect) const +// --------------------------------------------------------- +// +void CCenrepEditorView3Container::Draw(const TRect& aRect) const + { + CWindowGc& gc = SystemGc(); + gc.SetPenStyle( CGraphicsContext::ENullPen ); + gc.SetBrushColor( KRgbGray ); + gc.SetBrushStyle( CGraphicsContext::ESolidBrush ); + gc.DrawRect( aRect ); + } + + +TKeyResponse CCenrepEditorView3Container::OfferKeyEventL( + const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + if(aType != EEventKey) // Is not key event? + { + return EKeyWasNotConsumed; + } + switch (aKeyEvent.iCode) + { + case EKeyLeftArrow: + case EKeyRightArrow: + return EKeyWasNotConsumed; + default: + if(iMusApplicationListbox) + { + return iMusApplicationListbox->OfferKeyEventL( aKeyEvent, aType ); + } + else + { + return EKeyWasNotConsumed; + } + + } + } + + + + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/CenrepEditor/data/cenrepeditor.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/CenrepEditor/data/cenrepeditor.rss Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,896 @@ +/* +* Copyright (c) 2002-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: This file contains all the resources for the AiwTestApp. +* Initial content was generated by Series 60 AppWizard. +* +*/ + +// RESOURCE IDENTIFIER +NAME CENR // 4 letter ID + +// INCLUDES +#include +#include +#include +#include +#include +#include +#include + +#include "cenrepeditor.hrh" +#include "cenrepeditor.loc" + + +// RESOURCE DEFINITIONS +RESOURCE RSS_SIGNATURE { } +RESOURCE TBUF { buf = "CenrepEditor"; } + +//---------------------------------------------------- +// +// eik_app_info +// +//---------------------------------------------------- +// +RESOURCE EIK_APP_INFO + { + hotkeys = r_cenrepeditor_hotkeys; + menubar = r_cenrepeditor_menubar; + cba = R_AVKON_SOFTKEYS_OPTIONS_BACK; + status_pane = r_avkonviewexample_status_pane; + } + +//---------------------------------------------------- +// +// r_aiwtest_hotkeys +// +//---------------------------------------------------- +// +RESOURCE HOTKEYS r_cenrepeditor_hotkeys + { + control = + { + HOTKEY { command = EAknCmdExit; key='e'; } + }; + } + +//---------------------------------------------------- +// +// r_aiwtest_menubar +// +//---------------------------------------------------- +// +RESOURCE MENU_BAR r_cenrepeditor_menubar + { + titles = + { + MENU_TITLE { menu_pane = r_cenrepeditor_menu; txt = "File"; } + }; + } + +//---------------------------------------------------- +// +// r_aiwtest_menu +// +//---------------------------------------------------- +// +RESOURCE MENU_PANE r_cenrepeditor_menu + { + items = + { + //MENU_ITEM { command = 1000; txt = "Change"; }, + //MENU_ITEM { command = EAknCmdExit; txt = qtn_options_exit; } + }; + } + +// ----------------------------------------------------------------------------- +// +// r_aiwtest_localisable_app_info +// +// ----------------------------------------------------------------------------- +// +RESOURCE LOCALISABLE_APP_INFO r_cenrepeditor_localisable_app_info + { + short_caption = "CenrepEditor"; + caption_and_icon = + CAPTION_AND_ICON_INFO + { + caption = "CenrepEditor"; +#ifdef __SCALABLE_ICONS + number_of_icons = 1; +#else + number_of_icons = 2; +#endif + }; + } + +RESOURCE STATUS_PANE_APP_MODEL r_avkonviewexample_status_pane + { + panes = + { + SPANE_PANE + { + id = EEikStatusPaneUidNavi; + type = EAknCtNaviPane; + resource = r_avkonviewexample_navi_decorator; + } + }; + } + +//---------------------------------------------------- +// +// r_avkonviewexample_navi_decorator +// +//---------------------------------------------------- +// +RESOURCE NAVI_DECORATOR r_avkonviewexample_navi_decorator + { + type = ENaviDecoratorControlTabGroup; + control = TAB_GROUP + { + tab_width = EAknTabWidthWithThreeTabs; // three tabs + active = 0; + tabs = + { + TAB + { + id = EAvkonViewExampleView1Tab; // from application hrh + txt = qtn_view1_tab; + }, + TAB + { + id = EAvkonViewExampleView2Tab; + txt = qtn_view2_tab; + }, + TAB + { + id = EAvkonViewExampleView3Tab; + txt = qtn_view3_tab; + } + }; + }; + } + + +//---------------------------------------------------- +// +// r_avkonviewexample_view1 +// +//---------------------------------------------------- +// +RESOURCE AVKON_VIEW r_cenrepeditor_view1 + { + hotkeys = r_cenrepeditor_hotkeys; + menubar = r_cenrepeditor_menubar; + cba = r_cenrepeditor_softkeys_save_exit; + } + +RESOURCE CBA r_cenrepeditor_softkeys_save_exit + { + buttons = + { + CBA_BUTTON + { + id = EAknSoftKeySave; + txt = qtn_cenrepeditor_cba_text_save; + }, + CBA_BUTTON + { + id = EAknSoftKeyExit; + txt = qtn_cenrepeditor_cba_text_Exit; + } + }; + } + +RESOURCE AVKON_SETTING_ITEM_LIST r_phone_resource_details_settings_list + { + flags= EAknSettingItemNumberedStyle; + title = qtn_phoneresource_details; + initial_number = 1; + items = + { + AVKON_SETTING_ITEM + { + identifier = EPhoneResouceCamera; + setting_page_resource = r_popup_settings_page; + name = "CameraAvailability"; + associated_resource = r_availability_settings_page_texts; + }, + AVKON_SETTING_ITEM + { + identifier = EPhoneResouceKeypad; + setting_page_resource = r_popup_settings_page; + name = "KeypadAvailability"; + associated_resource = r_availability_settings_page_texts; + }, + AVKON_SETTING_ITEM + { + identifier = EPhoneResouceVideoPlayer; + setting_page_resource = r_popup_settings_page; + name = "VideoPlayerAvailability"; + associated_resource = r_availability_settings_page_texts; + }, + AVKON_SETTING_ITEM + { + identifier = EPhoneResouceCameraInformation; + setting_page_resource = r_popup_settings_page; + name = "CameraInformation"; + associated_resource = r_CameraInformation_settings_page_texts; + }, + AVKON_SETTING_ITEM + { + identifier = EKodiakPhoneCall; + setting_page_resource = r_popup_settings_page; + name = "KodiakPTT"; + associated_resource = r_kodiak_call_settings_page_texts; + } + }; + } + + + +//camera +RESOURCE AVKON_POPUP_SETTING_TEXTS r_availability_settings_page_texts + { + setting_texts_resource = r_availability_page_texts_array; + } + +RESOURCE ARRAY r_availability_page_texts_array + { + items = + { + AVKON_ENUMERATED_TEXT { value=1; text = "1.EAvailable"; }, + AVKON_ENUMERATED_TEXT { value=2; text = "2.ENotAvailable"; } + }; + } + + +//camera information +RESOURCE AVKON_POPUP_SETTING_TEXTS r_CameraInformation_settings_page_texts + { + setting_texts_resource = r_CameraInformation_settings_page_texts_array; + popped_up_texts_resource = r_CameraInformation_settings_page_popedup; + } + +RESOURCE ARRAY r_CameraInformation_settings_page_texts_array + { + items = + { + AVKON_ENUMERATED_TEXT { value=1; text = "1.EUsePrimaryCamera"; }, + AVKON_ENUMERATED_TEXT { value=2; text = "2.EUseSecondaryCamera"; } + }; + } + +RESOURCE ARRAY r_CameraInformation_settings_page_popedup + { + items = + { + LBUF { txt = "1.EUsePrimaryCamera"; }, + LBUF { txt = "2.EUseSecondaryCamera"; } + }; + } + +//kodiak PTT +RESOURCE AVKON_POPUP_SETTING_TEXTS r_kodiak_call_settings_page_texts + { + setting_texts_resource = r_kodiak_call_settings_page_texts_array; + } + +RESOURCE ARRAY r_kodiak_call_settings_page_texts_array + { + items = + { + AVKON_ENUMERATED_TEXT { value=0; text = "0.EPSCTsyKodiakPttNotActive"; }, + AVKON_ENUMERATED_TEXT { value=1; text = "1.EPSCTsyKodiakPttActive"; } + }; + } + +RESOURCE POPUP_SETTING_LIST r_enumerated_text_setting_other_editor + { + // other="-1.Undefined"; + } + +RESOURCE AVKON_INTEGER_EDWIN r_integer_edwin + { + min = 0; + max = 9999; + } + +RESOURCE EDWIN r_encoder_info_editor + { + maxlength = 2048; //KMaxBinaryLength, centralrepository.h + lines = 6; + } + +RESOURCE EDWIN r_encoding_device_editor + { + maxlength = 8; //KMaxUidStringLength, cenrepeditormodel.h + default_case = EAknEditorLowerCase; + //allowed_input_modes = EAknEditorTextInputMode | EAknEditorNumericInputMode + } + + +RESOURCE AVKON_SETTING_ITEM_LIST r_other_resource_details_settings_list + { + flags= EAknSettingItemNumberedStyle; + title = qtn_otherresource_details; + initial_number = 1; + items = + { + AVKON_SETTING_ITEM + { + identifier = EOtherResourceActivation; + setting_page_resource = r_popup_settings_page; + name = "Activation"; + associated_resource = r_activation_editor_settings_page_texts; + }, + AVKON_SETTING_ITEM + { + identifier = EOtherResourceOperatorVariant; + setting_page_resource = r_popup_settings_page; + name = "OperatorVariant"; + associated_resource = r_operator_editor_settings_page_texts; + }, + AVKON_SETTING_ITEM + { + identifier = EOtherResourceAuditoryNotification; + setting_page_resource = r_popup_settings_page; + name = "AuditoryNotification"; + associated_resource = r_Auditory_editor_settings_page_texts; + }, + AVKON_SETTING_ITEM + { + identifier = EOtherResourcePopupNotification; + setting_page_resource = r_popup_settings_page; + name = "PopupNotification"; + associated_resource = r_Popup_editor_settings_page_texts; + }, + AVKON_SETTING_ITEM + { + identifier = EOtherResourcePopupNotificationType; + setting_page_resource = r_popup_settings_page; + name = "PopupNotificationType"; + associated_resource = r_PopupType_editor_settings_page_texts; + }, + AVKON_SETTING_ITEM + { + identifier = EOtherResourceEdgeDtmSupport; + setting_page_resource = r_popup_settings_page; + name = "EdgeDtmSupport"; + associated_resource = r_edgedtm_editor_settings_page_texts; + }, + AVKON_SETTING_ITEM + { + identifier = EOtherResourceSessionSetupMethod; + setting_page_resource = r_popup_settings_page; + name = "ForceInternetSignaling"; + associated_resource = r_signal_editor_settings_page_texts; + }, + AVKON_SETTING_ITEM + { + identifier = EOtherResourceAutoRecord; + setting_page_resource = r_popup_settings_page; + name = "AutoRecord"; + associated_resource = r_videosaving_editor_settings_page_texts; + }, + AVKON_SETTING_ITEM + { + identifier = EOtherResourceVideoLocation; + setting_page_resource = r_editor_settings_page; + name = "VideoLocation"; + }, + AVKON_SETTING_ITEM + { + identifier = EOtherResourceSipProfileId; + setting_page_resource = r_editor_settings_page; + name = "SipProfileId"; + }, + AVKON_SETTING_ITEM + { + identifier = EOtherResourceUiOrientation; + setting_page_resource = r_popup_settings_page; + name = "UiOrientation"; + associated_resource = r_uiorientation_editor_settings_page_texts; + }, + AVKON_SETTING_ITEM + { + identifier = EOtherResourceCapabilityQuery; + setting_page_resource = r_popup_settings_page; + name = "CapabilityQuery"; + associated_resource = r_capquery_editor_settings_page_texts; + }, + AVKON_SETTING_ITEM + { + identifier = EOtherResourceProductModeVariationKey; + setting_page_resource = r_editor_settings_page; + name = "ProductModeVariation"; + }, + AVKON_SETTING_ITEM + { + identifier = EOtherResourceEncoderConfigurationInfo; + setting_page_resource = r_encoder_info_settings_page; + name = "EncoderConfigurationInfo"; + }, + AVKON_SETTING_ITEM + { + identifier = EOtherResourceEncodingDevice; + setting_page_resource = r_encoding_device_settings_page; + name = "EncodingDevice"; + }, + AVKON_SETTING_ITEM + { + identifier = EOtherResourceAllowOnlyWithActiveCSCall; + setting_page_resource = r_popup_settings_page; + name = "AllowWithCSCallOnly"; + associated_resource = r_activecscall_editor_settings_page_texts; + }, + AVKON_SETTING_ITEM + { + identifier = EOtherResourceAllowOnlyIn3GNetwork; + setting_page_resource = r_popup_settings_page; + name = "AllowIn3GNetworkOnly"; + associated_resource = r_3gnetwork_editor_settings_page_texts; + }, + AVKON_SETTING_ITEM + { + identifier = EOtherResourceCameraUsage; + setting_page_resource = r_popup_settings_page; + name = "CameraUsage"; + associated_resource = r_camera_usage_settings_page_texts; + }, + AVKON_SETTING_ITEM + { + identifier = EOtherResourceVideoDirection; + setting_page_resource = r_popup_settings_page; + name = "VideoDirection"; + associated_resource = r_video_direction_settings_page_texts; + }, + AVKON_SETTING_ITEM + { + identifier = EOtherResourceVideoBandwidth; + setting_page_resource = r_editor_settings_page; + name = "VideoBandwidth,KBits"; + }, + AVKON_SETTING_ITEM + { + identifier = EOtherResourceFastMode; + setting_page_resource = r_popup_settings_page; + name = "FastStartupMode"; + associated_resource = r_fast_mode_settings_page_texts; + } + }; + } + +//activation +RESOURCE AVKON_POPUP_SETTING_TEXTS r_activation_editor_settings_page_texts + { + setting_texts_resource = r_activation_editor_settings_page_texts_array; + } + +RESOURCE ARRAY r_activation_editor_settings_page_texts_array + { + items = + { + AVKON_ENUMERATED_TEXT { value=-1; text = "Not defined"; }, + AVKON_ENUMERATED_TEXT { value=0; text = "0.EAlwaysActive"; }, + AVKON_ENUMERATED_TEXT { value=1; text = "1.EActiveInHomeNetworks"; }, + AVKON_ENUMERATED_TEXT { value=2; text = "2.ENever"; } + }; + } + +//operator variant +RESOURCE AVKON_POPUP_SETTING_TEXTS r_operator_editor_settings_page_texts + { + setting_texts_resource = r_operator_editor_settings_page_texts_array; + } + +RESOURCE ARRAY r_operator_editor_settings_page_texts_array + { + items = + { + AVKON_ENUMERATED_TEXT { value=-1; text = "Not defined"; }, + AVKON_ENUMERATED_TEXT { value=0; text = "0.EStandard"; }, + AVKON_ENUMERATED_TEXT { value=1; text = "1.EOperatorSpecific"; } + }; + } + +//Auditory Notification +RESOURCE AVKON_POPUP_SETTING_TEXTS r_Auditory_editor_settings_page_texts + { + setting_texts_resource = r_Auditory_editor_settings_page_texts_array; + } + +RESOURCE ARRAY r_Auditory_editor_settings_page_texts_array + { + items = + { + AVKON_ENUMERATED_TEXT { value=-1; text = "Not defined"; }, + AVKON_ENUMERATED_TEXT { value=0; text = "0.EAuditoryNotificationOn"; }, + AVKON_ENUMERATED_TEXT { value=1; text = "1.EAuditoryNotificationOff"; } + }; + } + +//Popup Notification +RESOURCE AVKON_POPUP_SETTING_TEXTS r_Popup_editor_settings_page_texts + { + setting_texts_resource = r_Popup_editor_settings_page_texts_array; + } + +RESOURCE ARRAY r_Popup_editor_settings_page_texts_array + { + items = + { + AVKON_ENUMERATED_TEXT { value=-1; text = "Not defined"; }, + AVKON_ENUMERATED_TEXT { value=0; text = "0.EPopupNotificationOn"; }, + AVKON_ENUMERATED_TEXT { value=1; text = "1.EPopupNotificationOff"; } + }; + } + +//Popup Notification Type +RESOURCE AVKON_POPUP_SETTING_TEXTS r_PopupType_editor_settings_page_texts + { + setting_texts_resource = r_PopupType_editor_settings_page_texts_array; + } + +RESOURCE ARRAY r_PopupType_editor_settings_page_texts_array + { + items = + { + AVKON_ENUMERATED_TEXT { value=-1; text = "Not defined"; }, + AVKON_ENUMERATED_TEXT { value=0; text = "0.ENotificationTypeQueryUser"; }, + AVKON_ENUMERATED_TEXT { value=1; text = "1.ENotificationTypePopup"; } + }; + } + +//EDGE/DTM +RESOURCE AVKON_POPUP_SETTING_TEXTS r_edgedtm_editor_settings_page_texts + { + setting_texts_resource = r_edgedtm_editor_settings_page_texts_array; + } + +RESOURCE ARRAY r_edgedtm_editor_settings_page_texts_array + { + items = + { + AVKON_ENUMERATED_TEXT { value=-1; text = "Not defined"; }, + AVKON_ENUMERATED_TEXT { value=0; text = "0.EDtmModeAllowed"; }, + AVKON_ENUMERATED_TEXT { value=1; text = "1.EDtmModeNotAllowed"; } + }; + } + +//Internet Signalling +RESOURCE AVKON_POPUP_SETTING_TEXTS r_signal_editor_settings_page_texts + { + setting_texts_resource = r_signal_editor_settings_page_texts_array; + } + +RESOURCE ARRAY r_signal_editor_settings_page_texts_array + { + items = + { + AVKON_ENUMERATED_TEXT { value=-1; text = "Not defined"; }, + AVKON_ENUMERATED_TEXT { value=0; text = "0.EForceInternetSignaling"; }, + AVKON_ENUMERATED_TEXT { value=1; text = "1.EFollowProfileConfiguration"; } + }; + } + +//Video Saving +RESOURCE AVKON_POPUP_SETTING_TEXTS r_videosaving_editor_settings_page_texts + { + setting_texts_resource = r_videosaving_editor_settings_page_texts_array; + } + +RESOURCE ARRAY r_videosaving_editor_settings_page_texts_array + { + items = + { + AVKON_ENUMERATED_TEXT { value=-1; text = "Not defined"; }, + AVKON_ENUMERATED_TEXT { value=0; text = "0.EAutoRecordOn"; }, + AVKON_ENUMERATED_TEXT { value=1; text = "1.EAutoRecordOff"; } + }; + } + +//UI Orientation +RESOURCE AVKON_POPUP_SETTING_TEXTS r_uiorientation_editor_settings_page_texts + { + setting_texts_resource = r_uiorientation_editor_settings_page_texts_array; + } + +RESOURCE ARRAY r_uiorientation_editor_settings_page_texts_array + { + items = + { + AVKON_ENUMERATED_TEXT { value=-1; text = "Not defined"; }, + AVKON_ENUMERATED_TEXT { value=0; text = "0.EPortrait"; }, + AVKON_ENUMERATED_TEXT { value=1; text = "1.ELandscape"; } + }; + } + + +//Capability Query +RESOURCE AVKON_POPUP_SETTING_TEXTS r_capquery_editor_settings_page_texts + { + setting_texts_resource = r_capquery_editor_settings_page_texts_array; + } + +RESOURCE ARRAY r_capquery_editor_settings_page_texts_array + { + items = + { + AVKON_ENUMERATED_TEXT { value=-1; text = "Not defined"; }, + AVKON_ENUMERATED_TEXT { value=0; text = "0.ESequential"; }, + AVKON_ENUMERATED_TEXT { value=1; text = "1.EParallel"; }, + AVKON_ENUMERATED_TEXT { value=2; text = "2.ENoOptions"; } + }; + } + + +//Allow multimedia sharing only with active CS call +RESOURCE AVKON_POPUP_SETTING_TEXTS r_activecscall_editor_settings_page_texts + { + setting_texts_resource = r_activecscall_editor_settings_page_texts_array; + } + +RESOURCE ARRAY r_activecscall_editor_settings_page_texts_array + { + items = + { + AVKON_ENUMERATED_TEXT { value=-1; text = "Not defined"; }, + AVKON_ENUMERATED_TEXT { value=0; text = "0.EAllowedAllCalls"; }, + AVKON_ENUMERATED_TEXT { value=1; text = "1.EAllowedCSOnly"; } + }; + } + + +//Allow multimedia sharing only in 3G network +RESOURCE AVKON_POPUP_SETTING_TEXTS r_3gnetwork_editor_settings_page_texts + { + setting_texts_resource = r_3gnetwork_editor_settings_page_texts_array; + } + +RESOURCE ARRAY r_3gnetwork_editor_settings_page_texts_array + { + items = + { + AVKON_ENUMERATED_TEXT { value=-1; text = "Not defined"; }, + AVKON_ENUMERATED_TEXT { value=0; text = "0.EAllowedAllBearers"; }, + AVKON_ENUMERATED_TEXT { value=1; text = "1.EAllowed3GOnly"; } + }; + } + + +//Camera Usage +RESOURCE AVKON_POPUP_SETTING_TEXTS r_camera_usage_settings_page_texts + { + setting_texts_resource = r_camera_usage_settings_page_texts_array; + } + +RESOURCE ARRAY r_camera_usage_settings_page_texts_array + { + items = + { + AVKON_ENUMERATED_TEXT { value=-1; text = "Not defined"; }, + AVKON_ENUMERATED_TEXT { value=0; text = "0.EUseOnlyMainCamera"; }, + AVKON_ENUMERATED_TEXT { value=1; text = "1.EUseOnlySecondaryCamera"; }, + AVKON_ENUMERATED_TEXT { value=2; text = "2.EUseCameraSwapping"; } + }; + } + + +//Video direction +RESOURCE AVKON_POPUP_SETTING_TEXTS r_video_direction_settings_page_texts + { + setting_texts_resource = r_video_direction_settings_page_texts_array; + } + +RESOURCE ARRAY r_video_direction_settings_page_texts_array + { + items = + { + AVKON_ENUMERATED_TEXT { value=-1; text = "Not defined"; }, + AVKON_ENUMERATED_TEXT { value=0; text = "0.EOneWayVideo"; }, + AVKON_ENUMERATED_TEXT { value=1; text = "1.ETwoWayVideo"; } + }; + } + + +//Fast startup mode +RESOURCE AVKON_POPUP_SETTING_TEXTS r_fast_mode_settings_page_texts + { + setting_texts_resource = r_fast_mode_settings_page_texts_array; + } + +RESOURCE ARRAY r_fast_mode_settings_page_texts_array + { + items = + { + AVKON_ENUMERATED_TEXT { value=-1; text = "Not defined"; }, + AVKON_ENUMERATED_TEXT { value=0; text = "0.EFastModeOn"; }, + AVKON_ENUMERATED_TEXT { value=1; text = "1.EFastModeOff"; } + }; + } + + +// add setting page and editor resources for "details" field here +RESOURCE AVKON_SETTING_PAGE r_editor_settings_page + { + number = 1; + label = "Value"; + type = EAknCtIntegerEdwin; + editor_resource_id = r_integer_edwin; + } + +RESOURCE AVKON_SETTING_PAGE r_popup_settings_page + { + number = 1; + type = EAknCtPopupSettingList; + editor_resource_id = r_enumerated_text_setting_other_editor; + } + +RESOURCE AVKON_SETTING_PAGE r_encoder_info_settings_page + { + number = 14; + label="Configuration info"; + type = EEikCtEdwin; + editor_resource_id = r_encoder_info_editor; + hint_text="hint text"; + } + +RESOURCE AVKON_SETTING_PAGE r_encoding_device_settings_page + { + number = 15; + label = "Encoder UID (hex)"; + type = EEikCtEdwin; + editor_resource_id = r_encoding_device_editor; + } + + +//---------------------------------------------------- +// +// r_avkonviewexample_view3 +// +//---------------------------------------------------- +// +RESOURCE AVKON_VIEW r_cenrepeditor_view3 + { + hotkeys = r_cenrepeditor_hotkeys; + menubar = r_cenrepeditor_menubar; + cba = r_cenrepeditor_softkeys_start_exit; + } + +RESOURCE CBA r_cenrepeditor_softkeys_start_exit + { + buttons = + { + CBA_BUTTON + { + id = EAknSoftKeyStart; + txt = qtn_cenrepeditor_cba_text_start; + }, + CBA_BUTTON + { + id = EAknSoftKeyExit; + txt = qtn_cenrepeditor_cba_text_Exit; + } + }; + } + +RESOURCE CBA r_cenrepeditor_softkeys_stop_exit + { + buttons = + { + CBA_BUTTON + { + id = EAknSoftKeyStop; + txt = qtn_cenrepeditor_cba_text_stop; + }, + CBA_BUTTON + { + id = EAknSoftKeyExit; + txt = qtn_cenrepeditor_cba_text_Exit; + } + }; + } + +RESOURCE AVKON_SETTING_ITEM_LIST r_cenrepeditor_start_stop_settings_list + { + flags = EAknSettingItemNumberedStyle; + items = + { + AVKON_SETTING_ITEM + { + name = "Usecase"; + identifier = EApplicationStartStop; + setting_page_resource = r_cenrepeditor_start_stop_settings_list_page; + associated_resource = r_cenrepeditor_start_stop_associated_settings_list_page; + } + }; + } + +RESOURCE AVKON_SETTING_PAGE r_cenrepeditor_start_stop_settings_list_page + { + number = -16380; + label = qtn_cenrepeditor_application_usecase; + type = EAknCtPopupSettingList; + editor_resource_id = r_cenrepeditor_empty_setting_list; + } + +RESOURCE POPUP_SETTING_LIST r_cenrepeditor_empty_setting_list + { + } + +RESOURCE AVKON_POPUP_SETTING_TEXTS r_cenrepeditor_start_stop_associated_settings_list_page + { + setting_texts_resource = r_usecase_array; + } + +RESOURCE ARRAY r_usecase_array + { + items = + { + AVKON_ENUMERATED_TEXT + { + text = "Live"; + value = 0; + }, + AVKON_ENUMERATED_TEXT + { + text = "Clip"; + value = 1; + }, + AVKON_ENUMERATED_TEXT + { + text = "StillImage"; + value = 2; + }, + AVKON_ENUMERATED_TEXT + { + text = "Receive"; + value = 3; + }, + AVKON_ENUMERATED_TEXT + { + text = "Continue"; + value = 4; + } + }; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +RESOURCE DIALOG r_cenrepeditor_text_query_dialog + { + flags = EAknGeneralQueryFlags; + buttons = R_AVKON_SOFTKEYS_OK_CANCEL; + items = + { + DLG_LINE + { + type = EAknCtQuery; + id = EGeneralQuery; + control = AVKON_DATA_QUERY + { + layout = EDataLayout; + control = EDWIN + { + }; + }; + } + }; + } + + + +//End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/CenrepEditor/data/cenrepeditor_reg.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/CenrepEditor/data/cenrepeditor_reg.rss Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,32 @@ +/* +* Copyright (c) 2002-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: +* +*/ + +#include +#include +#include + +UID2 KUidAppRegistrationResourceFile +UID3 0x10282398 // Define your application UID here + +RESOURCE APP_REGISTRATION_INFO + { + app_file = "CenrepEditor"; + localisable_resource_file = APP_RESOURCE_DIR"\\CenrepEditor"; + localisable_resource_id = R_CENREPEDITOR_LOCALISABLE_APP_INFO; + } + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/CenrepEditor/group/CenrepEditor.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/CenrepEditor/group/CenrepEditor.mmp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,85 @@ +/* +* Copyright (c) 2002-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: +* +*/ + +#include +#include +#include + +TARGET CenrepEditor.exe +TARGETTYPE exe + +UID 0x100039CE 0x10282398 +VENDORID VID_DEFAULT +CAPABILITY CAP_APPLICATION + +EPOCSTACKSIZE 0xF000 + +/*Enable this when you compile it for mercury platform + or if kodiak ptt is present +*/ + +//MACRO _KODIAK_PHONE_CALL + +SOURCEPATH ../src +SOURCE cenrepeditorApp.cpp +SOURCE cenrepeditorAppUi.cpp +SOURCE cenrepeditorDocument.cpp +SOURCE cenrepeditorview1.cpp +SOURCE cenrepeditorview1container.cpp +SOURCE cenrepeditorlistbox.cpp +SOURCE cenrepeditormodel.cpp +SOURCE cenrepeditorview2.cpp +SOURCE cenrepeditorview2container.cpp +SOURCE cenrepeditorlistbox2.cpp +SOURCE cenrepeditorview3.cpp +SOURCE cenrepeditorview3container.cpp +SOURCE cenrepeditorlistbox3.cpp + + +START RESOURCE ../data/cenrepeditor.rss +HEADER +TARGETPATH APP_RESOURCE_DIR +END + +START RESOURCE ../data/cenrepeditor_reg.rss +DEPENDS cenrepeditor.rsg +TARGETPATH /private/10003a3f/apps +END + +LANG SC + +USERINCLUDE ../inc + +APP_LAYER_SYSTEMINCLUDE + +LIBRARY apparc.lib +LIBRARY avkon.lib +LIBRARY bafl.lib +LIBRARY cone.lib +LIBRARY ecom.lib +LIBRARY eikcoctl.lib +LIBRARY eikcore.lib +LIBRARY euser.lib +LIBRARY fbscli.lib +LIBRARY efsrv.lib +LIBRARY aknskins.lib // for skin background +LIBRARY CdlEngine.lib // for scalable ui +LIBRARY flogger.lib +LIBRARY centralrepository.lib +LIBRARY musmanagerclient.lib + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/CenrepEditor/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/CenrepEditor/group/bld.inf Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 2002-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: +* +*/ + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES +Cenrepeditor.mmp + +PRJ_TESTMMPFILES + +PRJ_TESTEXPORTS + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/CenrepEditor/inc/cenrepeditor.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/CenrepEditor/inc/cenrepeditor.hrh Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,82 @@ +/* +* Copyright (c) 2002-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: This file contains declarations for constants of AiwTestApp. +* The file can be included in C++ or resource file. +* Initial content was generated by Series 60 AppWizard. +* +*/ + +#ifndef AIWTESTAPP_HRH +#define AIWTESTAPP_HRH + +enum TAvkonViewExampleCommandIds + { + EAvkonViewExampleCmdAppTest = 1 + }; + +enum TAvkonViewExampleTabViewId + { + EAvkonViewExampleView1Tab= 1, + EAvkonViewExampleView2Tab, + EAvkonViewExampleView3Tab + }; + +enum TAiwTestAppCommandIds + { + EAknSoftKeySave=1, + EAknSoftKeyExit, + EAknSoftKeyStart, + EAknSoftKeyStop + }; + +enum TAvkonSettingsItemCommand + { + EPhoneResouceCamera = 1, + EPhoneResouceKeypad, + EPhoneResouceVideoPlayer, + EPhoneResouceCameraInformation, + EKodiakPhoneCall + }; + +enum TAvkonSettingsItemCommandOther + { + EOtherResourceActivation=1, + EOtherResourceOperatorVariant, + EOtherResourceAuditoryNotification, + EOtherResourcePopupNotification, + EOtherResourcePopupNotificationType, + EOtherResourceEdgeDtmSupport, + EOtherResourceSessionSetupMethod, + EOtherResourceAutoRecord, + EOtherResourceVideoLocation, + EOtherResourceSipProfileId, + EOtherResourceUiOrientation, + EOtherResourceCapabilityQuery, + EOtherResourceProductModeVariationKey, + EOtherResourceEncoderConfigurationInfo, + EOtherResourceEncodingDevice, + EOtherResourceAllowOnlyWithActiveCSCall, + EOtherResourceAllowOnlyIn3GNetwork, + EOtherResourceCameraUsage, + EOtherResourceVideoDirection, + EOtherResourceVideoBandwidth, + EOtherResourceFastMode + }; + +enum TAvkonViewApplicationStartStop + { + EApplicationStartStop=1 + }; + +#endif // AIWTESTAPP_HRH diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/CenrepEditor/inc/cenrepeditor.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/CenrepEditor/inc/cenrepeditor.loc Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,58 @@ +/* +* Copyright (c) 2002-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: This is a localisation file for AiwTestApp. +* A loc file is the one and only place where the logical strings +* to be localised are defined. +* Initial content was generated by Series 60 AppWizard. +* +*/ + + +// LOCALISATION STRINGS + +// d:Command in options menu. +// d:Example application spesific command. +// l:list_single_popup_submenu_pane_1 +// +#define qtn_appl_test "Test" + +// d:Example caption string for app. +// +#define qtn_app_caption_string "" + +// d:Example short caption string for app. +// +#define qtn_app_short_caption_string "" + +#define qtn_view1_tab "PhoneResource" + +#define qtn_view2_tab "AppResource" + +#define qtn_view3_tab "Application" + +#define qtn_phoneresource_details "Phone" + +#define qtn_cenrepeditor_cba_text_save "Save" + +#define qtn_cenrepeditor_cba_text_Exit "Exit" + +#define qtn_otherresource_details "Other" + +#define qtn_cenrepeditor_cba_text_start "Start" + +#define qtn_cenrepeditor_cba_text_stop "Stop" + +#define qtn_cenrepeditor_application_usecase "Usecase" + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/CenrepEditor/inc/cenrepeditorApp.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/CenrepEditor/inc/cenrepeditorApp.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,56 @@ +/* +* Copyright (c) 2002-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: Declares main application class. +* +*/ + +#ifndef AIWTESTAPP_H +#define AIWTESTAPP_H + +// INCLUDES +#include + +// CONSTANTS +// UID of the application +const TUid KUidAiwTestApp = { 0x10282398}; + +// CLASS DECLARATION + +/** +* CCenrepEditorApp application class. +* Provides factory to create concrete document object. +* +*/ +class CCenrepEditorApp : public CAknApplication + { + public: // Functions from base classes + + private: + /** + * From CApaApplication, creates CCenrepEditorAppDocument document object. + * @return A pointer to the created document object. + */ + CApaDocument* CreateDocumentL(); + + /** + * From CApaApplication, returns application's UID (KUidAiwTestApp). + * @return The value of KUidAiwTestApp. + */ + TUid AppDllUid() const; + }; + +#endif + +// End of File + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/CenrepEditor/inc/cenrepeditorappui.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/CenrepEditor/inc/cenrepeditorappui.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,104 @@ +/* +* Copyright (c) 2002-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: Declares UI class for application. +* +*/ + +#ifndef AIWTESTAPPUI_H +#define AIWTESTAPPUI_H + +// INCLUDES +#include "cenrepeditormodel.h" + +#include +#include +#include +#include +#include +#include +#include +#include + + +// FORWARD DECLARATIONS +class CCenrepEditorContainer; +class CAiwServiceHandler; +class CMusManager; +class CMusAvaInterface; +class CPhoneResources; +class CMusApplication; + +// CLASS DECLARATION + +/** +* Application UI class. +* Provides support for the following features: +* - EIKON control architecture +*/ +class CCenrepEditorAppUi : public CAknViewAppUi + { + public: // Constructors and destructor + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + /** + * Destructor. + */ + virtual ~CCenrepEditorAppUi(); + + public: // New functions + CPhoneResources* PhoneResouces(); + COtherResources* OtherResouces(); + CMusApplication* MusApplication(); + + private: + /** + * From MEikMenuObserver, dynamically initialises a menu pane. + * @param aResourceId The menu's ID. + * @param aMenuPane The in-memory representation of the menu pane. + */ + void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane); + + private: + /** + * From CEikAppUi, takes care of command handling. + * @param aCommand command to be handled + */ + void HandleCommandL(TInt aCommand); + + /** + * From CEikAppUi, handles key events. + * @param aKeyEvent Event to handled. + * @param aType Type of the key event. + * @return Response code (EKeyWasConsumed, EKeyWasNotConsumed). + */ + virtual TKeyResponse HandleKeyEventL( + const TKeyEvent& aKeyEvent,TEventCode aType); + + private: + CAknNavigationControlContainer* iNaviPane; + CAknTabGroup* iTabGroup; + CAknNavigationDecorator* iDecoratedTabGroup; + + private: + CPhoneResources* iPhoneResources; + COtherResources* iOtherResources; + CMusApplication* iMusApplication; + }; + +#endif + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/CenrepEditor/inc/cenrepeditordocument.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/CenrepEditor/inc/cenrepeditordocument.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,80 @@ +/* +* Copyright (c) 2002-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: Declares document for application. +* +*/ + +#ifndef AIWTESTDOCUMENT_H +#define AIWTESTDOCUMENT_H + +// INCLUDES +#include +#include +#include +#include +#include "cenrepeditormodel.h" + +// CONSTANTS + +// FORWARD DECLARATIONS +class CEikAppUi; +class CPhoneResources; + +// CLASS DECLARATION + +/** +* CCenrepEditorDocument application class. +*/ +class CCenrepEditorDocument : public CAknDocument + { + public: // Constructors and destructor + /** + * Two-phased constructor. + */ + static CCenrepEditorDocument* NewL(CEikApplication& aApp); + + /** + * Destructor. + */ + virtual ~CCenrepEditorDocument(); + + public: // New functions + CPhoneResources& CenrepPhoneResouces(); + public: // Functions from base classes + protected: // New functions + protected: // Functions from base classes + + private: + /** + * C++ default constructor. + */ + CCenrepEditorDocument(CEikApplication& aApp); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + private: + /** + * From CEikDocument, create CCenrepEditorAppUi "App UI" object. + */ + CEikAppUi* CreateAppUiL(); + + }; + +#endif + +// End of File + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/CenrepEditor/inc/cenrepeditorlistbox.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/CenrepEditor/inc/cenrepeditorlistbox.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,57 @@ +/* +* 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 S60UILABLISTBOX_H +#define S60UILABLISTBOX_H + +// INCLUDES +#include +#include +#include "cenrepeditor.hrh" +#include +#include "cenrepeditordocument.h" +#include "cenrepeditorview1container.h" +#include "cenrepeditormodel.h" + + +// FORWARD DECLARATIONS +class CCenrepEditorView1; +class CPhoneResources; +// CLASS DECLARATION + +/** +* CAknExSettingListContainer container control class. +*/ +class CPhoneResourcesListbox : public CAknSettingItemList + { + public: + CAknSettingItem* CreateSettingItemL( TInt identifier ); + void SetData(CPhoneResources* iPhoneResources); + + public: // Implementation from base class + // void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType); + // TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType); + + private: + void SizeChanged(); + CAknSettingItem* ConstructByValueL( TInt aIdentifier, + TInt& aVal ); + + private: + CPhoneResources* iPhoneResources; + }; + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/CenrepEditor/inc/cenrepeditorlistbox2.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/CenrepEditor/inc/cenrepeditorlistbox2.h Thu Jul 22 16:32:26 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: +* +*/ +#ifndef S60UILABLISTBOX2_H +#define S60UILABLISTBOX2_H + +// INCLUDES +#include +#include +#include "cenrepeditor.hrh" +#include +#include "cenrepeditordocument.h" +#include "cenrepeditorview1container.h" +#include "cenrepeditormodel.h" + + +// FORWARD DECLARATIONS +class CCenrepEditorView2; +class CPhoneResources; +// CLASS DECLARATION + +/** +* CAknExSettingListContainer container control class. +*/ +class COtherResourcesListbox : public CAknSettingItemList + { + public: + CAknSettingItem* CreateSettingItemL( TInt identifier ); + void SetData(COtherResources* iOtherResources); + + private: + void SizeChanged(); + CAknSettingItem* ConstructByValueL( TInt aIdentifier, + TInt& aVal ); + + private: + COtherResources* iOtherResources; + }; + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/CenrepEditor/inc/cenrepeditorlistbox3.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/CenrepEditor/inc/cenrepeditorlistbox3.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,61 @@ +/* +* 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 S60UILABLISTBOX2_H +#define S60UILABLISTBOX2_H + +// INCLUDES +#include +#include +#include "cenrepeditor.hrh" +#include +#include "cenrepeditordocument.h" +#include "cenrepeditorview3container.h" +#include "cenrepeditormodel.h" + + +// FORWARD DECLARATIONS +class CCenrepEditorView3; +class CMusApplication; +// CLASS DECLARATION + +/** +* CAknExSettingListContainer container control class. +*/ +class CMusApplicationListbox : public CAknSettingItemList + { + public: + CAknSettingItem* CreateSettingItemL( TInt identifier ); + void SetData(CMusApplication* iMusApplication); + + + public: // Implementation from base class + void EditItemL ( TInt aIndex, TBool aCalledFromMenu ); + void ChangeSelectedItemL(); + void LoadSettingValuesL(); + void SaveSettingValuesL(); + virtual TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ); + // void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType); + // TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType); + + private: + void SizeChanged(); + + private: + CMusApplication* iMusApplication; + }; + +#endif \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/CenrepEditor/inc/cenrepeditormodel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/CenrepEditor/inc/cenrepeditormodel.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,131 @@ +/* +* Copyright (c) 2002-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: Declares document for application. +* +*/ + +#ifndef CPHONERESOURCE_H +#define CPHONERESOURCE_H + +// INCLUDES +#include +#include +#include +#include +#include "musmanagercommon.h" +#include "musmanager.h" + +// CONSTANTS +const TInt KMaxUidStringLength = 8; + +// FORWARD DECLARATIONS +class CPhoneResources; +class COtherResources; +// CLASS DECLARATION + +class COtherResources : public CBase + { + public: + static COtherResources* NewL(); + static COtherResources* NewLC(); + ~COtherResources(); + + public: + + void SaveL(); + + public: + + TInt iActivation; + TInt iOperatorVariant; + TInt iAuditoryNotification; + TInt iPopupNotification; + TInt iPopupNotificationType; + TInt iEdgeDtmSupport; + TInt iSessionSetupMethod; + TInt iAutoRecord; + TInt iVideoLocation; + TInt iSipProfileId; + TInt iUiOrientation; + TInt iCapabilityQuery; + TInt iProductModeVariation; + TInt iEncodingDevice; + TInt iOnlyWithActiveCSCall; + TInt iOnlyIn3GNetwork; + TBuf iEncoderInfo; + TBuf iEncodingDeviceStr; + TInt iCameraUsage; + TInt iVideoDirection; + TInt iVideoBandwidth; + TInt iFastMode; + + private: + void ConstructL(); + void SetKeyValueL(const TUint32& aKey , TInt& aVal); + + private: + CRepository* iRepository; + }; + +class CPhoneResources : public CBase + { + public: + static CPhoneResources* NewL(); + static CPhoneResources* NewLC(); + ~CPhoneResources(); + + public : + void SaveL(); + + public: + TInt iCameraAvailability; + TInt iKeypadAvailability; + TInt iVideoPlayerAvailability; + TInt iCameraInformation; + TInt iKodiakPhoneCall; + + private : + void ConstructL(); + void SetValueL(TUid aCategory, TUint aKey, TInt aValue); + }; + +class CMusApplication : public CBase + { + public: + static CMusApplication* NewL(); + static CMusApplication* NewLC(); + ~CMusApplication(); + public : + + TBool Start(TInt aUseCase); + TBool Stop(); + TInt MonitorAvailability(); + TInt Availability(); + TBool AvailabilityInfo(); + void MusUseCaseInfo(TBool aStart); + private : + void HandleError(TInt aError , TPtrC aVal ); + public: + TInt iUseCase; + CMusManager *iMultimediasharing; + private : + void ConstructL(); + }; + + + +#endif + +// End of File + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/CenrepEditor/inc/cenrepeditorview1.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/CenrepEditor/inc/cenrepeditorview1.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,101 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef AVKONVIEWEXAMPLEVIEW_H +#define AVKONVIEWEXAMPLEVIEW_H + +// INCLUDES +#include +#include "cenrepeditormodel.h" + +// CONSTANTS +// UID of view +const TUid KViewId1 = {1}; + +// FORWARD DECLARATIONS +class CCenrepEditorView1Container; + +// CLASS DECLARATION + +/** +* CCenrepEditorView1 view class. +* +*/ +class CCenrepEditorView1 : public CAknView + { + public: // Constructors and destructor + + /** + * EPOC default constructor. + */ + void ConstructL(); + + /** + * Destructor. + */ + ~CCenrepEditorView1(); + + public: // Functions from base classes + + /** + * From CAknView returns Uid of View + * @return TUid uid of the view + */ + TUid Id() const; + + /** + * From MEikMenuObserver delegate commands from the menu + * @param aCommand a command emitted by the menu + * @return void + */ + void HandleCommandL(TInt aCommand); + + /** + * From CAknView reaction if size change + * @return void + */ + void HandleClientRectChange(); + + + CCenrepEditorView1Container * CCenrepEditorView1::Container(); + + private: + + /** + * From CAknView activate the view + * @param aPrevViewId + * @param aCustomMessageId + * @param aCustomMessage + * @return void + */ + void DoActivateL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId, + const TDesC8& aCustomMessage); + + /** + * From CAknView deactivate the view (free resources) + * @return void + */ + void DoDeactivate(); + + private: // Data + CCenrepEditorView1Container* iContainer; + }; + +#endif + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/CenrepEditor/inc/cenrepeditorview1container.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/CenrepEditor/inc/cenrepeditorview1container.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,93 @@ +/* +* Copyright (c) 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: +* +*/ + +#ifndef AVKONVIEWEXAMPLECONTAINER_H +#define AVKONVIEWEXAMPLECONTAINER_H + +// INCLUDES +#include +#include + +#include "cenrepeditorListbox.h" +#include "cenrepeditormodel.h" + +// CLASS DECLARATION +class CPhoneResourcesListbox; +/** +* CCenrepEditorView1Container container control class. +* +*/ +class CCenrepEditorView1Container : public CCoeControl + { + public: // Constructors and destructor + + /** + * EPOC default constructor. + * @param aRect Frame rectangle for container. + */ + void ConstructL(const TRect& aRect,TInt aResourceId, CPhoneResources* aPhoneResources); + + /** + * Store the Settings . + */ + void StoreSettingsL(); + + /** + * Destructor. + */ + ~CCenrepEditorView1Container(); + + public: // New functions + + + + public: // Functions from base classes + + private: // Functions from base classes + + /** + * From CoeControl,SizeChanged. + */ + void SizeChanged(); + + /** + * From CoeControl,CountComponentControls. + */ + TInt CountComponentControls() const; + + /** + * From CCoeControl,ComponentControl. + */ + CCoeControl* ComponentControl(TInt aIndex) const; + + /** + * From CCoeControl,Draw. + */ + void Draw(const TRect& aRect) const; + + + TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ); + + + private: //data + CPhoneResourcesListbox * iPhoneResourceListBox; + + }; + +#endif + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/CenrepEditor/inc/cenrepeditorview2.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/CenrepEditor/inc/cenrepeditorview2.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,97 @@ +/* +* Copyright (c) 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: +* +*/ + +#ifndef AVKONVIEWEXAMPLEVIEW2_H +#define AVKONVIEWEXAMPLEVIEW2_H + +// INCLUDES +#include +#include "cenrepeditormodel.h" + +// CONSTANTS +// UID of view +const TUid KViewId2 = {2}; + +// FORWARD DECLARATIONS +class CCenrepEditorView2Container; + +// CLASS DECLARATION + +/** +* CCenrepEditorView2 view class. +* +*/ +class CCenrepEditorView2 : public CAknView + { + public: // Constructors and destructor + + /** + * EPOC default constructor. + */ + void ConstructL(); + + /** + * Destructor. + */ + ~CCenrepEditorView2(); + + public: // Functions from base classes + + /** + * From CAknView returns Uid of View + * @return TUid uid of the view + */ + TUid Id() const; + + /** + * From MEikMenuObserver delegate commands from the menu + * @param aCommand a command emitted by the menu + * @return void + */ + void HandleCommandL(TInt aCommand); + + /** + * From CAknView reaction if size change + * @return void + */ + void HandleClientRectChange(); + + private: + + /** + * From CAknView activate the view + * @param aPrevViewId + * @param aCustomMessageId + * @param aCustomMessage + * @return void + */ + void DoActivateL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId, + const TDesC8& aCustomMessage); + + /** + * From CAknView deactivate the view (free resources) + * @return void + */ + void DoDeactivate(); + + private: // Data + CCenrepEditorView2Container* iContainer; + }; + +#endif + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/CenrepEditor/inc/cenrepeditorview2container.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/CenrepEditor/inc/cenrepeditorview2container.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,93 @@ +/* +* Copyright (c) 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: +* +*/ + +#ifndef AVKONVIEWEXAMPLECONTAINER2_H +#define AVKONVIEWEXAMPLECONTAINER2_H + +// INCLUDES +#include +#include + +#include "cenrepeditorListbox2.h" +#include "cenrepeditormodel.h" + +// CLASS DECLARATION + +/** +* CCenrepEditorView2Container container control class. +* +*/ +class CCenrepEditorView2Container : public CCoeControl + { + public: // Constructors and destructor + + /** + * EPOC default constructor. + * @param aRect Frame rectangle for container. + */ + void ConstructL(const TRect& aRect,TInt aResourceId,COtherResources* aOtherResources); + + /** + * Store the Settings . + */ + void StoreSettingsL(); + + /** + * Destructor. + */ + ~CCenrepEditorView2Container(); + + public: // New functions + + + + public: // Functions from base classes + + private: // Functions from base classes + + /** + * From CoeControl,SizeChanged. + */ + void SizeChanged(); + + /** + * From CoeControl,CountComponentControls. + */ + TInt CountComponentControls() const; + + /** + * From CCoeControl,ComponentControl. + */ + CCoeControl* ComponentControl(TInt aIndex) const; + + /** + * From CCoeControl,Draw. + */ + void Draw(const TRect& aRect) const; + + + TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ); + + + private: //data + COtherResourcesListbox * iOtherResourceListBox; + + }; + +#endif + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/CenrepEditor/inc/cenrepeditorview3.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/CenrepEditor/inc/cenrepeditorview3.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,102 @@ +/* +* Copyright (c) 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: +* +*/ + +#ifndef AVKONVIEWEXAMPLEVIEW3_H +#define AVKONVIEWEXAMPLEVIEW3_H + +// INCLUDES +#include +#include "cenrepeditormodel.h" + +// CONSTANTS +// UID of view +const TUid KViewId3 = {3}; + +// FORWARD DECLARATIONS +class CCenrepEditorView3Container; + +// CLASS DECLARATION + +/** +* CCenrepEditorView1 view class. +* +*/ +class CCenrepEditorView3 : public CAknView + { + public: // Constructors and destructor + + /** + * EPOC default constructor. + */ + void ConstructL(); + + /** + * Destructor. + */ + ~CCenrepEditorView3(); + + + public: // Functions from base classes + + /** + * From CAknView returns Uid of View + * @return TUid uid of the view + */ + TUid Id() const; + + /** + * From MEikMenuObserver delegate commands from the menu + * @param aCommand a command emitted by the menu + * @return void + */ + void HandleCommandL(TInt aCommand); + + /** + * From CAknView reaction if size change + * @return void + */ + void HandleClientRectChange(); + + protected : + + + + private: + + /** + * From CAknView activate the view + * @param aPrevViewId + * @param aCustomMessageId + * @param aCustomMessage + * @return void + */ + void DoActivateL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId, + const TDesC8& aCustomMessage); + + /** + * From CAknView deactivate the view (free resources) + * @return void + */ + void DoDeactivate(); + + private: // Data + CCenrepEditorView3Container* iContainer; + }; + +#endif + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/CenrepEditor/inc/cenrepeditorview3container.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/CenrepEditor/inc/cenrepeditorview3container.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,93 @@ +/* +* Copyright (c) 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: +* +*/ + +#ifndef AVKONVIEWEXAMPLECONTAINER_H +#define AVKONVIEWEXAMPLECONTAINER_H + +// INCLUDES +#include +#include + +#include "cenrepeditorListbox3.h" +#include "cenrepeditormodel.h" + +// CLASS DECLARATION +class CMusApplicationListbox; +/** +* CCenrepEditorView1Container container control class. +* +*/ +class CCenrepEditorView3Container : public CCoeControl + { + public: // Constructors and destructor + + /** + * EPOC default constructor. + * @param aRect Frame rectangle for container. + */ + void ConstructL(const TRect& aRect,TInt aResourceId, CMusApplication* aPhoneResources); + + /** + * Store the Settings . + */ + void StoreSettingsL(); + + /** + * Destructor. + */ + ~CCenrepEditorView3Container(); + + public: // New functions + + + + public: // Functions from base classes + + private: // Functions from base classes + + /** + * From CoeControl,SizeChanged. + */ + void SizeChanged(); + + /** + * From CoeControl,CountComponentControls. + */ + TInt CountComponentControls() const; + + /** + * From CCoeControl,ComponentControl. + */ + CCoeControl* ComponentControl(TInt aIndex) const; + + /** + * From CCoeControl,Draw. + */ + void Draw(const TRect& aRect) const; + + + virtual TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ); + + + private: //data + CMusApplicationListbox * iMusApplicationListbox; + + }; + +#endif + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/CenrepEditor/install/cenrepeditor.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/CenrepEditor/install/cenrepeditor.pkg Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,43 @@ +; +; 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: +; +; +; Installtion file for Cenrep Editor +; +;Languages +&EN +; +; UID is the app's UID +; +#{"CenrepEditor"},(0x102072D1),2,0,0 +; +; List of localised vendor names +%{"Vendor-EN"} + +; The non-localised, globally unique vendor name (mandatory) +:"Nokia OY" +;Supports Series 60 v 3.x +;This line indicates that this installation is for the Series 60 platform v3.x +;This line must appear _exactly_ as shown below in the sis file +;If this line is missing or incorrect, the sis file will not be able +;to be installed on Series 60 v3.x platforms +(0x101F7961), 0, 0, 0, {"Series60ProductID"} +; +; Three files to install +; +"\epoc32\release\armv5\udeb\CenrepEditor.exe" -"!:\sys\bin\CenrepEditor.exe" +"\epoc32\data\z\Resource\apps\cenrepeditor.rsc" -"!:\resource\apps\cenrepeditor.rsc" +"\epoc32\data\Z\private\10003a3f\apps\cenrepeditor_reg.rsc" -"!:\private\10003a3f\import\apps\cenrepeditor_reg.rsc" + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/CenrepEditor/install/cenrepeditor.sis Binary file tsrc/CenrepEditor/install/cenrepeditor.sis has changed diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/CenrepEditor/install/cenrepeditor_.sis Binary file tsrc/CenrepEditor/install/cenrepeditor_.sis has changed diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/CenrepEditor/install/sis_udeb.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/CenrepEditor/install/sis_udeb.bat Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,17 @@ +rem +rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +rem All rights reserved. +rem This component and the accompanying materials are made available +rem under the terms of "Eclipse Public License v1.0" +rem which accompanies this distribution, and is available +rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +rem +rem Initial Contributors: +rem Nokia Corporation - initial contribution. +rem +rem Contributors: +rem +rem Description: +rem + +makesis cenrepeditor.pkg cenrepeditor.sis diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/aknstub/inc/aknappui.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/aknstub/inc/aknappui.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,61 @@ +/* +* 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 __AKNAPPUI_H__ +#define __AKNAPPUI_H__ + + +//#include + + +class CAknAppUiBase + { + public: + + enum TAppUiOrientation + { + /** + * Use the default device screen rotation of the product for this + * application. This is the default rotation setting for an + * application, and it should be used by nearly all applications. + */ + EAppUiOrientationUnspecified, + /** + * Use a portrait screen rotation for this application. + * This should only be used when an application specifically wants + * portrait rotation. The device will select an appropriate portrait + * rotation, if one is available. + */ + EAppUiOrientationPortrait, + /** + * Use a landscape screen rotation for this application. + * This should only be used when an application specifically wants + * landscape rotation. The device will select an appropriate landscape + * rotation, if one is available. + */ + EAppUiOrientationLandscape, + /** + * Use the normal device screen rotation for this application. + * Both portrait and landscape screen rotations are possible. The + * application rotation follows device screen rotation. + */ + EAppUiOrientationAutomatic + }; + + }; + +#endif \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/aknstub/src/aknappui.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/aknstub/src/aknappui.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,21 @@ +/* +* 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 "aknappui.h" + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/centralrepositorystub/inc/centralrepository.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/centralrepositorystub/inc/centralrepository.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,302 @@ +/* +* 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: +* +*/ + + +#ifndef __CENTRALREPOSITORY_H__ +#define __CENTRALREPOSITORY_H__ + +// Stub includes +#include "mussettingskeys.h" +// Stub forward declarations +class CDesC8ArrayFlat; + +#include + +const TInt KCenRepStubGlobalKeyValueMaxLen = 20; // stub stuff + +namespace NCentralRepositoryConstants +/** Namespace encapsulating the CentralRepository constants. +@publishedAll +@released +*/ +{ + +/** The maximum number of unicode characters that can be stored in a setting +@publishedAll +@released +*/ +const TInt KMaxUnicodeStringLength = 1024; + +/** The maximum number of bytes that can be stored in a setting +@publishedAll +@released +*/ +const TInt KMaxBinaryLength = KMaxUnicodeStringLength*2; + +/** Error key returned by CommitTransaction in case of an error that cannot be +attributed to any single or partial key. Also notify value for spurious +notifications (eg when a notification is cancelled or several values change at once ) +@internalAll +@released +*/ +const TUint32 KUnspecifiedKey = 0xffffffffUL; + +/** Initial buffer size for Find~ API. Initial buffer is used to cut on the number +of IPC calls required for each Find~ API call. If the number of settings found is +less than or equal to KCentRepFindBufSize then all the settings can be retrieved with +a single IPC. +@internalAll +*/ +const TInt KCentRepFindBufSize = 16; + +/** Use KUnspecifiedKey instead of this value. +@publishedAll +@deprecated +*/ +const TUint32 KInvalidNotificationId = KUnspecifiedKey; + +/** The 8 most significant bits of a setting's meta-data are reserved for internal use. +Clients should not make use of the reserved bits (unless it is specifically stated +otherwise in Symbian developer documentation). Clients should not rely on the value +of the reserved bits. Reserved bits are not guaranteed to be 0 or 1 and are not +guaranteed to stay constant from one GetMeta call to the next. +@publishedPartner +@released +@see CRepository::GetMeta +@see KMetaUnreserved +*/ +const TUint32 KMetaSymbianReserved = 0xFF000000; + +/** The 24 least significant bits of a setting's meta-data are available for use. Clients +should make use of KMetaUnreserved to mask out the reserved bits following a call +to GetMeta. Clients should not rely on the value of the reserved bits. Reserved bits +are not guaranteed to be 0 or 1 and are not guaranteed to stay constant from one +GetMeta call to the next. +@publishedPartner +@released +@see CRepository::GetMeta +@see KMetaSymbianReserved +*/ +const TUint32 KMetaUnreserved = 0x00FFFFFF; + +} // namespace NCentralRepositoryConstants + +/** Provides access to a repository. + +There are potentially 2^32 repositories, each identified by a UID. Within each +repository up to 2^32 settings can be stored. Settings within a repository are +identified by a 32-bit key and may be of the types integer, real or descriptor. +@publishedAll +@released +*/ +class CRepository : public CBase + { +public: + + /** Transaction mode chosen with StartTransaction. + @publishedPartner + @released */ + enum TTransactionMode + { + /** Standard optimistic non-serialised transaction. Can be started at any time + Commit fails with KErrLocked if another client interrupts it by first committing + changes: transaction should be repeated until KErrLocked is not returned. */ + EConcurrentReadWriteTransaction = 2, + /** Pessimistic locking transaction intended for reading consistent values. + Can only be started if EReadWriteTransaction is not in progress. + Automatically promoted to EReadWriteTransaction on first write operation + if no other read transaction is in progress (or fails if not attainable). + Use ONLY if all clients can agree not to use EConcurrentReadWriteTransaction, + and only make changes in an EReadWriteTransaction. */ + EReadTransaction = 1, + /** Pessimistic locking transaction intended for writing values. Can only be + started if no EReadTransaction or EReadWriteTransactions are in progress. + Use ONLY if all clients can agree not to use EConcurrentReadWriteTransaction, + and only make changes in an EReadWriteTransaction. */ + EReadWriteTransaction = 3 + }; + + /** Buffer type for aKeyInfo parameter to asynchronous CommitTransaction. + @see CRepository::CommitTransaction(TDes8& aKeyInfo, TRequestStatus& aStatus) + @publishedPartner + @released + */ + typedef TPckgBuf TTransactionKeyInfoBuf; + + IMPORT_C static CRepository* NewL(TUid aRepositoryUid); + IMPORT_C static CRepository* NewLC(TUid aRepositoryUid); + + IMPORT_C virtual ~CRepository(); + + + IMPORT_C TInt Create(TUint32 aKey, TInt aValue); + //IMPORT_C TInt Create(TUint32 aKey, const TReal& aValue); + IMPORT_C TInt Create(TUint32 aKey, const TDesC8& aValue); + //IMPORT_C TInt Create(TUint32 aKey, const TDesC16& aValue); + //IMPORT_C TInt Delete(TUint32 aKey); + IMPORT_C TInt Delete(TUint32 aPartialKey, TUint32 aMask, TUint32 &aErrorKey) ; + + + IMPORT_C TInt Get(TUint32 aKey, TInt& aValue); + IMPORT_C TInt Set(TUint32 aKey, TInt aValue); + +/* + IMPORT_C TInt Get(TUint32 aKey, TReal& aValue); + IMPORT_C TInt Set(TUint32 aKey, const TReal& aValue); +*/ + IMPORT_C TInt Get(TUint32 aKey, TDes8& aValue); + //IMPORT_C TInt Get(TUint32 aId, TDes8& aValue, TInt& aActualLength); + IMPORT_C TInt Set(TUint32 aKey, const TDesC8& aValue); + + IMPORT_C TInt Get(TUint32 aKey, TDes16& aValue); + //IMPORT_C TInt Get(TUint32 aId, TDes16& aValue, TInt& aActualLength); + IMPORT_C TInt Set(TUint32 aKey, const TDesC16& aValue); +/* + IMPORT_C TInt GetMeta(TUint32 aKey, TUint32& aMeta); + + IMPORT_C TInt Move (TUint32 aSourcePartialKey, TUint32 aTargetPartialKey, + TUint32 aMask, TUint32 &aErrorKey) ; +*/ + IMPORT_C TInt FindL(TUint32 aPartialKey, TUint32 aMask, + RArray& aFoundKeys); +/* + IMPORT_C TInt FindEqL(TUint32 aPartialKey, TUint32 aMask, + TInt aValue, RArray& aFoundKeys); + IMPORT_C TInt FindEqL(TUint32 aPartialKey, TUint32 aMask, + const TReal& aValue, RArray& aFoundKeys); +*/ + IMPORT_C TInt FindEqL(TUint32 aPartialKey, TUint32 aMask, + const TDesC8& aValue, RArray& aFoundKeys); +/* + IMPORT_C TInt FindEqL(TUint32 aPartialKey, TUint32 aMask, + const TDesC16& aValue, RArray& aFoundKeys); + + IMPORT_C TInt FindNeqL(TUint32 aPartialKey, TUint32 aMask, + TInt aValue, RArray& aFoundKeys); + IMPORT_C TInt FindNeqL(TUint32 aPartialKey, TUint32 aMask, + const TReal& aValue, RArray& aFoundKeys); + IMPORT_C TInt FindNeqL(TUint32 aPartialKey, TUint32 aMask, + const TDesC8& aValue, RArray& aFoundKeys); + IMPORT_C TInt FindNeqL(TUint32 aPartialKey, TUint32 aMask, + const TDesC16& aValue, RArray& aFoundKeys); + + IMPORT_C TInt NotifyRequest(TUint32 aKey, TRequestStatus& aStatus); + IMPORT_C TInt NotifyRequest(TUint32 aPartialKey, TUint32 aMask, + TRequestStatus& aStatus); + + IMPORT_C TInt NotifyCancel(TUint32 aKey); + IMPORT_C TInt NotifyCancel(TUint32 aPartialKey, TUint32 aMask); + IMPORT_C TInt NotifyCancelAll(); + + IMPORT_C TInt Reset(); + IMPORT_C TInt Reset(TUint32 aKey); +*/ + + IMPORT_C TInt StartTransaction(TTransactionMode aMode); + //IMPORT_C void StartTransaction(TTransactionMode aMode, TRequestStatus& aStatus); + IMPORT_C TInt CommitTransaction(TUint32& aKeyInfo); + //IMPORT_C void CommitTransaction(TDes8& aKeyInfo, TRequestStatus& aStatus); + //IMPORT_C void CancelTransaction(); + //IMPORT_C void CleanupCancelTransactionPushL(); + //IMPORT_C void FailTransaction(); + //IMPORT_C void CleanupFailTransactionPushL(); + + /** Same as CancelTransaction. + @publishedPartner + @released + @see CancelTransaction */ +/* + inline void RollbackTransaction() + { + CancelTransaction(); + } +*/ + /** Same as CleanupCancelTransactionPushL. + @publishedPartner + @released + @see CleanupCancelTransactionPushL */ +/* + inline void CleanupRollbackTransactionPushL() + { + CleanupCancelTransactionPushL(); + } +*/ +// IMPORT_C TInt TransactionState(); + + /** This API is for internal use only and for testing purposes. + @internalAll + */ +// IMPORT_C static TInt SetGetParameters(const TIpcArgs& aArgs); + + + + +private: // Stub functions + + CRepository( TUid aRepositoryUid ); + +public: // Stub functios + + void ResetKeysAndValues(); + // Setter for static variable staticAvcConfigKeys. Reserves heap. + static void SetStubAvcConfigKeysL( const TDesC8& aConfigKeys ); + // Deletes heap reserved by previous function. + static void DeleteStubAvcConfigKeys(); + + // Setter for static cenrep val, note amount of globals is limited + static TInt SetStubGlobal(TUint32 aKey, TInt aValue); + static void ResetStubGlobal(); + + +public: // Stub data + + static MusSettingsKeys::TOperatorVariant iOperatorVariant; + + // If the following value is ETrue, CenRep UID KCRUidSIPClientResolverConfig + // exists and respository is possible to create with this value. Otherwise + // CenRep instantiation leaves with KErrNone. + static TBool iEmulateSawfishRepository; + + RArray iKeys; + RArray iValues; + RArray iDesC8Keys; + CDesC8ArrayFlat* iDesC8Values; + + static TInt iForceFailWithCode; + + static HBufC8* iStaticAvcConfigKeys; + static TBool iStaticWriteAvcKeysToStaticData; + + static TInt iStaticEncoderUid; + + class TCenRepStubKeyValueEntry + { + public: + TUint iKey; + TInt iVal; + }; + + static TCenRepStubKeyValueEntry iGlobalKeyVals[ KCenRepStubGlobalKeyValueMaxLen ]; + static TInt iGlobalKeyValsTop; + + TUid iRepositoryUid; + + + + }; + +#endif // __CENTRALREPOSITORY_H__ diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/centralrepositorystub/src/centralrepositorystub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/centralrepositorystub/src/centralrepositorystub.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,530 @@ +/* +* Copyright (c) 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: +* +*/ + + +#include "mussettingskeys.h" +#include "centralrepository.h" +#include "e32property.h" +#include + +/// CenRep UIDs and keys +const TUid KCRUidSIPClientResolverConfig = { 0x10282EE7 }; + +const TUid KCRUidInCallVolume = {0x102828B1}; +const TUint32 KTelIncallEarVolume = 0x00000001; +const TUint32 KTelIncallLoudspeakerVolume = 0x00000002; + + +// Values for static variables +MusSettingsKeys::TOperatorVariant CRepository::iOperatorVariant = + MusSettingsKeys::EStandard; +TBool CRepository::iEmulateSawfishRepository = EFalse; +HBufC8* CRepository::iStaticAvcConfigKeys = NULL; +TBool CRepository::iStaticWriteAvcKeysToStaticData = EFalse; +TInt CRepository::iForceFailWithCode = KErrNone; +TInt CRepository::iStaticEncoderUid = 0; +CRepository::TCenRepStubKeyValueEntry CRepository::iGlobalKeyVals[ KCenRepStubGlobalKeyValueMaxLen ]; +TInt CRepository::iGlobalKeyValsTop = 0; + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CRepository* CRepository::NewL( TUid aRepositoryUid ) + { + CRepository* self = CRepository::NewLC( aRepositoryUid ); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CRepository* CRepository::NewLC( TUid aRepositoryUid ) + { + CRepository* self = new (ELeave) CRepository( aRepositoryUid ); + CleanupStack::PushL( self ); + + // This UID cannot be used in normal variant + if ( aRepositoryUid == KCRUidSIPClientResolverConfig && + !iEmulateSawfishRepository ) + { + User::Leave( KErrNotFound ); + } + + // Add a few keys + if ( self->iRepositoryUid == KCRUidInCallVolume ) + { + User::LeaveIfError( self->Set ( KTelIncallEarVolume, 4 ) ); + User::LeaveIfError( self->Set ( KTelIncallLoudspeakerVolume, 4 ) ); + } + else if ( self->iRepositoryUid == MusSettingsKeys::KRepositoryUid ) + { + // Set default values for numeric values which are not handled by static + // variables + User::LeaveIfError( + self->Set ( MusSettingsKeys::KActivation, + MusSettingsKeys::EAlwaysActive ) ); + User::LeaveIfError( + self->Set ( MusSettingsKeys::KAuditoryNotification, + MusSettingsKeys::EAuditoryNotificationOff ) ); + User::LeaveIfError( + self->Set ( MusSettingsKeys::KPopupNotification, + MusSettingsKeys::EPopupNotificationOff ) ); + User::LeaveIfError( + self->Set ( MusSettingsKeys::KPopupNotificationType, + MusSettingsKeys::ENotificationTypeQueryUser ) ); + User::LeaveIfError( + self->Set ( MusSettingsKeys::KEdgeDtmSupport, + MusSettingsKeys::EDtmModeNotAllowed ) ); + User::LeaveIfError( + self->Set ( MusSettingsKeys::KForceInternetSignaling, + MusSettingsKeys::EFollowProfileConfiguration ) ); + User::LeaveIfError( + self->Set ( MusSettingsKeys::KAutoRecord, + MusSettingsKeys::EAutoRecordOn ) ); + User::LeaveIfError( + self->Set ( MusSettingsKeys::KSipProfileId, + 0 /*default profile*/ ) ); + + User::LeaveIfError( + self->Set ( MusSettingsKeys::KUiOrientation, + MusSettingsKeys::EPortrait ) ); + User::LeaveIfError( + self->Set ( MusSettingsKeys::KCapabilityQuery, + MusSettingsKeys::ENoOptions ) ); + + // No variation keys defined + } + + self->iDesC8Values = new (ELeave) CDesC8ArrayFlat( 1 ); + + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CRepository::~CRepository() + { + iKeys.Close(); + iValues.Close(); + iDesC8Keys.Close(); + delete iDesC8Values; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CRepository::Create(TUint32 /*aKey*/, TInt /*aValue*/ ) + { + return KErrNotSupported; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CRepository::Create(TUint32 /*aKey*/, const TDesC8& /*aValue*/) + { + return KErrNotSupported; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CRepository::Delete( TUint32 /*aPartialKey*/, + TUint32 /*aMask*/, + TUint32& /*aErrorKey*/ ) + { + return KErrNotSupported; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CRepository::Get(TUint32 aKey, TInt& aValue) + { + // fail simulation + if ( iForceFailWithCode != KErrNone ) + { + TInt returnValue = iForceFailWithCode; + iForceFailWithCode = KErrNone; + return returnValue; + } + + // Setting of encoding device + if ( iRepositoryUid == MusSettingsKeys::KRepositoryUid && + aKey == MusSettingsKeys::KEncodingDevice ) + { + aValue = CRepository::iStaticEncoderUid; + return KErrNone; + } + + if ( iRepositoryUid == MusSettingsKeys::KRepositoryUid && + aKey == MusSettingsKeys::KOperatorVariant ) + { + aValue = CRepository::iOperatorVariant; + return KErrNone; + } + + TInt err = RProperty::Get( MusSettingsKeys::KRepositoryUid, aKey, aValue ); + if ( err != KErrNone ) + { + for ( TInt i = 0; i < iKeys.Count(); ++i ) + { + if ( iKeys[i] == aKey ) + { + aValue = iValues[i]; + return KErrNone; + } + } + } + if ( iGlobalKeyValsTop >= 0 && iGlobalKeyValsTop < KCenRepStubGlobalKeyValueMaxLen ) + { + for ( TInt i = 0; i < iGlobalKeyValsTop; i++ ) + { + if ( iGlobalKeyVals[ i ].iKey == aKey ) + { + aValue = CRepository::iGlobalKeyVals[ i ].iVal; + return KErrNone; + } + } + } + return err; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CRepository::Get(TUint32 aKey, TDes8& aValue ) + { + // fail simulation + if ( iForceFailWithCode != KErrNone ) + { + TInt returnValue = iForceFailWithCode; + iForceFailWithCode = KErrNone; + return returnValue; + } + + if ( aKey == MusSettingsKeys::KEncoderConfigurationInfo && + iStaticAvcConfigKeys ) + { + // Use static data instead of member data + aValue.Copy( *iStaticAvcConfigKeys ); + return KErrNone; + } + + for ( TInt i = 0; i < iDesC8Keys.Count(); ++i ) + { + if ( iDesC8Keys[i] == aKey ) + { + TPtrC8 value = iDesC8Values->MdcaPoint( i ); + aValue.Copy( value ); + return KErrNone; + } + } + + return KErrNotFound; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CRepository::Set( TUint32 aKey, const TDesC8& aValue ) + { + TBool error( EFalse ); + + // fail simulation + if ( iForceFailWithCode != KErrNone ) + { + error = iForceFailWithCode; + iForceFailWithCode = KErrNone; + return error; + } + + TBool keyFound( EFalse ); + + // Replace possibly existing value + for ( TInt i = 0; i < iDesC8Keys.Count(); ++i ) + { + if ( iDesC8Keys[i] == aKey ) + { + iDesC8Values->Delete( i ); + iDesC8Values->Compress(); + TRAP( error, iDesC8Values->InsertL( i, aValue ) ); + if ( error != KErrNone ) + { + return error; + } + + keyFound = ETrue; + } + } + + // If no existing value, add new one + if ( !keyFound ) + { + error = iDesC8Keys.Append( aKey ); + if ( error == KErrNone ) + { + TRAP( error, iDesC8Values->AppendL( aValue ) ) + } + } + + if ( iStaticWriteAvcKeysToStaticData && + aKey == MusSettingsKeys::KEncoderConfigurationInfo ) + { + // Write also to static data + TRAP( error, SetStubAvcConfigKeysL( aValue ) ); + } + + return error; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CRepository::Get(TUint32 aKey, TDes& aValue) + { + // fail simulation + if ( iForceFailWithCode != KErrNone ) + { + TInt returnValue = iForceFailWithCode; + iForceFailWithCode = KErrNone; + return returnValue; + } + + _LIT( KSampleValue, "\\data\\videos\\"); + TInt err = RProperty::Get( MusSettingsKeys::KRepositoryUid, aKey, aValue ); + if ( err != KErrNone ) + { + aValue.Append( KSampleValue() ); + } + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CRepository::Set(TUint32 /*aKey*/, const TDesC& /*aValue*/) + { + return KErrNotSupported; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CRepository::Set(TUint32 aKey, TInt aValue) + { + // fail simulation + if ( iForceFailWithCode != KErrNone ) + { + TInt returnValue = iForceFailWithCode; + iForceFailWithCode = KErrNone; + return returnValue; + } + + // Setting of encoding device + if ( iRepositoryUid == MusSettingsKeys::KRepositoryUid && + aKey == MusSettingsKeys::KEncodingDevice ) + { + CRepository::iStaticEncoderUid = aValue; + return KErrNone; + } + + // Setting of operator variant value + if ( iRepositoryUid == MusSettingsKeys::KRepositoryUid && + aKey == MusSettingsKeys::KOperatorVariant ) + { + CRepository::iOperatorVariant = + ( MusSettingsKeys::TOperatorVariant ) aValue; + return KErrNone; + } + + RProperty::Set( MusSettingsKeys::KRepositoryUid, aKey, aValue ); + + // Setting of any other value + for ( TInt i = 0; i < iKeys.Count(); ++i ) + { + if ( iKeys[i] == aKey ) + { + iValues[i] = aValue; + return KErrNone; + } + } + + // No wise error handling implemented + TInt error = iKeys.Append( aKey ); + if ( error == KErrNone ) + { + error = iValues.Append( aValue ); + } + + return error; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CRepository::FindL( TUint32 /*aPartialKey*/, + TUint32 /*aMask*/, + RArray& /*aFoundKeys*/ ) + { + User::Leave( KErrNotSupported ); + return KErrNotSupported; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CRepository::FindEqL( TUint32 /*aPartialKey*/, + TUint32 /*aMask*/, + const TDesC8& /*aValue*/, + RArray& /*aFoundKeys*/ ) + { + User::Leave( KErrNotSupported ); + return KErrNotSupported; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CRepository::StartTransaction( TTransactionMode /*aMode*/ ) + { + return KErrNotSupported; + } + + +/// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CRepository::CommitTransaction(TUint32& /*aKeyInfo*/) + { + return KErrNotSupported; + } + + + +// ------- Functions that are not present in real CRepository but are ---------- +// ------- defined here exclusively for stubbing purposes ---------- + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CRepository::ResetKeysAndValues() + { + iKeys.Reset(); + iValues.Reset(); + + iDesC8Keys.Reset(); + iDesC8Values->Reset(); + + iEmulateSawfishRepository = EFalse; + + delete iStaticAvcConfigKeys; + iStaticAvcConfigKeys = NULL; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CRepository::SetStubAvcConfigKeysL( const TDesC8& aConfigKeys ) + { + HBufC8* newConfigKeys = aConfigKeys.AllocL(); + CRepository::DeleteStubAvcConfigKeys(); + iStaticAvcConfigKeys = newConfigKeys; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// + +void CRepository::DeleteStubAvcConfigKeys() + { + delete iStaticAvcConfigKeys; + iStaticAvcConfigKeys = NULL; + } + +void CRepository::ResetStubGlobal() + { + iGlobalKeyValsTop = 0; + } + +TInt CRepository::SetStubGlobal(TUint32 aKey, TInt aValue) + { + for ( TInt i = 0; i < iGlobalKeyValsTop; i++ ) + { + if ( iGlobalKeyVals[ i ].iKey == aKey ) + { + iGlobalKeyVals[ i ].iVal = aValue; + return KErrNone; + } + } + + if ( iGlobalKeyValsTop >= KCenRepStubGlobalKeyValueMaxLen ) + { + return KErrNoMemory; + } + iGlobalKeyVals[ iGlobalKeyValsTop ].iKey = aKey; + iGlobalKeyVals[ iGlobalKeyValsTop ].iVal = aValue; + iGlobalKeyValsTop++; + return KErrNone; + } +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CRepository::CRepository( TUid aRepositoryUid ) + :iRepositoryUid( aRepositoryUid ) + { + + } + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/cmusavainterfacestub/inc/cmusavainterfacestub.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/cmusavainterfacestub/inc/cmusavainterfacestub.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,152 @@ +/* +* Copyright (c) 2006-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: Stub class used for unit testing +* +*/ + + +#ifndef CMUSAVAINTERFACESTUB_H +#define CMUSAVAINTERFACESTUB_H + +#include "mmusavasettingsstub.h" +#include "musavaobserver.h" +#include "musavainterface.h" +#include "musunittesting.h" + +class CMusAvaAvailability; +class CMusAvaAvailabilityObserverImp; + +/** + * Class that provides a stub implementation of CMusAvainterface class. + * Used for unit testing other classes. + * + * @since S60 v3.2 + */ +class CMusAvaInterface2 : public CMusAvaInterface, MMusAvaObserver + { + +public: + + static CMusAvaInterface2* NewL(); + + /** + * Destructor. + */ + virtual ~CMusAvaInterface2(); + + /** + * Requests the implementation to provide availabilites. + * + * @since S60 v3.2 + */ + virtual void Availability(); + + /** + * Called by the ECOM framework when MusAvailability Plug-in is request + * retuns setting interface for the client. + * + * @since S60 v3.2 + * @return Returns reference to multimediasharing avaialability settings. + */ + virtual MMusAvaSettings& Settings(); + + /** + * Called by the ECOM framework when MusAvailability Plug-in is for + * setting Observer interface for the client. + * + * @since S60 v3.2 + * @param aObserver Reference to observer interface. + */ + virtual void SetObserver( MMusAvaObserver& aObserver ); + + /** + * Called by the ECOM framework when MusAvailability Plug-in is request + * to investigate availabilites for the client. + * + * @since S60 v3.2 + */ + void StartL(); + + /** + * Called by the ECOM framework when MusAvailability Plug-in is request + * to stop investigate or monitoring availabilites for the client. + * + * @since S60 v3.2 + */ + void Stop(); + + + virtual MMusAvaObserver::TAvailabilityName CurrentAvailability(); // tbd:availabilityname + virtual MMusAvaObserver::TAvailabilityStatus AvailabilityStatus(); + virtual TBool MinimumAvailability(); + virtual TBool MandatoryAvailability(); + virtual TBool ExtensionAvailability(); + virtual TBool Available( MMusAvaObserver::TAvailabilityName aAvailability ); + virtual MMusAvaObserver::TAvailabilityStatus AvailabilityState( MMusAvaObserver::TAvailabilityName aAvailability ); + virtual void PrepareForReceivedInviteL(); + +public: //From MMusAvaObserver + + /** + * Availability report + * + * @since S60 v3.2 + * @param aStatus New status for availability. + */ + virtual void AvailabilityChanged( + TAvailabilityName aName, + TAvailabilityStatus aStatus ); + + virtual void AvailabilityError( + TAvailabilityName aName, + TAvailabilityStatus aStatus ); + virtual void SetSettingsObserver( MMusAvaSettingsObserver& aObserver ); + +private: + + CMusAvaInterface2(); + + void ConstructL(); + +public: //data + + TBool iStart; + +private: // data + + /** + * Instance of settings class stub. + * Own. + */ + CMusAvaSettings2* iSettings; + + /** + * Pointer to observer interface. + * Not own. + */ + MMusAvaObserver* iObserver; + + + RPointerArray iAvailabilities; + + MMusAvaObserver::TAvailabilityName iCurrentAvailability; + MMusAvaObserver::TAvailabilityStatus iAvailabilityStatus; + + CMusAvaAvailabilityObserverImp* iMusAvailObs; + + MUS_UNITTEST( UT_CMusAvailabilityPluginManager ) + MUS_UNITTEST( UT_CMusManagerServerCore ) + }; + +#endif // CMUSAVAINTERFACESTUB_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/cmusavainterfacestub/src/cmusavainterfacestub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/cmusavainterfacestub/src/cmusavainterfacestub.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,347 @@ +/* +* 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: Stub class of CMusAvaInterface to support unit testing. +* +*/ + + +#include "cmusavainterfacestub.h" +#include "musavaavailabilitystub.h" +#include "mmusavasettingsstub.h" +#include "musavaavailability.h" +#include "musavaavailabilityobserverimp.h" + +const MMusAvaObserver::TAvailabilityName KMinimumAvailability + = MMusAvaObserver::EMusAvaBearerStatus; + +const MMusAvaObserver::TAvailabilityName KMandatoryAvailability + = MMusAvaObserver::EMusAvaNameRegistration; + +const MMusAvaObserver::TAvailabilityName KExtensionAvailability + = MMusAvaObserver::EMusAvaOptionHandler; + +// ======== MEMBER FUNCTIONS ======== + + +CMusAvaInterface2* CMusAvaInterface2::NewL() + { + CMusAvaInterface2* self = new( ELeave ) CMusAvaInterface2(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +CMusAvaInterface2::~CMusAvaInterface2() + { + iAvailabilities.ResetAndDestroy(); + iAvailabilities.Close(); + delete iSettings; + delete iMusAvailObs; + } + + +CMusAvaInterface2::CMusAvaInterface2() + { + } + + +void CMusAvaInterface2::ConstructL() + { + iSettings = new(ELeave)CMusAvaSettings2(); + iSettings->ConstructL(); + // Create network availability stub + iMusAvailObs = CMusAvaAvailabilityObserverImp::NewL(); + CMusAvaAvailabilityStub* stub = CMusAvaAvailabilityStub::NewLC( *iMusAvailObs, *iSettings ); + iAvailabilities.AppendL( stub ); + CleanupStack::Pop( stub ); + } + + +// --------------------------------------------------------------------------- +// Requests the implementation to provide availabilites. +// --------------------------------------------------------------------------- +// +void CMusAvaInterface2::Availability() + { + + } + + +// --------------------------------------------------------------------------- +// Called by the ECOM framework when MusAvailability Plug-in is request +// retuns setting interface for the client. +// --------------------------------------------------------------------------- +// +MMusAvaSettings& CMusAvaInterface2::Settings() + { + return *iSettings; + } + + +// --------------------------------------------------------------------------- +// Called by the ECOM framework when MusAvailability Plug-in is for +// setting Observer interface for the client. +// --------------------------------------------------------------------------- +// +void CMusAvaInterface2::SetObserver( MMusAvaObserver& aObserver ) + { + iObserver = &aObserver; + } + + +// --------------------------------------------------------------------------- +// Called by the ECOM framework when MusAvailability Plug-in is request +// to investigate availabilites for the client. +// --------------------------------------------------------------------------- +// +void CMusAvaInterface2::StartL() + { + + } + + +// --------------------------------------------------------------------------- +// Called by the ECOM framework when MusAvailability Plug-in is request +// to stop investigate or monitoring availabilites for the client. +// --------------------------------------------------------------------------- +// +void CMusAvaInterface2::Stop() + { + } + + +// ----------------------------------------------------------------------------- +// tbd +// ----------------------------------------------------------------------------- +// +MMusAvaObserver::TAvailabilityName CMusAvaInterface2::CurrentAvailability() + { + return iCurrentAvailability; + } + + +// ----------------------------------------------------------------------------- +// tbd +// ----------------------------------------------------------------------------- +// +MMusAvaObserver::TAvailabilityStatus CMusAvaInterface2::AvailabilityStatus() + { + return iAvailabilityStatus; + } + + +// ----------------------------------------------------------------------------- +// tbd +// ----------------------------------------------------------------------------- +// +TBool CMusAvaInterface2::MinimumAvailability() + { + return iCurrentAvailability > KMinimumAvailability; + } + + +// ----------------------------------------------------------------------------- +// tbd +// ----------------------------------------------------------------------------- +// +TBool CMusAvaInterface2::MandatoryAvailability() + { + return iCurrentAvailability > KMandatoryAvailability; + } + + +// ----------------------------------------------------------------------------- +// tbd +// ----------------------------------------------------------------------------- +// +TBool CMusAvaInterface2::ExtensionAvailability() + { + return iCurrentAvailability > KExtensionAvailability; + } + + +// ----------------------------------------------------------------------------- +// tbd +// ----------------------------------------------------------------------------- +// +TBool CMusAvaInterface2::Available( + MMusAvaObserver::TAvailabilityName aAvailability ) + { + return iCurrentAvailability > aAvailability + || ( iCurrentAvailability == aAvailability + && MMusAvaObserver::EMusAvaStatusAvailable == iAvailabilityStatus ); + } + + +// ----------------------------------------------------------------------------- +// tbd +// ----------------------------------------------------------------------------- +// +MMusAvaObserver::TAvailabilityStatus CMusAvaInterface2::AvailabilityState( + MMusAvaObserver::TAvailabilityName aAvailability ) + { + for ( TInt i = 0; i < iAvailabilities.Count(); i++ ) + { + if ( iAvailabilities[i]->Name() == aAvailability ) + { + return iAvailabilities[i]->State(); + } + } + return MMusAvaObserver::EMusAvaStatusNotExecuted; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusAvaInterface2::PrepareForReceivedInviteL() + { + for ( TInt i = 0; i < iAvailabilities.Count(); i++ ) + { + iAvailabilities[i]->PrepareForReceivedInviteL(); + } + } + +void CMusAvaInterface2::AvailabilityChanged( + TAvailabilityName aName, + TAvailabilityStatus aStatus ) + { + + } + +void CMusAvaInterface2::AvailabilityError( + TAvailabilityName aName, + TAvailabilityStatus aStatus ) + { + + } + +void CMusAvaInterface2::SetSettingsObserver( MMusAvaSettingsObserver& aObserver ) + { + } + +// ======== GLOBAL FUNCTIONS ======== + + +CImplementationInformation::CImplementationInformation() + { + + } + + +// ----------------------------------------------------------------------------- +// CImplementationInformation::~CImplementationInformation +// ----------------------------------------------------------------------------- +// +CImplementationInformation::~CImplementationInformation() + { + delete iData; + delete iDisplayName; + delete iOpaqueData; + } + +CImplementationInformation* CImplementationInformation::NewL( + TUid aUid, + TInt aVersion, + HBufC* aName, + HBufC8* aDataType, + HBufC8* aOpaqueData, + TDriveUnit aDrive, + TBool aRomOnly, + TBool aRomBased) + { + CImplementationInformation* self = new(ELeave)CImplementationInformation(); + CleanupStack::PushL(self); + self->iData = aDataType; + self->iDisplayName = aName; + self->iOpaqueData = aOpaqueData; + CleanupStack::Pop(self); + return self; + //return new (ELeave) CImplementationInformation(); + } + +void REComSession::DestroyedImplementation( TUid ) + { + + } + + +void REComSession::ListImplementationsL( + TUid /*aInterfaceUid*/, + RImplInfoPtrArray &aImplInfoArray ) + { + TUid uid = { 0x10101010 }; + TDriveUnit drive; + HBufC* name( NULL ); + HBufC8* type( NULL ); + + CImplementationInformation* info = + CImplementationInformation::NewL( uid, + 1, + name, + type, + type, + drive, + EFalse, + EFalse ); + CleanupStack::PushL( info ); + + aImplInfoArray.AppendL( info ); + + CleanupStack::Pop( info ); + + } + + +TAny* REComSession::CreateImplementationL( + TUid /*aImplementationUid*/, + TInt32 /*aDtorIDKey*/ ) + { + return CMusAvaInterface2::NewL(); + } + + + +// ----------------------------------------------------------------------------- +// REComSession::ListImplementationsL +// ----------------------------------------------------------------------------- +// +void REComSession::ListImplementationsL( + TUid aInterfaceUid, + const TEComResolverParams& resolverParams, + RImplInfoPtrArray& aImplInfoArray) + { + _LIT8(KDefaultEngineName,"MultimediaSharing"); + + TUid uid(aInterfaceUid); + TInt version = 1; + HBufC* name = _L("dummy").AllocLC(); + HBufC8* dataType = _L8("MultimediaSharing").AllocLC(); + HBufC8* opaqueData = _L8("dummy").AllocLC(); + TDriveUnit drive; + TBool romOnly(ETrue); + TBool romBased(ETrue); + CImplementationInformation* info = + CImplementationInformation::NewL(uid,version,name,dataType, + opaqueData,drive,romOnly,romBased); + CleanupStack::Pop(3); + CleanupStack::PushL(info); + aImplInfoArray.AppendL(info); + CleanupStack::Pop(info); + } + +// End of File + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/contactenginestub/inc/contactenginestub.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/contactenginestub/inc/contactenginestub.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,43 @@ +/* +* 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 __CONTACTENGINESTUB_H__ +#define __CONTACTENGINESTUB_H__ + +#include + +enum TContactEngineCalledFunction + { + EContactEngineStubNone, + EContactEngineStubSetText + }; + +class ContactEngineStubHelper + { +public: + + static void Reset(); + static void SetErrorCode(TInt aVal); + static TContactEngineCalledFunction GetCalledFunction(); + static void SetSIPFieldFound( TBool aFound ); + static void SetSIPFieldInfoFound( TBool aFound ); + + }; + + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/contactenginestub/src/contactenginestub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/contactenginestub/src/contactenginestub.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,97 @@ +/* +* 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 "contactenginestub.h" + +#include +#include +#include +#include + +static TInt iValue = KErrNone; +static TContactEngineCalledFunction iFunc = EContactEngineStubNone; +static TBool iFindField = EFalse; +static TBool iFindFieldInfo = ETrue; +static CContactTextField iTextField; + +// ----------------------------------------------------------------------------- +// CContactTextField +// ----------------------------------------------------------------------------- +// +void CContactTextField::SetTextL(const TDesC& /*aText*/) + { + iFunc = EContactEngineStubSetText; + } + +CContactTextField::~CContactTextField() + { + + } + +void CContactTextField::InternalizeL(RReadStream& /*aStream*/) + { + + } +void CContactTextField::ExternalizeL(RWriteStream& /*aStream*/) const + { + + } +TStreamId CContactTextField::StoreL(CStreamStore& /*aStore*/) const + { + return TStreamId( 0 ); + } + +void CContactTextField::RestoreL(CStreamStore& /*aStore*/,RReadStream& /*aStream*/) + { + + } + +TBool CContactTextField::IsFull() const + { + return EFalse; + } + +// ----------------------------------------------------------------------------- +// ContactEngineStubHelper +// ----------------------------------------------------------------------------- +// +void ContactEngineStubHelper::Reset() + { + iValue = KErrNone; + iFunc = EContactEngineStubNone; + iFindField = EFalse; + iFindFieldInfo = ETrue; + } + +void ContactEngineStubHelper::SetErrorCode( TInt aVal ) + { + iValue = aVal; + } + +TContactEngineCalledFunction ContactEngineStubHelper::GetCalledFunction() + { + return iFunc; + } + +void ContactEngineStubHelper::SetSIPFieldFound( TBool aFound ) + { + iFindField = aFound; + } + +void ContactEngineStubHelper::SetSIPFieldInfoFound( TBool aFound ) + { + iFindFieldInfo = aFound; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/drmstub/inc/drmcommon.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/drmstub/inc/drmcommon.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,697 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Declaration of class DRMCommon for accessing common +* DRM functions +* +*/ + + +#ifndef DRMCOMMON_H +#define DRMCOMMON_H + +#include +#include +#include + +const TUint KDrmMaxContentInfoSize = 512; + +// Stub constant +_LIT( KMusDrmProtectedFileName, "protectedfile.mp4" ); + +// FORWARD DECLARATIONS +class TDataType; + +// CLASS DECLARATION + +/** +* DRMCommon: provides common DRM functions. +* +* @lib DRMCommon.dll +* @since 2.0 +*/ +class DRMCommon: public CBase + { +public: // Data Types + enum + { + EPlay = ContentAccess::EPlay, + EDisplay = ContentAccess::EView, + EExecute = ContentAccess::EExecute, + EPrint = ContentAccess::EPrint, + EInstall = ContentAccess::EInstall, + }; + + enum TConsumeAction + { + EStart, + EFinish, + }; + + enum + { + EOk = KErrNone, + EGeneralError = -30100, + EUnknownMIME = -30101, + EVersionNotSupported = -30102, + ESessionError = -30103, + ENoRights = KErrCANoRights, + ERightsDBCorrupted = -30105, + EUnsupported = KErrCANotSupported, + ERightsExpired = KErrCANoPermission, + EInvalidRights = -30108, + EPaddingFailed = -30109, + EFileError = -30110 + }; + + enum TContentProtection + { + ENoDCFFile, + EForwardLocked, + ESuperDistributable + }; + + enum TOMALevel + { + EOMA_None, + EOMA_1_0, + EOMA_2_0 + }; + + enum + { + EForwardLock = 0x0001, + ECombinedDelivery = 0x0002, + ESeparateDelivery = 0x0004, + ESuperDistribution = 0x0008 + }; + +public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static DRMCommon* NewL(void); + + /** + * Destructor. + */ + IMPORT_C virtual ~DRMCommon(void); + + public: // New functions + + /** + * Version + * + * Returns the version of this API. + * + * @since 2.0 + * @return Version of the API + */ + //IMPORT_C static TVersion Version(void); + + /** + * ServerVersion + * + * Returns the version of the DRM Engine. + * + * @since 2.0 + * @return Version of the DRM Engine + */ + //IMPORT_C static TVersion ServerVersion(void); + + /** + * Connect + * + * Connect to the DRM Engine. + * + * @since 2.0 + * @return EOk if the connection has been made + */ + IMPORT_C TInt Connect(void); + + /** + * Disconnect + * + * Disconnect the current connection. + * + * @since 2.0 + * @return EOk if the connection has been disconnected + */ + IMPORT_C TInt Disconnect(void); + + /** + * CheckContentRights + * + * Takes a Content URI and a rights specification. + * Checks if the specified rights can be exercised with this content + * by looking up the content URI in the rights database and checking + * the stored rights. + * + * @since 2.0 + * @param aContentURI: the content URI of the content to be tested + * @param aRightsSpec: The rights to be checked defined as a bitmask + * combination of EPlay, EDisplay, EExecute and EPrint + * @return EOk if all of the given rights can be exercised, otherwise + * or if the content URI cannot be found, ENoRights + */ + //IMPORT_C TInt CheckContentRights( + // const TDesC8& aContentURI, + // TUint32 aRightsSpec); + + /** + * CheckFileRights + * + * Takes a file name and a rights specification. Opens the given file + * and checks if the specified rights can be exercised with this file + * by extracting the content URI from the file, looking up the content + * URI in the rights database and checking the stored rights. + * + * @since 2.0 + * @param aFileName: the name of the file to be tested. + * @param aRightsSpec: The rights to be checked defined as a bitmask + * combination of EPlay, EDisplay, EExecute and EPrint + * @return EOk if all of the given rights can be exercised, otherwise + * or if the file is not a DCF file or if the content URI cannot + * be found, ENoRights + */ + //IMPORT_C TInt CheckFileRights( + // const TDesC& aFileName, + // TUint32 aRightsSpec); + + /** + * CheckFileRights + * + * Takes a file name and a rights specification. Opens the given file + * and checks if the specified rights can be exercised with this file + * by extracting the content URI from the file, looking up the content + * URI in the rights database and checking the stored rights. + * + * @since 3.0 + * @param aFileHandle: file handle to the file. + * @param aRightsSpec: The rights to be checked defined as a bitmask + * combination of EPlay, EDisplay, EExecute and EPrint + * @return EOk if all of the given rights can be exercised, otherwise + * or if the file is not a DCF file or if the content URI cannot + * be found, ENoRights + */ + //IMPORT_C TInt CheckFileRights( + // RFile& aFileHandle, + // TUint32 aRightsSpec); + + /** + * IsProtectedContent + * + * Takes a memory buffer containing a file and checks if it is a DCF file + * or a regular file. + * + * @since 2.0 + * @param aContent: memory buffer containing a file + * @param aProtection: return parameter, true if the file is a DCF file + * @return EOk if the content could be checked. + */ + //IMPORT_C TInt IsProtectedContent( + // const TDesC8& aContent, + // TBool& aProtection); + + /** + * IsProtectedFile + * + * Takes a file name and checks if it is a DCF file or a regular file. + * + * @since 2.0 + * @param aFileName: the name of the file to be tested. + * @param aProtection: return parameter, true if the file is a DCF file + * @return EOk if the content could be checked. + */ + IMPORT_C TInt IsProtectedFile( + const TDesC& aFileName, + TBool& aProtection); + + /** + * IsProtectedFile + * + * Takes a file name and checks if it is a DCF file or a regular file. + * + * @since 3.0 + * @param aFileHandle: handle to the file to be tested. + * @param aProtection: return parameter, true if the file is a DCF file + * @return EOk if the content could be checked. + */ + //IMPORT_C TInt IsProtectedFile( + // RFile& aFileHandle, + // TBool& aProtection); + + /** + * GetContentInfo + * + * Takes a memory buffer containing a DCF(or at least the header part + * of it) and returns the protection for this content, the MIME type, + * Content URI and encrypted data length in out parameters. + * + * @since 2.0 + * @param aContent: memory buffer containing a DCF + * @param aProtection: return parameter for the type of protection for + * this DCF + * @param aMIMEType: return parameter for the MIME type header field + * @param aContentURI: return parameter for the content URI header field + * @param aDataLength: return parameter for the length of the encrypted + * data + * @return EOk if the information could be extracted from the DCF + */ + //IMPORT_C TInt GetContentInfo( + // const TDesC8& aContent, + // TContentProtection& aProtection, + // HBufC8*& aMIMEType, + // HBufC8*& aContentURI, + // TUint& aDataLength); + + /** + * GetFileInfo + * + * Takes the name of a DCF file, opens it and returns the protection for + * this content, the MIME type, Content URI and encrypted data length in + * out parameters. + * + * @since 2.0 + * @param aFileName: the name of the file to be inspected + * @param aProtection: return parameter for the type of protection for + * this DCF + * @param aMIMEType: return parameter for the MIME type header field + * @param aContentURI: return parameter for the content URI header field + * @param aDataLength: return parameter for the length of the encrypted + * data + * @return EOk if the information could be extracted from the DCF + */ + //IMPORT_C TInt GetFileInfo( + // const TDesC& aFileName, + // TContentProtection& aProtection, + // HBufC8*& aMIMEType, + // HBufC8*& aContentURI, + // TUint& aDataLength); + + /** + * GetFileInfo + * + * Takes the name of a DCF file, opens it and returns the protection for + * this content, the MIME type, Content URI and encrypted data length in + * out parameters. + * + * @since 3.0 + * @param aFileHandle: handle to the file to be inspected + * @param aProtection: return parameter for the type of protection for + * this DCF + * @param aMIMEType: return parameter for the MIME type header field + * @param aContentURI: return parameter for the content URI header field + * @param aDataLength: return parameter for the length of the encrypted + * data + * @return EOk if the information could be extracted from the DCF + */ + //IMPORT_C TInt GetFileInfo( + // RFile& aFileHandle, + // TContentProtection& aProtection, + // HBufC8*& aMIMEType, + // HBufC8*& aContentURI, + // TUint& aDataLength); + + /** + * GetContentHeader + * + * Takes a memory buffer containing a DCF(or at least the header part of + * it) and a header name and returns the value of the header field in an + * out parameter. Return value specifies if the header has been found. + * Search is case insensitive. + * + * @since 2.0 + * @param aContent: memory buffer containing a DCF + * @param aHeaderName: Name of the header to look for + * @param aHeaderValue: return parameter for value of the header + * @return EOk if the header was found + */ + //IMPORT_C TInt GetContentHeader( + // const TDesC8& aContent, + // const TDesC8& aHeaderName, + // HBufC8*& aHeaderValue); + + /** + * GetFileHeader + * + * Takes the name of a DCF file and a header name, opens the DCF file and + * returns the value of the header field in an out parameter. Return value + * specifies if the header has been found. Search is case insensitive. + * + * @since 2.0 + * @param aFileName: the name of the DCF file to be opened + * @param aHeaderName: Name of the header to look for + * @param aHeaderValue: return parameter for value of the header + * @return EOk if the header was found + */ + //IMPORT_C TInt GetFileHeader( + // const TFileName& aFileName, + // const TDesC8& aHeaderName, + // HBufC8*& aHeaderValue); + + /** + * GetFileHeader + * + * Takes the name of a DCF file and a header name, opens the DCF file and + * returns the value of the header field in an out parameter. Return value + * specifies if the header has been found. Search is case insensitive. + * + * @since 3.0 + * @param aFileHandle: handle to the DCF file + * @param aHeaderName: Name of the header to look for + * @param aHeaderValue: return parameter for value of the header + * @return EOk if the header was found + */ + //IMPORT_C TInt GetFileHeader( + // RFile& aFileHandle, + // const TDesC8& aHeaderName, + // HBufC8*& aHeaderValue); + + /** + * SetContentHeader + * + * Takes a memory buffer containing a DCF(or at least the header part of + * it), a header name and the value for the header field. Sets the header + * field in the optional DCF header. If the header field has not existed + * before, it is created. Any previous value of the header field will be + * overwritten. + * + * @since 2.0 + * @param aContent: memory buffer containing a DCF + * @param aHeaderName: Name of the header to set + * @param aHeaderValue: New value of the heade + * @return EOk if the header was set. + */ + //IMPORT_C TInt SetContentHeader( + // HBufC8*& aContent, + // const TDesC8& aHeaderName, + // const TDesC8& aHeaderValue); + + /** + * SetFileHeader + * + * Takes the name of a DCF file, a header name and the value for the header + * field. Opens the DCF file, sets the header field in the optional DCF + * header and writes the DCF file. If the header field has not existed + * before, it is created. Any previous value of the header field will be + * overwritten. + * + * @since 2.0 + * @param aFileName: the name of the DCF file to be opened + * @param aHeaderName: Name of the header to set + * @param aHeaderValue: New value of the heade + * @return EOk if the header was set. + */ + //IMPORT_C TInt SetFileHeader( + // const TDesC16& aFileName, + // const TDesC8& aHeaderName, + // const TDesC8& aHeaderValue); + + /** + * SetFileHeader + * + * Takes the name of a DCF file, a header name and the value for the header + * field. Opens the DCF file, sets the header field in the optional DCF + * header and writes the DCF file. If the header field has not existed + * before, it is created. Any previous value of the header field will be + * overwritten. + * + * @since 3.0 + * @param aFileHandle: handle to the DCF file + * @param aHeaderName: Name of the header to set + * @param aHeaderValue: New value of the heade + * @return EOk if the header was set. + */ + //IMPORT_C TInt SetFileHeader( + // RFile& aFileHandle, + // const TDesC8& aHeaderName, + // const TDesC8& aHeaderValue); + + /** + * GetSingleRightsObject + * + * Takes a content URI, a local ID and a rights object out parameter. + * Looks up the rights object using the content URI and the local ID + * and returns it in the out parameter. + * + * @since 2.5 + * @param aContentURI: the content URI of the content to be tested. + * @param aLocalID: local ID of the rights object + * @param aRightsObject: Out parameter for the rights object. It has + * to be released by the caller. + * @return EOk if the rights object could be retreived, ENoRights if + * no rights object exists. + */ + //IMPORT_C TInt GetSingleRightsObject( + // const TDesC8& aContentURI, + // TUint32 aLocalID, + // CDRMRights*& aRightsObject); + + /** + * GetDetailedContentRights + * + * Takes a Content URI and an array out parameter. Fills the rights + * specification array with the available rights by looking up the content + * URI in the rights database and retrieving the stored rights. The array + * parameter will contain a list of pointers to all rights object for the + * given content URI. The rights objects themselves can be distinguished by + * their local ID. + * + * @since 2.5 + * @param aContentURI: the content URI of the content to be tested. + * @param aRightsList: Out parameter for the available rights. It has to + * be released by the caller. + * @return EOk if the rights could be retreived, ENoRights if no rights + * object exists. + */ + //IMPORT_C TInt GetDetailedContentRights( + // const TDesC8& aContentURI, + // RPointerArray*& aRightsList); + + /** + * GetDetailedFileRights + * + * Takes a file name and a rights specification. Opens the given file and + * fills the rights specification array with the available rights by + * looking up the content URI in the rights database and retrieving the + * stored rights. The array parameter will contain a list of pointers to + * all rights object for the given content URI. The rights objects + * themselves can be distinguished by their local ID. + * + * @since 2.5 + * @param aFileName: the name of the file to be tested. + * @param aRightsList: Out parameter for the available rights. + * @return EOk if the rights could be retreived, if the file is not a DCF + * file or if the content URI cannot be found, ENoRights. + */ + //IMPORT_C TInt GetDetailedFileRights( + // const TDesC& aFileName, + // RPointerArray*& aRightsList); + + /** + * GetDetailedFileRights + * + * Takes a file name and a rights specification. Opens the given file and + * fills the rights specification array with the available rights by + * looking up the content URI in the rights database and retrieving the + * stored rights. The array parameter will contain a list of pointers to + * all rights object for the given content URI. The rights objects + * themselves can be distinguished by their local ID. + * + * @since 3.0 + * @param aFileHandle: handle to the file to be tested. + * @param aRightsList: Out parameter for the available rights. + * @return EOk if the rights could be retreived, if the file is not a DCF + * file or if the content URI cannot be found, ENoRights. + */ + //IMPORT_C TInt GetDetailedFileRights( + // RFile& aFileHandle, + // RPointerArray*& aRightsList); + + /** + * GetActiveRights + * + * Takes a Content URI and a rights specification. Finds all rights objects + * associated with given URI and returns a possible active one. The out + * parameters will contain a pointer to the found rights object. The found + * rights object can be expired. The details about expiration and constraints + * of the rights can be retrieved with the CDRMRights::GetRightsInfo function. + * + * @since 2.5 + * @param aContentURI: the content URI of the content to be tested. + * @param aRightsSpec: The rights to be checked defined as a bitmask + * combination of EPlay, EDisplay, EExecute and EPrint + * @param aRightsObject: Out parameter for the rights object. It has + * to be released by the caller. + * @return EFullRights, ERestrictedRights, EPreviewRights if a possble active + * rights object was found. ENoRights if no rights object for given + * content URI or permissions. + */ + //IMPORT_C TInt GetActiveRights( + // const TDesC8& aContentURI, + // TUint32 aRightsSpec, + // CDRMRights*& aRightsObject); + + /** + * GetContentURIList + * + * Returns a list of all content URIs that have rights in the rights + * database. + * + * @since 2.5 + * @param aURIList: Out parameter for the URI list. + * @return Ok if the URI list could be retreived. + */ + //IMPORT_C TInt GetContentURIList( + // RPointerArray*& aURIList); + + /** + * DataTypesCount + * + * Returns the number of previously registered datatypes which are + * supported by the DRM system and associated applications. + * + * @since 2.0 + * @param aCount: Out parameter for the datatype count + * @return EOk if the number of datatypes has been returned correctly + */ + //IMPORT_C TInt DataTypesCount( + // TInt& aCount); + + /** + * SupportedDataType + * + * Returns a specific datatype which has been registered before by giving an index + * + * @since 2.0 + * @param aIndex: Number of the datatype to return + * @param aDataType: Out parameter for the datatype + * @return EOk if the datatype was returned correctly + */ + + //IMPORT_C TInt SupportedDataType( + // const TInt aIndex, TDataType& aDataType); + + /** + * StaticDataTypesCount + * + * Returns the number of default registered datatypes which are + * supported by the DRM system and associated applications. + * + * @since 2.0 + * @param aCount: Out parameter for the static datatype count + * @return EOk if the number of datatypes has been returned correctly + */ + //IMPORT_C TInt StaticDataTypesCount( + // TInt& aCount); + + /** + * RegisterDataType + * + * Registers a datatype as a supported datatype. + * + * @since 2.0 + * @param aDataType: Datatype to register + * @return EOk if the datatype has been registered + */ + + //IMPORT_C TInt RegisterDataType( + // const TDataType& aDataType); + + /** + * UnRegisterDataType + * + * Unregisters a datatype via its index. + * + * @since 2.5 + * @param aIndex: Number of the datatype to unregister + * @return EOk if the datatype has been unregistered + */ + + //IMPORT_C TInt UnRegisterDataType( + // const TInt aIndex); + + /** + * SupportedDRMMethods + * + * Returns the supported DRM protection methods and the OMA compliance + * level of the DRM engine + * + * @since 2.0 + * @param aDRMMethod: Out parameter, bit mask containing any + * combination of EForwardLock, ECombinedDelivery, + * ESeparateDelivery etc. + * @param aOMALevel: OMA compliance of the DRM engine + * @return DRMCommon error code + */ + + //IMPORT_C TInt SupportedDRMMethods( + // TInt& aDRMMethod, TOMALevel& aOMALevel); + + /** + * MergeParentAndChild + * + * Merge rights with their parent rights + * + * @since 3.0 + * @param aRights Rights to be merged with their parent rights + */ + + //IMPORT_C void MergeParentAndChild(CDRMRights* aRights); + + + +protected: + + /** + * C++ default constructor. + */ + IMPORT_C DRMCommon(void); + + /** + * 2nd phase constructor. + */ + IMPORT_C void ConstructL(void); + + /** + * MapErrorCode + * + * Maps the error codes returned by the core engine to DRMCommon + * error codes. + * + * @since 2.5 + * @param aCode: core error code + * @return DRMCommon error code. + */ + //IMPORT_C TInt MapErrorCode( + // const TInt aCode); + + +public: // Stub data + + TBool iIsConnected; + + /* + * If != KErrNone, next operation will fail with this code + */ + //TInt iForceFailWithCode; + + }; + + + +#endif // DRMCOMMON_H + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/drmstub/src/drmcommonstub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/drmstub/src/drmcommonstub.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,108 @@ +/* +* 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 + + + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C DRMCommon* DRMCommon::NewL(void) + { + DRMCommon* self = new ( ELeave ) DRMCommon; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C DRMCommon::~DRMCommon(void) + { + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt DRMCommon::Connect(void) + { + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt DRMCommon::Disconnect(void) + { + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt DRMCommon::IsProtectedFile( const TDesC& aFileName, + TBool& aProtection) + { + if ( aFileName == KMusDrmProtectedFileName() ) + { + aProtection = ETrue; + } + else + { + aProtection = EFalse; + } + + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C DRMCommon::DRMCommon(void) + :iIsConnected( EFalse ) + { + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void DRMCommon::ConstructL(void) + { + } + + + + + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/etelstub/inc/etel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/etelstub/inc/etel.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,1190 @@ +/* +* Copyright (c) 1997-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: +* +*/ + +/** +@file +@publishedAll +@released +*/ + +#if !defined(__ETEL_H__) +/** @internalComponent */ +#define __ETEL_H__ + +#if !defined(__E32BASE_H__) +#include +#endif + +#if !defined (__C32COMM_H__) +#include +#endif + +#if !defined(__D32COMM_H__) +#include +#endif + +#if !defined(__FAXDEFN_H) +#include +#endif +/** Major version number.*/ +const TUint KEtelMajorVersionNumber=1; +/** Minor version number. */ +const TUint KEtelMinorVersionNumber=0; +/** Build number. */ +const TUint KEtelBuildVersionNumber=606; +/** +@internalComponent +*/ +IMPORT_C void PanicClient(TInt aFault); + +// +// Etel Core Error Definitions +// + +const TInt KErrEtelCoreBase = -2000; + +/** The client is not the call owner and has attempted to perform an operation +that requires ownership.*/ +const TInt KErrEtelNotCallOwner=KErrEtelCoreBase; +/** An attempt has been made to load an ETel (TSY) module which contains a phone +with the same name as one already loaded. */ +const TInt KErrEtelDuplicatePhoneName=KErrEtelCoreBase-1; +/** An attempt has been made to acquire call ownership when the requesting client +is already the call owner. */ +const TInt KErrEtelAlreadyCallOwner=KErrEtelCoreBase-2; +/** A connection has been terminated because the carrier has been lost. */ +const TInt KErrEtelNoCarrier=KErrEtelCoreBase-3; +/** An attempt to establish a connection with the RCall::Dial() function has failed +because the remote party's line was busy. */ +const TInt KErrEtelBusyDetected=KErrEtelCoreBase-4; +/** An attempt has been made to transfer call ownership, but no other clients are +interested in acquiring ownership. */ +const TInt KErrEtelNoClientInterestedInThisCall=KErrEtelCoreBase-5; +/** The TSY has failed to initialise the modem. This may be occur if the modem +is disconnected during initialisation, or if an attempt is made to initialise +an unsupported modem. */ +const TInt KErrEtelInitialisationFailure=KErrEtelCoreBase-6; +/** An attempt has been made to perform an operation which requires the call to +be connected - when the call is not connected. E.g. RCall:LoanDataPort(). */ +const TInt KErrEtelCallNotActive=KErrEtelCoreBase-7; +/** A connection request has failed because there is no answer. */ +const TInt KErrEtelNoAnswer=KErrEtelCoreBase-8; +/** A connection request has failed because there is no dial tone. For example, +if there is no connection between the modem and the network. */ +const TInt KErrEtelNoDialTone=KErrEtelCoreBase-9; +/** An attempt to configure the port has failed because the hardware cannot match +the desired configuration. For example, if an attempt is made to configure +the comms port to a baud rate it cannot support. */ +const TInt KErrEtelConfigPortFailure=KErrEtelCoreBase-10; +/** Out of memory error - global chunk cannot be created. */ +const TInt KErrEtelFaxChunkNotCreated=KErrEtelCoreBase-11; +/** The client is not the fax owner and has attempted to perform an operation that +requires fax ownership. + +The fax client should be used to access fax functionality. Consequently, client +code should not return this error. */ +const TInt KErrEtelNotFaxOwner=KErrEtelCoreBase-12; +/** An attempt has been made to perform an operation which requires port ownership. +However, the client does not own the port. */ +const TInt KErrEtelPortNotLoanedToClient=KErrEtelCoreBase-13; +/** An operation has failed because the modem has been incorrectly configured. */ +const TInt KErrEtelWrongModemType=KErrEtelCoreBase-14; +/** An operation has failed because the modem does not understand the request - +possible bug in modem. */ +const TInt KErrEtelUnknownModemCapability=KErrEtelCoreBase-15; +/** The call has already placed an 'answer incoming call' request. Only 1 request +of a type (e.g. fax, voice, data) can be outstanding on the server at a time. */ +const TInt KErrEtelAnswerAlreadyOutstanding=KErrEtelCoreBase-16; +/** An attempt to establish a connection with the modem has failed because the +modem cannot be detected. */ +const TInt KErrEtelModemNotDetected=KErrEtelCoreBase-17; +/** Operation failed because the modem settings are corrupt. */ +const TInt KErrEtelModemSettingsCorrupt=KErrEtelCoreBase-18; +/** The Data port is in use by another call or application. */ +const TInt KErrEtelPortAlreadyLoaned=KErrEtelCoreBase-19; +/** Another call active. Close it before opening a new one. */ +const TInt KErrEtelCallAlreadyActive=KErrEtelCoreBase-20; + +// +// +// RTelSubSessionBase +// +// +class CPtrHolder; +class RFile; +/** +A base class used in the derivation of RCall, RLine, and RPhone. It has no user +accessible functions. + +@publishedPartner +@released +*/ +class RTelSubSessionBase : public RSubSessionBase + { +public: // Some stub stuff + enum TCalledFunction + { + ENone, + ECancelAsyncRequest + }; + +public: + inline RSessionBase& SessionHandle() const; + inline void SetSessionHandle(RSessionBase& aSession); + inline TInt SubSessionHandle(); + + IMPORT_C void CancelAsyncRequest(TInt aReqToCancel) const; + + enum TReqPriorityType + { + EIsNotaPriorityRequest, + EIsaPriorityRequest, + EIsaEmergencyRequest + }; + +protected: + + IMPORT_C RTelSubSessionBase(); + IMPORT_C TInt Blank(const TInt aIpc,TReqPriorityType aType = EIsNotaPriorityRequest) const; + IMPORT_C void Blank(const TInt aIpc,TRequestStatus& aStatus,TReqPriorityType aType = EIsNotaPriorityRequest) const; + + IMPORT_C TInt Set(const TInt aIpc,const TDesC8& aDes,TReqPriorityType aType = EIsNotaPriorityRequest) const; + IMPORT_C void Set(const TInt aIpc,TRequestStatus& aStatus,const TDesC8& aDes,TReqPriorityType aType = EIsNotaPriorityRequest) const; + IMPORT_C TInt Get(const TInt aIpc,TDes8& aDes,TReqPriorityType aType = EIsNotaPriorityRequest) const; + IMPORT_C void Get(const TInt aIpc,TRequestStatus& aStatus,TDes8& aDes,TReqPriorityType aType = EIsNotaPriorityRequest) const; + + IMPORT_C TInt Set(const TInt aIpc,const TDesC8& aDes1,const TDesC8& aDes2,TReqPriorityType aType = EIsNotaPriorityRequest) const; + IMPORT_C void Set(const TInt aIpc,TRequestStatus& aStatus,const TDesC8& aDes1,const TDesC8& aDes2,TReqPriorityType aType = EIsNotaPriorityRequest) const; + IMPORT_C TInt Get(const TInt aIpc,TDes8& aDes1,TDes8& aDes2,TReqPriorityType aType = EIsNotaPriorityRequest) const; + IMPORT_C void Get(const TInt aIpc,TRequestStatus& aStatus,TDes8& aDes1,TDes8& aDes2,TReqPriorityType aType = EIsNotaPriorityRequest) const; + + IMPORT_C TInt Set(const TInt aIpc,const TDesC16& aDes,TReqPriorityType aType = EIsNotaPriorityRequest) const; + IMPORT_C void Set(const TInt aIpc,TRequestStatus& aStatus,const TDesC16& aDes,TReqPriorityType aType = EIsNotaPriorityRequest) const; + IMPORT_C TInt Get(const TInt aIpc,TDes16& aDes,TReqPriorityType aType = EIsNotaPriorityRequest) const; + IMPORT_C void Get(const TInt aIpc,TRequestStatus& aStatus,TDes16& aDes,TReqPriorityType aType = EIsNotaPriorityRequest) const; + + IMPORT_C TInt Set(const TInt aIpc,const TDesC16& aDes1,const TDesC16& aDes2,TReqPriorityType aType = EIsNotaPriorityRequest) const; + IMPORT_C void Set(const TInt aIpc,TRequestStatus& aStatus,const TDesC16& aDes1,const TDesC16& aDes2,TReqPriorityType aType = EIsNotaPriorityRequest) const; + IMPORT_C TInt Set(const TInt aIpc,const TDesC8& aDes1,const TDesC16& aDes2,TReqPriorityType aType = EIsNotaPriorityRequest) const; + IMPORT_C void Set(const TInt aIpc,TRequestStatus& aStatus,const TDesC8& aDes1,const TDesC16& aDes2,TReqPriorityType aType = EIsNotaPriorityRequest) const; + + IMPORT_C TInt Get(const TInt aIpc,TDes16& aDes1,TDes16& aDes2,TReqPriorityType aType = EIsNotaPriorityRequest) const; + IMPORT_C void Get(const TInt aIpc,TRequestStatus& aStatus,TDes16& aDes1,TDes16& aDes2,TReqPriorityType aType = EIsNotaPriorityRequest) const; + IMPORT_C TInt Get(const TInt aIpc,TDes8& aDes1,TDes16& aDes2,TReqPriorityType aType = EIsNotaPriorityRequest) const; + IMPORT_C void Get(const TInt aIpc,TRequestStatus& aStatus,TDes8& aDes1,TDes16& aDes2,TReqPriorityType aType = EIsNotaPriorityRequest) const; + + IMPORT_C void SetAndGet(const TInt aIpc, TRequestStatus& aStatus, const TDesC8& aDes1, TDes8& aDes2, TReqPriorityType aType = EIsNotaPriorityRequest) const; + IMPORT_C void SetAndGet(const TInt aIpc, TRequestStatus& aStatus, TDes8& aDes1, const TDesC16& aDes2, TReqPriorityType aType = EIsNotaPriorityRequest) const; + IMPORT_C void SetAndGet(const TInt aIpc, TRequestStatus& aStatus, const TDesC8&, TDes16& aDes2, TReqPriorityType aType = EIsNotaPriorityRequest) const; + IMPORT_C void SetAndGet(const TInt aIpc, TRequestStatus& aStatus, const TDesC16& aDes1, TDes16& aDes2, TReqPriorityType aType = EIsNotaPriorityRequest) const; + + IMPORT_C TInt Set(const TInt aIpc, const RFile& aFile, TReqPriorityType aType = EIsNotaPriorityRequest) const; + + IMPORT_C TInt CancelReq(const TInt aIpc,const TInt aIpcToCancel) const; + IMPORT_C TInt CancelSubSession() const; + +private: + RTelSubSessionBase(const RTelSubSessionBase& aTelSubSessionBase); + RSessionBase* iTelSession; +protected: + CPtrHolder* iPtrHolder; + mutable TRequestStatus* iReqStatus; + mutable TRequestStatus* iReqStatus2; + + }; + +// +// +// RFax +// +// +class RCall; +/** +ETel fax subsession. + +Contains the fax client progress information structure. + +ETel does include server-side RFax objects, however the +associated APIs are intended solely for use by ETel's own +fax client. Consequently, only the TProgress structure is +considered part of the public API. + +@publishedPartner +@released +*/ +class RFax : public RTelSubSessionBase + { +public: + IMPORT_C RFax(); + IMPORT_C TInt Open(RCall& aCall); + IMPORT_C void Close(); + +// +// Read,Write and Wait for Page End +// + IMPORT_C void Read(TRequestStatus& aStatus,TDes8& aDes); + IMPORT_C void Write(TRequestStatus& aStatus,const TDesC8& aDes); + IMPORT_C void WaitForEndOfPage(TRequestStatus& aStatus) const; + IMPORT_C TInt TerminateFaxSession() const; +// +// Progress Information +// + struct TProgress + /** Contains fax progress information.*/ + { + /** Time of last progress update.*/ + TTime iLastUpdateTime; + /** ID of remote fax - filled in after connection.*/ + TBuf<20> iAnswerback; + + /** Phase of session.*/ + TFaxPhase iPhase; + /** Resolution of document.*/ + TFaxResolution iResolution; + /** Compression method in use.*/ + TFaxCompression iCompression; + /** Error correction mode. Reserved for future releases.*/ + TInt iECM; + + /** Last or current page being transferred.*/ + TInt iPage; + /** Last or current line on page.*/ + TInt iLines; + /** Speed of fax session.*/ + TInt iSpeed; + }; + + IMPORT_C TInt GetProgress(TProgress& aProgress); +private: + TProgress* iProgressPtr; + RChunk iChunk; +protected: + IMPORT_C virtual void ConstructL(); + IMPORT_C virtual void Destruct(); + }; + +// +// +// RCall +// +// +class RTelServer; +class RPhone; +class RLine; +/** +Call sub-session. + +Provides access to the functionality associated with a specific call. + +This class is not intended for user derivation. + +@publishedPartner +@released +*/ +class RCall : public RTelSubSessionBase + { +public: + IMPORT_C RCall(); + IMPORT_C TInt OpenNewCall(RTelServer& aServer,const TDesC& aName,TDes& aNewName); + IMPORT_C TInt OpenNewCall(RTelServer& aServer,const TDesC& aName); + IMPORT_C TInt OpenNewCall(RPhone& aPhone,const TDesC& aName,TDes& aNewName); + IMPORT_C TInt OpenNewCall(RPhone& aPhone,const TDesC& aName); + IMPORT_C TInt OpenNewCall(RLine& aLine,TDes& aNewName); + IMPORT_C TInt OpenNewCall(RLine& aLine); + IMPORT_C TInt OpenExistingCall(RTelServer& aServer,const TDesC& aName); + IMPORT_C TInt OpenExistingCall(RPhone& aPhone,const TDesC& aName); + IMPORT_C TInt OpenExistingCall(RLine& aLine,const TDesC& aName); + IMPORT_C void Close(); + +// +// Call Status +// +/** Call status flags. */ + enum TStatus + { + /** The call status is not known. */ + EStatusUnknown, + /** The call is idle. */ + EStatusIdle, + /** The call is dialling. */ + EStatusDialling, + /** The call is ringing (an incoming, unanswered call). */ + EStatusRinging, + /** The call is being answered. */ + EStatusAnswering, + /** The call is connecting (immediate call establishment, without dialling). */ + EStatusConnecting, + /** The call is connected and active. */ + EStatusConnected, + /** The call is being terminated. */ + EStatusHangingUp + }; + + IMPORT_C TInt GetStatus(TStatus& aStatus) const; + +// +// Call Caps +// +/** Call capability flags. */ + enum TCapsEnum + { + /** The call supports data calls. */ + KCapsData=0x00000001, + /** The call supports fax calls. */ + KCapsFax=0x00000002, + /** The call supports voice calls. */ + KCapsVoice=0x00000004, + /** The Dial request is currently a valid action. */ + KCapsDial=0x00000008, + /** The Connect request is currently a valid action. */ + KCapsConnect=0x00000010, + /** The Hang Up request is currently a valid action. */ + KCapsHangUp=0x00000020, + /** The Answer request is currently a valid action. */ + KCapsAnswer=0x00000040, + /** The Loan Data Port request is currently a valid action. */ + KCapsLoanDataPort=0x00000080, + /** The Recover Data Port request is currently a valid action. */ + KCapsRecoverDataPort=0x00000100 + }; + + struct TCaps +/** Call capability information. */ + { + /** Call capability flag. Contains a bitmask of values defined in the TCapsEnum + enumeration.*/ + TUint iFlags; + }; + + IMPORT_C TInt GetCaps(TCaps& aCaps) const; + IMPORT_C void NotifyCapsChange(TRequestStatus& aStatus, TCaps& aCaps); + IMPORT_C void NotifyCapsChangeCancel() const; + +// +// Bearer Service Information +// +/** Bearer capability flags. */ + enum TBearerCaps + { + /** V42bis modem compression protocol. */ + KBearerCapsCompressionV42bis=0x00000001, + /** MNP5 modem compression protocol. */ + KBearerCapsCompressionMNP5=0x00000002, + /** No compression supported. */ + KBearerCapsCompressionNone=0x00000004, + /** LAPM error correction protocol. */ + KBearerCapsProtocolLAPM=0x00000008, + /** MNP10 mode. */ + KBearerCapsProtocolALT_CELLULAR=0x00000010, + /** MNP error correction. */ + KBearerCapsProtocolALT=0x00000020, + /** No protocol information provided. */ + KBearerCapsProtocolNone=0x00000040, + /** Compression protocol unknown. */ + KBearerCapsCompressionUnknown=0x00000080, + /** Unable to establish protocol. */ + KBearerCapsProtocolUnknown=0x00000100 + }; + +/** Bearer speed flags. */ + enum TCallBearerSpeed + { + /** Transfer rate of 57600 bps. */ + EBearerData57600, + /** Transfer rate of 33600 bps. */ + EBearerData33600, + /** Transfer rate of 31200 bps. */ + EBearerData31200, + /** Transfer rate of 9200 bps. */ + EBearerData19200, + /** Transfer rate of 4400 bps. */ + EBearerData14400, + /** Transfer rate of 12000 bps. */ + EBearerData12000, + /** Transfer rate of 9600 bps. */ + EBearerData9600, + /** Transfer rate of 7200 bps. */ + EBearerData7200, + /** Transfer rate of 4800 bps. */ + EBearerData4800, + /** Transfer rate of 2400 bps. */ + EBearerData2400, + /** Transfer rate of 200 bps. */ + EBearerData1200, + /** V.23 75 bps forward, 1200 bps back */ + EBearerData75_1200, + /** V.23 1200 bps forward, 75 bps back */ + EBearerData1200_75, + /** Transfer rate of 300 bps. */ + EBearerData300, + /** Transfer rate is unknown. */ + EBearerDataUnknown + }; + + struct TBearerService +/** Call bearer information. + +@see TCallBearerSpeed */ + { + /** The bearer capabilities. */ + TUint32 iBearerCaps; + /** The bearer's speed. + + @see TCallBearerSpeed */ + TCallBearerSpeed iBearerSpeed; + }; + + IMPORT_C TInt GetBearerServiceInfo(TBearerService& aBearerService) const; + +// +// Notifications +// +/** Hook status flags. */ + enum THookStatus + { + /** The line is currently off hook. */ + EHookStatusOff, + /** The line is currently on hook. */ + EHookStatusOn, + /** The status of the line's hook is currently unknown */ + EHookStatusUnknown + }; + + class TCallInfo +/** Line call capability information. + +@see TName +@publishedAll +@released +*/ + { + public: + IMPORT_C TCallInfo(); + /** The name of a call. + + @see TName */ + TName iCallName; + TName iLineName; + THookStatus iHookStatus; + /** The call status. + + @see RCall::TStatus */ + TStatus iStatus; + TTimeIntervalSeconds iDuration; + }; + + IMPORT_C TInt GetInfo(TCallInfo& aCallInfo) const; + IMPORT_C void NotifyHookChange(TRequestStatus& aStatus,THookStatus& aHookStatus); + IMPORT_C void NotifyHookChangeCancel() const; + IMPORT_C void NotifyStatusChange(TRequestStatus& aStatus,TStatus& aCallStatus); + IMPORT_C void NotifyStatusChangeCancel() const; + IMPORT_C void NotifyCallDurationChange(TRequestStatus& aStatus,TTimeIntervalSeconds& aTime); + IMPORT_C void NotifyCallDurationChangeCancel() const; + +// +// Duration of call +// + IMPORT_C TInt GetCallDuration(TTimeIntervalSeconds& aTime) const; +// +// Connecting and Disconnecting +// +/** Passes telephone numbers into Dial functions. */ + typedef TDesC TTelNumberC; + IMPORT_C TInt Dial(const TTelNumberC& aTelNumber) const; + IMPORT_C TInt Dial(const TDesC8& aCallParams,const TTelNumberC& aTelNumber) const; + IMPORT_C void Dial(TRequestStatus& aStatus,const TTelNumberC& aTelNumber); + IMPORT_C void Dial(TRequestStatus& aStatus,const TDesC8& aCallParams,const TTelNumberC& aTelNumber); + IMPORT_C void DialCancel() const; + IMPORT_C TInt Connect() const; + IMPORT_C TInt Connect(const TDesC8& aCallParams) const; + IMPORT_C void Connect(TRequestStatus& aStatus); + IMPORT_C void Connect(TRequestStatus& aStatus,const TDesC8& aCallParams); + IMPORT_C void ConnectCancel() const; + IMPORT_C TInt AnswerIncomingCall() const; + IMPORT_C TInt AnswerIncomingCall(const TDesC8& aCallParams) const; + IMPORT_C void AnswerIncomingCall(TRequestStatus& aStatus); + IMPORT_C void AnswerIncomingCall(TRequestStatus& aStatus,const TDesC8& aCallParams); + IMPORT_C void AnswerIncomingCallCancel() const; + IMPORT_C TInt HangUp() const; + IMPORT_C void HangUp(TRequestStatus& aStatus) const; + IMPORT_C void HangUpCancel() const; + +// +// Call Data Access +// + struct TCommPort +/** Communications port information. + +@see TFileName */ + { + /** The CSY module used by the C32 Communications Server to talk to the serial + device. + @deprecated This has been deprecated as all the information that is needed by the + lower layers is now being passed in iPort. + + @see TFileName */ + TFileName iCsy; + /** The port used by the C32 Communications Server to talk to the serial device. + It holds both the Csy name and the Port name. + + @see TName */ + TName iPort; + }; + + IMPORT_C TInt LoanDataPort(TCommPort& aDataPort) const; + IMPORT_C void LoanDataPort(TRequestStatus& aStatus,TCommPort& aDataPort); + IMPORT_C void LoanDataPortCancel() const; + IMPORT_C TInt RecoverDataPort() const; + +// +// Call Ownership manipulation +// +/** Call ownership status flags. */ + enum TOwnershipStatus + { + /** The call is not owned. */ + EOwnershipUnowned, + /** The call is owned, but not by this RCall instance. */ + EOwnershipOwnedByAnotherClient, // not the priority client + /** The call is owned by this RCall instance. */ + EOwnershipOwnedByThisClient, + /** The call is owned, but not by the priority client */ + EOwnershipThisIsPriorityClient // not owned by this (the priority) client + }; + + IMPORT_C TInt TransferOwnership() const; + IMPORT_C void AcquireOwnership(TRequestStatus& aStatus) const; + IMPORT_C void AcquireOwnershipCancel() const; + IMPORT_C TInt GetOwnershipStatus(TOwnershipStatus& aOwnershipStatus) const; + // +// +// Get and Set Call Parameters +// +/** Monitor speaker control setting flags. */ + enum TMonitorSpeakerControl + { + /** Speaker control is always off */ + EMonitorSpeakerControlAlwaysOff, + /** Speaker control is on until the carrier is detected */ + EMonitorSpeakerControlOnUntilCarrier, + /** Speaker control is always active. */ + EMonitorSpeakerControlAlwaysOn, + /** Speaker control is on, except while dialling */ + EMonitorSpeakerControlOnExceptDuringDialling, + /** Speaker control is unknown. */ + EMonitorSpeakerControlUnknown + }; + +/** Monitor speaker volume control setting flags. */ + enum TMonitorSpeakerVolume + { + /** Speaker volume is off. */ + EMonitorSpeakerVolumeOff, + /** Speaker volume is low. */ + EMonitorSpeakerVolumeLow, + /** Speaker volume is medium. */ + EMonitorSpeakerVolumeMedium, + /** Speaker volume is high. */ + EMonitorSpeakerVolumeHigh, + /** Speaker volume is unknown. */ + EMonitorSpeakerVolumeUnknown + }; + +/** Wait for dial tone flags. */ + enum TWaitForDialTone + { + /** Waiting for dial tone. */ + EDialToneWait, + /** Not waiting for dial tone. */ + EDialToneNoWait + }; + + class TCallParams + /** + @publishedAll + @released + */ + { + public: + IMPORT_C TCallParams(); + IMPORT_C TCallParams(TMonitorSpeakerControl aSpeakerControl, + TMonitorSpeakerVolume aSpeakerVolume, + TUint aInterval, + TWaitForDialTone aWaitForDialTone); + IMPORT_C TInt ExtensionId(); + IMPORT_C TBool IsDefault(); + TMonitorSpeakerControl iSpeakerControl; + TMonitorSpeakerVolume iSpeakerVolume; + TUint iInterval; + TWaitForDialTone iWaitForDialTone; + protected: + TBool iIsDefault; + TInt iExtensionId; + }; + +/** Call parameters package + +The call parameters to be associated with a call may be passed into functions +using this type. + +@see TCallParams */ + typedef TPckg TCallParamsPckg; + + IMPORT_C TInt GetCallParams(TDes8& aParams) const; + +// +// Fax Settings +// +/** Fax mode flags. */ + enum TFaxMode + { + /** Fax is transmitting */ + ETransmit, + /** Fax is receiving. */ + EReceive + }; + +/** Fax retrieval type flags. */ + enum TFaxRetrieveType + { + /** Retrieving a fax opened from voice call (not currently supported by GSM networks). */ + EFaxOnDemand, + /** Retrieve a fax opened from fax call. */ + EFaxPoll + }; + +/** Fax identifier size flags. */ + enum TConstants + { + /** 20 */ + KFaxIdUserNameMaxSize=20 + }; + + struct TFaxSessionSettings +/** Fax session settings information. + +@see TFaxMode */ + { + /** The fax mode. + + @see TFaxMode */ + TFaxMode iMode; + /** The mode of retrieving faxes. + + @see TFaxRetrieveType */ + TFaxRetrieveType iFaxRetrieveType; + /** The class of fax + + @see TFaxClass */ + TFaxClass iFaxClass; + /** The fax identifier string displayed at the top of the fax. + + @see KFaxIdUserNameMaxSize */ + TBuf iFaxId; + /** The maximum transfer speed that can be negotiated. */ + TInt iMaxSpeed; + /** The minimum transfer speed that should be negotiated. */ + TInt iMinSpeed; + /** The preferred compression mode used for negotiation. This may take one of the + following values: EModifiedHuffman, EModifiedRead, EUncompressedModifiedRead, + EModifiedModifiedRead. */ + TInt iPreferredECM; + /** The delay used for Fax on Demand services. Measured in seconds. */ + TInt iFaxOnDemandDelay; + // Tx Settings + /** The preferred transmit resolution. This may take one of the following values: + EFaxNormal EFaxFine + + @see TFaxResolution */ + TFaxResolution iTxResolution; + /** Compression mode for transmitting faxes. + + @see TFaxCompression */ + TFaxCompression iTxCompression; + /** The number of pages to be transmitted. */ + TInt iTxPages; + // Rx Settings + /** The preferred receive resolution. This may take one of the following values: + EFaxNormal EFaxFine. + + @see TFaxResolution */ + TFaxResolution iRxResolution; + /** Compression mode for receiving faxes. + + @see TFaxCompression */ + TFaxCompression iRxCompression; + }; + + IMPORT_C TInt GetFaxSettings(TFaxSessionSettings& aSettings) const; + IMPORT_C TInt SetFaxSettings(const TFaxSessionSettings& aSettings) const; + IMPORT_C TInt AdoptFaxSharedHeaderFile(const RFile& aSharedFile) const; +// +// Retrieval of call objects' reference count +// + IMPORT_C TInt ReferenceCount() const; + +protected: + IMPORT_C virtual void ConstructL(); + IMPORT_C virtual void Destruct(); + }; + +// +// +// RLine +// +// +class RPhone; +/** +Provides access to the functionality associated with a specific line. + +This class is not intended for user derivation. + +@publishedPartner +@released +*/ +class RLine : public RTelSubSessionBase + { +public: + IMPORT_C RLine(); + IMPORT_C TInt Open(RPhone& aPhone,const TDesC& aName); + IMPORT_C TInt Open(RTelServer& aServer,const TDesC& aName); + IMPORT_C void Close(); + +// +// Caps +// +/** Line capability flags. */ + enum TCapsFlags + { + /** The line supports data connections.*/ + KCapsData=0x00000001, + /** The line supports fax connections. */ + KCapsFax=0x00000002, + /** The line supports voice connections.*/ + KCapsVoice=0x00000004, + /** The line supports incoming call notification requests. */ + KCapsEventIncomingCall=0x00010000, + }; + + struct TCaps +/** Line capability information. */ + { + /** Line capability flag. Contains a bitmask of the values defined in the TCapsFlags + enumeration.*/ + TUint iFlags; + }; + + IMPORT_C TInt GetCaps(TCaps& aCaps) const; + IMPORT_C void NotifyCapsChange(TRequestStatus& aStatus, TCaps& aCaps); + IMPORT_C void NotifyCapsChangeCancel() const; + +// +// Line and Hook Status +// + IMPORT_C TInt GetStatus(RCall::TStatus& aStatus) const; + IMPORT_C TInt GetHookStatus(RCall::THookStatus& aHookStatus) const; + +// +// Call enumeration and Information +// + struct TCallInfo +/** Line call capability information. + +@see TName */ + { + /** The name of a call. + + @see TName */ + TName iCallName; + /** The call status. + + @see RCall::TStatus */ + RCall::TStatus iStatus; + /** The call capabilities flag. + + @see RCall::TCapsEnum*/ + TUint32 iCallCapsFlags; + }; + + IMPORT_C TInt EnumerateCall(TInt& aCount) const; + IMPORT_C TInt GetCallInfo(TInt aIndex,TCallInfo& aCallInfo) const; +// +// General line notification information +// + class TLineInfo +/** Line information. + +@see RCall::TStatus +@publishedAll +@released +*/ + { + public: + IMPORT_C TLineInfo(); + RCall::THookStatus iHookStatus; + /** The current line status. + + @see RCall::TStatus */ + RCall::TStatus iStatus; + TName iNameOfLastCallAdded; + TName iNameOfCallForAnswering; // if an incoming call occurs, this contains the name + // of the call to answer it on. + }; + +// +// Notifications +// + IMPORT_C TInt GetInfo(TLineInfo& aLineInfo) const; + IMPORT_C void NotifyIncomingCall(TRequestStatus& aStatus, TName& aName); + IMPORT_C void NotifyIncomingCallCancel() const; + IMPORT_C void NotifyHookChange(TRequestStatus& aStatus,RCall::THookStatus& aHookStatus); + IMPORT_C void NotifyHookChangeCancel() const; + IMPORT_C void NotifyStatusChange(TRequestStatus& aStatus,RCall::TStatus& aLineStatus); + IMPORT_C void NotifyStatusChangeCancel() const; + IMPORT_C void NotifyCallAdded(TRequestStatus& aStatus,TName& aName); + IMPORT_C void NotifyCallAddedCancel() const; +protected: + IMPORT_C virtual void ConstructL(); + IMPORT_C virtual void Destruct(); + }; + +// +// +// RPhone +// +// +class RTelServer; +/** +Phone sub-session. + +Provides access to the functionality associated with a specific phone. + +This class is not intended for user derivation. + +@publishedPartner +@released +*/ +class RPhone : public RTelSubSessionBase + { +public: + IMPORT_C RPhone(); + IMPORT_C TInt Open(RTelServer& aSession,const TDesC& aName); + IMPORT_C void Close(); + +// +// Initialisation +// + IMPORT_C TInt Initialise(); + IMPORT_C void Initialise(TRequestStatus& aStatus); + IMPORT_C void InitialiseCancel(); + +// +// Caps +// +/** Phone capability flags. */ + enum TCapsFlags + { + /** The capabilities of the phone are not known. */ + KCapsUnknown=0x00000001, + /** The phone supports data calls. */ + KCapsData=0x00000002, + /** The phone supports the fax class 1 interface. */ + KCapsFaxClassOne=0x0000004, + /** The phone supports the fax class 1.0 interface. */ + KCapsFaxClassOnePointZero=0x0000008, + /** The phone supports the fax class 2 interface. */ + KCapsFaxClassTwo=0x00000010, + /** The phone supports the fax class 2.0 interface. */ + KCapsFaxClassTwoPointZero=0x00000020, + /** The phone supports the fax class 2.1 interface. */ + KCapsFaxClassTwoPointOne=0x00000040, + /** The phone supports voice calls. */ + KCapsVoice=0x00000080, + /** The phone supports modem detection events, i.e. it can notify clients when + the modem can be or can no longer be detected. */ + KCapsEventModemDetection=0x00010000, + /** The phone supports the ability to take the communications port from whatever + component is currently using it. */ + KCapsStealCommPort=0x00020000 + }; + + struct TCaps +/** Phone capability information. */ + { + /** Phone capability flag. Contains bitmask of values defined in the TCapsFlags + enumeration. */ + TUint iFlags; + }; + + IMPORT_C TInt GetCaps(TCaps& aCaps) const; + IMPORT_C void NotifyCapsChange(TRequestStatus& aStatus, TCaps& aCaps); + IMPORT_C void NotifyCapsChangeCancel() const; + +// +// Status +// +/** Phone mode status flags. */ + enum TMode + { + /** Phone (modem) status unknown. */ + EModeUnknown, + /** Phone is idle. */ + EModeIdle, + /** Phone is establishing link. */ + EModeEstablishingLink, + /** Modem is in data mode. */ + EModeOnlineData, + /** Modem is in command mode and the line is active. */ + EModeOnlineCommand + }; + +/** Modem connection status flags. */ + enum TModemDetection + { + /** Modem present. */ + EDetectedPresent, + /** Modem is not present. */ + EDetectedNotPresent, + /** Modem connection status is unknown. */ + EDetectedUnknown + }; + + struct TStatus +/** Current phone status. + +@see TModemDetection */ + { + /** The current modem connection status. + + @see TModemDetection */ + TModemDetection iModemDetected; + /** The current mode of the phone. + + @see TMode */ + TMode iMode; + }; + + IMPORT_C TInt GetStatus(TStatus& aStatus) const; + +// +// Line Enumeration and Information +// + struct TLineInfo +/** Line information. + +@see RCall::TStatus */ + { + /** The current line status. + + @see RCall::TStatus */ + RCall::TStatus iStatus; + /** The line capabilities flag. + + @see RLine::TCapsFlags */ + TUint32 iLineCapsFlags; + /** The name of the line. + + @see TName */ + TName iName; + }; + + IMPORT_C TInt EnumerateLines(TInt& aCount) const; + IMPORT_C TInt GetLineInfo(const TInt aIndex,TLineInfo& aLineInfo) const; + +// +// General phone notification information +// + class TPhoneInfo +/** Phone notification information. + +Collects all the information associated with an instance of the core API phone +class is collected together into a single, directly accessible, structure. +This increases the efficiency of applications that require access to the majority +of the phone's data. + +This class is not intended for user derivation. + +@see TNetworkType +@publishedAll +@released +*/ + { + public: + IMPORT_C TPhoneInfo(); + /** The current modem detection state (is it present or not). + + @see TModemDetection */ + TModemDetection iDetection; + }; + + IMPORT_C TInt GetInfo(TPhoneInfo& aPhoneInfo) const; + +// +// Notifications +// + IMPORT_C void NotifyModemDetected(TRequestStatus& aStatus,TModemDetection& aDetection); + IMPORT_C void NotifyModemDetectedCancel() const; + +// +// TEmergencyRequest is a bit-mask where each bit-flag represents +// the emergency request type that the client wishes to handle +// + enum TEmergencyRequest + { + /** Location Based Services Emergency Request */ + EEmergencyLCSRequest = 0x00000001, + /** Circuit Switch Voice Call Emergency Request */ + EEmergencyCSVoiceCallRequest = 0x00000002, + }; + + IMPORT_C TInt SetEmergencyClient(const TUint32 aEmergencyRequest) const; + +protected: + IMPORT_C virtual void ConstructL(); + IMPORT_C virtual void Destruct(); + }; + +// +// +// RTelServer +// +// +/** +Root telephony server session. + +Provides access to general telephony information and functionality. Clients +wishing to use the ETel Server must open a connection with the root server +using the functions defined in this class. They may then obtain information +about loaded TSY modules, and the phones that they support. To access functionality +associated with a specific phone, the client must open a sub-session for that +phone. + +This class is not intended for user derivation. + +@publishedPartner +@released +*/ +class RTelServer : public RSessionBase + { +public: + enum { KDefaultMessageSlots=32 }; + + IMPORT_C RTelServer(); + IMPORT_C TInt Connect(TInt aMessageSlots =KDefaultMessageSlots); + inline TVersion Version() const; + +// +// Enumeration and Information +// +/** Types of telephony connection flags. */ + enum TNetworkType + { + /** Wired analog network. */ + ENetworkTypeWiredAnalog, + /** Wired digital network (not supported by ETel). */ + ENetworkTypeWiredDigital, + /** Mobile analog network (not supported by ETel). */ + ENetworkTypeMobileAnalog, + /** Mobile digital network. */ + ENetworkTypeMobileDigital, + /** Unknown network type. */ + ENetworkTypeUnknown + }; + + struct TPhoneInfo +/** Phone notification information. + +Collects all the information associated with an instance of the core API phone +class is collected together into a single, directly accessible, structure. +This increases the efficiency of applications that require access to the majority +of the phone's data. + +This class is not intended for user derivation. + +@see TNetworkType */ + { + /** The type of telephony connection supported by the phone. + + @see TNetworkType */ + TNetworkType iNetworkType; + /** The name of the phone. + + @see TName */ + TName iName; + /** The number of lines supported by the phone. */ + TUint iNumberOfLines; + /** The extensions that the TSY module supports. */ + TUint iExtensions; + }; + + IMPORT_C TInt EnumeratePhones(TInt& aNoOfPhones) const; + IMPORT_C TInt GetPhoneInfo(const TInt aIndex,TPhoneInfo& aInfo) const; + IMPORT_C TInt GetTsyName(const TInt aIndexOfPhone, TDes& aTsyName) const; + +// +// Load and Unload Phone modules +// + + IMPORT_C TInt LoadPhoneModule(const TDesC& aFileName) const; + IMPORT_C TInt UnloadPhoneModule(const TDesC& aFileName) const; + +// +// Check whether specified Phone module (TSY) supports certain functionality +// + + IMPORT_C TInt IsSupportedByModule(const TDesC& aTsyName, const TInt aMixin, TBool& aResult) const; + IMPORT_C TInt GetTsyVersionNumber(const TDesC& aTsyName,TVersion& aVersion) const; +// +// Set this session as Priority client +// + /** @deprecated This function has been deprecated. Use RTelServer::SetPriorityClientV2 followed by + RPhone::SetEmergencyClient(EEmergencyCSVoiceCallRequest) */ + IMPORT_C TInt SetPriorityClient() const; + +// +// Set this session to receive detailed errors +// + +/** Error granularity flags. */ + enum TErrorGranularity + { + /** Client is only interested in core errors */ + EErrorBasic, + /** Client is interested in extended errors */ + EErrorExtended + }; + + IMPORT_C TInt SetExtendedErrorGranularity(const TErrorGranularity aGranularity) const; + +// +// Debug calls - stubbed in release builds +// + IMPORT_C TInt __DbgMarkHeap(); + IMPORT_C TInt __DbgCheckHeap(TInt aCount); + IMPORT_C TInt __DbgMarkEnd(TInt aCount); + IMPORT_C TInt __DbgFailNext(TInt aCount); + IMPORT_C TInt __DbgFailNextAvailable(TBool& aResult); + +// +// Set this session as Priority client +// + IMPORT_C TInt SetPriorityClientV2() const; + + }; + +//#include "etel.inl" +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/etelstub/inc/etelmm.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/etelstub/inc/etelmm.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,12671 @@ +/* +* Copyright (c) 2000-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: +* +*/ + + +/** +@file + +Multimode ETel API header file. + +Describes the MM ETel API - classes, methods and types. + +@publishedPartner +@released +*/ + +#ifndef __ETELMM_H__ +#define __ETELMM_H__ + +#include +#include +#include +#include + + +/** +Internal API/TSY delimiter used to pass the phonebook type +*/ +#define PHBOOK_DELIMITER _L("//") +/** The size of the phone book delimiter string. +@internalComponent + */ +const TInt KSizeOfPhbookDelimiter=2; + +/** +Names for Multimode ETel sub-sessions +*/ +_LIT(KETelMeAdnPhoneBook,"S1"); +_LIT(KETelMeDialledPhoneBook,"S2"); +_LIT(KETelMeMissedPhoneBook,"S3"); +_LIT(KETelMeReceivedPhoneBook,"S4"); +_LIT(KETelCombinedAdnPhoneBook,"S5"); +_LIT(KETelTaAdnPhoneBook,"S6"); +_LIT(KETelIccAdnPhoneBook,"S7"); +_LIT(KETelIccFdnPhoneBook,"S8"); +_LIT(KETelIccSdnPhoneBook,"S9"); +_LIT(KETelIccBdnPhoneBook,"S10"); +_LIT(KETelIccLndPhoneBook,"S11"); +_LIT(KETelIccVoiceMailBox,"S12"); + +_LIT(KETelMeSmsStore,"S13"); +_LIT(KETelIccSmsStore,"S14"); +_LIT(KETelCombinedSmsStore,"S15"); + +_LIT(KETelNamStore,"S16"); +_LIT(KETelOwnNumberStore,"S17"); +_LIT(KETelEmergencyNumberStore,"S18"); + +_LIT(KETelSmsMessaging,"S19"); +_LIT(KETelBroadcastMessaging,"S20"); +_LIT(KETelUssdMessaging,"S21"); + +_LIT(KETelConferenceCall,"S22"); + +_LIT(KETelIccMbdnPhoneBook, "S23"); +_LIT(KETelIccMsisdnPhoneBook, "S24"); +_LIT(KETelIccOciPhoneBook, "S25"); +_LIT(KETelIccIciPhoneBook, "S26"); +_LIT(KETelIccNamStore ,"S27"); +_LIT(KETelIccInfoPhoneBook, "S28"); + +_LIT(KETelLocationServices,"S29"); + +// Types for Multimode ETel sub-sessions + +_LIT(KEtelCdmaPhoneBookType,"T1"); +_LIT(KEtelGsmPhoneBookType,"T2"); +_LIT(KEtelUSimPhoneBookType,"T3"); + +// Types for SmartCardEap sub-sessions + +/** +The prefix to all RMobileSmartCardEap sub-session names. +*/ +_LIT(KETelSmartCardEapSession, "ScEap"); +/** +The length of KETelSmartCardEapSession. Used to obtain a const value +for this length at compile-time. +*/ +#define SCEAP_SSN_LENGTH 5 + +/** +EAP-MD5 type identifier. Value taken from section 5 of RFC 3748 Jun 2004. +This should be used as the EAP type identifier value of +RMobileSmartCardEap::Open() if standard EAP-MD5 challenges are to be used. + +This value corresponds to one of the possible values returned in the type +list of TUiccApplicationEapInfoV6. + +(Decimal value = 4) + +@see RMobileSmartCardEap::Open() +@see RMobilePhone::TUiccApplicationEapInfoV6 +*/ +_LIT8(KETelSmartCardEapTypeMD5, "04"); + +/** +EAP-TLS type identifier. Value taken from section 4.1 of RFC 2716 Oct 1999. +This should be used as the EAP type identifier value of +RMobileSmartCardEap::Open() if standard EAP-TLS is to be used. + +This value corresponds to one of the possible values returned in the type +list of TUiccApplicationEapInfoV6. + +(Decimal value = 13) + +@see RMobileSmartCardEap::Open() +@see RMobilePhone::TUiccApplicationEapInfoV6 +*/ +_LIT8(KETelSmartCardEapTypeTLS, "0D"); + +/** +EAP-SIM type identifier. +This should be used as the EAP type identifier value of +RMobileSmartCardEap::Open() if standard EAP-SIM is to be used. + +This value corresponds to one of the possible values returned in the type +list of TUiccApplicationEapInfoV6. + +(Decimal value = 18) + +@see RMobileSmartCardEap::Open() +@see RMobilePhone::TUiccApplicationEapInfoV6 +*/ +_LIT8(KETelSmartCardEapTypeSIM, "12"); + +/** +EAP-AKA type identifier. +This should be used as the EAP type identifier value of +RMobileSmartCardEap::Open() if standard EAP-AKA is to be used. + +This value corresponds to one of the possible values returned in the type +list of TUiccApplicationEapInfoV6. + +(Decimal value = 23) + +@see RMobileSmartCardEap::Open() +@see RMobilePhone::TUiccApplicationEapInfoV6 +*/ +_LIT8(KETelSmartCardEapTypeAKA, "17"); + +/** +EAP-TTLS type identifier. +This should be used as the EAP type identifier value of +RMobileSmartCardEap::Open() if standard EAP-TTLS is to be used. + +This value corresponds to one of the possible values returned in the type +list of TUiccApplicationEapInfoV6. + +(Decimal value = 21) + +@see RMobileSmartCardEap::Open() +@see RMobilePhone::TUiccApplicationEapInfoV6 +*/ +_LIT8(KETelSmartCardEapTypeTTLS, "15"); + +/***********************************************************************************/ +// +// Global Multimode constants and types +// +/***********************************************************************************/ + +/** +Unique API identifier and Functional Unit constants +Modes: Common +*/ +enum TMultimodeETelV1Api + { + /** TSY supports the Multimode ETel v1.0 API. + + Modes: Common */ + KETelExtMultimodeV1=3000, // 3000 is unique reference for Multimode Etel v1.0 API + /** TSY supports the MobileSimAccess functional unit. + + Modes: Common */ + KETelFuncMobileIccAccess, + /** TSY supports the MobileNetwork functional unit. + + Modes: Common */ + KETelFuncMobileNetwork, + /** TSY supports the MobileIdentity functional unit. + + Modes: Common */ + KETelFuncMobileIdentity, + /** TSY supports the MobilePower functional unit. + + Modes: Common */ + KETelFuncMobilePower, + /** TSY supports the MobileSignal functional unit. + + Modes: GSM/WCDMA */ + KETelFuncMobileSignal, + /** TSY supports the MobileIndicator functional unit. + + Modes: Common */ + KETelFuncMobileIndicator, + /** TSY supports the MobileDTMF functional unit. + + Modes: Common */ + KETelFuncMobileDTMF, + /** TSY supports the MobileUserNetworkAccess functional unit. + + Modes: Common */ + KETelFuncMobileUserNetworkAccess, + /** TSY supports the MobileIdentityService functional unit. + + Modes: Common */ + KETelFuncMobileIdentityService, + /** TSY supports the MobileCallForwarding functional unit. + + Modes: Common */ + KETelFuncMobileCallForwarding, + /** TSY supports the MobileCallBarring functional unit. + + Modes: GSM/WCDMA */ + KETelFuncMobileCallBarring, + /** TSY supports the MobileCallWaiting functional unit. + + Modes: Common */ + KETelFuncMobileCallWaiting, + /** TSY supports the MobileCallCompletion functional unit. */ + KETelFuncMobileCallCompletion, + /** TSY supports the MobileAlternatingCall functional unit. + + Modes: GSM/WCDMA */ + KETelFuncMobileAlternatingCall, + /** TSY supports the MobileCost functional unit. + + Modes: GSM/WCDMA */ + KETelFuncMobileCost, + /** TSY supports the MobileSecurity functional unit. + + Modes: Common */ + KETelFuncMobileSecurity, + /** TSY supports the MobileAlternateLineService functional unit. + + Modes: GSM/WCDMA */ + KETelFuncMobileAlternateLineService, + /** TSY supports the MobileMessageWaiting functional unit. + + Modes: Common */ + KETelFuncMobileMessageWaiting, + /** TSY supports the MobileFixedDiallingNumbers functional unit. + + Modes: GSM/WCDMA */ + KETelFuncMobileFixedDiallingNumbers, + /** TSY supports the MobileDataCall functional unit. + + Modes: Common */ + KETelFuncMobileDataCall, + /** TSY supports the MobilePrivacy functional unit. + + Modes: CDMA */ + KETelFuncMobilePrivacy, + /** TSY supports the MobileEmergencyCall functional unit. + + Modes: Common */ + KETelFuncMobileEmergencyCall, + /** TSY supports the MobileSmsMessaging functional unit. + + Modes: Common */ + KETelFuncMobileSmsMessaging, + /** TSY supports the MobileBroadcastMessaging functional unit. + + Modes: Common */ + KETelFuncMobileBroadcastMessaging, + /** TSY supports the MobileUssdMessaging functional unit. + + Modes: GSM/WCDMA */ + KETelFuncMobileUssdMessaging, + /** TSY supports the MobileConferenceCall functional unit. + + Modes: Common */ + KETelFuncMobileConferenceCall, + /** TSY supports the MobilePhonebookStore functional unit. + + Modes: Common */ + KETelFuncMobilePhonebook, + /** TSY supports the MobileSmsStore functional unit. + + Modes: Common */ + KETelFuncMobileSmsStore, + /** TSY supports the MobileNamStore functional unit. + + Modes: CDMA */ + KETelFuncMobileNamStore, + /** TSY supports the MobileONStore functional unit. + + Modes: Common */ + KETelFuncMobileOwnNumberStore, + /** TSY supports the MobileENStore functional unit. + + Modes: Common */ + KETelFuncMobileEmergencyNumberStore, + /** TSY supports the MobileMultimedia functional unit. + + Modes: GSM/WCDMA */ + KETelFuncMobileMulticall, + /** TSY supports the MobileNextIncomingCall functional unit. + + Modes: GSM/WCDMA */ + KETelFuncMobileNextIncomingCall, + /** TSY supports the MobileMultimediaCall functional unit. + + Modes: GSM/WCDMA */ + KETelFuncMobileMultimediaCall, + /** TSY supports the MobileUserSignalling functional unit. + + Modes: GSM/WCDMA */ + KETelFuncMobileUserSignalling + }; + +/** Unique API identifier and Functional Unit constants. +Modes: WCDMA + +*/ +enum TMultimodeETelV2Api + { + /** TSY supports the Multimode ETel v2.0 API. + + Modes: WCDMA */ + KETelExtMultimodeV2=7000, // 7000 is unique reference for Multimode Etel v2.0 API + /** TSY supports the MobileMultimediaCallSettings functional unit. + + Modes: WCDMA */ + KEtelFuncMobileMultimediaCallSettings, + /** TSY supports the MobileNetworkSecurity functional unit. + + Modes: WCDMA */ + KEtelFuncMobileNetworkSecurity, + KEtelFuncMobileUSIMApplications + }; + +/** +Enum to define the v3.0 API additions + +*/ +enum TMultimodeETelV3Api + { + /** + Indicator that the TSY supports the Multimode ETel v3.0 API. + */ + KETelExtMultimodeV3 = 10000, + /** + TSY supports the MobileMMSInformation functional unit. + */ + KEtelFuncMobileMMSInformation, // 10001 + /** + TSY supports the KEtelFuncMobileAirTime functional unit. + */ + KEtelFuncMobileAirTime, // 10002 + /** + TSY supports the KEtelFuncMobileAutoRedial functional unit. + */ + KEtelFuncMobileAutoRedial, // 10003 + /** + TSY supports the KEtelFuncMobilePersonalisation functional unit. + */ + KEtelFuncMobilePersonalisation, // 10004 + /** + TSY supports the KEtelMobileMailboxNumbers functional unit. + */ + KEtelFuncMobileMailboxNumbers, // 10005 + /** + TSY supports the Mobile APN Control List functional unit. + */ + KEtelFuncMobileAPNControlList // 10006 + }; + +/** +Enum to define the v4.0 API additions + +*/ +enum TMultimodeETelV4Api + { + /** + Indicator that the TSY supports the Multimode ETel v4.0 API. + */ + KETelExtMultimodeV4 = 15000 + }; + + +/** Enum to define Release 5 enabling API and data structures +*/ +enum TMultimodeEtelV5Api + { + /** + Indicator that the TSY supports the Multimode ETel v5.0 API. + */ + KEtelExtMultimodeV5=20000, + /** + Indicator that the TSY supports the IMS functional unit. + */ + KEtelFuncMobileIMS, // 20001 + /** + TSY supports the KEtelFuncMobileSmartCardApplications functional unit. + */ + KEtelFuncMobileSmartCardApplications // 20002 + }; + + +/** +Enum to define the v6.0 API additions. +*/ +enum TMultimodeEtelV6Api + { + /** + Indicator that the TSY supports the Multimode ETel v6.0 API. + */ + KEtelExtMultimodeV6=25000, + /** + Indicator that the TSY supports the EAP supporting functional unit. + */ + KEtelSmartCardEap // 25001 + }; +/** +Enum to define the v7.0 API additions. +*/ +enum TMultimodeEtelV7Api + { + /** + Indicator that the TSY supports the Multimode ETel v7.0 API. + */ + KEtelExtMultimodeV7=30000, + /** + Indicator that the TSY supports the LocationServices supporting functional unit. + */ + KEtelLocationControlServices // 30001 + }; +/** +Enum to define the Etel 3rdParty V1 API additions + +*/ +enum TMultimodeETel3rdPartyV1Api + { + /** + Indicator that the TSY supports the Etel 3rd Party v1.0 API + */ + KETelExt3rdPartyV1 = 40000 + }; + +/*********************************************************/ +// +// Phone based functionality (RMobilePhone) +// +/*********************************************************/ + + +class CMobilePhonePtrHolder; +class CMobilePhoneStoredNetworkList; +class RMobileSmartCardEap; + +class RMobilePhone : public RPhone +/** +Provides client access to mobile phone functionality provided by TSY. + +Encapsulates access to a mobile phone. The functionality of RMobilePhone +is divided into a number of functional units, for the purpose of easier documentation +and navigation and selectable support by TSY. + +Note: Some RMobilePhone function members must be supported by the TSY while +others are part of optional "functional unit" and only need to be supported +if the TSY supports that functional unit. When a functional unit is mandatory +then the unit should at least support the Get...Caps() member function to +indicate the member functions that are supported for this unit. + +*/ + { +public: + friend class CAsyncRetrievePhoneList; + IMPORT_C RMobilePhone(); + + // Global multimode types + + + class TMultimodeType + /** + Base class for all the V1 parameter types defined within the API. + + @publishedPartner + @released + */ + { + public: + IMPORT_C TInt ExtensionId() const; + protected: + TMultimodeType(); + void InternalizeL(RReadStream& aStream); + void ExternalizeL(RWriteStream& aStream) const; + protected: + TInt iExtensionId; + }; + + /** A typedef'd packaged TMultimodeType for passing through a generic API + function member. */ + typedef TPckg TMultimodeTypePckg; + + // Types used in RMobilePhone::TMobileAddress + +/** Address types. + +Modes: Common */ + enum TMobileTON + { + /** User or the network has no knowledge of the type of number. + + Modes: Common */ + EUnknownNumber, // 0 + /** International number. + + Modes: Common */ + EInternationalNumber, // 1 + /** National number. + + Modes: Common */ + ENationalNumber, // 2 + /** Administration/service number specific to the serving network, e.g. used to + access an operator. + + Modes: Common */ + ENetworkSpecificNumber, // 3 + /** Subscriber number. + + Modes: Common */ + ESubscriberNumber, // 4 - Also defined as "dedicated, short code" in GSM 04.08 + /** Alphanumeric number coded according to 3GPP TS 123 038 GSM 7-bit default alphabet. + + Modes: GSM/WCDMA */ + EAlphanumericNumber, // 5 + /** Abbreviated number. + + Modes: Common */ + EAbbreviatedNumber // 6 + }; + +/** Number Plan Indicator. + +Modes: Common */ + enum TMobileNPI + { + /** User or the network has no knowledge of the numbering plan. + + Modes: Common */ + EUnknownNumberingPlan =0, + /** ISDN/telephony numbering plan. + + Modes: Common */ + EIsdnNumberPlan=1, + /** Data numbering plan. + + Modes: Common */ + EDataNumberPlan=3, + /** Telex numbering plan. + + Modes: Common */ + ETelexNumberPlan=4, + /** Service centre specific plan used to indicate a numbering plan specific to external + Short Message entities attached to the SMSC. */ + EServiceCentreSpecificPlan1=5, + /** Service centre specific plan used to indicate a numbering plan specific to external + Short Message entities attached to the SMSC. + + Modes: GSM/WCDMA */ + EServiceCentreSpecificPlan2=6, + /** National numbering plan. + + Modes: GSM/WCDMA */ + ENationalNumberPlan=8, + /** Private numbering plan. + + Modes: Common */ + EPrivateNumberPlan=9, + /** ERMES numbering plan. + + Modes: GSM/WCDMA */ + EERMESNumberPlan=10 + }; + + enum + { + KMaxMobilePasswordSize=10, + KMaxMobileNameSize=32, + KMaxMobileTelNumberSize=100 + }; + + struct TMMTableSettings + { + TUint32 iLocId; + }; + + typedef TPckg TMMTableSettingsPckg; + + + + class TMobileAddress + /** + Defines API abstraction of a mobile telephone number. + + @publishedPartner + @released + */ + { + public: + IMPORT_C TMobileAddress(); + + void InternalizeL(RReadStream& aStream); + void ExternalizeL(RWriteStream& aStream) const; + + public: + /** Type of number. + + @see TMobileTON */ + TMobileTON iTypeOfNumber; + /** Number plan. + + @see TMobileNPI */ + TMobileNPI iNumberPlan; + /** Telephone number. */ + TBuf iTelNumber; + }; + + // Mobile information location type + + /** Defines Location of service information. + + Modes: Common */ + enum TMobileInfoLocation + { + /** Retrieve the service information ONLY from the cache on the phone. Return KErrNotFound + if the cache does not exist or it is empty. */ + EInfoLocationCache, + /** Retrieve the service information from the cache, but if this is empty or does + not exist then interrogate the network. */ + EInfoLocationCachePreferred, + /** Retrieve the service information from the network (and refresh the cache if + there is one). */ + EInfoLocationNetwork + }; + + // Mobile call service type + + /** Applicability of request to a mobile service group. + + Modes: Common */ + enum TMobileService + { + /** The call service has not been specified. + + Modes: Common */ + EServiceUnspecified, + /** The API request applies to voice call services. + + Modes: Common */ + EVoiceService, + /** The API request applies to auxiliary voice call services. + + Modes: GSM/WCDMA */ + EAuxVoiceService, + /** The API request applies to circuit switched data call services. + + Modes: Common */ + ECircuitDataService, + /** The API request applies to packet data services. + + Modes: Common */ + EPacketDataService, + /** The API request applies to fax call services. + + Modes: Common */ + EFaxService, + /** The API request applies to short message services. + + Modes: Common */ + EShortMessageService, + /** The API request applies to all mobile services. + + Modes: Common */ + EAllServices, + /** All teleservices + + Modes: Common */ + EAllTele, + /** Telephony + + Modes: Common */ + ETelephony, + /** All data teleservices + + Modes: Common */ + EAllDataTele, + /** Voice Broadcast Service (VBS) Bearer Service + + Modes: Common */ + EAllDataExSms, + /** All teleservices except SMS + + Modes: Common */ + EAllTeleExcSms, + /** All PLMN specific teleservices + + Modes: Common */ + EAllPlmnTele, + /** PLMN specific teleservice 1 + + Modes: Common */ + EPlmnTele1, + /** PLMN specific teleservice 2 + + Modes: Common */ + EPlmnTele2, + /** PLMN specific teleservice 3 + + Modes: Common */ + EPlmnTele3, + /** PLMN specific teleservice 4 + + Modes: Common */ + EPlmnTele4, + /** PLMN specific teleservice 5 + + Modes: Common */ + EPlmnTele5, + /** PLMN specific teleservice 6 + + Modes: Common */ + EPlmnTele6, + /** PLMN specific teleservice 7 + + Modes: Common */ + EPlmnTele7, + /** PLMN specific teleservice 8 + + Modes: Common */ + EPlmnTele8, + /** PLMN specific teleservice 9 + + Modes: Common */ + EPlmnTele9, + /** PLMN specific teleservice 10 + + Modes: Common */ + EPlmnTeleA, + /** PLMN specific teleservice 11 + + Modes: Common */ + EPlmnTeleB, + /** PLMN specific teleservice 12 + + Modes: Common */ + EPlmnTeleC, + /** PLMN specific teleservice 13 + + Modes: Common */ + EPlmnTeleD, + /** PLMN specific teleservice 14 + + Modes: Common */ + EPlmnTeleE, + /** PLMN specific teleservice 15 + + Modes: Common */ + EPlmnTeleF, + /** All bearer services + + Modes: Common */ + EAllBearer, + /** All async services + + Modes: Common */ + EAllAsync, + /** All sync services + + Modes: Common */ + EAllSync, + /** All data circuit sync + + Modes: Common */ + ESyncData, + /** All data circuit async + + Modes: Common */ + EAsyncData, + /** All packet data services + + Modes: Common */ + EPacketData, + /** All pad access services + + Modes: Common */ + EPadAccess, + /** All PLMN specific bearer services + + Modes: Common */ + EAllPlmnBearer, + /** PLMN specific bearer service 1 + + Modes: Common */ + EPlmnBearerServ1, + /** PLMN specific bearer service 2 + + Modes: Common */ + EPlmnBearerServ2, + /** PLMN specific bearer service 3 + + Modes: Common */ + EPlmnBearerServ3, + /** PLMN specific bearer service 4 + + Modes: Common */ + EPlmnBearerServ4, + /** PLMN specific bearer service 5 + + Modes: Common */ + EPlmnBearerServ5, + /** PLMN specific bearer service 6 + + Modes: Common */ + EPlmnBearerServ6, + /** PLMN specific bearer service 7 + + Modes: Common */ + EPlmnBearerServ7, + /** PLMN specific bearer service 8 + + Modes: Common */ + EPlmnBearerServ8, + /** PLMN specific bearer service 9 + + Modes: Common */ + EPlmnBearerServ9, + /** PLMN specific bearer service 10 + + Modes: Common */ + EPlmnBearerServA, + /** PLMN specific bearer service 11 + + Modes: Common */ + EPlmnBearerServB, + /** PLMN specific bearer service 12 + + Modes: Common */ + EPlmnBearerServC, + /** PLMN specific bearer service 13 + + Modes: Common */ + EPlmnBearerServD, + /** PLMN specific bearer service 14 + + Modes: Common */ + EPlmnBearerServE, + /** PLMN specific bearer service 15 + + Modes: Common */ + EPlmnBearerServF, + /** Alternative tele services + + Modes: Common */ + EAltTele, + EVoiceGroupCall, + EVoiceBroadcast, + EAllGprsBearer + }; + + // Mobile name type + + /** A typedef to hold the names of API sub-sessions. The names are coded as ASCII + characters. */ + typedef TBuf TMobileName; + + // Mobile password type + + /** A typedef for the standard password used by mobile phones for secure access + to services (phone lock, SIM lock, call barring password). The password is + coded as Unicode characters. */ + typedef TBuf TMobilePassword; + + // for use by client-side API code and TSY only + + struct TClientId + /** This type is used within the 2-phase list retrieval classes. During both phases, + the client-side API code will pass down the TClientId so that TSY can use + this information to match the first phase of the request to the second phase. */ + { + /** The handle to the underlying RTelServer session. */ + TInt iSessionHandle; + /** The handle to the sub-session to which this API request relates. */ + TInt iSubSessionHandle; + }; + + /** Phone air interface capabilities. */ + enum TMobilePhoneModeCaps + { + /** Phone can operate in GSM mode on 900/1800/1900 MHz bands. */ + KCapsGsmSupported=0x00000001, + /** Phone can operate in GPRS mode on 900/1800/1900 MHz bands. */ + KCapsGprsSupported=0x00000002, + /** Phone can operate in AMPS mode on 800MHz band. */ + KCapsAmpsSupported=0x00000004, + /** Phone can operate in CDMA (IS-95) mode on 800/1900 MHz bands. */ + KCapsCdma95Supported=0x00000008, + /** Phone can operate in CDMA (cdma2000) mode on 800/1900 MHz bands. */ + KCapsCdma2000Supported=0x00000010, + /** Phone can operate in W-CDMA (UTRA Frequency Division Duplex (FDD)) mode. */ + KCapsWcdmaSupported=0x00000020, + /** Phone can operate in TDMA/CDMA (UTRA Time Division Duplex (TDD)) mode. */ + KCapsTdcdmaSupported=0x00000040, + /** + Phone can access Smart Card functionality required for an EAP. + @deprecated 9.3 + */ + KCapsEapSupported=0x00000080 + }; + + /** Version number of the multimode ETel API. */ + enum TMultimodeEtelAPIVersion + { + /** Multimode Etel API version 1. */ + TMultimodeETelApiV1 + }; + + // + // API/TSY internal type + // + + struct TPhoneStoreNameAndIccType + /** Structure that holds the phone store name and ICC type. + + Mode: Common */ + { + /** This parameter is used to set the name of the storage. */ + TName iStoreName; + /** This parameter is used to set the type of the ICC card. */ + TName iMode; + }; + + IMPORT_C TInt GetMultimodeAPIVersion(TInt& aVersion) const; + + IMPORT_C TInt GetMultimodeCaps(TUint32& aCaps) const; + + IMPORT_C void GetPhoneStoreInfo(TRequestStatus& aReqStatus, TDes8& aInfo, const TDesC& aStoreName) const; + + IMPORT_C void GetPhoneStoreInfo(TRequestStatus& aStatus, TDes8& aInfo, const TDesC& aStoreName, const TDesC& aMode) const; + + // explicit phone initialisation + IMPORT_C void InitialiseMM(TRequestStatus& aReqStatus, TDes8& aTableSettings) const; + + /***********************************************************************************/ + // + // MobilePhoneIccAccess functional unit + // + /***********************************************************************************/ + +/** ICC access capabilities. + +Modes: GSM */ + enum TMobilePhoneIccCaps + { + /** Phone has a SIM and it currently supports SIM access by clients. + + Modes: GSM */ + KCapsSimAccessSupported=0x00000001, + /** Phone has a R-UIM and it currently supports R-UIM access by clients. + + Modes: CDMA */ + KCapsRUimAccessSupported=0x00000002, + /** Phone has a USIM and it currently supports USIM access by clients. + + Modes: WCDMA */ + KCapsUSimAccessSupported=0x00000004 + }; + + + enum + { + /** + Maximum size of an ICC identity. + + NOTE: TS102.221 defines the maximum size of the ICC Identity as held in EF_ICCID as 10 bytes, however + TS 51.011 mentions that network operators may issue a SIM with an identification number of 20 bytes. + Therefore to cover this possibility the higher figure of 20 bytes has been chosen as the maximum size of the ICC identity. + */ + KMaxSizeIccIdentity = 20 + }; + + /** A typedef to hold the ICC identity.*/ + typedef TBuf8 TIccIdentity; + + IMPORT_C TInt GetIccAccessCaps(TUint32& aCaps) const; + IMPORT_C void NotifyIccAccessCapsChange(TRequestStatus& aReqStatus, TUint32& aCaps) const; + IMPORT_C void GetIccIdentity(TRequestStatus& aReqStatus, TIccIdentity& aIdentity) const; + +/** The Call Transfer/Call Forward options that are supported by the CSP. + +Modes: WCDMA/GSM */ + enum TCspCallOffering + { + /** Indicates that "Call Transfer" is supported by the CSP. */ + KCspCT=0x08, + /** Indicates that "Call Forwarding on Not Reachable" is supported by the CSP. */ + KCspCFNRc=0x10, + /** Indicates that "Call Forwarding on No Reply" is supported by the CSP. */ + KCspCFNRy=0x20, + /** Indicates that "Call Forwarding on Busy" is supported by the CSP. */ + KCspCFB=0x40, + /** Indicates that "Call Forwarding Unconditional" is supported by the CSP. */ + KCspCFU=0x80 + }; + +/** The call restrictions supported by the CSP. + +Modes: GSM/WCDMA */ + enum TCspCallRestriction + { + /** Indicates that "Barring of Incoming Calls when roaming outside the home PLMN + country" is supported by CSP. */ + KCspBICRoam=0x08, + /** Indicates that "Barring of All Incoming Calls" is supported by CSP. */ + KCspBAIC=0x10, + /** Indicates that "Barring of Outgoing International Calls except those directed + to the home PLMN country" is supported by CSP. */ + KCspBOICexHC=0x20, + /** Indicates that "Barring of Outgoing International Calls" is supported by CSP. */ + KCspBOIC=0x40, + /** Indicates that "Barring of All Outgoing Calls" is supported by CSP. */ + KCspBOAC=0x80 + }; + +/** Other services supported by the CSP. + +Modes: GSM/WCDMA */ + enum TCspOtherSuppServices + { + /** Indicates that the Outgoing Access option of the Closed User Group service is + supported by the CSP. */ + KCspCUGOA=0x08, + /** Indicates that the Preferential CUG option of the Closed User Group service + is supported by the CSP. */ + KCspPrefCUG=0x10, + /** Indicates that the Advice of Charge service is supported by the CSP. */ + KCspAoC=0x20, + /** Indicates that the Closed User Group service is supported by the CSP. */ + KCspCUG=0x40, + /** Indicates that the Multiparty call service is supported by the CSP */ + KCspMPTY=0x80, + }; + +/** Call completion modes supported by this CSP. + +Modes: GSM/WCDMA */ + enum TCspCallCompletion + { + /** Indicates that the Call Completion to Busy Subscriber service is supported by + the CSP. */ + KCspCCBS=0x20, + /** Indicates that the Call Waiting service is supported by the CSP. */ + KCspCW=0x40, + /** Indicates that the Call Hold service is supported by the CSP. */ + KCspHOLD=0x80, + }; + +/** SMS Teleservices supported by the CSP. + +Modes: GSM/WCDMA */ + enum TCspTeleservices + { + /** Indicates that display of Validity Period menu options for SMS is supported + by the CSP. */ + KCspValidityPeriod=0x02, + /** Indicates that display of Protocol ID menu options for SMS is supported by the + CSP. */ + KCspProtocolID=0x04, + /** Indicates that SMS Delivery Confirmation is supported by the CSP. */ + KCspDelConf=0x08, + /** Indicates that display of Reply Path menu options for outgoing SMS is supported + by the CSP. */ + KCspReplyPath=0x10, + /** Indicates that the Cell Broadcast service is supported by the CSP. */ + KCspSMCB=0x20, + /** Indicates mobile originated Short Messages are supported by CSP. */ + KCspSMMO=0x40, + /** Indicates mobile terminated Short Messages are supported by CSP. */ + KCspSMMT=0x80, + }; + +/** Alternate Line Services */ + enum TCspCPHSTeleservices + { + /** Indicates that Alternate Line Service is supported by the CSP. */ + KCspALS=0x80 + }; + +/** Currently not used. */ + enum TCspCPHSFeatures + { + /** This bit value is reserved for SST in Phase 1 CPHS. */ + KCspReservedSST=0x80 + }; + +/** Number Identification option supported by the CSP. + +Modes: GSM/WCDMA */ + enum TCspNumberIdentification + { + /** Indicates that Calling Line Identity Presentation blocking per call (CLI sent + by default) is supported by the CSP. */ + KCspCLIBlock=0x01, + /** Indicates that Calling Line Identity Presentation per call (CLI blocked by default) + is supported by the CSP. */ + KCspCLISend=0x02, + /** Indicates that Connected Line Identification Presentation is supported by the + CSP. */ + KCspCOLP=0x10, + /** Indicates that Connected Line Identification Restriction is supported by the + CSP. */ + KCspCOLR=0x20, + /** Indicates that Calling Line Identification Presentation is supported by the CSP. */ + KCspCLIP=0x80, + }; + +/** Phase 2+ services supported by the CSP. + +Modes: GSM/WCDMA */ + enum TCspPhase2PlusServices + { + /** Indicates that Multiple Band roaming is supported by CSP. */ + KCspMultipleband=0x04, + /** Indicates that Multiple Subscriber Profile is supported by CSP. + + v1.0 of Multimode ETel API does not support this feature */ + KCspMSP=0x08, + /** Indicates that Voice Broadcast is supported by CSP. + + v1.0 of Multimode ETel API does not support this feature. */ + KCspVoiceBroadcast=0x10, + /** Indicates that Voice Group Call is supported by CSP. + + v1.0 of Multimode ETel API does not support this feature. */ + KCspVoiceGroupCall=0x20, + /** Indicates that High Speed Circuit Switched Data is supported by CSP. */ + KCspHscsd=0x40, + /** Indicates that General Packet Radio Service is supported by CSP. */ + KCspGprs=0x80 + }; + +/** Value added services supported by this CSP. + +Modes: GSM/WCDMA */ + enum TCspValueAdded + { + /** Indicates that display of language selection menus is supported by the CSP. + + v1.0 of Multimode ETel API does not support this feature. */ + KCspLanguage=0x01, + /** Indicates that display of data call option menu is supported by the CSP. */ + KCspData=0x04, + /** Indicates that display of fax call option menu is supported by the CSP. */ + KCspFax=0x08, + /** Indicates that display of the menu option to send a Short Message of type Email + is supported by the CSP. */ + KCspSMMOEmail=0x10, + /** Indicates that display of the menu option to send a Short Message of type Paging + is supported by the CSP. */ + KCspSMMOPaging=0x20, + /** Indicates that display of the menu option for manual PLMN selection is supported + by the CSP. */ + KCspPLMNMode=0x80, + }; + + + + class TMobilePhoneCspFileV1 : public TMultimodeType + /** Defines contents of the CSP (Customer Service Profile) on the SIM. The profile + consists of the sum of the respective enums. + + @see GetCustomerServiceProfile() + @publishedPartner + @released*/ + { + public: + /** Constructor. */ + IMPORT_C TMobilePhoneCspFileV1(); + + /** Sum of the TCspCallOffering. */ + TUint8 iCallOfferingServices; + /** Sum of the TCspCallRestriction. */ + TUint8 iCallRestrictionServices; + /** Sum of the TCspOtherSuppServices. */ + TUint8 iOtherSuppServices; + /** Sum of the TCspCallCompletion. */ + TUint8 iCallCompletionServices; + /** Sum of the TCspTeleservices. */ + TUint8 iTeleservices; + /** Sum of the TCspCPHSTeleservices. */ + TUint8 iCphsTeleservices; + /** Sum of the TCspCPHSFeatures. */ + TUint8 iCphsFeatures; + /** Sum of the TCspNumberIdentification. */ + TUint8 iNumberIdentServices; + /** Sum of the TCspPhase2PlusServices. */ + TUint8 iPhase2PlusServices; + /** Sum of the TCspValueAdded. */ + TUint8 iValueAddedServices; + }; + +/** A typedef'd packaged TMobilePhoneCspFileV1 for passing through a generic API +function member. */ + typedef TPckg TMobilePhoneCspFileV1Pckg; + + IMPORT_C void GetCustomerServiceProfile(TRequestStatus& aReqStatus, TDes8& aCsp) const; + +/** SIM/USIM/CDMA Service Table. + +Modes: Common */ + enum TSSTServices1To8 + { + /** Indicates that disabling PIN1 is supported by the ICC. */ + KSstPin1Disable=0x01, + /** Indicates that storage of Abbreviated Dialling Numbers within this ICC is supported. */ + KSstADN=0x02, + /** Indicates that the Fixed Dialling Numbers service and the storage of FDN numbers + within this ICC is supported. */ + KSstFDN=0x04, + /** Indicates that the Short Message Service and the storage of short messages within + this ICC is supported. + + Modes: Common */ + KSstSMS=0x08, + /** Indicates that the Advice of Charge service is supported by this ICC. + + Modes: GSM/WCDMA */ + KSstAoC=0x10, + /** Indicates that the storage of Configuration Capability Parameters associated + with an AND, FDN, MSISDN, LND or SDN is supported by this ICC. + + Modes: GSM/WCDMA */ + KSstCCP=0x20, + /** Indicates that storage of a preferred network list is supported by this ICC. + + v1.0 of Multimode ETel API does not support this feature + + Modes: GSM/WCDMA */ + KSstPLMNSelector=0x40 + }; + +/** SIM/USIM/CDMA Service Table (continued). + +Modes: GSM/WCDMA */ + enum TSSTServices9To16 + { + /** Indicates that storage of MSISDN (own numbers) numbers within this ICC is supported. + + Modes: GSM/WCDMA */ + KSstMSISDN=0x01, + /** Indicates that storage of extended (greater than 20 digits) ADN, LND and MSISDN + numbers within this ICC is supported. + + Modes: Common */ + KSstExt1=0x02, + /** Indicates that storage of extended (greater than 20 digits) FDN numbers within + this ICC is supported. + + Modes: Common */ + KSstExt2=0x04, + /** Indicates that storage of SMS parameter records within this ICC is supported. + + Modes: Common */ + KSstSMSP=0x08, + /** Indicates that storage of Last Numbers Dialled within this ICC is supported. + + Modes: Common */ + KSstLND=0x10, + /** Indicates that the storage of Cell Broadcast message identifiers is supported + within this ICC. + + Modes: GSM/WCDMA */ + KSstCBMI=0x20, + /** Indicates that access to the GID1 file is supported within this ICC. + + v1.0 of Multimode ETel API does not support this feature + + Modes: GSM/WCDMA */ + KSstGID1=0x40, + /** Indicates that access to the GID2 file is supported within this ICC. + + v1.0 of Multimode ETel API does not support this feature + + Modes: GSM/WCDMA */ + KSstGID2=0x80 + }; + +/** SIM/USIM/CDMA Service Table (continued). + +v1.0 of Multimode ETel API does not support this feature + +Modes: Common */ + enum TSSTServices17To24 + { + /** Indicates that access to the Service Provider Name within ICC is supported. + + v1.0 of Multimode ETel API does not support this feature + + Modes: Common */ + KSstSPName=0x01, + /** Indicates that storage of Service Dialling Numbers within ICC is supported. + + Modes: Common */ + KSstSDN=0x02, + /** Indicates that storage of extended (greater than 20 digits) SDN numbers within + this ICC/RUIM is supported. + + Modes: Common */ + KSstExt3=0x04, + /** Indicates that access to the VGCS group identifier list within ICC is supported. + + v1.0 of Multimode ETel API does not support this feature + + Modes: GSM/WCDMA */ + KSstVGCSList=0x10, + /** Indicates that access to the VBS group identifier list within ICC is supported. + + v1.0 of Multimode ETel API does not support this feature + + Modes: GSM/WCDMA */ + KSstVBSList=0x20, + /** Indicates that the enhanced Multi-Level Precedence and Pre-emption service is + supported by ICC + + v1.0 of Multimode ETel API does not support this feature + + Modes: GSM/WCDMA */ + KSsteMLPP=0x40, + /** Indicates that automatic answer for eMLPP is supported by ICC + + v1.0 of Multimode ETel API does not support this feature + + Modes: GSM/WCDMA */ + KSstAnswereMLPP=0x80 + }; + +/** SIM/USIM/CDMA Service Table (continued). + +Modes: GSM/WCDMA */ + enum TSSTServices25To32 + { + /** Indicates that SAT SMS-CB data download is supported by ICC. */ + KSstSmsCbDataDownload=0x01, + /** Indicates that SAT SMS-PP data download is supported by ICC. */ + KSstSmsPpDataDownload=0x02, + /** Indicates that SAT menu selection is supported by ICC. + + SAT ETel API provides this feature. */ + KSstMenuSelection=0x04, + /** Indicates that SAT call control is supported by ICC. + + SAT ETel API provides this feature. */ + KSstCallControl=0x08, + /** Indicates that SAT pro-active SIM is supported by ICC. + + SAT ETel API provides this feature. */ + KSstProactiveSim=0x10, + /** Indicates ICC storage of ranges of Cell Broadcast Message Identifiers is supported. */ + KSstCBMIRanges=0x20, + /** Indicates ICC storage of Barred Dialling Numbers is supported. */ + KSstBDN=0x40, + /** Indicates ICC storage of extended (greater than 20 digits) BDN numbers is supported. */ + KSstExt4=0x80 + }; + +/** SIM/USIM/CDMA Service Table (continued). + +Modes: GSM/WCDMA */ + enum TSSTServices33To40 + { + /** Indicates depersonalisation control keys are supported by ICC. + + v1.0 of Multimode ETel API does not support this feature. */ + KSstDepersonalisationKeys=0x01, + /** Indicates co-operative network list are supported by this ICC. + + v1.0 of Multimode ETel API does not support this feature. */ + KSstCooperativeNetworks=0x02, + /** Indicates Short Message Status Reports are supported by ICC. */ + KSstSMStatusReports=0x04, + /** Indicates network's indication of alerting is supported by ICC. + + v1.0 of Multimode ETel API does not support this feature. */ + KSstNetworkIndAlerting=0x08, + /** Indicates outgoing SM control by SAT is supported by ICC. + + SAT ETel API provides this feature. */ + KSstMoSmControlBySim=0x10, + /** Indicates that GPRS is supported by this ICC. + + GPRS ETel API provides GPRS functionality. */ + KSstGprs=0x20, + /** Indicates that Image files are supported by this ICC. + + SAT ETel API provides this feature. */ + KSstImage=0x40, + /** Indicates that SoLSA in supported by this ICC. + + v1.0 of Multimode ETel API does not support this feature */ + KSstSoLSA=0x80 + }; + +/** SIM/USIM/CDMA Service Table (continued). + +Modes: GSM/WCDMA */ + enum TSSTServices41To48 + { + /** Indicates that USSD string data is supported in SAT Call Control by this ICC. + + SAT ETel API provides this feature. */ + KSstUssdStringInCallControl=0x01, + /** Indicates that RUN AT COMMAND is supported in SAT by this ICC. + + v1.0 of Multimode ETel API does not support this feature */ + KSstRunATCommand=0x02, + /** Indicates that PLMN selector list with access technology is supported by this + ICC. + + v1.0 of Multimode ETel API does not support this feature. */ + KSstPlmnSelectorListWithAccessTechnology=0x04, + /** Indicates that OPLMN selector list with access technology is supported by this + ICC. + + v1.0 of Multimode ETel API does not support this feature. */ + KSstOplmnSelectorListWithAccessTechnology=0x08, + /** Indicates that HPLMN access technology is supported by this ICC. + + v1.0 of Multimode ETel API does not support this feature. */ + KSstHplmnAccessTechnology=0x10, + /** Indicates that CPBCCH information is supported by this ICC. + + v1.0 of Multimode ETel API does not support this feature. */ + KSstCpbcchInformation=0x20, + /** Indicates that Investigation Scan is supported by this ICC. + + v1.0 of Multimode ETel API does not support this feature. */ + KSstInvestigationScan=0x40, + /** Indicates that extended capability configuration parameters are supported by + this ICC. + + v1.0 of Multimode ETel API does not support this feature. */ + KSstExtendedCcp=0x80 + }; + +/** SIM/USIM/CDMA Service Table (continued). + +Modes: GSM/WCDMA */ + enum TSSTServices49To56 + { + /** Indicates Mobile Execution Environment services are supported by this ICC */ + KSstMExE=0x01, + /** Indicates that RPLMN last used access technology is supported by this ICC. + + v1.0 of Multimode ETel API does not support this feature. */ + KSstRplmnLastUsedAccessTechnology=0x02 + }; + +/** USIM service table. */ + enum TUSTServices1To8 + { + /** Indicates that the local phonebook is supported by the USIM. Local phonebook + means a phonebook that is specific to a USIM Application, as opposed to the + global phonebook which is located at the DF Telecom level on the UICC and + not attached to a USIM Application. */ + KUstLocalPhBk=0x01, + /** Indicates that the Fixed Dialling Numbers (FDN) service and the storage of + FDN numbers within this USIM is supported. */ + KUstFDN=0x02, + /** Indicates that the Extension 2 is supported by the USIM. Extension 2 provides + extension data for Fixed Dialling Numbers. */ + KUstExt2=0x04, + /** Indicates that the Service Dialling Numbers are supported by the USIM. */ + KUstSDN=0x08, + /** Indicates that the Extension 3 is supported by the USIM. Extension 3 provides + extension data for Service Dialling Numbers. */ + KUstExt3=0x10, + /** Indicates that the Barred Dialling Numbers are supported by the USIM. */ + KUstBDN=0x20, + /** Indicates that the Extension 4 is supported by the USIM. Extension 4 provides + extension data for Barred Dialling Numbers. */ + KUstExt4=0x40, + /** Indicates that the outgoing call information (OCI and OCT) are supported by + the USIM. + + Note: v2.0 of Multimode ETel API does not support this feature. */ + KUstOugoingCallInfo=0x80 + }; + +/** USIM service table (continued). */ + enum TUSTServices9To16 + { + /** Indicates that the incoming call information (ICI and ICT) are supported by + the USIM + + Note: v2.0 of Multimode ETel API does not support this feature. */ + KUstIncomingCallInfo=0x01, + /** Indicates that Short Message Storage is supported by the USIM. */ + KUstSMS=0x02, + /** Indicates that Short Message Status Reports are supported by the USIM. */ + KUstSMSR=0x04, + /** Indicates that Short Message Service Parameters are supported by the USIM. */ + KUstSMSP=0x08, + /** Indicates that Advice Of Charge is supported by the USIM. */ + KUstAoC=0x10, + /** Indicates that Capability Configuration Parameters are supported by the USIM. */ + KUstCCP=0x20, + /** Indicates that Cell Broadcast Message Identifier is supported by the USIM. */ + KUstCBMI=0x40, + /** Indicates that Cell Broadcast Message Identifier Ranges are supported by the + USIM. */ + KUstCBMIRanges=0x80 + }; + +/** USIM service table (continued). */ + enum TUSTServices17To24 + { + /** Indicates that Group Identifier Level 1 is supported by the USIM. + + Note: v2.0 of Multimode ETel API does not support this feature. */ + KUstGID1=0x01, + /** Indicates that Group Identifier Level 2 is supported by the USIM. + + Note: v2.0 of Multimode ETel API does not support this feature. */ + KUstGID2=0x02, + /** Indicates that Service Provider Name is supported by the USIM. */ + KUstSPN=0x04, + /** Indicates that user controlled PLMN selector with Access Technology is supported + by the USIM. + + Note: v2.0 of Multimode ETel API does not support this feature. */ + KUstPLMNSelAccessTech=0x08, + /** Indicates that MSISDN is supported by the USIM. */ + KUstMSISDN=0x10, + /** Indicates that Image is supported by the USIM. + + Note: (U)SAT ETel API provides this feature. This enum value is reserved for + future API use. */ + KUstIMG=0x20, + //0x40 is a reserved value + /** Indicates that enhanced Multi Level Precedence and Pre-emption Service is supported + by the USIM. + + Note: v2.0 of Multimode ETel API does not support this feature. */ + KUsteMLPP=0x80 + }; + +/** USIM service table (continued). */ + enum TUSTServices25To32 + { + /** Indicates that Automatic Answer for eMLPP is supported by the USIM. + + Note: v1.0 and v2.0 of Multimode ETel API do not support this feature. */ + KUstAnswereMLPP=0x01, + //0x02 is a reserved value + /** Indicates that GSM Access is supported by the USIM */ + KUstGSMAccess=0x04, + /** Indicates that Data download via SMS-PP is supported by the USIM. + + Note: (U)SAT ETel API provides this feature. */ + KUstSMSPpDataDownload=0x08, + /** Indicates that Data download via SMS-CB is supported by the USIM. + + Note: (U)SAT ETel API provides this feature. */ + KUstSMSCbDataDownload=0x10, + /** Indicates that Call Control by USIM is supported by the USIM. + + Note: (U)SAT ETel API provides this feature. */ + KUstCallControl=0x20, + /** Indicates that MO-SMS Control by USIM is supported by the USIM. + + Note: (U)SAT ETel API provides this feature. */ + KUstMoSmControl=0x40, + /** Indicates that the proactive command RUN AT COMMAND is supported by the USIM. + + Note: (U)SAT ETel API provides this feature. */ + KUstPCmdRunAtCommand=0x80 + }; + +/** USIM service table (continued). */ + enum TUSTServices33To40 + { + /** Should always be present as specified by 3 GPP spec. */ + KUstAlways=0x10, + /** Indicates that the Enabled Service Table is supported by the USIM. */ + KUstEST=0x02, + /** Indicates that APN Control List is supported by the USIM. + + Note: v2.0 of Multimode ETel API does not support this feature. */ + KUstACL=0x04, + /** Indicates that the Depersonalisation Control Keys are supported by the USIM. + + Note: v2.0 of Multimode ETel API does not support this feature. */ + KIstDepersonalisationKeys =0x08, + /** Indicates that the Co-operative Network List is supported by the USIM. + + Note: v2.0 of Multimode ETel API does not support this feature. */ + KUstCooperativeNetwork=0x10, + /** Indicates that GSM Security Context is supported by the USIM. */ + KUstGSMSecurityContext=0x20, + /** Indicates that CPBCCH Information is supported by the USIM. + + Note: v2.0 of Multimode ETel API do not support this feature. */ + KUstCPBCCHInfo=0x40, + /** Indicates that Investigation Scan is supported by the USIM. + + Note:v2.0 of Multimode ETel API do not support this feature. */ + KUstInvestigationScan=0x80 + }; + +/** USIM service table (continued). */ + enum TUSTServices41To48 + { + /** Indicates that MExE is supported by the USIM. + + Note: v2.0 of Multimode ETel API do not support this feature. */ + KUstMExE=0x01, + /** Indicates that Operator controlled PLMN selector with Access Technology is + supported by the USIM. + + N.B .v2.0 of Multimode ETel API do not support this feature. */ + KUstOperatorPLMNSelector=0x02, + /** Indicates that HPLMN selector with Access Technology is supported by the USIM. + + Note: v2.0 of Multimode ETel API do not support this feature. */ + KUstHPLMNSelAccessTech=0x04, + /** Indicates that Extension 5 is supported by the USIM. Provides support for extension + data for MSISDN. */ + KUstExt5=0x08, + /** Indicates that PLMN Network Name is supported by the USIM. + + Note: v2.0 of Multimode ETel API do not support this feature. */ + KUstPLMNNetworkName=0x10, + /** Indicates that Operator PLMN List is supported by the USIM. + + Note: v2.0 of Multimode ETel API do not support this feature. */ + KUstOperatorPLMNList=0x20, + /** Indicates that Mailbox Dialling Numbers are supported by the USIM. */ + KUstMDN=0x40, + /** Indicates that Message Waiting Indication Status is supported by the USIM. */ + KUstMWISo=0x80 + }; + +/** USIM service table (continued). */ + enum TUSTServices49To56 + { + /** Indicates that Call forwarding indication status is supported by the USIM. + + Note: v2.0 of Multimode ETel API do not support this feature. */ + KUstCFIS=0x01, + /** Indicates that RPLMN last-used access technology is supported by the USIM. + + Note: v2.0 of Multimode ETel API do not support this feature. */ + KUstRPLMN=0x02, + /** Indicates that Service provider display information is supported by the USIM. + + Note: v2.0 of Multimode ETel API do not support this feature. */ + KUstSPDI=0x04, + KUstMMS=0x08, + KUstExt8=0x10, + KUstCConGPRS=0x20, + KUstMMSUCP=0x40 + }; + +/** Enabled Services Table. */ + enum TESTServices1To8 + { + /** Indicates that FDN service is activated. */ + KEstFDN=0x01, + /** Indicates that BDN service is activated. */ + KEstBDN=0x02, + /** Indicates that the APN Control List service is activated. + + Note: v2.0 of Multimode ETel API do not support this feature. */ + KEstACL=0x04 + }; + +/** Get Service Table. + +Modes: GSM/WCDMA */ + enum TMobilePhoneServiceTable + { + /** Retrieve SIM service table on SIM (or from GSM application on UICC). + + Modes: GSM/WCDMA */ + ESIMServiceTable, + /** Retrieve USIM service table from active USIM application on UICC. + + Modes: WCDMA */ + EUSIMServiceTable, + /** Retrieve CDMA service table on R-UIM. + + Modes: CDMA */ + ECDMAServiceTable, + /** USIM Enabled Services Table to be used in conjunction with the USIM Service + Table. + + Modes: WCDMA */ + EUSIMEnabledServiceTable + }; + + + class TMobilePhoneServiceTableV1 : public TMultimodeType + /** Defines contents of the specified Service Table on the ICC. + + @see GetServiceTable() + @publishedPartner + @released + */ + { + public: + IMPORT_C TMobilePhoneServiceTableV1(); + + /** Sum of the TSSTServices1To8 capability constants. */ + TUint8 iServices1To8; + /** Sum of the TSSTServices9To16 capability constants. */ + TUint8 iServices9To16; + /** Sum of the TSSTServices17To24 capability constants. */ + TUint8 iServices17To24; + /** Sum of the TSSTServices25To32 capability constants. */ + TUint8 iServices25To32; + /** Sum of the TSSTServices33To40 capability constants. */ + TUint8 iServices33To40; + /** Sum of the TSSTServices41To48 capability constants. */ + TUint8 iServices41To48; + /** Sum of the TSSTServices49To56 capability constants. */ + TUint8 iServices49To56; + }; + +/** A typedef'd packaged TMobilePhoneServiceTableV1 passing through a generic API +function member. */ + typedef TPckg TMobilePhoneServiceTableV1Pckg; + + enum { KAIDSize=16 }; + +/** A typedef'd buffer to hold the application identifier (AID) that identifies +the USIM application in a UICC. The AID consists of a Registered application +provider IDentifier (RID) of 5 bytes and a Proprietary application Identifier +eXtension (PIX) of up to 11 bytes. */ + typedef TBuf8 TAID; + + class TMobilePhoneServiceTableV2 : public TMobilePhoneServiceTableV1 +/** Defines contents of the specified Service Table on the ICC for the v2.0 version +of the API. +*/ + { + public: + IMPORT_C TMobilePhoneServiceTableV2(); + public: + /** The application identifier. */ + TAID iAID; + }; + +/** A typedef'd packaged TMobilePhoneServiceTableV2 passing through a generic API +function member. */ + typedef TPckg TMobilePhoneServiceTableV2Pckg; + + IMPORT_C void GetServiceTable(TRequestStatus& aReqStatus, TMobilePhoneServiceTable aTable, TDes8& aTableData) const; + + + /***********************************************************************************/ + // + // MobilePhonePower functional unit + // + /***********************************************************************************/ + +/** Phone supported battery information. + +Modes: Common */ + enum TMobilePhoneBatteryCaps + { + /** Phone supports requests to get the current battery information. */ + KCapsGetBatteryInfo=0x00000001, + /** Phone supports requests for notification of change in battery information. */ + KCapsNotifyBatteryInfoChange=0x00000002 + }; + + IMPORT_C TInt GetBatteryCaps(TUint32& aCaps) const; + +/** The mobile phone battery status. + +Modes: Common */ + enum TMobilePhoneBatteryStatus + { + /** The TSY can not determine the phone's current power status. */ + EPowerStatusUnknown, + /** The phone is currently powered by a battery. */ + EPoweredByBattery, + /** A battery is connected, but the phone is externally powered. */ + EBatteryConnectedButExternallyPowered, + /** No battery is connected. */ + ENoBatteryConnected, + /** Power fault. */ + EPowerFault + }; + + class TMobilePhoneBatteryInfoV1 : public TMultimodeType +/** Defines contents of the battery status of the phone. + +@see GetBatteryInfo() +@see NotifyBatteryInfoChange() +*/ + { + public: + IMPORT_C TMobilePhoneBatteryInfoV1(); + public: + /** The power and battery status. + + @see TMobilePhoneBatteryStatus */ + TMobilePhoneBatteryStatus iStatus; + /** The percentage battery charge level. */ + TUint iChargeLevel; + }; + + IMPORT_C void GetBatteryInfo(TRequestStatus& aReqStatus, TMobilePhoneBatteryInfoV1& aInfo) const; + IMPORT_C void NotifyBatteryInfoChange(TRequestStatus& aReqStatus, TMobilePhoneBatteryInfoV1& aInfo) const; + + + /***********************************************************************************/ + // + // MobilePhoneSignal functional unit + // + /***********************************************************************************/ + +/** The mobile phone signal strength capabilities. + +Modes: Common */ + enum TMobilePhoneSignalCaps + { + /** Phone supports requests to get the current signal strength. */ + KCapsGetSignalStrength=0x00000001, + /** Phone supports requests for notification of change in signal strength. */ + KCapsNotifySignalStrengthChange=0x00000002 + }; + + IMPORT_C TInt GetSignalCaps(TUint32& aCaps) const; + IMPORT_C void GetSignalStrength(TRequestStatus& aReqStatus, TInt32& aSignalStrength, TInt8& aBar) const; + IMPORT_C void NotifySignalStrengthChange(TRequestStatus& aReqStatus, TInt32& aSignalStrength, TInt8& aBar) const; + + /***********************************************************************************/ + // + // MobilePhoneIndicator functional unit + // + /***********************************************************************************/ + +/** The mobile phone indicator capabilities supported. + +Modes: Common */ + enum TMobilePhoneIndicatorCaps + { + /** Phone supports requests to get the current value of all supported indicators. */ + KCapsGetIndicator=0x00000001, + /** Phone supports requests for notification of change in the supported indicators. */ + KCapsNotifyIndicatorChange=0x00000002 + }; + +/** The mobile phone indicators. + +Modes Common */ + enum TMobilePhoneIndicators + { + /** If bit-flag is set to '1' indicates that the battery charger is connected to + the phone. If bit-flag is set to '0' indicates that the battery charger is + disconnected. */ + KIndChargerConnected=0x00000001, + /** If bit-flag is set to '1' indicates that network service is available. If bit-flag + is set to '0' indicates that network service is unavailable. */ + KIndNetworkAvailable=0x00000002, + /** If bit-flag is set to '1' indicates that a call is in progress. If set to '0' + indicates that a call is not in progress. */ + KIndCallInProgress=0x00000004 + }; + + IMPORT_C TInt GetIndicatorCaps(TUint32& aActionCaps, TUint32& aIndCaps) const; + IMPORT_C void GetIndicator(TRequestStatus& aReqStatus, TUint32& aIndicator) const; + IMPORT_C void NotifyIndicatorChange(TRequestStatus& aReqStatus, TUint32& aIndicator) const; + + + /***********************************************************************************/ + // + // MobilePhoneIdentity functional unit + // + /***********************************************************************************/ + +/** Defines Identity Capabilities. + +Modes: Common */ + enum TMobilePhoneIdentityCaps + { + /** Phone can return the identity of its manufacturer. */ + KCapsGetManufacturer=0x00000001, + /** Phone can return the identity of its model. */ + KCapsGetModel=0x00000002, + /** Phone can return the identity of its revision. */ + KCapsGetRevision=0x00000004, + /** Phone can return the identity of its serial number. */ + KCapsGetSerialNumber=0x00000008, + /** Phone can return the identity of its subscriber. */ + KCapsGetSubscriberId=0x00000010 + }; + + IMPORT_C TInt GetIdentityCaps(TUint32& aCaps) const; + + enum { KPhoneManufacturerIdSize=50 }; + enum { KPhoneModelIdSize=50 }; + enum { KPhoneRevisionIdSize=50 }; + enum { KPhoneSerialNumberSize=50 }; + + class TMobilePhoneIdentityV1 : public TMultimodeType +/** Defines the mobile phone identity. + +@see GetPhoneId() */ + { + public: + IMPORT_C TMobilePhoneIdentityV1(); + public: + /** Phone manufacturer identification, in character string format. */ + TBuf iManufacturer; + /** Phone model identification, in character string format. */ + TBuf iModel; + /** Phone revision identification, in character string format. */ + TBuf iRevision; + /** Phone serial number (IMEI or ESN), in character string format. */ + TBuf iSerialNumber; + }; + + IMPORT_C void GetPhoneId(TRequestStatus& aReqStatus, TMobilePhoneIdentityV1& aId) const; + + enum { KIMSISize = 15 }; + +/** A typedef'd buffer to hold the mobile phone subscriber id. */ + typedef TBuf TMobilePhoneSubscriberId; + + IMPORT_C void GetSubscriberId(TRequestStatus& aReqStatus, TMobilePhoneSubscriberId& aId) const; + + /***********************************************************************************/ + // + // MobilePhoneDTMF functional unit + // + /***********************************************************************************/ + +/** DTMF Capabilities. + +Modes: Common */ + enum TMobilePhoneDTMFCaps + { + /** Capability to send a string of DTMF tones, containing one or more tone(s). */ + KCapsSendDTMFString=0x00000001, + /** Capability to send one DTMF tone, using start and stop DTMF tone function member. */ + KCapsSendDTMFSingleTone=0x00000002, + }; + + /** + DTMF tone operation event. + */ + enum TMobilePhoneDTMFEvent + { + /** + Start sending of a Dtmf tone operation has been acknowledged from the MSC. + */ + EStartDtmfTone, + /** + Stop sending of a Dtmf tone operation has been acknowledged from the MSC. + */ + EStopDtmfTone, + }; + + + IMPORT_C TInt GetDTMFCaps(TUint32& aCaps) const; + IMPORT_C void NotifyDTMFCapsChange(TRequestStatus& aReqStatus, TUint32& aCaps) const; + + IMPORT_C void SendDTMFTones(TRequestStatus& aReqStatus, const TDesC& aTones) const; + IMPORT_C void ReadDTMFTones(TRequestStatus& aReqStatus, TDes& aTones) const; + IMPORT_C TInt StartDTMFTone(TChar aTone) const; + IMPORT_C TInt StopDTMFTone() const; + + IMPORT_C void NotifyStopInDTMFString(TRequestStatus& aRequestStatus) const; + IMPORT_C TInt ContinueDTMFStringSending(TBool aContinue) const; + IMPORT_C void NotifyDTMFEvent(TRequestStatus& aReqStatus, TMobilePhoneDTMFEvent& aEvent) const; + + /***********************************************************************************/ + // + // MobilePhoneNetwork functional unit + // + /***********************************************************************************/ + +/** Defines Network Capabilities. + +Modes: Common */ + enum TMobilePhoneNetworkCaps + { + /** The phone supports retrieval of current registration status. */ + KCapsGetRegistrationStatus=0x00000001, + /** The phone supports notifications of change in registration status. */ + KCapsNotifyRegistrationStatus=0x00000002, + /** The phone supports retrieval of current mode. */ + KCapsGetCurrentMode=0x00000004, + /** The phone supports notification of change in mode. */ + KCapsNotifyMode=0x00000008, + /** The phone supports retrieval of current network information. */ + KCapsGetCurrentNetwork=0x00000010, + /** The phone supports notification of change of current network. */ + KCapsNotifyCurrentNetwork=0x00000020, + /** The phone supports retrieval of home network information. */ + KCapsGetHomeNetwork=0x00000040, + /** The phone supports retrieval of a list of detected networks. */ + KCapsGetDetectedNetworks=0x00000080, + /** The phone supports manual network selection mode. */ + KCapsManualNetworkSelection=0x00000100, + /** The phone supports retrieval of time and date information (NITZ) received from + the network. */ + KCapsGetNITZInfo=0x00000200, + /** The phone supports notification of new updates of time & date information (NITZ) + received from the network. */ + KCapsNotifyNITZInfo=0x00000400 + }; + + IMPORT_C TInt GetNetworkCaps(TUint32& aCaps) const; + +/** Defines Current Network Modes. + +Modes: Common */ + enum TMobilePhoneNetworkMode + { + /** Network mode is unknown. + + Modes: Common */ + ENetworkModeUnknown, + /** ME is not registered. + + Modes: Common */ + ENetworkModeUnregistered, + /** GSM/GPRS or DCS1800 network. */ + ENetworkModeGsm, + /** AMPS network. + + Modes: CDMA */ + ENetworkModeAmps, + /** CDMA (IS-95) network. + + Modes: CDMA */ + ENetworkModeCdma95, + /** CDMA (cdma2000) network. + + Modes: CDMA */ + ENetworkModeCdma2000, + /** WCDMA (UTRA Frequency Division Duplex (FDD)) network. + + Modes: WCDMA */ + ENetworkModeWcdma, + /** TD-CDMA (UTRA Time Division Duplex (TDD)) network. + + Modes: WCDMA */ + ENetworkModeTdcdma + }; + + IMPORT_C TInt GetCurrentMode(TMobilePhoneNetworkMode& aNetworkMode) const; + IMPORT_C void NotifyModeChange(TRequestStatus& aReqStatus, TMobilePhoneNetworkMode& aNetworkMode) const; + +/** Phone network status. + +Modes: Common */ + enum TMobilePhoneNetworkStatus + { + /** Status is unknown. */ + ENetworkStatusUnknown, + /** A network that the ME is allowed to register to. */ + ENetworkStatusAvailable, + /** The currently registered network. */ + ENetworkStatusCurrent, + /** A network that the ME is not allowed to register to. */ + ENetworkStatusForbidden + }; + +/** Mobile phone network band information. + +Modes: CDMA */ + enum TMobilePhoneNetworkBandInfo + { + /** The current band and band class is unknown. */ + EBandUnknown, + /** The network operates at 800MHz on Band A. */ + E800BandA, + /** The network operates at 800MHz on Band B. */ + E800BandB, + /** The network operates at 800MHz on Band C. */ + E800BandC, + /** The network operates at 1900MHz on Band A. */ + E1900BandA, + /** The network operates at 1900MHz on Band B. */ + E1900BandB, + /** The network operates at 1900MHz on Band C. */ + E1900BandC, + /** The network operates at 1900MHz on Band D. */ + E1900BandD, + /** The network operates at 1900MHz on Band E. */ + E1900BandE, + /** The network operates at 1900MHz on Band F. */ + E1900BandF + }; + +/** A typedef'd buffer to hold the network display tag */ + typedef TBuf<30> TMobilePhoneNetworkDisplayTag; +/** A typedef'd buffer to hold the network long name. */ + typedef TBuf<20> TMobilePhoneNetworkLongName; +/** A typedef'd buffer to hold the network short name. */ + typedef TBuf<10> TMobilePhoneNetworkShortName; + +/** A typedef'd buffer to hold the network country code. */ + typedef TBuf<4> TMobilePhoneNetworkCountryCode; // MCC in GSM and CDMA +/** A typedef'd buffer to hold the network identity. */ + typedef TBuf<8> TMobilePhoneNetworkIdentity; // MNC in GSM and SID or NID in CDMA + + + + class TMobilePhoneNetworkInfoV1 : public TMultimodeType + /** Defines information related to a mobile phone network. + + @see GetCurrentNetwork() + @see NotifyCurrentNetworkChange() + @see GetHomeNetwork() + @publishedPartner + @released */ + { + public: + IMPORT_C TMobilePhoneNetworkInfoV1(); + public: + void InternalizeL(RReadStream& aStream); + void ExternalizeL(RWriteStream& aStream) const; + public: + /** Mode of the network. + + Modes: Common + + @see TMobilePhoneNetworkMode */ + TMobilePhoneNetworkMode iMode; + /** Status of the network + + Modes: Common + + @see TMobilePhoneNetworkStatus */ + TMobilePhoneNetworkStatus iStatus; + /** The band and band class of the CDMA network operator. + + Modes: CDMA + + @see TMobilePhoneNetworkBandInfo */ + TMobilePhoneNetworkBandInfo iBandInfo; + /** The MCC of the network. + + Modes: Common + + @see TMobilePhoneNetworkCountryCode */ + TMobilePhoneNetworkCountryCode iCountryCode; + /** The system identity (SID) of the CDMA network. + + Modes: CDMA + + @see TMobilePhoneNetworkIdentity */ + TMobilePhoneNetworkIdentity iCdmaSID; + /** The system identity (SID) of the AMPS network. + + Modes: CDMA + + @see TMobilePhoneNetworkIdentity */ + TMobilePhoneNetworkIdentity iAnalogSID; + /** The network identity (NID in CDMA and MNC in GSM). + + Modes: Common + + @see TMobilePhoneNetworkIdentity */ + TMobilePhoneNetworkIdentity iNetworkId; + /** The alpha-tag displayed when this is the serving network. + + Modes: Common + + @see TMobilePhoneNetworkDisplayTag */ + TMobilePhoneNetworkDisplayTag iDisplayTag; + /** The short name (up to 10 characters) of the network operator. + + Modes: GSM/WCDMA + + @see TMobilePhoneNetworkShortName */ + TMobilePhoneNetworkShortName iShortName; + /** The long name (up to 20 characters) of the network operator. + + Modes: GSM/WCDMA + + @see TMobilePhoneNetworkLongName */ + TMobilePhoneNetworkLongName iLongName; + }; + +/** A typedef'd packaged TMobilePhoneNetworkInfoV1 for passing through a generic +API function member. */ + typedef TPckg TMobilePhoneNetworkInfoV1Pckg; + +/** The access technology that the network is based on. + +Modes: Common */ + enum TMobilePhoneNetworkAccess + { + /** This is used when there is no network activity and therefore no RAT active. + + Modes: Common */ + ENetworkAccessUnknown, + /** The access technology is GSM. + + Modes: GSM */ + ENetworkAccessGsm, + /** The access technology is GSM COMPACT. However GSM COMPACT systems which use + GSM frequency bands but with the CBPCCH broadcast channel are considered as + a separate access technology from GSM. + + Modes: GSM */ + ENetworkAccessGsmCompact, + /** The access technology is UTRAN (UMTS Network). + + Modes: WCDMA */ + ENetworkAccessUtran, + /** Analogue Cellular + + Modes: CDMA */ + ENetworkAccessAmpsCellular, + /** CDMA Cellular - Standard channels + + Modes: CDMA */ + ENetworkAccessCdmaCellularStdChannel, + /** CDMA Cellular - Custom channels + + Modes: CDMA */ + ENetworkAccessCdmaCellularCustomChannel, + /** CDMA/Analogue Cellular (cdma first then analogue) + + Modes: CDMA */ + ENetworkAccessCdmaAmpsCellular, + /** CDMA PCS - Using blocks + + Modes: CDMA */ + ENetworkAccessCdmaPcsUsingBlocks, + /** CDMA PCS - Using channels + + Modes: CDMA */ + ENetworkAccessCdmaPcsUsingNetworkAccessChannels, + /** CDMA JTACS - Standard channels + + Modes: CDMA */ + ENetworkAccessJTacsStdChannels, + /** CDMA JTACS - Custom channels + + Modes: CDMA */ + ENetworkAccessJTacsCustomChannels, + /** CDMA 2GHz band - Using channels + + Modes: CDMA */ + ENetworkAccess2GHzBandUsingChannels, + /** Generic Acquisition Record for IS-2000 and IS-95 + + Modes: CDMA */ + ENetworkAccessGenericAcqRecord2000and95, + /** Generic Acquisition Record for IS-856 + + Modes: CDMA */ + ENetworkAccessGenericAcqRecord856 + }; + + + + class TMobilePhoneNetworkInfoV2 : public TMobilePhoneNetworkInfoV1 + /** The access technology that the network is based on in version v2.0 of the API. + @publishedPartner + @released*/ + { + public: + /** Default constructor. Network access is set to ENetworkAccessUnknown and iExtensionId + is set to KETelExtMultimodeV2. */ + IMPORT_C TMobilePhoneNetworkInfoV2(); + + public: + void InternalizeL(RReadStream& aStream); + void ExternalizeL(RWriteStream& aStream) const; + + public: + /** The type of network access. + + @see TMobilePhoneNetworkAccess */ + TMobilePhoneNetworkAccess iAccess; + }; + +/** A typedef'd packaged TMobilePhoneNetworkInfoV2 for passing through a generic +API function member. */ + typedef TPckg TMobilePhoneNetworkInfoV2Pckg; + + + class TMobilePhoneNetworkInfoV5 : public TMobilePhoneNetworkInfoV2 + /** The access technology that the network is based on in version v2.0 of the API. + @publishedPartner + @released*/ + { + public: + IMPORT_C TMobilePhoneNetworkInfoV5(); + + public: + void InternalizeL(RReadStream& aStream); + void ExternalizeL(RWriteStream& aStream) const; + + public: + /** HSDPA availability indicator. This information is for display + indication only and shall not be used for any other purpose. + + Modes: WCDMA */ + TBool iHsdpaAvailableIndicator; + + /** EGPRS availability indicator. This information is for display + indication only and shall not be used for any other purpose. + + Modes: GPRS */ + TBool iEgprsAvailableIndicator; + }; + +/** A typedef'd packaged TMobilePhoneNetworkInfoV5 for passing through a generic +API function member. */ + typedef TPckg TMobilePhoneNetworkInfoV5Pckg; + + class TMobilePhoneLocationAreaV1 : public TMultimodeType +/** Defines the mobile phone location area. + +@see GetCurrentNetwork() +@see NotifyCurrentNetworkChange() */ + { + public: + /** Constructor. */ + IMPORT_C TMobilePhoneLocationAreaV1(); + public: + /** Boolean indicating whether the location area is known. + + Modes: Common */ + TBool iAreaKnown; + /** Location area code. + + Modes: GSM/WCDMA */ + TUint iLocationAreaCode; + /** Cell identity code. + + Modes: GSM/WCDMA */ + TUint iCellId; + }; + + IMPORT_C void GetCurrentNetwork(TRequestStatus& aReqStatus, TDes8& aNetworkInfo, TMobilePhoneLocationAreaV1& aArea) const; + IMPORT_C void NotifyCurrentNetworkChange(TRequestStatus& aReqStatus, TDes8& aNetworkInfo, TMobilePhoneLocationAreaV1& aArea) const; + IMPORT_C void GetCurrentNetwork(TRequestStatus& aReqStatus, TDes8& aNetworkInfo) const; + IMPORT_C void NotifyCurrentNetworkChange(TRequestStatus& aReqStatus, TDes8& aNetworkInfo) const; + + IMPORT_C void GetHomeNetwork(TRequestStatus& aReqStatus, TDes8& aNetworkInfo) const; + IMPORT_C void GetHomeNetworkSearchPeriod(TRequestStatus& aReqStatus, TInt& aSearchIntv) const; + IMPORT_C void GetLastUsedAccessTechnology(TRequestStatus& aReqStatus, TMobilePhoneNetworkAccess& aAccessTech) const; + +/** The registration status of the mobile phone. + +Modes: WCDMA */ + enum TMobilePhoneRegistrationStatus + { + /** Registration status is unknown. */ + ERegistrationUnknown, + /** Not registered. The ME can not detect any other networks and is not currently + searching a new operator to register to. */ + ENotRegisteredNoService, + /** Not registered. The ME can detect other networks on which it is possible to + make emergency calls only. */ + ENotRegisteredEmergencyOnly, + /** Not registered, but the ME is currently searching a new operator to register to. */ + ENotRegisteredSearching, + /** Registered, network busy. + + Modes: WCDMA */ + ERegisteredBusy, + /** Registered on home network. */ + ERegisteredOnHomeNetwork, + /** Registration denied. */ + ERegistrationDenied, + /** Registered, roaming. */ + ERegisteredRoaming + }; + + IMPORT_C void GetNetworkRegistrationStatus(TRequestStatus& aReqStatus, TMobilePhoneRegistrationStatus& aStatus) const; + IMPORT_C void NotifyNetworkRegistrationStatusChange(TRequestStatus& aReqStatus, TMobilePhoneRegistrationStatus& aStatus) const; + +/** The network selection function member. + +Modes: Common */ + enum TMobilePhoneSelectionMethod + { + /** Network selection function member is unknown. + + Modes: Common */ + ENetworkSelectionUnknown, + /** Network is selected automatically by phone. + + Modes: Common */ + ENetworkSelectionAutomatic, + /** Network is selected manually by user. + + Modes: GSM/WCDMA */ + ENetworkSelectionManual, + /** Network selection is restricted to home network only + + Modes: CDMA */ + ENetworkSelectionHomeOnly + }; + +/** The mobile phone band class preferences. + +Modes: CDMA */ + enum TMobilePhoneBandClass + { + /** Band class selection is unknown. */ + ENetworkBandClassUnknown, + /** Phone will select band class A only. */ + ENetworkBandClassAOnly, + /** Phone will select band class B only. */ + ENetworkBandClassBOnly, + /** Phone will prefer to select band class A. */ + ENetworkBandClassAPreferred, + /** Phone will prefer to select band class B. */ + ENetworkBandClassBPreferred + }; + +/** The mobile phone network operation mode preferences. + +Modes: CDMA */ + enum TMobilePhoneOperation + { + /** Network operation mode is unknown. */ + ENetworkOperationUnknown, + /** Phone will select analog operation only. */ + ENetworkOperationAnalogOnly, + /** Phone will select digital/CDMA operation only. */ + ENetworkOperationDigitalOnly, + /** Phone will prefer to select analog operation. */ + ENetworkOperationAnalogPreferred, + /** Phone will prefer to select digital/CDMA operation. */ + ENetworkOperationDigitalPreferred + }; + + class TMobilePhoneNetworkSelectionV1 : public TMultimodeType +/** The mobile phone network selection preferences. + +@see GetNetworkSelectionSetting() +@see SetNetworkSelectionSetting() +@see NotifyNetworkSelectionSettingChange() +@publishedPartner +@released */ + { + public: + IMPORT_C TMobilePhoneNetworkSelectionV1(); + public: + /** Phone's network selection function member. + + Modes: Common + + @see TMobilePhoneSelectionMethod */ + TMobilePhoneSelectionMethod iMethod; + /** Phone's band class setting. + + Modes: CDMA + + @see TMobilePhoneBandClass */ + TMobilePhoneBandClass iBandClass; + /** Phone's CDMA operation mode. + + Modes: CDMA + + @see TMobilePhoneOperation */ + TMobilePhoneOperation iOperationMode; + }; + +/** A typedef'd packaged TMobilePhoneNetworkSelectionV1 for passing through a generic +API function member. */ + typedef TPckg TMobilePhoneNetworkSelectionV1Pckg; + + IMPORT_C TInt GetNetworkSelectionSetting(TDes8& aSetting) const; + IMPORT_C void SetNetworkSelectionSetting(TRequestStatus& aReqStatus, const TDes8& aSetting) const; + IMPORT_C void NotifyNetworkSelectionSettingChange(TRequestStatus& aReqStatus, TDes8& aSetting) const; + + struct TMobilePhoneNetworkManualSelection +/** The mobile phone manual network selection parameters. + +Modes: GSM/WCDMA + +@see TMobilePhoneNetworkCountryCode */ + { + /** The MCC of the network + + @see TMobilePhoneNetworkCountryCode */ + TMobilePhoneNetworkCountryCode iCountry; + /** The MNC of the network + + @see TMobilePhoneNetworkIdentity */ + TMobilePhoneNetworkIdentity iNetwork; + }; + + IMPORT_C void SelectNetwork(TRequestStatus& aReqStatus, TBool aIsManual, const TMobilePhoneNetworkManualSelection& aManualSelection) const; + + + + // Used to indicate which TMobilePhoneNITZ fields are currently available +/** The Phone Network Time Zone Capabilities. */ + enum TMobilePhoneNITZCaps + { + /** Universal Time is available in the current network mode. */ + KCapsTimeAvailable = 0x00000001, + /** Local time zone is available in the current network mode. */ + KCapsTimezoneAvailable = 0x00000002, + /** DST is available in the current network mode. */ + KCapsDSTAvailable = 0x00000004, + /** Short name is available in the current network mode. */ + KCapsShortNameAvailable = 0x00000008, + /** Long name is available in the current network mode. */ + KCapsLongNameAvailable = 0x00000010 + }; + + class TMobilePhoneNITZ : public TDateTime +/** Defines time and date information received from a mobile phone network. + +@see GetNITZInfo() +@see NotifyNITZInfoChange() +@publishedPartner +@released */ + { + public: + IMPORT_C TMobilePhoneNITZ(); + IMPORT_C TMobilePhoneNITZ(TInt aYear, TMonth aMonth, TInt aDay, TInt aHour, TInt aMinute, TInt aSecond, TInt aMicroSecond); + public: + /** Bitwise sum of TMobilePhoneNITZCaps constants used to indicate which NITZ fields + are available. + + Modes: Common */ + TInt32 iNitzFieldsUsed; + /** Time zone, expressed in +/- 15 minute offsets from GMT. + + Modes: Common */ + TInt iTimeZone; + /** Daylight Saving Time adjustment for summer time. The adjustment for DST + can be +1h or +2h. + + Modes: GSM/WCDMA */ + TInt iDST; + /** Network name in "short" representation. + + Modes: GSM/WCDMA + + @see TMobilePhoneNetworkShortName */ + TMobilePhoneNetworkShortName iShortNetworkId; + /** Network name in "long" representation. + + Modes: GSM/WCDMA + + @see TMobilePhoneNetworkLongName */ + TMobilePhoneNetworkLongName iLongNetworkId; + }; + + IMPORT_C TInt GetNITZInfo(TMobilePhoneNITZ& aNITZInfo) const; + IMPORT_C void NotifyNITZInfoChange(TRequestStatus& aReqStatus, TMobilePhoneNITZ& aNITZInfo) const; + + enum { KMaxSPNameSize=16 }; + enum { KMaxPLMNFieldSize=251 }; + + enum TDisplayRequirements + { + KDisplayPLMNNotRequired = 0x00000001, + KDisplayPLMNRequired = 0x00000002, + KDisplaySPNRequired = 0x00000004, + KDisplaySPNNotRequired = 0x00000008 + }; + + typedef TUint32 TDisplayRequirementsFlags; + + class TMobilePhoneServiceProviderNameV2 : public TMultimodeType +/** Used to retrieve the Service Provider Name from the ICC. The +SP is actually the entity that provides the service. The SP could have contractual +agreements with several home PLMN that the ME can register to. The display +preference of the registered PLMN and/or the SPN on the ME can be defined +on the UICC. +@publishedPartner +@released */ + { + public: + IMPORT_C TMobilePhoneServiceProviderNameV2(); + public: + /** This parameter specifies if the display of the registered PLMN is required. + Can contain a number of flags from RMobilePhone::TDisplayRequirements. + */ + TDisplayRequirementsFlags iDisplayReq; + /** The name of the service provider. */ + TBuf iSPName; + TBuf iPLMNField; + }; + +/** A typedef'd packaged TMobilePhoneServiceProviderNameV2 for passing through +a generic API function member. */ + typedef TPckg TMobilePhoneServiceProviderNameV2Pckg; + + IMPORT_C void GetServiceProviderName(TRequestStatus& aReqStatus, TDes8& aName) const; + + /** + Network investigation scan settings. + */ + enum TMobilePhoneInvestigationScan + { + /** + Network investigation setting in limited service mode. + */ + KNetworkInvLimited = 0x01, + /** + Network investigation setting after successful PLMN selection. + */ + KNetworkInvAfterPlmnSelection=0x02 + }; + + /** + Network investigation scan events. + */ + enum TMobilePhoneInvestigationScanEvent + { + /** + No investigation scan events available. + */ + ENetworkInvestigationNoEvent, + /** + A higher priority network has been detected, but it does not offer CS Voice. + */ + ENetworkInvestigationHighPriorityPlmn + }; + + IMPORT_C TInt GetNetworkInvScanSetting(TMobilePhoneInvestigationScan & aSetting) const; + IMPORT_C void NotifyNetworkInvScanChange(TRequestStatus& aReqStatus, TMobilePhoneInvestigationScan& aSetting) const; + IMPORT_C void NotifyNetworkInvScanEvent(TRequestStatus& aReqStatus, TMobilePhoneInvestigationScanEvent& aEvent) const; + + + /** 251 bytes is the maximum number of octets in an L3 message as defined in3GPP TS 44.006. */ + enum { KMaxNetworkNameFieldSize = 251 }; + + class TMobilePhoneNetworkNameV3 : public TMultimodeType + /** + Class containing short, long network names and location information for a PLMN. + */ + { + public: + IMPORT_C TMobilePhoneNetworkNameV3(); + public: + /** + The long name (up to 20 characters) of the network operator. + */ + TMobilePhoneNetworkLongName iLongName; + /** + The short name (up to 10 characters) of the network operator. + */ + TMobilePhoneNetworkShortName iShortName; + /** + This buffer contains other long and short names for the registered PLMN coded as TLV objects. + */ + TBuf iOtherNames; + }; + + /** + Packaging typedef for TMobilePhoneNetworkNameV3 class. + */ + typedef TPckg TMobilePhoneNetworkNameV3Pckg; + + + class TMobilePhoneOPlmnV3 : public TMultimodeType + /** + Class containing network name information. + */ + { + public: + IMPORT_C TMobilePhoneOPlmnV3(); + public: + /** + The MCC of the registered PLMN, with "wild" values specified for the particular digits of the code. + */ + TMobilePhoneNetworkCountryCode iCountryCode; + /** + The MNC of the registered PLMN, with "wild" values specified for the particular digits of the code. + */ + TMobilePhoneNetworkIdentity iNetworkId; + /** + The id of the Network Name to be displayed for the (following) location area codes. + */ + TUint32 iPNNid; + /** + First Location area code for defining the entire range of LACs for the registered PLMN. + */ + TUint iFirstLocationAreaCode; + /** + Last Location area code defining the entire range of LACs for the registered PLMN. + */ + TUint iLastLocationAreaCode; + + }; + + /** + Packaging typedef for TMobilePhoneOPlmnV3 class. + */ + typedef TPckg TMobilePhoneOPlmnV3Pckg; + + IMPORT_C void GetCurrentNetworkName(TRequestStatus& aReqStatus, TDes8& aNetworkName, TDes8& aLocInfo) const; + + /** + Identifiers for different access technologies. + */ + enum TMobilePhoneNetworkAccessCaps + { + /** + No network activity. + */ + KNetworkAccessUnknown=0x0000, + /** + Access technology is GSM. + */ + KNetworkAccessGsm=0x8000, + /** + Access technology is GSM COMPACT. + */ + KNetworkAccessGsmCompact=0x4000, + /** + Access technology is UTRAN (UMTS only). + */ + KNetworkAccessUtran=0x0080 + }; + + typedef TUint32 TMobilePhoneNetworkAccessCapsFlags; + + class TMobilePreferredNetworkEntryV3 : public TMultimodeType + /** + Defines information for a preferred network. + */ + { + public: + IMPORT_C TMobilePreferredNetworkEntryV3(); + public: + void InternalizeL(RReadStream& aStream); + void ExternalizeL(RWriteStream& aStream) const; + public: + /** + Access Technology supported. + Can contain a number of flags from RMobilePhone::TMobilePhoneNetworkAccessCaps. + */ + TMobilePhoneNetworkAccessCapsFlags iAccess; + /** + Editable preferences in the User-controlled Networks List with Access Technology. + */ + TBool iUserDefined; + /** + The MCC of the network. + */ + TMobilePhoneNetworkCountryCode iCountryCode; + /** + The MNC of the network. + */ + TMobilePhoneNetworkIdentity iNetworkId; + }; + + IMPORT_C void StorePreferredNetworksListL(TRequestStatus& aReqStatus, CMobilePhoneStoredNetworkList* aList) const; + IMPORT_C void NotifyPreferredNetworksListChange(TRequestStatus& aReqStatus) const; + + /***********************************************************************************/ + // + // Mobile Multimedia Call Settings functional unit + // + /***********************************************************************************/ + +/** An enumerated list of settings for multimedia calls. */ + enum TMobilePhoneMultimediaSettings + { + /** Accept all incoming multimedia calls with the fallback option enabled. (default). */ + EAcceptMMCallsVoiceFallback, + /** Accept all incoming multimedia calls, but do not accept voice fallback. */ + EAcceptMMCallsNoFallback, + /** Reject all incoming multimedia calls. */ + ERejectMMCalls, + /** Reject all incoming multimedia calls, but drop to voice instead. */ + EAnswerMMCallsAsVoice + }; + + IMPORT_C void SetMultimediaCallPreference(TRequestStatus& aReqStatus, TMobilePhoneMultimediaSettings aMmSettings) const; + IMPORT_C TInt GetMultimediaCallPreference(TMobilePhoneMultimediaSettings& aMmSettings) const; + IMPORT_C void NotifyMultimediaCallPreferenceChange(TRequestStatus& aReqStatus, TMobilePhoneMultimediaSettings& aMmSettings); + + /***********************************************************************************/ + // + // MobilePrivacy functional unit + // + /***********************************************************************************/ + +/** The mobile phone privacy settings. + +Modes: CDMA */ + enum TMobilePhonePrivacy + { + /** The privacy setting is unspecified. */ + EPrivacyUnspecified, + /** The privacy setting is set to ON. */ + EPrivacyOn, + /** The privacy setting is set to OFF. */ + EPrivacyOff + }; + + IMPORT_C TInt GetDefaultPrivacy(TMobilePhonePrivacy& aSetting) const; + IMPORT_C void SetDefaultPrivacy(TRequestStatus& aReqStatus, TMobilePhonePrivacy aSetting) const; + IMPORT_C void NotifyDefaultPrivacyChange(TRequestStatus& aReqStatus, TMobilePhonePrivacy& aSetting) const; + + /***********************************************************************************/ + // + // TSY Capabilities for supplementary call services + // + /***********************************************************************************/ + +/** The call services. + +Modes: GSM/WCDMA */ + enum TMobilePhoneCallServiceCaps + { + /** Phone supports retrieval of call forwarding status from a cache on the phone. + + Modes: GSM/WCDMA */ + KCapsGetCFStatusCache =0x00000001, + /** Phone supports retrieval of call forwarding status from the network. + + Modes: GSM/WCDMA */ + KCapsGetCFStatusNetwork =0x00000002, + /** Phone supports setting of call forwarding status (and registered information) + in the network. */ + KCapsSetCFStatus =0x00000004, + /** Phone supports notification of change in status of any call forwarding service. + + Modes: GSM/WCDMA */ + KCapsNotifyCFStatus =0x00000008, + /** Phone supports retrieval of CLIP status from either a cache or the network. + + Modes: GSM/WCDMA */ + KCapsGetClipStatus =0x00000010, + /** Phone supports retrieval of CLIR status from either a cache or the network. + + Modes: GSM/WCDMA */ + KCapsGetClirStatus =0x00000020, + /** Phone supports retrieval of COLP status from either a cache or the network. + + Modes: GSM/WCDMA */ + KCapsGetColpStatus =0x00000040, + /** Phone supports retrieval of COLR status from either a cache or the network. + + Modes: GSM/WCDMA */ + KCapsGetColrStatus =0x00000080, + /** Phone supports retrieval of CNAP status from either a cache or the network. + + Modes: GSM/WCDMA */ + KCapsGetCnapStatus =0x00000100, + /** Phone supports retrieval of call barring status from a cache on the phone. + + Modes: Common */ + KCapsGetCBStatusCache =0x00000200, + /** Phone supports retrieval of call barring status from the network. + + Modes: GSM/WCDMA */ + KCapsGetCBStatusNetwork =0x00000400, + /** Phone supports setting of call barring status in the network. + + Modes: Common */ + KCapsSetCBStatus =0x00000800, + /** Phone supports notification of change in call barring status for any service. + + Modes: Common */ + KCapsNotifyCBStatus =0x00001000, + /** Phone supports setting of a password for call barring service. + + Modes: Common */ + KCapsChangeCBPassword =0x00002000, + /** Phone supports BAIC call barring service. + + Modes: Common */ + KCapsBarAllIncoming =0x00004000, + /** Phone supports BIC-Roam call barring service. + + Modes: Common */ + KCapsBarIncomingRoaming =0x00008000, + /** Phone supports BAOC call barring service. + + Modes: Common */ + KCapsBarAllOutgoing =0x00010000, + /** Phone supports BOIC call barring service. + + Modes: Common */ + KCapsBarOutgoingInternational =0x00020000, + /** Phone supports BOIC-ExHC call barring service. + + Modes: Common */ + KCapsBarOutgoingInternationalExHC =0x00040000, + /** Phone supports barring all cases at once. + + Modes: Common */ + KCapsBarAllCases =0x00080000, + /** Phone supports retrieval of call waiting status from a cache on the phone. + + Modes: GSM/WCDMA */ + KCapsGetCWStatusCache =0x00100000, + /** Phone supports retrieval of call waiting status from the network. + + Modes: GSM/WCDMA */ + KCapsGetCWStatusNetwork =0x00200000, + /** Phone supports setting of call waiting status in the network. + + Modes: Common */ + KCapsSetCWStatus =0x00400000, + /** Phone supports notification of change in call waiting status for any service. + + Modes: GSM/WCDMA */ + KCapsNotifyCWStatus =0x00800000, + /** Phone supports retrieval of call completion (CCBS) status from a cache on the + phone. + + Modes: GSM/WCDMA */ + KCapsGetCCBSStatusCache =0x01000000, + /** Phone supports retrieval of call completion (CCBS) status from the network. + + Modes: GSM/WCDMA */ + KCapsGetCCBSStatusNetwork =0x02000000, + /** Phone supports deactivation of all CCBS requests at once. + + Modes: GSM/WCDMA */ + KCapsDeactivateAllCCBS =0x04000000, + KCapsDeactivateCCBS =0x08000000, + /** Phone supports retrieval of a list of active CCBS requests. + + Modes: GSM/WCDMA */ + KCapsRetrieveActiveCCBS =0x10000000, + /** The phone supports programming and retrieval of feature code against a CDMA + network service. + + Modes: CDMA */ + KCapsFeatureCode =0x20000000, + /** The phone supports sending of generic network service request strings. + + Modes: Common */ + KCapsNetworkServiceRequest =0x40000000, + /** The phone supports retrieval of called line identification status. + + Modes: GSM/WCDMA */ + KCapsGetCdipStatus =0x80000000 + }; + + IMPORT_C TInt GetCallServiceCaps(TUint32& aCaps) const; + IMPORT_C void NotifyCallServiceCapsChange(TRequestStatus& aReqStatus, TUint32& aCaps) const; + + /***********************************************************************************/ + // + // MobilePhoneUserNetworkAccess functional unit + // + /***********************************************************************************/ + +/** Mobile Phone network services. + +Modes: CDMA */ + enum TMobilePhoneNetworkService + { + /** Network service is unspecified. */ + ENetworkServiceUnspecified, + /** Feature code applies to call forwarding unconditional service. */ + ECFUService, + /** Feature code applies to call forwarding on busy service. */ + ECFBService, + /** Feature code applies to call forwarding on no reply service. */ + ECFNRyService, + /** Feature code applies to call forwarding on not reachable service. */ + ECFNRcService, + /** Feature code applies to user selective call forwarding service - when the + user wishes to forward incoming call to voicemail. */ + EDeflectToVoicemail, + /** Feature code applies to user selective call forwarding service - when the + user wishes to forward incoming call to a number supplied within the deflect + request. */ + EDeflectToNumber, + /** Feature code applies to user selective call forwarding service - when the + user wishes to forward incoming call to a number pre-registered within the + network. */ + EDeflectToRegisteredNumber, + /** Feature code applies to call waiting service. */ + ECWService, + ENextCallShowCLI, + /** Feature code applies to caller ID restriction service - when user wishes to + hide their ID for the next call they make. */ + ENextCallHideCLI + }; + +/** Mobile phone service actions. + +Modes: Common */ + enum TMobilePhoneServiceAction + { + /** The action is unspecified. */ + EServiceActionUnspecified, + /** The client is registering new service information. If the service was not active + then this action also activates the service. */ + EServiceActionRegister, + /** The client is activating the service. */ + EServiceActionActivate, + /** The client is invoking the service. */ + EServiceActionInvoke, + /** The client is deactivating the service. */ + EServiceActionDeactivate, + /** The client is erasing the currently registered service information. If the service + was active then this action also deactivates the service. */ + EServiceActionErase + }; + + /** + Defines the type of SS operation + */ + enum TMobilePhoneNotifySendSSOperation + { + /** + SS Invoke operation. + */ + ESendSSInvoke, + /** + SS ReturnResult operation. + */ + ESendSSReturnResult, + /** + SS ReturnError operation. + */ + ESendSSReturnError, + /** + SS Reject operation. + */ + ESendSSReject + }; + + /** Size of additional info buffer. */ + enum{ KAdditionalInfoSize = 244 }; + + class TMobilePhoneSendSSRequestV3 : public TMultimodeType + /** + Contains the operation code and buffer to hold any additional information when receiving a notification + about a network service request. + */ + { + public: + IMPORT_C TMobilePhoneSendSSRequestV3(); + public: + /** + This is the Operation Code for a Send SS Invoke or Return result events. + This is the Error or Problem Code for a Send SS Return Error or Reject events. + */ + TUint8 iOpCode; + /** + The additional information (parameters) for a Send SS Invoke or Return result or Return Error events. + This is not used for a Send SS Reject event + */ + TBuf iAdditionalInfo; + }; + + /** + Packaging typedef for TMobilePhoneSendSSRequestV3 class. + */ + typedef TPckg TMobilePhoneSendSSRequestV3Pckg; + + // API/TSY internal type + + struct TNetworkServiceAndAction + { + TMobilePhoneNetworkService iService; + TMobilePhoneServiceAction iAction; + }; + + IMPORT_C void ProgramFeatureCode(TRequestStatus& aReqStatus, const TDesC& aFCString, TMobilePhoneNetworkService aService, TMobilePhoneServiceAction aAction) const; + IMPORT_C void GetFeatureCode(TRequestStatus& aReqStatus, TDes& aFCString, TMobilePhoneNetworkService aService, TMobilePhoneServiceAction aAction) const; + + IMPORT_C void SendNetworkServiceRequest(TRequestStatus& aReqStatus, const TDesC& aServiceString) const; + IMPORT_C void SendNetworkServiceRequestNoFdnCheck(TRequestStatus& aReqStatus, const TDesC& aServiceString) const; + IMPORT_C void NotifySendNetworkServiceRequest(TRequestStatus& aReqStatus, const TMobilePhoneNotifySendSSOperation aOperation, TDes8& aRequestComplete) const; + + /***********************************************************************************/ + // + // MobilePhoneCallForwarding functional unit + // + /***********************************************************************************/ + +/** The Call Forwarding flavours. + +Modes: GSM/WCDMA */ + enum TMobilePhoneCFCondition + { + /** The call forwarding service is unspecified. */ + ECallForwardingUnspecified, + /** All calls to this subscriber are forwarded. */ + ECallForwardingUnconditional, + /** Calls are forwarded when this subscriber is busy. */ + ECallForwardingBusy, + /** Calls are forwarded when this subscriber does not reply within a time-out period. */ + ECallForwardingNoReply, + /** Calls are forwarded when this subscriber is unreachable. */ + ECallForwardingNotReachable, + /** All of above CF services. Can be used to check all 4 call forwarding Fs + at once. */ + ECallForwardingAllCases, // combination of all four above cases + /** All the conditional (busy, no reply, not reachable) CF services. Can be used + to check all 3 conditional call forwarding conditions at once. */ + ECallForwardingAllConditionalCases // combination of CFB, CFNRy and CFNRc + }; + +/** The Call Forwarding status + +Modes: GSM/WCDMA */ + enum TMobilePhoneCFStatus + { + /** The CF service is currently active and operative. */ + ECallForwardingStatusActive, + /** The CF service is currently deactivated. */ + ECallForwardingStatusNotActive, + /** The CF service is not registered. */ + ECallForwardingStatusNotRegistered, + /** The CF service is not provisioned. */ + ECallForwardingStatusNotProvisioned, + /** The CF service is not available in the serving network. */ + ECallForwardingStatusNotAvailable, + /** The phone can not determine CF service status. */ + ECallForwardingStatusUnknown, + /** The Call Forwarding service is active and the presentation indicator is set + to allowed */ + ECallForwardingStatusActivePIAllowed, + /** The Call Forwarding service is active and the presentation indicator is set + to not available */ + ECallForwardingStatusActivePINotAvailable, + /** The Call Forwarding service is active and the presentation indicator is set + to restricted + + The Call Forwarding service is active and the presentation indicator is set + to restricted and screening returns "User provided, verified and passed". */ + ECallForwardingStatusActivePIClir, + /** The Call Forwarding service is active and the presentation indicator is set + to restricted and screening returns "User provided, not screened". */ + ECallForwardingStatusActivePIClirSIVerified, + /** The Call Forwarding service is active and the presentation indicator is set + to "restricted" and screening returns "Network provided". */ + ECallForwardingStatusActivePIClirSINotScreened, + /** The Call Forwarding service is active and the presentation indicator is set + to "restricted" and screening returns "Network provided". */ + ECallForwardingStatusActivePIClirSINetwork, + /** The CF service is currently in the quiescent state. */ + ECallForwardingStatusQuiescent + }; + + + + class TMobilePhoneCFInfoEntryV1 : public TMultimodeType +/** Defines information about the call forwarding service. + +Modes: GSM/WCDMA + +@see CMobilePhoneCFList +@publishedPartner +@released +*/ + { + public: + IMPORT_C TMobilePhoneCFInfoEntryV1(); + public: + void InternalizeL(RReadStream& aStream); + void ExternalizeL(RWriteStream& aStream) const; + public: + /** The CF service of this list entry. + + @see TMobilePhoneCFCondition */ + TMobilePhoneCFCondition iCondition; + /** The basic service group associated to this CF service list entry. + + @see TMobileService */ + TMobileService iServiceGroup; + /** The current status of the call forwarding condition. + + @see TMobilePhoneCFStatus */ + TMobilePhoneCFStatus iStatus; + /** The "forward-to" telephone number registered for the call forwarding condition. + An empty string if CF service is not registered, not provisioned or not available. + + @see TMobileAddress */ + TMobileAddress iNumber; + /** The "No Reply" time-out (in seconds) registered for the call forwarding no reply + condition. + + Equals to -1 if this value is not applicable. In GSM mode, will be between + 5 and 30 and in steps of 5 if this value is applicable. */ + TInt iTimeout; // valid for CFRNy only + }; + + IMPORT_C void NotifyCallForwardingStatusChange(TRequestStatus& aReqStatus, TMobilePhoneCFCondition& aCondition) const; + + class TMobilePhoneCFChangeV1 : public TMultimodeType +/** Defines the call forward information. + +@see SetCallForwardingStatus() +@publishedPartner +@released +*/ + { + public: + IMPORT_C TMobilePhoneCFChangeV1(); + public: + /** The basic service group(s) to apply the CF status change to. + + @see TMobileService */ + TMobileService iServiceGroup; + /** The service action for call forwarding. + + @see TMobilePhoneServiceAction */ + TMobilePhoneServiceAction iAction; + /** A new "forward-to" number to be registered against the CF condition. This is + applicable if iAction=EServiceActionRegister. In other cases, it is set to + an empty string. + + @see TMobileAddress */ + TMobileAddress iNumber; + /** The new "No Reply" time-out in seconds to be registered. This is applicable + if the CF condition is CFNRy and iAction=EServiceActionRegister. Equals -1 + if this value is not applicable. If applicable, in GSM mode will be between + 5 and 30 and in steps of 5. */ + TInt iTimeout; + }; + + IMPORT_C void SetCallForwardingStatus(TRequestStatus& aReqStatus, TMobilePhoneCFCondition aCondition, const TMobilePhoneCFChangeV1& aInfo) const; + +/** Call Forwarding Active Notification + +Modes: Common */ + enum TMobilePhoneCFActive + { + /** CF Unconditional is currently active. */ + ECFUnconditionalActive, + /** CF Busy, CF No Reply or CF Not Reachable is currently active. */ + ECFConditionalActive + }; + + IMPORT_C void NotifyCallForwardingActive(TRequestStatus& aReqStatus, TMobileService& aServiceGroup, TMobilePhoneCFActive& aActiveType) const; + + /** + Current status indicators for unconditional call forwarding. + */ + enum TCFUIndicatorStatus + { + /** + CFU Indicator status unknown. + */ + KCFUIndicatorUnknown = 0x0, + /** + CFU Indicator status for Voice (TMobileServiceGroup EVoice). + */ + KCFUIndicatorVoice=0x01, + /** + CFU Indicator status for Fax (TMobileServiceGroup EFax). + */ + KCFUIndicatorFax=0x02, + /** + CFU Indicator status for Data Teleservices(TMobileServiceGroup EData). + */ + KCFUIndicatorData=0x04, + /** + CFU Indicator status for Sms (TMobileServiceGroup ESms). + */ + KCFUIndicatorSms=0x08, + /** + CFU Indicator status for Data Bearer Services(TMobileServiceGroup EDataBearer). + */ + KCFUIndicatorDataBearer=0x10 + }; + + typedef TUint32 TCFUIndicatorStatusFlags; + + class TMobilePhoneCFUIndicatorV3 : public TMultimodeType + /** + Contains indicator parameters for unconditional call forwarding. + */ + { + public: + IMPORT_C TMobilePhoneCFUIndicatorV3(); + public: + /** + Current setting for indicator status. + Can contain a number of flags from RMobilePhone::TCFUIndicatorStatus. + */ + TCFUIndicatorStatusFlags iIndicator; + }; + + typedef TPckg TMobilePhoneCFUIndicatorV3Pckg; + + /** + The MSP number contains the Profile Identity of the subscriber profile. + The Profile Identity shall be any of the following enlisted. + @see 3GPP TS 31.102 v7.4.1 section 4.2.64 + @see 3GPP TS 23.097 [36] + */ + enum TMultipleSubscriberProfileID + { + /** + Profile Identity Unknown + */ + KProfileIdentityUnknown = 0x0, + /** + Profile Identity 1 + */ + KProfileIdentityOne = 0x01, + /** + Profile Identity 2 + */ + KProfileIdentityTwo = 0x02, + /** + Profile Identity 3 + */ + KProfileIdentityThree = 0x04, + /** + Profile Identity 4 + */ + KProfileIdentityFour = 0x08 + }; + + class TMobilePhoneCFUIndicatorV6 : public TMobilePhoneCFUIndicatorV3 + /** + Contains the indicator parameters for unconditional call forwarding. + The TMobilePhoneCFUIndicatorV6 supports MSP number(Multiple Subscriber Profile) and Call Forwarding Number. + Upto four different profiles can be provisioned against a subscriber using the MSP feature. + @see 3GPP TS 31.102 v7.4.1 section 4.2.64 + */ + { + public: + IMPORT_C TMobilePhoneCFUIndicatorV6(); + public: + /** + @see RMoblie::TMobileAddress + */ + TMobileAddress iCFNumber; + /** + The profile IDs allow unambiguous identification of each profile. + This will allow the subscriber to select the preferred profile for outgoing calls and for subscriber actions. + For terminating calls the profile ID shall be part of the notification of the profile. + */ + TMultipleSubscriberProfileID iMultipleSubscriberProfileID; + }; + + typedef TPckg TMobilePhoneCFUIndicatorV6Pckg; + + IMPORT_C void GetCallForwardingIndicator(TRequestStatus& aReqStatus, TDes8& aIndicator) const; + + /***********************************************************************************/ + // + // Mobile Identity Service functional unit + // + /***********************************************************************************/ + +/** Phone ID services (CLIP/CNIP/CLIR). + +Modes: GSM/WCDMA */ + enum TMobilePhoneIdService + { + /** The identity service is unspecified */ + EIdServiceUnspecified, + /** The caller's ID is presented to the called party. */ + EIdServiceCallerPresentation, + /** The caller's ID is restricted to the called party. */ + EIdServiceCallerRestriction, + /** The connected party's ID is presented to the calling party. */ + EIdServiceConnectedPresentation, + /** The connected party's ID is restricted to the calling party. */ + EIdServiceConnectedRestriction, + /** The caller's name is presented to the called party. */ + EIdServiceCallerName, + /** The called party is presented with the caller's ID. This command enables a + called subscriber to get the called line identification of the called party + when receiving a mobile terminated call. - maps to +CDIP. */ + EIdServiceCalledPresentation + }; + +/** Service status of the Phone ID services (CLIP/CLIR/CNIP). + +Modes: GSM/WCDMA */ + enum TMobilePhoneIdServiceStatus + { + /** The interrogated Identity service is provisioned and active. This status is + used for all identity services and in the case of the CLIR service means that + it is permanently active with no subscription option set. */ + EIdServiceActivePermanent, + /** This status is used for the CLIR service only and means that the service is + provisioned and active. + + The CLIR subscription option is set to "Temporary, default restricted", therefore + identity is always restricted unless over-ridden by the user during a call + set-up. */ + EIdServiceActiveDefaultRestricted, + /** This status is used for the CLIR service only and means that the service is + provisioned and active. + + The CLIR subscription option is set to "Temporary, default allowed", therefore + identity is always allowed unless over-ridden by the user during a call set-up. */ + EIdServiceActiveDefaultAllowed, + /** The interrogated Identity service is not provisioned. */ + EIdServiceNotProvisioned, + /** The status of the interrogated Identity service is unknown. */ + EIdServiceUnknown + }; + + // for use by client-side API code and TSY only + + struct TIdServiceAndLocation + { + TMobilePhoneIdService iService; + TMobileInfoLocation iLocation; + }; + + /** This function member retrieves the current status of the identity service specified. + + The phone will retrieve this service status information from the location + specified by the client. + + If the client has requested EInfoLocationCache but there is no valid status + information in the cache then the request will return KErrNotFound. + + If the client has requested EInfoLocationCachePreferred, the network will + be interrogated if the cache is empty. Whenever the network is interrogated, + the cache will be refreshed with the information from the network. + + Use RTelSubSessionBase::CancelAsyncRequest(EMobilePhoneGetIdentityServiceStatus) + to cancel a previously placed asynchronous GetIdentityServiceStatus() request. + + @param aReqStatus On return, KErrNone if successful. + @param aService The identity service to be queried. + @param aStatus On return, the service status. + @param aLocation The location to use. */ + IMPORT_C void GetIdentityServiceStatus(TRequestStatus& aReqStatus, TMobilePhoneIdService aService, TMobilePhoneIdServiceStatus& aStatus, TMobileInfoLocation aLocation = EInfoLocationCachePreferred) const; + + /** + Identifies default service status for provisioned identity services. + */ + enum TMobilePhoneIdServiceSetting + { + /** Sets the default setting to network default (unknown). */ + EIdServiceNetworkDefault, + /** Sets the default setting to presentation restricted. */ + EIdServicePresentationRestricted, + /** Sets the default setting to presentation allowed. */ + EIdServicePresentationAllowed + }; + + IMPORT_C void SetIdentityServiceStatus(TRequestStatus& aReqStatus, const TMobilePhoneIdService aService, const TMobilePhoneIdServiceSetting aSetting) const; + IMPORT_C void NotifyIdentityServiceStatus(TRequestStatus& aReqStatus, const TMobilePhoneIdService aService, TMobilePhoneIdServiceStatus& aStatus) const; + IMPORT_C void NotifyIdentitySuppressionRejected(TRequestStatus& aReqStatus) const; + + /***********************************************************************************/ + // + // Mobile Call Barring Functional Unit + // + /***********************************************************************************/ + +/** Mobile Phone Call Baring Conditions. + +Modes: Common */ + enum TMobilePhoneCBCondition + { + /** The barring program is unspecified */ + EBarUnspecified, + /** All incoming calls to this subscriber are barred (BAIC). */ + EBarAllIncoming, + /** All incoming calls to this subscriber are barred when roaming outside the home + PLMN country (BIC-roam). */ + EBarIncomingRoaming, + /** All outgoing calls by this subscriber are barred (BAOC). */ + EBarAllOutgoing, + /** All outgoing international calls by this subscriber are barred (BOIC). */ + EBarOutgoingInternational, + /** All outgoing international calls except those directed to the home PLMN country + by this subscriber are barred (BOIC-ExHC). */ + EBarOutgoingInternationalExHC, + /** All of above CB services. */ + EBarAllCases, + EBarAllOutgoingServices, + EBarAllIncomingServices + }; + +/** Mobile Phone Call Barring Status and Information. + +Modes: Common */ + enum TMobilePhoneCBStatus + { + /** The CB service is currently active and operative. */ + ECallBarringStatusActive, + /** The CB service is currently deactivated or quiescent. */ + ECallBarringStatusNotActive, + /** In GSM/WCDMA mode, the CB service is not provisioned. In CDMA mode, this value + has no meaning. */ + ECallBarringStatusNotProvisioned, + /** In GSM/WCDMA mode, the CB service is not available in serving network. In CDMA + mode, the CB service is not available in the phone. */ + ECallBarringStatusNotAvailable, + /** The phone can not determine CB service status. */ + ECallBarringStatusUnknown + }; + + + + class TMobilePhoneCBInfoEntryV1 : public TMultimodeType +/** Defines information about the call barring service. + +@see CMobilePhoneCBList +@publishedPartner +@released +*/ + { + public: + void InternalizeL(RReadStream& aStream); + void ExternalizeL(RWriteStream& aStream) const; + public: + IMPORT_C TMobilePhoneCBInfoEntryV1(); + public: + /** The CB service of this list entry. + + Modes: Common + + @see TMobilePhoneCBCondition */ + TMobilePhoneCBCondition iCondition; + /** The service group associated to this list entry. + + Modes: Common + + @see TMobileService */ + TMobileService iServiceGroup; + /** The CB service status of this list entry. + + Modes: Common + + @see TMobilePhoneCBStatus */ + TMobilePhoneCBStatus iStatus; + }; + + class TMobilePhoneCBInfoEntryV3 : public TMobilePhoneCBInfoEntryV1 + /** + V3 class extending TMobilePhoneCBInfoEntryV1 to add a comparison method parameter. + */ + { + public: + void InternalizeL(RReadStream& aStream); + void ExternalizeL(RWriteStream& aStream) const; + public: + IMPORT_C TMobilePhoneCBInfoEntryV3(); + public: + /** + The comparison method associated with this CB entry. + */ + TUint8 iCompMethod; + }; + + class TMobilePhoneCBChangeV1 : public TMultimodeType +/** Mobile Phone Call Barring Change. + +@see SetCallBarringStatus() +*/ + { + public: + IMPORT_C TMobilePhoneCBChangeV1(); + public: + /** The basic service group(s) to apply the CB status change to. + + @see TMobileService */ + TMobileService iServiceGroup; + /** The service action for call barring. + + @see TMobilePhoneServiceAction */ + TMobilePhoneServiceAction iAction; + /** Password required to perform the call barring service action. + + @see TMobilePassword */ + TMobilePassword iPassword; + }; + + IMPORT_C void SetCallBarringStatus(TRequestStatus& aReqStatus, TMobilePhoneCBCondition aCondition, const TMobilePhoneCBChangeV1& aInfo) const; + IMPORT_C void NotifyCallBarringStatusChange(TRequestStatus& aReqStatus, TMobilePhoneCBCondition& aCondition) const; + + class TMobilePhonePasswordChangeV1 : public TMultimodeType +/** Mobile phone password change. + +@see SetCallBarringPassword() +@see ChangeSecurityCode() +@publishedPartner +@released +*/ + { + public: + IMPORT_C TMobilePhonePasswordChangeV1(); + public: + /** Old password. + + Modes: Common + + @see TMobilePassword */ + TMobilePassword iOldPassword; + /** New password. + + Modes: Common + + @see TMobilePassword */ + TMobilePassword iNewPassword; + }; + + IMPORT_C void SetCallBarringPassword(TRequestStatus& aReqStatus, const TMobilePhonePasswordChangeV1& aPassword) const; + + class TMobilePhonePasswordChangeV2 : public TMobilePhonePasswordChangeV1 +/** Mobile phone password change version 2. +*/ + { + public: + IMPORT_C TMobilePhonePasswordChangeV2(); + public: + /** Verified password. + + Modes: Common + + @see TMobilePassword */ + TMobilePassword iVerifiedPassword; + }; + +/** A typedef'd packaged TMobilePhonePasswordChangeV2 passing through a generic +API function member. */ + typedef TPckg TMobilePhonePasswordChangeV2Pckg; + + IMPORT_C void SetSSPassword(TRequestStatus& aReqStatus, const TDesC8& aPassword, const TInt aService) const; + + IMPORT_C void GetCompMethodName(TRequestStatus& aReqStatus, TDes& aAlphaTag, const TUint8 aCmi) const; + + /***********************************************************************************/ + // + // Mobile Call Waiting Functional Unit + // + /***********************************************************************************/ + +/** The mobile phone call waiting status. + +Modes: GSM/WCDMA */ + enum TMobilePhoneCWStatus + { + /** The CW service is currently active and operative. */ + ECallWaitingStatusActive, + /** The CW service is currently deactivated or quiescent. */ + ECallWaitingStatusNotActive, + /** The CW service is not provisioned. */ + ECallWaitingStatusNotProvisioned, + /** The CW service is not available in the serving network. */ + ECallWaitingStatusNotAvailable, + /** The phone can not determine CW service status. */ + ECallWaitingStatusUnknown + }; + + + + class TMobilePhoneCWInfoEntryV1 : public TMultimodeType +/** Defines information about the call waiting service. + +@see CMobilePhoneCWList +*/ + { + public: + void InternalizeL(RReadStream& aStream); + void ExternalizeL(RWriteStream& aStream) const; + public: + IMPORT_C TMobilePhoneCWInfoEntryV1(); + public: + /** The service group associated to this CW service list entry. + + Modes: GSM/WCDMA + + @see TMobileService */ + TMobileService iServiceGroup; + /** The CW service status of this list entry. + + Modes: GSM/WCDMA + + @see TMobilePhoneCWStatus */ + TMobilePhoneCWStatus iStatus; + }; + +/** A typedef'd packaged TMobilePhoneCWInfoEntryV1 for passing through a generic +API function member. */ + typedef TPckg TMobilePhoneCWInfoEntryV1Pckg; + + IMPORT_C void SetCallWaitingStatus(TRequestStatus& aReqStatus, TMobileService aServiceGroup, TMobilePhoneServiceAction aAction) const; + IMPORT_C void NotifyCallWaitingStatusChange(TRequestStatus& aReqStatus, TDes8& aCWStatus) const; + + /***********************************************************************************/ + // + // Mobile Call Completion Unit + // + /***********************************************************************************/ + +/** The Call Completion Busy Subscriber status of the phone. + +Modes: GSM/WCDMA */ + enum TMobilePhoneCCBSStatus + { + /** User has CCBS provisioned and there is at least 1 (and up to 5) active CCBS + requests. */ + ECcbsActive, + /** User has CCBS provisioned but there are currently no active CCBS requests. */ + ECcbsNotActive, + /** User has not subscribed to the CCBS service. */ + ECcbsNotProvisioned, + /** The CCBS service is not available in the serving network. */ + ECcbsNotAvailable, + /** MS is unable to determine status of the CCBS service. */ + ECcbsUnknown + }; + +/** CCBS recall events. + +@see RMobilePhone::TMobilePhoneCCBSEntryV2 */ + enum TCCBSRecallEvent + { + /** Recall received. */ + ECcbsRecallReceived, + /** Recall accepted. */ + ECcbsRecallAccepted, + /** Recall refused. */ + ECcbsRecallRefused, + /** Recall reason unspecified. */ + ECcbsRecallUnspecified + }; + + + + class TMobilePhoneCCBSEntryV1 : public TMultimodeType +/** Defines information about the call completion (CCBS) service. + +@see CMobilePhoneCcbsList +@publishedPartner +@released +*/ + { + public: + void InternalizeL(RReadStream& aStream); + void ExternalizeL(RWriteStream& aStream) const; + public: + IMPORT_C TMobilePhoneCCBSEntryV1(); + public: + /** The CCBS index - a number allocated by the network. + + Modes: GSM/WCDMA */ + TInt iCcbsIndex; + /** The basic service group (voice/data/fax) this CCBS request is applicable to. + + Modes: GSM/WCDMA + + @see TMobileService */ + TMobileService iServiceGroup; + /** The phone number of the remote party to whom the CCBS request is aimed. + + Modes: GSM/WCDMA + + @see TMobileAddress */ + TMobileAddress iDestination; + + }; + +/** A typedef'd packaged TMobilePhoneCCBSEntryV1 for passing through a generic API +function member. */ + typedef TPckg TMobilePhoneCCBSEntryV1Pckg; + + + class TMobilePhoneCCBSEntryV2 : public TMobilePhoneCCBSEntryV1 +/** Defines information about the call completion (CCBS) service version 2. +*/ + { + public: + IMPORT_C TMobilePhoneCCBSEntryV2(); + public: + TCCBSRecallEvent iEvent; + }; + +/** A typedef'd packaged TMobilePhoneCCBSEntryV2 for passing through a generic API +function member. */ + typedef TPckg TMobilePhoneCCBSEntryV2Pckg; + + IMPORT_C void GetCCBSStatus(TRequestStatus& aReqStatus, TMobilePhoneCCBSStatus& aCcbsStatus, TMobileInfoLocation aLocation = EInfoLocationCachePreferred) const; + IMPORT_C void NotifyCCBSStatusChange(TRequestStatus& aReqStatus, TMobilePhoneCCBSStatus& aCcbsStatus) const; + IMPORT_C void DeactivateCCBS(TRequestStatus& aReqStatus, TInt aIndex) const; + IMPORT_C void NotifyCCBSRecall(TRequestStatus& aReqStatus, TDes8& aCCBSEntry) const; + IMPORT_C void AcceptCCBSRecall(TRequestStatus& aReqStatus, TInt aIndex, TName& aCallName) const; + IMPORT_C TInt RefuseCCBSRecall(TInt aIndex) const; + + /***********************************************************************************/ + // + // Mobile Alternating Call Function Unit + // + /***********************************************************************************/ + +/** Alternating Call Capabilities + +Modes: GSM */ + enum TMobilePhoneAlternatingCallCaps + { + /** Phone supports outgoing Voice/Data calls + + Modes: GSM */ + KCapsMOVoiceData = 0x00000001, + /** Phone supports outgoing Voice Then Data calls. + + Modes: GSM */ + KCapsMOVoiceThenData = 0x00000002, + /** Phone supports outgoing Voice/Fax calls. + + Modes: GSM/WCDMA */ + KCapsMOVoiceFax = 0x00000004, + /** Phone supports incoming Voice/Data calls. + + Modes: GSM */ + KCapsMTVoiceData = 0x00000008, + /** Phone supports incoming Voice Then Data calls. + + Modes: GSM */ + KCapsMTVoiceThenData = 0x00000010, + /** Phone supports incoming Voice/Fax calls + + Modes: GSM/WCDMA */ + KCapsMTVoiceFax = 0x00000020 + }; + + IMPORT_C TInt GetAlternatingCallCaps(TUint32& aCaps) const; + IMPORT_C void NotifyAlternatingCallCapsChange(TRequestStatus& aReqStatus, TUint32& aCaps) const; + +/** Alternating Call Mode. + +Modes: Common */ + enum TMobilePhoneAlternatingCallMode + { + /** The alternating call mode is unspecified + + Modes: Common */ + EAlternatingModeUnspecified, + /** Next call will use a single bearer service - default setting + + Modes: Common */ + EAlternatingModeSingle, + /** Next call will use voice/data alternating bearer service. + + Modes: GSM */ + EAlternatingModeVoiceData, + /** Next call will use voice then data alternating bearer service. + + Modes: GSM */ + EAlternatingModeVoiceThenData, + /** Next call will use voice/fax alternating bearer service. + + Modes: GSM/WCDMA */ + EAlternatingModeVoiceFax + }; + + IMPORT_C TInt GetAlternatingCallMode(TMobilePhoneAlternatingCallMode& aMode, TMobileService& aFirstService) const; + IMPORT_C void SetAlternatingCallMode(TRequestStatus& aReqStatus, TMobilePhoneAlternatingCallMode aMode, TMobileService aFirstService) const; + IMPORT_C void NotifyAlternatingCallModeChange(TRequestStatus& aReqStatus, TMobilePhoneAlternatingCallMode& aMode,TMobileService& aFirstService) const; + + /***********************************************************************************/ + // + // Mobile Alternate Line Service Functional Unit + // + /***********************************************************************************/ + +/** Alternate Line Primary settings. + +Modes: GSM */ + enum TMobilePhoneALSLine + { + /** Current ALS line selection is the "Primary" voice line. */ + EAlternateLinePrimary, + /** Current ALS line selection is the "Auxiliary" voice line. */ + EAlternateLineAuxiliary, + /** ALS is supported by ME and SIM, but the TSY can not determine which line is + currently selected. */ + EAlternateLineUnknown, + /** The ME, SIM or serving network does not support ALS. */ + EAlternateLineNotAvailable + }; + + IMPORT_C TInt GetALSLine(TMobilePhoneALSLine& aALSLine) const; + IMPORT_C void SetALSLine(TRequestStatus& aReqStatus, TMobilePhoneALSLine aALSLine) const; + IMPORT_C void NotifyALSLineChange(TRequestStatus& aReqStatus, TMobilePhoneALSLine& aALSLine) const; + + /***********************************************************************************/ + // + // Mobile Network Security Functional Unit + // + /***********************************************************************************/ + +/** Enumerated network security types. + +Mode: Common */ + enum TMobilePhoneNetworkSecurity + { + /** The encryption level is NONE. + + Mode: Common */ + ECipheringOff, + /** The encryption level is GSM.(standard encryption algorithms for 2nd Generation + Mobile networks). + + Mode: GSM */ + ECipheringGSM, + /** The encryption level is WCDMA.(standard encryption algorithms for 3rd Generation + Mobile networks). + + Mode: WCDMA */ + ECipheringWCDMA, + /** The encryption level is CDMA.(standard encryption algorithms for 3rd Generation + Mobile networks). + + Mode: CDMA */ + ECipheringCDMA + }; + + IMPORT_C void GetNetworkSecurityLevel(TRequestStatus& aReqStatus, TMobilePhoneNetworkSecurity& aSecurity) const; + IMPORT_C void NotifyNetworkSecurityLevelChange(TRequestStatus& aReqStatus, TMobilePhoneNetworkSecurity& aSecurity) const; + + /** + Indicators for whether encryption status of the current call should be displayed. + */ + enum TMobileCallCipheringIndicator + { + /** + The ME indication displaying the encryption status of the current call should be off. + */ + ECipheringDisplayOff, + /** + The ME indication displaying the encryption status of the current call should be on. + */ + ECipheringDisplayOn + }; + + IMPORT_C void GetCipheringIndicatorStatus(TRequestStatus& aReqStatus, TMobileCallCipheringIndicator& aIndicatorStatus) const; + IMPORT_C void NotifyCipheringIndicatorStatus(TRequestStatus& aReqStatus, TMobileCallCipheringIndicator& aIndicatorStatus) const; + + /***********************************************************************************/ + // + // Mobile Cost Functional Unit + // + /***********************************************************************************/ + +/** Call Cost Capabilities. + +Modes: GSM/WCDMA */ + enum TMobilePhoneCostCaps + { + /** Indicates that the phone supports calculation and display of current and accumulated + call cost on an information-only basis. (The AoCI service in GSM) + + Modes: GSM/WCDMA */ + KCapsCostInformation = 0x00000001, + /** Indicates that the phone supports calculation and display of current and accumulated + call cost in order to support the charging service. (The AoCC service in GSM). + + + Modes: Common */ + KCapsCostCharging = 0x00000002, + /** Indicates that the phone supports clearing of cost meters (ACM or CCM) to zero. + + Modes: Common */ + KCapsClearCost = 0x00000004, + /** Indicates that the phone supports setting the maximum allowed cost (ACMmax) + to a non-zero value. + + Modes: Common */ + KCapsSetMaxCost = 0x00000008, + /** Indicates that the phone supports setting the currency and price per unit. + + Modes: GSM/WCDMA */ + KCapsSetPuct = 0x00000010, + /** Indicates that the phone currently has call cost information available that + the client can retrieve. + + Modes: Common */ + KCapsGetCost = 0x00000020, + /** Indicates that the phone can notify the client when the call cost information + changes. + + Modes: Common */ + KCapsNotifyCostChange = 0x00000040 + }; + + IMPORT_C TInt GetCostCaps(TUint32& aCaps) const; + IMPORT_C void NotifyCostCapsChange(TRequestStatus& aReqStatus, TUint32& aCaps) const; + +/** Clear Cost Meter. + +Modes: Common */ + enum TMobilePhoneCostMeters + { + /** Clear the Current Call Meter. */ + EClearCCM, + /** Clear the Accumulated Charge Meter. */ + EClearACM, + /** Clear all cost meters */ + EClearAll + }; + + IMPORT_C void ClearCostMeter(TRequestStatus& aReqStatus, TMobilePhoneCostMeters aMeter) const; + IMPORT_C void SetMaxCostMeter(TRequestStatus& aReqStatus, TUint aUnits) const; + + + + class TMobilePhonePuctV1 : public TMultimodeType +/** Defines the contents of the price/unit and currency table (PUCT) on the SIM. + +@see TMobilePhoneCostInfoV1 +@see SetPuct() +*/ + { + public: + IMPORT_C TMobilePhonePuctV1(); + public: + /** The Price per Unit. This floating point value is used to adjust the pricing + units supplied by the network into real currency values. + + Modes: GSM/WCDMA */ + TReal iPricePerUnit; + /** The three character currency indicator. + + Modes: GSM/WCDMA */ + TBuf<4> iCurrencyName; + }; + +/** A typedef'd packaged TMobilePhonePuctV1 for passing through a generic API function +member. */ + typedef TPckg TMobilePhonePuctV1Pckg; + + IMPORT_C void SetPuct(TRequestStatus& aReqStatus, const TDesC8& aPuct) const; + +/** Cost Information + +Modes: GSM/WCDMA */ + enum TMobilePhoneCostService + { + /** Phone supports call cost service but no calls are currently in progress so the + network support and user subscription is unknown. */ + ECostServiceUnknown, + /** The network or the phone does not support any of the call cost services. The + call can be either in progress or not. If the user is subscribed to AoCI they + will be able to continue to make calls but will not see any charging information. + If the user is subscribed to AoCC then they will be prevented from making + chargeable calls. */ + ECostServiceNotAvailable, + /** Call is in progress and a call cost service is active but the phone is unable + to determine whether it is an AoCI or AoCC service. */ + ECostServiceAvailable, + /** Call is in progress and the call cost information (AoCI) service is currently + operating. + + Modes: GSM/WCDMA */ + ECostServiceInformation, + /** Call is in progress and the call cost charging (AoCC) service is currently operating. + + Modes: GSM/WCDMA */ + ECostServiceCharging + }; + + + + class TMobilePhoneCostInfoV1 : public TMultimodeType +/** Defines the information related to current billing costs. + +@see GetCostInfo() +@see NotifyCostInfoChange() +*/ + { + public: + IMPORT_C TMobilePhoneCostInfoV1(); + public: + /** The current status and type of call cost service. + + @see TMobilePhoneCostService */ + TMobilePhoneCostService iService; + /** The current number of charging units in the Current Call Meter. This is set + to zero if reset by the user or at the start of call set-up attempt. */ + TUint iCCM; + /** The current number of charging units in the Accumulated Call Meter. This equals + the accumulation of previous and current calls. */ + TUint iACM; + /** The maximum number of charging units that the ACM can rise to before chargeable + calls are stopped. Equals zero if Service != ECostServiceCharging. */ + TUint iACMmax; + /** The Price per Unit and Currency Table. + + @see TMobilePhonePuctV1 */ + TMobilePhonePuctV1 iPuct; + }; + +/** A typedef'd packaged TMobilePhoneCostInfoV1 for passing through a generic API +function member. */ + typedef TPckg TMobilePhoneCostInfoV1Pckg; + + IMPORT_C void GetCostInfo(TRequestStatus& aReqStatus, TDes8& aCostInfo) const; + IMPORT_C void NotifyCostInfoChange(TRequestStatus& aReqStatus, TDes8& aCostInfo) const; + + /***********************************************************************************/ + // + // Mobile Security Functional Unit + // + /***********************************************************************************/ + +/** Security Capabilities. + +Modes: Common */ + enum TMobilePhoneSecurityCaps + { + /** The phone supports an overall "phone device lock" which can be enabled or disabled. + If enabled, user must enter phone password before the phone can be used. When + this capability is set the phone will support get lock info, notify lock info + change and set lock setting for phone device lock. + + Modes: Common */ + KCapsLockPhone = 0x0000001, + /** The phone supports locking the ICC (using the PIN1 security code), which can + be enabled or disabled. If enabled, the user must enter PIN1 code before the + ICC can be used. When this capability is set the phone will support get lock + info, notify lock info change and set lock setting for ICC lock. + + Modes: Common */ + KCapsLockICC = 0x00000002, + /** The phone supports the "phone to ICC lock" which can be enabled or disabled. + If enabled, at power-up the phone will check whether current ICC is the one + the phone is locked to or not. If not, then the user must enter the phone + password before phone can be used with this ICC. When this capability is set + the phone will support get lock info, notify lock info change and set lock + setting for Phone-ICC lock. + + Modes: Common */ + KCapsLockPhoneToICC = 0x00000004, + /** The phone supports the "phone to first ICC lock" which can be enabled or disabled. + If enabled, at power-up the phone will check whether current ICC is the one + the phone is first locked to or not. If not, then user must enter the phone + password before the phone can be used with this ICC. When this capability + is set the phone will support get lock info, notify lock info change and set + lock setting for Phone-First ICC lock. + + Modes: Common */ + KCapsLockPhoneToFirstICC = 0x00000008, + /** The phone supports the "Over The Air" programming lock which can be enabled + or disabled. If enabled, the phone will prevent OTA programming by the network. + If disabled, the phone will allow OTA programming by the network. When this + capability is set the phone will support get lock info, notify lock info change + and set lock setting for OTA lock. + + Modes: CDMA */ + KCapsLockOTA = 0x00000010, + /** The phone supports access to the PIN 1 security code. When this capability is + set the phone will support verification of PIN1, unblocking PIN1, changing + PIN1 and notification of PIN1 required. + + Modes: Common */ + KCapsAccessPin1 = 0x00000020, + /** The phone supports access to the PIN 2 security code. When this capability is + set the phone will support verification of PIN2, unblocking PIN2, changing + PIN2 and notification of PIN2 required. + + Modes: GSM/WCDMA */ + KCapsAccessPin2 = 0x00000040, + /** The phone supports access to the phone password security code. When this capability + is set the phone will support verification of the phone password, changing + the phone password and notification if the phone password is required. + + Modes: Common */ + KCapsAccessPhonePassword = 0x00000080, + /** The phone supports access to the SPC (Service Programming Code) security code. + This code may need to be verified before OTA can commence. + + Modes: CDMA */ + KCapsAccessSPC = 0x00000100, + /** The phone supports access to the hidden key. When this capability is set the + phone will support verification of HiddenKey. + + Modes: WCDMA */ + KCapsAccessHiddenKey=0x00000200, + /** The phone supports access to the USIM Application PIN. An Application PIN allows + access to any file on the UICC where it is referenced in the access rules. + + Modes: WCDMA */ + KCapsAccessUSIMAppPin=0x00000400, + /** The phone supports access to the second USIM Application PIN. The second Application + PIN allows access to files (where it is referenced in the access rules) within + one USIM Application on the UICC. This is a local PIN. + + Modes: WCDMA */ + KCapsAccessUSIMAppSecondPin =0x00000800, + /** The phone supports access to the Universal PIN. A Universal PIN is a PIN that + is used in a multi-application UICC environment to allow several USIM applications + to share one common PIN. + + Modes: WCDMA */ + KCapsAccessUniversalPin =0x00001000 + }; + + IMPORT_C TInt GetSecurityCaps(TUint32& aCaps) const; + IMPORT_C void NotifySecurityCapsChange(TRequestStatus& aReqStatus, TUint32& aCaps) const; + +/** Lock Information. + +Modes: Common */ + enum TMobilePhoneLock + { + /** Lock the whole device. Phone lock password is required to unlock when this lock + is enabled. + + Modes: Common */ + ELockPhoneDevice, + /** Lock PIN1 on the ICC. PIN1 security code is required to unlock when this lock + is enabled. + + Modes: Common */ + ELockICC, + /** Lock the phone to the current ICC inserted in the phone Phone lock password + is required to unlock when this lock is enabled. + + Modes: Common */ + ELockPhoneToICC, + /** Lock the phone to the first ICC inserted in the phone. Phone lock password is + required to unlock when this lock is enabled. + + Modes: Common */ + ELockPhoneToFirstICC, + /** Lock the OTA facility on the phone. SPC security code may be required to unlock + when this lock is enabled. + + Modes: CDMA */ + ELockOTA, + /** Lock PIN2 on the ICC. PIN2 security code is required to unlock when this lock + is enabled. + + Modes: Common */ + ELockPin2, + /** Lock the phonebook hidden entries on the phone. Hidden key security code may + be required to unlock when this lock is enabled. + + Modes: WCDMA */ + ELockHiddenKey, + /** Lock the associated USIM Application. USIM Application PIN is required to unlock + when this lock is enabled. + + Modes: WCDMA */ + ELockUSimApp, + /** Lock the associated USIM Application. The second USIM Application PIN is required + to unlock when this lock is enabled. + + Modes: WCDMA */ + ELockSecondUSimApp, + /** Lock the associated USIM Application(s) that share this common lock. Universal + Pin is required to unlock when this lock is enabled. + + Modes: WCDMA */ + ELockUniversalPin, + /** Lock for the NAM. The SPC is required to unlock. + + Modes: CDMA */ + ELockNam + }; + +/** Phone lock status. + +Modes: Common */ + enum TMobilePhoneLockStatus + { + /** The status of the lock is unknown. */ + EStatusLockUnknown, + /** Lock is closed - user can not access functionality governed by this lock until + user correctly enters associated security code. */ + EStatusLocked, + /** Lock is open - user can access functionality governed by this lock */ + EStatusUnlocked, + EStatusBlocked + }; + +/** The phone lock setting. + +Modes: Common */ + enum TMobilePhoneLockSetting + { + /** The setting of the lock is unknown + + Modes: Common */ + ELockSetUnknown, + /** Lock is enabled - associated security code will be required to unlock the + lock, the next time the lock's status is EStatusLocked. + + Modes: Common */ + ELockSetEnabled, + /** Lock is disabled - so its status is always EStatusUnlocked. + + Modes: Common */ + ELockSetDisabled, + /** Lock of the current Application is replaced by the Universal PIN. Only the + Universal PIN is allowed as a replacement. + + Modes: WCDMA */ + ELockReplaced + }; + + + + class TMobilePhoneLockInfoV1 : public TMultimodeType +/** Defines the status of a phone lock. + +@see GetLockInfo() +@see NotifyLockInfoChange() +@publishedPartner +@released +*/ + { + public: + IMPORT_C TMobilePhoneLockInfoV1(); + public: + /** The current status of the lock. + + Modes: Common + + @see TMobilePhoneLockStatus */ + TMobilePhoneLockStatus iStatus; + /** The current setting of the lock. + + Modes: Common + + @see TMobilePhoneLockSetting */ + TMobilePhoneLockSetting iSetting; + }; + +/** A typedef'd packaged TMobilePhoneLockInfoV1 for passing through a generic API +function member. */ + typedef TPckg TMobilePhoneLockInfoV1Pckg; + + IMPORT_C void GetLockInfo(TRequestStatus& aReqStatus, TMobilePhoneLock aLock, TDes8& aLockInfo) const; + IMPORT_C void NotifyLockInfoChange(TRequestStatus& aReqStatus, TMobilePhoneLock& aLock, TDes8& aLockInfo) const; + IMPORT_C void SetLockSetting(TRequestStatus& aReqStatus, TMobilePhoneLock aLock, TMobilePhoneLockSetting aSetting) const; + +/** Change Security Code. + +Modes: Common */ + enum TMobilePhoneSecurityCode + { + /** PIN 1 code (between 4-8 digits). + + Modes: Common */ + ESecurityCodePin1, + /** PIN 2 code (between 4-8 digits) + + Modes: GSM/WCDMA */ + ESecurityCodePin2, + /** PIN 1 unblocking code (always 8 digits). + + Modes: Common */ + ESecurityCodePuk1, + /** PIN 2 unblocking code (always 8 digits) + + Modes: GSM/WCDMA */ + ESecurityCodePuk2, + /** Password used for Phone-SIM Lock and Phone Device Lock (up to 8 digits) + + Modes: Common */ + ESecurityCodePhonePassword, + /** Service Programming Code (SPC) + + Modes: CDMA */ + ESecurityCodeSPC, + /** Phonebook key to display the hidden entries. + + Modes: WCDMA */ + ESecurityHiddenKey, + /** USIM Application PIN. + + Modes: WCDMA */ + ESecurityUSIMAppPin, + /** Second USIM Application PIN. + + Modes: WCDMA */ + ESecuritySecondUSIMAppPin, + /** Universal PIN. + + Modes: WCDMA */ + ESecurityUniversalPin, + /** Universal PIN unblocking code (always 8 digits). + + Modes: Common */ + ESecurityUniversalPuk + }; + + IMPORT_C void ChangeSecurityCode(TRequestStatus& aReqStatus, TMobilePhoneSecurityCode aType, const TMobilePhonePasswordChangeV1& aChange) const; + + /** Defines the status of a security code. + + @see GetSecurityCodeInfo() + @see NotifySecurityCodeInfoChange() + @publishedPartner + @released + */ + class TMobilePhoneSecurityCodeInfoV5 : public TMultimodeType + { + public: + IMPORT_C TMobilePhoneSecurityCodeInfoV5(); + public: + /** Number of remaining security code entry attempts before the corresponding lock gets blocked + + Modes: Common + */ + TInt iRemainingEntryAttempts; + }; + + /** A typedef'd packaged TMobilePhoneSecurityCodeInfoV5 for passing through a generic API + function member. */ + typedef TPckg TMobilePhoneSecurityCodeInfoV5Pckg; + + IMPORT_C void GetSecurityCodeInfo(TRequestStatus& aReqStatus, TMobilePhoneSecurityCode aSecurityCode, TDes8& aSecurityCodeInfo) const; + IMPORT_C void NotifySecurityCodeInfoChange(TRequestStatus& aReqStatus, TMobilePhoneSecurityCode& aSecurityCode, TDes8& aSecurityCodeInfo) const; + +/** Notify Security Events. + +Modes: Common */ + enum TMobilePhoneSecurityEvent + { + /** The phone has detected that there is no ICC present. + + Modes: Common */ + ENoICCFound, + /** The phone has detected that the ICC is unusable. + + Modes: Common */ + EICCTerminated, + /** The phone requires PIN1 to be entered. + + Modes: Common */ + EPin1Required, + /** The phone requires PUK1 to be entered. + + Modes: Common */ + EPuk1Required, + /** The phone requires PIN2 to be entered. + + Modes: GSM/WCDMA */ + EPin2Required, + /** The phone requires PUK2 to be entered. + + Modes: GSM/WCDMA */ + EPuk2Required, + /** The phone requires the Phone Password to be entered. + + Modes: Common */ + EPhonePasswordRequired, + /** The phone requires the SPC to be entered. + + Modes: CDMA */ + ESPCRequired, + /** The PIN1 verification procedure has passed. + + Modes: Common */ + EPin1Verified, + /** The PIN2 verification procedure has passed. + + Modes: GSM/WCDMA */ + EPin2Verified, + /** The PUK1 unblocking procedure has passed. + + Modes: Common */ + EPuk1Verified, + /** The PUK2 unblocking procedure has passed. + + Modes: GSM/WCDMA */ + EPuk2Verified, + /** The Phone Password has been verified. + + Modes: Common */ + EPhonePasswordVerified, + /** The SPC verification procedure has passed. + + Modes: CDMA */ + ESPCVerified, + /** The phone requires the phonebook hidden key to be entered. + + Modes: WCDMA */ + EHiddenKeyRequired, + /** The phonebook hidden key procedure has passed. + + Modes: WCDMA */ + EHiddenKeyVerified, + /** The phone requires the currently active USIM Application PIN to be entered. + + Modes: WCDMA */ + EUSIMAppPinRequired, + /** The currently active USIM Application PIN procedure has passed. + + Modes: WCDMA */ + EUSIMAppPinVerified, + /** The phone requires the currently active USIM Application second PIN to be entered. + + Modes: WCDMA */ + ESecondUSIMAppPinRequired, + /** The currently active USIM Application second PIN procedure has passed. + + Modes: WCDMA */ + ESecondUSIMAppPinVerified, + /** The phone requires the Universal PIN to be entered. + + Modes: WCDMA */ + EUniversalPinRequired, + /** The currently active Universal PIN procedure has passed. + + Modes: WCDMA */ + EUniversalPinVerified, + /** The Service Programming Code has been changed. + + Modes: CDMA */ + ESPCChanged, + /** The phone requires Universal PUK to be entered. + + Modes: WCDMA */ + EUniversalPukRequired, + /** The Universal PUK unblocking procedure has passed. + + Modes: WCDMA */ + EUniversalPukVerified + }; + + IMPORT_C void NotifySecurityEvent(TRequestStatus& aReqStatus, TMobilePhoneSecurityEvent& aEvent) const; + + // for use by client-side API code and TSY only + + struct TCodeAndUnblockCode + { + TMobilePassword iCode; + TMobilePassword iUnblockCode; + }; + + IMPORT_C void VerifySecurityCode(TRequestStatus& aReqStatus, TMobilePhoneSecurityCode aType, + const TMobilePassword& aCode, const TMobilePassword& aUnblockCode) const; + IMPORT_C TInt AbortSecurityCode(TMobilePhoneSecurityCode aType) const; + + /***********************************************************************************/ + // + // MobileMessageWaiting + // + /***********************************************************************************/ + +/** Display indicators. */ + enum TMobilePhoneIndicatorDisplay + { + /** Display voicemail active. */ + KDisplayVoicemailActive = 0x01, + /** Display fax active. */ + KDisplayFaxActive = 0x02, + /** Display E-mail active. */ + KDisplayEmailActive = 0x04, + /** Display other active. */ + KDisplayOtherActive = 0x08, + /** Display Aux voicemail active. */ + KDisplayAuxVoicemailActive = 0x10, + /** Display data active. */ + KDisplayDataActive = 0x20 + }; + + class TMobilePhoneMessageWaitingV1 : public TMultimodeType +/** Message Waiting Indicators. See 3GPP TS 31 102. + +@see GetIccMessageWaitingIndicators() +@see SetIccMessageWaitingIndicators() +@see NotifyIccMessageWaitingIndicatorsChange() +*/ + { + public: + IMPORT_C TMobilePhoneMessageWaitingV1(); + public: + /** The flags for each indicator from TMobilePhoneIndicatorDisplay to specify whether + the indicator should be displayed or not. E.g. Messages of the specified type are waiting. + + Modes: Common */ + TUint8 iDisplayStatus; + /** The number of voicemail messages waiting for the "main" voice line. + + Modes: Common */ + TUint8 iVoiceMsgs; + /** The number of voicemail messages waiting for the "auxiliary" voice line. + + Modes: GSM */ + TUint8 iAuxVoiceMsgs; + /** The number of messages waiting for the data line. + + Modes: Common */ + TUint8 iDataMsgs; + /** The number of messages waiting for the fax line. + + Modes: Common */ + TUint8 iFaxMsgs; + /** The number of email messages waiting. + + Modes: WCDMA */ + TUint8 iEmailMsgs; + /** Contains the number of "unspecified" messages waiting. + + Modes: WCDMA */ + TUint8 iOtherMsgs; + }; + +/** A typedef'd packaged TMobilePhoneMessageWaitingV1 for passing through a generic +API function member. */ + typedef TPckg TMobilePhoneMessageWaitingV1Pckg; + + IMPORT_C void GetIccMessageWaitingIndicators(TRequestStatus& aReqStatus, TDes8& aMsgIndicators) const; + IMPORT_C void SetIccMessageWaitingIndicators(TRequestStatus& aReqStatus, const TDesC8& aMsgIndicators) const; + IMPORT_C void NotifyIccMessageWaitingIndicatorsChange(TRequestStatus& aReqStatus, TDes8& aMsgIndicators) const; + + IMPORT_C void NotifyMessageWaiting(TRequestStatus& aReqStatus, TInt& aCount) const; + + /***********************************************************************************/ + // + // Mobile Fixed Dialling Numbers Functional Unit + // + /***********************************************************************************/ + +/** Fixed Dialling Numbers Status. + +Modes: Common */ + enum TMobilePhoneFdnStatus + { + /** Fixed Dialling Number mode is supported but is not currently active. */ + EFdnNotActive, + /** Fixed Dialling Number mode is supported and is currently active. Deactivating + FDN mode is supported. */ + EFdnActive, + /** Fixed Dialling Number mode is supported and is permanently active. Deactivating + FDN mode is NOT supported with this SIM. */ + EFdnPermanentlyActive, + /** Fixed Dialling Number mode is not supported by ME and/or SIM. */ + EFdnNotSupported, + /** ME is currently unable to determine the status of FDN mode. */ + EFdnUnknown + }; + + IMPORT_C TInt GetFdnStatus(TMobilePhoneFdnStatus& aFdnStatus) const; + IMPORT_C void GetFdnStatus(TRequestStatus& aReqStatus, TMobilePhoneFdnStatus& aFdnStatus) const; + +/** Fixed Dialling Numbers Setting + +Modes: Common */ + enum TMobilePhoneFdnSetting + { + /** Activate the FDN service. */ + EFdnSetOn, + /** Deactivate the FDN service. */ + EFdnSetOff + }; + + IMPORT_C void SetFdnSetting(TRequestStatus& aReqStatus, TMobilePhoneFdnSetting aFdnSetting) const; + IMPORT_C void NotifyFdnStatusChange(TRequestStatus& aReqStatus, TMobilePhoneFdnStatus& aFdnStatus) const; + + /***********************************************************************************/ + // + // Multicall bearer settings + // + /***********************************************************************************/ + + class TMobilePhoneMulticallSettingsV1 : public TMultimodeType +/** Multi call settings for version v1.0. + +@see GetMulticallParams() +@see NotifyMulticallParamsChange() +@publishedPartner +@released*/ + { + public: + IMPORT_C TMobilePhoneMulticallSettingsV1(); + public: + /** Maximum number of simultaneous CS bearers allowed - defined by the user. + + Modes: WCDMA */ + TInt iUserMaxBearers; + /** Maximum number of simultaneous bearers allowed - defined by the service provider. + + Modes: WCDMA */ + TInt iServiceProviderMaxBearers; + /** Maximum number of simultaneous CS bearers supported by the network. + + Modes: WCDMA */ + TInt iNetworkSupportedMaxBearers; + /** Maximum number of simultaneous CS bearers supported by the UE. + + Modes: WCDMA */ + TInt iUESupportedMaxBearers; + }; + +/** A typedef'd packaged TMobilePhoneMulticallSettingsV1 for passing through a generic +API function member. */ + typedef TPckg TMobilePhoneMulticallSettingsV1Pckg; + + IMPORT_C void GetMulticallParams(TRequestStatus& aReqStatus, TDes8& aMulticallParams) const; + IMPORT_C void SetMulticallParams(TRequestStatus& aReqStatus, TInt aUserMaxBearers) const; + IMPORT_C void NotifyMulticallParamsChange(TRequestStatus& aReqStatus, TDes8& aMulticallParams) const; + + enum TMobilePhoneMulticallIndicator + /** + Indicators for exceeding allowed multiple active bearers. + */ + { + /** The maximum number of multiple active bearers allowed by the service provider has been exceeded. */ + EBearerNetworProviderExceeded, + /** The maximum number of multiple active bearers allowed by the mobile user has been exceeded. */ + EBearerUserExceeded + }; + + IMPORT_C void NotifyMulticallIndicatorChange(TRequestStatus& aReqStatus, TMobilePhoneMulticallIndicator& aMulticallIndicator) const; + + /***********************************************************************************/ + // + // MobileNextIncomingCall Functional Unit + // + /***********************************************************************************/ + +/** Incoming Call Types. + +Modes: Common */ + enum TMobilePhoneIncomingCallType + { + /** MS will receive any type of incoming call. + + Modes: Common */ + EIncomingTypeNotSpecified, + /** MS will request voice bearer for incoming calls. + + Modes: Common */ + EIncomingVoice, + /** MS will request fax bearer for incoming calls + + Modes: Common */ + EIncomingFax, + /** MS will request data bearer for incoming calls + + Modes: Common */ + EIncomingData, + /** MS will request a data bearer for use by a Multimedia CS call (voice fall back + is acceptable) for incoming calls. + + Modes: GSM/WCDMA */ + EIncomingMultimediaVoiceFallback, + /** MS will request a data bearer for use by a Multimedia CS call (voice fall back + NOT acceptable) for incoming calls + + Modes: GSM/WCDMA */ + EIncomingMultimediaNoFallback, + /** The single numbering scheme call mode is alternating voice to fax. + + Modes: GSM/WCDMA */ + EIncomingAlternatingVoiceFax, + /** The single numbering scheme call mode is alternating voice to data. + + Modes: GSM */ + EIncomingAlternatingVoiceData, + /** The single numbering scheme call mode is alternating fax to voice. + + Modes: GSM */ + EIncomingAlternatingFaxVoice, + /** The single numbering scheme call mode is alternating data to voice. + + Modes: GSM */ + EIncomingAlternatingDataVoice, + /** The single numbering scheme call mode is alternating voice then data. + + Modes: GSM */ + EIncomingAlternatingVoiceThenData + }; + + IMPORT_C void GetIncomingCallType(TRequestStatus& aReqStatus, TMobilePhoneIncomingCallType& aCallType, TDes8& aDataParams) const; + IMPORT_C void SetIncomingCallType(TRequestStatus& aReqStatus, TMobilePhoneIncomingCallType aCallType, TDes8& aDataParams) const; + IMPORT_C void NotifyIncomingCallTypeChange(TRequestStatus& aReqStatus, TMobilePhoneIncomingCallType& aCallType, TDes8& aDataParams) const; + + /***********************************************************************************/ + // + // User-To-User Signalling Functional Unit + // + /***********************************************************************************/ + +/** UUS Settings Requests. + +Modes: GSM/WCDMA */ + enum TMobilePhoneUUSSetting // UUS settings of the phone + { + /** UUS is not specified. */ + EIncomingUUSNotSpecified, + /** MS will accept incoming UUS activation request. */ + EIncomingUUSAccepted, + /** MS will reject incoming UUS activation request. */ + EIncomingUUSRejected + }; + + IMPORT_C void GetUUSSetting(TRequestStatus& aReqStatus, TMobilePhoneUUSSetting& aSetting) const; + IMPORT_C void SetUUSSetting(TRequestStatus& aReqStatus, TMobilePhoneUUSSetting aSetting) const; + IMPORT_C void NotifyUUSSettingChange(TRequestStatus& aReqStatus, TMobilePhoneUUSSetting& aSetting) const; + + /***********************************************************************************/ + // + // Mobile Smart Card Applications Functional Unit + // + /***********************************************************************************/ + + + enum { KSmartCardApplicationLabelMaxSize=32 }; + + /** Smart card application info version v5.0. + Modes: Common + + @see GetSmartCardApplicationInfo() + @publishedPartner + @released + */ + class TSmartCardApplicationInfoV5 : public TMultimodeType + { + public: + IMPORT_C TSmartCardApplicationInfoV5(); + public: + /** + Smart card application identifier. + */ + TAID iAID; + /** + Smart card application label. 16 bit USC2 characters string provided by the application + provider to be shown to the user for information, e.g. operator name. It is + recommended by ETSI/3GPP spec that the application label does not exceed 32 + bytes. + + The application label is optional. If no label is provided, the buffer should + be NULL. + */ + TBuf8 iLabel; + }; + + /** + A typedef'd packaged TSmartCardApplicationInfoV5 for passing through a generic API + function member. + */ + typedef TPckg TSmartCardApplicationInfoV5Pckg; + + /** + Specifies the max length of the buffer used to retrieve the smart + card application's supported EAP method list. Value 255 since EAP + type list length fits into one byte (see table 5.1 of ETSI TS + 102.310 v6.2.0). + + @see RMobilePhone::GetSmartCardApplicationInfo() + @see RMobilePhone::TUiccApplicationEapInfoV6::iEapTypeList + */ + enum { KEapSupportedTypeListSize = 255 }; + + /** + UICC application info version v6.0. Is a + TSmartCardApplicationInfoV5 object, but has an additional buffer + (iEapTypeList) for retrieving a list supported EAP methods on the + application. + + Modes: GSM/WCDMA + + @see RMobilePhone::GetSmartCardApplicationInfo() + @publishedPartner + @released + */ + class TUiccApplicationEapInfoV6 : public TSmartCardApplicationInfoV5 + { + public: + IMPORT_C TUiccApplicationEapInfoV6(); + + public: + /** + Application EAP support type list, defining the EAP methods + supported by the UICC application (see RFC 3748 and + http://www.iana.org/assignments/eap-numbers). + + As reference, also worth seeing section 5.2 of ETSI TS 102.310 + v6.2.0 and section 6.2 of RFC3748. + + @see KETelSmartCardEapTypeMD5 + @see KETelSmartCardEapTypeTLS + @see KETelSmartCardEapTypeSIM + @see KETelSmartCardEapTypeAKA + @see KETelSmartCardEapTypeTTLS + */ + TBuf8 iEapTypeList; + }; + + /** + A typedef'd packaged TEapUiccApplicationInfoV6 for passing through + a generic API function member. + + @see RMobilePhone::GetSmartCardApplicationInfo() + */ + typedef TPckg TUiccApplicationEapInfoV6Pckg; + + /** + Smart card application notification events + + Modes: Common + */ + enum TSmartCardApplicationEvent + { + /** + Smart card application has been installed. + */ + EScApplicationInstalled, + /** + Smart card application has been removed. + */ + EScApplicationRemoved, + /** + Smart card application has been activated. + */ + EScApplicationActivated, + /** + Smart card application has been terminated. + */ + EScApplicationTerminated + }; + + /** + Smart card application status. + + Modes: Common + */ + enum TSmartCardApplicationAction + { + /** + Smart card application will be activated. + */ + EScApplicationActivate, + /** + Smart card application will be terminated. + */ + EScTerminate + }; + + /** + Smart card application file types. For definitions see TS 102.221. + + Modes: Common + */ + enum TScFileType + { + /** + Smart card file type is unknown. + */ + EUnknown, + /** + Smart card file type is linear fixed. + + This is a record-based file. + */ + ELinearFixed, + /** + Smart card file type is cyclic. + + This is a record-based file. + */ + ECyclic, + /** + Smart card file type is transparent. + + This is a binary file. + */ + ETransparent + }; + + /** + Typedef to hold a 2-byte file identifier. + */ + typedef TUint16 TScFileID; + + /** Smart card application file info version v5.0. + Modes: Common + + @see GetScFileInfo() + @publishedPartner + @released + */ + class TScFileInfoV5 : public TMultimodeType + { + public: + IMPORT_C TScFileInfoV5(); + public: + /** + Smart card file identifier. + */ + TScFileID iFileID; + /** + The type of the smart card file. Options are + Linear Fixed, Cyclic or Transparent. + */ + TScFileType iType; + /** + Total length of the file. As specified in TS 102.221 the maximum length of an EF is 0xFFF bytes. + */ + TInt iTotalLength; + /** + If the file is a record based file (e.g. file type is ELinearFixed or ECyclic) then this gives the fixed length of a record in the file. + If file type is ETransparent then this value is unused and will be set to 0. + + From TS 102.221 the maximum length of a record in an EF is 255 bytes. + */ + TInt iRecordLength; + /** + If the file is a record based file (e.g. file type is ELinearFixed or ECyclic) then this gives the number of records in the file. + If file type is ETransparent then this value is unused and will be set to 0. + + From TS 102.221 the maximum number of records in an EF is 254. + */ + TInt iNumberRecords; + }; + + + /** A typedef'd packaged TScFileInfoV5 for passing through a generic API + function member. + */ + typedef TPckg TScFileInfoV5Pckg; + + /** + This based on the maximum number of bytes in a command PDU + as defined in TS 102.221 however the actual path string is very unlikely to ever be this big. + + Modes: Common + */ + enum{ KMaxScFilePathLength = 256}; + + /** + A typedef'd buffer to hold the path to an EF file. + */ + typedef TBuf8 TScFilePathReference; + + + /** + Class that holds a smart card applications AID and associated file path string. + + Modes: Common + + @see GetScFileInfo() + @publishedPartner + @released + */ + class TScFilePath + { + public: + IMPORT_C TScFilePath(); + public: + /** + AID of application. This may be empty implying the iPath is a path reference starting at the master file (MF). + */ + TAID iAID; + /** + Full path reference to file. + + The iPath must define the file path using full path referencing. This is because the client does not know + what is the currently selected EF or DF and it is therefore necessary to select the file by full + path referencing from the master file. + + If iAID value is empty then the iPath reference starts from the MF file but should not include the file ID of the MF (3F00) itself. + E.g. To reference the EF_DIR - iAID would be empty and iPath would be set to "2F00". + E.g. To refefence the EF_SMS under DF_TELECOM on a 2G SIM ICC - iAID would be empty and iPath would be set to "7F106F3C". + + If iAID is non-empty then it refers to the AID of the application and iPath is a path reference to a file in that application, + In this situation the path reference may start with the implicit FID of the application DF (7FFF). + E.g. The path to reference to the EF_SMS file in a USIM application using implicit ADF FID would + be "7FFF6F3C". + + See TS102.221 section 8.4.2 for more information. + */ + TScFilePathReference iPath; + }; + + /** Smart card application file identifier and access offsets. This class is used to identify a file and the + location in a file to either read or write. Inherits attributes from TScFilePath which provide the + parent AID and full path reference. + + Modes: Common + + @see TScFilePath + @see ReadScFile() + @see UpdateScFile() + @publishedPartner + @released + */ + class TScFilePathWithAccessOffsets : public TScFilePath + { + public: + IMPORT_C TScFilePathWithAccessOffsets(); + public: + /** + The type of the smart card file. Options are + Linear Fixed, Cyclic or Transparent. + */ + TScFileType iType; + /** + If file type is ELinearFixed or ECyclic then this is the starting record index to read or update. + This must be less than the number of records in the file. + + If file type is ETransparent then this is the offset (in bytes) from the start of the transparent file to read or update. + This must be less than the total file size. + */ + TUint iStartOffset; + /** + If the file type is ELinearFixed or ECyclic then this is unused. + NOTE: A call to ReadScFile or UpdateScFile for a record based file type will only read or update + one record as described in TS 102.221 READ RECORD and UPDATE RECORD. + + If file type is ETransparent then this is the number of bytes to read or update. + */ + TUint iCount; + }; + + IMPORT_C void EnumerateSmartCardApplications(TRequestStatus& aReqStatus, TUint& aCount) const; + IMPORT_C void GetSmartCardApplicationInfo(TRequestStatus& aReqStatus, TUint aAppIndex, TDes8& aInfo) const; + IMPORT_C void NotifySmartCardApplicationInfoChange(TRequestStatus& aReqStatus, TAID& aAID, TSmartCardApplicationEvent& aEvent) const; + IMPORT_C void SetSmartCardApplicationStatus(TRequestStatus& aReqStatus, const TAID& aAID, TSmartCardApplicationAction aAppAction) const; + IMPORT_C void GetScFileInfo(TRequestStatus& aReqStatus, const TScFilePath& aFilePathId, TDes8& aInfo) const; + IMPORT_C void ReadScFile(TRequestStatus& aReqStatus, const TScFilePathWithAccessOffsets& aFilePathOffsets, TDes8& aReadBuffer) const; + IMPORT_C void UpdateScFile(TRequestStatus& aReqStatus, const TScFilePathWithAccessOffsets& aFilePathOffsets, TDes8& aUpdateBuffer) const; + + /***********************************************************************************/ + // + // Mobile USIM Applications Functional Unit + // + /***********************************************************************************/ + + enum { KUSimApplicationLabelMaxSize=32 }; + + IMPORT_C void EnumerateUSimApplications(TRequestStatus& aReqStatus, TInt& aCount, TAID& aActiveAID) const; //deprecated 9.1 + + class TUSimApplicationInfoV2 : public TMultimodeType + /** USIM application information for version v2.0. + + @deprecated 9.1 Use @see TSmartCardApplicationInfoV5 instead. + */ + { + public: + IMPORT_C TUSimApplicationInfoV2(); + public: + /** USIM Application identifier. + + Modes: WCDMA */ + TAID iAID; + /** USIM Application label. 16 bit USC2 characters string provided by the application + provider to be shown to the user for information, e.g. operator name. It is + recommended by ETSI/3GPP spec that the application label does not exceed 32 + bytes. + + The application label is optional. If no label is provided, the buffer should + be NULL. + + Modes: WCDMA */ + TBuf8 iLabel; + }; + + /** A typedef'd packaged TUSimApplicationInfoV2 for passing through a generic API + function member. + + @deprecated 9.1 Use @see TSmartCardApplicationInfoV5 instead. + */ + typedef TPckg TUSimApplicationInfoV2Pckg; + + IMPORT_C void GetUSimApplicationInfo(TRequestStatus& aReqStatus, TInt aUSimAppIndex, TDes8& aInfo) const; //deprecated 9.1 + IMPORT_C void NotifyUSimApplicationsInfoChange(TRequestStatus& aReqStatus, TInt& aCount, TAID& aActiveAID) const; //deprecated 9.1 + + /** USIM Application Status. + + Modes: WCDMA + + @deprecated 9.1 Use @see TSmartCardApplicationAction instead. + */ + enum TUSimAppAction + { + /** USIM application will be activated. + + Modes: WCDMA */ + EUSimActivate, + /** USIM application will be terminated. + + Modes: WCDMA */ + EUSimTerminate + }; + + IMPORT_C void SetUSimApplicationStatus(TRequestStatus& aReqStatus, const TAID aAID, TUSimAppAction aUsimAppAction) const; //deprecated 9.1 + + /** USIM Application selection mode. + + Mode: WCDMA */ + enum TUSimSelectionMode + { + /** USIM application is selected automatically by phone. + + Mode: WCDMA */ + EUSimSelectionAutomatic, + /** USIM application is selected manually by user. + + Mode: WCDMA */ + EUSimSelectionManual + }; + + IMPORT_C TInt SetUSimAppsSelectionMode(TUSimSelectionMode aUSimSelectionMode) const; + IMPORT_C TInt GetUSimAppsSelectionMode(TUSimSelectionMode& aUSimSelectionMode) const; + IMPORT_C void NotifyUSimAppsSelectionModeChange(TRequestStatus& aReqStatus, TUSimSelectionMode& aUSimSelectionMode) const; + IMPORT_C void GetCurrentActiveUSimApplication(TRequestStatus& aReqStatus, TAID& aAID) const; + + /***********************************************************************************/ + // + // Mobile MMS Functional Unit + // + /***********************************************************************************/ + + /** max size of MMS notification buffer. */ + enum{KMaxMmsNotification = 253}; + + /** + Identifies current status of MMS. + */ + enum TMmsStatus + { + /** + The MMS has not been retrieved. + */ + EMmsNotRetrieved, + /** + The MMS has been retrieved. + */ + EMmsRetrieved, + /** + The MMS has been rejected. + */ + EMmsRejected, + /** + The MMS has been forwarded. + */ + EMmsforwarded + }; + + /** + MMS Implementation. + */ + enum TMmsImplementation + { + /** + Unknown implementation for MMS. + */ + KMmsImplUnknwown=0x00, + /** + Wap implementation for MMS. + */ + KWapImplementation=0x01 + }; + + /** + MMS Connectivity settings. + */ + enum TMmsConnParams + { + /** + MMS User Preferences. + */ + EUserPreferences, + /** + MMS Issuer Connectivity Parameters. + */ + EIssuerConnParams, + /** + MMS User Connectivity Parameters. + */ + EUserConnParams + }; + + /** + MMS field Id tags. + */ + enum TMobileMMSFieldTags + { + /** + Tag id for MMS connectivity parameters. + */ + ETagMmsConnParams=0xAB, + /** + Tag id for MMS Implementation. + */ + ETagMmsImpl=0x80, + /** + Tag id for MMS Relay/Server. + */ + ETagMmsServer=0x81, + /** + Tag id for Interface to Core Network and Bearer. + */ + ETagMmsBearerIE=0x82, + /** + Tag id for Gateway. + */ + ETagMmsGateway=0x83 + }; + + class TMmsNotificationV3 : public TMultimodeType + /** + Class containing MMS notification paramters. + */ + { + public : + IMPORT_C TMmsNotificationV3(); + public : + /** + Free/Used space. + */ + TBool iSpace; + /** + Notification read/not read. + */ + TBool iNotification; + /** + MMS status. + */ + TMmsStatus iMmsStatus; + /** + MMS implementation. + */ + TMmsImplementation iImplementation; + /** + MMS notification buffer. + */ + TBuf8 iNotify; + }; + + typedef TPckg TMmsNotificationV3Pckg; + + // MMS notification + IMPORT_C void NotifyMmsUpdate(TRequestStatus& aReqStatus, TDes8& aNotification) const; + IMPORT_C void SetMmsUserConnParams(TRequestStatus& aReqStatus, TDes8& aConnectivity) const; + IMPORT_C void SetMmsUserPreferences(TRequestStatus& aReqStatus, TDes8& aPreferences) const; + IMPORT_C void GetMmsConfig(TRequestStatus& aReqStatus, const TMmsConnParams aType, TDes8& aConnectivity) const; + IMPORT_C void NotifyMmsConfig(TRequestStatus& aReqStatus, const TMmsConnParams aType, TDes8& aConnectivity) const; + + /***********************************************************************************/ + // + // Mobile MailBox Numbers Functional Unit + // + /***********************************************************************************/ + + class TMobilePhoneVoicemailIdsV3 : public TMultimodeType + /** + Contains mailbox numbers. + */ + { + public : + IMPORT_C TMobilePhoneVoicemailIdsV3(); + public : + /** + Phonebook entry for "voicemail" mailbox number. + */ + TUint8 iVoice; + /** + Phonebook entry for "data" mailbox number. + */ + TUint8 iData; + /** + Phonebook entry for "fax" mailbox number. + */ + TUint8 iFax; + /** + Phonebook entry for "other" mailbox number. + */ + TUint8 iOther; + }; + + typedef TPckg TMobilePhoneVoicemailIdsV3Pckg; + + IMPORT_C void GetMailboxNumbers(TRequestStatus& aReqStatus, TDes8& aMailBox) const; + IMPORT_C void NotifyMailboxNumbersChange(TRequestStatus& aReqStatus, TDes8& aMailBox) const; + + /***********************************************************************************/ + // + // Mobile APN Control List Functional Unit + // + /***********************************************************************************/ + + enum { KMaxApnName = 100 }; + + class TAPNEntryV3 : public TMultimodeType + /** + Contains parameters for an Access Point Name (APN) entry contained + within the Access Control List EFacl file in the UICC. + */ + { + public: + IMPORT_C TAPNEntryV3(); + public: + /** + GGSN DNS name. + */ + TBuf8 iApn; + }; + + typedef TPckg TAPNEntryV3Pckg; + + IMPORT_C void EnumerateAPNEntries(TRequestStatus& aReqStatus, TUint32 &aIndex) const; + IMPORT_C void GetAPNname(TRequestStatus& aReqStatus, const TUint32 aIndex, TDes8& aAPN) const; + IMPORT_C void AppendAPNName(TRequestStatus& aReqStatus, const TDes8& aAPN) const; + IMPORT_C void DeleteAPNName(TRequestStatus& aReqStatus, TUint32 aIndex) const; + IMPORT_C void NotifyAPNListChanged(TRequestStatus& aReqStatus) const; + + enum TAPNControlListServiceStatus { + /** + The APN control list service is disabled. + */ + EAPNControlListServiceDisabled, + /** + The APN control list service is enabled. + */ + EAPNControlListServiceEnabled + }; + + IMPORT_C void SetAPNControlListServiceStatus(TRequestStatus& aReqStatus, TAPNControlListServiceStatus aAPNControlListServiceStatus) const; + IMPORT_C void GetAPNControlListServiceStatus(TRequestStatus& aReqStatus, TAPNControlListServiceStatus& aAPNControlListServiceStatus) const; + IMPORT_C void NotifyAPNControlListServiceStatusChange(TRequestStatus& aReqStatus, TAPNControlListServiceStatus& aAPNControlListServiceStatus) const; + + /***********************************************************************************/ + // + // Retrieve Total Air Time Duration Functional Unit + // + /***********************************************************************************/ + IMPORT_C TInt GetAirTimeDuration(TTimeIntervalSeconds& aTime) const; + IMPORT_C void NotifyAirTimeDurationChange(TRequestStatus& aReqStatus,TTimeIntervalSeconds& aTime) const; + /***********************************************************************************/ + // + // Terminate All Calls + // + /***********************************************************************************/ + IMPORT_C void TerminateAllCalls(TRequestStatus& aReqStatus) const; + + /***********************************************************************************/ + // + // Auto Redial Functional Unit + // + /***********************************************************************************/ + IMPORT_C void ClearBlacklist(TRequestStatus& aReqStatus) const; + + /***********************************************************************************/ + // + // Mobile Personalisation Functional Unit + // + /***********************************************************************************/ + + /** + Indentifies the personalisation scheme capabilities of the UICC/ME. + */ + enum TMobilePhonePersonalisationCaps + { + /** + UICC/ME personalisation based on network (MCC, MNC) information is possible. + */ + KCapsPersonalisedNetwork=0x01, + /** + UICC/ME personalisation based on network (MCC, MNC, IMSI network code group) information is possible. + */ + KCapsPersonalisedNetworkSub=0x02, + /** + UICC/ME personalisation based on network (MCC, MNC, EFGID1, EFCNL) information is possible. + */ + KCapsPersonalisedServiceProvider=0x04, + /** + UICC/ME personalisation based on network (MCC, MNC, EFGID1, EFGID2, EFCNL) information is possible. + */ + KCapsPersonalisedCorporate=0x08, + /** + UICC/ME personalisation based on (IMSI SIM/USIM code group) information is possible. + */ + KCapsPersonalisedUSim=0x10 + }; + + /** + Identifies the current personalisation schemes that are active. + */ + enum TMobilePhonePersonalisationScheme + { + /** + The ME is personalised under the network scheme. + */ + KPersonalisedNetwork=0x01, + /** + The ME is personalised under the network sub scheme. + */ + KPersonalisedNetworkSub=0x02, + /** + The ME is personalised under the service provider scheme. + */ + KPersonalisedServiceProvider=0x04, + /** + The ME is personalised under the corprorate scheme. + */ + KPersonalisedCorporate=0x08, + /** + The ME is personalised under the SIM/USIM scheme. + */ + KPersonalisedUSim=0x10 + }; + + /** + Identifies the personalisation scheme to be set. + */ + enum TMobilePhonePersonalisation + { + /** + Personalise the ME using the network scheme. + */ + EPersonaliseNetwork, + /** + Personalise the ME using the network sub scheme. + */ + EPersonaliseNetworkSub, + /** + Personalise the ME using the service provider scheme. + */ + EPersonaliseServiceProvider, + /** + Personalise the ME using the corporate scheme. + */ + EPersonaliseCorporate, + /** + Personalise the ME using the SIM/USIM scheme. + */ + EPersonaliseUsim + }; + + IMPORT_C TInt GetPersonalisationCaps(TUint32& aCaps) const; + IMPORT_C void GetPersonalisationStatus(TRequestStatus& aReqStatus, TUint32& aPersSchemes) const; + IMPORT_C void SetPersonalisationStatus(TRequestStatus& aReqStatus, const TMobilePhonePersonalisation aPersSchemes, const TDes& aPersCode) const; + + /***********************************************************************************/ + // + // Etel 3rd Party v1.0 Parameter classes + // + /***********************************************************************************/ + + class TEtel3rdPartyMobileNetworkInfoV1 : public TMultimodeType + /** + Defines the parameters used to set-up of a call originated from an ETel 3rd Party client. + + TEtel3rdPartyMobileNetworkInfoV1 was used to give an indication to the TSY of where the + request was originating from; i.e. if the request is from an application using the ISV + API or ETel API, which allowed the TSY to make a decision based on the origin. This + data type also provided further protection by not including any location information + parameters. With PlatSec being introduced in v9.0, there was no need to use this data + structure, as each API is policed with the adequate PlatSec capabilities. Therefore, + in v9.0 TEtel3rdPartyMobileNetworkInfoV1 was deprecated and removed from the ETel ISV + (ETel3rdParty) implementation. + + TEtel3rdPartyMobileNetworkInfoV1 was only used internally by the ETel ISV API when calls + are made to RMobilePhone::GetCurrentNetwork or RMobilePhone::NotifyCurrentNetworkChange. + The TSY no longer needs to support this as ETel ISV now uses the TMobilePhoneNetworkInfoV2 + data structure and no distinction is required for ISV Apps. + + @publishedPartner + @deprecated 9.0 This class has been deprecated from 9.0 and should no longer be used. + */ + { + public: + IMPORT_C TEtel3rdPartyMobileNetworkInfoV1(); + public: + /** Mode of the network. + Modes: Common + + @see TMobilePhoneNetworkMode */ + TMobilePhoneNetworkMode iMode; + /** Status of the network + + Modes: Common + + @see TMobilePhoneNetworkStatus */ + TMobilePhoneNetworkStatus iStatus; + /** The band and band class of the CDMA network operator. + + Modes: CDMA + + @see TMobilePhoneNetworkBandInfo */ + TMobilePhoneNetworkBandInfo iBandInfo; + /** The MCC of the network. + + Modes: Common + + @see TMobilePhoneNetworkCountryCode */ + TMobilePhoneNetworkCountryCode iCountryCode; + /** The system identity (SID) of the CDMA network or the system identity (SID) of the AMPS network. + + Modes: CDMA + + @see TMobilePhoneNetworkIdentity */ + TMobilePhoneNetworkIdentity iCdmaSID; + /** The network identity (NID in CDMA and MNC in GSM). + + Modes: Common + + @see TMobilePhoneNetworkIdentity */ + TMobilePhoneNetworkIdentity iNetworkId; + /** The alpha-tag displayed when this is the serving network. + + Modes: Common + + @see TMobilePhoneNetworkDisplayTag */ + TMobilePhoneNetworkDisplayTag iDisplayTag; + /** The short name (up to 10 characters) of the network operator. + + Modes: GSM/WCDMA + + @see TMobilePhoneNetworkShortName */ + TMobilePhoneNetworkShortName iShortName; + /** The long name (up to 20 characters) of the network operator. + + Modes: GSM/WCDMA + + @see TMobilePhoneNetworkLongName */ + TMobilePhoneNetworkLongName iLongName; + /** The type of network access. + + @see TMobilePhoneNetworkAccess */ + TMobilePhoneNetworkAccess iAccess; + }; + +/** A typedef'd packaged TEtel3rdPartyMobileNetworkInfoV1 for passing through a generic +API function member. + +@deprecated 9.0 +*/ + typedef TPckg TEtel3rdPartyMobileNetworkInfoV1Pckg; + + /** IMS Authenticate constants,in accordance to 3GPP TS 33.102, + section 6.3.7, and RFC 3310*/ + enum TMobilePhoneAuthenticate + { + /** length of autn is 128bits - 16octets*/ + KAutnLength=16, + /** length of RAND is 16 octets */ + KRandLength=16, + /** length of RES is 16 octets*/ + KResLength=16, + /** length of IK is 16 octets*/ + KIkLength=16, + /** length of CK is 16 octets*/ + KCkLength=16, + /** length of Kc (GSM cipher key) is 8 octets*/ + KKcLength=8, + /** length of is 112 bits - 14 octets */ + KAutsLength=14, + }; + + /** Maximum size of the record in an EF is 0xff( 255 bytes) according to TS 102.221, section 8.2.2.2 + */ + enum TMobilePhoneRelease5EFMaxSize + { + KRelease5EFMaxSize=255, + }; + + /** typedefs for encapsulation of the buffers that hold authorization data stored on the ISIM/USIM*/ + /** typedef for Internet Multimedia Public Identity*/ + typedef TBuf8 TIMPU; + /** typedef for Internet Multimedia Private Identity*/ + typedef TBuf8 TIMPI; + /** typedef for Home Network Domain Name*/ + typedef TBuf8 THNDN; + + + /** IMS Authenticate API*/ + /** Class encapsulates data needed as an input/output for + ISIM/USIM AUTHENTICATE command + + @publishedPartner + @released + */ + class TImsAuthenticateDataV5: public TMultimodeType + { + public: + IMPORT_C TImsAuthenticateDataV5(); + /** holds value of network challenge AUTN */ + TBuf8 iAUTN; + /** holds value of network challenge RAND */ + TBuf8 iRAND; + /** holds result RES of AUTHENTICATE command when it's successfull*/ + TBuf8 iRES; + /** holds value of session key Integrity Key */ + TBuf8 iIK; + /** holds value of session key Cipher Key */ + TBuf8 iCK; + /** holds value of Authentication Token when AUTHENTICATE fails*/ + TBuf8 iAUTS; + }; + + /** packaged version of TImsAuthenticateDataV5, used when this structure has to be passeed via IPC*/ + typedef TPckg TImsAuthenticateDataV5Pckg; + friend class CAsyncRetrieveAuthorizationInfo; + + /** API that execute ISIM/USIM AUTHENTICATE command*/ + IMPORT_C void ImsAuthenticate (TRequestStatus& aReqStatus,TDes8& authenticateDataPckgd) const; + + IMPORT_C void NotifyImsAuthorizationInfoChange(TRequestStatus& aReqStatus) const; + + /** + Source location of IMS Authorization data. + */ + enum TAuthorizationDataSource + { + /** Authorization data source is USIM. */ + EFromUSIM, + /** Authorization data source is ISIM. */ + EFromISIM + }; + + /** + Class encapsulates IMS authorization data stored in the ISIM or USIM + + @publishedPartner + @released + */ + class CImsAuthorizationInfoV5 : public CBase + { + public: + IMPORT_C ~CImsAuthorizationInfoV5(); + IMPORT_C static CImsAuthorizationInfoV5* NewL(); + IMPORT_C virtual void ExternalizeL(HBufC8*& aBuffer); + IMPORT_C virtual void InternalizeL(const TDesC8& aBuffer); + IMPORT_C TUint ExtensionId() const; + public: + /**Internet Multimedia Private Identity stored on the ISIM/USIM*/ + RMobilePhone::TIMPI iIMPI; + /**Internet Multimedia Public Identity(ies) stored on the ISIM/USIM*/ + RArray iIMPUArray; + /**Home Network Domain Name stored on the ISIM/USIM*/ + RMobilePhone::THNDN iHomeNetworkDomainName; + /**indicates whether authorization data has been retrieved from the ISIM*/ + TAuthorizationDataSource iAuthenticationDataSource; + protected: + CImsAuthorizationInfoV5(); + /** version of the data supported*/ + TUint iExtensionId; + }; + + /** + Defines the input as well as the ouput parameters used when performing the + (U)ICC AUTHENTICATE command. + + @publishedPartner + @released + */ + class TSmartCardAuthenticateDataV6 : public TImsAuthenticateDataV5 + { + public: + IMPORT_C TSmartCardAuthenticateDataV6(); + + public: + TBuf8 iKc; + }; + + /** + Packaged version of TSmartCardAuthenticateDataV6, used when this + structure has to be passeed via IPC. + */ + typedef TPckg TSmartCardAuthenticateDataV6Pckg; + + IMPORT_C void SmartCardAuthenticate(TRequestStatus& aReqStatus, TDes8& aAuthDataPckgd) const; + IMPORT_C void SmartCardAuthenticate(TRequestStatus& aReqStatus, const TAID& aAID, TDes8& aAuthDataPckgd) const; + +private: + CMobilePhonePtrHolder* iMmPtrHolder; + RMobilePhone(const RMobilePhone& aPhone); + +protected: + IMPORT_C void ConstructL(); + IMPORT_C void Destruct(); + }; + + +/*********************************************************/ +// +// Phone Storage functionality (RMobilePhoneStore) +// +/*********************************************************/ + + + +class CMobilePhoneStorePtrHolder; +class RMobilePhoneStore : public RTelSubSessionBase +/** +Abstract class used to define common phone storage actions and types + +Clients open one of the specialised phone store classes that are derived from RMobilePhoneStore +*/ + { +public: + friend class CAsyncRetrieveStoreList; + +/** Types of store. + +Modes: Common */ + enum TMobilePhoneStoreType + { + /** Store type is unknown. + + Modes: Common */ + EPhoneStoreTypeUnknown, + /** Store contains SMS messages. + + Modes: Common */ + EShortMessageStore, + /** Store contains NAM entries. + + Modes: CDMA */ + ENamStore, + /** Store contains PhoneBook entries. + + Modes: Common */ + EPhoneBookStore, + /** Store contains emergency number entries. + + Modes: Common */ + EEmergencyNumberStore, + /** Store contains own number entries. + + Modes: Common */ + EOwnNumberStore + }; + +/** Store capabilities. */ + enum TMobilePhoneStoreCaps + { + /** The store can be accessed as a whole using the ReadAll() and StoreAll() member + functions. */ + KCapsWholeStore = 0x80000000, + /** The store can be accessed one entry at a time using the RMobilePhoneStore::Read(), + RMobilePhoneStore::Write() and RMobilePhoneStore::Delete() member functions. */ + KCapsIndividualEntry = 0x40000000, + /** The store can be accessed in order to read entries. */ + KCapsReadAccess = 0x20000000, + /** The store can be accessed in order to write or delete entries. */ + KCapsWriteAccess = 0x10000000, + /** The TSY supports deleting all the store entries at once. */ + KCapsDeleteAll = 0x08000000, + /** The TSY supports notification of store events such as entries added, deleted + or store becoming full. */ + KCapsNotifyEvent = 0x04000000 + }; + +/** The type of store information. As defined in TMobilePhoneStoreInfoV1::iExtensionId + +Modes: Common + +@see TMobilePhoneStoreInfoV1 +@see RMobilePhone::TMultimodeType */ + enum TMobilePhoneStoreInfoExtId + { + /** The iExtensionId contents indicate that the packaged class is a RMobilePhoneStore::TMobilePhoneStoreInfoV1. + Modes: Common */ + KETelMobilePhoneStoreV1=KETelExtMultimodeV1, + /** The iExtensionId contents indicate that the packaged class is a RMobilePhoneBookStore::TMobilePhoneBookInfoV1. + Modes: Common */ + KETelMobilePhonebookStoreV1, + /** Reserved for SMS store specific information class. + Modes: Common */ + KETelMobileSmsStoreV1, + /** The iExtensionId contents indicate that the packaged class is a RMobileNamStore::TMobileNamStoreInfoV1. + Modes: CDMA */ + KETelMobileNamStoreV1, + /** The iExtensionId contents indicate that the packaged class is a RMobileONStore::TMobileONStoreInfoV1. + Modes: Common */ + KETelMobileONStoreV1, + /** Reserved for Emergency Number store specific infoprmation class. + Modes: Common */ + KETelMobileENStoreV1, + /** The iExtensionId contents indicate that the packaged class is a TMobilePhoneBookInfoV2. + Modes: Common */ + KETelMobilePhonebookStoreV2=KETelExtMultimodeV2, + + /** The iExtensionId contents indicate that the packaged class is a TMobilePhoneBookInfoV2. + Modes: Common */ + KETelMobilePhonebookStoreV5=KEtelExtMultimodeV5 + }; + + + + class TMobilePhoneStoreInfoV1 : public RMobilePhone::TMultimodeType +/** Defines information and capabilities of a phone-side store. +@publishedPartner +@released */ + { + public: + IMPORT_C TMobilePhoneStoreInfoV1(); + + /** The type of entry in the phone-side store. + + Modes: Common + + @see TMobilePhoneStoreType */ + TMobilePhoneStoreType iType; + /** Indicates the total number of entries that may be held in this store. */ + TInt iTotalEntries; + /** Indicates the current number of entries held in this store. + + Is equal to KIndexNotUsed if the TSY is unable to determine current number + of entries. + + Modes: Common */ + TInt iUsedEntries; + /** Indicates the capabilities of the store. It is the sum of caps constants defined + in TMobilePhoneStoreCaps and those defined for a specialised phone store. + + Modes: Common */ + TUint32 iCaps; + /** The name of the phone-side store. A valid list of names is given in the description + of each specialised store. + + Modes: Common + + @see RMobilePhone::TMobileName */ + RMobilePhone::TMobileName iName; + }; + +/** A typedef'd packaged TMobilePhoneStoreInfoV1 for passing through a generic +API member function. */ + typedef TPckg TMobilePhoneStoreInfoV1Pckg; + + + + class TMobilePhoneStoreEntryV1 : public RMobilePhone::TMultimodeType +/** Defines common contents of an entry in a phone-side store. +*/ + { + public: + + enum + { + KIndexNotUsed = -1 + }; + + protected: + TMobilePhoneStoreEntryV1(); + public: + void InternalizeL(RReadStream& aStream); + void ExternalizeL(RWriteStream& aStream) const; + public: + /** The slot location of the entry within phone-side storage. + + Modes: Common */ + TInt iIndex; + }; + + IMPORT_C void GetInfo(TRequestStatus& aReqStatus, TDes8& aInfo) const; + + IMPORT_C void Read(TRequestStatus& aReqStatus, TDes8& aEntry) const; + IMPORT_C void Write(TRequestStatus& aReqStatus, TDes8& aEntry) const; + + IMPORT_C void Delete(TRequestStatus& aReqStatus, TInt aIndex) const; + IMPORT_C void DeleteAll(TRequestStatus& aReqStatus) const; + +/** The store events. It is possible for more than one event to occur at the same +time, therefore the events are a bitmask and should be tested as a bitmask. + +Modes: Common + +@see NotifyStoreEvent() */ + enum TMobileStoreEvent + { + /** The store has become full. This event will trigger after the last possible + entry in a store has been written. */ + KStoreFull =0x00000001, + /** The store was full but now has some space. This event will trigger after one + or more entries have been deleted from a full store. */ + KStoreHasSpace =0x00000002, + /** The store is empty. This event will trigger after the last entry in a store + has been deleted or if all entries are deleted at once. */ + KStoreEmpty =0x00000004, + /** The store has a new entry, placed in the slot indicated by the aIndex parameter. */ + KStoreEntryAdded =0x00000008, + /** The store has deleted the entry that was in the slot indicated by the aIndex + parameter. */ + KStoreEntryDeleted =0x00000010, + /** The store has changed the entry that was in the slot indicated by the aIndex + parameter. */ + KStoreEntryChanged =0x00000020, + /** The store contents have substantially changed and the TSY is recommending that + the client performs a refresh by reading all the contents again. */ + KStoreDoRefresh =0x00000040 + }; + + IMPORT_C void NotifyStoreEvent(TRequestStatus& aReqStatus, TUint32& aEvent, TInt& aIndex) const; + +protected: + CMobilePhoneStorePtrHolder* iStorePtrHolder; + +protected: + RMobilePhoneStore(); + IMPORT_C void BaseConstruct(CMobilePhoneStorePtrHolder* aPtrHolder); + IMPORT_C void Destruct(); + }; + + +/*********************************************************/ +// +// Call based functionality (RMobileCall) +// +/*********************************************************/ + + + +class CMobileCallPtrHolder; + +class RMobileCall : public RCall +/** Provides access to the functionality associated with a specific mobile call. + +RMobileCall encapsulates access to a mobile phone. The functionality of RMobileCall +is divided into a number of functional units, for the purpose of easier documentation +and navigation and selectable support by TSY. + +Note: Some RMobileCall function members must be supported by the TSY while +others are part of optional "functional unit" and only need to be supported +if the TSY supports that functional unit. When a functional unit is mandatory +then the TSY should at least support the Get...Caps() member function to indicate +the member functions that are supported for this unit. + */ + { +public: + IMPORT_C RMobileCall(); + /***********************************************************************************/ + // + // Mobile call parameters - used within Dial/Answer API + // + /***********************************************************************************/ + + // used to set iExtensionId in RCall::TCallParams +/** The mobile call parameter extension IDs. + +Modes: Common */ + enum TMobileCallParamsExtensionId + { + /** The iExtensionId contents indicate that the packaged class is a TMobileCallParamsV1. */ + KETelMobileCallParamsV1=KETelExtMultimodeV1, + /** The iExtensionId contents indicate that the packaged class is a TMobileDataCallParamsV1. + + Modes: Common */ + KETelMobileDataCallParamsV1, + /** The iExtensionId contents indicate that the packaged class is a TMobileHscsdCallParamsV1. + + Modes: GSM/WCDMA */ + KETelMobileHscsdCallParamsV1, + /** The iExtensionId contents indicate that the packaged class is a TMobileCallParamsV2. + + Modes: Common */ + KETelMobileCallParamsV2=KETelExtMultimodeV2, + /** The iExtensionId contents indicate that the packaged class is a TMobileDataCallParamsV2. + + Modes: Common */ + KETelMobileDataCallParamsV2, + /** The iExtensionId contents indicate that the packaged class is a TMobileHscsdCallParamsV2. + + Modes: GSM/WCDMA */ + KETelMobileHscsdCallParamsV2, + /** The iExtensionId contents indicate that the packaged class is a TEtel3rdPartyMobileCallParamsV1. + + Modes: Common */ + KETel3rdPartyCallParamsV1=KETelExt3rdPartyV1 + }; + +/** Caller Id restriction settings. + +Modes: Common + +@see TMobileCallParamsV1 */ + enum TMobileCallIdRestriction + { + /** The default setting should be used if the user has not explicitly requested + their identity to be restricted/allowed. */ + EIdRestrictDefault, + /** The user has explicitly requested their identity to be sent for this call. */ + ESendMyId, + /** The user has explicitly requested their identity not to be sent for this call. */ + EDontSendMyId + }; + + class TMobileCallCugV1 : public RMobilePhone::TMultimodeType +/** This class is used to set up a CUG (Closed User Group) call. + +TMobileCallCugV1() is valid in GSM/WCDMA mode only. The client application +should set the CUG settings for the call depending on the user's choice. If +the user has not explicitly requested a CUG call then this parameter should +indicate that explicit CUG invoke is false. The TSY ignores this parameter +if in CDMA mode. +*/ + { + public: + IMPORT_C TMobileCallCugV1(); + public: + /** A boolean indicating whether Closed User Group is being explicitly invoked by + the client or not. If this parameter is false, the other entries in this structure + will be ignored. */ + TBool iExplicitInvoke; + /** The Closed User Group index that the user has specified for this call (if no + index has been specified then this element will equal -1). */ + TInt iCugIndex; + /** A boolean indicating whether the user has suppressed their Outgoing Access option + or not. */ + TBool iSuppressOA; + /** A boolean indicating whether the user has suppressed the use of their preferential + Closed User Group or not. */ + TBool iSuppressPrefCug; + }; + +/** Multicall Operation set-up. + +Mode: WCDMA */ + enum TMobileCallMulticallBearerMode + { + /** Multicall is not supported. */ + EMulticallNotSupported, + /** MS will accept incoming call and establish a connection using an existing bearer. */ + EMulticallShareBearer, + /** MS will accept incoming call and establish a connection by creating a new bearer. */ + EMulticallNewBearer + }; + + + + class TMobileCallParamsV1 : public RCall::TCallParams +/** Defines the parameters used for set-up of a call of any type. +*/ + { + public: + IMPORT_C TMobileCallParamsV1(); + public: + /** Call Id restriction setting to be used for this call. + + @see TMobileCallIdRestriction */ + TMobileCallIdRestriction iIdRestrict; + /** Closed User Group setting to be used for this call. + + @see TMobileCallCugV1 */ + TMobileCallCugV1 iCug; + /** Specifies whether this call attempt is user initiated (EFalse) or a client initiated + redial (ETrue). */ + TBool iAutoRedial; + }; + +/** A typedef'd packaged TMobileCallParamsV1 for passing through a generic API function +member. */ + typedef TPckg TMobileCallParamsV1Pckg; + + + + class TMobileCallParamsV2 : public TMobileCallParamsV1 +/** Defines the parameters used for set-up of a call of any type +for version v2.0 of the API. +A new parameter (iBearerMode) is required to support Multicall. +@publishedPartner +@released +*/ + { + public: + IMPORT_C TMobileCallParamsV2(); + public: + /** The bearer mode. */ + TMobileCallMulticallBearerMode iBearerMode; + }; + +/** A typedef'd packaged TMobileCallParamsV1 for passing through a generic API +function member. */ + typedef TPckg TMobileCallParamsV2Pckg; + + /***********************************************************************************/ + // + // Mobile Call Data Functional Unit + // + /***********************************************************************************/ + +/** In GSM mode, maps to list of supported speeds returned in response to AT+CBST=?. +In CDMA mode, maps to data rates supported by supported service options. + +@see TMobileCallDataCapsV1 */ + enum TMobileCallDataSpeedCaps + { + /** Call can support autobauding. */ + KCapsSpeedAutobauding = 0x00000001, + /** Call can support a speed of 2400bps. */ + KCapsSpeed2400 = 0x00000002, + /** Call can support a speed of 4800bps. */ + KCapsSpeed4800 = 0x00000004, + /** Call can support a speed of 9600bps. */ + KCapsSpeed9600 = 0x00000008, + /** Call can support a speed of 14400bps. */ + KCapsSpeed14400 = 0x00000010, + /** Call can support a speed of 19200bps. */ + KCapsSpeed19200 = 0x00000020, + /** Call can support a speed of 28800bps. */ + KCapsSpeed28800 = 0x00000040, + /** Call can support a speed of 32000bps. */ + KCapsSpeed32000 = 0x00000080, + /** Call can support a speed of 33600bps. */ + KCapsSpeed33600 = 0x00000100, + /** Call can support a speed of 38400bps. */ + KCapsSpeed38400 = 0x00000200, + /** Call can support a speed of 43200bps. */ + KCapsSpeed43200 = 0x00000400, + /** Call can support a speed of 48000bps. */ + KCapsSpeed48000 = 0x00000800, + /** Call can support a speed of 56000bps. */ + KCapsSpeed56000 = 0x00001000, + /** Call can support a speed of 57600bps. */ + KCapsSpeed57600 = 0x00002000, + /** Call can support a speed of 64000bps. */ + KCapsSpeed64000 = 0x00004000, + /** Call can support extended data speed capabilities. This flag is reserved for + future expansion of API and should always be set to zero. */ + KCapsSpeedExtended = 0x80000000 + }; + +/** List of supported values of the parameter returned in response to AT+CBST=? + +Not applicable to CDMA mode + +@see TMobileDataCallParamsV1 */ + enum TMobileCallDataProtocolCaps + { + /** Call can support V.22bis standard + + Modes: COMMON */ + KCapsProtocolV22bis = 0x00000001, + /** Call can support V.32 standard. + + Modes: COMMON */ + KCapsProtocolV32 = 0x00000002, + /** Call can support V.34 standard. + + Modes: COMMON */ + KCapsProtocolV34 = 0x00000004, + /** Call can support V.110 standard. + + Modes: GSM/WCDMA */ + KCapsProtocolV110 = 0x00000008, + /** Call can support V.120 standard. + + Modes: GSM/WCDMA */ + KCapsProtocolV120 = 0x00000010, + /** Call can support bit transparent service. + + Modes: GSM/WCDMA */ + KCapsProtocolBitTransparent = 0x00000020, + /** Call can support X31 flag stuffing standard. + + Modes: GSM/WCDMA */ + KCapsProtocolX31FlagStuffing = 0x00000040, + /** Call can support both PIAF standards (32000bps and 64000bps). + + Modes: GSM/WCDMA */ + KCapsProtocolPIAFS = 0x00000080, + /** Call can support request for Multimedia protocol (3G-324M) over a call to PSTN + with voice fallback. + + Modes: WCDMA */ + KCapsPstnMultimediaVoiceFallback = 0x00000100, + /** Call can support request for Multimedia protocol (3G-324M) over a call to PSTN + without voice fallback + + Modes: WCDMA */ + KCapsPstnMultimedia = 0x00000200, + /** Call can support request for Multimedia protocol (3G-324M) over a call to ISDN + (voice fallback not possible). + + Modes: WCDMA */ + KCapsIsdnMultimedia = 0x00000400, + /** Call can support extended data carrier capabilities. This flag is reserved for + future expansion and should always be set to zero for v1.0 of this API. + + Modes: COMMON */ + KCapsProtocolExtended = 0x80000000 + }; + +/** In GSM mode, maps to list of supported returned in response to AT+CBST=? +In CDMA mode, maps to supported service options. + +Modes: COMMON + +@see TMobileCallDataCapsV1 */ + enum TMobileCallDataServiceCaps + { + KCapsDataCircuitAsynchronous = 0x00000001, + KCapsDataCircuitAsynchronousRDI = 0x00000002, + KCapsDataCircuitSynchronous = 0x00000004, + KCapsDataCircuitSynchronousRDI = 0x00000008, + /** Call can support "PAD Access (asynchronous) (UDI)". + + Modes: GSM/WCDMA */ + KCapsPADAsyncUDI = 0x00000010, + /** Call can support "PAD Access (asynchronous) (RDI)" + + Modes: GSM/WCDMA */ + KCapsPADAsyncRDI = 0x00000020, + /** Call can support "Packet Access (synchronous) (UDI)" + + Modes: GSM/WCDMA */ + KCapsPacketAccessSyncUDI = 0x00000040, + /** Call can support "Packet Access (synchronous) (RDI)". + + Modes: GSM/WCDMA */ + KCapsPacketAccessSyncRDI = 0x00000080, + /** Call can support extended data service capabilities. This flag is reserved for + future expansion of this API and should always be set to zero for v1.0 of + this API. + + Modes: COMMON */ + KCapsServiceExtended = 0x80000000 + }; + +/** Maps to list of supported returned in response to AT+CBST=? + +Not applicable to CDMA mode. + +@see TMobileCallDataCapsV1 */ + enum TMobileCallDataQoSCaps + { + /** Call can support a request for "transparent only" connection. */ + KCapsTransparent = 0x00000001, + /** Call can support a request for "non-transparent only" connection. */ + KCapsNonTransparent = 0x00000002, + /** Call can support a request for "transparent preferred" connection. */ + KCapsTransparentPreferred = 0x00000004, + /** Call can support a request for "non-transparent preferred" connection. */ + KCapsNonTransparentPreferred = 0x00000008 + }; + +/** Supported Air Interface User Rates. */ + enum TMobileCallAiurCodingCaps + { + /** Air interface user rate of 4.8k is supported. */ + KCapsAiurCoding48 = 0x01, + /** Air interface user rate of 9.6k is supported. */ + KCapsAiurCoding96 = 0x04, + /** Air interface user rate of 14.4k is supported. */ + KCapsAiurCoding144 = 0x08 + }; + +/** HSCSD coding capabilities. + +Modes: GSM/WCDMA */ + enum TMobileCallTchCodingsCaps + { + /** Call supports HSCSD coding on 4.8K full rate data traffic channel. */ + KCapsTchCoding48 = 0x00000001, + /** Call supports HSCSD coding on 9.6K full rate data traffic channel. */ + KCapsTchCoding96 = 0x00000004, + /** Call supports HSCSD coding on 14.4K full rate data traffic channel. */ + KCapsTchCoding144 = 0x00000008, + /** Call supports HSCSD coding on 28.8K full rate data traffic channel (only possible + when 14.4K is supported). */ + KCapsTchCoding288 = 0x00000010, + /** Call supports HSCSD coding on 32.0K full rate data traffic channel (only possible + in a two-timeslot configuration). */ + KCapsTchCoding320 = 0x00000020, + /** Call supports HSCSD coding on 43.2K full rate data traffic channel (only possible + when 14.4K is supported). */ + KCapsTchCoding432 = 0x00000040 + }; + +/** The call asymmetry capabilities. + +Modes: GSM/WCDMA + +@see TMobileCallDataCapsV1 */ + enum TMobileCallAsymmetryCaps + { + /** Call supports "No Preference" option for asymmetry bias of a Non-Transparent + ECSD call. */ + KCapsAsymmetryNoPreference= 0x00000001, + /** Call supports "Downlink bias" option for asymmetry bias of a Non-Transparent + ECSD call. + + This means 8-PSK modulation is preferred downlink and GMSK modulation uplink. */ + KCapsAsymmetryDownlink = 0x00000002, + /** Call supports "Uplink bias" option for asymmetry bias of a Non-Transparent ECSD + call. + + This means 8-PSK modulation is preferred uplink and GMSK modulation downlink. */ + KCapsAsymmetryUplink = 0x00000004 + }; + +/** The supported Call RLP versions. + +Modes: GSM/WCDMA + +@see TMobileCallDataCapsV1 */ + enum TMobileCallRLPVersionCaps + { + /** Call supports the single link, basic RLP version 0. */ + KCapsRLPSingleLinkVersion0 = 0x00000001, + /** Call supports the single link, extended RLP version 1. */ + KCapsRLPSingleLinkVersion1 = 0x00000002, + /** Call supports the multi link, RLP version 2. */ + KCapsRLPMultiLinkVersion2 = 0x00000004 + }; + +/** The supported V42bis options. + +Modes: GSM/WCDMA + +@see TMobileCallDataCapsV1 */ + enum TMobileCallV42bisCaps + { + /** Call supports V42bis compression in initiator-responder direction. */ + KCapsV42bisTxDirection = 0x00000001, + /** Call supports V42bis compression in responder-initiator direction. */ + KCapsV42bisRxDirection = 0x00000002, + /** Call supports V42bis compression in both directions. */ + KCapsV42bisBothDirections = 0x00000004 + }; + + + + class TMobileCallDataCapsV1 : public RMobilePhone::TMultimodeType + /** Defines the capabilities of a circuit switched data call. + @publishedPartner + @released + */ + { + public: + IMPORT_C TMobileCallDataCapsV1(); + public: + /** Data speed capabilities - a bit wise sum of the caps defined in TMobileCallDataSpeedCaps. */ + TUint32 iSpeedCaps; + /** Data protocol capabilities - a bit wise sum of the caps defined in TMobileCallDataProtocolCaps. */ + TUint32 iProtocolCaps; + /** Data service capabilities - a bit wise sum of the caps defined in TMobileCallDataServiceCaps. */ + TUint32 iServiceCaps; + /** Data QoS capabilities - a bit wise sum of the caps defined in TMobileCallDataQoSCaps. + + Note: Only available in GSM/WCDMA mode. */ + TUint32 iQoSCaps; + /** A boolean indicating whether or not the MS supports HSCSD for this call. If + this attribute equals EFalse all the following attributes are invalid. + + Note: Only available in GSM/WCDMA mode. */ + TBool iHscsdSupport; + /** For HSCSD: The multi-slot class supported. */ + TInt iMClass; + /** For HSCSD: The maximum supported number of time-slots in the receive (down-link) + direction. */ + TInt iMaxRxTimeSlots; + /** For HSCSD: The maximum supported number of time-slots in the transmit (up-link) + direction. */ + TInt iMaxTxTimeSlots; + /** For HSCSD: The maximum supported total number of receive and transmit time-slots + that can be used at same time. */ + TInt iTotalRxTxTimeSlots; + /** For HSCSD: A bit-wise sum of the supported air interface channel codings defined + in TMobileCallAiurCodingCaps. */ + TUint32 iCodingCaps; + /** For HSCSD: A bit-wise sum of the supported asymmetry bias defined in TMobileCallAsymmetryCaps. */ + TUint32 iAsymmetryCaps; + /** For HSCSD: A boolean indicating whether or not the MS supports automatic user + initiated service level upgrading. */ + TBool iUserInitUpgrade; + /** For HSCSD and CSD: A bit-wise sum of the supported Radio Link Protocol versions + defined in TMobileCallRLPVersionCaps. */ + TUint32 iRLPVersionCaps; + /** For HSCSD and CSD: A bit-wise sum of the supported V42bis compression capabilities + defined in TMobileCallV42bisCaps . */ + TUint32 iV42bisCaps; + }; + +/** A typedef'd packaged TMobileCallDataCapsV1 for passing through a generic API +function member. */ + typedef TPckg TMobileCallDataCapsV1Pckg; + + IMPORT_C TInt GetMobileDataCallCaps(TDes8& aCaps) const; + IMPORT_C void NotifyMobileDataCallCapsChange(TRequestStatus& aReqStatus, TDes8& aCaps) const; + +/** The call setup requested data speed. + +@see TMobileDataCallParamsV1 */ + enum TMobileCallDataSpeed + { + /** Call set-up will request speed depending on data carrier chosen. */ + ESpeedUnspecified, + /** Call set-up will request autobauding. */ + ESpeedAutobauding, + /** Call set-up will request 2400bps. */ + ESpeed2400, + /** Call set-up will request 4800bps. */ + ESpeed4800, + /** Call set-up will request 9600bps. */ + ESpeed9600, + /** Call set-up will request 14400bps. */ + ESpeed14400, + /** Call set-up will request 19200bps. */ + ESpeed19200, + /** Call set-up will request 28800bps. */ + ESpeed28800, + /** Call set-up will request 32000bps. */ + ESpeed32000, + /** Call set-up will request 33600bps. */ + ESpeed33600, + /** Call set-up will request 38400bps. */ + ESpeed38400, + /** Call set-up will request 43200bps. */ + ESpeed43200, + /** Call set-up will request 48000bps. */ + ESpeed48000, + /** Call set-up will request 56000bps. */ + ESpeed56000, + /** Call set-up will request 57600bps. */ + ESpeed57600, + /** Call set-up will request 64000bps. */ + ESpeed64000 + }; + +/** The call set-up requested data protocol. + +Modes: GSM/WCDMA */ + enum TMobileCallDataProtocol + { + /** Call set-up will request carrier depending on data speed chosen. */ + EProtocolUnspecified, + /** Call set-up will request the V.22bis standard. */ + EProtocolV22bis, + /** Call set-up will request the V.32 standard. */ + EProtocolV32, + /** Call set-up will request the V.34 standard. */ + EProtocolV34, + /** Call set-up will request the V.110 standard. */ + EProtocolV110, + /** Call set-up will request the V.120 standard. */ + EProtocolV120, + /** Call set-up will request the X31FlagStuffing standard. */ + EProtocolX31FlagStuffing, + /** Call set-up will request the PIAFS standard. */ + EProtocolPIAFS, + /** Call set-up will request the bit transparent service. */ + EProtocolBitTransparent, + /** Call set-up will request a PSTN multimedia call with voice fallback if multimedia + fails. + + WCDMA mode only. */ + EProtocolPstnMultimediaVoiceFallback, + /** Call set-up will request a PSTN multimedia call. + + WCDMA mode only. */ + EProtocolPstnMultimedia, + /** Call set-up will request a ISDN multimedia call. + + WCDMA mode only. */ + EProtocolIsdnMultimedia + }; + +/** The call setup requested data services. + +Modes: Common + +@see TMobileDataCallParamsV1 */ + enum TMobileCallDataService + { + /** Call set-up will request its default service type. + + Modes: Common */ + EServiceUnspecified, + /** Call set-up will request: + + GSM mode - Data circuit asynchronous (UDI or 3.1 KHz, ex PLMN) service + + In CDMA mode - Async Data service + + Modes: Common */ + EServiceDataCircuitAsync, + /** Call set-up will request Data circuit asynchronous (RDI) service. + + Modes: GSM/WCDMA */ + EServiceDataCircuitAsyncRdi, + /** Call set-up will request Data circuit synchronous (UDI or 3.1 KHz, ex PLMN) + service. + + Modes: GSM/WCDMA */ + EServiceDataCircuitSync, + /** Call set-up will request Data circuit synchronous (RDI) service. + + Modes: GSM/WCDMA */ + EServiceDataCircuitSyncRdi, + /** Call set-up will request PAD asynchronous (UDI) service. + + Modes: GSM/WCDMA */ + EServicePADAsyncUDI, + /** Call set-up will request PAD asynchronous (RDI) service. + + Modes: GSM/WCDMA */ + EServicePADAsyncRDI, + /** Call set-up will request Packet Access synchronous (UDI) service. + + Modes: GSM/WCDMA */ + EServicePacketAccessSyncUDI, + /** Call set-up will request Packet Access synchronous (RDI) service. + + Modes: GSM/WCDMA */ + EServicePacketAccessSyncRDI + }; + +/** The call set-up requested quality of service (QoS). + +Modes: GSM/WCDMA + +@see TMobileDataCallParamsV1 */ + enum TMobileCallDataQoS + { + /** Call set-up will request its default connection. */ + EQoSUnspecified, + /** Call set-up will request a transparent connection. */ + EQoSTransparent, + /** Call set-up will request a non-transparent connection. */ + EQoSNonTransparent, + /** Call set-up will prefer a transparent connection. */ + EQosTransparentPreferred, + /** Call set-up will prefer a non-transparent connection. */ + EQosNonTransparentPreferred + }; + +/** The call set-up requested RLP version. + +@see TMobileDataCallParamsV1 */ + enum TMobileCallDataRLPVersion + { + /** Call set-up will request no RLP version. */ + ERLPNotRequested, + /** Call set-up will request single link basic RLP (version 0). */ + ERLPSingleLinkVersion0, + /** Call set-up will request single link extended RLP (version 1). */ + ERLPSingleLinkVersion1, + /** Call set-up will prefer multi link RLP (version 2). */ + ERLPMultiLinkVersion2 + }; + +/** The V.42bis parameters used in the call set-up of a V.42bis data call. + +@see TMobileDataCallParamsV1 */ + enum TMobileCallDataV42bis + { + /** Call set-up will not request V.42bis compression. */ + EV42bisNeitherDirection, + /** Call set-up will request V.42bis compression in initiator-responder direction + only. */ + EV42bisTxDirection, + /** Call set-up will request V.42bis compression in responder-initiator direction + only. */ + EV42bisRxDirection, + /** Call set-up will request V.42bis compression in both directions. */ + EV42bisBothDirections + }; + + + + + class TMobileDataCallParamsV1 : public TMobileCallParamsV1 +/** Defines the parameters used for setup of a circuit switched data call. +*/ + { + public: + IMPORT_C TMobileDataCallParamsV1(); + public: + /** The type of data service. + + @see TMobileCallDataService */ + TMobileCallDataService iService; + /** The data transfer rate. + + @see TMobileCallDataSpeed */ + TMobileCallDataSpeed iSpeed; + /** The ITU-T standard modulation protocol or higher application protocol. */ + TMobileCallDataProtocol iProtocol; + /** The quality of data service. + + @see TMobileCallDataQoS */ + TMobileCallDataQoS iQoS; + /** The version of Radio Link Protocol. + + Modes: GSM/WCDMA + + @see TMobileCallDataRLPVersion */ + TMobileCallDataRLPVersion iRLPVersion; + /** The IWF to MS windows size. + + Modes: GSM/WCDMA */ + TInt iModemToMSWindowSize; + /** The MS window to IWF size. + + Modes: GSM/WCDMA */ + TInt iMSToModemWindowSize; + /** The acknowledgement timer. + + Modes: GSM/WCDMA */ + TInt iAckTimer; + /** The number of retransmission attempts. + + Modes: GSM/WCDMA */ + TInt iRetransmissionAttempts; + /** The resequencing period in integer format. + + Modes: GSM/WCDMA */ + TInt iResequencingPeriod; + /** The V42bis compression request parameter. + + @see TMobileCallDataV42bis */ + TMobileCallDataV42bis iV42bisReq; + /** The number of codewords in the algorithm. */ + TInt iV42bisCodewordsNum; + /** The maximum encodable data string length. */ + TInt iV42bisMaxStringLength; + TBool iUseEdge; // True for ECSD + }; + +/** A typedef'd packaged TMobileDataCallParamsV1 for passing through a generic API +function member. */ + typedef TPckg TMobileDataCallParamsV1Pckg; + + + + + class TMobileDataCallParamsV2 : public TMobileDataCallParamsV1 +/** Defines the parameters used for setup of a circuit switched data call for version +v2.0 of the API. +*/ + { + public: + IMPORT_C TMobileDataCallParamsV2(); + public: + /** The bearer mode. */ + TMobileCallMulticallBearerMode iBearerMode; + }; + +/** A typedef'd packaged TMobileDataCallParamsV2 for passing through a generic +API function member. */ + typedef TPckg TMobileDataCallParamsV2Pckg; + +/** The Air interface user rate. + +Modes: GSM/WCDMA. */ + enum TMobileCallAiur + { + /** Air interface user rate is not set. */ + EAiurBpsUnspecified, + /** Air interface user rate of 9.6Kbps. */ + EAiurBps9600, + /** Air interface user rate of 14.4Kbps. */ + EAiurBps14400, + /** Air interface user rate of 19.2Kbps. */ + EAiurBps19200, + /** Air interface user rate of 28.8Kbps. */ + EAiurBps28800, + /** Air interface user rate of 38.4Kbps. */ + EAiurBps38400, + /** Air interface user rate of 43.2Kbps. */ + EAiurBps43200, + /** Air interface user rate of 57.6Kbps. */ + EAiurBps57600 + }; + +/** Call Asymmetry preferences. + +Modes: GSM/WCDMA + +@see TMobileHscsdCallParamsV1 */ + enum TMobileCallAsymmetry + { + /** There is no preference for Asymmetry Bias. */ + EAsymmetryNoPreference, + /** Downlink Bias is preferred. */ + EAsymmetryDownlink, + /** Uplink Bias is preferred. */ + EAsymmetryUplink + }; + +/** The call channel coding used. + +Modes: GSM/WCDMA */ + enum TMobileCallTchCoding + { + /** Channel coding is unspecified. */ + ETchCodingUnspecified, + /** 4.8K full rate data traffic channel is used. */ + ETchCoding48, + /** 9.6K full rate data traffic channel is used. */ + ETchCoding96, + /** 14.4K full rate data traffic channel is used. */ + ETchCoding144, + /** 28.8K full rate data traffic channel is used. */ + ETchCoding288, + /** 32.0K full rate data traffic channel is used. */ + ETchCoding320, + /** 43.2K full rate data traffic channel is used. */ + ETchCoding432 + }; + + + + class TMobileDataRLPRangesV1 : public RMobilePhone::TMultimodeType +/** Defines the parameters for minimum and maximum RLP parameter ranges. + +Modes: GSM/WCDMA + +*/ + { + public: + IMPORT_C TMobileDataRLPRangesV1(); + public: + /** Maximum modem to MS window size value. */ + TInt iIWSMax; + /** Minimum modem to MS window size value. */ + TInt iIWSMin; + /** Maximum MS to modem window size value. */ + TInt iMWSMax; + /** Minimum MS to modem window size value. */ + TInt iMWSMin; + /** Maximum acknowledgement timer value. */ + TInt iT1Max; + /** Minimum acknowledgement timer value. */ + TInt iT1Min; + /** Maximum retransmission attempts value. */ + TInt iN2Max; + /** Minimum retransmission attempts value. */ + TInt iN2Min; + /** Maximum resequencing period value. */ + TInt iT4Max; + /** Minimum resequencing period value. */ + TInt iT4Min; + }; + +/** A typedef'd packaged TMobileDataRLPRangesV1 for passing through a generic API +function member. */ + typedef TPckg TMobileDataRLPRangesV1Pckg; + + IMPORT_C void GetMobileDataCallRLPRange(TRequestStatus& aReqStatus, TInt aRLPVersion, TDes8& aRLPRange) const; + + class TMobileHscsdCallParamsV1 : public TMobileDataCallParamsV1 +/** The High Speed Circuit Switched Data parameters. +*/ + { + public: + IMPORT_C TMobileHscsdCallParamsV1(); + public: + /** The wanted Air Interface Rate for the HSCSD call being set-up. + + Modes: GSM/WCDMA + + @see TMobileCallAiur */ + TMobileCallAiur iWantedAiur; + /** The wanted number of receive timeslots for the HSCSD call being set-up. + + Modes: GSM/WCDMA */ + TInt iWantedRxTimeSlots; + TInt iMaxTimeSlots; + /** Bit-wise sum of acceptable air interface channel codings TMobileCallAiurCodingCaps + for the HSCSD call being set-up. + + Modes: GSM/WCDMA */ + TUint iCodings; + /** The wanted asymmetry bias for the HSCSD call being set-up. + + Modes: GSM/WCDMA + + @see TMobileCallAsymmetry */ + TMobileCallAsymmetry iAsymmetry; + /** A boolean indicating whether or not automatic user initiated service level upgrading + is active for the HSCSD call being set-up. ETrue means enabled, EFalse means + disabled. + + Modes: GSM/WCDMA */ + TBool iUserInitUpgrade; + }; + +/** A typedef'd packaged TMobileHscsdCallParamsV1 for passing through a generic +API function member. */ + typedef TPckg TMobileHscsdCallParamsV1Pckg; + + class TMobileHscsdCallParamsV2 : public TMobileHscsdCallParamsV1 +/** Call parameters for High Speed Circuit Switched Data (HSCSD) for version v2.0 +of the API. + +*/ + { + public: + IMPORT_C TMobileHscsdCallParamsV2(); + public: + /** The bearer mode. */ + TMobileCallMulticallBearerMode iBearerMode; + }; + +/** A typedef'd packaged TMobileHscsdCallParamsV2 for passing through a generic +API function member. */ + typedef TPckg TMobileHscsdCallParamsV2Pckg; + + IMPORT_C void SetDynamicHscsdParams(TRequestStatus& aReqStatus, TMobileCallAiur aAiur, TInt aRxTimeslots) const; + + class TMobileCallHscsdInfoV1 : public RMobilePhone::TMultimodeType +/** The HSCSD settings. + +Modes: GSM/WCDMA + +*/ + { + public: + IMPORT_C TMobileCallHscsdInfoV1(); + public: + /** Current AIUR for the HSCSD call. + + @see TMobileCallAiur */ + TMobileCallAiur iAiur; + /** Current number of receive timeslots for the HSCSD call. */ + TInt iRxTimeSlots; + /** Current number of transmit time slots for the HSCSD call. */ + TInt iTxTimeSlots; + /** Current channel coding for the HSCSD call. */ + TMobileCallTchCoding iCodings; + }; + +/** A typedef'd packaged TMobileCallHscsdInfoV1 for passing through a generic API +function member. */ + typedef TPckg TMobileCallHscsdInfoV1Pckg; + + IMPORT_C TInt GetCurrentHscsdInfo(TDes8& aHSCSDInfo) const; + IMPORT_C void NotifyHscsdInfoChange(TRequestStatus& aReqStatus, TDes8& aHSCSDInfo) const; + + /***********************************************************************************/ + // + // Multimedia Calls + // + /***********************************************************************************/ + + IMPORT_C void AnswerMultimediaCallAsVoice(TRequestStatus& aReqStatus, const TDesC8& aCallParams, TName& aCallName) const; + IMPORT_C void NotifyVoiceFallback(TRequestStatus& aReqStatus, TName& aCallName) const; + + // + // Mobile Alternating Call Functional Unit + // + + IMPORT_C void SwitchAlternatingCall(TRequestStatus& aReqStatus) const; + IMPORT_C void NotifyAlternatingCallSwitch(TRequestStatus& aReqStatus) const; + + /***********************************************************************************/ + // + // MobileCallControl functional unit + // + /***********************************************************************************/ + +/** Mobile call control capabilites. + +Modes: Common */ + enum TMobileCallControlCaps + { + //KCapsData=0x00000001, // taken from etel.h + //KCapsFax=0x00000002, + //KCapsVoice=0x00000004, + //KCapsDial=0x00000008, + //KCapsConnect=0x00000010, + //KCapsHangUp=0x00000020, + //KCapsAnswer=0x00000040, + //KCapsLoanDataPort=0x00000080, + //KCapsRecoverDataPort=0x00000100 + /** Indicates that this call can be put on hold. This implies that the call is currently + active and that there is no other held call. */ + KCapsHold = 0x00000200, + /** Indicates that this call can be resumed. This implies that the call is currently + on hold and that there is no other active call. + + Modes: Common */ + KCapsResume = 0x00000400, + /** Indicates that this call's state can be swapped to the opposite state. This + implies that this call is either active or held. There may be another call + in the opposite state and if this is the case then both calls will be simultaneously + swapped to their opposite state. + + Modes: Common */ + KCapsSwap = 0x00000800, + /** Indicates that this incoming call can be deflected to another destination. + + Modes: GSM/WCDMA */ + KCapsDeflect = 0x00001000, + /** Indicates that this call can be transferred to the remote party of another call. + For this capability to be set there must be one active call and one held or + dialing call. + + Modes: GSM/WCDMA */ + KCapsTransfer = 0x00002000, + /** Indicates that this call can be joined either to another single call to form + a conference call or to an existing conference call. + + Modes: Common */ + KCapsJoin = 0x00004000, + /** Indicates that this call (within a conference call) can go into One to One mode. + This action would put the rest of the conference call on hold. + + Modes: GSM/WCDMA */ + KCapsOneToOne = 0x00008000, + /** Indicates that the user can activate a CCBS request on this failed call set-up. + + Modes: GSM/WCDMA */ + KCapsActivateCCBS = 0x00010000, + /** Indicates that this call is part of an alternating call and the client can call + SwitchAlternatingCall() on this call in order to switch it to its other mode. + + Modes: GSM/WCDMA */ + KCapsSwitchAlternatingCall = 0x00020000, + /** Indicates that this call can use/create a new bearer. This means that multiple + calls (multicall) can be active at the same time using no more that 7 bearers + simultaneously. The other option is to swap with an active call, therefore + it becomes held and shares the same bearer. + + Modes: WCDMA */ + KCapsMulticall = 0x00040000 + }; + + +/** Mobile call events capabilities. + +Modes: Common */ + enum TMobileCallEventCaps + { + /** Indicates that local hold notifications are supported. + + Modes: Common */ + KCapsLocalHold = 0x00000001, + /** Indicates that local resume notifications are supported. + + Modes: Common */ + KCapsLocalResume = 0x00000002, + /** Indicates that local deflect transfer notifications are supported. + + Modes: GSM/WCDMA */ + KCapsLocalDeflectCall = 0x00000004, + /** Indicates that local explicit transfer notifications are supported. + + Modes: GSM/WCDMA */ + KCapsLocalTransfer = 0x00000008, + /** Indicates that remote hold notifications are supported. + + Modes: GSM/WCDMA */ + KCapsRemoteHold = 0x00000010, + /** Indicates that remote resume notifications are supported. + + Modes: GSM/WCDMA */ + KCapsRemoteResume = 0x00000020, + /** Indicates that remote termination notifications are supported. + + Modes: Common */ + KCapsRemoteTerminate = 0x00000040, + /** Indicates that remote conference invocation notifications are supported. + + Modes: GSM/WCDMA */ + KCapsRemoteConferenceCreate = 0x00000080 + }; + + + + class TMobileCallCapsV1 : public RMobilePhone::TMultimodeType +/** Defines the dynamic capabilities of a mobile call. +*/ + { + public: + IMPORT_C TMobileCallCapsV1(); + public: + /** Call control capability information - a bit wise sum of TMobileCallControlCaps + constants */ + TUint32 iCallControlCaps; + /** Call event capability information - a bit wise sum of TMobileCallEventCaps constants. */ + TUint32 iCallEventCaps; + }; + +/** A typedef'd packaged TMobileCallCapsV1 for passing through a generic API function +member. */ + typedef TPckg TMobileCallCapsV1Pckg; + + IMPORT_C TInt GetMobileCallCaps(TDes8& aCaps) const; + IMPORT_C void NotifyMobileCallCapsChange(TRequestStatus& aReqStatus, TDes8& aCaps) const; + + IMPORT_C void Hold(TRequestStatus& aReqStatus) const; + IMPORT_C void Resume(TRequestStatus& aReqStatus) const; + IMPORT_C void Swap(TRequestStatus& aReqStatus) const; + IMPORT_C void DialISV(TRequestStatus& aStatus,const TDesC8& aCallParams,const TTelNumberC& aTelNumber); + IMPORT_C void AnswerIncomingCallISV(TRequestStatus& aStatus,const TDesC8& aCallParams); + +/** The type of call deflection requested. + +@see Deflect() */ + enum TMobileCallDeflect + { + /** Destination is not specified. */ + EDeflectUnspecified, + /** Call will be deflected to voicemail. */ + EDeflectVoicemail, + /** Call will be deflected to the pre-registered number for the call forwarding + service. */ + EDeflectRegisteredNumber, + /** Call will be deflected to the number supplied in the aDestination parameter. */ + EDeflectSuppliedNumber + }; + + IMPORT_C void Deflect(TRequestStatus& aReqStatus, TMobileCallDeflect aDeflectType, const RMobilePhone::TMobileAddress& aDestination) const; + IMPORT_C void Transfer(TRequestStatus& aReqStatus) const; + IMPORT_C void GoOneToOne(TRequestStatus& aReqStatus) const; + +/** The mobile call events. + +Modes: Common */ + enum TMobileCallEvent + { + /** The call has been placed on hold as a result of a local action. + + Modes: Common */ + ELocalHold, + /** The call has been resumed as a result of a local action. + + Modes: Common */ + ELocalResume, + /** The call has been deflected to another remote party as a result of a local action. + + + Modes: GSM/WCDMA */ + ELocalDeflectCall, + /** The call has been transferred to another remote party as a result of a local + action. + + Modes: Common */ + ELocalTransfer, + /** The call has been placed on hold by the remote connected party. + + Modes: GSM/WCDMA */ + ERemoteHold, + /** The call has been resumed by the remote connected party. + + Modes: GSM/WCDMA */ + ERemoteResume, + /** The call has been terminated by the remote party. + + Modes: Common */ + ERemoteTerminated, + /** The call has been joined by the remote connected party to other call(s) to create/add + to a conference call. + + Modes: GSM/WCDMA */ + ERemoteConferenceCreate, + ERemoteTransferring, + ERemoteTransferAlerting, + /** The outgoing call has been barred by the remote party. + + Modes: GSM/WCDMA */ + ERemoteBarred, + /** The call is being forwarded by the remote party. + + Modes: GSM/WCDMA */ + ERemoteForwarding, + /** The call is waiting at the remote end. + + Modes: GSM/WCDMA */ + ERemoteWaiting, + /** The outgoing call has been barred by the local party. + + Modes: GSM/WCDMA */ + ELocalBarred + }; + + IMPORT_C void NotifyCallEvent(TRequestStatus& aReqStatus, TMobileCallEvent& aEvent) const; + +/** Describes the possible call states. */ + enum TMobileCallStatus + { + /** Indicates that the call status is unknown. */ + EStatusUnknown, // same as RCall::EStatusUnknown + /** Indicates that the call is idle. */ + EStatusIdle, // same as RCall::EStatusIdle + EStatusDialling, // same as RCall::EStatusDialling + /** Indicates that the MT call is ringing but not answered yet by the local user. */ + EStatusRinging, // same as RCall::EStatusRinging + /** Indicates that the local user has answered the MT call but the network has not + acknowledged the call connection yet. */ + EStatusAnswering, // same as RCall::EStatusAnswering + /** MO Call: the network notifies to the MS that the remote party is now ringing. */ + EStatusConnecting, // same as RCall::EStatusConnecting + /** Indicates that call is connected and active. */ + EStatusConnected, // same as RCall::EStatusConnected + /** Indicates that call is disconnecting. */ + EStatusDisconnecting, // same as RCall::EStatusHangingUp + /** Indicates that the call is disconnecting with inband data (to enable the network + to send an audio tone), signifying that the call is not to be released until + the user terminates the call. */ + EStatusDisconnectingWithInband, + /** Indicates that call is undergoing temporary channel loss and it may or may not + be reconnected. */ + EStatusReconnectPending, + /** Indicates that the call is connected but on hold. */ + EStatusHold, + /** Indicates that the call is the non-active half of an alternating call. This + call is waiting for its active half or the remote end to switch alternating + call mode. */ + EStatusWaitingAlternatingCallSwitch, + EStatusTransferring, + EStatusTransferAlerting + }; + + IMPORT_C TInt GetMobileCallStatus(TMobileCallStatus& aStatus) const; + IMPORT_C void NotifyMobileCallStatusChange(TRequestStatus& aReqStatus, TMobileCallStatus& aStatus) const; + + IMPORT_C void DialNoFdnCheck(TRequestStatus& aStatus,const TDesC& aTelNumber) const; + IMPORT_C void DialNoFdnCheck(TRequestStatus& aStatus,const TDesC8& aCallParams,const TDesC& aTelNumber) const; + + /** + Contains audio tone events. + */ + enum TMobileCallAudioToneEvent + { + /** + Stop audio tone. + */ + EAudioStop, + /** + Start audio tone. + */ + EAudioStart + }; + + /** + List of 3GPP defined supervisory audio tones taken from technical specification 3GPP TS 22.001 v4.0.0 Annex F. + + This enumeration is based on the signal information element specified in Table 10.5.130/3GPP TS 24.008 v5.15.0 + */ + enum TMobileCallAudioTones + { + /** + No tone. Not defined in specification used for initialisation of + iTone class member variable during TAudioToneV3 construction. + */ + ENoTone, + /** + Dial tone. + */ + EDialTone, + /** + Subscriber busy tone. + */ + ESubscriberBusyTone, + /** + Congestion tone. + */ + ECongestionTone, + /** + Radio path acknowledgement tone. + */ + ERadioPathAcknowledgement, + /** + Radio path not available tone. + */ + ERadioPathNotAvailable, + /** + Call dropped (Mobile Originated only). + */ + EMOCallDropped, + /** + Error special information. + */ + EErrorSpecialInformation, + /** + Number unobtainable. + */ + ENumberUnobtainable, + /** + Authentication failure. + */ + EAuthenticationFailure, + /** + Call waiting. + */ + ECallWaiting, + /** + Ringback tone. + */ + ERingback + }; + + class TAudioToneV3 : public RMobilePhone::TMultimodeType + /** + Audio tone version 1 class. Contains information relating to the call control playing of audio tones. + Tones maybe generated by the network (in-band) or signalled to be played locally by the ME. + @publishedPartner + @released + */ + { + public: + IMPORT_C TAudioToneV3(); + + public: + /** + Indicates whether the tone is starting or stopping playing. + */ + TMobileCallAudioToneEvent iEvent; + /** + Indicates which tone is to be played. + */ + TMobileCallAudioTones iTone; + /** + Indicates whether the tone is played by the network or is to be played locally by the ME. + */ + TBool iPlayedLocally; + }; + + /** + Packaging typedef for TAudioToneV3 class. + */ + typedef TPckg TAudioToneV3Pckg; + + IMPORT_C void NotifyAudioToneEvent(TRequestStatus& aReqStatus, TDes8& aToneInfo) const; + + /***********************************************************************************/ + // + // MobilePrivacy functional unit + // + /***********************************************************************************/ + + IMPORT_C TInt SetPrivacy(RMobilePhone::TMobilePhonePrivacy aPrivacySetting) const; + IMPORT_C void NotifyPrivacyConfirmation(TRequestStatus& aReqStatus, RMobilePhone::TMobilePhonePrivacy& aPrivacySetting) const; + + /***********************************************************************************/ + // + // MobileTrafficChannel function unit + // + /***********************************************************************************/ + +/** Call traffic channels. + +Modes: CDMA */ + enum TMobileCallTch + { + /** The traffic channel of the call is unknown. */ + ETchUnknown, + /** The call has a digital traffic channel */ + ETchDigital, + /** The call has an analog traffic channel */ + ETchAnalog + }; + + IMPORT_C TInt SetTrafficChannel(TMobileCallTch aTchRequest) const; + IMPORT_C void NotifyTrafficChannelConfirmation(TRequestStatus& aReqStatus, TMobileCallTch& aTchType) const; + + /***********************************************************************************/ + // + // MobileCallInformation functional unit + // + /***********************************************************************************/ + + /** + Remote party Identity status. + + Modes: Common + + @see TMobileCallRemotePartyInfoV1 + */ + enum TMobileCallRemoteIdentityStatus + { + /** + The remote party's identity can not be determined. Calling + party's Binary Coded Decimal (BCD) number is not available. + Cause of No CLI is "unavailable". + */ + ERemoteIdentityUnknown, + + /** + The remote party's identity, or BCD number, is available. + However, cause of No CLI has not been set. + */ + ERemoteIdentityAvailable, + + /** + The remote party has suppressed the transmission of its + identity; i.e. their BCD number is not available. Cause of No + CLI is "reject by user". + */ + ERemoteIdentitySuppressed, + /** + The remote party's identity, or BCD number, is available. The + cause of No CLI is "reject by user". + + To be used where the network has specified that displaying of + CLI information of the remote party has been rejected by the + caller but the TMobileCallRemotePartyInfoV1::iRemoteNumber + parameter has been populated with some other string which may + be of use to the client. + */ + ERemoteIdentityAvailableNoCliRejectedByUser, + + /** + The remote party's identity is available; a BCD number is + available. The cause of No CLI is "Interaction with other + service". + + To be used where the network has specified that CLI information + of the remote party is not available due to ineraction with + another service. However, the + TMobileCallRemotePartyInfoV1::iRemoteNumber parameter has been + populated with some other string which may be of use to the + client. + */ + ERemoteIdentityAvailableNoCliInteractionWithOtherService, + /** + The remote party's identity, or BCD number, is unavailable. + Cause of No CLI is "interaction with other service". + */ + ERemoteIdentityUnavailableNoCliInteractionWithOtherService, + + /** + The remote party's identity, or BCD number, is available. + Cause of No CLI is "Coin Line/ Payphone". + + To be used where the network has specified that CLI information + of the remote party is not available as the caller is calling + from a coin/ payphone. However, the + TMobileCallRemotePartyInfoV1::iRemoteNumber parameter has been + populated with some other string which may be of use to the + client. + */ + ERemoteIdentityAvailableNoCliCoinOrPayphone, + /** + The remote party's identity, or BCD number, is not available. + Cause of No CLI is "Coin Line/ Payphone". + */ + ERemoteIdentityUnavailableNoCliCoinOrPayphone, + + /** + The remote party's identity, or BCD number, is available. + Cause of No CLI is "unavailable". + + To be used where the network has specified that the CLI + information of the remote party is not available but the + TMobileCallRemotePartyInfoV1::iRemoteNumber parameter has been + populated with some other string which may be of use to the + client. + */ + ERemoteIdentityAvailableNoCliUnavailable + }; + + + /** + The direction of the mobile call. + + Modes: Common + + @see TMobileCallRemotePartyInfoV1 + */ + enum TMobileCallDirection + { + /** The direction of the call is unknown. */ + EDirectionUnknown, + /** The call was originated by this phone, i.e. it is an outgoing call. */ + EMobileOriginated, + /** The call was terminated by this phone, i.e. it is an incoming call. */ + EMobileTerminated + }; + + enum { KCallingNameSize=80 }; + + + + class TMobileCallRemotePartyInfoV1 : public RMobilePhone::TMultimodeType +/** Defines information about the remote party of a mobile call. +*/ + { + public: + IMPORT_C TMobileCallRemotePartyInfoV1(); + public: + /** Indicates whether the remote party information in the rest of this structure + is valid or not. + + Modes: Common + + @see TMobileCallRemoteIdentityStatus */ + TMobileCallRemoteIdentityStatus iRemoteIdStatus; + /** The direction of the call and hence the role of the remote party, i.e. if the + call is mobile originated then the remote party is the called party whereas + if the call is mobile terminated then the remote party is the calling party. + + Modes: Common + + @see TMobileCallDirection */ + TMobileCallDirection iDirection; + /** The phone number of the remote party if available. + + Modes: Common + + @see RMobilePhone::TMobileAddress */ + RMobilePhone::TMobileAddress iRemoteNumber; + /** Calling party name available through the CNAP supplementary service (if provisioned). + + + Modes: Common */ + TBuf iCallingName; + }; + +/** A typedef'd packaged TMobileCallRemotePartyInfoV1 for passing through a generic +API function member. */ + typedef TPckg TMobileCallRemotePartyInfoV1Pckg; + + IMPORT_C void NotifyRemotePartyInfoChange(TRequestStatus& aReqStatus, TDes8& aRemotePartyInfo) const; + +/** Determines which fields in the class are valid. + +@see TMobileCallInfoV1 */ + enum TMobileCallInfoFlags + { + /** The iStartTime field is valid in the call info class. + + Modes: COMMON */ + KCallStartTime = 0x00000001, + /** The iDuration field is valid in the call info class. + + Modes: COMMON */ + KCallDuration = 0x00000002, + /** The iCallId field is valid in the call info class. + + Modes: COMMON */ + KCallId = 0x00000004, + /** The iRemoteParty field is valid in the call info class. + + Modes: COMMON */ + KCallRemoteParty = 0x00000008, + /** The iDialledParty field is valid in the call info class. + + Modes: COMMON */ + KCallDialledParty = 0x00000010, + /** The iExitCode field is valid in the call info class. + + Modes: COMMON */ + KCallExitCode = 0x00000020, + /** The iEmergency field is valid in the call info class. + + Modes: COMMON */ + KCallEmergency = 0x00000040, + /** The iForwarded field is valid in the call info class. + + Modes: COMMON */ + KCallForwarded = 0x00000080, + /** The iPrivacy field is valid in the call info class. + + Modes: CDMA */ + KCallPrivacy = 0x00000100, + /** The iTch field is valid in the call info class. + + Modes: CDMA */ + KCallTch = 0x00000200, + /** The iAlternatingCall field is valid in the call info class. + + Modes: GSM/WCDMA */ + KCallAlternating = 0x00000400, + KCallSecurity = 0x00000800 + }; + + + + class TMobileCallInfoV1 : public RMobilePhone::TMultimodeType +/** Defines general information about a mobile call. +*/ + { + public: + IMPORT_C TMobileCallInfoV1(); + public: + /** A bit-wise sum of TMobileCallInfoFlags indicating which of the following optional + fields contain valid data. */ + TUint32 iValid; + /** The call service (voice, data, fax, aux. voice) that this call provides. + + @see RMobilePhone::TMobileService */ + RMobilePhone::TMobileService iService; + /** The mobile call status. + + @see TMobileCallStatus */ + static TMobileCallStatus iStatus; + /** The call ID number assigned to an ongoing call. Will equal -1 if the call does + not have an allocated ID. */ + TInt iCallId; + /** The reason for termination of a finished call. Will equal KErrNone if the call + ended normally and KErrNotFound if the call has not ended. */ + TInt iExitCode; + /** ETrue if the call is an emergency call or EFalse if it is not. */ + TBool iEmergency; + /** For a MT call, this attribute equals ETrue if the call has been forwarded to + this phone or EFalse if it has not. For a MO call, this attribute equals ETrue + if the call has been forwarded to another destination or EFalse if it has + not. If the phone can not determine whether the call has been forwarded or + not then the attribute will return EFalse. */ + TBool iForwarded; + /** This attribute indicates whether privacy is on or off for this call. + + @see RMobilePhone::TMobilePhonePrivacy */ + RMobilePhone::TMobilePhonePrivacy iPrivacy; + /** This attribute indicates whether this call is an alternating call or not. + + @see RMobilePhone::TMobilePhoneAlternatingCallMode */ + RMobilePhone::TMobilePhoneAlternatingCallMode iAlternatingCall; + /** The current duration of the call. + + @see TTimeIntervalSeconds */ + TTimeIntervalSeconds iDuration; + /** This attribute indicates whether a digital or analog traffic channel is being + used for this call. + + @see TMobileCallTch */ + TMobileCallTch iTch; + /** Information about remote party of a connected call. + + @see TMobileCallRemotePartyInfoV1 */ + TMobileCallRemotePartyInfoV1 iRemoteParty; + /** The original number (including DTMF) dialled for an outgoing call. + + @see RMobilePhone::TMobileAddress */ + RMobilePhone::TMobileAddress iDialledParty; + /** The time and date the call started. + + @see TDateTime */ + TDateTime iStartTime; + /** The name of the call. + + @see TName */ + TName iCallName; + /** The name of the line on which the call is open. + + @see TName */ + TName iLineName; + }; + +/** A typedef'd packaged TMobileCallInfoV1 for passing through a generic API function +member. */ + typedef TPckg TMobileCallInfoV1Pckg; + + class TMobileCallInfoV3 : public TMobileCallInfoV1 + /** + Extends the TMobileCallInfoV1 claass to include extra call info parameter relating to network security. + @publishedPartner + @released + */ + { + public: + IMPORT_C TMobileCallInfoV3(); + public: + /** + Indicates whether Ciphering Status of a call is enabled or disabled. + */ + RMobilePhone::TMobilePhoneNetworkSecurity iSecurity; + }; + + typedef TPckg TMobileCallInfoV3Pckg; + + IMPORT_C TInt GetMobileCallInfo(TDes8& aCallInfo) const; + + /***********************************************************************************/ + // + // MobileCallEmergency functional unit + // + /***********************************************************************************/ + + IMPORT_C void DialEmergencyCall(TRequestStatus& aReqStatus, const TDesC& aNumber) const; + + /***********************************************************************************/ + // + // MobileCallCompletion + // + /***********************************************************************************/ + + IMPORT_C void ActivateCCBS(TRequestStatus& aReqStatus, TInt& aIndex) const; + IMPORT_C TInt RejectCCBS() const; + // + // User-To-User Signalling Functional Unit + // + /***********************************************************************************/ + +/** The UUS capabilities of the call. + +Modes: GSM/WCDMA. */ + enum TMobileCallUUSCaps // UUS capabilities of the call + { + /** Indicates that MS supports UUS1 implicit request. */ + KCapsSetupUUS1Implicit=0x00000001, + /** Indicates that MS supports UUS1 explicit request. */ + KCapsSetupUUS1Explicit=0x00000002, + /** Indicates that MS supports UUS2 request. */ + KCapsSetupUUS2=0x00000004, + /** Indicates that MS supports UUS3 request. */ + KCapsSetupUUS3=0x00000008, + /** Indicates that MS supports activating more than one UUS request at a time. */ + KCapsSetupMultipleUUS=0x00000010, + /** Indicates that UUS1 is active for this call. */ + KCapsActiveUUS1=0x00000020, + /** Indicates that UUS2 is active for this call. */ + KCapsActiveUUS2=0x00000040, + /** Indicates that UUS3 is active for this call. */ + KCapsActiveUUS3=0x00000080 + }; + + IMPORT_C TInt GetUUSCaps(TUint32& aCaps) const; + IMPORT_C void NotifyUUSCapsChange(TRequestStatus& aReqStatus, TUint32& aCaps) const; + +/** UUS Service requests. + +Modes: GSM/WCDMA */ + enum TMobileCallUUSReqs // UUS Service requests + { + /** UUS1 is implicitly requested. */ + KUUS1Implicit=0x00000001, + /** UUS1 is explicitly requested, but it is not mandatory for this call to proceed. */ + KUUS1ExplicitRequested=0x00000002, + /** UUS1 is explicitly requested and it is mandatory for this call to proceed. */ + KUUS1ExplicitRequired=0x00000004, + /** UUS2 is (explicitly) requested, but it is not mandatory for this call to proceed. */ + KUUS2Requested=0x00000008, + /** UUS2 is (explicitly) requested and it is mandatory for this call to proceed. */ + KUUS2Required=0x00000010, + /** UUS3 is (explicitly) requested, but it is not mandatory for this call to proceed. */ + KUUS3Requested=0x00000020, + /** UUS3 is (explicitly) requested and it is mandatory for this call to proceed. */ + KUUS3Required=0x00000040 + }; + + enum + { + KMaxUUISize = 129, + }; + +/** Buffer for the UUI element. */ + typedef TBuf TMobileCallUUI; + + class TMobileCallUUSRequestV1 : public RMobilePhone::TMultimodeType +/** The mobile Call User-to-User Signaling request. +*/ + { + public: + IMPORT_C TMobileCallUUSRequestV1(); + public: + /** This field indicates whether the specified service is requested or required + for the call. */ + TUint iServiceReq; + /** The UUI element. This field only contains data if iServiceReq indicates UUS1. + + @see TMobileCallUUI */ + TMobileCallUUI iUUI; + }; + +/** A typedef'd packaged TMobileCallUUSRequestV1 for passing through a generic API +function member. */ + typedef TPckg TMobileCallUUSRequestV1Pckg; + + IMPORT_C void ActivateUUS(TRequestStatus& aReqStatus, const TDesC8& aUUSRequest) const; + IMPORT_C void SendUUI(TRequestStatus& aReqStatus, TBool aMore, const TMobileCallUUI& aUUI) const; + IMPORT_C void ReceiveUUI(TRequestStatus& aReqStatus, TMobileCallUUI& aUUI) const; + IMPORT_C void HangupWithUUI(TRequestStatus& aReqStatus, const TMobileCallUUI& aUUI) const; + IMPORT_C void AnswerIncomingCallWithUUI(TRequestStatus& aReqStatus, const TDesC8& aCallParams, const TMobileCallUUI& aUUI) const; + + /***********************************************************************************/ + // + // Etel 3rd Party v1.0 Parameter classes + // + /***********************************************************************************/ + + class TEtel3rdPartyMobileCallParamsV1 : public RCall::TCallParams +/** Defines the parameters used to set-up of a call originated from an ETel 3rd Party client. +@publishedPartner +@released +*/ + { + public: + IMPORT_C TEtel3rdPartyMobileCallParamsV1(); + public: + /** Call Id restriction setting to be used for this call. + + @see TMobileCallIdRestriction */ + TMobileCallIdRestriction iIdRestrict; + /** Specifies whether this call attempt is user initiated (EFalse) or a client initiated + redial (ETrue). */ + TBool iAutoRedial; + }; + +/** A typedef'd packaged TEtel3rdPartyMobileCallParamsV1 for passing through a generic API +function member. */ + typedef TPckgTEtel3rdPartyMobileCallParamsV1Pckg; + + +private: + RMobileCall(const RMobileCall& aCall); + CMobileCallPtrHolder* iMmPtrHolder; +protected: + IMPORT_C void ConstructL(); + IMPORT_C void Destruct(); + }; + + +/*********************************************************/ +// +// Line based functionality (RMobileLine) +// +/*********************************************************/ + + + +class CMobileLinePtrHolder; + +class RMobileLine : public RLine +/** Provides access to the functionality associated with a specific mobile line. +*/ + { +public: + IMPORT_C RMobileLine(); + + /***********************************************************************************/ + // + // MobileLineStatus functional unit + // + /***********************************************************************************/ + + IMPORT_C TInt GetMobileLineStatus(RMobileCall::TMobileCallStatus& aStatus) const; + IMPORT_C void NotifyMobileLineStatusChange(TRequestStatus& aReqStatus, RMobileCall::TMobileCallStatus& aStatus) const; + + // + // Additional Caps + // +/** Enumerated auxiliary capabilities. */ + enum TMobileLineAdditionalCaps + { + /** Indicates whether the line is a Primary or Auxiliary voice line offset added + so that core Etel and additional line caps can be returned in one TUint. */ + KCapsAuxVoice=0x00000008 + }; + +private: + RMobileLine(const RMobileLine& aLine); + CMobileLinePtrHolder* iMmPtrHolder; +protected: + IMPORT_C void ConstructL(); + IMPORT_C void Destruct(); + }; + + +/*********************************************************/ +// +// SMS Messaging (RMobileSmsMessaging) +// +/*********************************************************/ + + + +class CMobilePhoneSmspList; +class CSmsMessagingPtrHolder; + +class RMobileSmsMessaging : public RTelSubSessionBase +/** Provides client access to SMS messaging functionality provided by TSY. +@publishedPartner +@released +*/ + { +public: + + friend class CRetrieveMobilePhoneSmspList; + + IMPORT_C RMobileSmsMessaging(); + + IMPORT_C TInt Open(RMobilePhone& aPhone); + IMPORT_C void Close(); + +/** Defines capabilities of SMS messaging. + +Modes: GSM/WCDMA */ + enum TMobileSmsModeCaps + { + /** SMS is supported in GSM and WCDMA modes. SMS are sent across MM ETel API in + a GSM 03.40 TPDU format. + + Modes: GSM/WCDMA */ + KCapsGsmSms=0x00000001, + /** SMS is supported in CDMA mode. SMS are sent across MM ETel API in a IS-637 + Teleservice message PDU format. + + Modes: CDMA */ + KCapsCdmaSms=0x00000002 + }; + +/** Defines SMS control capabilities. + +Modes: Common */ + enum TMobileSmsControlCaps + { + /** TSY supports receiving incoming SMS that have been stored and acknowledged + by the phone prior to forwarding to the TSY. If this flag is set then KCapsReceiveEither + will not be set and the client can receive stored messages only while the + TSY-phone link is in "receive stored" mode. + + Modes: Common */ + KCapsReceiveStored=0x00000001, + /** TSY supports receiving incoming SMS that have been acknowledged by the phone + but have NOT already been stored. It is the client's responsibility to do + the storage. If this flag is set then KCapsReceiveEither will not be set and + the client can receive unstored messages only while the TSY-phone link is + in "receive unstored with phone ack" mode. + + Modes: Common */ + KCapsReceiveUnstoredPhoneAck=0x00000002, + /** TSY supports receiving incoming SMS that have NOT already been stored and acknowledged + by the phone. It is the client's responsibility to do both the storage and + the acknowledgment or rejection. If this flag is set then KCapsReceiveEither + will not be set and the client can receive unstored messages only while the + TSY-phone link is in "receive unstored with client ack" mode. + + Modes: Common */ + KCapsReceiveUnstoredClientAck=0x00000004, + /** TSY supports receiving either stored or unstored incoming SMS at any time. + If this flag is set then any other KCapsReceive... flags will not be set and + the client can receive stored or unstored messages while the TSY-phone link + is in "receive either" mode. + + Modes: Common */ + KCapsReceiveEither=0x00000008, + /** TSY supports creating a default acknowledgment or rejection TPDU using only + a "cause code" supplied by the client. If this flag is not set then the client + must supply the full ack or nack TPDU if it calls RMobileSmsMessaging::AckSmsStored() + or RMobileSmsMessaging::NackSmsStored(). + + Modes: Common */ + KCapsCreateAck=0x00000010, + /** TSY supports sending SMS messages but does not support returning the service + centre's acknowledgment of the submitted message to the client. + + Modes: Common */ + KCapsSendNoAck=0x00000020, + /** TSY supports sending SMS messages and also supports returning the service centre's + acknowledgment of the submitted message to the client. + + Modes: GSM/WCDMA */ + KCapsSendWithAck=0x00000040, + /** TSY supports retrieval of the SMS parameter list. + + Modes: GSM/WCDMA */ + KCapsGetSmspList=0x00000080, + /** TSY supports storage of the SMS parameter list + + Modes: GSM/WCDMA */ + KCapsSetSmspList=0x00000100 + }; + + class TMobileSmsCapsV1 : public RMobilePhone::TMultimodeType +/** Defines capabilities of SMS messaging. +*/ + { + public: + IMPORT_C TMobileSmsCapsV1(); + + /** Sum of TMobileSmsModeCaps constants. + + Modes: Common */ + TUint32 iSmsMode; + /** Sum of TMobileSmsControlCaps constants. + + Modes: Common */ + TUint32 iSmsControl; + }; + +/** A typedef'd packaged TMobileSmsCapsV1 for passing through a generic API member +function. */ + typedef TPckg TMobileSmsCapsV1Pckg; + + IMPORT_C TInt GetCaps(TDes8& aCaps) const; + + // Definitions for sizes of TPDU and User Data fields + enum + { + KGsmTpduSize = 165, // 140 bytes user data + 25 bytes TPDU header + KCdmaTpduSize = 256 // Max size of Bearer Data in Transport Layer message + }; + +/** A typedef'd buffer for GSM or WCDMA message data. */ + typedef TBuf8 TMobileSmsGsmTpdu; +/** A typedef'd buffer for CDMA message data. */ + typedef TBuf8 TMobileSmsCdmaTpdu; + + /***********************************************************************************/ + // + // Enum used by TSY to distinguish which SMS attribute class is used by client + // + /***********************************************************************************/ + +/** Used by TSY to distinguish which SMS attribute class is used by client. + +Modes: Common + +@see RMobileSmsMessaging::TMobileSmsSendAttributesV1 */ + enum TMobileSmsAttributeExtensionId + { + /** The iExtensionId contents indicate that the packaged class is a TMobileSmsAttributesV1. */ + KETelMobileSmsAttributesV1=KETelExtMultimodeV1, + /** The iExtensionId contents indicate that the packaged class is a TMobileSmsReceiveAttributesV1. */ + KETelMobileSmsReceiveAttributesV1, + /** The iExtensionId contents indicate that the packaged class is a TMobileSmsSendAttributesV1. */ + KETelMobileSmsSendAttributesV1, + /** The iExtensionId contents indicate that the packaged class is a TMobileSmsCdmaSendAttributesV4. */ + KETelMobileSmsCdmaSendAttributesV4=KETelExtMultimodeV4 + }; + +/** Defines common attributes of all SMS messages. + +Modes: CDMA + +@see TMobileSmsAttributesV1 */ + enum TMobileSmsAttributeFlags + { + /** The iCdmaTeleservice field is valid in the attribute class. + + Modes: CDMA */ + KCdmaTeleservice = 0x00000001, + /** The iCdmaServiceCategory field is valid in the attribute class. + + Modes: CDMA */ + KCdmaServiceCategory = 0x00000002, + /** The iGsmServiceCentre field is valid in the attribute class. + + Modes: GSM/WCDMA */ + KGsmServiceCentre = 0x00000004, + /** The iDataFormat field is valid in the attribute class. + + Modes: Common */ + KSmsDataFormat = 0x00000008, + /** The iOriginator or iDestination field is valid in the attribute class. + + Modes: Common */ + KRemotePartyInfo = 0x00000010, + /** The iStatus field is valid in the attribute class. + + Modes: Common */ + KIncomingStatus = 0x00000020, + /** The iStore and iStoreIndex fields are valid in the attribute class. + + Modes: Common */ + KStorageLocation = 0x00000040, + /** The iMsgRef field is valid in the attribute class. + + Modes: Common */ + KMessageReference = 0x00000080, + /** The iSubmitReport field is valid in the attribute class. + + Modes: GSM/WCDMA */ + KGsmSubmitReport = 0x00000100, + /** The iMore field is valid in the attribute class. + + Modes: Common */ + KMoreToSend = 0x00000200, + /** Indicates to the TSY that it should keep the traffic channel open since there is + another message ready to be sent immediately after this one (typically used when + sending messages to multiple recipients). TSY should then keep the channel open + until a message is sent with this bit cleared. + + Modes: CDMA */ + KCdmaKeepChannelOpen = 0x00000400, + /** Indicates to the TSY that it must wait for the Transport Layer Acknowledgement from the network + + Modes: CDMA */ + KCdmaTLAckRequired = 0x00000800, + /** The iAddressAuthentication field is valid in the attribute class. + + Modes: CDMA */ + KCdmaAddressAuthentication = 0x00001000 + }; + +/** Defines the SMS data format. + +Modes: Common */ + enum TMobileSmsDataFormat + { + /** The format is not specified. + + Modes: Common */ + EFormatUnspecified, + /** The message data format complies to a SMS TPDU coded as octets according to + GSM 03.40. + + Modes: GSM/WCDMA */ + EFormatGsmTpdu, + /** The message data format complies to a SMS Teleservice PDU coded as octets according + to IS-637. + + Modes: CDMA */ + EFormatCdmaTpdu + }; + + class TMobileSmsAttributesV1 : public RMobilePhone::TMultimodeType + /** Defines common attributes of all SMS messages. + @publishedPartner + @released + */ + { + protected: + TMobileSmsAttributesV1(); + public: + /** The bit-mask flags from TMobileSmsAttributeFlags indicating which attributes + are present in this instance. + + Modes: Common */ + TUint32 iFlags; + /** The format of the message data buffer . + + Modes: Common + + @see TMobileSmsDataFormat */ + TMobileSmsDataFormat iDataFormat; + /** The teleservice this message belongs to, coded according to SMS teleservice + identifier values table in TIA/EIA-41-D. + + Modes: CDMA */ + TInt iCdmaTeleservice; + /** The service category this message belongs to. + + Modes: CDMA */ + TInt iCdmaServiceCategory; + /** The GSM service centre used for this SMS. + + Modes: GSM/WCDMA + + @see RMobilePhone::TMobileAddress */ + RMobilePhone::TMobileAddress iGsmServiceCentre; + }; + +/** A typedef'd packaged TMobileSmsAttributesV1 for passing through a generic +API member function. */ + typedef TPckg TMobileSmsAttributesV1Pckg; + +/** Defines attributes of incoming SMS messages. + +Modes: Common */ + enum TMobileSmsIncomingStatus + { + /** The status of the incoming SMS is unknown. */ + EMtMessageUnknownStatus, + /** The incoming SMS is not stored phone-side but has already been acknowledged + by the phone. */ + EMtMessageUnstoredPhoneAck, + /** The incoming SMS is not stored phone-side and needs to be acknowledged by the + client. */ + EMtMessageUnstoredClientAck, + /** The incoming SMS is stored phone-side. */ + EMtMessageStored + }; + + class TMobileSmsReceiveAttributesV1 : public TMobileSmsAttributesV1 + /** Defines attributes of incoming SMS messages. + @publishedPartner + @released + */ + { + public: + IMPORT_C TMobileSmsReceiveAttributesV1(); + public: + /** Indicates the status of the incoming message -whether it is stored phone-side + or has been acknowledged by the phone. + + Modes: Common + + @see TMobileSmsIncomingStatus */ + TMobileSmsIncomingStatus iStatus; // indicates if MT message is stored phone-side + /** If the message is stored phone-side, indicates the index (within the phone-side + store) where the message is stored. + + Modes: Common */ + TInt iStoreIndex;// used if MT message is stored phone-side + /** If the message is stored phone-side, indicates the name of the appropriate + phone-side store. + + Modes: Common + + @see RMobilePhone::TMobileName */ + RMobilePhone::TMobileName iStore; // used if MT message is stored phone-side + /** The address of the originator of the SMS. + + Modes: Common + + @see RMobilePhone::TMobileAddress */ + RMobilePhone::TMobileAddress iOriginator; + }; + +/** A typedef'd packaged TMobileSmsReceiveAttributesV1 for passing through a generic +API member function. */ + typedef TPckg TMobileSmsReceiveAttributesV1Pckg; + + + + class TMobileSmsSendAttributesV1 : public TMobileSmsAttributesV1 + /** Defines attributes of sent SMS messages. + @publishedPartner + @released */ + { + public: + IMPORT_C TMobileSmsSendAttributesV1(); + public: + /** The message reference assigned to a sent message. + + Modes: Common */ + TUint16 iMsgRef; + /** A boolean indicating whether the client is going to send another SMS immediately + after this one. Equals ETrue if this is the case, EFalse if it is not. + + Modes: Common */ + TBool iMore; + /** The SMS-SUBMIT-REPORT TPDU received from network in response to a sent message. + + Modes: GSM/WCDMA + + @see TMobileSmsGsmTpdu */ + TMobileSmsGsmTpdu iSubmitReport; + /** The address of the destination of the SMS. + + Modes: Common + + @see RMobilePhone::TMobileAddress */ + RMobilePhone::TMobileAddress iDestination; + }; + +/** A typedef'd packaged TMobileSmsSendAttributesV1 for passing through a generic +API member function. */ + typedef TPckg TMobileSmsSendAttributesV1Pckg; + + class TMobileSmsCdmaSendAttributesV4 : public TMobileSmsAttributesV1 + /** + Defines attributes of sent SMS messages (CDMA only). + + @publishedPartner + @released + */ + { + public: + IMPORT_C TMobileSmsCdmaSendAttributesV4(); + public: + /** + The message id allocated by the SMS stack. The TSY should + retrieve the value from iCdmaTeleserviceId to determine + which teleservice this message id corresponds to. + */ + TUint16 iMsgRef; + /** Indicates whether the client is going to send another + PDU immediately after this one (typically used when sending + messages of more than one PDU). Equals ETrue if at least + one more PDU is needed to complete the message and EFalse + otherwise. + */ + TBool iMore; + /** TPDU received from network in response to a sent message */ + TMobileSmsCdmaTpdu iTLAck; + /** The address of the destination of the SMS. */ + RMobilePhone::TMobileAddress iDestination; + /** Transport layer authentication parameter */ + TUint32 iAddressAuthentication; + }; + +/** A typedef'd packaged TMobileSmsCdmaSendAttributesV4 for passing through a generic +API member function. */ + typedef TPckg TMobileSmsCdmaSendAttributesV4Pckg; + + // + // Setting up the storage & acknowledgement mode + // + +/** Defines the SMS receive modes. + +Modes: Common */ + enum TMobileSmsReceiveMode + { + /** Receive mode is unspecified and phone will use its default. */ + EReceiveModeUnspecified, + /** Phone will store and acknowledge all incoming messages before passing them + onto TSY. */ + EReceiveUnstoredPhoneAck, // client stores but phone acknowledges message + /** Phone will acknowledge but NOT store all incoming messages before passing them + onto TSY. It is client's responsibility to store the message. */ + EReceiveUnstoredClientAck, // client acknowledges and stores message + /** Phone will NOT acknowledge or store any incoming messages before passing them + onto TSY. It is client's responsibility to attempt storage and then either + acknowledge or reject the message. */ + EReceiveStored, // phone acknowledges and store message + /** Phone may pass on either stored or unstored messages to TSY. It is client's + responsibility to check RMobileSmsMessaging::TMobileSmsReceiveAttributesV1::iStatus + to determine what action(s) the client needs to take for a message. */ + EReceiveEither // client deals with stored & unstored messages + }; + + IMPORT_C void SetReceiveMode(TRequestStatus& aReqStatus, TMobileSmsReceiveMode aReceiveMode) const; + IMPORT_C TInt GetReceiveMode(TMobileSmsReceiveMode& aReceiveMode) const; + IMPORT_C void NotifyReceiveModeChange(TRequestStatus& aStatus, TMobileSmsReceiveMode& aReceiveMode); + + /***********************************************************************************/ + // + // Incoming SMS + // + /***********************************************************************************/ + + IMPORT_C void ReceiveMessage(TRequestStatus& aReqStatus, TDes8& aMsgData, TDes8& aMsgAttributes) const; + + /***********************************************************************************/ + // + // Responding to incoming SMS + // + /***********************************************************************************/ + + IMPORT_C void AckSmsStored(TRequestStatus& aReqStatus, const TDesC8& aMsgData, TBool aFull=EFalse) const; + IMPORT_C void NackSmsStored(TRequestStatus& aReqStatus, const TDesC8& aMsgData, TInt aRpCause) const; + IMPORT_C void ResumeSmsReception(TRequestStatus& aReqStatus) const; + + /***********************************************************************************/ + // + // Outgoing SMS + // + /***********************************************************************************/ + + IMPORT_C void SendMessage(TRequestStatus& aReqStatus, const TDesC8& aMsgData, TDes8& aMsgAttributes) const; + IMPORT_C void SendMessageNoFdnCheck(TRequestStatus& aReqStatus, const TDesC8& aMsgData, TDes8& aMsgAttributes) const; + +/** Defines the SMS bearer. + +Modes: GSM */ + enum TMobileSmsBearer + { + /** SMS messages will only be sent over a packet-switched (GPRS) network. */ + ESmsBearerPacketOnly, + /** SMS messages will only be sent over a circuit-switched (GSM) network. */ + ESmsBearerCircuitOnly, + /** SMS messages will be sent over the packet-switched (GPRS) network if possible, + otherwise over circuit-switched (GSM) network. */ + ESmsBearerPacketPreferred, + /** SMS messages will be sent over the circuit-switched (GSM) network if possible, + otherwise over packet-switched (GPRS) network. */ + ESmsBearerCircuitPreferred + }; + + IMPORT_C void SetMoSmsBearer(TRequestStatus& aReqStatus, TMobileSmsBearer aBearer) const; + IMPORT_C TInt GetMoSmsBearer(TMobileSmsBearer& aBearer) const; + IMPORT_C void NotifyMoSmsBearerChange(TRequestStatus& aReqStatus, TMobileSmsBearer& aBearer); + + /***********************************************************************************/ + // + // Get information on phone-side SMS storage + // + /***********************************************************************************/ + + IMPORT_C TInt EnumerateMessageStores(TInt& aCount) const; + IMPORT_C void GetMessageStoreInfo(TRequestStatus& aReqStatus, TInt aIndex, TDes8& aInfo) const; + + /***********************************************************************************/ + // + // Read/Write SMS parameters to phone-side storage + // + /***********************************************************************************/ + + enum { KMaxSmspTextSize=30 }; + +/** Defines the valid SMS parameters store. + +Modes: GSM/WCDMA + +@see TMobileSmspEntryV1 */ + enum TMobileSmspStoreValidParams + { + /** The entry includes a valid iDestination field. */ + KDestinationIncluded=0x00000001, + /** The entry includes a valid iServiceCentre field. */ + KSCAIncluded=0x00000002, + /** The entry includes a valid iProtocolId field. */ + KProtocolIdIncluded=0x00000004, + /** The entry includes a valid iDcs field. */ + KDcsIncluded=0x00000008, + /** The entry includes a valid iValidityPeriod field. */ + KValidityPeriodIncluded=0x00000010 + }; + + class TMobileSmspEntryV1 : public RMobilePhone::TMultimodeType + + /** Defines a set of SMS parameters. + @publishedPartner + @released + */ + { + public: + IMPORT_C TMobileSmspEntryV1(); + public: + void InternalizeL(RReadStream& aStream); + void ExternalizeL(RWriteStream& aStream) const; + public: + /** The slot index where this SMSP entry is stored in the SIM's SMSP file. */ + TInt iIndex; + /** A bit-wise sum of the constants defined in TMobileSmspStoreValidParams, that + specifies which parameters are valid within this entry. */ + TUint32 iValidParams; + /** Default protocol ID. Coded according to GSM 03.40. */ + TUint8 iProtocolId; + /** Default data coding scheme. Coded according to GSM 03.40. */ + TUint8 iDcs; + /** Default validity period, in relative format and coded on 8 bits as defined + by GSM 03.40. */ + TUint8 iValidityPeriod; + /** Reserved for future use. */ + TUint8 iReservedFiller; + /** Default destination for outgoing SMS. + + @see RMobilePhone::TMobileAddress */ + RMobilePhone::TMobileAddress iDestination; + /** Default service centre for outgoing SMS. + + @see RMobilePhone::TMobileAddress */ + RMobilePhone::TMobileAddress iServiceCentre; + /** The alpha-tag associated with this SMSP entry, expressed as Unicode characters. */ + TBuf iText; + }; + +/** A typedef'd packaged TMobileSmspEntryV1 for passing through a generic API member +function. */ + typedef TPckg TMobileSmspEntryV1Pckg; + IMPORT_C void StoreSmspListL(TRequestStatus& aReqStatus, CMobilePhoneSmspList* aSmspList) const; + IMPORT_C void NotifySmspListChange(TRequestStatus& aReqStatus) const; + +private: + RMobileSmsMessaging(const RMobileSmsMessaging&); + CSmsMessagingPtrHolder* iSmsMessagingPtrHolder; +protected: + IMPORT_C void ConstructL(); + IMPORT_C void Destruct(); + }; + + +/*********************************************************/ +// +// Broadcast Messaging (RMobileBroadcastMessaging) +// +/*********************************************************/ + + + +class CMobilePhoneBroadcastIdList; + +class CCbsMessagingPtrHolder; +class RMobileBroadcastMessaging : public RTelSubSessionBase +/** This sub-session provides access to the broadcast message services provided +by GSM/WCDMA and CDMA networks. + +Clients will open a RMobileBroadcastMessaging sub-session and then wait for +incoming broadcast messages. The broadcast messages received can depend upon +a "message filter" which defines the languages and/or identifiers of acceptable +(or unacceptable) messages. This sub-session and the function members within +this section must be supported if the TSY indicates that it supports the MobileBroadcastMessaging +functional unit. + +@publishedPartner +@released*/ + { +public: + + friend class CRetrieveMobilePhoneBroadcastIdList; + + IMPORT_C RMobileBroadcastMessaging(); + + IMPORT_C TInt Open(RMobilePhone& aPhone); + IMPORT_C void Close(); + + /***********************************************************************************/ + // + // Broadcast messaging capabilities + // + /***********************************************************************************/ + +/** Broadcast capabilities. + +Modes:GSM/WCDMA */ + enum TMobileBroadcastModeCaps + { + /** GSM 03.41 cell broadcast messages are supported. + + Modes:GSM/WCDMA */ + KCapsGsmTpduFormat = 0x00000001, + /** IS-637-A broadcast messages are supported. + + Modes:CDMA */ + KCapsCdmaTpduFormat = 0x00000002, + /** 3GPP 25.324 Release 4 cell broadcast messages are supported. + + Modes: WCDMA */ + KCapsWcdmaTpduFormat = 0x00000004 + }; + +/** Broadcast message filter capabilities. + +Modes: Common + +@see RMobileBroadcastMessaging::GetLanguageFilter() */ + enum TBroadcastMessagingFilterCaps + { + /** Phone supports switching broadcast messages on or off. This means the EbroadcastAcceptNone + and EBroadcastAcceptAll settings of TMobilePhoneBroadcastFilter are supported. + + Modes: Common */ + KCapsSimpleFilter = 0x00000001, + /** Phone supports filtering of broadcast messages depending upon their language. + The language filter is a list of languages used only for broadcast filtering. + + Modes: Common + + @see RMobileBroadcastMessaging::GetLanguageFilter() */ + KCapsLangFilter = 0x00000002, + /** Phone supports filtering of broadcast messages depending upon their subject. + The subject of a message is identified in GSM/WCDMA mode by the Cell Broadcast + Message Identifier (CBMI) and in CDMA mode by the Service Category. + + Modes: Common */ + KCapsIdFilter = 0x00000004 + }; + + + + class TMobileBroadcastCapsV1 : public RMobilePhone::TMultimodeType + /** Defines capabilities of Broadcast messaging. + @publishedPartner + @released + */ + { + public: + IMPORT_C TMobileBroadcastCapsV1(); + public: + /** Sum of TMobileBroadcastModeCaps constants. + + Modes: GSM/WCDMA */ + TUint32 iModeCaps; + /** Sum of TBroadcastMessagingFilterCaps constants. + + Modes: GSM/WCDMA */ + TUint32 iFilterCaps; + }; + +/** A typedef'd packaged TMobileBroadcastCapsV1 for passing through a generic API +function member. */ + typedef TPckg TMobileBroadcastCapsV1Pckg; + + IMPORT_C TInt GetCaps(TDes8& aCaps) const; + +/** Defines the broadcast attributes. + +Modes: Common */ + enum TMobileBroadcastAttributeFlags + { + /** The iFormat field is valid in the attribute class. + + Modes: Common */ + KBroadcastDataFormat = 0x00000001, + /** The iServiceCategory field is valid in the attribute class. + + Modes: CDMA */ + KCdmaServiceCategory = 0x00000002 + }; + +/** The mobile broadcast data format, used byTMobileBroadcastAttributesV1. + +Modes: Common */ + enum TMobileBroadcastDataFormat + { + /** The message data format is not specified. + + Modes: Common */ + EFormatUnspecified, + /** The message data format complies to a Cell Broadcast TPDU coded as 88 octets + (6 for header and 82 for message data) according to GSM 03.41. + + Modes: GSM/WCDMA */ + EFormatGsmTpdu, + /** The message data format complies to IS-637-A encoding of the Bearer Data parameter + within the Transport Layer's SMS-Broadcast message. + + Modes: CDMA */ + EFormatCdmaTpdu, + /** The message data format complies to a Cell Broadcast TPDU coded as 1252 octets + (6 for header and a maximum of 1246 for message data) according to 3GPP 25.324. + + Modes: WCDMA */ + EFormatWcdmaTpdu + }; + + + + class TMobileBroadcastAttributesV1 : public RMobilePhone::TMultimodeType + /** Defines attributes of a Broadcast message. + @publishedPartner + @released + */ + { + public: + IMPORT_C TMobileBroadcastAttributesV1(); + public: + /** The bit-mask flags indicating which attributes are present in this instance. + + Modes: Common + + @see TMobileBroadcastAttributeFlags */ + TUint32 iFlags; + /** Format of the message data buffer. + + Modes: Common + + @see TMobileBroadcastDataFormat */ + TMobileBroadcastDataFormat iFormat; + /** Service category of the message. + + Modes: CDMA */ + TInt iServiceCategory; + }; + +/** A typedef'd packaged TMobileBroadcastAttributesV1 for passing through a generic +API function member. */ + typedef TPckg TMobileBroadcastAttributesV1Pckg; + + + + + class TMobileBroadcastAttributesV2 : public TMobileBroadcastAttributesV1 + /** Defines attributes of a UMTS Broadcast message for version v2.0 of the API. + @publishedPartner + @released + */ + { + public: + IMPORT_C TMobileBroadcastAttributesV2(); + public: + /** The number of pages that the current broadcast message consists of. The maximum + number of pages for WCDMA Broadcast messages is 15. */ + TInt iNumberOfPages; + /** This parameter is used to store the message type for this broadcast message. */ + TUint8 iMessageType; + /** This parameter is used to store the message id for this broadcast message. + + This parameter is used to store the serial number for this broadcast message. + + This parameter is used to store the data coding scheme for this broadcast + message. */ + TUint16 iMessageId; + /** This parameter is used to store the serial number for this broadcast message. */ + TUint16 iSerialNum; + /** This parameter is used to store the data coding scheme for this broadcast message. */ + TUint8 iDCS; + }; + +/** A typedef'd packaged TMobileBroadcastAttributesV1 for passing through a generic +API function member. */ + typedef TPckg TMobileBroadcastAttributesV2Pckg; + + /***********************************************************************************/ + // + // Receiving broadcast messages + // + /***********************************************************************************/ + + /** A constant which defines the length of the buffer to be passed to ReceiveMessage. + + This constant should be used for all message types: GSM, CDMA and WCDMA.*/ + enum + { + KBroadcastPageSize = 88 + }; + + /** Buffer for received messages. + + This buffer should be used for all message types: GSM, CDMA and WCDMA.*/ + typedef TBuf8 TBroadcastPageData; + + /** Old buffer sizes. KBroadcastPageSize should be used instead. */ + enum + { + KGsmBroadcastDataSize = KBroadcastPageSize, + KCdmaBroadcastDataSize = KBroadcastPageSize, + KWCdmaBroadcastPageSize = KBroadcastPageSize + }; + + /** Buffer for GSM messages. TBroadcastPageData should be used instead. */ + typedef TBuf8 TGsmBroadcastMessageData; + /** Buffer for CDMA messages. TBroadcastPageData should be used instead. */ + typedef TBuf8 TCdmaBroadcastMessageData; + /** Buffer for WCDMA messages. TBroadcastPageData should be used instead. */ + typedef TBuf8 TWCdmaBroadcastPageData; + + IMPORT_C void ReceiveMessage(TRequestStatus& aReqStatus, TDes8& aMsgData, TDes8& aMsgAttributes) const; + + /***********************************************************************************/ + // + // Filters + // + /***********************************************************************************/ + +/** The filter settings of the mobile phone. + +Modes: Common */ + enum TMobilePhoneBroadcastFilter + { + /** The phone does not have a filter setting. */ + EBroadcastFilterUnspecified, + /** The phone is not accepting any broadcast messages. */ + EBroadcastAcceptNone, + /** The phone is accepting all broadcast messages. */ + EBroadcastAcceptAll, + /** The phone is accepting those broadcast messages included within the language + and identifier filters. */ + EBroadcastAcceptFilter, + /** The phone is rejecting those broadcast messages included within the language + or identifier filters. */ + EBroadcastRejectFilter + }; + + IMPORT_C TInt GetFilterSetting(TMobilePhoneBroadcastFilter& aSetting) const; + IMPORT_C void SetFilterSetting(TRequestStatus& aReqStatus, TMobilePhoneBroadcastFilter aSetting) const; + IMPORT_C void NotifyFilterSettingChange(TRequestStatus& aReqStatus, TMobilePhoneBroadcastFilter& aSetting) const; + + IMPORT_C void GetLanguageFilter(TRequestStatus& aReqStatus, TDes16& aLangFilter) const; + IMPORT_C void SetLanguageFilter(TRequestStatus& aReqStatus, const TDesC16& aLangFilter) const; + IMPORT_C void NotifyLanguageFilterChange(TRequestStatus& aReqStatus, TDes16& aLangFilter) const; + + class TMobileBroadcastIdEntryV1 : public RMobilePhone::TMultimodeType + /** In GSM - defines a Cell Broadcast Message Identifier (CBMI) list entry. In + CDMA - defines a Service Category list entry. + @publishedPartner + @released + */ + { + public: + void InternalizeL(RReadStream& aStream); + void ExternalizeL(RWriteStream& aStream) const; + IMPORT_C TMobileBroadcastIdEntryV1(); + public: + /** The value of the message identifier. */ + TUint16 iId; + }; + +/** Defines the broadcast types. */ + enum TMobileBroadcastIdType + { + /** GSM broadcast. */ + EGsmBroadcastId, + /** CDMA broadcast. */ + ECdmaBroadcastId + }; + + IMPORT_C void StoreBroadcastIdListL(TRequestStatus& aReqStatus, CMobilePhoneBroadcastIdList* aIdList, TMobileBroadcastIdType aIdType); + IMPORT_C void NotifyBroadcastIdListChange(TRequestStatus& aReqStatus) const; + +private: + RMobileBroadcastMessaging(const RMobileBroadcastMessaging&); + CCbsMessagingPtrHolder* iCbsMessagingPtrHolder; +protected: + IMPORT_C void ConstructL(); + IMPORT_C void Destruct(); + }; + +/*********************************************************/ +// +// USSD Messaging (RMobileUssdMessaging) +// +/*********************************************************/ + + + +class CUssdMessagingPtrHolder; +class RMobileUssdMessaging : public RTelSubSessionBase +/** Provides client access to USSD functionality provided by TSY. +*/ + { +public: + IMPORT_C RMobileUssdMessaging(); + + IMPORT_C TInt Open(RMobilePhone& aPhone); + IMPORT_C void Close(); + +/** Defines the USSD Messaging Format Capabilities. + +Modes: GSM/WCDMA */ + enum TMobileUssdFormatCaps + { + /** USSD messages coded as a packed string within 160 octets, as defined for a + ussd-String within GSM 04.80 and GSM 03.38. + + Modes: GSM/WCDMA */ + KCapsPackedString=0x00000001 + }; + +/** Defines the USSD Messaging Type Capabilities. + +Modes: GSM/WCDMA */ + enum TMobileUssdTypeCaps + { + /** Outgoing USSD messages are supported. + + Modes: GSM/WCDMA */ + KCapsMOUssd=0x00000001, + /** Incoming USSD messages are supported. + + Modes: GSM/WCDMA */ + KCapsMTUssd=0x00000002 + }; + + + + class TMobileUssdCapsV1 : public RMobilePhone::TMultimodeType + /** Defines capabilities of USSD messaging. + @publishedPartner + @released + */ + { + public: + IMPORT_C TMobileUssdCapsV1(); + /** Sum of TMobileUssdFormatCaps constants. + + Modes: GSM/WCDMA + + @see TMobileUssdFormatCaps */ + TUint32 iUssdFormat; + /** Sum of TMobileUssdTypeCaps constants. + + Modes: GSM/WCDMA + + @see TMobileUssdTypeCaps */ + TUint32 iUssdTypes; + }; + +/** A typedef'd packaged TMobileUssdCapsV1 for passing through a generic API member +function. */ + typedef TPckg TMobileUssdCapsV1Pckg; + + IMPORT_C TInt GetCaps(TDes8& aCaps) const; + +/** Defines the USSD Messaging Attributes. + +Modes: GSM/WCDMA + +@see TMobileUssdAttributesV1 */ + enum TMobileUssdAttributeFlags + { + /** The iFormat field is valid in the attribute class. */ + KUssdDataFormat = 0x00000001, + /** The iType field is valid in the attribute class. */ + KUssdMessageType = 0x00000002, + /** The iDcs field is valid in the attribute class. */ + KUssdMessageDcs = 0x00000004 + }; + +/** Defines the USSD Data Formats. + +Modes: Common */ + enum TMobileUssdDataFormat + { + /** The message data format is unspecified. + + Modes: Common */ + EFormatUnspecified, + /** The message data format complies to a USSD coded as 160 octets as defined for + a ussd-String within GSM 04.80 and GSM 03.38. + + Modes: GSM/WCDMA */ + EFormatPackedString + }; + +/** Defines the USSD Message Types. + +Modes: GSM/WCDMA */ + enum TMobileUssdMessageType + { + /** Message is an unknown type. */ + EUssdUnknown, + /** Message is a mobile originated USSD request. The MS expects the network to + send a USSD MT reply. */ + EUssdMORequest, + /** Message is a reply to a previously received network initiated USSD request. + It is a USSD MO reply. */ + EUssdMOReply, + /** Message is a one-off network initiated USSD notification. The network expects the MS to + send a USSD MO acknowledgement with empty message content. */ + EUssdMTNotify, + /** Message is a network initiated USSD request. The network expects + the MS to send a USSD MO reply. */ + EUssdMTRequest, + /** Message is a network initiated reply to a previously sent MO USSD request. */ + EUssdMTReply, + /** For acknowledging MT USSD notifications (empty message content). */ + EUssdMOAcknowledgement + }; + + + + class TMobileUssdAttributesV1 : public RMobilePhone::TMultimodeType + /** Defines attributes of a USSD message. + @publishedPartner + @released + */ + { + public: + IMPORT_C TMobileUssdAttributesV1(); + public: + /** The TMobileUssdAttributeFlags bit-mask flags indicating which attributes are + present in this instance. + + Modes: GSM/WCDMA + + @see TMobileUssdAttributeFlags */ + TUint32 iFlags; + /** Format of the message data buffer. + + Modes: GSM/WCDMA + + @see TMobileUssdDataFormat */ + TMobileUssdDataFormat iFormat; + /** The type of USSD message. + + Modes: GSM/WCDMA + + @see TMobileUssdMessageType */ + TMobileUssdMessageType iType; + /** The Data Coding Scheme of the USSD message. + + Modes: GSM/WCDMA */ + TUint8 iDcs; + }; + +/** A typedef'd packaged TMobileUssdAttributesV1 for passing through a generic +API member function. */ + typedef TPckg TMobileUssdAttributesV1Pckg; + + /***********************************************************************************/ + // + // Receiving USSD messages + // + /***********************************************************************************/ + + enum + { + KGsmUssdDataSize = 160 + }; + +/** A typedef'd buffer to hold the message data. */ + typedef TBuf8 TGsmUssdMessageData; + + IMPORT_C void ReceiveMessage(TRequestStatus& aReqStatus, TDes8& aMsgData, TDes8& aMsgAttributes) const; + + /***********************************************************************************/ + // + // Sending USSD messages + // + /***********************************************************************************/ + + IMPORT_C void SendMessage(TRequestStatus& aReqStatus, const TDesC8& aMsgData, const TDesC8& aMsgAttributes) const; + IMPORT_C void SendMessageNoFdnCheck(TRequestStatus& aReqStatus, const TDesC8& aMsgData, const TDesC8& aMsgAttributes) const; + + IMPORT_C void SendRelease(TRequestStatus& aReqStatus, TDes8& aReturnResult) const; + IMPORT_C void NotifyNetworkRelease(TRequestStatus& aReqStatus, TDes8& aReturnResult) const; + IMPORT_C void NotifyNetworkRelease(TRequestStatus& aReqStatus, TDes8& aMsgData, TDes8& aMsgAttributes) const; + +private: + RMobileUssdMessaging(const RMobileUssdMessaging&); + CUssdMessagingPtrHolder* iUssdMessagingPtrHolder; +protected: + IMPORT_C void ConstructL(); + IMPORT_C void Destruct(); + }; + + + +/*********************************************************/ +// +// SMS Message Storage (RMobileSmsStore) +// +/*********************************************************/ + + + +class CSmsStorePtrHolder; +class CMobilePhoneSmsList; +class RMobileSmsStore : public RMobilePhoneStore +/** Provides client access to SMS storage functionality provided by TSY. +@publishedPartner +@released +*/ + { +public: + + IMPORT_C RMobileSmsStore(); + IMPORT_C TInt Open(RMobileSmsMessaging& aMessaging, const TDesC& aStoreName); + IMPORT_C void Close(); + +/** Defines the SMS Store Capabilities. + +Modes: Common */ + enum TMobileSmsStoreCaps + { + /** The store contains unread, incoming SMS entries. + + Modes: Common */ + KCapsUnreadMessages = 0x00000001, + /** The store contains read, incoming SMS entries. + + Modes: Common */ + KCapsReadMessages = 0x00000002, + /** The store contains sent SMS entries. + + Modes: Common */ + KCapsSentMessages = 0x00000004, + /** The store contains un sent SMS entries. */ + KCapsUnsentMessages = 0x00000008, + /** The store contains GSM SMS message entries – so TMobileGsmSmsEntryV1 class + should be used. + + Modes: GSM/WCDMA */ + KCapsGsmMessages = 0x00000010, + /** The store contains CDMA SMS message entries – so TMobileCdmaSmsEntryV1 class + should be used. + + Modes: CDMA */ + KCapsCdmaMessages = 0x00000020 + }; + +/** Defines contents of a fixed-size, stored SMS entry. + +Modes: Common */ + enum TMobileSmsStoreStatus + { + /** The status of the SMS is unknown. */ + EStoredMessageUnknownStatus, + /** The SMS is stored phone-side. It is an incoming message that has not been read + yet. */ + EStoredMessageUnread, + /** The SMS is stored phone-side. It is an incoming message that has already been + read. */ + EStoredMessageRead, + /** The SMS is stored phone-side. It is an outgoing message that has not been sent + yet. */ + EStoredMessageUnsent, + /** The SMS is stored phone-side. It is an outgoing message that has already been + sent but a delivery/status report has either not been received yet or was + not requested in the first place. */ + EStoredMessageSent, + /** The SMS is stored phone-side. It is an outgoing message that has already been + sent and a delivery/status report has been received */ + EStoredMessageDelivered + }; + + // + // Enum used by TSY to distinguish which SMS entry class is used by client + // + +/** Used by TSY to distinguish which SMS entry class is used by client. */ + enum TMobileSmsEntryExtensionId + { + /** Type is unknown. */ + KETelMobileSmsEntryV1=KETelExtMultimodeV1, + /** The iExtensionId contents indicate that the packaged class is a TMobileGsmSmsEntryV1. + + Also used to indicate that GSM SMS entries will be retrieved by CRetrieveMobilePhoneSmsList. */ + KETelMobileGsmSmsEntryV1, + /** The iExtensionId contents indicate that the packaged class is a TMobileCdmaSmsEntryV1. + + Also used to indicate that CDMA SMS entries will be retrieved by CRetrieveMobilePhoneSmsList. */ + KETelMobileCdmaSmsEntryV1 + }; + + class TMobileSmsEntryV1 : public RMobilePhoneStore::TMobilePhoneStoreEntryV1 + /** Defines contents of a fixed-size, stored SMS entry. + @publishedPartner + @released + */ + { + public: + void InternalizeL(RReadStream& aStream); + void ExternalizeL(RWriteStream& aStream) const; + protected: + TMobileSmsEntryV1(); + public: + /** The status of the stored message. + + Modes: Common + + @see TMobileSmsStoreStatus */ + TMobileSmsStoreStatus iMsgStatus; + }; + +/** A typedef'd packaged TMobileSmsEntryV1 for passing through a generic API +member function. */ + typedef TPckg TMobileSmsEntryV1Pckg; + + class TMobileGsmSmsEntryV1 : public TMobileSmsEntryV1 +/** Defines contents of a fixed-size, stored GSM SMS entry. +@publishedPartner +@released */ + { + public: + void InternalizeL(RReadStream& aStream); + void ExternalizeL(RWriteStream& aStream) const; + public: + IMPORT_C TMobileGsmSmsEntryV1(); + public: + /** The service centre to use (or used) for the message. + + Modes: GSM/WCDMA + + @see RMobilePhone::TMobileAddress */ + RMobilePhone::TMobileAddress iServiceCentre; + /** The GSM 03.40 TPDU. + + Modes: GSM/WCDMA + + @see RMobileSmsMessaging::TMobileSmsGsmTpdu */ + RMobileSmsMessaging::TMobileSmsGsmTpdu iMsgData; + }; + +/** A typedef'd packaged TMobileGsmSmsEntryV1 for passing through a generic API +member function. */ + typedef TPckg TMobileGsmSmsEntryV1Pckg; + + class TMobileCdmaSmsEntryV1 : public TMobileSmsEntryV1 + /** Defines contents of a fixed-size, stored CDMA SMS entry. + @publishedPartner + @released + */ + { + public: + void InternalizeL(RReadStream& aStream); + void ExternalizeL(RWriteStream& aStream) const; + public: + IMPORT_C TMobileCdmaSmsEntryV1(); + public: + /** The teleservice identifier of the stored message. + + Modes: CDMA */ + TInt iTeleservice; + /** The service category of the stored message. + + Modes: CDMA */ + TInt iServiceCategory; + /** The remote party (destination or originator) of the stored message. + + Modes: CDMA + + @see RMobilePhone::TMobileAddress */ + RMobilePhone::TMobileAddress iRemoteParty; + /** The teleservice layer bearer data of the stored message. + + Modes: CDMA + + @see RMobileSmsMessaging::TMobileSmsCdmaTpdu */ + RMobileSmsMessaging::TMobileSmsCdmaTpdu iMsgData; + }; + +/** A typedef'd packaged TMobileCdmaSmsEntryV1 for passing through a generic API +member function. */ + typedef TPckg TMobileCdmaSmsEntryV1Pckg; + +protected: + IMPORT_C void ConstructL(); +private: + RMobileSmsStore(const RMobileSmsStore&); + }; + +/*********************************************************/ +// +// NAM Storage (RMobileNamStore) +// +/*********************************************************/ + + + +class CNamStorePtrHolder; +class CMobilePhoneNamList; +class CMobilePhoneNamListV4; + +class RMobileNamStore : public RMobilePhoneStore +/** +Provides client access to NAM storage functionality provided by TSY + +*/ + { +public: + IMPORT_C RMobileNamStore(); + IMPORT_C TInt Open(RMobilePhone& aPhone); + IMPORT_C void Close(); + + + + class TMobileNamStoreInfoV1 : public RMobilePhoneStore::TMobilePhoneStoreInfoV1 + /** + Defines information about a NAM store + + @publishedPartner + @released + */ + { + public: + IMPORT_C TMobileNamStoreInfoV1(); + public: + /** The number of enabled NAMs within the NAM store. + + Modes: CDMA */ + TInt iNamCount; + /** The index of the NAM that is currently the active NAM, will be between 0 and + iNamCount-1. + + Modes: CDMA */ + TInt iActiveNam; + }; + +/** A typedef'd packaged TMobileNamStoreInfoV1 for passing through a generic API +member function. */ + typedef TPckg TMobileNamStoreInfoV1Pckg; + + IMPORT_C void SetActiveNam(TRequestStatus& aReqStatus, TInt aNamId) const; + + enum + { + /* The original maximum NAM parameter size for a TMobileNamEntryV1 */ + KMaxNamParamSize = 64, + /* Updated maximum NAM parameter size for TMobileNamEntryV4 */ + KMaxNamParamSizeV4 = 256 + }; + + class TMobileNamEntryV1 : public RMobilePhoneStore::TMobilePhoneStoreEntryV1 + /** + Defines contents of a NAM store entry + + @publishedPartner + @released + */ + { + public: + IMPORT_C TMobileNamEntryV1(); + public: + void InternalizeL(RReadStream& aStream); + void ExternalizeL(RWriteStream& aStream) const; + public: + /** The NAM that is to be accessed, will be between 0 and TMobileNamStoreInfoV1::iNamCount-1. + + Modes: CDMA */ + TInt iNamId; + /** The identifier of the NAM parameter to be accessed. + + TSY must define values of parameter identifiers. + + Modes: CDMA */ + TInt iParamIdentifier; + /** The data contents of the selected parameter. + + Modes: CDMA + + @see KMaxNamParamSize */ + TBuf8 iData; + }; + + /** A typedef'd packaged TMobileNamEntryV1 for passing through a generic API member + function. */ + typedef TPckg TMobileNamEntryV1Pckg; + + /** Enumeration for the standard NAM parameters (see 3GPP2 C.S0005-A appendix F.3) + Modes: CDMA */ + enum TStandardNamParameters + { + /** The 64-bit pattern stored in the Mobile Station and + Home Location Register/Authentication Centre used to generate/update the + mobile station’s Shared Secret Data + Corresponds to NAM Indicator 'A_KEY' */ + EAKey, + /** 64-bit key used for authentication + Corresponds to NAM Indicator 'SSD_A(s-p)' */ + ESharedSecretDataA, + /** 64-bit key used as input to generate encryption mask and long code + Corresponds to NAM Indicator 'SSD_B(s-p)' */ + ESharedSecretDataB, + /** Modulo-64 event counter maintained by the mobile station and Authentication Center + used for clone detection + Corresponds to NAM Indicator 'COUNT(s-p)' */ + EParameterUpdateReceivedCount, + /** Class of the International Mobile Station Identity (IMSI) containing a MIN as + the lower 10 digits + Corresponds to NAM Indicator 'IMSI_M_CLASS(p)' */ + EMinBasedImsiClass, + /** The class of the International Mobile Station Identity (IMSI) not containing a MIN as + the lower 10 digits + Corresponds to NAM Indicator 'IMSI_T_CLASS(p)' */ + ETrueImsiClass, + /** 34-bit number derived from the IMSI M used as input for authentication + Corresponds to NAM Indicator 'IMSI_M_S(p)' */ + EMinBasedImsiS, + /** 34-bit number derived from the IMSI T used as input for authentication + Corresponds to NAM Indicator 'IMSI_T_S(p)' */ + ETrueImsiS, + /** Number of digits in the IMSI M minus 4 + Corresponds to NAM Indicator 'IMSI_M_ADDR_NUM(p)' */ + EMinBasedImsiAddressNum, + /** The number of digits in the IMSI T minus 4 + Corresponds to NAM Indicator 'IMSI_T_ADDR_NUM(p)' */ + ETrueImsiAddressNum, + /** The 11th and 12th digits in the IMSI M + Corresponds to NAM Indicator 'IMSI_M_11_12(p)' */ + EMinBasedImsiDigits11and12, + /** The 11th and 12th digits in the IMSI T + Corresponds to NAM Indicator 'IMSI_T_11_12(p)' */ + ETrueImsiDigits11and12, + /** The country code for the IMSI M + Corresponds to NAM Indicator 'MCC_M(p)' */ + EMinBasedMobileCountryCode, + /** The country code for the IMSI T + Corresponds to NAM Indicator 'MCC_T(p)' */ + ETrueMobileCountryCode, + /** Up to 15 digit dialable number associated with the mobile station through a service + subscription + Corresponds to NAM Indicator 'MDN(p)' */ + EMobileDirectoryNumber, + /** 4-bit number giving the length of the assigning Temporary Mobile Station Identity (TMSI) zone + (can range from 1 to 8 octets) + Corresponds to NAM Indicator 'ASSIGNING_TMSI_ZONE_LEN(s-p)' */ + EAssigningTmsiZoneLen, + /** Temporary Mobile Station Identity (TMSI) zone is an arbitrary set of base stations + for the administrative assignment of TMSI + Corresponds to NAM Indicator 'ASSIGNING_TMSI_ZONE(s-p)' */ + EAssigningTmsiZone, + /** The uniquely assigned number to a mobile station inside a TMSI zone + Corresponds to NAM Indicator 'TMSI_CODE(s-p)' */ + ETmsiCode, + /** The expiration time used to automatically delete the assigned TMSI + Corresponds to NAM Indicator 'TMSI_EXP_TIME(s-p)' */ + ETmsiExpTime, + /** Mobile station's home System Id for 800MHz analog operation + Corresponds to NAM Indicator 'HOME_SID(p)' */ + EHomeSystemIdAnalog, + /** Mobile station's home System Id + Corresponds to NAM Indicator 'SID(p)' */ + EHomeSystemId, + /** Mobile station's home Network Id + Corresponds to NAM Indicator 'NID(p)' */ + EHomeNetworkId, + /** Mobile station is configured to receive mobile station terminated calls when + using a home (SID, NID) pair + Corresponds to NAM Indicator 'MOB_TERM_HOME(p)' */ + EReceiveCallsHome, + /** The mobile station is configured to receive mobile station terminated calls when + it is a foreign SID roamer + Corresponds to NAM Indicator 'MOB_TERM_FOR_SID(p)' */ + EReceiveCallsForeignSystem, + /** The mobile station is configured to receive mobile station terminated calls when + it is a foreign NID roamer + Corresponds to NAM Indicator 'MOB_TERM_FOR_NID(p)' */ + EReceiveCallsForeignNetwork, + /** A TSY may use this as the first TSY-defined non-standard NAM parameter */ + ENumStandardNamParameters + }; + + class TMobileNamEntryV4 : public RMobilePhoneStore::TMobilePhoneStoreEntryV1 + /** + Defines contents of a NAM store entry + + The differences between the original TMobileNamEntryV1, and updated TMobileNamEntryV4 are: + - the maximum mobile NAM parameter size is KMaxNamParamSize(64) for TMobileNamEntryV1 + and KMaxNamParamSizeV4(256) for TMobileNamEntryV4 + - TMobileNamEntryV4 defines a set of standard NAM parameters for the iParamIdentifier as + described in 3GPP2 C.S0005-A appendix F.3 + + @publishedPartner + @released + */ + { + public: + IMPORT_C TMobileNamEntryV4(); + public: + void InternalizeL(RReadStream& aStream); + void ExternalizeL(RWriteStream& aStream) const; + public: + /** The NAM that is to be accessed, will be between 0 and TMobileNamStoreInfo::iNamCount-1. + + Modes: CDMA */ + TInt iNamId; + + /** The identifier of the NAM parameter to be accessed. + iParamIdentifier will be a TStandardNamParameters value if a standard NAM parameter is being accessed, + however a TSY may support and define NAM parameters in addition to those given by TStandardNamParameters + Modes: CDMA */ + TInt iParamIdentifier; + + /** The data contents of the selected parameter. + + Modes: CDMA + + @see KMaxNamParamSizeV4 */ + TBuf8 iData; + }; + + /** A typedef'd packaged TMobileNamEntryV4 for passing through a generic API member + function. */ + typedef TPckg TMobileNamEntryV4Pckg; + + IMPORT_C void StoreAllL(TRequestStatus& aReqStatus, TInt aNamId, CMobilePhoneNamList* aNamList) const; + IMPORT_C void StoreAllL(TRequestStatus& aReqStatus, TInt aNamId, CMobilePhoneNamListV4* aNamList) const; + +protected: + IMPORT_C void ConstructL(); +private: + RMobileNamStore(const RMobileNamStore&); + }; + + +/*********************************************************/ +// +// Own Number Storage (RMobileONStore) +// +/*********************************************************/ + + + +class CONStorePtrHolder; +class CMobilePhoneONList; + +class RMobileONStore : public RMobilePhoneStore +/** +Provides client access to Own Number storage functionality provided by TSY + +*/ + { +public: + IMPORT_C RMobileONStore(); + IMPORT_C TInt Open(RMobilePhone& aPhone); + IMPORT_C void Close(); + + + + class TMobileONStoreInfoV1 : public RMobilePhoneStore::TMobilePhoneStoreInfoV1 + /** + Defines information about an Own Number store + + @publishedPartner + @released + */ + { + public: + IMPORT_C TMobileONStoreInfoV1(); + public: + /** The maximum length of the own phone number can be. */ + TInt iNumberLen; + /** The maximum length the text field can be. */ + TInt iTextLen; + }; + +/** A typedef'd packaged TMobileONStoreInfoV1 for passing through a generic API +member function. */ + typedef TPckg TMobileONStoreInfoV1Pckg; + + enum + { + KOwnNumberTextSize = 20 + }; + + + + class TMobileONEntryV1 : public RMobilePhoneStore::TMobilePhoneStoreEntryV1 + /** + Defines contents of a Own Number store entry + + @publishedPartner + @released + */ + { + public: + IMPORT_C TMobileONEntryV1(); + public: + void InternalizeL(RReadStream& aStream); + void ExternalizeL(RWriteStream& aStream) const; + public: + /** Network mode. */ + RMobilePhone::TMobilePhoneNetworkMode iMode; + /** Mobile call service type. + + @see RMobilePhone::TMobileService */ + RMobilePhone::TMobileService iService; + /** Own number. + + @see RMobilePhone::TMobileAddress */ + RMobilePhone::TMobileAddress iNumber; + /** The name-tag associated with own number (e.g. "Voice Number"). */ + TBuf iText; + }; + +/** A typedef'd packaged TMobileONEntryV1 for passing through a generic API member +function. */ + typedef TPckg TMobileONEntryV1Pckg; + + IMPORT_C void StoreAllL(TRequestStatus& aReqStatus, CMobilePhoneONList* aONList) const; + +protected: + IMPORT_C void ConstructL(); +private: + RMobileONStore(const RMobileONStore&); + }; + +/*********************************************************/ +// +// Emergency Number Storage (RMobileENStore) +// +/*********************************************************/ + + + +class CMobilePhoneENList; + +class RMobileENStore : public RMobilePhoneStore +/** +Provides client access to Emergency Number storage functionality provided by TSY + +*/ + { +public: + IMPORT_C RMobileENStore(); + IMPORT_C TInt Open(RMobilePhone& aPhone); + IMPORT_C void Close(); + + enum + { + KEmergencyNumberSize = 6, + KEmergencyAlphaTagSize = 20 + }; + +/** Enumerated list of Emergency Number entries. + +Mode: WCDMA */ + enum TMobilePhoneENServiceCategory + { + /** This number provides emergency care by the police department. */ + KServiceCatPolice =0x0001, + /** This number provides emergency care by the ambulance department. */ + KServiceCatAmbulance =0x0002, + /** This number provides emergency care by the fire brigade department. */ + KServiceCatFireBrigade =0x0004, + /** This number provides emergency care by the marine guard department. */ + KServiceCatMarineGuard =0x0008, + /** This number provides emergency care by the mountain rescue department. */ + KServiceCatMountainRescue =0x0010 + // Reserved types: 0x0020,0x0040, + }; + + + +/** Buffer to hold the emergency number in. */ + typedef TBuf TEmergencyNumber; + + class TMobileENEntryV1 : public RMobilePhoneStore::TMobilePhoneStoreEntryV1 + /** + Defines contents of a Emergency Number store entry + @publishedPartner + @released + */ + { + public: + IMPORT_C TMobileENEntryV1(); + public: + void InternalizeL(RReadStream& aStream); + void ExternalizeL(RWriteStream& aStream) const; + public: + /** Indicates whether the emergency number is applicable in all situations (=EFalse) + or only when the MS is registered to a specific GSM or CDMA network (=ETrue). */ + TBool iNetworkSpecific; + /** The network mode. Only applicable if iNetworkSpecific equals ETrue. + + Modes: Common + + @see RMobilePhone::TMobilePhoneNetworkMode */ + RMobilePhone::TMobilePhoneNetworkMode iMode; + /** Country code. Only applicable if iNetworkSpecific equals ETrue. + + Modes: Common + + @see RMobilePhone::TMobilePhoneNetworkCountryCode */ + RMobilePhone::TMobilePhoneNetworkCountryCode iCountryCode; + /** Network identity. Only applicable if iNetworkSpecific equals ETrue. + + Modes: Common + + @see RMobilePhone::TMobilePhoneNetworkIdentity */ + RMobilePhone::TMobilePhoneNetworkIdentity iIdentity; + /** Emergency number. + + Modes: Common + + @see TEmergencyNumber */ + TEmergencyNumber iNumber; + /** Emergency call number type. It is used to display information about the dialed + emergency number (e.g. "Police", "Ambulance", "Fire brigade", etc.) + + Modes: WCDMA */ + TBuf iAlphaId; + //TInt should map to TMobilePhoneENServiceCategory. + //It was not changed to maintain source compatibility + + /** Emergency call type indicator, which contains information to be sent to the + network indicating the type of emergency call. + + The field is for future reference only and it is set to RFU (Reserved for + Future Use) as it is currently not being used, as specified in section 4.2.21 + TS 31.102 v3.3.0 Rel 99. + + Modes: WCDMA */ + TInt iCallType; + }; + + typedef TPckg TMobileENEntryV1Pckg; + +protected: + IMPORT_C void ConstructL(); +private: + RMobileENStore(const RMobileENStore&); + }; + + +/*********************************************************/ +// +// RMobilePhoneBookStore +// +/*********************************************************/ + + + +class CPhoneBookStorePtrHolder; +class CMobilePhoneBookList; + +class RMobilePhoneBookStore : public RMobilePhoneStore +/** Provides member functions for clients to access phone +books that are stored in ICC memory or in non-volatile memory on the phone +itself. This sub-session and the member functions within this section must +be supported if the TSY indicates that it supports the MobilePhonebookStore +functional unit. +@publishedPartner +@released +*/ + { +public: + IMPORT_C RMobilePhoneBookStore(); + IMPORT_C TInt Open(RMobilePhone& aPhone, const TDesC& aStore); + IMPORT_C TInt Open(RMobilePhone& aPhone, const TDesC& aStore, const TDesC& aMode); + IMPORT_C void Close(); + +/** Describes the specialized phone book capabilities. + +Modes: Common */ + enum TMobilePhoneBookCaps + { + /** New entries can only be written to (or deleted from) the phone book with the + PIN2 password or equivalent. + + Modes: Common */ + KCapsRestrictedWriteAccess = 0x00000001, + /** The phonebook supports the second name field. + + Modes: WCDMA */ + KCapsSecondNameUsed = 0x00000002, + /** The phonebook supports the additional number (with optional Text, TON, NPI + and Bearer Capability) field. + + Modes: WCDMA */ + KCapsAdditionalNumUsed = 0x00000004, + /** The phonebook supports the group name field. + + Modes: WCDMA */ + KCapsGroupingUsed = 0x00000008, + /** The phonebook supports entry control and hidden flag fields. + + Modes: WCDMA */ + KCapsEntryControlUsed = 0x00000010, + /** The phonebook supports the email address field. + + Modes: WCDMA */ + KCapsEmailAddressUsed = 0x00000020, + /** The phonebook supports the bearer capability IE field. + + Modes: WCDMA */ + KCapsBearerCapUsed = 0x00000040, + /** The phonebook supports retrieval of the phonebook's PBID and Change Counter + - and for each entry its UID field. + + Modes: WCDMA */ + KCapsSynchronisationUsed = 0x00000080 + }; + +/** Described the location of the phone book. + +Modes: Common for all */ + enum TMobilePhoneBookLocation + { + /** The phonebook's location is unknown. */ + ELocationUnknown, + /** The phonebook is located in ICC (SIM/R-UIM) memory. */ + ELocationIccMemory, + /** The phonebook is located in Phone (ME) memory. */ + ELocationPhoneMemory, + /** The phonebook is located in an external memory. */ + ELocationExternalMemory, + /** The phonebook entries are dispersed over a combination of memory locations. */ + ELocationCombinedMemory + }; + + enum + { + KMaxPBIDSize=15 + }; + +/** Defines a modifiable buffer descriptor to contain the phone book identity. +Used in TMobilePhoneBookInfoV1. */ + typedef TBuf8 TMobilePhoneBookIdentity; + + + + class TMobilePhoneBookInfoV1 : public RMobilePhoneStore::TMobilePhoneStoreInfoV1 + /** + Defines information about a Phonebook store. + @publishedPartner + @released + */ + { + public: + /** Trivial constructor. Initializes iMaxNumLength=-1; iMaxTextLength=-1; iLocation=ELocationUnknown; + iChangeCounter=0; iExtensionId=KETelMobilePhonebookStoreV1; */ + IMPORT_C TMobilePhoneBookInfoV1(); + public: + /** The maximum number of characters for the number in a phonebook entry. + + Modes: Common */ + TInt iMaxNumLength; + /** The maximum number of characters for the text tag in a phonebook entry. + + Modes: Common */ + TInt iMaxTextLength; + /** The memory location of this phonebook. + + Modes: Common + + @see TMobilePhoneBookLocation */ + TMobilePhoneBookLocation iLocation; + /** The contents of the Change Counter file in a USIM phonebook. + + Modes: WCDMA */ + TUint16 iChangeCounter; + /** A unique identity for this type of phonebook. + + If this is a SIM or R-UIM phonebook then it will equal the ICCID of the card. + + If this is a USIM phonebook then it will equal the PBID of the phonebook. + + Modes: Common + + @see TMobilePhoneBookIdentity */ + TMobilePhoneBookIdentity iIdentity; + }; + +/** Packages the TMobilePhoneBookInfoV1 into a TMobilePhoneBookInfoV1Pckg. */ + typedef TPckg TMobilePhoneBookInfoV1Pckg; + + + class TMobilePhoneBookInfoV2 : public TMobilePhoneBookInfoV1 +/** Defines information about a Phonebook store for version v2.0 of the API. +@publishedPartner +@released */ + { + public: + IMPORT_C TMobilePhoneBookInfoV2(); + public: + /** The type of the phonebook which relates to its location (ICC/UICC/CDMA). + + Mode: Common */ + TName iPhBkMode; + }; + +/** Packages the TMobilePhoneBookInfoV2 into a TMobilePhoneBookInfoV1Pckg. */ + typedef TPckg TMobilePhoneBookInfoV2Pckg; + + + /** Defines information about a Phonebook store for version v5.0 of the API. + + Extends the v2.0 API to allow additional information about the phonebook + (Maximum number of second name fields, Maximum number of additional number fields, + Maximum number of additional group name fields, Maximum number of email address fields) + to be retieved where available. + + @publishedPartner + @released*/ + class TMobilePhoneBookInfoV5 : public TMobilePhoneBookInfoV2 + { + public: + IMPORT_C TMobilePhoneBookInfoV5(); + public: + /** The maximum number of Second Name fields that can be used. */ + TInt iMaxSecondNames; + + /** The maximum text length for Second Name fields. */ + TInt iMaxTextLengthSecondName; + + /** The maximum number of additional number fields that can be used. */ + TInt iMaxAdditionalNumbers; + + /** The maximum number length for Additional Number fields. */ + TInt iMaxNumLengthAdditionalNumber; + + /** The maximum text length for Additonal Number fields. */ + TInt iMaxTextLengthAdditionalNumber; + + /** The maximum number of additional Group Name fields that can be used. */ + TInt iMaxGroupNames; + + /** The maximum text length for Group Name fields. */ + TInt iMaxTextLengthGroupName; + + /** The maximum number of additional E-Mail address fields that can be used. */ + TInt iMaxEmailAddr; + + /** The maximum text length for Email Address fields. */ + TInt iMaxTextLengthEmailAddr; + }; + + /** Packages the TMobilePhoneBookInfoV5 into a TMobilePhoneBookInfoV5Pckg. */ + typedef TPckg TMobilePhoneBookInfoV5Pckg; + + + // check these fields - not sure all are correct +/** The following Tag IDs are used to encode/decode the phonebook entries to/from +the TLV format. Each field will have a unique identifier and will be followed +by the field length. The type of data associated with the field is also specified +below. + +Some fields do not have any data and just serve as separators within the buffer +- in these cases the Data Type column is set to not applicable (n/a). + +Modes: Common */ + enum TMobilePBFieldTags + { + /** Tag id for the beginning of a new phonebook entry. + + Data type: n/a. + + Modes: Common */ + ETagPBNewEntry =0xA0, + /** Tag id for the Unique ID field. + + Data type: TUint16 + + Modes: WCDMA */ + ETagPBUniqueId =0xB0, + /** Tag id for the Index within the ADN record. + + Data type: TUint16 + + Modes: Common */ + ETagPBAdnIndex =0xC0, + /** Tag id for a Text field within the ADN/ANR record. + + Data type: TDes16 + + Modes: Common */ + ETagPBText =0xC1, + /** Tag id for a Number field within the ADN/ANR record. + + Data type: TDes16 + + Modes: Common */ + ETagPBNumber =0xC2, + /** Tag id for a TON/NPI byte within the ADN/ANR record. + + Data type: TUint8 + + Modes: Common */ + ETagPBTonNpi =0xC3, + /** Tag id for a Bearer Capability IE associated to the ADN/ANR record. + + Data type: TDes8 + + Modes: GSM/WCDMA */ + ETagPBBearerCap =0xC4, + /** Tag id for the beginning of an Additional Number entry within the phonebook + entry. + + Data type: n/a + + Modes: WCDMA */ + ETagPBAnrStart =0xC5, + /** Tag id for the Second Name associated to the ADN record. + + Data type: TDes16 + + Modes: WCDMA */ + ETagPBSecondName =0xC6, + /** Tag id for a Group Name associated to the ADN record. + + Data type:TDes16 + + Modes: WCDMA */ + ETagPBGroupName =0xC7, + /** Tag id for an Email Address associated to the ADN record. + + Data type: TDes16 + + Modes: WCDMA */ + ETagPBEmailAddress =0xC8, + /** Tag id for the Entry Control byte associated to the ADN record. + + Data type: TUint8 + + Modes: WCDMA */ + ETagPBEntryControl =0xC9, + /** Tag id for the Hidden Information byte associated to the ADN record. + + Data type: TUint8 + + Modes: WCDMA */ + ETagPBHiddenInfo =0xCA, + ETagPBDateTime =0xCB, + ETagPBDuration =0xCC, + ETagPBCallStatus =0xCD, + ETagPBEntryStatus =0xCE + }; + + + // API/TSY internal type + struct TPBIndexAndNumEntries +/** A structure to hold the phone book index and number of entries. */ + { + /** Index for the phone book. */ + TInt iIndex; + TInt iNumSlots; + }; + + IMPORT_C void Read(TRequestStatus& aReqStatus, TInt aIndex, TInt aNumSlots, TDes8& aPBData) const; + IMPORT_C void Write(TRequestStatus& aReqStatus, const TDesC8& aPBData, TInt& aIndex) const; + +protected: + IMPORT_C void ConstructL(); +private: + RMobilePhoneBookStore(const RMobilePhoneBookStore&); + }; + +/*********************************************************/ +// +// RMobileConferenceCall +// +/*********************************************************/ + + + +class CMobileConferenceCallPtrHolder; + +class RMobileConferenceCall : public RTelSubSessionBase +/** Provides access to conference call functionality provided by TSY. + +Conference calls allow users to conduct multi-connection voice calls, for example +simultaneous communication to more than one remote party. All participants +within a conference call can hear and speak to each other. There is a controlling +party that initiates and manages the conference. + +Conference calling is possible in both GSM and CDMA mode and the actions to +initiate a 3-way conference are the same in either mode. However, GSM conference +calls offer more functionality and the number of remote parties is limited +in CDMA mode to 2 and in GSM mode to 5. + +The Multimode ETel API uses a new sub-session called RMobileConferenceCall +as a model for a conference call. The conference call object will be an aggregation +of all the RMobileCall objects that are part of the conference call. It will +be possible for clients to manipulate both the conference call as a whole +and individual calls within a conference call depending on the dynamic capabilities +of each of these objects. + +Please note that RMobileConferenceCall is replacing the RCallGroup abstraction +used in the GSM API. This was an optimisation decision. The call group abstraction +placed a large burden on a TSY to create call groups, monitor the calls in +each group and trigger notification when calls were added or moved, probably +even when a conference call was not ongoing. Clients will probably only open +a RMobileConferenceCall when the user has decided to make a conference call +and by having just one object replace three call groups it will also reduce +the number of notifications that would trigger in response to conference call +events. With a view to the future, without call groups there are also no longer +any restrictions to the allowed types of active calls (simultaneous, separate +voice and data calls are possible). + +The methods within this section must be supported if the TSY supports MobileConferenceCall +functional unit. + +*/ + { +public: + IMPORT_C RMobileConferenceCall(); + IMPORT_C TInt Open(RMobilePhone& aPhone); + IMPORT_C void Close(); + +/** Conference call capabilities. */ + enum TMobileConferenceCallCaps + { + /** Indicates that a conference call can be created. */ + KCapsCreate = 0x00000001, + /** Indicates that a conference call can be terminated. */ + KCapsHangUp = 0x00000002, + /** Indicates that a conference call exists and can be swapped to the opposite + state (active or hold). */ + KCapsSwap = 0x00000004 + }; + + IMPORT_C TInt GetCaps(TUint32& aCaps) const; + IMPORT_C void NotifyCapsChange(TRequestStatus& aReqStatus, TUint32& aCaps) const; + + IMPORT_C void CreateConference(TRequestStatus& aReqStatus) const; + IMPORT_C void AddCall(TRequestStatus& aReqStatus, const TName& aCallName) const; + IMPORT_C void Swap(TRequestStatus& aReqStatus) const; + IMPORT_C void HangUp(TRequestStatus& aReqStatus) const; + IMPORT_C TInt EnumerateCalls(TInt& aCount) const; + IMPORT_C TInt GetMobileCallInfo(TInt aIndex, TDes8& aCallInfo) const; + +/** Conference call status. */ + enum TMobileConferenceStatus + { + /** The conference call is in the idle state. */ + EConferenceIdle, + /** The conference call is in the active, connected state. */ + EConferenceActive, + /** The conference call is in the held, connected state. */ + EConferenceHold + }; + + IMPORT_C TInt GetConferenceStatus(TMobileConferenceStatus& aStatus) const; + IMPORT_C void NotifyConferenceStatusChange(TRequestStatus& aReqStatus, TMobileConferenceStatus& aStatus) const; + +/** Conference events. */ + enum TMobileConferenceEvent + { + /** A call has been added to the conference. */ + EConferenceCallAdded, // Name of the call added returned in aCallName + /** A call has been removed from the conference. */ + EConferenceCallRemoved, // Name of the call terminated returned in aCallName + /** Names of the two calls used to build the conference call returned in aCallName. */ + EConferenceBuilt, // Names of the two calls used to build the conference call returned in aCallName + /** No name provided */ + EConferenceTerminated, // No name provided + /** No name provided. */ + EConferenceSwapped, // No name provided + /** Name of the call being seperated. */ + EConferenceSplit // Name of the call being seperated + }; + + IMPORT_C void NotifyConferenceEvent(TRequestStatus& aReqStatus, TMobileConferenceEvent& aEvent, TName& aCallName) const; + +private: + CMobileConferenceCallPtrHolder* iMmPtrHolder; + RMobileConferenceCall(const RMobileConferenceCall&); +protected: + IMPORT_C void ConstructL(); + IMPORT_C void Destruct(); + }; + + +///////////////////////////////////////////////////////////////////////////////////// +// +// EAP-SIM Authentication functional unit +// +///////////////////////////////////////////////////////////////////////////////////// + +class CMobileSmartCardEapPtrHolder; + +/** +This sub-session opens under RMobilePhone. + +RMobileSmartCardEap provides the client with access to a Smart Card +Application's EAP-capability (if one exists). + +(See ETSI TS 102.310 v6.2.0 and RFC3748) + +To submit authentication challenges or requests, a client must use +CAsyncSmartCardEapAuthentication in conjunction with this sub-session. + +@see CAsyncSmartCardEapAuthentication +@publishedPartner +@prototype +*/ +class RMobileSmartCardEap : public RTelSubSessionBase + { + friend class CAsyncSmartCardEapAuthentication; + +public: + /** + Class encapsulates EAP request packet data for authentication. + + @see CAsyncSmartCardEapAuthentication + + @publishedPartner + @prototype + */ + class CEapAuthenticateRequestDataV6 : public CBase + { + public: + IMPORT_C static CEapAuthenticateRequestDataV6* NewL(); + IMPORT_C virtual void ExternalizeL(TPtr8& aBuffer); + IMPORT_C virtual void InternalizeL(const TDesC8& aBuffer); + IMPORT_C TUint VersionId() const; + IMPORT_C TPtr8 GetEapReqPacket() const; + IMPORT_C void SetEapReqPacketL(const TDesC8& aData); + IMPORT_C ~CEapAuthenticateRequestDataV6(); + + private: + CEapAuthenticateRequestDataV6(); + void ConstructL(); + + protected: + /** + ETelMM's supported version. + */ + TUint iVersionId; + + public: + /** + EAP-request packet in a flat buffer. + */ + CBufFlat* iEapReqPacket; + }; + + IMPORT_C RMobileSmartCardEap(); + + /** + EAP types are represented by one byte for standard EAP methods, and + eight bytes for extended methods. Each byte specified in the + TEapType buffer should represent one semi-octet. Therefore, a + maximum of 16-chars are needed for representing any possible EAP + type. (See section 5.2 of ETSI TS 102.310 v6.2.0.) + + @see RMobileSmartCardEap::TEapType + + @publishedPartner + @prototype + */ + enum { KEapTypeSize = 16 }; + + /** + A typedef'd buffer to hold the EAP type for the subsequent + authentication that will be carried out on the Smart Card + Application. + + The value specified must correspond to the pre-allocated type + identifiers for various EAPs (see + http://www.iana.org/assignments/eap-numbers). Some known values + are given in etelmm.h. + + The type must be specified in hexadecimal format, where each + character represents one semi-octet. + + @see KETelSmartCardEapTypeMD5 + @see KETelSmartCardEapTypeTLS + @see KETelSmartCardEapTypeSIM + @see KETelSmartCardEapTypeAKA + @see KETelSmartCardEapTypeTTLS + @see RMobileSmartCardEap::Open() + + @publishedPartner + @prototype + */ + typedef TBuf8 TEapType; + + IMPORT_C TInt Open(RMobilePhone& aPhone, const RMobilePhone::TAID& aAID, const TEapType& aEapType); + IMPORT_C void InitialiseEapMethod(TRequestStatus& aReqStatus); + IMPORT_C void Close(); + + /** + Authentication status of the EAP supporting UICC application (See + section 7.2 of ETSI TS 102.310 v6.2.0). One of these values is + returned on completion of an + RMobileSmartCardEap::GetAuthenticationStatus() request. + + @see RMobileSmartCardEap::GetAuthenticationStatus() + + @publishedPartner + @prototype + */ + enum TEapAuthStatus + { + /** + No authentication started + */ + ENoAuthStarted, // 0 + /** + Authenticating + */ + EAuthenticating, // 1 + /** + Authentication complete + */ + EAuthenticated, // 2 + /** + Held (authentication failure) + */ + EHeld // 3 + }; + + IMPORT_C void GetAuthenticationStatus(TRequestStatus& aReqStatus, TEapAuthStatus& aAuthStatus); + + /** + TEapUserIdType should be used to request an identity from EF_PUId + or EF_Ps, when making an RMobileSmartCardEap::GetUserIdentity() + request. + (See sections 7.3 and 7.4, respectively, of ETSI TS 102.310 v6.2.0, + and RFC2486 - The Network Access Identifier). + + @see RMobileSmartCardEap::GetUserIdentity() + @see RMobileSmartCardEap::TEapUserIdentityV6 + + @publishedPartner + @prototype + */ + enum TEapUserIdType + { + /** Identity is permanent type */ + EPermanentIdentity, // 0 + /** Identity is pseudonym type */ + EPseudonymIdentity // 1 + }; + + /** + Maximum permitted size of identity data. + */ + enum { KEapIdentityMaxSize = 255 }; + + /** + EAP User Identity data. Ids are stored in EF_PUId or EF_Ps + (specified in sections 7.3 and 7.4, respectively, of ETSI TS + 102.310 v6.2.0). + + @see RMobileSmartCardEap::GetUserIdentity() + + @publishedPartner + @prototype + */ + class TEapUserIdentityV6 : public RMobilePhone::TMultimodeType + { + public: + IMPORT_C TEapUserIdentityV6(); + public: + /** + EAP-IDENTITY Data. + */ + TBuf8 iEapId; + }; + + /** + A typedef'd packaged TEapUserIdentityV6 for passing through a + generic API method. + + @publishedPartner + @prototype + */ + typedef TPckg TEapUserIdentityV6Pckg; + + IMPORT_C void GetUserIdentity(TRequestStatus& aReqStatus, + TEapUserIdType aRequestedIdType, + TDes8& aUserId); + + /** + TEapKeyV6 should be used to request one of (currently) two keys + available on the EF_EAPKEYS of the UICC application (see section + 7.1 of ETSI TS 102.310 v6.2.0). This enumeration type should be + used in RMobileSmartCardEap::GetEapKey() to specify the key to be + retrieved. + + @see RMobileSmartCardEap::TEapKeyV6 + @see RMobileSmartCardEap::GetEapKey() + + @publishedPartner + @prototype + */ + enum TEapKeyTag + { + /** + Used to request Master Session Key. + */ + EEapKeyMSK = 0x80, + /** + Used to request Extended Master Session Key. + */ + EEapKeyEMSK = 0x81 + }; + + /** + Maximum size of an EAP Key stored on the DF_EAP's EF_EAPKEYS. + 255 as each key has a length that can be specified by exactly one + byte (see section 7.1 of ETSI TS 102.310 v6.2.0). + + @publishedPartner + @prototype + */ + enum { KEapKeyMaxSize = 255 }; + + /** + EAP authentication key data. + + @see RMobileSmartCardEap::GetEapKey() + + @publishedPartner + @prototype + */ + class TEapKeyV6 : public RMobilePhone::TMultimodeType + { + public: + IMPORT_C TEapKeyV6(); + public: + /** + EAP-KEY Data. + */ + TBuf8 iEapKey; + }; + + /** + A typedef'd packaged TEapKeyV6 for passing through a generic API + method. + + @publishedPartner + @prototype + */ + typedef TPckg TEapKeyV6Pckg; + + IMPORT_C void GetEapKey(TRequestStatus& aReqStatus, const TEapKeyTag aRequestedKey, TDes8& aKey); + + /** + Status of the DF_EAP this subsession refers to. The status is + basically an indication of whether the DF is in use by another sub- + session client instance. + + NotifyEapMethodAccessStatusChange() will give a notification when + the status changes. + + Status will change when the first client calls + InitialiseEapMethod() on this sub-session. When the same client + calls ReleaseEapMethod() (or Close()), the status will change + again. This allows mutually exclusive access to the DF_EAP. All + other RMobileSmartCardEap hanles will get an error if they attempt + to make requests that access the same DF_EAP. + + @see RMobileSmartCardEap::NotifyEapMethodAccessStatusChange() + @see RMobileSmartCardEap::ReleaseEapMethod() + @see RMobileSmartCardEap::InitialiseEapMethod() + + @publishedPartner + @prototype + */ + enum TEapMethodAccessStatus + { + /** + AID/DF_EAP has been reset, and the DF_EAP has not been + initialised by any other instance of RMobileSmartCardEap. + */ + EEapMethodAvailable, + /** + Another instance of RMobileSmartCardEap has initialised first + and taken ownership of the DF_EAP. The DF_EAP is currently + active and EAP requests can be made. + */ + EEapMethodInUseApplicationActive, + /** + This instance of RMobileSmartCardEap still owns the lock on the + DF_EAP, but the application has been deactivated elsewhere. + The client should re-initialise before making further EAP + requests. + + @see RMobileSmartCardEap::InitialiseEapMethod() + */ + EEapMethodInUseApplicationInactive, + /** + Lock on the DF_EAP has been released, but another DF_EAP method + is in use under the same AID, thus, cannot reset/initialise + this subsessions EAP method. Client can only post a + notification and wait till status changes to + EEapMethodAvailable. + + @see RMobileSmartCardEap::NotifyEapMethodAccessStatusChange() + */ + EEapMethodUnableToInitialise + }; + + IMPORT_C TInt ReleaseEapMethod(); + IMPORT_C TInt GetEapMethodAccessStatus(TEapMethodAccessStatus& aEapMethodStatus); + IMPORT_C void NotifyEapMethodAccessStatusChange(TRequestStatus& aReqStatus, TEapMethodAccessStatus& aEapMethodStatus); + IMPORT_C TBool IsEapMethodOwner() const; + +protected: + IMPORT_C void ConstructL(); + IMPORT_C void Destruct(); + +private: + RMobileSmartCardEap(const RMobileSmartCardEap&); + + TChar SeptChar(TInt aDigit); + void ConvertBinToText(const TDesC8& aBinData, TDes& aText); + +private: + /** + Pointer Holder for the RMobileSmartCardEap sub-session requests. + */ + CMobileSmartCardEapPtrHolder* iMmPtrHolder; + /** + True if this object is the first to request InitialiseEapMethod() + on its when the status is EEapMethodAvailable. + I.e. True only for the instance of RMobileSmartCardEap that + successfully passes the Wait() on iSemaphore. + */ + TBool iOwnsEapMethodLock; + /** + Semaphore is actually owned by TSY, and used by all instances of + RMobileSmartCardEap to stop multiple access to the same EAP method + on any one application. + */ + RSemaphore iSemaphore; + + }; // RMobileSmartCardEap + +///////////////////////////////////////////////////////////////////////////////////// +// +// LCS-MO-LR AND LCS-MT-LR +// +///////////////////////////////////////////////////////////////////////////////////// +class CMobileLocationServicesPtrHolder; + +/** +This sub-session opens under RMobilePhone. + +A new RMobileLocationServices class is used to add the ETelMM Support for Mobile Terminating Location Request, +Mobile Originating Location Requests, A-Gps assistance data for the LBS Framework. + +RMobileLocationServices is derived from RTelSubSessionBase.RMobileLocationServices lists the +APIs,which provided the support for Mtlr, Molr, A-Gps assistance data requests. +*/ +class RMobileLocationServices : public RTelSubSessionBase + { +public: + + IMPORT_C RMobileLocationServices(); + IMPORT_C TInt Open(RMobilePhone& aPhone); + IMPORT_C void Close(); + /** + Maximum length of the array used for TLcsRequestorIdString. + */ + enum { KLcsMaxRequestorIdStringSize = 256 }; + /** + Maximum length of the array used for TLcsClientBufferName. + */ + enum { KLcsMaxClientNameBufferSize = 256 }; + /** + Maximum length of the array used for TLcsClientExternalID. + */ + enum { KLcsMaxClientExternalIdSize = 64 }; + /** + Maximum length of the array used for TLcsLocationEstimate. + */ + enum { KLcsMaxLocationEstimateSize = 64 }; + /** + Maximum length of the array used for TLcsVelocityEstimate. + */ + enum { KLcsMaxVelocityEstimateSize = 64 }; + /** + Maximum length of the array used for TLcsGpsAssistanceData. + */ + enum { KLcsMaxGpsAssistanceDataSize = 64 }; + /** + A typedef'd buffer which holds the External ClientName Buffer. + @see KLcsMaxClientNameBufferSize + */ + typedef TBuf8 TLcsClientNameBuffer; + /** + A typedef'd buffer which holds the RequestorId String. + @see KLcsMaxRequestorIdStringSize + */ + typedef TBuf8 TLcsRequestorIdString; + /** + A typedef'd buffer which holds the Gps Assistance Data. + @see KLcsMaxGpsAssistanceDataSize + */ + typedef TBuf8 TGpsAssistanceData; + /** + A typedef'd buffer which holds the External ClientId. + @see KLcsMaxClientExternalIdSize + */ + typedef TBuf8 TLcsClientExternalID; + /** + A typedef'd TUint8 which holds the Data Coding Scheme information. + */ + typedef TUint8 TLcsDataCodingScheme; + /** + A typedef'd buffer which holds the Location Estimate. + @see KLcsMaxLocationEstimateSize + */ + typedef TBuf8 TLcsLocationEstimate; + /** + A typedef'd buffer which holds the Velocity Estimate. + @see KLcsMaxVelocityEstimateSize + */ + typedef TBuf8 TLcsVelocityEstimate; + /** + A typedef'd buffer which holds the GpsAssistanceData type. + @see KLcsMaxGpsAssistanceDataSize + */ + typedef TBuf8 TGpsAssistanceData; + typedef TUint8 TTransactionIdentifier; + typedef TUint8 TGPSI; + /** + Note:Refer to 3GPP TS 23.271(Functional stage 2 description of Location Services (LCS)), + 3GPP TS 24.030(Location Services (LCS); Supplementary service operations - Stage 3) and + 3GPP TS 24.080(Mobile radio interface layer 3 supplementary services specification; Formats and coding) + for further details of MTLR and MOLR member data. + */ + /*********************************************************************/ + // MTLR // + /*********************************************************************/ + /** + TNotificationType lists the various types of Notification + that can be expected from any MTLR-Location Notification coming from the Network, + These types depend on the Subscription Profile of the UE. + + One of the TNotificationType is expected to be retrieved from the Network, + when a UE places a RMobileLocationServices::NotifyMtlr() request on the TSY. + @internalAll + */ + enum TNotificationType + { + /** + Notification Type Unknown + */ + ENotificationTypeUnknown, + /** + The Location Request is accepted by default + */ + ENotifyLocationAllowed, + /** + This enum is used to indicate to the client, that the user should be notified of the incoming MTLR request, + and that the user is expected to respond by granting/denying the request. By defualt, if the user + does not provide a response, the request is granted + */ + ENotifyAndVerify_LocationAllowedIfNoResponse, + /** + This enum is used to indicate to the client, that the user should be notified of the incoming MTLR request, + and that the user is expected to respond by granting/denying the request. By defualt, if the + user does not provide a response, the request is denied. + */ + ENotifyAndVerify_LocationNotAllowedIfNoResponse, + /** + The network sends the information to the UE that the external client has privacy overide capability, + This indicator is received when an authenticated or emergency client had sent the request. + */ + ELocationPrivacyOverride, + /** + This enum is used to notify the UE that an incoming MTLR request was denied by the network for any of various + reasons. + */ + ELocationNotAllowed + }; + + + /** + TLocationEstimateType lists the various types of LocationEstimate + that can be expected from any MTLR-Location Notification request coming from the Network, + These types depend on the Subscription Profile of the UE. + + One of the TLocationEstimateType is expected to be retrieved from the Network, + when a UE places a RMobileLocationServices::NotifyMtlr() request on the TSY. + @internalAll + */ + enum TLocationEstimateType + { + /** + Location Estimate Type Unknown. + */ + ELocationEstimateTypeUnknown, + /** + The External Client has requested for the Current Location of + the UE. + */ + ECurrentLocation, + /** + The External Client has requested for the Current Location of + the UE.Incase,if the request is accepted,But still it fails to + generate the Location report because of Measurement Control Failure. + The Client receives the Last Known Location. + */ + ECurrentOrLastKnownLocation, + /** + The External Client has requested for the initial location of the UE. The current + location of the UE may or may not be the initial location. + */ + EInitialLocation + }; + + /** + TLcsClientNameV1 holds the details of the name of the External client, + who is making the request via Network. + TLcsClientNameV1 is used by RMobileLocationServices::NotifyMtlr() request. + @see TLcsDataCodingScheme + @see TLcsClientNameBuffer + @internalAll + */ + class TLcsClientNameV1 + { + public: + /** + TLcsDataCodingScheme holds the Data Coding Scheme information which is used + to extract the ExternalClient name. + */ + TLcsDataCodingScheme iLcsDataCodingScheme; + /** + TLcsClientNameBuffer holds the Client name + */ + TLcsClientNameBuffer iLcsClientNameBuffer; + }; + + /** + TLcsRequestorIDV1 holds the details of the RequestorId i.e the details of the + Network,Which is carrying the request of External Client to UE + TLcsRequestorIDV1 is used by RMobileLocationServices::NotifyMtlr() request. + @see TLcsDataCodingScheme + @see TLcsRequestorIdString + @internalAll + */ + class TLcsRequestorIDV1 + { + public: + /** + TLcsDataCodingScheme holds the Data Coding Scheme information which is used + to extract the RequestorId String. + */ + TLcsDataCodingScheme iLcsDataCodingScheme; + /** + TLcsRequestorIdString holds the RequestorId String + */ + TLcsRequestorIdString iLcsRequestorIdString; + }; + + /** + TLocationExternalInfoV1 holds the details of the External client and the Requestor + TLocationExternalInfoV1 is used by RMobileLocationServices::NotifyMtlr() request + @see TLcsClientExternalID + @see TLcsClientNameV1 + @see TLcsRequestorIDV1 + @internalAll + */ + class TLocationExternalInfoV1 + { + public: + /** + TLcsClientExternalID gives the id of the External client. + */ + TLcsClientExternalID iLcsClientID; + /** + TLcsClientNameV1 holds the name of the External Client. + */ + TLcsClientNameV1 iLcsClientName; + /** + TLcsRequestorIDV1 gives the details of requestor id + */ + TLcsRequestorIDV1 iLcsRequestorID; + }; + + /** + TNotifyMtlrV7 holds the details of the MTLR request made by the External client. + TNotifyMtlrV7 is used by RMobileLocationServices::NotifyMtlr() request + @see TNotificationType + @see TLocationEstimateType + @see TLocationExternalInfoV1 + @internalAll + */ + class TNotifyMtlrV7: public RMobilePhone::TMultimodeType + { + public: + IMPORT_C TNotifyMtlrV7(); + public: + /** + TNotificationType holds the type of notification request being made + */ + TNotificationType iNotificationType; + /** + TLocationEstimateType holds the type of LocationEstimate is requested + */ + TLocationEstimateType iMtlrLocationEstimateType; + /** + TLocationExternalInfoV7 holds the details of the External client. + */ + TLocationExternalInfoV1 iLocationInfo; + }; + + /** + A typedef'd packaged TNotifyMtlrV7 for passing through a + generic API method. + + @internalAll + */ + typedef TPckg TNotifyMtlrV7Pckg; + + //MTLR-RESPONSE + /** + TMtlrResponse is used by the OverLoaded RMobileLocationServices::SendMtlrResponse() API + It holds the type of response being sent back for the MTLR request made. + @internalAll + */ + + enum TMtlrResponse + { + /** + Mtlr Response Unknown. + */ + EMtlrResponseUnknown, + /** + The UE has denied the Location Request of the External client. + @see RMobileLocationServices::SendMtlrResponse() + */ + EPermissionDenied , + /** + The UE has granted the Location Request of the External client. + @see RMobileLocationServices::SendMtlrResponse() + */ + EPermissionGranted + }; + + /** + TMtlrError is used by the Overloaded RMobileLocationServices::SendMtlrResponse() API + It holds the type of Error response being sent back for the MTLR request made. + @internalAll + */ + enum TMtlrError + { + /** + Mtlr Error Unknown. + */ + EMtlrErrorUnknown, + /** + This response is sent back to the network when System has failed to + do the privacy check due to some Miscellaneous reasons + */ + ESystemFailure , + /** + The response is sent when the privacy verification has failed because of Unexpected data + values retrieved from the Location Notification request generated by the Network. + This generates an Error-Prone response from UE + */ + EUnexpectedDataValue + }; + + /** + TMtlrReject is used by the Overloaded RMobileLocationServices::SendMtlrResponse() API + It holds the details of the Response being rejected due to one of the problems reported to the UE + for the MTLR request being made. + @internalAll + */ + enum TMtlrReject + { + /** + Mtlr Reject Unknown. + */ + EMtlrRejectUnknown, + /** + This indication is given under a scenario where the UE wants to reject a request, + It is done by invoking Duplicate ID's. + */ + EDuplicateInvokeID, + /** + This indication is given under a scenario where the UE wants to reject a request, + It is done by saying the operation is not recognized + */ + EUnrecognizedOperation, + /** + This invokes a problem indicating Resource Limitation. + */ + EResourceLimitation, + /** + This Invokes a problem initiating release. + */ + EInitiatingRelease, + /** + This invokes a problem indicating that the ID linked with the Client information + is unrecognized + */ + EUnrecognizedLinkedID, + /** + This invokes a problem of Linked Response Unexpected + */ + ELinkedResponseUnexpected, + /** + This invokes a problem of Unexpected Linked Operation + */ + EUnexpectedLinkedOperation, + /** + This invokes a problem of Mistyped Parameter. + */ + EMistypedParameter + }; + + /**************************************************************/ + // MOLR // + /**************************************************************/ + + /** + TMolrType is used by the SendMolr() API. + This gives an indication of type of Molr request the UE wants to invoke + @internalAll + */ + enum TMolrType + { + /** + MolrType UnKnown + */ + EMolrTypeUnknown, + /** + UE is requesting the Network for its Location Estimate + */ + ELocationEstimate, + /** + UE is requesting the Network for GPS Assistance data + */ + EAssistanceData, + /** + UE is requesting the Network for DecipheringKeys + */ + EDecipheringKeys + }; + + /** + TResponseTime is used by SendMolr() API + This enum holds the various types of delay that an UE is expecting. + @internalAll + */ + enum TResponseTime + { + /** + Response Time Unknown. + */ + EResponseTimeunknown, + /** + This enum value indicates that the UE expects a Less Time Delay + from Network in responding to its request + */ + ELowDelay, + /** + This enum value indicates that the UE expects a Long Time Delay + from Network in responding to its request and is tolerant to it. + */ + EDelayTolerant + }; + + /** + TLocationMethod is used by SendMolr() API + This is an enum which lists out all different types of Location methods that an UE can request + @internalAll + */ + enum TLocationMethod + { + /** + Location Method Unknown + */ + ELocationMethodunknown, + /** + This indication is given under a scenario where the UE wants a MS (Mobile Station) Based Location Fix. + This can be termed as UE Assisted Location Fix(EOTD-Enhanced observed time difference). + */ + EMSBasedEOTD, + /** + This indication is given under a scenario where the UE wants a MS (Mobile Station) Assisted Location Fix. + This can be termed out as UE based location fix. + */ + EMSAssistedEOTD, + /** + This indication is given under a scenario where the UE wants a MS (Mobile Station) Assisted GPS data. + */ + EMSAssistedGPS, + /** + This indication is given under a scenario where the UE wants a MS (Mobile Station) based location fix + (OTDOA-Observed time difference of arrival). + */ + EMSBasedOTDOA + }; + + /** + TQosV1 is used by SendMolr() API + This is a class with details of accuracy of Position information, Response Time, + expected to be received from the network. + @see TResponseTime + @internalAll + */ + class TQosV1 + { + public: + /** + This gives an information of the amount of Horizontal accuracy that the UE is expecting. + */ + TUint8 iHorizontalAccuracy; + /** + This gives an information of the amount of Vertical accuracy that the UE is expecting. + */ + TUint8 iVerticalAccuracy; + /** + This enum indicates the Response Time expected by the UE to receive a response for its MOlr request. + */ + TResponseTime iResponseTime; + }; + + /** + TMolrErrors is used by SendMolr() API + This is an enum which lists out all the possible errors that can be + reported to UE by an External Client or the Network. + @internalAll + */ + enum TMolrErrors + { + /** + Molr Error Unknown + */ + EMolrErrorUnknown, + /** + This indication is given to the UE when the Location Report is unable to reach the + External Client due to some failure in the Network Connections. + */ + EMolrSystemFailure, + /** + This indication is given back to the UE by the Network to the UE or by the + External Client to the UE,where the UE generated MOLR has some unexpected values. + */ + EMolrUnexpectedDataValue, + /** + This indication is given back to the UE by the Network to the UE or by the + External Client to the UE,where the UE generated MOLR had a data discrepancy + */ + EMolrDataMissing, + /** + This indication is given by the Network to the UE, + when the UE is not given a facility to make a MOLR request + */ + EMolrFacilityNotSupported, + /** + This indication is given by the Network to the UE, + when the subscription profile of the UE doesn't match with the requests made by it. + */ + EMolrSS_SubscriptionViolation, + /** + This indication is given by the Network to the UE, + when the UE or the Network failed to generate the Location estimate + */ + EMolrPositionMethodFailure + }; + + /** + TStartMolrV7 is used by SendMolr() API + This class lists the details send by UE to Network when a Molr request is being made. + @see TMolrType + @see TQosV1 + @see TLocationEstimateType + @see TLcsClientExternalID + @see TGpsAssistanceData + @see TLocationMethod + @internalAll + */ + class TStartMolrV7: public RMobilePhone::TMultimodeType + { + public: + IMPORT_C TStartMolrV7(); + public: + /** + TMolrType holds the type of Molr request being made + */ + TMolrType iMolrType; + /** + TQosV1 lists out the Quality of Service expected by UE + */ + TQosV1 iQos; + /** + Type of Location Estimate requested + */ + TLocationEstimateType iMolrLocationEstimateType; + /** + Id of the External client + */ + TLcsClientExternalID iLcsClientExternalID; + /** + Type of GpsAssistanceData + */ + TGpsAssistanceData iGpsAssistanceData; + /** + Type of Location method requested + */ + TLocationMethod iLocationMethod ; + /** + Type of Service requested + */ + TUint8 iLcsServiceTypeID; + }; + /** + A typedef'd packaged TStartMolrV7 for passing through a + generic API method. + + @internalAll + */ + typedef TPckg TStartMolrV7Pckg; + + /** + TMolrReturnResultV7 is used by SendMolr() API + This class lists all the Molr return results that can be expected for the Molr request + being made. + @see TLcsLocationEstimate + @see TLcsVelocityEstimate + @see TMolrErrors + @internalAll + */ + class TMolrReturnResultV7: public RMobilePhone::TMultimodeType + { + public: + IMPORT_C TMolrReturnResultV7(); + public: + /** + This gives the Location Estimate of the UE + */ + TLcsLocationEstimate iLocationEstimate; + /** + This gives the Velocity Estimate of the UE + */ + TLcsVelocityEstimate iVelocityEstimate; + /** + This gives the indication of the type of error occured + */ + TMolrErrors iMolrErrors; + }; + + /** + A typedef'd packaged TMolrReturnResultV7 for passing through a + generic API method. + + @internalAll + */ + typedef TPckg TMolrReturnResultV7Pckg; + + //**************************************// + // Measurement Control Data structures // + //**************************************// + + enum + { + /**Maximum number of monitored cells RACH*/ + KMaxMonitoredCells = 8, + /**Maximum number of satellites*/ + KMaxSat = 16, + /**GlobalHealth size. 364 bits =46 bytes (Rounded) */ + KGlobalHealthSize = 46 + }; + + /**This enum contains the possible types of measurement commands.*/ + enum TMeasurementCmd + { + /**Measurement Command Unknown*/ + EMeasCommandUnknown, + /**Setup a new measurement*/ + ESetup, + /**Modify a previously defined measurement, e.g. to change the reporting criteria*/ + EModify, + /**Indicates to stop a measurement and clear all information in the UE that are related to that measurement */ + ERelease, + }; + + /**This enum contains the possible positioning method types*/ + enum TUePosMethodType + { + /**Positioning Method Type unknown*/ + EPosMethodTypeUnknown, + /**UE Assisted : The network computes the location of the UE.*/ + EUeAssisted, + /**UE Based : The UE computes the location of itself*/ + EUeBased, + }; + + /**This enum contains the possible positioning methods*/ + enum TPosMethod + { + /**Positioning Method unknown*/ + EPosMethodUnknown, + /**OTDOA may be selected by the SRNC as the method to be used on receipt of an LCS positioning request from the CN */ + EOtdoa, + /**These methods make use of UEs, which are equipped with radio receivers capable of receiving GPS signals*/ + EGps, + /**Use either OTDOA or GPS positioning method.*/ + EOtdoaOrGps, + /** + In the cell ID based (i.e. cell coverage) method, the position of an UE is + estimated with the knowledge of its serving Node B. The information about the serving + Node B and cell may be obtained by paging,locating area update, cell update, URA update, or routing area update. + */ + ECellID + }; + + /** + This class contains the information which is part of the Navigation Model. + This can be requested by the UE as part of additional request. + */ + class TSatDataV1 + { + public: + /**Satellite identity*/ + TUint8 iSatID; + /**Issue of Data Ephemeris for SatID*/ + TUint8 iIode; + }; + + /** + This class contains the additional information that can be requested by the UE. + */ + class TNavModelAddlDataReqV1 + { + public: + /**GPS time in weeks*/ + TUint16 iGpsWeek; + /**GPS time of ephemeris in hours of the latest ephemeris set contained by the UE.*/ + TUint8 iGpsToe; + /**Ephemeris age tolerance of the UE to UTRAN in hours.*/ + TUint8 iTToeLimit; + /**Satellite Identities + @see TSatDataV1*/ + TSatDataV1 iSatData[KMaxSat]; + }; + + /**This class contains the indicators to request for additional assistance data from the network.*/ + class TGpsAddlAssistDataReqV1 + { + public: + /**ETrue indicates Almanac Data is requested + @see TAlmanacV1*/ + TBool iAlmanacRequest; + /**ETrue indicates UTC model Data is requested + @see TUtcModelV1*/ + TBool iUtcModelRequest; + /**ETrue indicates Ionospheric Model Data is requested + @see TUtcModelV1*/ + TBool iIonosphericModelRequest; + /**ETrue indicates Navigation model Data is requested + @see TIonosphericModelV1*/ + TBool iNavigationModelRequest; + /**ETrue indicates DGPS corrections Data is requested + @see TNavigationModelSatInfoV1*/ + TBool iDgpsCorrectionsRequest; + /**ETrue indicates Reference location Data is requested + @see TDgpsCorrectionsV1*/ + TBool iReferenceLocationRequest; + /**ETrue indicates Reference time Data is requested + @see TReferenceLocationV1*/ + TBool iReferenceTimeRequest; + /**ETrue indicates Acquisition assistance Data is requested + @see TReferenceTimeV1*/ + TBool iAcquisitionAssistanceReq; + /**ETrue indicates Realtime integrity Data is requested + @see TAcquisitionAssistanceV1*/ + TBool iRealTimeIntegrityRequest; + /**This member is included only if Navigagion Model Data is requested (iNavigationModelRequest is ETrue). + @see TNavModelAddlDataReqV1*/ + TNavModelAddlDataReqV1 iNavModelAddlDataReq; + }; + + /**This class contains the UE positioning reporting quantity*/ + class TUePosReportingQuantityV1 + { + public: + /**Holds the positioning method type*/ + TUePosMethodType iUePosMethodType; + /**Holds the positioning method*/ + TPosMethod iPosMethod; + /**Holds the horizontal accuracy*/ + TInt8 iHorzAccuracy; + /**Holds the vertical accuracy*/ + TInt8 iVertAccuracy; + /**If true the SRNC wants the UE to report the SFN-GPS timing of the reference cell.*/ + TBool iGpsTimingOfCellWanted; + /**ETrue indicates that the UE is requested to send the IE "Additional assistance Data Request" + when the IE "UE positioning Error" is present in the UE positioning measured results. + EFalse indicates that the UE shall use the assistance data available. + */ + TBool iAddlAssistanceDataReq; + }; + + /**This enum contains the states in which measurements are valid*/ + enum TMeasurementValidity + { + /**Measurement Validity Unknown*/ + EMeasValidityUnknown, + /**Indicates measurement is valid in CellDCH state*/ + ECellDCH, + /**Indicates measurement is valid except in CellDCH state*/ + EAllButCellDCH, + /**Indicates measurement is valid in all state*/ + EAllStates + }; + + /**This enum list the SfnTow uncertainity*/ + enum TSfnTowUncertainity + { + /**Sfn Tow Uncertainity unknown*/ + ESfnTowUncertainityUnknown, + /**SfnTowUncertainity < 10*/ + ELessThan10, + /**SfnTowUncertainity > 10*/ + EMoreThan10 + }; + + /**This enum lists the different GPS drift rates*/ + enum TUtranGpsDriftRate + { + /**GPS Drift rate unknown*/ + EDriftRateUnknown, + /**Drift = 0*/ + EUtranGpsDrift0, + /**Drift = 1*/ + EUtranGpsDrift1, + /**Drift = 2*/ + EUtranGpsDrift2, + /**Drift = 5*/ + EUtranGpsDrift5, + /**Drift = 10*/ + EUtranGpsDrift10, + /**Drift = 15*/ + EUtranGpsDrift15, + /**Drift = 25*/ + EUtranGpsDrift25, + /**Drift = 50*/ + EUtranGpsDrift50, + /**Drift = -1*/ + EUtranGpsDriftMinus1, + /**Drift = -2*/ + EUtranGpsDriftMinus2, + /**Drift = -5*/ + EUtranGpsDriftMinus5, + /**Drift = -10*/ + EUtranGpsDriftMinus10, + /**Drift = -15*/ + EUtranGpsDriftMinus15, + /**Drift = -25*/ + EUtranGpsDriftMinus25, + /**Drift = -50*/ + EUtranGpsDriftMinus50, + }; + + /**This enum lists the different Udre values*/ + enum TDiffCorrectionsStatus + { + /**Diff Corrections Status unknown*/ + ECorrectionStatusUnknown, + /**UDRE 1.0 */ + EUdre1Point0, + /**UDRE 0.75 */ + EUdre0Point75, + /**UDRE 0.5 */ + EUdre0Point5, + /**UDRE 0.3 */ + EUdre0Point3, + /**UDRE 0.2 */ + EUdre0Point2, + /**UDRE 0.1 */ + EUdre0Point1, + /**UDRE No Data */ + ENoData, + /**UDRE Invalid Data */ + EInvalidData + }; + + /**This class reserves members for future use*/ + class TSubFrame1ReservedV1 + { + public: + /**Reserve member 1*/ + TUint iReserved1; + /**Reserve member 2*/ + TUint iReserved2; + /**Reserve member 3*/ + TUint iReserved3; + /**Reserve member 4*/ + TUint iReserved4; + }; + + /**This class contains information for GPS ephemeris and clock correction.*/ + class TEphemerisParameterV1 + { + public: + /**Code(s) on L2 Channel */ + TUint8 iCodeOnL2; + /**User Range Accuracy */ + TUint8 iUraIndex; + /**Health of Satellite*/ + TUint8 iSatHealth; + /**Issue of Data, Clock */ + TUint16 iIodc; + /**L2 channel flag*/ + TUint8 iL2Flag; + TSubFrame1ReservedV1 iSubFrame1Reserved; + /**Estimated group delay differential */ + TUint8 iTGd; + /**Apparent clock correction*/ + TUint16 iTOc; + /**Apparent clock correction*/ + TUint8 iAf2; + /**Apparent clock correction*/ + TUint16 iAf1; + /**Apparent clock correction*/ + TUint iAf0; + /**Amplitude of the Sine Harmonic Correction Term to the Orbit Radius (meters)*/ + TUint16 iCRs; + /**Mean Motion Difference From Computed Value (semi-circles/sec)*/ + TUint16 iDeltaN; + /**Mean Anomaly at Reference Time (semi-circles)*/ + TUint iM0; + /**Amplitude of the Cosine Harmonic Correction Term To The Argument Of Latitude (radians)*/ + TUint16 iCUc; + /**Eccentricity*/ + TUint iE; + /**Amplitude of the Sine Harmonic Correction Term To The Argument Of Latitude (radians)*/ + TUint16 iCUs; + /**Semi-Major Axis in squareroot(meters) */ + TUint iASqrt; + /**Reference Time Ephemeris */ + TUint16 iTOe; + /** + Fit interval flag + @see ICD-GPS-200 + */ + TUint8 iFitInterval; + /**Age Of Data Offset */ + TUint8 iAodo; + /**Amplitude of the Cosine Harmonic Correction Term To The Angle Of Inclination (radians)*/ + TUint16 iCIc; + /**Longitude of Ascending Node of Orbit Plane at Weekly Epoch (semi-circles) */ + TUint iOmega0; + /**Amplitude of the Sine Harmonic Correction Term To The Angle Of Inclination (radians) */ + TUint16 iCIs; + /**Inclination Angle at Reference Time (semi-circles) */ + TUint i0; + /**Amplitude of the Cosine Harmonic Correction Term to the Orbit Radius (meters) */ + TUint16 iCRc; + /**Argument of Perigee (semi-circles) */ + TUint iOmega; + /**Longitude of Ascending Node of Orbit Plane at Weekly Epoch (semi-circles/sec) */ + TUint iOmegaDot; + /**Rate of Inclination Angle (semi-circles/sec) */ + TUint16 iDot; + }; + + /**This enum specifies the possible status of a satellite*/ + enum TSatelliteStatus + { + /**Satellite Status unknown*/ + ESatStatusUnknown, + /**New satellite, new Navigation Model*/ + ENsNnU, + /**Existing satellite, same Navigation Model*/ + EEsSn, + /**Existing satellite, new Navigation Model*/ + EEsNnU, + /**Reserved*/ + ERev2, + /**Reserved*/ + ERev + }; + + /**This class contains the navigation model satellite information*/ + class TNavigationModelSatInfoV1 + { + public: + /**Satellite identification*/ + TUint8 iSatID; + /**Status of the satellite*/ + TSatelliteStatus iSatelliteStatus; + /**Contains information for GPS ephemeris and clock correction.*/ + TEphemerisParameterV1 iEphemerisParameter; + }; + + /** + This class contains the ionospheric model information needed to model + the propagation delays of the GPS signals through the ionosphere + */ + class TIonosphericModelV1 + { + public: + /** + The parameters *n are the coefficients of a cubic equation + representing the amplitude of the vertical delay. + @see ICD-GPS-200 + */ + /**Alfa = 0*/ + TUint8 iAlfa0; + /**Alfa = 1*/ + TUint8 iAlfa1; + /**Alfa = 2*/ + TUint8 iAlfa2; + /**Alfa = 3*/ + TUint8 iAlfa3; + /** + The parameters *n are the coefficients of a cubic equation + representing the period of the ionospheric model + @see ICD-GPS-200 + */ + /**Beta = 0*/ + TUint8 iBeta0; + /**Beta = 1*/ + TUint8 iBeta1; + /**Beta = 2*/ + TUint8 iBeta2; + /**Beta = 3*/ + TUint8 iBeta3; + }; + + /** + This class contains the UTC model information needed to relate GPS time to Universal Time Coordinate (UTC) + @see ICD-GPS-200 + */ + class TUtcModelV1 + { + public: + /** + Time in seconds. + @see ICD-GPS-200. + */ + TUint iA1; + /** + Time in seconds. + @see ICD-GPS-200. + */ + TUint iA2; + /**Time in seconds + @see ICD-GPS-200 + */ + TUint8 iTOt; + /**weeks + @see ICD-GPS-200 + */ + TUint8 iWnT; + /**Time in seconds + @see ICD-GPS-200 + */ + TUint8 iDeltaTLs; + /**Weeks + @see ICD-GPS-200 + */ + TUint8 iWnLsf; + /**Days + @see ICD-GPS-200 + */ + TUint8 iDn; + /**Seconds + @see ICD-GPS-200 + */ + TUint8 iDeltaTLsf; + }; + + /**This class contains a reduced-precision subset of the ephemeris and clock correction parameters.*/ + class TAlmanacSatInfoV1 + { + public: + /**Data identification*/ + TUint8 iDataID; + /**Eccentricity*/ + TUint16 iE; + /**Reference Time of Almanac */ + TUint8 iTOa; + /**@see ICD-GPS-200*/ + TUint16 iDeltaI; + /**Longitude of Ascending Node of Orbit Plane at Weekly Epoch (semi-circles/sec) */ + TUint16 iOmegaDot; + /**Satellite health*/ + TUint8 iSatHealth; + /**Semi-Major Axis in squareroot(meters)*/ + TUint iASqrt; + /**Longitude of Ascending Node of Orbit Plane at Weekly Epoch (semi-circles) */ + TUint iOmega0; + /**Mean Anomaly at Reference Time (semi-circles) */ + TUint iM0; + /**Argument of Perigee (semi-circles) */ + TUint iOmega; + /**Apparent clock correction */ + TUint16 iAf0; + /**Apparent clock correction */ + TUint16 iAf1; + }; + + /**This class holds the coarse, long-term model of the satellite positions and clocks.*/ + class TAlmanacV1 + { + public: + /**Almanac Reference Week */ + TUint8 iWnA; + TAlmanacSatInfoV1 iAlmanacSatInfoList[KMaxSat]; + /**This enables GPS time recovery and possibly extended GPS correlation intervals.*/ + TUint16 iSvGlobalHealth[KGlobalHealthSize]; + }; + + /**This union contains the information specific to mode - FDD/TDD*/ + union TModeSpecificInfoV1 + { + /**Used in FDD mode*/ + TUint16 iPrimaryScramblingCode; + /**Used in TDD mode*/ + TUint16 iCellParametersID; + }; + + /**This class contains parameters that enable fast acquisition of the GPS + signals in UE-assisted GPS positioning.*/ + class TAcquisitionAssistanceV1 + { + public: + /**Specifies GPS reference time*/ + TUint iGpsReferenceTime; + /**Specifies GPS reference time specific to mode - FDD/TDD*/ + TModeSpecificInfoV1 iUtranGpsReferenceTime; + /**ETrue indicates iUtranGpsReferenceTime is iPrimaryScramblingCode. + EFalse indicates iUtranGpsReferenceTime is iCellParametersID*/ + TBool iUtranGpsRefTimeStatus; + }; + + /** + The UDRE provides an estimate of the uncertainty (1-*) in the corrections for + the particular satellite. The value in this field shall be multiplied by the + UDRE Scale Factor in the common Corrections Status/Health field to determine the + final UDRE estimate for the particular satellite. + @see 3GPP TS 25.305 + */ + enum TUdre + { + /**Udre unknown*/ + EUdreUnknown, + /** UDRE < 1*/ + ELessThan1, + /** 1> UDRE < 4*/ + EBtw1And4, + /** 1> UDRE < 8*/ + EBtw1And8, + /** UDRE > 8*/ + EOver8 + }; + + /**This class contains DGPS corrections to be used by the UE*/ + class TDgpsCorrectionSatInfoV1 + { + public: + /**Satellite identification*/ + TUint8 iSatID; + /**Issue of Data Ephemeris for SatID.*/ + TUint8 iIode; + /** + The UDRE provides an estimate of the uncertainty (1-*) in the corrections for + the particular satellite. The value in this field shall be multiplied by the + UDRE Scale Factor in the common Corrections Status/Health field to determine the + final UDRE estimate for the particular satellite. + @see 3GPP TS 25.305 + */ + TUdre iUdre; + /**The PRC indicates the correction to the pseudorange for the particular satellite at the GPS Reference Time*/ + TInt16 iPrc; + /** + This information indicates the rate-of-change of the pseudorange correction for the particular satellite, + using the satellite ephemeris identified by the IODE IE + */ + TInt8 iRrc; + /**For future use*/ + TInt8 iDummy1; + /**For future use*/ + TInt8 iDummy2; + }; + + /**This class contains the DGPS corrections information*/ + class TDgpsCorrectionsV1 + { + public: + /**GPS time of week*/ + TUint16 iGpsTow; + /**This information indicates the status of the differential corrections contained in the message.*/ + TDiffCorrectionsStatus iStatusHealth; + /**This member data contains DGPS corrections of the satellites to be used by the UE*/ + TDgpsCorrectionSatInfoV1 iDgpsCorrectionSatInfoList[KMaxSat]; + }; + + /**This enum containst the possible signs of latitude*/ + enum TLatitudeSign + { + /**Latitude Sign Unknown*/ + ELatitudeSignUnknown, + /**Latitude sign is north*/ + ENorth, + /**Latitude sign is south*/ + ESouth + }; + + /**This enum contains the possible directions of altitudes for reference location*/ + enum TAltDirection + { + /**Altitude Direction Unknown*/ + EAltDirectionUnknown, + /**Indicates Altitude direction is height-wise*/ + EHeight, + /**Indicates Altitude direction is depth-wise*/ + EDepth + }; + + /**This class contains a 3-D location (with uncertainty)*/ + class TReferenceLocationV1 + { + public: + /**Specifies the sign - North/South*/ + TLatitudeSign iLatitudeSign; + /**Degree of latitude*/ + TUint16 iLatitude; + /**Degree of longitude*/ + TInt16 iLongitude; + /**Direction of altitude*/ + TAltDirection iAltDirection; + /**Degree of altitude*/ + TUint16 iAltitude; + /**Uncertainty semi major axis*/ + TUint8 iUncertainitySemiMajor; + /**Uncertainty semi minor axis*/ + TUint8 iUncertainitySemiMinor; + /**Orientation of major axis*/ + TUint8 iOrientationMajorAxis; + /**The uncertainty in altitude, h, expressed in metres*/ + TUint8 iUncertainityAltitude; + /**The confidence by which the position of a target entity is known to be within the shape description*/ + TUint8 iConfidence; + }; + + /** + Contains several fields in the Telemetry (TLM) Word and Handover Word (HOW) + that are currently being broadcast by the respective GPS satellites. Combining this information + with GPS TOW helps the UE with time-recovery needed to predict satellite signal. + */ + class TGpsTowAssistV1 + { + public: + /**Satellite identification*/ + TUint8 iSatID; + /** + Contains a 14-bit value representing the Telemetry Message (TLM) + being broadcast by the GPS satellite identified by the particular SatID, + with the MSB occurring first in the satellite transmission. + */ + TUint16 iTlmMsg; + /** + Contains the two reserved bits in the TLM Word + being broadcast by the GPS satellite identified by SatID, + with the MSB occurring first in the satellite transmission. + */ + TUint8 iTlmReserved; + /**Contain the Alert flags that are being broadcast by the GPS satellite identified by SatID.*/ + TBool iAlert; + /**Contain the Anti-Spoof that are being broadcast by the GPS satellite identified by SatID.*/ + TBool iAntiSpoof; + }; + + /**This class contains information that may be used to provide a mapping between UTRAN and GPS time*/ + class TUtranGpsRefTimeV1 + { + public: + /**UE-GPS timing of cell ms-part*/ + TUint16 iMsPart; + /**UE-GPS timing of cell ls-part*/ + TUint16 iLsPart; + /**System frame number*/ + TUint16 iSfn; + /**Specifies GPS reference time specific to mode - FDD/TDD*/ + TModeSpecificInfoV1 iModeSpecificInfo; + /**ETrue indicates iUtranGpsReferenceTime is iPrimaryScramblingCode. + EFalse indicates iUtranGpsReferenceTime is iCellParametersID*/ + TBool iModeSpecificInfoStatus; + }; + + /** + This class contains several fields in the Telemetry (TLM) Word and Handover Word (HOW) + that are currently being broadcast by the respective GPS satellites. Combining this information + with GPS TOW helps the UE with time-recovery needed to predict satellite signal. + */ + class TReferenceTimeV1 + { + public: + /**GPS time in weeks*/ + TUint16 iGpsWeek; + /**GPS Time of Week in milliseconds */ + TUint16 iGpsTowOneMsec; + /**GPS reference time may be used to provide a mapping between UTRAN and GPS time*/ + TUtranGpsRefTimeV1 iUtranGpsRefTime; + /** + This field indicates the uncertainty of the relation GPS TOW/SFN. + ELessThan10 means the relation is accurate to at least 10 ms. + */ + TSfnTowUncertainity iSfnTowUncertainity; + /**Drift rate of the NODE B clock relative to GPS time.*/ + TUtranGpsDriftRate iUtranGpsDriftRate; + /** + Contains several fields in the Telemetry (TLM) Word and Handover Word (HOW) + that are currently being broadcast by the respective GPS satellites. Combining this information + with GPS TOW helps the UE with time-recovery needed to predict satellite signal. + */ + TGpsTowAssistV1 iGpsTowAssistList[KMaxSat]; + }; + + /**This class contains the GPS Assistance Data received from network*/ + class TUePosGpsAssistanceDataV1 + { + public: + /**GPS reference time may be used to provide a mapping between UTRAN and GPS time.*/ + TReferenceTimeV1 iReferencTime; + /**The Reference Location contains a 3-D location (with uncertainty)*/ + TReferenceLocationV1 iReferenceLocation; + /** + Holds information to allow a UE to estimate its position more accurate, + biases in the pseudorange measurements may be provided to the UE. + */ + TDgpsCorrectionsV1 iDgpsCorrections; + /**Holds navigation model satellite information*/ + TNavigationModelSatInfoV1 iNavigationModel; + /** + The Ionospheric Model contains information needed to model + the propagation delays of the GPS signals through the ionosphere. + */ + TIonosphericModelV1 iIonosphericModel; + /**UTC parameters may be used to provide Coordinated Universal Time to the UE.*/ + TUtcModelV1 iUtcModel; + /**Holds the coarse, long-term model of the satellite positions and clocks.*/ + TAlmanacV1 iAlmanac; + /**Holds the acquistions assistance information of the UE*/ + TAcquisitionAssistanceV1 iAcquisitionAssistance; + /**Holds the list of bad satellites*/ + TUint8 iBadSatList[KMaxSat]; + /** + This member specifies which of the above additional data structures are populated. + */ + TGpsAddlAssistDataReqV1 iGpsAddlDataStatus; + }; + + /**This class contains the GPS assistance data required to compute the UE Postioning information*/ + class TUePosMeasurementV1 + { + public: + /** + The purpose of the element is to express the allowed/required location method(s), + and to provide information desired QoS. + */ + TUePosReportingQuantityV1 iUePosReportingQuantity; + /**This member data defines in which UE states the measurement is valid.*/ + TMeasurementValidity iMeasurementValidity; + /**This member data holds the GPS Assistance Data sent by the network*/ + TUePosGpsAssistanceDataV1 iUePosGpsAssistanceData; + }; + + /**This holds the possible types of measurement commands that can be specified*/ + union TMeasurementCommandV1 + { + /**Setup a new measurement*/ + TUePosMeasurementV1 iSetup; + /**Modify a previously defined measurement*/ + TUePosMeasurementV1 iModify; + /**Stop the measurement and clear all information in the UE that are related to that measurement.*/ + TBool iRelease; + }; + + /**This enum specifies the mode the UE shall use to transmit the measurement report*/ + enum TMeasReportTransferMode + { + /**Transfer mode unknown*/ + ETransferModeUnknown, + /**The UE shall transmit the measurement report using Acknowledged RLC mode*/ + EAckModeRlc, + /**The UE shall transmit the measurement report using Unacknowledged RLC mode*/ + EUnAckModeRlc + }; + + /** + This class contains the GPS assistance data needed by the UE to compute the location + of the UE. The UE computes the location once it receives all required information. + */ + class TMeasurementControlV7 : public RMobilePhone::TMultimodeType + { + public: + IMPORT_C TMeasurementControlV7(); + public: + /** + A reference number that should be used by the UTRAN when setting up, + modifying or releasing the measurement and by the UE in the measurement report. + */ + TUint8 iMeasurementIdentity; + /**Specifies the Measurement Setup / Modify / Release*/ + TMeasurementCommandV1 iMeasurementCommand; + /**This specifies whether the UE shall transmit the measurement report using AM or UM RLC.*/ + TMeasReportTransferMode iMeasReportTransferMode; + /**ETrue indicates velocity estimate is requested. EFalse indicates velocity estimate is not requested*/ + TBool iVelocityRequested; + /**Holds the type of measurement command being used*/ + TMeasurementCmd iMeasurementCmdStatus; + }; + /** + A typedef'd packaged TMeasurementControlV7 for passing through a + generic API method. + + @internalAll + */ + typedef TPckg TMeasurementControlV7Pckg; + + //**************************************// + // Measurement Report Data structures // + //**************************************// + + + /** + This enum contains the indicators thta specify which + union members of TMeasurementQuantityV1 are included + */ + enum TMeasQnty + { + /**Measurement Quantity unknown*/ + EMeasQntyUnknown, + /**Indicates that CpichEcN0 is present*/ + EMeasQntyCpichEcN0Present, + /**Indicates that CpichRscp is present*/ + EMeasQntyCpichRscpPresent, + /**Indicates that path loss is present*/ + EMeasQntyPathLossPresent, + }; + + /** + This enum contains the indicators that specify which + union members of TPosEstimateRefTime and TPositionEstimateV1 are included + */ + enum TPosEstimateInfo + { + /**Position Estimate Info Unknown*/ + EPosEstimateInfoUnknown, + /** + NOTE: The following states correspond to TUePosPositionEstimateInfoV1/TPosEstimateRefTime + Indicates that UE positioning estimate reference time is populated + */ + EUtranGpsRefTimeResultPresent, + /**Indicates that GPS reference time is populated*/ + EGpsRefTimeOnlyPresent, + /**Indicates that cell timing is populated*/ + ECellTimingPresent, + /** + NOTE: The following states correspond to TUePosPositionEstimateInfoV1/TPositionEstimateV1. + Indicates EllipsoidPoint is populated + */ + EEllipsoidPointPresent, + /**Indicates EllipsoidPoint with uncertainty circle is populated*/ + EEllipsoidPointUncertCirclePresent, + /**Indicates EllipsoidPoint with uncertainty ellipse is populated*/ + EEllipsoidPointUncertEllipsePresent, + /**Indicates EllipsoidPoint with altitude is populated*/ + EEllipsoidPointAltitudePresent, + /**Indicates EllipsoidPoint with altitude and ellipse is populated*/ + EEllipsoidPointAltEllipsePresent, + }; + + /**This enum contains the possible types of velocity estimates*/ + enum TVelEstimate + { + /**Velocity Estimate Unknown*/ + EVelEstimateUnknown, + /**Velocity Estimate is not present*/ + EVelEstimateNotPresent, + /**Horizontal velocity is included*/ + EHorzVelPresent, + /**Horizontal and vertical velocity is included*/ + EHorzWithVertVelPresent, + /**Horizontal velocity with uncertainty is included*/ + EHorzVelWithUncertPresent, + /**Horizontal and vertical velocity with uncertainty is included*/ + EHorzWithVertVelAndUncertPresent, + }; + + /**This contains the measurement quantities of the UE*/ + union TMeasurementQuantityV1 + { + public: + /** + @see 3GPP TS 25.133. + @see 3GPP TS 25.123. + */ + TUint8 iCpichEcN0; + /** + @see 3GPP TS 25.133. + @see 3GPP TS 25.123. + */ + TUint8 iCpichRscp; + /**Measurement path loss in dB.*/ + TUint8 iPathLoss; + /**Extra for future use*/ + TBool iSpare; + }; + + /**This class contains the current cell informations in TDD mode*/ + class TTddV1 + { + public: + /** + Time slot Interference on Signal Code Power + @see 3GPP TS 25.123 + */ + TUint8 iTimeSlotIscp; + /**Primary Common Control Physical CHannel received signal code power*/ + TUint8 iPrimaryCcpchRscp; + }; + + /**This class contains the information in FDD mode*/ + class TFddV1 + { + public: + /**Holds the measurement quantities of the UE*/ + TMeasurementQuantityV1 iMeasurementQuantity; + /**Holds the field that would be populated in iMeasurementQuantity*/ + TMeasQnty iMeasQntyStatus; + }; + + /**This contains the current cell information in specific modes - FDD/TDD*/ + union TCurrentCellV1 + { + /**Current cell information in FDD mode*/ + TFddV1 iFdd; + /**Current cell information in TDD mode*/ + TTddV1 iTdd; + }; + + /**This contains the type of sfn-sfn observed time difference*/ + union TSfnSfnObsTimeDifferenceV1 + { + /**Sfn-Sfn observed time difference -type1*/ + TUint16 iSfnSfnObsTimeDiff1; + /**Sfn-Sfn observed time difference -type2*/ + TUint16 iSfnSfnObsTimeDiff2; + }; + + /**This class contains the FDD mode information of monitored cells*/ + class TMonitoredCellFddV1 + { + public: + /**Primary Common Control Physical CHannel information*/ + TUint16 iPrimaryCpichInfo; + /**Holds the measurement quantities of the UE*/ + TMeasurementQuantityV1 iMeasurementQuantity; + /**Holds the field that would be populated in iMeasurementQuantity*/ + TMeasQnty iMeasQntyStatus; + }; + + /**This class contains the TDD mode information of monitored cells*/ + class TMonitoredCellTddV1 + { + public: + /**Cell identification*/ + TUint8 iCellParametersID; + /**Primary Common Control Physical CHannel received signal code power*/ + TUint8 iPrimaryCcpchRscp; + }; + + /**This contains the monitored cells information in specific mode - FDD/TDD*/ + union TMonitoredCellModeSpecificInfoV1 + { + /**Monitored Cell information in FDD mode*/ + TMonitoredCellFddV1 iMonitoredCellFdd; + /**Monitored Cell information in TDD mode*/ + TMonitoredCellTddV1 iMonitoredCellTdd; + }; + + /**This class contains the measured results for monitored cells on Random Access Channel*/ + class TMonitoredCellRachResultV1 + { + public: + /**Holds the sfn-sfn observed time difference*/ + TSfnSfnObsTimeDifferenceV1 iSfnSfnObsTimeDiff; + /**Holds the monitored cells specific info mode - FDD/TDD*/ + TMonitoredCellModeSpecificInfoV1 iMonitoredCellModeSpecificInfo; + /**ETrue indicates iMonitoredCellModeSpecificInfo is iMonitoredCellFdd. + EFalse indicates iMonitoredCellModeSpecificInfo is iMonitoredCellTdd*/ + TBool iSfnSfnObsTimeDiffStatus; + }; + /** + Horizontal velocity is characterised by the horizontal speed and bearing. + The horizontal speed gives the magnitude of the horizontal component of the velocity of a UE. + The bearing provides the direction of the horizontal component of velocity taken clockwise from North. + @see 3GPP TS 23.032 + */ + class THorzVelocityV1 + { + public: + /**The direction of movement is given in degrees where '0' represents North, '90' represents East, etc.*/ + TUint16 iBearing; + /**The horizontal speed gives the magnitude of the horizontal component of the velocity of a UE*/ + TUint16 iHorzSpeed; + }; + + /**This enum holds vertical speed direction*/ + enum TVertSpeedDirection + { + /**Speed direction unknown*/ + ESpeedDirectionUnknown, + /**Upward direction*/ + EUpward, + /**Downward direction*/ + EDownward + }; + + /** + Horizontal velocity is characterised by the horizontal speed and bearing. + The horizontal speed gives the magnitude of the horizontal component of the velocity of a UE. + The vertical speed and direction provides the component of velocity of a UE in a vertical direction. + The bearing provides the direction of the horizontal component of velocity taken clockwise from North. + @see 3GPP TS 23.032 + */ + class THorzWithVertVelocityV1 + { + public: + /**Direction of vertical speed*/ + TVertSpeedDirection iVertSpeedDirection; + /**The direction of movement is given in degrees where '0' represents North, '90' represents East, etc.*/ + TUint16 iBearing; + /**The horizontal speed gives the magnitude of the horizontal component of the velocity of a UE*/ + TUint16 iHorzSpeed; + /**The vertical speed and direction provides the component of velocity of a UE in a vertical direction.*/ + TUint8 iVertSpeed; + }; + + /** + Horizontal velocity with uncertainty is characterised by a horizontal speed and bearing, + giving a horizontal velocity vector V, and an uncertainty speed s. + @see 3GPP TS 23.032 + */ + class THorzVelocityWithUncertaintyV1 + { + public: + /** The direction of movement is given in degrees where '0' represents North, '90' represents East, etc.*/ + TUint16 iBearing; + /**The horizontal speed gives the magnitude of the horizontal component of the velocity of a UE*/ + TUint16 iHorzSpeed; + /** + Horizontal speed uncertainty. + */ + TUint8 iHorzSpeedUncertainty; + }; + + /** + Horizontal and vertical velocity with uncertainty is characterised by a horizontal speed and bearing, + giving a horizontal velocity vector Vx,y, a vertical speed and direction giving a vertical velocity component Vz, + and uncertainty speeds s1 and s2. + @see 3GPP TS 23.032 + */ + class THorzWithVertVelocityAndUncertaintyV1 + { + public: + /** + The direction of movement is given in degrees where '0' represents North, '90' represents East, etc. + */ + TUint16 iBearing; + /**The horizontal speed gives the magnitude of the horizontal component of the velocity of a UE*/ + TUint16 iHorzSpeed; + /**The vertical speed and direction provides the component of velocity of a UE in a vertical direction.*/ + TUint8 iVertSpeed; + /**Horizontal speed uncertainty.*/ + TUint8 iHorzSpeedUncertainty; + }; + + /** + This class contains the possible ways of velocity estimates + @see 3GPP TS 23.032 + */ + union TVelocityEstimateV1 + { + /**Horizontal velocity*/ + THorzVelocityV1 iHorzVelocity; + /**Horizontal velockity and vertical velocity*/ + THorzWithVertVelocityV1 iHorzWithVertVelocity; + /**Horizontal velocity with uncertainty*/ + THorzVelocityWithUncertaintyV1 iHorzVelocityWithUncertainty; + /**Horizontal and vertical velocity with uncertainty*/ + THorzWithVertVelocityAndUncertaintyV1 iHorzWithVertVelocityAndUncertainty; + }; + + /**This class contains the measured results on Random Access Channel*/ + class TMeasuredResultsOnRachV1 + { + public: + /**Current cell information*/ + TCurrentCellV1 iCurrentCell; + /**Monitored Cell information*/ + TMonitoredCellRachResultV1 iMonitoredCellsRachList[KMaxMonitoredCells]; + /**ETrue indicates iCurrentCell is iFdd. + EFalse indicates iCurrentCell is iTdd*/ + TBool iCurrentCellStatus; + }; + + /** + Identifies the channel in combination with the Midamble shift and slot number. + It is not used in 1.28 Mcps TDD and may be set to either value and should be ignored by the receiver. + */ + enum TBurstType + { + /**Burst type 1*/ + EType1, + /**Burst type 2*/ + EType2 + }; + + /**This class contains UE positioning estimates specific to TDD*/ + class TPosEstimateTddV1 + { + public: + /**Identifies the channel in combination with the Midamble shift and slot number.*/ + TBurstType iBurstType; + /**Midamble shift*/ + TUint8 iMidambleShift; + /** + This member data is present only if no IPDL scheme is configured in the reference cell. + Otherwise the slot is defined by the IPDL configuration. + */ + TUint8 iTimeSlotNumber; + /** + Cell identification + */ + TUint8 iCellParametersID; + }; + + /**This class contains UE positioning estimates specific to FDD/TDD*/ + union TPosEstimateModeSpecificInfoV1 + { + /**Identifies the reference cell for the GPS TOW-SFN relationship.*/ + TUint16 iPrimaryCpichInfo; + /**Holds the cell and channel identification*/ + TPosEstimateTddV1 iCellAndChannelID; + }; + + /**This class contains the cell timing information*/ + class TCellTimingV1 + { + public: + /** + SFN during which the position was calculated. + */ + TUint16 iSfn; + /**Holds the UE positioning estimates specific to mode - FDD or TDD*/ + TPosEstimateModeSpecificInfoV1 iPosEstimateModeSpecificInfo; + /**ETrue indicates iPosEstimateModeSpecificInfo is iPrimaryCpichInfo. + EFalse indicates iPosEstimateModeSpecificInfo is iCellAndChannelID.*/ + TBool iPosEstimateModeStatus; + }; + + /**This class captures the GPS measurement specific to FDD or TDD*/ + union TGpsMeasModeSpecificInfoV1 + { + /**Frequency Division Duplex identification*/ + TUint16 iFddRefID; + /**Time Division Duplex identification*/ + TUint8 iTddRefID; + }; + + /**This class contains results of the GPS reference time*/ + class TUtranGpsRefTimeResultV1 + { + public: + /**UE-GPS timing of cell ms-part*/ + TUint16 iMsPart; + /**UE-GPS timing of cell ls-part*/ + TUint16 iLsPart; + /**Holds the GPS measurement specific to FDD or TDD*/ + TGpsMeasModeSpecificInfoV1 iGpsMeasModeSpecificInfo; + /**Cell System Frame Number*/ + TUint16 iSfn; + /**ETrue indicates iGpsMeasModeSpecificInfo is iFddRefID. + EFalse indicates iGpsMeasModeSpecificInfo is iTddRefID*/ + TBool iGpsMeasModeStatus; + }; + + /**This union contains the UE positioning reference time*/ + union TPosReferenceTimeV1 + { + /**Contains the results of GPS reference time*/ + TUtranGpsRefTimeResultV1 iUtranGpsRefTimeResult; + /**Contains the GPS reference time*/ + TUint16 iGpsRefTimeOnly; + }; + + /** + This class contains the information of ellipsoid. + It consists of a latitude and a longitude. + @see 3GPP TS 23.032 + */ + class TEllipsoidPointV1 + { + public: + /**Specifies the sign - North/South*/ + TLatitudeSign iLatitudeSign; + /** + A north/south angular measurement of position relative to the equator, + in the meridian plane which contains the earth's rotation axis + */ + TUint16 iLatitude; + /** + An east/west angular measurement of position in relation to the Prime Meridian. + The angle between the two great circles, one being the Prime (or Greenwich) Meridian + and the other a meridian passing through the point of interest. + */ + TInt16 iLongitude; + }; + + /** + It is characterised by the co-ordinates of an ellipsoid point (the origin) and a distance r + @see 3GPP TS 23.032 + */ + class TEllipsoidPointUncertCircleV1 + { + public: + /**Specifies the sign - North/South*/ + TLatitudeSign iLatitudeSign; + /** + A north/south angular measurement of position relative to the equator, + in the meridian plane which contains the earth's rotation axis + */ + TUint16 iLatitude; + /** + An east/west angular measurement of position in relation to the Prime Meridian. + The angle between the two great circles, one being the Prime (or Greenwich) Meridian + and the other a meridian passing through the point of interest. + */ + TInt16 iLongitude; + /**Uncertainty code*/ + TUint8 iUncertaintyCode; + }; + + /** + It is characterised by the co-ordinates of an ellipsoid point (the origin), + distances r1 and r2 and an angle of orientation A + @see 3GPP TS 23.032 + */ + class TEllipsoidPointUncertEllipseV1 + { + public: + /**Specifies the sign - North/South*/ + TLatitudeSign iLatitudeSign; + /** + A north/south angular measurement of position relative to the equator, + in the meridian plane which contains the earth's rotation axis + */ + TUint16 iLatitude; + /** + An east/west angular measurement of position in relation to the Prime Meridian. + The angle between the two great circles, one being the Prime (or Greenwich) Meridian + and the other a meridian passing through the point of interest. + */ + TInt16 iLongitude; + /**Uncertainty semi major axis*/ + TUint8 iUncertaintySemiMajor; + /**Uncertainty semi minor axis*/ + TUint8 iUncertaintySemiMinor; + /**Orientation of major axis*/ + TUint8 iOrientationMajorAxis; + /**The confidence by which the position of a target entity is known to be within the shape description*/ + TUint8 iConfidence; + }; + + /** + The description of an ellipsoid point with altitude is that of a point at a specified distance + above or below a point on the earth's surface. This is defined by an ellipsoid point + with the given longitude and latitude and the altitude above or below the ellipsoid point. + @see 3GPP TS 23.032 + */ + class TEllipsoidPointAltitudeV1 + { + public: + /**Specifies the sign - North/South*/ + TLatitudeSign iLatitudeSign; + /** + A north/south angular measurement of position relative to the equator, + in the meridian plane which contains the earth's rotation axis + */ + TUint16 iLatitude; + /** + An east/west angular measurement of position in relation to the Prime Meridian. + The angle between the two great circles, one being the Prime (or Greenwich) Meridian + and the other a meridian passing through the point of interest. + */ + TInt16 iLongitude; + /**Direction of altitude*/ + TAltDirection iAltDirection; + /**Degree of altitude*/ + TUint16 iAltitude; + }; + + /** + characterised by the co-ordinates of an ellipsoid point with altitude, distances r1 (the "semi-major uncertainty"), + r2 (the "semi-minor uncertainty") and r3 (the "vertical uncertainty") and an angle of orientation A + (the "angle of the major axis") + @see 3GPP TS 23.032 + */ + class TEllipsoidPointAltitudeEllipseV1 + { + public: + /**Specifies the sign - North/South*/ + TLatitudeSign iLatitudeSign; + /** + A north/south angular measurement of position relative to the equator, + in the meridian plane which contains the earth's rotation axis + */ + TUint16 iLatitude; + /** + An east/west angular measurement of position in relation to the Prime Meridian. + The angle between the two great circles, one being the Prime (or Greenwich) Meridian + and the other a meridian passing through the point of interest. + */ + TInt16 iLongitude; + /**Direction of altitude*/ + TAltDirection iAltDirection; + /**Degree of latitude*/ + TUint16 iAltitude; + /**Uncertainty semi major axis*/ + TUint8 iUncertaintySemiMajor; + /**Uncertainty semi minor axis*/ + TUint8 iUncertaintySemiMinor; + /**Orientation of major axis*/ + TUint8 iOrientationMajorAxis; + /**The confidence by which the position of a target entity is known to be within the shape description*/ + TUint8 iConfidence; + }; + + /**This union holds the possible forms of position estimate of the UE that can be captured.*/ + union TPositionEstimateV1 + { + /** + The description of an ellipsoid point is that of a point + on the surface of the ellipsoid, and consists of a latitude and a longitude. + @see 3GPP TS 23.032 + */ + TEllipsoidPointV1 iEllipsoidPoint; + /** + It is characterised by the co-ordinates of an ellipsoid point (the origin) and a distance r + @see 3GPP TS 23.032 + */ + TEllipsoidPointUncertCircleV1 iEllipsoidPointUncertCircle; + /** + It is characterised by the co-ordinates of an ellipsoid point (the origin), + distances r1 and r2 and an angle of orientation A + @see 3GPP TS 23.032 + */ + TEllipsoidPointUncertEllipseV1 iEllipsoidPointUncertEllipse; + /** + The description of an ellipsoid point with altitude is that of a point at a specified distance + above or below a point on the earth's surface. This is defined by an ellipsoid point + with the given longitude and latitude and the altitude above or below the ellipsoid point. + @see 3GPP TS 23.032 + */ + TEllipsoidPointAltitudeV1 iEllipsoidPointAltitude; + /** + characterised by the co-ordinates of an ellipsoid point with altitude, distances r1 (the "semi-major uncertainty"), + r2 (the "semi-minor uncertainty") and r3 (the "vertical uncertainty") and an angle of orientation A + (the "angle of the major axis") + @see 3GPP TS 23.032 + */ + TEllipsoidPointAltitudeEllipseV1 iEllipsoidPointAltitudeEllipsoide; + }; + + /**This contains the positioning estimate reference time*/ + union TPosEstimateRefTime + { + /**Contains results of the GPS reference time*/ + TUtranGpsRefTimeResultV1 iUtranGpsRefTimeResult; + /**Contains the GPS reference time */ + TUint16 iGpsRefTimeOnly; + /**Contains the cell timing*/ + TCellTimingV1 iCellTiming; + }; + + /** + Provides the position estimate from the UE to the network, + if the UE is capable of determining its own position. + */ + class TUePosPositionEstimateInfoV1 + { + public: + /**UE positioning estimate reference time*/ + TPosEstimateRefTime iPosEstimateRefTime; + /**Holds the UE's position estimate + @see TPositionEstimateV1 + */ + TPositionEstimateV1 iPostionEstimate; + /**Holds the field that would be populated in iPosEstimateRefTime*/ + TPosEstimateInfo iPosEstimateRefTimeStatus; + /**Holds the field that would be populated in iPosEstimate*/ + TPosEstimateInfo iPosEstimateStatus; + }; + + /**This enum contains the multipath indicators*/ + enum TMultipathIndicator + { + /** + Multipath indicator unknown + This is an invalid indicator. + */ + EMPUnknown, + /**Not measured*/ + ENm, + /**MP error < 5m*/ + ELow, + /**5m < MP error < 43m*/ + EMedium, + /**MP error > 43m*/ + EHigh + }; + + /**This class contains the GPS measurement parameters of the UE*/ + class TGpsMeasMeasurementParamV1 + { + public: + /**Satellite Identification*/ + TUint8 iSatID; + /** + The estimate of the carrier-to-noise ratio of the received signal from the particular + satellite used in the measurement. It is given in units of dB-Hz (typical levels will + be in the range of 20 - 50 dB-Hz). + */ + TUint8 iCN0; + /** + It is the instantaneous frequency difference between the receiver's internal oscillator + and the received carrier from the satellite. Hz, scale factor 0.2. + */ + TInt16 iDoppler; + /** + Unit in GPS chips. + Whole value of the UE GPS code-phase measurement, where increasing binary values of the field + signify increasing measured pseudoranges. + */ + TUint16 iWholeGpsChips; + /** + The UE GPS code-phase measurement is divided into the fields "Whole GPS Chips" and "Fractional GPS Chips". + Scale factor 2-10 Fractional value of the UE GPS code-phase measurement. + */ + TUint16 iFractionalGpsChips; + /** + Contains the possible multipath indicators. Multipath error is usually caused by one path being bounced or + reflected. The impact on a pseudo-range measurement may be up to a few metres. In the case of carrier phase, + this is of the order of a few centimetres. + */ + TMultipathIndicator iMultipathIndicator; + /** + A distance measurement based on the correlation of a satellite's transmitted code (may be the C/A-Code or + the encrypted P-Code) and the local receiver's reference code (for that PRN satellite number), + that has not been corrected for errors in synchronisation between the transmitter's clock and the receiver's clock. + Hence a pseudo-range measurement is a time-error biased distance measurement. + */ + TUint8 iPseudorangeRmsError; + }; + + /**This class contains the GPS measurement parameters and the positioning reference time*/ + class TUePosGpsMeasurementResultsV1 + { + public: + /**UE positioning reference time*/ + TPosReferenceTimeV1 iPosGpsMeasRefTime; + /**Holds the GPS measurement parameters from all the active satellites*/ + TGpsMeasMeasurementParamV1 iGpsMeasurementParamList[KMaxSat]; + /**ETrue indicates TPosReferenceTimeV1::iUtranGpsRefTimeResult is populated. + EFalse indicates TPosReferenceTimeV1::iGpsRefTimeOnly is populated*/ + TBool iPosGpsMeasRefTimeStatus; + }; + + /** + This enum lists all the possible errors that UE can report to the network + */ + enum TPosErrorCause + { + /** + Error Cause Unknown. This is an invalid error cause and is set if the UE does not set with + any of the underlying valid error causes + */ + EErrorCauseUnknown, + /**Indicates that enought number of GPS satellites are healthy and active.*/ + ENotEnoughGpsSatellites, + /**Assistance data required to compute location of the UE is missing in the measurement control. + If the Additional data request flag is true in the measurement control only then additional assistance + data can be requested otherwise measurements need to be done using the existing assistance data + @see TGpsAddlAssistDataReqV1 + @see TUePosReportingQuantityV1 + */ + EAssistanceDataMissing, + /** + Cell Frames Timings are not accomplished + */ + ENotAccomplishedGpsTimingOfCellFrames, + /** + UE can set this error in case other than the above mentioned is encountered + */ + EUndefinedError, + /** + UE denies Location information + */ + ERequestDeniedByUser, + }; + + /** + This class contains the positioning errors that might have encountered during + measurement of location of the UE. + */ + class TUePosError + { + public: + /**Indicates the error cause encountered while computing GPS Assistance data*/ + TPosErrorCause iPosErrorCause; + /**If error cause is "Assistance Data Missing" and iAddlAssistanceDataReq is set to ETrue then + then this member shall indicate what additional assistance data is needed. + If iAddlAssistanceDataReq is set to EFalse then existing assistance data is used to compute location + information of the UE. + @see TUePosReportingQuantityV1::iAddlAssistanceDataReq*/ + TGpsAddlAssistDataReqV1 iGpsAddlAssistDataReq; + }; + + /** + This class contains the measurement results computed by the UE. + */ + class TUePosMeasuredResultsV1 + { + public: + /**The purpose of this is to provide the position estimate from the UE to the network, + if the UE is capable of determining its own position.*/ + TUePosPositionEstimateInfoV1 iUePosPositionEstimateInfo; + /**Contains the GPS measurement parameters and the positioning reference time*/ + TUePosGpsMeasurementResultsV1 iUePosGpsMeasurement; + /**Indicates the error cause and/or additional assistance data is required*/ + TUePosError iUePosError; + /** + ETrue indicates some error has encountered. iUePosError will be populated. + EFalse indicates Gps Assistance Data is received and no error has encountered while processing. + Hence iUePosPositionEstimateInfo and iUePosGpsMeasurement will be populated + */ + TBool iPosErrorStatus; + }; + + /**Contains the measured location information of the UE*/ + union TMeasuredResultsV1 + { + /** + This member either contains the measurement results or the error that might have + encountered during measurements. + */ + TUePosMeasuredResultsV1 iTUePosMeasuredResults; + /** + A spare member for future use. + */ + TBool iSpare; + }; + + /** + This class contains the measurement report expected as response to the measurement control sent by the + network. Veloctiy estimates are included if requested in measurement control. + */ + class TMeasurementReportV7 : public RMobilePhone::TMultimodeType + { + public: + IMPORT_C TMeasurementReportV7(); + public: + /**A reference number that should be used by the UTRAN when setting up, + modifying or releasing the measurement and by the UE in the measurement report. + */ + TUint8 iMeasurementIdentity; + /**Contains the measured location information of the UE*/ + TMeasuredResultsV1 iMeasuredResults; + /**Contains the measured results on Random Access Channel*/ + TMeasuredResultsOnRachV1 iMeasuredResultsOnRach; + /**Contains the velocity estimates of the UE*/ + TVelocityEstimateV1 iVelocityEstimate; + /** + Indicates the populated member in iVelocityEstimate if velocity estimate is computed. + Otherwise indicates that velocity estimate is not computed. + */ + TVelEstimate iVelEstimateStatus; + }; + /** + A typedef'd packaged TMeasurementReportV7 for passing through a + generic API method. + + @internalAll + */ + typedef TPckg TMeasurementReportV7Pckg; + + //*********************************************// + // Measurement Control Failure data structure // + //*********************************************// + + /** + This enum contains the list of errors that the UE can specify. + The Measurement control failure is caused only when the the UE + cannot initiate a measurement as instructed by the network. + */ + enum TMeasurementControlFailure + { + /** + Unknown Measurement Control Failure. + This is an invalid failure state whic will be set if the UE does not set with the + underlying valid error reasons. + */ + EControlFailureUnknown, + /**Indicates ASN1.0 encoding is incorrect*/ + EAsn1ViolationOrEncoding, + /**Messsgae type specified is not existent*/ + EMsgTypeNonExistent, + /**Message is not compatible*/ + EMsgNotCompatibleWithReceiverState, + /**Information sent cannot be understood*/ + EIeValueNotComprehend, + /**Information expected is not present*/ + EInformationElementMissing, + /*Message extension cannot be understood*/ + EMsgExtnNotComprehend + }; + + /** + This enum contains the possible domains used by MOLR + */ + enum TDomain + { + /**Packet switch domain is the default domain that will be used by Molr*/ + EPacketSwitchedDomain, + /**UE shall set the domain to Circuit switch whenever Molr is intended to use it*/ + ECircuitSwitchedDomain + }; + + IMPORT_C void NotifyMtlr(TRequestStatus& aReqStatus,TDes8& aNotifyMtlr); + IMPORT_C void SendMtlrResponse(TRequestStatus& aReqStatus,const TMtlrResponse aMtlrResponse); + IMPORT_C void SendMtlrResponse(TRequestStatus& aReqStatus,const TMtlrError aMtlrResponse); + IMPORT_C void SendMtlrResponse(TRequestStatus& aReqStatus,const TMtlrReject aMtlrResponse); + IMPORT_C void SendMolr(TRequestStatus& aReqStatus,const TDesC8& aStartMolr,TDes8& aMolrReturnResult); + IMPORT_C void NotifyMeasurementControl(TRequestStatus& aReqStatus,TDes8& aMeasurementControl); + IMPORT_C void SendMeasurementReport(TRequestStatus& aReqStatus,const TDesC8& aMeasurementReport); + IMPORT_C void SendMeasurementReport(TRequestStatus& aReqStatus,const TMeasurementControlFailure aMeasurementControlFailure); + IMPORT_C TInt SetLcsDomain(const TDomain aDomain); +private: + void ConstructL(); + void Destruct(); +private: + /** + Pointer Holder for the RMobileLocationServices sub-session requests. + */ + CMobileLocationServicesPtrHolder* iMmPtrHolder; + }; + +class RTelHelper + { + public: + static RTelSubSessionBase::TCalledFunction GetCalledFunction(); + static void SetCallStatus( RMobileCall::TMobileCallStatus aStatus ); + static void SetCallEvent( RMobileCall::TMobileCallEvent aCallEvent ); + static void SetConfEvent( RMobileConferenceCall::TMobileConferenceEvent aConfEvent ); + static void SetConfStatus( RMobileConferenceCall::TMobileConferenceStatus aConfStatus ); + static void SetCallDirection( RMobileCall::TMobileCallDirection aDirection ); + static void SetCallEmergency( TBool aVal ); + }; + +#endif // __ETELMM_H__ + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/etelstub/src/etelstub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/etelstub/src/etelstub.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,367 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 FILES + +#include "etelmm.h" + +static TBool iEmergency = EFalse; +static RMobileCall::TMobileCallEvent iCallEvent = RMobileCall::ELocalBarred; +static RMobileConferenceCall::TMobileConferenceStatus iConfStatus = RMobileConferenceCall::EConferenceIdle; +static RMobileConferenceCall::TMobileConferenceEvent iConfEvent = RMobileConferenceCall::EConferenceCallAdded; +static RMobileCall::TMobileCallStatus iCallStatus = RMobileCall::EStatusIdle; +static RMobileCall::TMobileCallDirection iDirection = RMobileCall::EDirectionUnknown; +static TBool iReqToCancel = EFalse; +static RTelSubSessionBase::TCalledFunction iCalledFunction = RTelSubSessionBase::ENone; + + +EXPORT_C TInt RTelServer::Connect( int ) + { + return KErrNone; + } + +EXPORT_C TInt RPhone::Open( RTelServer&, const TDesC& ) + { + return KErrNone; + } + +EXPORT_C int RLine::Open( RPhone&, const TDesC& ) + { + return KErrNone; + } + +EXPORT_C RTelServer::RTelServer() + { + + } + +EXPORT_C RMobilePhone::RMobilePhone() + { + + } + +EXPORT_C RMobileLine::RMobileLine() + { + + } + +EXPORT_C RMobileCall::RMobileCall() + { + + } + +EXPORT_C void RCall::Close() + { + iCallEvent = RMobileCall::ELocalBarred; + iCallStatus = RMobileCall::EStatusUnknown; + iDirection = RMobileCall::EDirectionUnknown; + } + +EXPORT_C void RLine::Close() + { + + } + +EXPORT_C void RPhone::Close() + { + + } + +EXPORT_C void RMobileLine::Destruct() + { + + } + +EXPORT_C void RMobileLine::ConstructL() + { + + } + +EXPORT_C void RMobileCall::Destruct() + { + + } + +EXPORT_C void RMobileCall::ConstructL() + { + + } + +EXPORT_C void RMobilePhone::Destruct() + { + + } + +EXPORT_C void RMobilePhone::ConstructL() + { + + } + + +EXPORT_C RPhone::RPhone() + { + + } + +EXPORT_C RLine::RLine() + { + + } + +EXPORT_C RCall::RCall() + { + + } + +EXPORT_C RMobilePhone::TMultimodeType::TMultimodeType() + { + + } + +EXPORT_C RMobileCall::TMobileCallRemotePartyInfoV1::TMobileCallRemotePartyInfoV1() + { + + } + +EXPORT_C RMobilePhone::TMobileAddress::TMobileAddress() + { + + } + +EXPORT_C void RPhone::Destruct() + { + + } + +EXPORT_C void RPhone::ConstructL() + { + + } + +EXPORT_C void RLine::Destruct() + { + + } + +EXPORT_C void RLine::ConstructL() + { + + } + +EXPORT_C void RCall::Destruct() + { + + } + +EXPORT_C void RCall::ConstructL() + { + + } + +EXPORT_C RCall::TCallInfo::TCallInfo() + { + + } + +EXPORT_C TInt RCall::GetInfo( TCallInfo& /*aCallInfo*/ ) const + { + return 0; + } + +EXPORT_C RMobileCall::TMobileCallInfoV1::TMobileCallInfoV1() + { + + } + + +EXPORT_C RTelSubSessionBase::RTelSubSessionBase() + { + iReqStatus = NULL; + iReqStatus2 = NULL; + } + +EXPORT_C void RMobileCall::NotifyMobileCallStatusChange( TRequestStatus& aReqStatus, + RMobileCall::TMobileCallStatus& aCallStatus) const + { + aCallStatus = iCallStatus; + aReqStatus = KRequestPending; + iReqStatus2 = &aReqStatus; + //User::RequestComplete( &aStatus, KErrNone ); + } + +EXPORT_C void RMobileCall::NotifyCallEvent( TRequestStatus& aReqStatus, + TMobileCallEvent& aEvent ) const + { + + aEvent = iCallEvent ; + aReqStatus = KRequestPending; + iReqStatus = &aReqStatus; + //User::RequestComplete( &aReqStatus, aEvent ); + } + +EXPORT_C RMobileCall::TMobileCallInfoV3::TMobileCallInfoV3() + { + + } + +EXPORT_C TInt RMobileCall::GetMobileCallInfo( TDes8& aBuffer ) const + { + _LIT8( KNumber, "1234" ); + + RMobileCall::TMobileCallInfoV3 callInfo; + callInfo.iRemoteParty.iRemoteNumber.iTelNumber.Copy( KNumber() ); + callInfo.iRemoteParty.iDirection = iDirection; + callInfo.iEmergency = iEmergency; + RMobileCall::TMobileCallInfoV3Pckg pckg( callInfo ); + + aBuffer.Copy( pckg ); + + return KErrNone; + } + +EXPORT_C TInt RCall::OpenExistingCall( class RLine&, const TDesC& ) + { + return KErrNone; + }; + +EXPORT_C TInt RMobileCall::GetMobileCallStatus( RMobileCall::TMobileCallStatus& aStatus ) const + { + aStatus = iCallStatus; + + return KErrNone; + } + +EXPORT_C TInt RLine::EnumerateCall( TInt& aCount ) const + { + aCount = 1; + + return KErrNone; + } + +EXPORT_C TInt RLine::GetCallInfo( int, RLine::TCallInfo& aInfo ) const + { + _LIT( KCallName, "callname" ); + + aInfo.iStatus = (RCall::TStatus)iCallStatus; + aInfo.iCallName = KCallName(); + + return KErrNone; + } + +EXPORT_C void RMobileLine::NotifyMobileLineStatusChange( TRequestStatus& aReqStatus, RMobileCall::TMobileCallStatus& )const + { + aReqStatus = KRequestPending; + iReqStatus = &aReqStatus; + } + +EXPORT_C void RTelSubSessionBase::CancelAsyncRequest( TInt aReqToCancel ) const + { + TRequestStatus* reqStatus = aReqToCancel == EMobileCallNotifyMobileCallStatusChange ? + iReqStatus2 : iReqStatus; + + iCalledFunction = RTelSubSessionBase::ECancelAsyncRequest; + if ( reqStatus ) + { + User::RequestComplete( reqStatus, KErrCancel ); + } + if ( aReqToCancel == EMobileCallNotifyMobileCallStatusChange ) + { + iReqStatus2 = NULL; + } + else + { + iReqStatus = NULL; + } + + } + +EXPORT_C TInt RMobileConferenceCall::Open( RMobilePhone&) + { + return KErrNone; + } + +EXPORT_C RMobileConferenceCall::RMobileConferenceCall() + { + + } + +EXPORT_C void RMobileConferenceCall::Close() + { + + } + +EXPORT_C TInt RMobileConferenceCall::GetConferenceStatus( RMobileConferenceCall::TMobileConferenceStatus& /*aStatus*/ ) const + { + return KErrNone; + } + +EXPORT_C void RMobileConferenceCall::NotifyConferenceStatusChange( TRequestStatus& aReqStatus, + RMobileConferenceCall::TMobileConferenceStatus& aConfStatus ) const + { + aConfStatus = iConfStatus; + aReqStatus = KRequestPending; + iReqStatus = &aReqStatus; + + //User::RequestComplete( &aReqStatus, KErrNone ); + } + + +EXPORT_C void RMobileConferenceCall::NotifyConferenceEvent(TRequestStatus& aReqStatus, + TMobileConferenceEvent& aEvent, TName& /*aCallName*/) const + { + aEvent = iConfEvent; + aReqStatus = KRequestPending; + iReqStatus = &aReqStatus; + //User::RequestComplete( &aReqStatus, KErrNone ); + + } + + +/* + * Helper function to retrive static iCalledFunction variable + */ +RTelSubSessionBase::TCalledFunction RTelHelper::GetCalledFunction() + { + return iCalledFunction; + } + +void RTelHelper::SetCallStatus( RMobileCall::TMobileCallStatus aCallStatus ) + { + iCallStatus = aCallStatus; + } + +void RTelHelper::SetCallEvent( RMobileCall::TMobileCallEvent aCallEvent ) + { + iCallEvent = aCallEvent; + } +void RTelHelper::SetConfEvent( RMobileConferenceCall::TMobileConferenceEvent aConfEvent ) + { + iConfEvent = aConfEvent; + } +void RTelHelper::SetConfStatus( RMobileConferenceCall::TMobileConferenceStatus aConfStatus ) + { + iConfStatus = aConfStatus; + } +void RTelHelper::SetCallDirection( RMobileCall::TMobileCallDirection aDirection ) + { + iDirection = aDirection; + } +void RTelHelper::SetCallEmergency( TBool aVal ) + { + iEmergency = aVal; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/fbsbitmapstub/inc/fbs.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/fbsbitmapstub/inc/fbs.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,61 @@ +/* +* 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 __FBS_H__ +#define __FBS_H__ + +#include +#include +#include + +class CFbsBitmap + { + public: + + CFbsBitmap(); + ~CFbsBitmap(); + + + TInt Create( const TSize& aSizeInPixels, TDisplayMode aDispMode); + +TInt Load(const TDesC& aFileName,TInt32 aId=0,TBool aShareIfLoaded=ETrue); + TInt Load(const TDesC& aFileName,TInt32 aId,TBool aShareIfLoaded,TUint aFileOffset); + TInt Load(RFile& aFile,TInt32 aId=0,TBool aShareIfLoaded=ETrue); + TInt Load(RFile& aFile,TInt32 aId,TBool aShareIfLoaded,TUint aFileOffset); + + TInt Resize(const TSize& aSizeInPixels); + TSize SizeInPixels() const; + TSize value; + + + + + }; + +class CFbsFont + { + }; + +class RFbsSession + { + }; + +class CFbsTypefaceStore + { + }; + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/fbsbitmapstub/src/fbs.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/fbsbitmapstub/src/fbs.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,72 @@ +/* +* 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 + + +CFbsBitmap::CFbsBitmap() + { + + } + + +CFbsBitmap::~CFbsBitmap() + { + + } + +TInt CFbsBitmap::Create( const TSize& /*aSizeInPixels*/, TDisplayMode /*aDispMode*/) + { + return KErrNone; + } + +TInt CFbsBitmap::Load(const TDesC& aFileName, + TInt32 aId,TBool aShareIfLoaded) + { + return KErrNone; + } + + +TInt CFbsBitmap::Load(const TDesC& aFileName, + TInt32 aId,TBool aShareIfLoaded, + TUint aFileOffset) + { + return KErrNone; + } + +TInt CFbsBitmap::Load(RFile& aFile,TInt32 aId,TBool aShareIfLoaded) + { + return KErrNone; + } + +TInt CFbsBitmap::Load(RFile& aFile,TInt32 aId,TBool aShareIfLoaded,TUint aFileOffset) + { + return KErrNone; + } + +TInt CFbsBitmap::Resize(const TSize& aSizeInPixels) + { + value = aSizeInPixels ; + return KErrNone; + } + +TSize CFbsBitmap::SizeInPixels() const + { + return value; + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/featmgrstub/inc/FeatMgr.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/featmgrstub/inc/FeatMgr.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,58 @@ +/* +* 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: +* +*/ +// FeatMgr.h +// +//stubsfor Feature Manager + +#ifndef FEATUREMANAGER_H +#define FEATUREMANAGER_H + + +//INCLUDES +#include + + +class FeatureManager + { + public: + + /** + * Fetches information whether a certain feature is supported. + * @return feature support status + */ + IMPORT_C static TBool FeatureSupported( TInt aFeature ); + + static void InitializeLibL(); + static void UnInitializeLib(); + + // functions to set/unset camera feature + IMPORT_C static void CameraNotSupported(); + IMPORT_C static void CameraSupported(); + + // functions to set/unset MultimediaSharing feature + IMPORT_C static void MultimediaSharingNotSupported(); + IMPORT_C static void MultimediaSharingSupported(); + + private: + // member to + static TBool iIsCameraSupported; + static TBool iIsMultimediaSharingSupported; + }; + +#endif // FEATUREMANAGER_H + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/featmgrstub/src/FeatMgr.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/featmgrstub/src/FeatMgr.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,70 @@ +/* +* 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 "FeatMgr.h" + + +// ============================================================================= +// Stub variables for FeatureManager +// ============================================================================= + +TBool FeatureManager::iIsCameraSupported = ETrue; +TBool FeatureManager::iIsMultimediaSharingSupported = ETrue; + + +// ============================================================================= +// Stub functions for FeatureManager +// ============================================================================= + +EXPORT_C TBool FeatureManager::FeatureSupported( TInt aFeature ) + { + if (aFeature == KFeatureIdCamera) + return iIsCameraSupported; + else if (aFeature == KFeatureIdMultimediaSharing) + return iIsMultimediaSharingSupported; + else + return EFalse; + } + +EXPORT_C void FeatureManager::CameraNotSupported() + { + iIsCameraSupported = EFalse; + } + +EXPORT_C void FeatureManager::CameraSupported() + { + iIsCameraSupported = ETrue; + } + +EXPORT_C void FeatureManager::MultimediaSharingNotSupported() + { + iIsMultimediaSharingSupported = EFalse; + } + +EXPORT_C void FeatureManager::MultimediaSharingSupported() + { + iIsMultimediaSharingSupported = ETrue; + } + +void FeatureManager::InitializeLibL() + { + + } + +void FeatureManager::UnInitializeLib() + { + + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/imagedecoderstub/inc/imageconversion.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/imagedecoderstub/inc/imageconversion.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,71 @@ +/* +* 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 __IMAGECONVERSION__ +#define __IMAGECONVERSION__ + + +#include +#include +#include + + + +class CFbsBitmap; + +class TFrameInfo + { + public: + TRect iFrameCoordsInPixels; + TDisplayMode iFrameDisplayMode; + }; + + +class CImageDecoder + { + + public: + + + CImageDecoder(); + ~CImageDecoder(); + + + const TFrameInfo& FrameInfo(TInt aFrameNumber = 0) const; + + //FrameInfo(); + + //iDecoder->FrameInfo().iFrameCoordsInPixels.Size(), + // iDecoder->FrameInfo().iFrameDisplayMode ); + + void Convert(TRequestStatus* aRequestStatus, CFbsBitmap& aDestination, TInt aFrameNumber = 0); + //iDecoder->Convert( &iStatus, *iBitmap, 0 ); + + void Cancel(); + //Cancel + + + //CImageDecoder* DataNewL( RFs aFs, HBufC8 *iData ); + + //IMPORT_C static CImageDecoder* DataNewL(RFs& aFs, const TDesC8& aSourceData, const TDesC8& aMIMEType, const TOptions aOptions = EOptionNone); + static CImageDecoder* DataNewL(RFs& aFs, const TDesC8& aSourceData );//, const TOptions aOptions = EOptionNone, const TUid aImageType = KNullUid, const TUid aImageSubType = KNullUid, const TUid aDecoderUid = KNullUid); + + TFrameInfo iFrameInfo; + + }; + + +#endif \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/imagedecoderstub/src/imageconversion.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/imagedecoderstub/src/imageconversion.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,58 @@ +/* +* 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 "imageconversion.h" + +CImageDecoder::CImageDecoder() + { + iFrameInfo.iFrameCoordsInPixels = TRect( 0,0, 100,100 ); + iFrameInfo.iFrameDisplayMode = EColor16MCopy; + } + +CImageDecoder::~CImageDecoder() + { + + } + + +const TFrameInfo& CImageDecoder::FrameInfo( TInt aFrameNumber ) const + { + return iFrameInfo; + } + + //FrameInfo(); + + //iDecoder->FrameInfo().iFrameCoordsInPixels.Size(), + // iDecoder->FrameInfo().iFrameDisplayMode ); + +void CImageDecoder::Convert( TRequestStatus* aRequestStatus, CFbsBitmap& aDestination, TInt aFrameNumber ) + { + + } + //iDecoder->Convert( &iStatus, *iBitmap, 0 ); + +void CImageDecoder::Cancel() + { + + } + //Cancel + +CImageDecoder* CImageDecoder::DataNewL(RFs& aFs, const TDesC8& aSourceData ) //, const TOptions aOptions, const TUid aImageType, const TUid aImageSubType , const TUid aDecoderUid); + + { + + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/install/multimediasharing.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/install/multimediasharing.pkg Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,95 @@ +; +; 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: +; +; A package file for creating SIS for Multimediasharing + +; Supported languages +&en + +#{"MultimediaSharing"},(0x10282491),2,1,0,TYPE=SA,RU + +;Localised Vendor Name +%{"Nokia"} + +;Unique Vendor Name +:"Nokia" + +; Supports S60 v 5.0 +[0x1028315F], 0, 0, 0, {"S60ProductID"} + +;Supports Series 60 v5.1 +;[0x10283160], 0, 0, 0, {"Series60ProductID"} + +; ----------------------------------------------------------------------------------- + +;MUS FILES +;for S60 5.0 + +;MUS CENREP KEY +"\epoc32\data\z\private\10202be9\1028238b.txt" - "c:\private\10202be9\1028238b.txt" + +;MUS UI +"\epoc32\release\armv5\urel\musui.exe"-"c:\sys\bin\musui.exe" +"\epoc32\data\z\resource\apps\musui.mbm"-"c:\resource\apps\musui.mbm" +"\epoc32\data\z\resource\apps\musui_aif.mif"-"c:\resource\apps\musui_aif.mif" +"\epoc32\data\z\resource\apps\musuiicons.mif"-"c:\resource\apps\musuiicons.mif" +"\epoc32\data\z\resource\apps\musuitoolbaricons.mif"-"c:\resource\apps\musuitoolbaricons.mif" +"\epoc32\data\z\resource\apps\musui.rsc"-"c:\resource\apps\musui.rsc" +"\epoc32\data\z\private\10003a3f\apps\musui_reg.rsc"-"c:\private\10003a3f\import\apps\musui_reg.rsc" + + +;MUS GENERAL +"\epoc32\release\armv5\urel\musmanagerserver.exe"-"c:\sys\bin\musmanagerserver.exe" +"\epoc32\release\armv5\urel\musmanagerclient.dll"-"c:\sys\bin\musmanagerclient.dll" +"\epoc32\release\armv5\urel\musengine.dll"-"c:\sys\bin\musengine.dll" +"\epoc32\release\armv5\urel\musindicator.dll"-"c:\sys\bin\musindicator.dll" +"\epoc32\data\z\resource\musindicator.rsc"-"c:\resource\musindicator.rsc" +"\epoc32\data\z\private\1028238D\tone.amr"-"c:\private\1028238D\tone.amr" +"\epoc32\data\z\resource\apps\musindicatoricons.mif"-"c:\resource\apps\musindicatoricons.mif" +"\epoc32\data\z\resource\apps\musindicatoricons.mbm"-"c:\resource\apps\musindicatoricons.mbm" + +;MUS ECOM PLUGINS + +; Always Online Plugin +"\epoc32\release\armv5\urel\musaoplugin.dll"-"c:\sys\bin\musaoplugin.dll" +"\epoc32\data\z\resource\plugins\musaoplugin.rsc"-"c:\resource\plugins\musaoplugin.rsc" + +; SIP Client Resolver Plugin +"\epoc32\release\armv5\urel\mussipcrplugin.dll"-"c:\sys\bin\mussipcrplugin.dll" +"\epoc32\data\z\resource\plugins\mussipcrplugin.rsc"-"c:\resource\plugins\mussipcrplugin.rsc" + +; AIW Provider Plugin +"\epoc32\release\armv5\urel\musaiwprovider.dll"-"c:\sys\bin\musaiwprovider.dll" +"\epoc32\data\z\resource\plugins\musaiwprovider.rsc"-"c:\resource\plugins\musaiwprovider.rsc" +"\epoc32\data\z\resource\musaiwproviderui.rsc"-"c:\resource\musaiwproviderui.rsc" + +; Availability Plugin +"\epoc32\release\armv5\urel\musavailabilityplugin.dll"-"c:\sys\bin\musavailabilityplugin.dll" +"\epoc32\data\z\resource\plugins\musavailabilityplugin.rsc"-"c:\resource\plugins\musavailabilityplugin.rsc" + +; WirelessProvisioning Adapter +"\epoc32\release\armv5\urel\muswpadapter.dll"-"c:\sys\bin\muswpadapter.dll" +"\epoc32\data\z\resource\plugins\muswpadapter.rsc"-"c:\resource\plugins\muswpadapter.rsc" +"\epoc32\data\z\resource\muswpadapterresource.rsc"-"c:\resource\muswpadapterresource.rsc" + +; SETTINGS UI +;"\epoc32\release\armv5\urel\mussettingsui.dll"-"c:\sys\bin\mussettingsui.dll" +;"\epoc32\data\z\resource\plugins\mussettingsui.rsc"-"c:\resource\plugins\mussettingsui.rsc" +;"\epoc32\data\z\resource\mussettingsuirsc.RSC"-"c:\resource\mussettingsuirsc.rsc" +;"\epoc32\data\z\resource\apps\mussettingsplugin.mif"-"c:\resource\apps\mussettingsplugin.mif" + +;MCC Transcoder +;"\epoc32\release\armv5\urel\mmcctranscoder.dll"-"c:\sys\bin\mmcctranscoder.dll" +;"\epoc32\data\z\resource\plugins\mmcctranscoder.rsc"-"c:\resource\plugins\mmcctranscoder.rsc" diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/install/multimediasharing.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/install/multimediasharing.xml Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,27 @@ + + + + + 1 + Multimedia Sharing + Upgrade package for Multimedia Sharing + + + + S60 + + 5 + 0 + + 2008 + 28 + + + + + + + + + \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/install/multimediasharing_stub.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/install/multimediasharing_stub.pkg Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,27 @@ +; +; 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: +; +; A package file for creating SIS stub for Multimediasharing + +; Supported languages +&EN + +; Package header +#{"MultimediaSharing"},(0x10282491),2,0,0,TYPE=SA + +; Localised Vendor name +%{"Nokia"} +; Unique Vendor name +:"Nokia" diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/install/multimediasharing_udeb.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/install/multimediasharing_udeb.pkg Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,90 @@ +; +; 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: +; +; A package file for creating an installation file for Multimediasharing + +; Supported languages +&en + +#{"MultimediaSharing"},(0x10282491),2,0,0,TYPE=SA + +%{"Vendor-EN"} +:"Nokia" + +(0x101F6F88), 0, 0, 0, {"Series60ProductID"} + +; ----------------------------------------------------------------------------------- + +;MUS FILES +;for S60 3.2 + +;MUS CENREP KEY +;"\epoc32\DATA\Z\private\10202be9\1028238b.txt"-"!:\private\10202BE9\1028238b.txt" + +;MUS UI +"\epoc32\release\armv5\udeb\musui.exe"-"!:\sys\bin\musui.exe" +"\epoc32\data\z\resource\apps\musui.mbm"-"!:\resource\apps\musui.mbm" +"\epoc32\data\z\resource\apps\musui_aif.mif"-"!:\resource\apps\musui_aif.mif" +"\epoc32\data\z\resource\apps\musuiicons.mif"-"!:\resource\apps\musuiicons.mif" +"\epoc32\data\z\resource\apps\musuitoolbaricons.mif"-"!:\resource\apps\musuitoolbaricons.mif" +"\epoc32\data\z\resource\apps\musui.rsc"-"!:\resource\apps\musui.rsc" +"\epoc32\data\z\private\10003a3f\apps\musui_reg.rsc"-"!:\private\10003a3f\import\apps\musui_reg.rsc" + +;MUS GENERAL +"\epoc32\release\armv5\udeb\musmanagerserver.exe"-"!:\sys\bin\musmanagerserver.exe" +"\epoc32\release\armv5\udeb\musmanagerclient.dll"-"!:\sys\bin\musmanagerclient.dll" +"\epoc32\release\armv5\udeb\musindicator.dll"-"!:\sys\bin\musindicator.dll" +"\epoc32\data\z\resource\musindicator.rsc"-"!:\resource\musindicator.rsc" +"\epoc32\data\z\private\1028238D\tone.amr"-"!:\private\1028238D\tone.amr" +"\epoc32\data\z\resource\apps\musindicatoricons.mif"-"!:\resource\apps\musindicatoricons.mif" +"\epoc32\data\z\resource\apps\musindicatoricons.mbm"-"!:\resource\apps\musindicatoricons.mbm" + +;MUS ECOM PLUGINS + +; Always Online Plugin +"\epoc32\release\armv5\udeb\musaoplugin.dll"-"!:\sys\bin\musaoplugin.dll" +"\EPOC32\DATA\Z\Resource\Plugins\musaoplugin.RSC"-"!:\resource\plugins\musaoplugin.RSC" + +; SIP Client Resolver Plugin +"\epoc32\release\armv5\udeb\mussipcrplugin.dll"-"!:\sys\bin\mussipcrplugin.dll" +"\EPOC32\DATA\Z\Resource\Plugins\mussipcrplugin.RSC"-"!:\resource\plugins\mussipcrplugin.RSC" + +; AIW Provider Plugin +"\epoc32\release\armv5\udeb\musaiwprovider.dll"-"!:\sys\bin\musaiwprovider.dll" +"\EPOC32\DATA\Z\Resource\Plugins\musaiwprovider.RSC"-"!:\resource\plugins\musaiwprovider.RSC" +"\EPOC32\DATA\Z\Resource\musaiwproviderui.RSC"-"!:\resource\musaiwproviderui.RSC" + +; Availability Plugin +"\epoc32\release\armv5\udeb\musavailabilityplugin.dll"-"!:\sys\bin\musavailabilityplugin.dll" +"\EPOC32\DATA\Z\Resource\Plugins\musavailabilityplugin.RSC"-"!:\resource\plugins\musavailabilityplugin.RSC" + +; WirelessProvisioning Adapter +"\epoc32\release\armv5\udeb\muswpadapter.dll"-"!:\sys\bin\muswpadapter.dll" +"\EPOC32\DATA\Z\Resource\Plugins\muswpadapter.RSC"-"!:\resource\plugins\muswpadapter.RSC" +"\EPOC32\DATA\Z\Resource\muswpadapterresource.RSC"-"!:\resource\muswpadapterresource.RSC" + +;SETTINGS UI +"\epoc32\release\armv5\udeb\mussettingsui.dll"-"!:\sys\bin\mussettingsui.dll" +"\EPOC32\DATA\Z\Resource\Plugins\mussettingsui.RSC"-"!:\resource\plugins\mussettingsui.RSC" +"\EPOC32\DATA\Z\Resource\mussettingsuirsc.RSC"-"!:\resource\mussettingsuirsc.RSC" +"\EPOC32\DATA\Z\Resource\apps\mussettingsplugin.mif"-"!:\resource\apps\mussettingsplugin.mif" + +;MCC Transcoder +"\epoc32\RELEASE\armv5\udeb\mmcctranscoder.dll"-"!:\Sys\Bin\mmcctranscoder.dll" +"\epoc32\data\Z\Resource\Plugins\mmcctranscoder.RSC"-"!:\resource\plugins\mmcctranscoder.RSC" + +; Livecomms MusEngine +"\epoc32\release\armv5\udeb\musengineplugin.dll"-"!:\sys\bin\musengineplugin.dll" +"\epoc32\data\z\resource\plugins\musengineplugin.rsc"-"!:\resource\plugins\musengineplugin.rsc" diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/install/multimediasharing_update_udeb.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/install/multimediasharing_update_udeb.pkg Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,108 @@ +; +; 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: +; +; A package file for creating an installation file for Multimediasharing +; which updates Multimediasharing binaries from ROM (eclipsing) + +; Supported languages +&en + +#{"MultimediaSharing"},(0x10282491),2,0,0,TYPE=PU + +%{"Vendor-EN"} +:"Nokia" + +(0x101F6F88), 0, 0, 0, {"Series60ProductID"} + +; ----------------------------------------------------------------------------------- + +;Multimediasharing binaries + +; Central repository +;"\epoc32\data\z\private\10202be9\1028238b.txt"-"!:\private\10202BE9\1028238b.txt" + +; Backup registration and restore +;"\epoc32\data\z\private\1028238D\backup_registration.xml"-"!:\private\1028238D\backup_registration.xml" + +; User interface +;"\epoc32\release\armv5\udeb\musui.exe"-"!:\sys\bin\musui.exe" + +"\epoc32\release\armv5\udeb\livecommsui.dll"-"!:\sys\bin\livecommsui.dll" + +;"\epoc32\data\z\resource\apps\musui.rsc"-"!:\resource\apps\musui.rsc" +;"\epoc32\data\z\private\10003a3f\import\apps\musui_reg.rsc"-"!:\private\10003a3f\import\apps\musui_reg.rsc" + +; User interface DOCMLs +;"\epoc32\data\z\data\others\lcidleview.docml"-"!:\data\others\lcidleview.docml" +;"\epoc32\data\z\data\others\lcreceiveview.docml"-"!:\data\others\lcreceiveview.docml" +;"\epoc32\data\z\data\others\lcsendview.docml"-"!:\data\others\lcsendview.docml" +;"\epoc32\data\z\data\others\lctwowayview.docml"-"!:\data\others\lctwowayview.docml" +;"\epoc32\data\z\data\others\lcvtview.docml"-"!:\data\others\lcvtview.docml" +;"\epoc32\data\z\data\others\lcreceiveonlyview.docml"-"!:\data\others\lcreceiveonlyview.docml" + +; General components +;"\epoc32\release\armv5\udeb\musmanagerserver.exe"-"!:\sys\bin\musmanagerserver.exe" +;"\epoc32\release\armv5\udeb\musmanagerclient.dll"-"!:\sys\bin\musmanagerclient.dll" +;"\epoc32\release\armv5\udeb\musindicator.dll"-"!:\sys\bin\musindicator.dll" +;"\epoc32\data\z\resource\musindicator.rsc"-"!:\resource\musindicator.rsc" +;"\epoc32\data\z\private\1028238D\tone.amr"-"!:\private\1028238D\tone.amr" +;"\epoc32\data\z\resource\apps\musindicatoricons.mif"-"!:\resource\apps\musindicatoricons.mif" +;"\epoc32\data\z\resource\apps\musindicatoricons.mbm"-"!:\resource\apps\musindicatoricons.mbm" + +; AlwaysOnline Plugin. +;"\epoc32\release\armv5\udeb\musaoplugin.dll"-"!:\sys\bin\musaoplugin.dll" +;"\epoc32\data\z\Resource\Plugins\musaoplugin.RSC"-"!:\resource\plugins\musaoplugin.RSC" + +; Sip client resolver Plugin +; In VOIP terminals, MuS uses same client resolver plugin as VoIP. +; In all other terminals, a separate resolver plugin is needed. +; So uncomment the below lines if phone do not have VOIP. +;"\epoc32\release\armv5\udeb\mussipcrplugin.dll"-"!:\sys\bin\mussipcrplugin.dll" +;"\epoc32\data\z\Resource\Plugins\mussipcrplugin.RSC"-"!:\resource\plugins\mussipcrplugin.RSC" + +; AIW provider Plugin +;"\epoc32\release\armv5\udeb\musaiwprovider.dll"-"!:\sys\bin\musaiwprovider.dll" +;"\epoc32\data\z\Resource\Plugins\musaiwprovider.RSC"-"!:\resource\plugins\musaiwprovider.RSC" +;"\epoc32\data\z\Resource\musaiwproviderui.RSC"-"!:\resource\musaiwproviderui.RSC" + +; Availability Plugin +;"\epoc32\release\armv5\udeb\musavailabilityplugin.dll"-"!:\sys\bin\musavailabilityplugin.dll" +;"\epoc32\data\z\Resource\Plugins\musavailabilityplugin.RSC"-"!:\resource\plugins\musavailabilityplugin.RSC" + +; Wireless Provisioning Adapter +;"\epoc32\release\armv5\udeb\muswpadapter.dll"-"!:\sys\bin\muswpadapter.dll" +;"\epoc32\data\z\Resource\Plugins\muswpadapter.RSC"-"!:\resource\plugins\muswpadapter.RSC" +;"\epoc32\data\z\Resource\muswpadapterresource.RSC"-"!:\resource\muswpadapterresource.RSC" + +; Settings UI +;"\epoc32\release\armv5\udeb\mussettingsui.dll"-"!:\sys\bin\mussettingsui.dll" +;"\epoc32\data\z\Resource\Plugins\mussettingsui.RSC"-"!:\resource\plugins\mussettingsui.RSC" +;"\epoc32\data\z\Resource\mussettingsuirsc.RSC"-"!:\resource\mussettingsuirsc.RSC" +;"\epoc32\data\z\Resource\apps\mussettingsplugin.mif"-"!:\resource\apps\mussettingsplugin.mif" + +; MCC Transcoder +;"\epoc32\release\armv5\udeb\mmcctranscoder.dll"-"!:\Sys\Bin\mmcctranscoder.dll" +;"\epoc32\data\z\Resource\Plugins\mmcctranscoder.RSC"-"!:\resource\plugins\mmcctranscoder.RSC" + +; Help files +;"\epoc32\data\z\Resource\xhtml\01\0x10282491\contents.zip"-"!:\resource\xhtml\01\0x10282491\contents.zip" +;"\epoc32\data\z\Resource\xhtml\01\0x10282491\keywords.xml"-"!:\resource\xhtml\01\0x10282491\keywords.xml" +;"\epoc32\data\z\Resource\xhtml\01\0x10282491\index.xml"-"!:\resource\xhtml\01\0x10282491\index.xml" +;"\epoc32\data\z\Resource\xhtml\01\0x10282491\meta.xml"-"!:\resource\xhtml\01\0x10282491\meta.xml" + +; Engine +;"\epoc32\release\armv5\udeb\musengineplugin.dll"-"!:\sys\bin\musengineplugin.dll" +;"\epoc32\data\z\resource\plugins\musengineplugin.rsc"-"!:\resource\plugins\musengineplugin.rsc" + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/install/multimediasharing_update_urel.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/install/multimediasharing_update_urel.pkg Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,107 @@ +; +; 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: +; +; A package file for creating an installation file for Multimediasharing +; which updates Multimediasharing binaries from ROM (eclipsing) + +; Supported languages +&en + +#{"MultimediaSharing"},(0x10282491),2,0,0,TYPE=PU + +%{"Vendor-EN"} +:"Nokia" + +(0x101F6F88), 0, 0, 0, {"Series60ProductID"} + +; ----------------------------------------------------------------------------------- + +;Multimediasharing binaries + +; Central repository +;"\epoc32\data\z\private\10202be9\1028238b.txt"-"!:\private\10202BE9\1028238b.txt" + +; Backup registration and restore +;"\epoc32\data\z\private\1028238D\backup_registration.xml"-"!:\private\1028238D\backup_registration.xml" + +; User interface +;"\epoc32\release\armv5\urel\musui.exe"-"!:\sys\bin\musui.exe" + +"\epoc32\release\armv5\urel\livecommsui.dll"-"!:\sys\bin\livecommsui.dll" + +;"\epoc32\data\z\resource\apps\musui.rsc"-"!:\resource\apps\musui.rsc" +;"\epoc32\data\z\private\10003a3f\import\apps\musui_reg.rsc"-"!:\private\10003a3f\import\apps\musui_reg.rsc" + +; User interface DOCMLs +;"\epoc32\data\z\data\others\lcidleview.docml"-"!:\data\others\lcidleview.docml" +;"\epoc32\data\z\data\others\lcreceiveview.docml"-"!:\data\others\lcreceiveview.docml" +;"\epoc32\data\z\data\others\lcsendview.docml"-"!:\data\others\lcsendview.docml" +;"\epoc32\data\z\data\others\lctwowayview.docml"-"!:\data\others\lctwowayview.docml" +;"\epoc32\data\z\data\others\lcvtview.docml"-"!:\data\others\lcvtview.docml" +;"\epoc32\data\z\data\others\lcreceiveonlyview.docml"-"!:\data\others\lcreceiveonlyview.docml" + +; General components +;"\epoc32\release\armv5\urel\musmanagerserver.exe"-"!:\sys\bin\musmanagerserver.exe" +;"\epoc32\release\armv5\urel\musmanagerclient.dll"-"!:\sys\bin\musmanagerclient.dll" +;"\epoc32\release\armv5\urel\musindicator.dll"-"!:\sys\bin\musindicator.dll" +;"\epoc32\data\z\resource\musindicator.rsc"-"!:\resource\musindicator.rsc" +;"\epoc32\data\z\private\1028238D\tone.amr"-"!:\private\1028238D\tone.amr" +;"\epoc32\data\z\resource\apps\musindicatoricons.mif"-"!:\resource\apps\musindicatoricons.mif" +;"\epoc32\data\z\resource\apps\musindicatoricons.mbm"-"!:\resource\apps\musindicatoricons.mbm" + +; AlwaysOnline Plugin. +;"\epoc32\release\armv5\urel\musaoplugin.dll"-"!:\sys\bin\musaoplugin.dll" +;"\epoc32\data\z\Resource\Plugins\musaoplugin.RSC"-"!:\resource\plugins\musaoplugin.RSC" + +; Sip client resolver Plugin +; In VOIP terminals, MuS uses same client resolver plugin as VoIP. +; In all other terminals, a separate resolver plugin is needed. +; So uncomment the below lines if phone do not have VOIP. +;"\epoc32\release\armv5\urel\mussipcrplugin.dll"-"!:\sys\bin\mussipcrplugin.dll" +;"\epoc32\data\z\Resource\Plugins\mussipcrplugin.RSC"-"!:\resource\plugins\mussipcrplugin.RSC" + +; AIW provider Plugin +;"\epoc32\release\armv5\urel\musaiwprovider.dll"-"!:\sys\bin\musaiwprovider.dll" +;"\epoc32\data\z\Resource\Plugins\musaiwprovider.RSC"-"!:\resource\plugins\musaiwprovider.RSC" +;"\epoc32\data\z\Resource\musaiwproviderui.RSC"-"!:\resource\musaiwproviderui.RSC" + +; Availability Plugin +;"\epoc32\release\armv5\urel\musavailabilityplugin.dll"-"!:\sys\bin\musavailabilityplugin.dll" +;"\epoc32\data\z\Resource\Plugins\musavailabilityplugin.RSC"-"!:\resource\plugins\musavailabilityplugin.RSC" + +; Wireless Provisioning Adapter +;"\epoc32\release\armv5\urel\muswpadapter.dll"-"!:\sys\bin\muswpadapter.dll" +;"\epoc32\data\z\Resource\Plugins\muswpadapter.RSC"-"!:\resource\plugins\muswpadapter.RSC" +;"\epoc32\data\z\Resource\muswpadapterresource.RSC"-"!:\resource\muswpadapterresource.RSC" + +; Settings UI +;"\epoc32\release\armv5\urel\mussettingsui.dll"-"!:\sys\bin\mussettingsui.dll" +;"\epoc32\data\z\Resource\Plugins\mussettingsui.RSC"-"!:\resource\plugins\mussettingsui.RSC" +;"\epoc32\data\z\Resource\mussettingsuirsc.RSC"-"!:\resource\mussettingsuirsc.RSC" +;"\epoc32\data\z\Resource\apps\mussettingsplugin.mif"-"!:\resource\apps\mussettingsplugin.mif" + +; MCC Transcoder +;"\epoc32\release\armv5\urel\mmcctranscoder.dll"-"!:\Sys\Bin\mmcctranscoder.dll" +;"\epoc32\data\z\Resource\Plugins\mmcctranscoder.RSC"-"!:\resource\plugins\mmcctranscoder.RSC" + +; Help files +;"\epoc32\data\z\Resource\xhtml\01\0x10282491\contents.zip"-"!:\resource\xhtml\01\0x10282491\contents.zip" +;"\epoc32\data\z\Resource\xhtml\01\0x10282491\keywords.xml"-"!:\resource\xhtml\01\0x10282491\keywords.xml" +;"\epoc32\data\z\Resource\xhtml\01\0x10282491\index.xml"-"!:\resource\xhtml\01\0x10282491\index.xml" +;"\epoc32\data\z\Resource\xhtml\01\0x10282491\meta.xml"-"!:\resource\xhtml\01\0x10282491\meta.xml" + +; Engine +;"\epoc32\release\armv5\urel\musengineplugin.dll"-"!:\sys\bin\musengineplugin.dll" +;"\epoc32\data\z\resource\plugins\musengineplugin.rsc"-"!:\resource\plugins\musengineplugin.rsc" diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/install/multimediasharing_urel.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/install/multimediasharing_urel.pkg Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,90 @@ +; +; 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: +; +; A package file for creating an installation file for Multimediasharing + +; Supported languages +&en + +#{"MultimediaSharing"},(0x10282491),2,0,0,TYPE=SA + +%{"Vendor-EN"} +:"Nokia" + +(0x101F6F88), 0, 0, 0, {"Series60ProductID"} + +; ----------------------------------------------------------------------------------- + +;MUS FILES +;for S60 3.2 + +;MUS CENREP KEY +;"\epoc32\DATA\Z\private\10202be9\1028238b.txt"-"!:\private\10202BE9\1028238b.txt" + +;MUS UI +"\epoc32\release\armv5\urel\musui.exe"-"!:\sys\bin\musui.exe" +"\epoc32\data\z\resource\apps\musui.mbm"-"!:\resource\apps\musui.mbm" +"\epoc32\data\z\resource\apps\musui_aif.mif"-"!:\resource\apps\musui_aif.mif" +"\epoc32\data\z\resource\apps\musuiicons.mif"-"!:\resource\apps\musuiicons.mif" +"\epoc32\data\z\resource\apps\musuitoolbaricons.mif"-"!:\resource\apps\musuitoolbaricons.mif" +"\epoc32\data\z\resource\apps\musui.rsc"-"!:\resource\apps\musui.rsc" +"\epoc32\data\z\private\10003a3f\apps\musui_reg.rsc"-"!:\private\10003a3f\import\apps\musui_reg.rsc" + +;MUS GENERAL +"\epoc32\release\armv5\urel\musmanagerserver.exe"-"!:\sys\bin\musmanagerserver.exe" +"\epoc32\release\armv5\urel\musmanagerclient.dll"-"!:\sys\bin\musmanagerclient.dll" +"\epoc32\release\armv5\urel\musindicator.dll"-"!:\sys\bin\musindicator.dll" +"\epoc32\data\z\resource\musindicator.rsc"-"!:\resource\musindicator.rsc" +"\epoc32\data\z\private\1028238D\tone.amr"-"!:\private\1028238D\tone.amr" +"\epoc32\data\z\resource\apps\musindicatoricons.mif"-"!:\resource\apps\musindicatoricons.mif" +"\epoc32\data\z\resource\apps\musindicatoricons.mbm"-"!:\resource\apps\musindicatoricons.mbm" + +;MUS ECOM PLUGINS + +; Always Online Plugin +"\epoc32\release\armv5\urel\musaoplugin.dll"-"!:\sys\bin\musaoplugin.dll" +"\EPOC32\DATA\Z\Resource\Plugins\musaoplugin.RSC"-"!:\resource\plugins\musaoplugin.RSC" + +; SIP Client Resolver Plugin +"\epoc32\release\armv5\urel\mussipcrplugin.dll"-"!:\sys\bin\mussipcrplugin.dll" +"\EPOC32\DATA\Z\Resource\Plugins\mussipcrplugin.RSC"-"!:\resource\plugins\mussipcrplugin.RSC" + +; AIW Provider Plugin +"\epoc32\release\armv5\urel\musaiwprovider.dll"-"!:\sys\bin\musaiwprovider.dll" +"\EPOC32\DATA\Z\Resource\Plugins\musaiwprovider.RSC"-"!:\resource\plugins\musaiwprovider.RSC" +"\EPOC32\DATA\Z\Resource\musaiwproviderui.RSC"-"!:\resource\musaiwproviderui.RSC" + +; Availability Plugin +"\epoc32\release\armv5\urel\musavailabilityplugin.dll"-"!:\sys\bin\musavailabilityplugin.dll" +"\EPOC32\DATA\Z\Resource\Plugins\musavailabilityplugin.RSC"-"!:\resource\plugins\musavailabilityplugin.RSC" + +; WirelessProvisioning Adapter +"\epoc32\release\armv5\urel\muswpadapter.dll"-"!:\sys\bin\muswpadapter.dll" +"\EPOC32\DATA\Z\Resource\Plugins\muswpadapter.RSC"-"!:\resource\plugins\muswpadapter.RSC" +"\EPOC32\DATA\Z\Resource\muswpadapterresource.RSC"-"!:\resource\muswpadapterresource.RSC" + +;SETTINGS UI +"\epoc32\release\armv5\urel\mussettingsui.dll"-"!:\sys\bin\mussettingsui.dll" +"\EPOC32\DATA\Z\Resource\Plugins\mussettingsui.RSC"-"!:\resource\plugins\mussettingsui.RSC" +"\EPOC32\DATA\Z\Resource\mussettingsuirsc.RSC"-"!:\resource\mussettingsuirsc.RSC" +"\EPOC32\DATA\Z\Resource\apps\mussettingsplugin.mif"-"!:\resource\apps\mussettingsplugin.mif" + +;MCC Transcoder +"\epoc32\RELEASE\armv5\urel\mmcctranscoder.dll"-"!:\Sys\Bin\mmcctranscoder.dll" +"\epoc32\data\Z\Resource\Plugins\mmcctranscoder.RSC"-"!:\resource\plugins\mmcctranscoder.RSC" + +; Livecomms MusEngine +"\epoc32\release\armv5\urel\musengineplugin.dll"-"!:\sys\bin\musengineplugin.dll" +"\epoc32\data\z\resource\plugins\musengineplugin.rsc"-"!:\resource\plugins\musengineplugin.rsc" \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/install/sis_udeb.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/install/sis_udeb.bat Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,17 @@ +rem +rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +rem All rights reserved. +rem This component and the accompanying materials are made available +rem under the terms of "Eclipse Public License v1.0" +rem which accompanies this distribution, and is available +rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +rem +rem Initial Contributors: +rem Nokia Corporation - initial contribution. +rem +rem Contributors: +rem +rem Description: +rem + +makesis multimediasharing_udeb.pkg udeb_multimediasharing.sis diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/install/sis_update_udeb.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/install/sis_update_udeb.bat Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,18 @@ +rem +rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +rem All rights reserved. +rem This component and the accompanying materials are made available +rem under the terms of "Eclipse Public License v1.0" +rem which accompanies this distribution, and is available +rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +rem +rem Initial Contributors: +rem Nokia Corporation - initial contribution. +rem +rem Contributors: +rem +rem Description: +rem + +makesis multimediasharing_update_udeb.pkg udeb_multimediasharing_update.sis + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/install/sis_update_urel.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/install/sis_update_urel.bat Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,17 @@ +rem +rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +rem All rights reserved. +rem This component and the accompanying materials are made available +rem under the terms of "Eclipse Public License v1.0" +rem which accompanies this distribution, and is available +rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +rem +rem Initial Contributors: +rem Nokia Corporation - initial contribution. +rem +rem Contributors: +rem +rem Description: +rem + +makesis multimediasharing_update_urel.pkg urel_multimediasharing_update.sis diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/install/sis_urel.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/install/sis_urel.bat Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,17 @@ +rem +rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +rem All rights reserved. +rem This component and the accompanying materials are made available +rem under the terms of "Eclipse Public License v1.0" +rem which accompanies this distribution, and is available +rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +rem +rem Initial Contributors: +rem Nokia Corporation - initial contribution. +rem +rem Contributors: +rem +rem Description: +rem + +makesis multimediasharing_urel.pkg urel_multimediasharing.sis diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mceclientstub/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mceclientstub/group/bld.inf Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,19 @@ +/* +* 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: +* +*/ + +PRJ_MMPFILES +mceclientstub.mmp \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mceclientstub/group/mceclientstub.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mceclientstub/group/mceclientstub.mmp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,79 @@ +/* +* Copyright (c) 2006-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: Definition of project MceClientStub +* +*/ + + +// To get the APP_LAYER_SYSTEMINCLUDE-definition +#include + +#include +#include + +TARGET mceclientstub.dll +TARGETTYPE dll +UID 0x1000008d 0x00000111 // Experimental UID + +CAPABILITY EUNIT_CAPS +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE mcemanager.cpp +SOURCE mcesession.cpp +SOURCE mceoutsession.cpp +SOURCE mceinsession.cpp +SOURCE mcestreambundle.cpp +SOURCE mcemediastream.cpp +SOURCE mcevideostream.cpp +SOURCE mceaudiostream.cpp +SOURCE mcemediasource.cpp +SOURCE mcecamerasource.cpp +SOURCE mcefilesource.cpp +SOURCE mcefilesink.cpp +SOURCE mcertpsource.cpp +SOURCE mcemediasink.cpp +SOURCE mcedisplaysink.cpp +SOURCE mcertpsink.cpp +SOURCE mcespeakersink.cpp +SOURCE mcecodec.cpp +SOURCE mceaudiocodec.cpp +SOURCE mceamrcodec.cpp +SOURCE mcevideocodec.cpp +SOURCE mceh263codec.cpp +SOURCE mceavccodec.cpp +SOURCE mcetransactiondatacontainer.cpp +SOURCE staticdllentry.cpp + +SOURCEPATH ../../sipprofilestub/src +SOURCE sipprofileregistrybasestub.cpp +SOURCE sipprofileregistrystub.cpp +SOURCE sipprofilestub.cpp + + +USERINCLUDE ../inc +USERINCLUDE ../../sipprofilestub/inc + + +// to replace SIP profiles with a stub +SYSTEMINCLUDE ../../sipprofilestub/inc + +// Default system include paths for application layer modules. +APP_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY bafl.lib + + +EXPORTUNFROZEN \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mceclientstub/inc/mceamrcodec.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mceclientstub/inc/mceamrcodec.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,182 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef CMCEAMRCODEC_H +#define CMCEAMRCODEC_H + +// INCLUDES +#include +#include + +// CONSTANTS +const TInt KMceAmrNbBitrate475 = 4750; +const TInt KMceAmrNbBitrate515 = 5150; +const TInt KMceAmrNbBitrate590 = 5900; +const TInt KMceAmrNbBitrate670 = 6700; +const TInt KMceAmrNbBitrate740 = 7400; +const TInt KMceAmrNbBitrate795 = 7950; +const TInt KMceAmrNbBitrate102 = 10200; +const TInt KMceAmrNbBitrate122 = 12200; + +const TUint KMceAllowedAmrNbBitrate475 = 0x0001; +const TUint KMceAllowedAmrNbBitrate515 = 0x0002; +const TUint KMceAllowedAmrNbBitrate590 = 0x0004; +const TUint KMceAllowedAmrNbBitrate670 = 0x0008; +const TUint KMceAllowedAmrNbBitrate740 = 0x0010; +const TUint KMceAllowedAmrNbBitrate795 = 0x0020; +const TUint KMceAllowedAmrNbBitrate102 = 0x0040; +const TUint KMceAllowedAmrNbBitrate122 = 0x0080; +const TUint KMceAllowedAmrNbBitrateAll = 0x00FF; + +const TUint KMceAmrNbSamplingFreq = 8000; +const TUint KMceAmrWbSamplingFreq = 16000; + +const TUint KMceDefaultMaxPtime = 400; +const TUint KMceDefaultPtime = 20; + +// DATA TYPES +enum TAmrCodecMode + { + EMceBandwidthEfficient = 4, + EMceOctetAligned + }; + +// CLASS DECLARATION + +/** +* Class for the AMR codec information. +* +* It checks the validity of inserted values for AMR. +* +* @lib mceclient.lib +*/ +class CMceAmrCodec : public CMceAudioCodec + { + public: // Constructors and destructor + + /** + * Destructor. + */ + IMPORT_C ~CMceAmrCodec(); + + public: // From base class + + /** + * Enable / Disable Voice Activity Detection. + * @param aEnableVAD, Boolean indicating whether to enable Voice Activity Detection + * @return KErrNotSupported if codec doesn't support VAD; otherwise KErrNone. + */ + IMPORT_C TInt EnableVAD(TBool aEnableVAD); + + /** + * Sets bitrate used with codec for encoding. + * @param aBitrate, bitrate value for encoding + * @return KErrNotSupported if codec doesn't support bitrate value issued; otherwise KErrNone. + */ + IMPORT_C TInt SetBitrate(TUint aBitrate); + + /** + * Sets bitrates allowed with codec. + * @param aBitrates, allowed bitrate values (like KMceAmrNbBitrate590|KMceAmrNbBitrate670) + * @return KErrNotSupported if codec doesn't support bitrate value issued; otherwise KErrNone. + */ + IMPORT_C TInt SetAllowedBitrates(TUint aBitrates); + + /** + * Sets the sampling frequency. + * @param aSamplingFreq, Sampling frequency to be used + * @return KErrNotSupported if codec doesn't support sampling frequency issued; otherwise KErrNone. + */ + IMPORT_C TInt SetSamplingFreq(TUint aSamplingFreq); + + /** + * Sets the packetization rate. + * @param aPTime, Packetization rate, must be multiple of audio frame size. + * @return KErrNotSupported if codec doesn't support packetrate value issued; otherwise KErrNone. + */ + IMPORT_C TInt SetPTime(TUint aPTime); + + /** + * Sets the maximum packetization rate. + * @param aMaxPTime, maximum allowed packetization rate, must be multiple of audio frame size. + * @return KErrNotSupported if codec doesn't support packetrate value issued; otherwise KErrNone. + */ + IMPORT_C TInt SetMaxPTime(TUint aMaxPTime); + + /** + * Sets the payload type identifier. + * @param aPayloadType payload type identifier. + * @return One of the standard system-wide error codes. + */ + IMPORT_C TInt SetPayloadType(TUint8 aPayloadType); + + /** + * Sets the codec mode. + * @param aCodecMode Codec mode ( Bandwidth efficient / octet aligned ) + * @return KErrNotSupported if codec doesnt' support codec mode value issued; otherwise KErrNone. + */ + IMPORT_C TInt SetCodecMode(TUint aCodecMode); + + /** + * Clones codec, ownership is transferred. + * @return cloned codec + */ + IMPORT_C CMceAudioCodec* CloneL() const; + + public: + + /** + * Two-phased constructor. + * @param aSdpName sdp name + */ + static CMceAmrCodec* NewL( TBuf8 aSdpName); + + /** + * Two-phased constructor. + * @param aSdpName sdp name + */ + static CMceAmrCodec* NewLC(TBuf8 aSdpName); + + + private: + + /** + * C++ default constructor. + */ + CMceAmrCodec(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL( TBuf8 aSdpName); + + /** + * Sets the sdp name. + * @param aSdpName the sdp name + */ + void SetSdpNameL( const TDesC8& aSdpName ); + + //for testing + + MCE_UNIT_TEST_DEFS + }; + + +#endif + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mceclientstub/inc/mceaudiocodec.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mceclientstub/inc/mceaudiocodec.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,161 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef CMCEAUDIOCODEC_H +#define CMCEAUDIOCODEC_H + +// INCLUDES +#include +#include +#include + +// FORWARD DECLARATIONS +class RReadStream; +class RWriteStream; +class CMceComAudioCodec; +class CMceMediaStream; +class TMceIds; +class TMceEvent; +class TMceMediaId; +class TMceFactory; +class TMceAudioCodecFactory; + +// CLASS DECLARATION + +/** +* Container class for audio codecs. +* +* It defines attributes that can be set and get from audio codec. +* These attributes are used in single audio stream and they +* are negotiated with remote terminal. +* +* @lib mceclient.lib +*/ +class CMceAudioCodec : public CMceCodec + { + public: // Constructors and destructor + + /** + * Destructor. + */ + virtual ~CMceAudioCodec(); + + public: // New functions + + /** + * Enable / Disable Voice Activity Detection. + * @param aEnableVAD, Boolean indicating whether to enable Voice Activity Detection + * @return KErrNotSupported if codec doesn't support VAD; otherwise KErrNone. + */ + virtual TInt EnableVAD(TBool aEnableVAD) = 0; + + /** + * Sets the sampling frequency. + * @param aSamplingFreq, Sampling frequency to be used + * @return KErrNotSupported if codec doesn't support sampling frequency issued; otherwise KErrNone. + */ + virtual TInt SetSamplingFreq(TUint aSamplingFreq) = 0; + + /** + * Sets the packetization rate. + * @param aPTime, Packetization rate, must be multiple of audio frame size. + * @return KErrNotSupported if codec doesn't support packetrate value issued; otherwise KErrNone. + */ + virtual TInt SetPTime(TUint aPTime) = 0; + + /** + * Sets the maximum packetization rate. + * @param aMaxPTime, maximum allowed packetization rate, must be multiple of audio frame size. + * @return KErrNotSupported if codec doesn't support packetrate value issued; otherwise KErrNone. + */ + virtual TInt SetMaxPTime(TUint aMaxPTime) = 0; + + /** + * Clones codec, ownership is transferred. + * @return cloned codec + */ + virtual CMceAudioCodec* CloneL() const = 0; + + /** + * Gets sampling frequency used currently. + * @return Sampling frequency + */ + virtual TUint SamplingFreq() const; + + /** + * Get VAD status. + * @return Boolean indicating is VAD activated + */ + virtual TBool VAD() const; + + /** + * Gets the packetization rate. + * @return packetization rate. + */ + virtual TUint PTime() const; + + /** + * Gets max packetization rate. + * @return Max packetization rate. + */ + virtual TUint MaxPTime() const; + + public: + + /** + * Initializes + * @param aParent the parent + */ + virtual void InitializeL( CMceMediaStream& aParent ); + + + protected: // New functions + + /** + * C++ default constructor. + */ + CMceAudioCodec(); + + + public: // stub data + + /** + * Enables or disables VAD + */ + TBool iEnableVAD; + + /** + * Sampling frequency used with codec + */ + TUint iSamplingFreq; + + /** + * Stream's packet time + */ + TUint iPTime; + + /** + * Stream's max packet time + */ + TUint iMaxPTime; + }; + + +#endif + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mceclientstub/inc/mceaudiostream.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mceclientstub/inc/mceaudiostream.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,122 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef CMCEAUDIOSTREAM_H +#define CMCEAUDIOSTREAM_H + +// INCLUDES +#include +#include + +// CONSTANTS +const TMceMediaType KMceAudio = 1; + +// FORWARD DECLARATIONS +class CMceAudioCodec; + +// CLASS DECLARATION + +/** +* Class for representing unidirectional audio stream. +* +* It defines the used audio codecs for the stream. +* In order to be complete structure, at least one codec is required. +* +* @lib mceclient.lib +*/ +class CMceAudioStream: public CMceMediaStream + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CMceAudioStream* NewL(); + + /** + * Two-phased constructor. + */ + IMPORT_C static CMceAudioStream* NewLC(); + + /** + * Destructor. + */ + IMPORT_C ~CMceAudioStream(); + + public: // Functions + + /** + * Returns the available codecs to the session. + * For CMEOutSession, array contains all codecs supported by + * terminal in default. For CMEInSession, array contains codecs + * that were offered by remote terminal, and supported by local terminal. + * @return codecs available for the session. + */ + IMPORT_C const RPointerArray& Codecs(); + + /** + * Adds codec to the stream, ownership is transferred. + * @param aCodec codec added to the stream + */ + IMPORT_C void AddCodecL( CMceAudioCodec* aCodec ); + + /** + * Removes codec from the stream + * @param aCodec codec removed from stream + */ + IMPORT_C void RemoveCodecL( CMceAudioCodec& aCodec ); + + + public: //from CMceMediaStream + + /** + * Initializes + * @param aParent the parent + */ + void InitializeL( CMceSession& aParent ); + + /** + * Initializes + * @param aManager the manager. Ownership is NOT transferred + */ + void InitializeL( CMceManager* aManager ); + + + private: //methods + + /** + * C++ default constructor. + */ + CMceAudioStream(); + + /** + * Second-phase constructor. + */ + void ConstructL(); + + + private: // Owned data + + /** + * codecs + */ + RPointerArray iCodecs; + + }; + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mceclientstub/inc/mceavccodec.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mceclientstub/inc/mceavccodec.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,243 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef MCEAVCCODEC_H +#define MCEAVCCODEC_H + +// INCLUDES +#include +#include + +// CONSTANTS + +const TUint KMceAvcClockRate = 90000; + +// Allowedbitrates bitfield combines avc profile-level-id information in +// similar manner as defined in RFC 3984. Most significant byte stores +// profile-id value, seconds significant byte contains profile-iop value and +// last two bytes contain profile-level information. +// +const TUint KMceAvcBitrateLevel1 = 0x0001; +const TUint KMceAvcBitrateLevel1b = 0x0002; +const TUint KMceAvcBitrateLevel1_1 = 0x0004; +const TUint KMceAvcBitrateLevel1_2 = 0x0008; +const TUint KMceAvcBitrateLevel1_3 = 0x0010; +const TUint KMceAvcBitrateLevel2 = 0x0020; + +const TUint KMceAvcCodecProfileIopConstraintSet = 0x0100; +const TUint KMceAvcCodecProfileIopConstraintSet1 = 0x0200; +const TUint KMceAvcCodecProfileIopConstraintSet2 = 0x0400; + +const TUint KMceAvcCodecProfileIdBaseline = 0x1000; +const TUint KMceAvcCodecProfileIdMain = 0x2000; +const TUint KMceAvcCodecProfileIdExtended = 0x4000; +const TUint KMceAvcCodecProfileIdHigh = 0x8000; + +const TUint KMceAllowedAvcBitrateAll = 0x00FF; + +// Different framerates may be supported depending on profile level. +// +const TUint KMceAvcFrameRate7_5 = 0x0001; +const TUint KMceAvcFrameRate12_5 = 0x0002; +const TUint KMceAvcFrameRate15 = 0x0004; +const TUint KMceAvcFrameRate30 = 0x0008; +const TUint KMceAvcFrameRate36 = 0x0010; + +const TUint KMceAllowedAvcFrameRateAll = 0x00FF; + +// Different resolutions may be supported depending on profile level. +// +const TUint KMceAvcResolution176x144 = 0x0001; +const TUint KMceAvcResolution320x240 = 0x0002; +const TUint KMceAvcResolution352x288 = 0x0004; + +const TUint KMceAllowedAvcResolutionAll = 0x000F; + + +// DATA TYPES +enum TAvcCodecMode + { + KMceAvcModeSingleNal, + KMceAvcModeNonInterleaved, + KMceAvcModeInterleaved + }; + + +// CLASS DECLARATION + +/** +* Class for the H264 codec information. +* +* It checks the validity of inserted values for H264 +* +* @lib mceclient.lib +*/ +class CMceAvcCodec : public CMceVideoCodec + { + + public: // Constructors and destructor + + /** + * Destructor. + */ + IMPORT_C ~CMceAvcCodec(); + + public: + + /** + * Two-phased constructor. + * @param aSdpName sdp name + */ + IMPORT_C static CMceAvcCodec* NewL( TBuf8 aSdpName); + + /** + * Two-phased constructor. + * @param aSdpName sdp name + */ + IMPORT_C static CMceAvcCodec* NewLC( TBuf8 aSdpName ); + + public: // From base classes + + /** + * Sets bitrate used with codec for encoding. + * @param aBitrate bitrate value for encoding + * @return KErrNotSupported if codec doesn't support bitrate + * value issued + */ + virtual TInt SetBitrate( TUint aBitrate ); + + /** + * Sets bitrates allowed with codec. + * @param aBitrates allowed bitrate values + * @return KErrNotSupported if codec doesn't support bitrate + * values issued + */ + virtual TInt SetAllowedBitrates( TUint aBitrates ); + + /** + * Sets the codec specific mode. + * @param aCodecMode mode of the codec + * @return KErrNotSupported if codec doesnt' support codec mode + * value issued + */ + virtual TInt SetCodecMode( TUint aCodecMode ); + + /** + * Sets the payload type. + * @param aPayloadType type identifier of the payload + * @return KErrNotSupported if codec doesn't support payload type issued + */ + virtual TInt SetPayloadType( TUint8 aPayloadType ); + + /** + * Clones the codec. + * @return cloned codec; ownership is transferred + */ + virtual CMceVideoCodec* CloneL() const; + + /** + * Sets maximum bitrate of the codec. + * @param aMaxBitrate value of maximum bitrate used for encoding + * @leave KErrNotSupported if codec doesn't support frame sizes issued + */ + virtual void SetMaxBitrateL( TUint aMaxBitrate ); + + /** + * Sets resolutions allowed with the codec. + * @param aResolutions bitfield of allowed resolutions + * @leave KErrNotSupported if codec doesn't support resolutions issued + */ + virtual void SetAllowedResolutionsL( TUint aResolutions ); + + /** + * Sets resolution of the video. + * @param aResolution resolution of the video in pixels + * @leave KErrNotSupported if codec doesn't support resolution issued + */ + virtual void SetResolutionL( TSize aResolution ); + + /** + * Sets frame rates allowed with the codec. + * @param aFrameRates allowed frame rate values as a bitfield + * @leave KErrNotSupported if codec doesn't support frame rates issued + */ + virtual void SetAllowedFrameRatesL( TUint aFrameRates ); + + /** + * Sets frame rate used with the codec for encoding. + * @param aFrameRate frame rate for encoding + * @leave KErrNotSupported if codec doesn't support frame rate value + * issued + */ + virtual void SetFrameRateL( TReal aFrameRate ); + + /** + * Sets preferred encoding device for uplink stream and preferred decoding + * device for downlink stream. + * @param aEncodingDecodingDevice + * @leave KErrNotSupported if setting preferred device is not possible + */ + virtual void SetPreferredEncodingDecodingDeviceL( + TUid aEncodingDecodingDevice ); + + /** + * Set config key (sprop-parameter-sets) + * @param aConfigKey, config key as Base64 encoded + * @leave KErrNotSupported if setting config key is not possible + */ + virtual void SetConfigKeyL( const TDesC8& aConfigKey ); + + + private: // Helper functions + + /** + * Sets the sdp name. + * @param aSdpName the sdp name + */ + void SetSdpNameL( const TDesC8& aSdpName ); + + private: // Constructors + + /** + * C++ default constructor. + */ + CMceAvcCodec(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL( TBuf8 aSdpName); + + + public: // Stub data + + TUint8 iPacketizationMode; + + TUint8 iAllowedPacketizationModes; + + + //for testing + + MCE_UNIT_TEST_DEFS + + }; + + +#endif + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mceclientstub/inc/mcecamerasource.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mceclientstub/inc/mcecamerasource.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,248 @@ +/* +* 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: +* +*/ + + +#ifndef MCECAMERASOURCE_H +#define MCECAMERASOURCE_H + +// INCLUDES +#include +#include +#include "mcemediasource.h" + +// CONSTANTS +const TMceSourceType KMceCameraSource = 3; + +//FORWARD DECLARATIONS +class CMceManager; +class CMceItcSender; + +// CLASS DECLARATION + +/** +* Class representing camera in MCE. +* +* CMceCameraSource can be used to record video from camera. +* +* Enable (continue) and Disable (pause) operations to it are considered +* to be local, so they are not signalled to remote terminal. +* +* In common situation camera source is combined with display sink which acts +* as a viewfinder for the camera. +* +* @lib mceclient.lib +*/ +class CMceCameraSource : public CMceMediaSource + { + friend class UT_CMusEngLiveSession; + friend class UT_CMusEngTwoWaySession; + friend class UT_TMusEngCameraHandler; + + public: // Constructors and destructor + + /** + * Two-phased constructor. + * @param aManager reference to the manager + */ + IMPORT_C static CMceCameraSource* NewL( CMceManager& aManager ); + + /** + * Two-phased constructor. + * @param aManager reference to the manager + */ + IMPORT_C static CMceCameraSource* NewLC( CMceManager& aManager ); + + /// Not in the real implementation + IMPORT_C static CMceCameraSource* NewL(); + + /// Not in the real implementation + IMPORT_C static CMceCameraSource* NewLC(); + + /** + * Destructor. + */ + IMPORT_C ~CMceCameraSource(); + + public: // From CMceMediaSource + + /** + * Enables the source explicitly. + */ + IMPORT_C void EnableL(); + + /** + * Disables the source explicitly. + */ + IMPORT_C void DisableL(); + + public: // New functions + + /** + * Gets the number of cameras on the device. + * @return number of available cameras + */ + IMPORT_C TInt CamerasAvailable() const; + + /** + * Sets index of physical camera to be used. + * @param aCameraIndex, index of the camera to be used; First camera has + * index 0 and number of available cameras can be retrieved by + * calling CMceCameraSource::CamerasAvailable + */ + IMPORT_C void SetCameraIndexL( TInt aCameraIndex ); + + /** + * Gets information about the camera device. + * @param aInfo on return information about the camera device + */ + IMPORT_C void GetCameraInfo( TCameraInfo& aInfo ) const; + + /** + * Sets the zoom factor. + * This must be in the range of TCameraInfo::iMinZoom to + * TCameraInfo::iMaxZoom inclusive. + * @param aZoomFactor required zoom factor + * @leave KErrArgument if the specified zoom factor is out of range + */ + IMPORT_C void SetZoomFactorL( TInt aZoomFactor ); + + /** + * Gets the currently set zoom factor. + * @return current zoom factor + */ + IMPORT_C TInt ZoomFactorL(); + + /** + * Sets the digital zoom factor. + * This must be in the range of 0 to TCameraInfo::iMaxDigitalZoom + * inclusive. + * @param aDigitalZoomFactor The required digital zoom factor + * @leave KErrArgument if the zoom factor is out of range + */ + IMPORT_C void SetDigitalZoomFactorL( TInt aDigitalZoomFactor ); + + /** + * Gets the currently set digital zoom factor. + * @return current digital zoom factor + */ + IMPORT_C TInt DigitalZoomFactorL(); + + /** + * Sets the contrast adjustment of the device. + * @param aContrast required contrast value; This must be in the + * range of -100 to +100 or CCamera::EContrastAuto. + * @leave KErrNotSupported if contrast adjustment is not supported, + * see TCameraInfo::TOptions + * @leave KErrArgument if the specified contrast value is out of + * range + */ + IMPORT_C void SetContrastL( TInt aContrast ); + + /** + * Gets the current contrast value. + * @return current contrast value + */ + IMPORT_C TInt ContrastL(); + + /** + * Sets the brightness adjustment of the device. + * No effect if this is not supported, see TCameraInfo::TOptions. + * + * @param aBrightness required brightness adjustment; This must be + * in the range of -100 to +100 or CCamera::EBrightnessAuto + * @leave KErrNotSupported if brightness adjustment is not supported, + * see TCameraInfo::TOptions + * @leave KErrArgument if the brightness adjustment is out of range + */ + IMPORT_C void SetBrightnessL( TInt aBrightness ); + + /** + * Gets the currently set brightness adjustment value. + * @return current brightness adjustment value + */ + IMPORT_C TInt BrightnessL(); + + /** + * Sets the exposure adjustment of the device. + * @param aExposure required exposure adjustment + * @leave KErrNotSupported if the specified exposure adjustment is + * not supported, see CameraInfo::iExposureModesSupported + */ + IMPORT_C void SetExposureL( CCamera::TExposure aExposure ); + + /** + * Gets the currently set exposure setting value. + * @return current exposure setting value + */ + IMPORT_C CCamera::TExposure ExposureL(); + + /** + * Sets the white balance adjustment of the device. + * @param aWhiteBalance required white balance adjustment + * @leave KErrNotSupported if the specified white balance adjustment is + * not supported, see TCameraInfo::iWhiteBalanceModesSupported + */ + IMPORT_C void SetWhiteBalanceL( CCamera::TWhiteBalance aWhiteBalance ); + + /** + * Gets the currently set white balance adjustment value. + * @return current white balance adjustment value + */ + IMPORT_C CCamera::TWhiteBalance WhiteBalanceL(); + + public: // internal + + /** + * Initializes + * @param aManager the manager. Ownership is NOT transferred + */ + void InitializeL( CMceManager* aManager ); + + private: + + /** + * C++ constructor. + */ + CMceCameraSource(); + + private: // Owned data + + TCameraInfo iCameraInfo; + + private: // Not owned data + + //CMceManager* iManager; + + private: // Reserved for future use + + TAny* iReserved; + + + public: // stub data + + TInt iCameraIndex; + TInt iCameraCount; + TInt iZoomFactor; + TInt iDigitalZoomFactor; + TInt iContrast; + TInt iBrightness; + TInt iExposure; + TInt iWhiteBalance; + + }; + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mceclientstub/inc/mcecodec.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mceclientstub/inc/mcecodec.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,412 @@ +/* +* 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: +* +*/ + + +#ifndef MCECODEC_H +#define MCECODEC_H + +// INCLUDES +#include +#include "mcedefs.h" + +// FORWARD DECLARATIONS +class RReadStream; +class RWriteStream; +class CMceComCodec; + +class CMceMediaStream; +class TMceEvent; +class TMceMediaId; +class TMceFactory; + +// DATA TYPES +typedef TUint TMceCodecType; + + +// CLASS DECLARATION + +/** +* Base class for codecs. +* +* It defines setters and getters for generic codec attributes. +* +* In some systems certain device resources cannot be shared. For example +* speaker of the device might not be able to play simultaneously several +* differently encoded audio streams. Or only one client at the time +* could use the camera of the device. Codec states can be used to overcome +* situations where single codec would occupy some resource for excessive +* period of time or permanently. +* +* Codec can be in one of the three states: +* +* When codec is in state EEnabled, resources, associated with the codec, +* are reserved for the codec and in some cases cannot be used by other +* software components. Precondition for reserving resources for the codec +* is that associated device resource (e.g. speaker sink of downlink or +* camera source of uplink) is also enabled. +* +* When codec is in state EStandby, resources are not reserved for the codec +* and therefore can be used by other software components. If the stream +* (uplink or downlink), into which this codec is attached, encounters data +* encoded with the codec, codec in state EStandby is tried to be enabled. +* If enabling succeeds, codec state changes to EEnabled and associated +* resources are reserved. +* +* When codec is in state EDisabled, resources are not reserved for the codec +* and are not even tried to be reserved. +* +* @lib mceclient.lib +*/ +class CMceCodec : public CBase + { + + public: // Codec states + + enum TState + { + EDisabled, + EStandby, + EEnabled + }; + + public: // Constructors and destructor + + /** + * Destructor. + */ + virtual ~CMceCodec(); + + public: // New functions + + /** + * Sets bitrate used with codec for encoding. + * @param aBitrate bitrate value for encoding + * @return KErrNotSupported if codec doesn't support bitrate + * value issued + */ + virtual TInt SetBitrate( TUint aBitrate ) = 0; + + /** + * Sets bitrates allowed with codec. + * @param aBitrates allowed bitrate values + * @return KErrNotSupported if codec doesn't support bitrate + * values issued + */ + virtual TInt SetAllowedBitrates( TUint aBitrates ) = 0; + + /** + * Sets the codec specific mode. + * @param aCodecMode mode of the codec + * @return KErrNotSupported if codec doesnt' support codec mode + * value issued + */ + virtual TInt SetCodecMode( TUint aCodecMode ) = 0; + + /** + * Sets the payload type. + * @param aPayloadType type identifier of the payload + * @return KErrNotSupported if codec doesn't support payload type issued + */ + virtual TInt SetPayloadType( TUint8 aPayloadType ) = 0; + + + public: // New functions + + /** + * Sets the state of the codec. + * @param aState desired codec state + */ + IMPORT_C void SetStateL( CMceCodec::TState aState ); + + /** + * Sets the timer period in seconds from starting of inactivity + * to automatically changing to state CMceCodec::EStandby . + * @param aTimerValue timer period in seconds + */ + IMPORT_C void SetStandByTimerL( TUint32 aTimerValue ); + + /** + * Sets MMF priority value for the codec. + * @param aPriority priority of the codec + */ + IMPORT_C void SetMMFPriorityL( TInt aPriority ); + + /** + * Sets MMF priority preference value for the codec. + * @param aPriorityPreference priority preference of the codec + */ + IMPORT_C void SetMMFPriorityPreferenceL( TInt aPriorityPreference ); + + /** + * Set keep alive packets send timer value. + * @param aTimerValue timer value in ms for keep alive packets + * @return One of the standard system-wide error codes. + */ + IMPORT_C void SetKeepAliveTimerL( TUint8 aTimerValue ); + + /** + * Set keep alive packets payload type. + * @param aKeepAlivePT payload type for keep alive packets + * @return One of the standard system-wide error codes. + */ + IMPORT_C void SetKeepAlivePayloadTypeL( TUint8 aKeepAlivePT ); + + /** + * Set keep alive packets payload data. + * @param aData payload data for keep alive packets + * @return One of the standard system-wide error codes. + */ + IMPORT_C void SetKeepAliveDataL( const TDesC8& aData ); + + + public: // Getters + + /** + * Gets the state of the codec + * @return state of the codec + */ + IMPORT_C CMceCodec::TState State() const; + + /** + * Media id of the codec. + * @return media id + */ + //IMPORT_C TMceMediaId Id() const; + + /** + * Type of the codec + * @return codec type + */ + IMPORT_C TMceCodecType Type() const; + + /** + * Gets codec fourCC. + * @return fourCC value + */ + IMPORT_C TUint32 FourCC() const; + + /** + * Gets current bitrate. + * @return bitrate value + */ + IMPORT_C TUint Bitrate() const; + + /** + * Gets allowed bitrate values. + * @return bitrate values + */ + IMPORT_C TUint AllowedBitrates() const; + + /** + * Gets current frame size of the codec. + * @return size of single frame used by the codec + */ + IMPORT_C TUint FrameSize() const; + + /** + * Gets the codec mode. + * @return codec mode + */ + IMPORT_C TUint CodecMode() const; + + /** + * Gets the payload type identifier. + * @return payload type used + */ + IMPORT_C TUint8 PayloadType() const; + + /** + * Gets the sdp name. + * @return sdp name of the codec + */ + IMPORT_C const TDesC8& SdpName() const; + + /** + * Gets MMF priority + * @return MMF priority + */ + IMPORT_C TInt MMFPriority() const; + + /** + * Gets MMF priority preference + * @return current MMFPriorityPreference + */ + IMPORT_C TInt MMFPriorityPreference() const; + + /** + * Gets keep alive packets send timer value. + * @return keep alive packets send timer value (ms). + */ + IMPORT_C TUint8 KeepAliveTimer() const; + + /** + * Gets keep alive packets payload type. + * @return keep alive packets payload type. + */ + IMPORT_C TUint8 KeepAlivePayloadType() const; + + /** + * Gets keep alive packets payload data. + * @return keep alive packets payload data. + */ + IMPORT_C const TDesC8& KeepAliveData() const; + + + public: // Preference manipulation + + /** + * Gets the preference value. + * @return preference value of the codec + */ + IMPORT_C TInt Preference() const; + + /** + * Sets the preference value used in media negotiation. + * Codec with preference value 0 is considered as the most preferenced + * codec. Preference of codecs with the same preference value is + * determined by order they were added to the stream. + * @param aPreference preference value of the codec + */ + IMPORT_C void SetPreferenceL( TInt aPeference ); + + + public: // Internal + + /** + * Initializes the codec. + * @param aParent the parent + */ + virtual void InitializeL( CMceMediaStream& aParent ); + + + + protected: // New functions + + /** + * Sets the sdp name. + * @param aSdpName sdp name for the codec + */ + virtual void SetSdpNameL( const TDesC8& aSdpName ) = 0; + + /** + * C++ default constructor. + */ + CMceCodec(); + + protected: // Data + + /** + * Codec type. + */ + TMceCodecType iType; + + protected: // NOT owned data + + /** + * Parent stream, not owned. + */ + CMceMediaStream* iStream; + + private: // Reserved for future use + + TAny* iReserved; + + public: // stub data + + /** + * type of session + */ + //TMceMediaId iID; + + /** + * Fmtp attribute + */ + HBufC8* iFmtpAttr; + + /** + * Sdp name used in SDP messages + */ + TBuf8 iSdpName; + + /** + * Payload type + */ + TUint8 iPayloadType; + + /** + * Is enabled + */ + TBool iIsEnabled; + + /** + * Stream's bit rate + */ + TUint iBitrate; + + /** + * Stream's allowed bit rates + */ + TUint32 iAllowedBitrates; + + /** + * Codec mode ( e.g. PCMU, PCMA, Bandwidth efficient, octet aligned ) + */ + TUint32 iCodecMode; + + /** + * Codec FourCC + */ + TUint32 iFourCC; + + /** + * Codecs frame size + */ + TUint iFrameSize; + + /** + * + */ + TInt iMMFPriority; + + /** + * + */ + TInt iMMFPriorityPreference; + + /** + * + */ + TUint8 iKeepAliveTimer; + + /** + * Codecs frame size + */ + TUint8 iKeepAlivePayloadType; + + /** + * + */ + TBuf8<10> iKeepAliveData; + + TInt iPreference; + + }; + + +#endif + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mceclientstub/inc/mcedefs.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mceclientstub/inc/mcedefs.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,97 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef MCEDEFS_H +#define MCEDEFS_H + +#include + +const TInt KMceMaxSdpNameLength = 20; +const TUint8 KMceMaxPacketrate = 10; +const TInt KMcePTimeFactor = 1000; + +const TInt KMceMaxSizeInReadStream = 1000; +const TInt KMceExternalizeBufferExpandSize = 100; +const TInt KMceArrayGranularity = 5; + + +_LIT8( KMceSDPNamePCMU, "PCMU" ); +_LIT8( KMceSDPNamePCMA, "PCMA" ); +_LIT8( KMceSDPNameAMR, "AMR" ); + +_LIT8( KMceSDPNameH263, "H263" ); +_LIT8( KMceSDPNameH2632000, "H263-2000" ); +_LIT8( KMceSDPNameH2631998, "H263-1998" ); +_LIT8( KMceSDPNameH264, "H264" ); + +typedef TInt TMceReturnStatus; +const TMceReturnStatus KMceAsync = 1; +const TMceReturnStatus KMceReady = 0; + +// SESSION MODIFIERS + +/** +* Data type for session modifiers. +*/ +typedef TUint32 TMceSessionModifier; + + +/** +* Usage of QOS preconditions within session; +* This modifier can be set only when session is in state MceSession::EIdle. +* By default, session is in preconditions supported mode. +* +* KMcePreconditionsNotUsed indicates that preconditions are not used. +* KMcePreconditionsSupported indicates that preconditions are supported +*/ +// KEY +const TMceSessionModifier KMcePreconditions = 0; +// VALUES +const TUint KMcePreconditionsNotUsed = 0; +const TUint KMcePreconditionsSupported = 1; + +/** +* Usage of reliable provisional responses (aka 100rel) within session. +* This modifier can be set only when session is in state MceSession::EIdle +* or MceSession::EIncoming. +* By default, session is in 100rel supported mode. +* +* KMce100RelNotUsed indicates that 100rel is not used. +* KMce100RelSupported indicates that 100rel is supported. +* KMce100RelRequired indicates that 100rel is required. +*/ +// KEY +const TMceSessionModifier KMce100Rel = 1; +// VALUES +const TUint KMce100RelNotUsed = 0; +const TUint KMce100RelSupported = 1; +const TUint KMce100RelRequired = 2; + + + +#ifdef __MWERKS__ +#pragma warn_emptydecl off +#endif + +#ifdef MCE_UNIT_TEST +#include "mcetestdefs.h" +#else +#define MCE_UNIT_TEST_DEFS +#endif + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mceclientstub/inc/mcedisplaysink.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mceclientstub/inc/mcedisplaysink.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,194 @@ +/* +* 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: +* +*/ + + +#ifndef MCEDISPLAYSINK_H +#define MCEDISPLAYSINK_H + +// INCLUDES +#include "mcemediasink.h" + +// FORWARD DECLARATIONS +class CMceManager; +class RWindow; +class CWindowGc; + +// DATA TYPES +const TMceSinkType KMceDisplaySink = 3; + + +// CLASS DECLARATION + +/** +* Class representing display in MCE. +* +* CMceDisplaySink can be used to show video on screen or as a viewfinder +* of the camera. +* +* Enable and Disable operations to it are considered to be local, +* so they are not signalled to remote terminal. +* +* @lib mceclient.lib +*/ +class CMceDisplaySink : public CMceMediaSink + { + + public: + + enum TRotation + { + ENone, + EClockwise90Degree, + EClockwise180Degree, + EClockwise270Degree + }; + + public: // Constructors and destructor + + /** + * Two-phased constructor. + * @param aManager reference to the manager + */ + IMPORT_C static CMceDisplaySink* NewL( CMceManager& aManager ); + + /** + * Two-phased constructor. + * @param aManager reference to the manager + */ + IMPORT_C static CMceDisplaySink* NewLC( CMceManager& aManager ); + + /// Not in the real implementation + IMPORT_C static CMceDisplaySink* NewL(); + + /// Not in the real implementation + IMPORT_C static CMceDisplaySink* NewLC(); + + /** + * Destructor. + */ + IMPORT_C ~CMceDisplaySink(); + + + public: // From CMceMediaSink + + /** + * Enables the sink explicitly. + */ + IMPORT_C void EnableL(); + + /** + * Disables the sink explicitly. + */ + IMPORT_C void DisableL(); + + + public: // New functions + + /** + * Gets the number of available displays on the device. + * @return number of available displays + */ + IMPORT_C TInt DisplaysAvailable() const; + + /** + * Sets index of physical display to be used. + * @param aDisplayIndex, index of the display to be used; number of + * available displays can be retrieved by calling + * CMceDisplaySink::DisplaysAvailable + * @leave KErrNotSupported if requested display cannot be used + */ + IMPORT_C void SetDisplayIndexL( TInt aDisplayIndex ); + + /** + * Sets display resources. + * @param aWindow handle to the display window of the user + * @param aGc graphics context of the user + */ + IMPORT_C void SetDisplay( RWindow& aWindow, CWindowGc& aGc ); + + /** + * Sets display rectangle. Display data is drawn to the given area. + * @param aRect display area + */ + IMPORT_C void SetDisplayRectL( const TRect& aRect ); + + /** + * Gets current display rectagle. + * @return current display rectangle + */ + IMPORT_C const TRect DisplayRectL(); + + /* + * Sets display sink priority. Priority value 0 is the highest priority. + * Display sink with higher priority draws over less priority display + * if display rectangles overlap. + * @param aPriority priority value + */ + IMPORT_C void SetPriorityL( TUint aPriority ); + + /* + * Display sink's current priority. + * @return priority value + */ + IMPORT_C TUint PriorityL(); + + /* + * Sets display sink rotation. + * @param aRotation rotation value + */ + IMPORT_C void SetRotationL( TRotation aRotation ); + + /* + * Display sink's current rotation. + * @return rotation value + */ + IMPORT_C TRotation RotationL(); + + + public: // internal + + /** + * Initializes + * @param aManager the manager. Ownership is NOT transferred + */ + void InitializeL( CMceManager* aManager ); + + + private: + + /** + * C++ constructor. + */ + CMceDisplaySink(); + + private: // Reserved for future use + + TAny* iReserved; + + public: // stub data + + TInt iDisplayIndex; + + TRect iDisplayRect; + + TUint iDisplayPriority; + + TRotation iRotation; + + }; + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mceclientstub/inc/mcefilesink.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mceclientstub/inc/mcefilesink.h Thu Jul 22 16:32:26 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: +* +*/ + + +#ifndef MCEFILESINK_H +#define MCEFILESINK_H + +// INCLUDES +#include +#include + +// FORWARD DECLARATIONS + +// DATA TYPES +const TMceSinkType KMceFileSink = 4; + + +// CLASS DECLARATION + +/** +* Class representing file sink in Mce. +* +* CMceFileSink can be used to record a stream to the file. The file may consist of +* both audio and video data. If both media elements are available and should be +* recorded to the same file, the same file sink should be attached to audio stream +* and video stream. Recording only one of the media elements is possible as well. +* +* Enable (continue) and Disable (pause) operations to it are considered +* to be local, so they are not signalled to remote terminal. +* +* @lib mceclient.lib +*/ +class CMceFileSink : public CMceMediaSink + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + * @param aFileName name of the file including full path info + */ + IMPORT_C static CMceFileSink* NewL( const TFileName& aFileName ); + + /** + * Two-phased constructor. + * @param aFileName name of the file including full path info + */ + IMPORT_C static CMceFileSink* NewLC( const TFileName& aFileName ); + + /** + * Destructor. + */ + IMPORT_C ~CMceFileSink(); + + + public: // From CMceMediaSink + + /** + * Enables the sink explicitly. + */ + IMPORT_C void EnableL(); + + /** + * Disables the sink explicitly. + */ + IMPORT_C void DisableL(); + + private: + + /** + * C++ default constructor. + */ + CMceFileSink(); + + /** + * Second-phase constructor. + */ + void ConstructL( const TFileName& aFileName ); + + public: // Stub data + + TFileName iFileName; + + }; + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mceclientstub/inc/mcefilesource.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mceclientstub/inc/mcefilesource.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,262 @@ +/* +* 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: +* +*/ + + +#ifndef MCEFILESOURCE_H +#define MCEFILESOURCE_H + +// INCLUDES +#include "mcemediasource.h" +#include "mcemediastream.h" + +// CONSTANTS +const TMceSourceType KMceFileSource = 4; + +//FORWARD DECLARATIONS +class CMceManager; + +// CLASS DECLARATION + +/** +* Class representing file source in MCE. +* +* CMceFileSource can be used for streaming file contents. The file may contain +* both audio and video data. If the user wants to stream both media types, +* the same file source should be attached to audio stream and video stream. +* +* The file may contain also several elements of the same media type (e.g. +* 3 audio channels) and the user might want to use only some of those. +* This can be handled by defining index of the file's current media element: +* +* - Get number of audio media elements within the file (e.g. returns 3) +* - Set current audio element index to be 0 +* - Attach the file source to the audioStreamOne (audio element 0 is attached) +* - Set current audio element index to be 2 +* - Attach the file source to the audioStreamTwo (audio element 2 is attached) +* - Consequently, file's audio channel 0 would be streamed over the audioStreamOne +* and channel 2 over the audioStreamTwo. Channel 1 would be ignored. +* +* Enable (continue) and Disable (pause) operations to it are considered +* to be local, so they are not signalled to remote terminal. +* +* @lib mceclient.lib +*/ +class CMceFileSource : public CMceMediaSource + { + + public: // Constructors and destructor + + /** + * Two-phased constructor. + * @param aManager associated MCE manager + * @param aFileName name of the file including full path info + */ + IMPORT_C static CMceFileSource* NewL( CMceManager& aManager, + const TFileName& aFileName ); + + /** + * Two-phased constructor. + * @param aManager associated MCE manager + * @param aFileName name of the file including full path info + */ + IMPORT_C static CMceFileSource* NewLC( CMceManager& aManager, + const TFileName& aFileName ); + + /** + * Destructor. + */ + IMPORT_C ~CMceFileSource(); + + + public: // From CMceMediaSource + + /** + * Enables the source explicitly. + */ + IMPORT_C void EnableL(); + + /** + * Disables the source explicitly. + */ + IMPORT_C void DisableL(); + + + public: // Functions + + /** + * Updates file for the source. + * @param aFileName name of the file including full path info + */ + IMPORT_C void UpdateL ( const TFileName& aFileName ); + + /** + * Determines how many media elements of the spesified type the file + * source contains. E.g. audio file may contain N number of audio + * channels which has to be streamed over N number of audio streams. + * @param aType the type of media + * @return the number of media elements (of spesified type) + * the file contains + */ + IMPORT_C TInt MediaElementCountL( TMceMediaType aType ) const; + + /** + * Sets currently managed media element of the spesified media type. + * The setting is effective when the file source is attached to + * media stream of the spesified type. Current media element can be + * defined for each media type the file contains. By default, media + * element 0 of each media type is used. + * @param aType the type of media + * @param aIndex new index of the current media element + * @leave KErrArgument if media element spesified by input parameters + * does not exist + */ + IMPORT_C void SetCurrentMediaElementL( TMceMediaType aType, TInt aIndex ); + + /** + * Gets currently managed media element of the spesified media type. + * @param aType the type of media + * @return index of the current media element or KErrNotFound if no media + * elements of the spesified type exists + */ + IMPORT_C TInt CurrentMediaElement( TMceMediaType aType ); + + /** + * Sets the position within the file from where to start playback. + * @pre IsEnabled() == EFalse and contains audio/video + * @param aPosition from start of the file in microseconds + */ + IMPORT_C void SetPositionL( const TTimeIntervalMicroSeconds& aPosition ); + + /** + * Gets the current playback position in microseconds from the start of the file. + * @pre contains audio/video + * @return current position from start of the file in microseconds + */ + IMPORT_C TTimeIntervalMicroSeconds PositionL() const; + + /** + * Returns the duration of the file in microseconds. + * @pre contains audio/video + * @return duration of the file in microseconds. + */ + IMPORT_C TTimeIntervalMicroSeconds DurationL() const; + + /** + * Sets fast forward on/off. + * @pre contains video + * @param aUseFFWD ETrue if fast forward is enabled; otherwise EFalse + */ + IMPORT_C void SetFastForwardL( TBool aUseFFWD ); + + /** + * Sets fast rewind on/off. + * @pre contains video + * @param aUseFRWD ETrue if fast rewind is enabled; otherwise EFalse + */ + IMPORT_C void SetFastRewindL( TBool aUseFRWD ); + + /** + * Starts transcoding of file. After the transcoding is complete, + * file of this source is changed into the transcoded file. + * @pre CMceMediaStream::State() == ETranscodingRequired + * @post CMceMediaStream::State() == ETranscoding + * @param aFileName Name of the transcoding output file. + */ + IMPORT_C void TranscodeL( const TFileName& aFileName ); + + /** + * Cancels transcoding of file. + * @pre CMceMediaStream::State() == ETranscoding + * @post CMceMediaStream::State() == ETranscodingRequired + */ + IMPORT_C void CancelTranscodeL(); + + /** + * Gets the current transcoding progress in percentage. + * Value is updated with MMceStreamObserver::StreamStateChanged() event. + * @pre CMceMediaStream::State() == ETranscoding + * @return Transcoding progress in persentage (0-100). + */ + IMPORT_C TInt TranscodingProgressL() const; + + + public: // internal + + /** + * Initializes + * @param aManager the manager. Ownership is NOT transferred + */ + void InitializeL( CMceManager* aManager ); + + public: + + /** + * Two-phased constructor. + */ + static CMceFileSource* NewL(); + + /** + * Two-phased constructor. + */ + static CMceFileSource* NewLC(); + + private: + + /** + * C++ default constructor. + */ + CMceFileSource(); + + /** + * Second-phase constructor. + */ + void ConstructL( CMceManager* aManager, + const TFileName& aFileName ); + + + public: // Stub data + + TBool iFastForward; + TBool iFastRewind; + TTimeIntervalMicroSeconds iPosition; + + //TMceFileInfo iFileInfo; + //TBuf8<256> iFileName; + + TBool iInitialInfoRetrieved; + + TInt iCurrentAudioElement; + TInt iCurrentVideoElement; + + + TFileName iFileName; + TTimeIntervalMicroSeconds iDuration; + TInt iAudioElementCount; + TInt iVideoElementCount; + + TInt iTranscodingPercentage; + + // If this code is != KErrNone, next operation that can fail will fail + // (leave or return a value) with this code. Variable is reseted before + // failing. + // Obs! Check that wanted failing is really implemented in this stub + mutable TInt iFailWithCode; + + }; + + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mceclientstub/inc/mceh263codec.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mceclientstub/inc/mceh263codec.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,199 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef CMCEH263CODEC_H +#define CMCEH263CODEC_H + +// INCLUDES +#include "mcevideocodec.h" +#include "mcedefs.h" + +// CONSTANTS + +const TUint KMceH263FrameHeight = 176; +const TUint KMceH263FrameWidth = 144; +const TUint KMceH263ClockRate = 90000; +const TReal KMceH263FrameRate = 15; + +const TInt KMceH263Level10Bitrate = 64000; +const TInt KMceH263Level45Bitrate = 128000; + +const TUint KMceAllowedH263Bitrate10 = 0x0001; +const TUint KMceAllowedH263Bitrate45 = 0x0002; +const TUint KMceAllowedH263BitrateAll = 0x00FF; + +// CLASS DECLARATION + +/** +* Class for the H263 codec information. +* +* It checks the validity of inserted values for H263 +* +* @lib mceclient.lib +*/ +class CMceH263Codec : public CMceVideoCodec + { + + public: // Constructors and destructor + + /** + * Destructor. + */ + IMPORT_C ~CMceH263Codec(); + + public: + + /** + * Two-phased constructor. + * @param aSdpName sdp name + */ + IMPORT_C static CMceH263Codec* NewL( TBuf8 aSdpName); + + /** + * Two-phased constructor. + * @param aSdpName sdp name + */ + IMPORT_C static CMceH263Codec* NewLC( TBuf8 aSdpName ); + + public: // From base classes + + /** + * Sets bitrate used with codec for encoding. + * @param aBitrate bitrate value for encoding + * @return KErrNotSupported if codec doesn't support bitrate + * value issued + */ + virtual TInt SetBitrate( TUint aBitrate ); + + /** + * Sets bitrates allowed with codec. + * @param aBitrates allowed bitrate values + * @return KErrNotSupported if codec doesn't support bitrate + * values issued + */ + virtual TInt SetAllowedBitrates( TUint aBitrates ); + + /** + * Sets the codec specific mode. + * @param aCodecMode mode of the codec + * @return KErrNotSupported if codec doesnt' support codec mode + * value issued + */ + virtual TInt SetCodecMode( TUint aCodecMode ); + + /** + * Sets the payload type. + * @param aPayloadType type identifier of the payload + * @return KErrNotSupported if codec doesn't support payload type issued + */ + virtual TInt SetPayloadType( TUint8 aPayloadType ); + + /** + * Clones the codec. + * @return cloned codec; ownership is transferred + */ + virtual CMceVideoCodec* CloneL() const; + + /** + * Sets maximum bitrate of the codec. + * @param aMaxBitrate value of maximum bitrate used for encoding + * @leave KErrNotSupported if codec doesn't support frame sizes issued + */ + virtual void SetMaxBitrateL( TUint aMaxBitrate ); + + /** + * Sets resolutions allowed with the codec. + * @param aResolutions bitfield of allowed resolutions + * @leave KErrNotSupported if codec doesn't support resolutions issued + */ + virtual void SetAllowedResolutionsL( TUint aResolutions ); + + /** + * Sets resolution of the video. + * @param aResolution resolution of the video in pixels + * @leave KErrNotSupported if codec doesn't support resolution issued + */ + virtual void SetResolutionL( TSize aResolution ); + + /** + * Sets frame rates allowed with the codec. + * @param aFrameRates allowed frame rate values as a bitfield + * @leave KErrNotSupported if codec doesn't support frame rates issued + */ + virtual void SetAllowedFrameRatesL( TUint aFrameRates ); + + /** + * Sets frame rate used with the codec for encoding. + * @param aFrameRate frame rate for encoding + * @leave KErrNotSupported if codec doesn't support frame rate value + * issued + */ + virtual void SetFrameRateL( TReal aFrameRate ); + + /** + * Sets preferred encoding device for uplink stream and preferred decoding + * device for downlink stream. + * @param aEncodingDecodingDevice + * @leave KErrNotSupported if setting preferred device is not possible + */ + virtual void SetPreferredEncodingDecodingDeviceL( + TUid aEncodingDecodingDevice ); + + /** + * Set config key (sprop-parameter-sets) + * @param aConfigKey, config key as Base64 encoded + * @leave KErrNotSupported if setting config key is not possible + */ + virtual void SetConfigKeyL( const TDesC8& aConfigKey ); + + + private: // Helper functions + + /** + * Sets the sdp name. + * @param aSdpName the sdp name + */ + void SetSdpNameL( const TDesC8& aSdpName ); + + private: // Constructors + + /** + * C++ default constructor. + */ + CMceH263Codec(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL( TBuf8 aSdpName); + + + + private: // Data + + private: // Reserved for future use + + TAny* iReserved; + + + }; + + +#endif + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mceclientstub/inc/mceinsession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mceclientstub/inc/mceinsession.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,199 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef CMCEINSESSION_H +#define CMCEINSESSION_H + +// INCLUDES +#include +#include + +// CLASS DECLARATION + +/** +* Class for mobile terminated MCE sessions. +* +* CMceInSession represents incoming invitation to join in a session. +* +* The characteristics of the session are defined by remote terminal. Theses charactereistics +* are defined using SDP and are turned by MCE server into structure of media streams attached +* into the session. The user of this class is then responsible to either reject accept +* the invitation. +* +* Accepting the invitation is executed in two steps. First after receiving the invitation +* the user must complete the media structure. Streams attached to the session are not complete, +* but they must be completed by the user. Those componens defined in SDP are put automatically +* into media structure (like streams and RTP sinks and sources), but other relations must +* be completed by user. When media structure is complete, UpdateL method is called and session +* establishement continues with second step. +* +* After all media resources are succesfully negotiated and reserved, session state is changed +* to Proceeding, and end used can be alarmed about incoming invitation. Typically, at this state +* 180 Ringing response is sent to network. If end user accepts the invitation, 200 OK is +* sent to network and session is established. +* +* After the session has been succesfylly established, it can be later updated and +* must be finally terminated. +* +* This class is never instantiated by user, but the ownership is in any case transferred +* to it. See class MMceInSessionObserver. +* +* If for any reason instance of this class is deleted while in established state, +* session is automatically terminated by MCE server. +* +* @lib mceclient.lib +*/ +class CMceInSession : public CMceSession + { + + public: // Constructors and destructor + + /** + * Destructor + */ + IMPORT_C ~CMceInSession(); + + public: // Functions + + /** + * Indicates to the server side, that 180(Ringing) response for the + * incoming INVITE request can be sent. Does not establish session. + * @pre State() == CMceSession::EProceeding + * @param aHeaders, SIP headers to be added. Ownership is + * transferred. + * @param aContentType, a type of content. Ownership + * is transferred. + * @param aContent, content to be added in body. Ownership is + * transferred. + + */ + IMPORT_C void RingL( CDesC8Array* aHeaders = 0, + HBufC8* aContentType = 0, + HBufC8* aContent = 0 ); + + /** + * Answers to an incoming session. Indicates to server side that the + * 200(OK) response for the incoming INVITE has to be sent. + * @pre State() == CMceSession::EProceeding + * @post State() == CMceSession::EAnswering + */ + IMPORT_C void AcceptL(); + + /** + * Answers to an incoming session. Indicates to server side that the + * given response for the incoming INVITE has to be sent. + * @pre State() == CMceSession::EProceeding && ( 200 <= aCode <= 300 ) + * @post State() == CMceSession::EAnswering + * @param aReason, reason phrase + * @param aCode, reason code + * @param aHeaders, SIP headers to be added. Ownership is + * transferred. + * @param aContentType, a type of content. Ownership + * is transferred. + * @param aContent, content to be added in body. Ownership is + * transferred. + */ + IMPORT_C void AcceptL( const TDesC8& aReason, + TUint32 aCode, + CDesC8Array* aHeaders = 0, + HBufC8* aContentType = 0, + HBufC8* aContent = 0 ); + + /** + * Rejects the incoming session. Indicates to server side that + * 603(Decline) response has to be sent. + * @pre State() == CMceSession::EIncoming || + * State() == CMceSession::EProceeding + * @post State() == CMceSession::ETerminated + */ + IMPORT_C void RejectL(); + + /** + * Rejects the incoming session. Indicates to server side that + * 603(Decline) response has to be sent. + * @pre ( State() == CMceSession::EIncoming || + * State() == CMceSession::EProceeding ) && + * ( 300 <= aCode < 700 ) + * @post State() == CMceSession::ETerminated + * @param aReason, reason phrase + * @param aCode, reason code + * @param aHeaders, SIP headers to be added. Ownership is + * transferred. + * @param aContentType, a type of content. Ownership + * is transferred. + * @param aContent, content to be added in body. Ownership is + * transferred. + */ + IMPORT_C void RejectL( const TDesC8& aReason, + TUint32 aCode, + CDesC8Array* aHeaders = 0, + HBufC8* aContentType = 0, + HBufC8* aContent = 0 ); + + public: // serialization + + /** + * Two-phased constructor. + * @param aReadStream, read stream + * @param aManager, reference to session manager. + * @param aProfileId, id of the sip profile used for the session. + */ + static CMceInSession* NewL( RReadStream& aReadStream, + CMceManager& aManager, + TUint32 aProfileId ); + /** + * Two-phased constructor. + * For temporay use only. + */ + IMPORT_C static CMceInSession* NewL(); + + /** + * C++ default constructor. + * @param aManager, reference to session manager. + * @param aProfileId, id of the sip profile used for the session. + */ + CMceInSession( CMceManager* aManager, TUint32 aProfileId ); + + + private://methods + + /** + * second-phase constructor + * @param aOriginator, the originator + * @param aRecipient, the recipient + */ + void ConstructL( const TDesC8& aOriginator, const TDesC8& aRecipient ); + + public: // Stub constructor + + /** + * Two-phased constructor. + * @param aManager, reference to session manager. + */ + IMPORT_C static CMceInSession* NewL( CMceManager& aManager, + const TDesC8& aOriginator ); + + + public: // Stub data + + TBool iRingingCalled; + + }; + + + #endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mceclientstub/inc/mceinsessionobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mceclientstub/inc/mceinsessionobserver.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,74 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef MMCEINSESSIONOBSERVER_H +#define MMCEINSESSIONOBSERVER_H + +// INCLUDES +#include + +// FORWARD DECLARATIONS +class CMceSession; +class CMceInSession; +class TMceTransactionDataContainer; + +// CLASS DECLARATION + +/** +* An interface to be implemented by users of MCE if they wish to receive +* invitations to session from network. +* +* This observer is set using CMceManager::SetInSessionObserver function. +* +* @lib mceclient.lib +*/ +class MMceInSessionObserver + { + + public: // Functions + + /** + * Incoming session invitation. The CMceInSession is given to the + * application as a callback. + * @param aSession, pointer to the incoming session. Ownership is + * transferred. + * @param aContainer, if present, holds details of + * transaction causing state change. + */ + virtual void IncomingSession( + CMceInSession* aSession, + TMceTransactionDataContainer* aContainer ) = 0; + + /** + * Incoming session update. The new updated CMceInSession is given to the + * application as a callback. + * @param aOrigSession, the original session to be updated. This instance + * cannot be used anymore, all actions done using aUpdatedSession instance. + * @param aUpdatedSession, pointer to the new updated session. Ownership is + * transferred. + * @param aContainer, if present, holds details of + * update transaction. + */ + virtual void IncomingUpdate( + CMceSession& aOrigSession, + CMceInSession* aUpdatedSession, + TMceTransactionDataContainer* aContainer ) = 0; + + }; + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mceclientstub/inc/mcemanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mceclientstub/inc/mcemanager.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,267 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef CMCEMANAGER_H +#define CMCEMANAGER_H + +// INCLUDES +#include +#include +//#include + +// FORWARD DECLARATIONS +class MMceInSessionObserver; +class MMceInEventObserver; +class MMceInReferObserver; +class MMceSessionObserver; +class MMceEventObserver; +class MMceReferObserver; +class MMceStreamObserver; +class MMceRtpObserver; +class CMceSession; +class CMceEvent; +class CMceRefer; +class TMceMediaId; +class CMceAudioCodec; +class CMceVideoCodec; +class TMceTransactionDataContainer; + +// CLASS DECLARATION + +/** +* Class for connecting to MCE server. +* +* This class provides the connection to the MCE server and +* provides functions for setting observers for asynchronous +* events. +* +* The user should create only one instance of this class. +* +* @lib mceclient.lib +*/ +class CMceManager : public CBase + { + + public: // Constructors and destructor + + /** + * Two-phased constructor. + * @param aAppUid, uid of the application. + * @param aContainer, if set, detailed data provided in observers. + */ + IMPORT_C static CMceManager* NewL( + const TUid& aAppUid, + TMceTransactionDataContainer* aContainer = 0); + + /** + * Destructor. + */ + IMPORT_C ~CMceManager(); + + public: // Functions + + /** + * Set observer for incoming sessions. + * @param aInSessionObserver, observer of the sessions. + */ + IMPORT_C void SetInSessionObserver( + MMceInSessionObserver* aInSessionObserver ); + + /** + * Set observer for incoming events. + * @param aInEventObserver, observer of the events. + */ + IMPORT_C void SetInEventObserver( + MMceInEventObserver* aInEventObserver ); + + /** + * Set observer for incoming refers. + * @param aInReferObserver, observer of the refers. + */ + IMPORT_C void SetInReferObserver( + MMceInReferObserver* aInReferObserver ); + + /** + * Set observer for sessions. + * @param aSessionObserver, observer of the sessions. + */ + IMPORT_C void SetSessionObserver( + MMceSessionObserver* aSessionObserver ); + + /** + * Set observer for medias + * @param aMediaObserver, observer of medias. + */ + IMPORT_C void SetMediaObserver( + MMceStreamObserver* aMediaObserver ); + + /** + * Set observer for rtp + * @param aRtpObserver, observer of rtp + */ + IMPORT_C void SetRtpObserver( + MMceRtpObserver* aRtpObserver ); + + /** + * Sets observer for incoming events. + * @param aEventObserver, observer of the event. Ownership is + * not transferred. + */ + IMPORT_C void SetEventObserver( + MMceEventObserver* aEventObserver); + + /** + * Sets observer for incoming REFER events. + * @param aReferObserver, observer of the event. Ownership is + * not transferred. + */ + IMPORT_C void SetReferObserver( + MMceReferObserver* aReferObserver); + + /** + * Gets currently ongoing sessions + * @return RPointerArray array of sessions. + */ + IMPORT_C const RPointerArray< CMceSession >& Sessions() const; + + /** + * Gets currently ongoing events + * @return RPointerArray array of events. + */ + IMPORT_C const RPointerArray< CMceEvent >& Events() const; + + /** + * Sets observer for incoming SUBSCRIBE events. + * @param aObserver, observer of the event. Ownership is + * not transferred. + */ + IMPORT_C const RPointerArray< CMceRefer >& Refers() const; + + /** + * Returns supported audio codecs of the system. + * @return supported audio codecs of the system. + */ + IMPORT_C const RPointerArray& SupportedAudioCodecs() const; + + /** + * Returns supported video codecs of the system. + * @return supported video codecs of the system. + */ + IMPORT_C const RPointerArray& SupportedVideoCodecs() const; + + /* + * Set default headers for the method. The headers will always be added + * to the given SIP methods unless overwritten with + * headers given as parameter for the API method triggering the + * sending of request/response. + * @param aMethods, the SIP methods the headers are added to. + * @param aHeaders, the default headers, ownership is transferred. + */ + IMPORT_C void SetDefaultHeadersL( CDesC8Array* aMethods, CDesC8Array* aHeaders ); + + /* + * Get the default headers assigned for the given method. + * If none is assigned, and empty array is returned. + * @param aMethod, the method for which the headers are queried. + * @return the default headers, ownership is transfered. + */ + IMPORT_C CDesC8Array* DefaultHeadersL( const TDesC8& aMethod ) const; + + + public: // Functions + + /** + * Gets observer for incoming sessions + * @return incoming session observer + */ + MMceInSessionObserver* InSessionObserver() const; + + /** + * Gets session observer + * @return session observer + */ + MMceSessionObserver* SessionObserver() const; + + /** + * Gets media observer + * @return media observer + */ + MMceStreamObserver* MediaObserver() const; + + /** + * Gets rtp observer + * @return rtp observer + */ + MMceRtpObserver* RtpObserver() const; + + + /** + * Returs transaction container for detailed data. + * Returns NULL, if none exists. + */ + TMceTransactionDataContainer* TransactionContainer() const; + + private: + + /** + * C++ default constructor. + * @param aAppUid, uid of the application. + * @param aContainer, if set, detailed data provided in observers. + */ + CMceManager( const TUid& aAppUid, + TMceTransactionDataContainer* aContainer = 0); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + + public: // Stub data + + /** + * detailed callbacks wanted + */ + TBool iDetailedCallbacks; + + /** + * sessions + */ + RPointerArray iSessions; + + /** + * supported audio codecs + */ + RPointerArray iSupportedAudioCodecs; + + /** + * supported audio codecs + */ + RPointerArray iSupportedVideoCodecs; + + MMceSessionObserver* iSessionObserver; + MMceStreamObserver* iMediaObserver; + MMceRtpObserver* iRtpObserver; + MMceInSessionObserver* iInSessionObserver; + + TMceTransactionDataContainer* iContainer; + + friend class CMceSession; + }; + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mceclientstub/inc/mcemediasink.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mceclientstub/inc/mcemediasink.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,143 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef CMCEMEDIASINK_H +#define CMCEMEDIASINK_H + +// INCLUDES +#include +#include + +// DATA TYPES +typedef TUint TMceSinkType; + +// FORWARD DECLARATIONS +class TMceSinkFactory; +class CMceMediaStream; +class TMceIds; +class TMceEvent; +class TMceMediaId; +class CMceManager; + + +// CLASS DECLARATION + +/** +* Base class for the MCE media sinks. +* +* Media sinks represent the destination of data. +* CMceMediaSink gets it data from CMceMediaSource through +* CMceMediaStream. +* +* CMceMediaSink has a type that defines how it can connected to other +* sources and streams. +* +* Enable and Disable operations to sinks are considered to be local, +* so they are not signalled to remote terminal. +* +* @lib mceclient.lib +*/ +class CMceMediaSink: public CBase + { + + public: // Destructor + + IMPORT_C ~CMceMediaSink(); + + public: // Functions + + /** + * Returns the type of the sink. + * @return The type of the sink. + */ + IMPORT_C TMceSinkType Type() const; + + /** + * Enables streaming explicitly. + */ + virtual void EnableL() = 0; + + /** + * Disables streaming explicitly. + */ + virtual void DisableL() = 0; + + /** + * Returns the state of the sink. + * @return ETrue if enabled, EFalse if disabled. + */ + IMPORT_C TBool IsEnabled() const; + + public: //internal + + /** + * Initializes + * @param aParent the parent + */ + virtual void InitializeL( CMceMediaStream& aParent ); + + /** + * Initializes + * @param aManager the manager. Ownership is NOT transferred + */ + virtual void InitializeL( CMceManager* aManager ); + + /** + * Sets and gets reference count describing to how many + * streams sink is associated + * @return reference count reference + */ + TInt& ReferenceCount(); + + protected: + + /** + * C++ default constructor. + */ + CMceMediaSink(); + + /** + * Enables streaming explicitly. + */ + void DoEnableL(); + + /** + * Disables streaming explicitly. + */ + void DoDisableL(); + + + protected: // NOT owned data + + /** + * stream + */ + CMceMediaStream* iStream; + + public: // stub data + + TMceSinkType iType; + + TBool iIsEnabled; + + TInt iReferenceCount; + + }; + + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mceclientstub/inc/mcemediasource.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mceclientstub/inc/mcemediasource.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,146 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef CMCEMEDIASOURCE_H +#define CMCEMEDIASOURCE_H + +// INCLUDES +#include + +// DATA TYPES +typedef TUint TMceSourceType; + +// FORWARD DECLARATIONS +class RReadStream; +class RWriteStream; +class CMceComMediaSource; +class TMceSourceFactory; +class CMceMediaStream; +class TMceEvent; +class TMceMediaId; +class CMceManager; + +// CLASS DECLARATION + +/** +* Base class for the MCE media sources. +* +* Media sources represent the origin of data. +* CMceMediaSource puts it data through CMceMediaStream into +* CMceMediaSink. +* +* CMceMediaSource has a type that defines how it can connected to other +* sinks and streams. +* +* Enable and Disable operations to sinks are considered to be local, +* so they are not signalled to remote terminal. +* +* @lib mceclient.lib +*/ +class CMceMediaSource: public CBase + { + public: // Destructor + + IMPORT_C ~CMceMediaSource(); + + public: // Functions + + /** + * Returns the type of the source. + * @return The type of the source. + */ + IMPORT_C TMceSourceType Type() const; + + /** + * Enables streaming explicitly. + */ + virtual void EnableL() = 0; + + /** + * Disables streaming explicitly. + */ + virtual void DisableL() = 0; + + /** + * Returns the state of the source. + * @return ETrue if enabled, EFalse if disabled. + */ + IMPORT_C TBool IsEnabled() const; + + + + public: //internal + + /** + * Initializes + * @param aParent the parent + */ + virtual void InitializeL( CMceMediaStream& aParent ); + + /** + * Initializes + * @param aManager the manager. Ownership is NOT transferred + */ + virtual void InitializeL( CMceManager* aManager ); + + /** + * Sets and gets reference count describing to how many + * streams source is associated + * @return reference count reference + */ + TInt& ReferenceCount(); + + + protected: + + /** + * C++ default constructor. + */ + CMceMediaSource(); + + /** + * Enables streaming explicitly. + */ + void DoEnableL(); + + /** + * Disables streaming explicitly. + */ + void DoDisableL(); + + + protected: // NOT owned data + + /** + * stream + */ + RPointerArray iStreams; + + + public: // stub data + + TBool iIsEnabled; + + TMceSourceType iType; + + TInt iReferenceCount; + + }; + + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mceclientstub/inc/mcemediastream.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mceclientstub/inc/mcemediastream.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,316 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef CMCEMEDIASTREAM_H +#define CMCEMEDIASTREAM_H + +// INCLUDES +#include + +// DATA TYPES +typedef TUint TMceMediaType; + +// FORWARD DECLARATIONS +class CMceComMediaStream; +class TMceFactory; +class TMceMediaStreamFactory; +class RWriteStream; +class RReadStream; +class CDesC8Array; +class CMceSession; +class TMceIds; +class TMceEvent; +class TMceMediaId; +class CMceManager; +class CMceSession; +class CMceMediaSource; +class CMceMediaSink; +class MMceComSerializationContext; +class MDesC8Array; + +// CLASS DECLARATION + +/** +* Base class for MCE media streams. +* +* MCE Media stream represents stream of data negotiated between two terminals. +* Streams may transfer any data. +* +* Enabling or disabling of a stream is not a local operation, but it requires +* always signalling. Thus, these operation require always to be completed by +* calling CMceSession::UpdateL() function. +* +* @lib mceclient.lib +*/ +class CMceMediaStream : public CBase + { + public: // Stream states + + enum TState + { + EUninitialized, // Stream is created + EInitialized, // Stream is initialized + EBuffering, // Stream is buffering + EIdle, // Stream is not receiving RTP + EStreaming, // Stream is streaming + EDisabled, // Stream is explicitly disabled + ENoResources, // Stream has no needed resources to stream + ETranscodingRequired, // Stream requires non-realtime transcoding + ETranscoding // Stream is transcoding in non-realtime + }; + + public: // Destructor + + /** + * Destructor. + */ + IMPORT_C ~CMceMediaStream(); + + public: // Functions + + /** + * Gets the state of the stream. + * @return the current state of the stream + */ + IMPORT_C CMceMediaStream::TState State() const; + + /** + * Returns the type of the stream. + * @return The type of the stream. + */ + IMPORT_C TMceMediaType Type() const; + + /** + * Configures media stream by updating SDP media lines. + * In order to get complete update, whole session must be + * updated causing sending of re-invite. + * @param aMediaSDPLines, application specific SDP media lines for + * the stream. Ownership is transferred. + */ + IMPORT_C void SetMediaAttributeLinesL( CDesC8Array* aMediaSDPLines ); + + /** + * Gets attribute lines of the media. + * @return array of media attribute lines, owneship is transferred. + */ + IMPORT_C MDesC8Array* MediaAttributeLinesL(); + + /** + * Sets local media port + * @param aLocalMediaPort, local port for the media + */ + IMPORT_C void SetLocalMediaPortL(TUint aLocalMediaPort); + + /** + * Gets the local media port. + * @return Local port used for media. + */ + IMPORT_C TUint LocalMediaPort() const; + + /** + * Gets the session this stream belongs to, if exists. The + * ownership is not transfered. + * @return Session object + */ + IMPORT_C CMceSession* Session() const; + + + public: // Local stream control + + /** + * Enables streaming explicitly. + */ + virtual void EnableL(); + + /** + * Disables streaming explicitly. + */ + virtual void DisableL(); + + /** + * Returns the state of the stream. + * @return ETrue if enabled, EFalse if disabled. + */ + IMPORT_C TBool IsEnabled() const; + + + public: // Source and sink functions + + /** + * Adds source to the stream. CMceMediaStream can only + * have one source at a time. Ownership of passed source is transferred. + * However, the same source can be also passed to other streams resulting + * that streams share ownership of the source. Passing NULL source will + * remove source from stream. + * In some cases the source might contain a codec. The codec is derived + * to the stream when such source is added to the stream. + * Derived codec will get automatically highest preference. + * @param aSource source to be added to the stream; ownership is + * transferred + */ + IMPORT_C void SetSourceL( CMceMediaSource* aSource ); + + /** + * Adds sink to the stream. CMceMediaStream can have + * many sinks at a time. Ownership of passed sink is transferred. + * However, the same sink can be also passed to other streams resulting + * that streams share ownership of the sink. + * @param aSink sink to be added to the stream; ownership is transferred + */ + IMPORT_C void AddSinkL( CMceMediaSink* aSink ); + + /** + * Gets source of the stream. Returns NULL if source is not set. + * @return source of the stream; ownership is not transferred + */ + IMPORT_C CMceMediaSource* Source() const; + + /** + * Gets array of sinks of the stream. + * @return array of sinks + */ + IMPORT_C const RPointerArray& Sinks() const; + + /** + * Removes sink from the stream. + * @post aSink cannot be used anymore and contents of + * previously returned sink array (CMceMediaStream::Sinks()) + * are not anymore valid + * @param aSink sink to be removed from the stream + */ + IMPORT_C void RemoveSinkL( CMceMediaSink& aSink ); + + public: // Binding opposite way stream + + /** + * Binds opposite direction stream to this stream. + * @param aStream another stream to be bind to the stream; + * ownership is transferred + */ + IMPORT_C void BindL( CMceMediaStream* aStream ); + + /** + * Gets opposite direction stream of this stream. + * @return opposite direction stream + */ + IMPORT_C CMceMediaStream& BoundStreamL() const; + + /** + * Checks if opposite direction stream is set. + * @return ETrue if opposite direction stream is set; + * otherwise EFalse + */ + IMPORT_C TBool BoundStream() const; + + + public: //internal + + /** + * Checks if this is binder (biding owner) + * @return ETrue if this is binder (biding owner) + */ + TBool Binder() const; + + /** + * Initializes + * @param aParent the parent + */ + virtual void InitializeL( CMceSession& aParent ); + + /** + * Initializes + * @param aManager the manager. Ownership is NOT transferred + */ + virtual void InitializeL( CMceManager* aManager ); + + protected: + + /** + * C++ default constructor. + */ + CMceMediaStream(); + + private: + + /** + * Handles event + * @param aEvent the event + * @return status, if event was consumed or not or object needs update + */ + TInt HandleEvent( TMceEvent& aEvent ); + + /** + * one-way bind + * @param aStream another stream to be bind to the stream. + */ + void DoBindL( CMceMediaStream* aStream ); + + /** + * Deletes sink + * @param aIndex index of sink in the array + */ + void DeleteSink( TInt aIndex ); + + /** + * Deletes source + */ + void DeleteSource(); + + + protected: // NOT owned data + + /** + * session + */ + CMceSession* iSession; + + protected: // owned data + + + /** + * linked stream. Owned if iLinkOwner is ETrue + */ + CMceMediaStream* iLinkedStream; + + public: // stub data + + /** + * source + */ + CMceMediaSource* iSource; + + /** + * sinks + */ + RPointerArray iSinks; + + TState iState; + + TMceMediaType iType; + + TBool iLinkOwner; + + TBool iIsEnabled; + + TUint iLocalMediaPort; + + CDesC8Array* iMediaSDPLines; + }; + + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mceclientstub/inc/mceoutsession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mceclientstub/inc/mceoutsession.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,162 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef CMCEOUTSESSION_H +#define CMCEOUTSESSION_H + +// INCLUDES +#include +#include + +// FORWARD DECLARATIONS +class CSIPProfile; +class CMceMediaStream; +class CMceManager; +class CMceEvent; +class CMceRefer; + +// CLASS DECLARATION + +/** +* Class for mobile originated MCE sessions. +* +* CMceOutSession represents outgoing invitation to remote terminal to join in a session. +* +* The characteristics of the session are defined by user of this class by attaching +* media streams into the session. Theses charactereistics are turned by MCE server into SDP +* and attached into sent invitation request. +* +* After the session has been succesfylly established, it can be later updated and +* must be finally terminated. +* +* If for any reason instance of this class is deleted while in established state, +* session is automatically terminated by MCE server. +* +* @lib mceclient.lib +*/ +class CMceOutSession : public CMceSession + { + + public: // Constructors and destructor + + /** + * Two-phased constructor. Should be used when session + * is established into new logical connection to remote terminal. + * @param aManager, reference to session manager. + * @param aProfile, sip profile used for the session. + * @param aRecipient, recipient of the session invitation. + * @param aOriginator, originator of the session invitation. + */ + IMPORT_C static CMceOutSession* NewL( + CMceManager& aManager, + CSIPProfile& aProfile, + const TDesC8& aRecipient, + HBufC8* aOriginator = 0); + + /** + * Two-phased constructor. Should be used when session is associated + * to existing event. This guarantees that session is established with + * same remote terminal with the event. + * @param aEvent, reference to existing event that is associated + * with this session. + */ + IMPORT_C static CMceOutSession* NewL(CMceEvent& aEvent); + + /** + * Two-phased constructor. Should be used when session is associated + * to existing refer. This guarantees that session is established with + * same remote terminal with the refer. + * @param aRefer, reference to existing refer that is associated + * with this session. + */ + IMPORT_C static CMceOutSession* NewL(CMceRefer& aRefer); + + /// Note: This function exists only in the stub + IMPORT_C static CMceOutSession* NewL(); + + /** + * Destructor. + */ + IMPORT_C ~CMceOutSession(); + + public: // from CMceSession + + /** + * Adds media stream into session. + * @pre State() == CMceSession::EIdle || + * State() == CMceSession::EIncoming || + * State() == CMceSession::EEstablished + * @pre aMediaStream != 0 + * @param aMediaStream, media stream to be added. + * ownership is transferred. + */ + IMPORT_C void AddStreamL( CMceMediaStream* aMediaStream ); + + public: // Functions + + /** + * Establishes a SIP session with the recipient. + * The streams in the stream array are offered in the + * SDP codec negotiation. + * @pre State() == CMceSession::EIdle + * @post State() == CMceSession::EOffering + * @param aTimeout, the session timer value in seconds + * @param aHeaders, SIP headers to be added. Ownership is + * transferred. + * @param aContentType, content type of the body. + * Ownership is transferred. + * @param aContent, content to be added in body. Ownership is + * transferred. + * @param aContentHeaders, content headers to be added. Ownership is + * transferred. + */ + IMPORT_C void EstablishL( + TUint32 aTimeout = 0, + CDesC8Array* aHeaders = 0, + HBufC8* aContentType = 0, + HBufC8* aContent = 0, + CDesC8Array* aContentHeaders = 0 ); + + /** + * Cancels a previously initialized MO session. + * @pre State() == CMceSession::EOffering + */ + IMPORT_C void CancelL(); + + private://methods + + /** + * C++ default constructor. + * @param aManager, reference to session manager. + * @param aProfileId, id of the sip profile used for the session. + */ + CMceOutSession( CMceManager* aManager, TUint32 aProfileId ); + + /** + * second-phase constructor + * @param aRecipient, the recipient + * @param aOriginator, the originator + */ + void ConstructL( const TDesC8& aRecipient, HBufC8* aOriginator ); + + + private: // Data + + }; + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mceclientstub/inc/mcertpobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mceclientstub/inc/mcertpobserver.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,98 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef MMCERTPOBSERVER_H +#define MMCERTPOBSERVER_H + +// INCLUDES +#include + +// FORWARD DECLARATIONS +class CMceMediaStream; +class CMceRtpSource; + +// CLASS DECLARATION + +/** +* An interface to be implemented by users of MCE if they wish to receive +* events from CMceRtpSource. +* +* This observer is set using CMceManager::SetRtpObserver function. +* +* @lib mceclient.lib +*/ +class MMceRtpObserver + { + public: + /** + * Callback function to indicate that an RTCP sender report + * has been received. + * @param aSession the session that has changed + * @param aStream the stream that has changed + */ + virtual void SRReceived( + CMceSession& aSession, + CMceMediaStream& aStream) = 0; + + /** + * Callback function to indicate that an RTCP receiver report + * has been received. + * @param aSession the session that has changed + * @param aStream the stream that has changed + */ + virtual void RRReceived( + CMceSession& aSession, + CMceMediaStream& aStream) = 0; + + /** + * Callback function to indicate inactivity timer timeout + * has occurred. Timer is disabled after the timeout. + * @param aStream, the session that has changed. + * @param aSource, the source that the timeout occurred. + */ + virtual void InactivityTimeout( + CMceMediaStream& aStream, + CMceRtpSource& aSource) = 0; + + /** + * Callback function to indicate that spesified CMceRtpSource has + * received RTP from a new synchronization source (SSRC). + * @param aStream the stream that new SSRC was added to + * @param aSource the source that new SSRC was added to + * @param aSsrc added SSRC identifier + */ + virtual void SsrcAdded( + CMceMediaStream& aStream, + CMceRtpSource& aSource, + TUint aSsrc ) = 0; + + /** + * Callback function to indicate that spesified CMceRtpSource has + * received RTP BYE message from a spesified synchronization + * source (SSRC). + * @param aStream the stream that SSRC was removed from + * @param aSource the source that SSRC was removed from + * @param aSsrc removed SSRC identifier + */ + virtual void SsrcRemoved( + CMceMediaStream& aStream, + CMceRtpSource& aSource, + TUint aSsrc ) = 0; + }; + +#endif \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mceclientstub/inc/mcertpsink.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mceclientstub/inc/mcertpsink.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,154 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef CMCERTPSINK_H +#define CMCERTPSINK_H + +// INCLUDES +#include "mcemediasink.h" + +// CONSTANTS +const TMceSinkType KMceRTPSink = 1; + +// CLASS DECLARATION + +/** +* Class representing outgoing RTP stream in MCE. +* +* CMceRtpSink can be used to send media data to network. +* It can be configured not to use RTCP during play in order +* to save bandwith. +* +* CMceRtpSink allows also explicitly sending of RTP RR and SR +* messages. +* +* Enable and Disable operations to it are considered +* to be local, so they are not signalled to remote terminal. +* +* @lib mceclient.lib +*/ +class CMceRtpSink: public CMceMediaSink + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CMceRtpSink* NewL(); + + /** + * Two-phased constructor. + */ + IMPORT_C static CMceRtpSink* NewLC(); + + /** + * Two-phased constructor. + * @param aSuppressRTCP, ETrue if RTCP not sent during play, + * EFalse otherwise + * @param aIdentity, identity of user placed in RTCP, + * ownership not transferred. + */ + IMPORT_C static CMceRtpSink* NewL( TBool aSuppressRTCP, + HBufC8* aIdentity = 0 ); + + /** + * Destructor. + */ + IMPORT_C ~CMceRtpSink(); + + public: // From base class + + /** + * Locally resumes sending of RTP packets. + */ + IMPORT_C void EnableL(); + + /** + * Locally pauses sending of RTP packets. + */ + IMPORT_C void DisableL(); + + public: // Functions + + /** + * Sends RTCP sender report to recipient. + */ + IMPORT_C void SendSRL(); + + /** + * Returns the sequence id of the last packet + * sent to network. The value is updated only + * when sink is disabled. + * @pre IsEnabled() == EFalse + * @return sequence number of last sent packet. + */ + IMPORT_C TUint32 LastPacket() const; + + /** + * Returns the RTP stream source identifier + * used in network (SSRC). + * @pre CMceSession::State() == CMceSession::EEstablished + * @return source identifier used in network (SSRC). + */ + IMPORT_C TUint32 Ssrc() const; + + /** + * Updates settings of rtp sink. + * @pre CMceSession::State() == CMceSession::EIncoming + * @param aSuppressRTCP, ETrue if RTCP not sent during play, + * EFalse otherwise + * @param aIdentity, identity of user placed in RTCP, + * ownership not transferred. + */ + IMPORT_C void UpdateL( TBool aSuppressRTCP, HBufC8* aIdentity = 0 ); + + private: + + /** + * C++ default constructor. + */ + CMceRtpSink(); + + /** + * second-phase constructor + * @param aSuppressRTCP, ETrue if RTCP not sent during play, + * EFalse otherwise + */ + void ConstructL( TBool aSuppressRTCP ); + + public: // stub data + + /** + * suppress RTCP + */ + TBool iSuppressRTCP; + + /** + * SSRC + */ + TUint32 iSSRC; + + /** + * last packet + */ + TUint32 iLastPacket; + + + }; + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mceclientstub/inc/mcertpsource.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mceclientstub/inc/mcertpsource.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,217 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef CMCERTPSOURCE_H +#define CMCERTPSOURCE_H + +// INCLUDES +#include +#include + +// CONSTANTS +const TMceSourceType KMceRTPSource = 1; +const TInt KMceJitterBufferLength = 10; +const TInt KMceJitterBufferTreshold = 5; + +//FORWARD DECLARATIONS +class TMceIds; + +// CLASS DECLARATION + +/** +* Class representing incoming RTP stream in MCE. +* +* CMceRtpSource can be used to receive media data from network. +* It can be configured with stream specific values to avoid +* jitter generated by network. It may also be configured to +* recognize separate media bursts instead of just receiving +* continuous flow of data. +* +* Events from this class can be received through class MMceRtpObserver. +* +* Enable and Disable operations to it are considered to be local, +* so they are not signalled to remote terminal. +* +* One CMceRTPSource may contain several RTP streams which are identified with +* synchronization source (SSRC) values. Disabling or enabling CMceRtpSource +* will affect to all SSRCs but streaming from specific SSRC can be also +* controlled with EnableSSRCL and Disable SSRCL methods. These are also +* local operations, thus not signalled to remote terminal. +* +* @lib mceclient.lib +*/ +class CMceRtpSource: public CMceMediaSource + { + + public: // Constructors and destructor + + /** + * Two-phased constructor. + * @param aBufferLength, length in packets of jitter buffer + * @param aBufferTreshold, treshold in packets of jitter buffer + * @param aInactivityTimer, timer (ms) to detect network inactivity. + * If 0, no activity detection, otherwise source is set to support + * talk bursts and report inactivity. + * @param aIdentity, identity of user placed in RTCP, ownership not transferred. + */ + IMPORT_C static CMceRtpSource* NewL( + TUint aBufferLength = KMceJitterBufferLength, + TUint aBufferTreshold = KMceJitterBufferTreshold, + TUint32 aInactivityTimer = 0, + HBufC8* aIdentity = 0 ); + + /** + * Two-phased constructor. + * @param aBufferLength, length in packets of jitter buffer + * @param aBufferTreshold, treshold in packets of jitter buffer + * @param aInactivityTimer, timer (ms) to detect network inactivity. + * If 0, no activity detection, otherwise source is set to support + * talk bursts and report inactivity. + * @param aIdentity, identity of user placed in RTCP, ownership not transferred. + */ + IMPORT_C static CMceRtpSource* NewLC( + TUint aBufferLength = KMceJitterBufferLength, + TUint aBufferTreshold = KMceJitterBufferTreshold, + TUint32 aInactivityTimer = 0, + HBufC8* aIdentity = 0 ); + + /** + * Destructor. + */ + IMPORT_C ~CMceRtpSource(); + + public: // From base class + + /** + * Enables streaming explicitly. + */ + IMPORT_C void EnableL(); + + /** + * Disables streaming explicitly. + */ + IMPORT_C void DisableL(); + + public: // Functions + + /** + * Enables RTP inactivity timer. + * @param aInactivityTimer, timer value (ms) that after inactivity + * of media from network is reported to client. + */ + IMPORT_C void EnableInactivityTimerL( TUint32 aInactivityTimer ); + + /** + * Disables RTP inactivity timer. + */ + IMPORT_C void DisableInactivityTimerL(); + + /** + * Updates settings for incoming session. + * @pre CMceSession::State() == CMceSession::EIncoming + * @param aBufferLength, length in packets of jitter buffer + * @param aBufferTreshold, treshold in packets of jitter buffer + * @param aInactivityTimer, timer (ms) to detect network inactivity. + * If 0, no activity detection, otherwise source is set to support + * talk bursts and report inactivity. + * @param aIdentity, identity of user placed in RTCP, ownership not transferred. + */ + IMPORT_C void UpdateL ( TUint aBufferLength = KMceJitterBufferLength, + TUint aBufferTreshold = KMceJitterBufferTreshold, + TUint32 aInactivityTimer = 0, + HBufC8* aIdentity = 0 ); + + /** + * Sends RTCP receiver report to recipient. + */ + IMPORT_C void SendRRL(); + + /** + * Returns the last RTP stream source identifier + * used in network (SSRC). + * @pre CMceSession::State() == CMceSession::EEstablished + * @return last source identifier used in network (SSRC). + */ + IMPORT_C TUint32 Ssrc() const; + + /** + * Gets an array of RTP synchronization source (SSRC) identifiers. + * Array includes all SSRC values this RtpSource has received RTP from. + * Changes in array are notified using MMceRtpObserver interface. + * @return array of synchronization source identifiers + */ + IMPORT_C const RArray& Ssrcs() const; + + /** + * Enables streaming from specified synchronization source (SSRC). + * @param aSsrc synchronization source to be enabled + */ + IMPORT_C void EnableSsrcL( TUint aSsrc ); + + /** + * Disables streaming from specified synchronization source (SSRC). + * @param aSsrc synchronization source to be disabled + */ + IMPORT_C void DisableSsrcL( TUint aSsrc ); + + /** + * Determines whether specific SSRC is enabled or not. + * @param aSsrc the SSRC identifier + * @return ETrue if specified SSRC is enabled; otherwise EFalse + */ + IMPORT_C TBool IsSsrcEnabledL( TUint aSsrc ); + + private: + + /** + * C++ default constructor. + */ + CMceRtpSource(); + + /** + * second-phase constructor + * @param aBufferLength, length in packets of jitter buffer + * @param aBufferTreshold, treshold in packets of jitter buffer + * @param aInactivityTimer, timer (ms) to detect network inactivity. + * If 0, no activity detection, otherwise source is set to support + * talk burts and report inactivity. + * @param aMediaBurstIndicator, indicator sound to be played before + * every new burst of media, if source in media burst mode. + */ + void ConstructL( TUint aBufferLength, + TUint aBufferTreshold, + TUint32 aInactivityTimer, + HBufC8* iMediaBurstIndicator ); + + + public: // Stub data + + RArray iSsrcs; + + TUint iBufferLength; + TUint iBufferTreshold; + TUint32 iInactivityTimer; + TUint32 iSilenceTimer; + TUint iToneFrequency; + TUint iToneLength; + HBufC8* iMediaBurstIndicator; + + }; + + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mceclientstub/inc/mcesession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mceclientstub/inc/mcesession.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,367 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef CMCESESSION_H +#define CMCESESSION_H + +// INCLUDES +#include +#include + +// FORWARD DECLARATIONS +class CDesC8Array; +class TMceIds; +class CMceMediaStream; +class CMceManager; +class TMceFactory; +class RReadStream; +class RWriteStream; +class CMceItcSender; +class CMceSessionReceiver; +class MMceFcMsgObserver; +class CMceComSession; +class CMceMsgBase; +class TMceEvent; +class CMceInSession; +class MDesC8Array; +class CMceStreamBundle; + + +// CLASS DECLARATION + +/** +* Base class for MCE sessions, inherited by both CMceInSession and CMceOutSession. +* +* CMceSession represents peer-to-peer connection made with remote terminal. +* This connection is also known as dialog and it is set up using SIP INVITE +* method. +* +* The characteristics of the session are defined by user of this class by attaching +* media streams into the session. +* +* After the session has been succesfylly established, it can be later updated and +* must be finally terminated. +* +* If for any reason instance of this class is deleted while in established state, +* session is automatically terminated by MCE server. +* +* @lib mceclient.lib +*/ +class CMceSession : public CBase + { + public: // Session states + + enum TState + { + EIdle, // Idle + EOffering, // Outgoing session, or session update establishment in progress, + EIncoming, // Session received incoming call + EReserving, // UpdateL called to incoming session during session establishment + EAnswering, // Answering an incoming call + EProceeding, // Session media negotiations proceeding + EEstablished, // Session established + ECancelling, // Cancelling outgoing session establishment + ETerminating, // Terminating session + ETerminated, // Session terminated + }; + + public: // Session termination reasons + + enum TReason + { + EDeclined, + EBusy, + ECancelled, + EDisconnected + }; + + public: + + /** + * Destructor. + */ + virtual ~CMceSession(); + + public: // Functions + + /** + * Returns the state of the session. + * @return The current state of the session + */ + IMPORT_C TState State() const; + + /** + * Returns the state of network connection of the session. + * @return ETrue if connection active, EFalse if connection inactive. + */ + IMPORT_C TBool ConnectionActive() const; + + + /** + * Removes media stream from session. + * @pre State() == CMceSession::EIdle || + * State() == CMceSession::EIncoming || + * State() == CMceSession::EEstablished + * @post aMediaStream cannot be used anymore and contents of + * previously returned stream array (CMceSession::Streams()) + * are not anymore valid + * @param aMediaStream media stream to be removed + */ + IMPORT_C void RemoveStreamL( CMceMediaStream& aMediaStream ); + + /** + * Adds media stream into session. + * @pre State() == CMceSession::EIdle || + * State() == CMceSession::EIncoming || + * State() == CMceSession::EEstablished + * @pre aMediaStream != 0 + * @param aMediaStream, media stream to be added. + * ownership is transferred. + */ + virtual void AddStreamL( CMceMediaStream* aMediaStream ); + + /** + * Updates offered session parameters during session + * establishement phase for first answer. + * Updates established session using re-invite. + * In state EIncoming the timeout value must be smaller or equal to + * offered value obtained by SessionTimer(). + * @pre State() == CMceSession::EIncoming || + * State() == CMceSession::EEstablished + * @post State() == CMceSession::EReserving for incoming session || + * State() == CMceSession::EOffering for established session + * @param aTimeout, the session timer value in seconds + * @param aHeaders, SIP headers to be added. Ownership is + * transferred. + * @param aContentType, content type of the body. + * Ownership is transferred. + * @param aContent, content to be added in body. Ownership is + * transferred. + * @param aContentHeaders, content headers to be added. Ownership is + * transferred. + */ + IMPORT_C void UpdateL( + TUint32 aTimeout = 0, + CDesC8Array* aHeaders = 0, + HBufC8* aContentType = 0, + HBufC8* aContent = 0, + CDesC8Array* aContentHeaders = 0 ); + + /** + * Terminates established session. + * @pre State() == CMceSession::EEstablished + * @post State() == CMceSession::ETerminating + * @param aHeaders, SIP headers to be added. Ownership is + * transferred. + * @param aContentType, content type of the body. + * Ownership is transferred. + * @param aContent, content to be added in body. Ownership is + * transferred. + */ + IMPORT_C void TerminateL( CDesC8Array* aHeaders = 0, + HBufC8* aContentType = 0, + HBufC8* aContent = 0 ); + + /** + * Returns the streams belonging to the session. + * @return streams of the session. + */ + IMPORT_C const RPointerArray& Streams() const; + + /** + * Returns the recipient of the session. + * @pre State() == CMceSession::EIncoming || + * State() == CMceSession::EEstablished + * @return The recipients address. + */ + IMPORT_C const TDesC8& Recipient() const; + + /** + * Returns the originator of the session. + * @pre State() == CMceSession::EIdle || + * State() == CMceSession::EIncoming || + * State() == CMceSession::EEstablished + * @return the originators address. + */ + IMPORT_C const TDesC8& Originator() const; + + /** + * Configures session by updating SDP session lines. + * In order to get complete update, whole session must be + * updated causing sending of re-invite. + * @pre State() == CMceSession::EIdle || + * State() == CMceSession::EIncoming || + * State() == CMceSession::EEstablished + * @pre aSessionSDPLines != 0 + * @param aSessionSDPLines, application specific SDP lines for session. + * Ownership is transferred. + */ + IMPORT_C void SetSessionSDPLinesL( CDesC8Array* aSessionSDPLines ); + + /** + * Gets SDP lines of the session. + * @return array of session SDP lines, owneship is transferred. + */ + IMPORT_C MDesC8Array* SessionSDPLinesL(); + + /** + * Returns the session timer value of the session. + * @return the session timer value. + */ + IMPORT_C TUint32 SessionTimer() const; + + /** + * Adds grouped media streams to the session. Changes SDP + * of the session. In order to get complete update, whole + * session must be updated causing sending of re-invite. + * @pre State() == CMceSession::EIdle || + * State() == CMceSession::EIncoming || + * State() == CMceSession::EEstablished + * @pre aBundle != 0 + * @param aBundle group of media streams; + * ownership of the bundle is transferred + */ + IMPORT_C void AddBundleL( CMceStreamBundle* aBundle ); + + /** + * Removes grouped media stream from session. Changes SDP + * of the session. In order to get complete update, whole + * session must be updated causing sending of re-invite. + * @pre State() == CMceSession::EIdle || + * State() == CMceSession::EIncoming || + * State() == CMceSession::EEstablished + * @post aBundle cannot be used anymore and contents of + * previously returned bundle array (CMceSession::Bundles()) + * are not anymore valid + * @param aBundle bundle to be removed + */ + IMPORT_C void RemoveBundleL( CMceStreamBundle& aBundle ); + + /** + * Gets the grouped media streams of the session. + * @return bundles of the session + */ + IMPORT_C const RPointerArray< CMceStreamBundle >& Bundles() const; + + /** + * Gets session modifier of type TUint. + * @param aModifier is a modifier to be retrieved + * @param aValue on return will contain modifier value + * @leave KErrNotFound if modifier is not found + */ + IMPORT_C void GetModifierL( TMceSessionModifier aModifier, + TUint& aValue ) const; + + /** + * Sets session modifier of type TUint. + * @param aModifier is a modifier to be set + * @param aValue is a new value of a modifier + * @leave KErrNotFound if modifier is not found + */ + IMPORT_C void SetModifierL( TMceSessionModifier aModifier, + TUint aValue ); + + /** + * Returns the identifier of profile used by the sesison. + * @return TUint32 Identifier of the used profile. 0, + * if session is setup without profile. + */ + IMPORT_C TUint32 Profile() const; + + + public: + + CMceManager& Manager() const; + + protected: + + /** + * C++ default constructor. + * @param aManager, reference to session manager. + * @param aProfileId, id of the sip profile used for the session. + */ + CMceSession( CMceManager* aManager, TUint32 aProfileId ); + + /** + * second-phase constructor + */ + void ConstructL(); + + /** + * Initializes + */ + void InitializeL(); + + + protected: // Not owned data + + /** + * profile id + */ + TUint32 iProfileId; + + private: // Owned data + + /** + * media streams + */ + RPointerArray iMediaStreams; + + /** + * bundles + */ + RPointerArray iBundles; + + //for testing + + //friend class CMceManager; + + public: // stub data + + CMceManager* iManager; + + CMceSession::TState iState; + + TBool iIsConnectionActive; + + HBufC8* iOriginator; + + HBufC8* iRecipient; + + TUint32 iTimeout; + + CDesC8Array* iSessionSDPLines; + + CDesC8Array* iHeaders; + + TBool iForceInternetSignaling; + + TUint i100RelUsage; + + // If this code is != KErrNone, next operation that can fail will fail + // (leave or return a value) with this code. Variable is reseted before + // failing. + // Obs! Check that wanted failing is really implemented in this stub + TInt iFailWithCode; + + TBuf8<200> iReasonPhrase; + + TInt iReasonCode; + }; + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mceclientstub/inc/mcesessionobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mceclientstub/inc/mcesessionobserver.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,82 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef MMCESESSIONOBSERVER_H +#define MMCESESSIONOBSERVER_H + +// INCLUDES +#include + +// FORWARD DECLARATIONS +class CMceSession; +class TMceTransactionDataContainer; + +// CLASS DECLARATION + +/** +* An interface to be implemented by users of MCE if they wish to use +* sessions. +* +* This observer is set using CMceManager::SetSessionObserver function. +* +* @lib mceclient.lib +*/ +class MMceSessionObserver + { + public: // Session control callbacks + + /** + * The state of the session has changed. + * @param aSession, the session that has changed. + * @param aContainer, if present, holds details of + * transaction causing state change. + */ + virtual void SessionStateChanged( + CMceSession& aSession, + TMceTransactionDataContainer* aContainer ) = 0; + + /** + * The state of the connection used by the session has changed. + * @param aSession, the session that has changed. + * @param aActive, ETrue if connection active, EFalse if connection inactive. + */ + virtual void SessionConnectionStateChanged( + CMceSession& aSession, + TBool aActive ) = 0; + + /** + * An error has occurred concerning a specific session. + * Note, that each error causes the session state to be ETerminated. + * @param aSession, The session raising the error. + * @param aError, Error code + */ + virtual void Failed( CMceSession& aSession, TInt aError ) = 0; + + /** + * An session update has been failed concerning a specific session. + * Note, that each error causes the session state to be ETerminated. + * @param aSession, The session raising the error. + * @param aContainer, if present, holds details of + * transaction causing update. + */ + virtual void UpdateFailed( + CMceSession& aSession, + TMceTransactionDataContainer* aContainer ) = 0; + }; + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mceclientstub/inc/mcespeakersink.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mceclientstub/inc/mcespeakersink.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,130 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef CMCESPEAKERSINK_H +#define CMCESPEAKERSINK_H + +// INCLUDES +#include +#include + +// DATA TYPES +const TMceSinkType KMceSpeakerSink = 2; + +// CLASS DECLARATION + +const TInt KMceAudioRoutePrivate = 3; +const TInt KMceAudioRoutePublic = 4; + +/** +* Class representing speaker in MCE. +* +* CMceSpeakerSink can be used to play out audio. +* +* Enable (un-mute) and Disable (mute) operations to it are considered +* to be local, so they are not signalled to remote terminal. +* +* @lib mceclient.lib +*/ +class CMceSpeakerSink: public CMceMediaSink + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CMceSpeakerSink* NewL(); + + /** + * Two-phased constructor. + */ + IMPORT_C static CMceSpeakerSink* NewLC(); + + /** + * Destructor. + */ + IMPORT_C ~CMceSpeakerSink(); + + public: // Functions + + /** + * Enables streaming explicitly. + */ + IMPORT_C void EnableL(); + + /** + * Disables streaming explicitly. + */ + IMPORT_C void DisableL(); + + /** + * Sets volume + * @param aVolume, + */ + IMPORT_C void SetVolumeL( TInt aVolume ); + + /** + * Gets current volume + * @return value of current volume, + */ + IMPORT_C TInt VolumeL() const; + + /** + * Gets maximum volume + * @return value of mamimum volume, + */ + IMPORT_C TInt MaxVolumeL() const; + + /** + * Sets audio routing + * @param aRoute Required audio route, like KMceAudioRoutePublic. + */ + IMPORT_C void SetRoutingL( TInt aRoute ); + + /** + * Gets current audio routing. + * @return TInt Current audio routing. + */ + IMPORT_C TInt RoutingL() const; + + private: + + /** + * C++ default constructor. + */ + CMceSpeakerSink(); + + /** + * second-phase constructor + */ + void ConstructL(); + + + + + public: // stub data + + TInt iVolume; + + TInt iMaxVolume; + + TInt iAudioRouting; + + }; + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mceclientstub/inc/mcestreambundle.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mceclientstub/inc/mcestreambundle.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,150 @@ +/* +* 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: +* +*/ + + +#ifndef MCESTREAMBUNDLE_H +#define MCESTREAMBUNDLE_H + +// INCLUDES +#include +#include + +// CONSTANTS + +// FORWARD DECLARATIONS +class CMceMediaStream; +class CMceSession; +class CMceMediaSink; +class MMceEndPointProxy; + + +/** +* Class for handling grouping of Mce streams (i.e. grouping of media lines). +* +* Can be used for example to synchronize audio and video streams. +* +* If streams are added to the bundle or removed from it after the bundle +* has been added to the session, the session has to be updated with +* CMceSEssion::UpdateL() function in order to complete the changes. +* +* @lib mceclient.lib +*/ +class CMceStreamBundle: public CBase + { + public: // Bundle types + + enum TMceStreamBundleType + { + ELS, + EFID + }; + + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CMceStreamBundle* NewL( TMceStreamBundleType aType ); + + /** + * Two-phased constructor. + */ + IMPORT_C static CMceStreamBundle* NewLC( TMceStreamBundleType aType ); + + /** + * Destructor. + */ + IMPORT_C ~CMceStreamBundle(); + + public: + + /** + * Type of the bundle + * @param aParent the parent + */ + IMPORT_C TMceStreamBundleType Type() const; + + /** + * Adds stream to the bundle. + * @param aStream, stream to be added + */ + IMPORT_C void AddStreamL( CMceMediaStream& aStream ); + + /** + * Removes stream from the bundle. + * @param aStream, stream to be removed + */ + IMPORT_C void RemoveStreamL( CMceMediaStream& aStream ); + + /** + * Returns the streams belonging to the bundle. + * @return streams of the bundle. + */ + IMPORT_C const RPointerArray< CMceMediaStream >& Streams(); + + public: + + /** + * Initializes + * @param aParent the parent + */ + void InitializeL( CMceSession& aParent ); + + + private: //methods + + /** + * C++ default constructor. + */ + CMceStreamBundle(); + + /** + * second-phase constructor + */ + void ConstructL( TMceStreamBundleType aType ); + + void AddedSinkL( CMceMediaStream& aStream, + CMceMediaSink*& aCurrentSink, + MMceEndPointProxy*& aProxy ); + + + protected: // NOT owned data + + /** + * session + */ + CMceSession* iSession; + + public: // Stub data + + /** + * Bundled streams, streams are not owned + */ + RPointerArray< CMceMediaStream > iStreams; + + RPointerArray< CMceMediaStream > iTempStreams; + + /** + * type + */ + CMceStreamBundle::TMceStreamBundleType iBundleType; + + + + }; + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mceclientstub/inc/mcestreamobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mceclientstub/inc/mcestreamobserver.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,71 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef MMCESTREAMOBSERVER_H +#define MMCESTREAMOBSERVER_H + +// INCLUDES +#include + +// FORWARD DECLARATIONS +class CMceMediaStream; +class CMceMediaSink; +class CMceMediaSource; + +// CLASS DECLARATION + +/** +* An interface to be implemented by users of MCE if they wish to receive +* media state events. +* +* This observer is set using CMceManager::SetMediaObserver function. +* +* @lib mceclient.lib +*/ +class MMceStreamObserver + { + public: + + /** + * The state of the stream has changed. + * @param aStream, the stream that has changed. + */ + virtual void StreamStateChanged( + CMceMediaStream& aStream) = 0; + + /** + * The state of the sink has changed. + * @param aStream, the stream that uses the sink. + * @param aSink, the sink that has changed. + */ + virtual void StreamStateChanged( + CMceMediaStream& aStream, + CMceMediaSink& aSink) = 0; + + /** + * The state of the source has changed. + * @param aStream, the stream that uses the source. + * @param aSource, the source that has changed. + */ + virtual void StreamStateChanged( + CMceMediaStream& aStream, + CMceMediaSource& aSource) = 0; + + }; + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mceclientstub/inc/mcetransactiondatacontainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mceclientstub/inc/mcetransactiondatacontainer.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,120 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef TMceTRANSACTIONDATACONTAINER_H +#define TMceTRANSACTIONDATACONTAINER_H + +// INCLUDES +#include +#include +//#include + +// CLASS DECLARATION + +/** +* Container class to hold detailed data of a transaction. +* +* It is assumed, that user has only one instance of this class. +* The same instance is passed between MCE and user, but the data +* inside of this container is just updated for each event. +* +* The data inside the container is valid only during the execution +* of the callback function. After this the remaining data in container +* is deleted. +* +* @lib mceclient.lib +*/ +class TMceTransactionDataContainer + { + public: + + /** + * Default constructor + */ + IMPORT_C TMceTransactionDataContainer(); + + /** + * Returns status code + * @returns status code of transaction, if any. + */ + IMPORT_C TInt GetStatusCode(); + + /** + * Returns reason phrase, ownership is transferred. + * @returns reason phrase of transaction, if any. + */ + IMPORT_C HBufC8* GetReasonPhrase(); + + /** + * Returns headers, ownership is transferred. + * @returns headers of transaction, if any. + */ + IMPORT_C CDesC8Array* GetHeaders(); + + /** + * Returns content type, ownership is transferred. + * @returns content type of transaction, if any. + */ + IMPORT_C HBufC8* GetContentType(); + + /** + * Returns content headers, ownership is transferred. + * @returns headers of content, if any. + */ + IMPORT_C CDesC8Array* GetContentHeaders(); + + /** + * Returns content, ownership is transferred. + * @returns content of transaction, if any. + */ + IMPORT_C HBufC8* GetContent(); + + public: // IMPORTED FOR STUBBING PURPOSES, NORMALLY NOT IMPORTED + + IMPORT_C void SetStatusCode( TInt aStatusCode ); + + IMPORT_C void SetReasonPhrase( HBufC8* aReasonPhrase ); + + IMPORT_C void SetHeaders( CDesC8Array* aHeaders ); + + IMPORT_C void SetContentType( HBufC8* aContentType ); + + IMPORT_C void SetContent( HBufC8* aContent ); + + IMPORT_C void SetContentHeaders( CDesC8Array* aHeaders ); + + IMPORT_C void Clear(); + + private: + + TUint32 iStatusCode; + + HBufC8* iReasonPhrase; + + CDesC8Array* iHeaders; + + HBufC8* iContentType; + + CDesC8Array* iContentHeaders; + + HBufC8* iContent; + + + }; + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mceclientstub/inc/mcevideocodec.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mceclientstub/inc/mcevideocodec.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,190 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef MCEVIDEOCODEC_H +#define MCEVIDEOCODEC_H + +// INCLUDES +#include +#include "mcecodec.h" +#include "mcedefs.h" + +// FORWARD DECLARATIONS +class CMceComVideoCodec; +class TMceVideoCodecFactory; +class TCCMRVideoCodingOptions; + +// CONSTANTS +const TMceCodecType KMceVideoCodec = 2; + + +// CLASS DECLARATION + +/** +* Base class for video codecs. +* +* It defines setters and getters for generic video codec attributes. +* These attributes are used in single video stream and they +* are negotiated with remote terminal. +* +* @lib mceclient.lib +*/ +class CMceVideoCodec : public CMceCodec + { + public: // Constructors and destructor + + /** + * Destructor. + */ + virtual ~CMceVideoCodec(); + + + public: // New functions + + /** + * Clones the codec. + * @return cloned codec; ownership is transferred + */ + virtual CMceVideoCodec* CloneL() const = 0; + + /** + * Sets maximum bitrate of the codec. + * @param aMaxBitrate value of maximum bitrate used for encoding + * @leave KErrNotSupported if codec doesn't support frame sizes issued + */ + virtual void SetMaxBitrateL( TUint aMaxBitrate ) = 0; + + /** + * Sets resolutions allowed with the codec. + * @param aResolutions bitfield of allowed resolutions + * @leave KErrNotSupported if codec doesn't support resolutions issued + */ + virtual void SetAllowedResolutionsL( TUint aResolutions ) = 0; + + /** + * Sets resolution of the video. + * @param aResolution resolution of the video in pixels + * @leave KErrNotSupported if codec doesn't support resolution issued + */ + virtual void SetResolutionL( TSize aResolution ) = 0; + + /** + * Sets frame rates allowed with the codec. + * @param aFrameRates allowed frame rate values as a bitfield + * @leave KErrNotSupported if codec doesn't support frame rates issued + */ + virtual void SetAllowedFrameRatesL( TUint aFrameRates ) = 0; + + /** + * Sets frame rate used with the codec for encoding. + * @param aFrameRate frame rate for encoding + * @leave KErrNotSupported if codec doesn't support frame rate value + * issued + */ + virtual void SetFrameRateL( TReal aFrameRate ) = 0; + + /** + * Sets preferred encoding device for uplink stream and preferred decoding + * device for downlink stream. + * @param aEncodingDecodingDevice + * @leave KErrNotSupported if setting preferred device is not possible + */ + virtual void SetPreferredEncodingDecodingDeviceL( + TUid aEncodingDecodingDevice ) = 0; + + /** + * Set config key (sprop-parameter-sets) + * @param aConfigKey, config key as Base64 encoded + * @leave KErrNotSupported if setting config key is not possible + */ + virtual void SetConfigKeyL( const TDesC8& aConfigKey ) = 0; + + + public: // Getters + + /** + * Gets maximum bit rate currently allowed + * @return maximum bit rate + */ + IMPORT_C TUint MaxBitRate() const; + + /** + * Gets currently allowed resolutions as a bitfield + * @return currently allowed resolutions as a bitfield + */ + IMPORT_C TUint AllowedResolutions() const; + + /** + * Gets current resolution + * @return current resolution + */ + IMPORT_C TSize Resolution() const; + + /** + * Gets frame rates currently allowed for encoding and decoding. + * @return allowed frame rate values as a bitfield + */ + IMPORT_C TUint AllowedFrameRates() const; + + /** + * Gets frame rate currently used for encoding and decoding. + * @return current frame rate value + */ + IMPORT_C TReal FrameRate() const; + + /** + * Get config key (sprop-parameter-sets) + * @return config key as Base64 encoded or NULL, ownership + * is transferred. + */ + IMPORT_C HBufC8* ConfigKeyL() const; + + + protected: // New functions + + /** + * C++ default constructor. + */ + CMceVideoCodec(); + + + + + private: // Reserved for future use + + TAny* iReserved; + + public: // stub data + + TReal iFrameRate; + TUint iMaxBitRate; + TUint iAllowedResolutions; + TInt iResolutionWidth; + TInt iResolutionHeight; + TUint iAllowedFrameRates; + TUint iClockRate; + + HBufC8* iConfigKey; + TUid iEncodingDecodingDevice; + + }; + + +#endif + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mceclientstub/inc/mcevideostream.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mceclientstub/inc/mcevideostream.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,176 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef MCEVIDEOSTREAM_H +#define MCEVIDEOSTREAM_H + +// INCLUDES +#include +#include "mcemediastream.h" + +// CONSTANTS +const TMceMediaType KMceVideo = 2; + +// FORWARD DECLARATIONS +class CMceVideoCodec; + +// CLASS DECLARATION + +/** +* Class for representing unidirectional video stream. +* +* It defines the used video codecs for the stream. +* In order to be complete structure, at least one codec is required. +* +* @lib mceclient.lib +*/ +class CMceVideoStream : public CMceMediaStream + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CMceVideoStream* NewL(); + + /** + * Two-phased constructor. + */ + IMPORT_C static CMceVideoStream* NewLC(); + + /** + * Destructor. + */ + IMPORT_C ~CMceVideoStream(); + + public: // Functions + + /** + * Returns the codecs available to the session. + * For CMceOutSession, array contains all codecs supported by + * terminal in default. For CMceInSession, array contains codecs + * that were offered by remote terminal, and supported by local terminal. + * Codecs are in preference order in the array. + * Codec in the first element of the array has highest preference. + * Adding, removing or replacing a codec or changing the preference + * of a codec causes the returned array to be in invalid state. + * @return codecs available for the session + */ + IMPORT_C const RPointerArray& Codecs(); + + /** + * Adds codec to the stream. The codec contains preference value + * which will define its preference when added to the stream. + * Preference of codecs with the same preference value is determined + * by order they were added to the stream. In case of bound streams, + * codec is also automatically added to the opposite direction stream. + * After adding a codec an array of codecs received with a call + * to Codecs() is not valid. + * @param aCodec codec added to the stream; ownership is transferred + */ + IMPORT_C void AddCodecL( CMceVideoCodec* aCodec ); + + /** + * Removes codec from the stream. In case of bound streams, codec is + * also automatically removed from the opposite direction stream. + * After removing a codec an array of codecs previously received with + * a call to Codecs() is not valid. + * @param aCodec codec removed from stream + */ + IMPORT_C void RemoveCodecL( CMceVideoCodec& aCodec ); + + /** + * Replaces codecs of the stream. Preference values of codecs will define + * the preference order. In case of bound streams, codecs are + * also automatically added to the opposite direction stream. + * After replacing codecs an array of codecs received with a call + * to Codecs() is not valid. + * @param aCodecs array of codecs which will replace existing codecs; + * ownership is transferred + */ + IMPORT_C void ReplaceCodecsL( RPointerArray* aCodecs ); + + /** + * Gets supported video codecs of the current stream configuration. + * Supported codecs for this video stream is affected by attached + * sinks and sources. + * @return supported video codecs of the current stream configuration + */ + IMPORT_C const RPointerArray& + SupportedVideoCodecs() const; + + + public: // From CMceMediaStream + + /** + * Initializes the stream. + * @param aParent the parent + */ + void InitializeL( CMceSession& aParent ); + + /** + * Initializes the stream. + * @param aManager the manager; ownership is not transferred + */ + void InitializeL( CMceManager* aManager ); + + + protected: // From CMceMediaStream + + /** + * Determine whether current combination of source and sinks + * is allowed for spesific stream type. + * @return ETrue is combination is allowed; otherwise EFalse + */ + virtual TBool IsAllowedCombination(); + + private: + + /** + * C++ default constructor. + */ + CMceVideoStream(); + + /** + * Second-phase constructor. + */ + void ConstructL(); + + + private: // Owned data + + /** + * Codecs. + */ + RPointerArray iCodecs; + + /** + * Supported video codecs. + */ + RPointerArray iSupportedVideoCodecs; + + private: // Reserved for future use + + TAny* iReserved; + + + public: // Stub data + + }; + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mceclientstub/src/mceamrcodec.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mceclientstub/src/mceamrcodec.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,194 @@ +/* +* Copyright (c) 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: +* +*/ + + +#include "mceamrcodec.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CMceAmrCodec::~CMceAmrCodec +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceAmrCodec::~CMceAmrCodec() + { + } + +// ----------------------------------------------------------------------------- +// CMceAmrCodec::CloneL +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceAudioCodec* CMceAmrCodec::CloneL() const + { + CMceAmrCodec* clone = CMceAmrCodec::NewLC( iSdpName ); + + if ( iFmtpAttr ) + { + clone->iFmtpAttr = iFmtpAttr->AllocL(); + } + clone->iEnableVAD = iEnableVAD; + clone->iSamplingFreq = iSamplingFreq; + clone->iPTime = iPTime; + clone->iMaxPTime = iMaxPTime; + clone->iBitrate = iBitrate; + clone->iAllowedBitrates = iAllowedBitrates; + clone->iPayloadType = iPayloadType; + clone->iCodecMode = iCodecMode; + clone->iFourCC = iFourCC; + clone->iFrameSize = iFrameSize; + + CleanupStack::Pop( clone ); + + return clone; + } + +// ----------------------------------------------------------------------------- +// CMceAmrCodec::EnableVAD +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceAmrCodec::EnableVAD( TBool aEnableVAD ) + { + iEnableVAD = aEnableVAD; + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CMceAmrCodec::SetBitrate +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceAmrCodec::SetBitrate(TUint aBitrate) + { + iBitrate = aBitrate; + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CMceAmrCodec::SetAllowedBitrates +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceAmrCodec::SetAllowedBitrates(TUint aBitrates) + { + iAllowedBitrates = aBitrates; + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CMceAmrCodec::SetSamplingFreq +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceAmrCodec::SetSamplingFreq(TUint aSamplingFreq) + { + iSamplingFreq = aSamplingFreq; + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CMceAmrCodec::SetPTime +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceAmrCodec::SetPTime(TUint aPTime) + { + iPTime = aPTime; + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CMceAmrCodec::SetMaxPTime +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceAmrCodec::SetMaxPTime(TUint aMaxPTime) + { + iMaxPTime = aMaxPTime; + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CMceAmrCodec::SetPayloadType +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceAmrCodec::SetPayloadType(TUint8 aPayloadType) + { + iPayloadType = aPayloadType; + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CMceAmrCodec::SetCodecMode +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceAmrCodec::SetCodecMode(TUint aCodecMode) + { + iCodecMode = aCodecMode; + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CMceAmrCodec::NewL +// ----------------------------------------------------------------------------- +// +CMceAmrCodec* CMceAmrCodec::NewL( TBuf8 aSdpName ) + { + CMceAmrCodec* self = NewLC( aSdpName ); + CleanupStack::Pop( self ); + return self; + + } + +// ----------------------------------------------------------------------------- +// CMceAmrCodec::NewL +// ----------------------------------------------------------------------------- +// +CMceAmrCodec* CMceAmrCodec::NewLC( TBuf8 aSdpName ) + { + CMceAmrCodec* self = new (ELeave) CMceAmrCodec(); + CleanupStack::PushL( self ); + self->ConstructL( aSdpName ); + return self; + + } + +// ----------------------------------------------------------------------------- +// CMceAmrCodec::CMceAmrCodec +// ----------------------------------------------------------------------------- +// +CMceAmrCodec::CMceAmrCodec() + : CMceAudioCodec() + { + } + + +// ----------------------------------------------------------------------------- +// CMceAmrCodec::ConstructL +// ----------------------------------------------------------------------------- +// +void CMceAmrCodec::ConstructL( TBuf8 aSdpName ) + { + iSdpName = aSdpName; + } + + +// ----------------------------------------------------------------------------- +// CMceAmrCodec::SetSdpNameL +// ----------------------------------------------------------------------------- +// +void CMceAmrCodec::SetSdpNameL( const TDesC8& aSdpName ) + { + __ASSERT_ALWAYS( aSdpName.Length() <= KMceMaxSdpNameLength, + User::Leave( KErrArgument ) ); + iSdpName.Copy( aSdpName ); + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mceclientstub/src/mceaudiocodec.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mceclientstub/src/mceaudiocodec.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,92 @@ +/* +* Copyright (c) 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: +* +*/ + + +#include "mceaudiocodec.h" +#include "mcesession.h" +#include "mcemanager.h" +#include "mcemediastream.h" + + +#define _FLAT_DATA static_cast( iFlatData ) +#define FLAT_DATA( data ) _FLAT_DATA->data + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// CMceAudioCodec::InitializeL +// ----------------------------------------------------------------------------- +// +void CMceAudioCodec::InitializeL( CMceMediaStream& aParent ) + { + CMceCodec::InitializeL( aParent ); + } + +// ----------------------------------------------------------------------------- +// CMceAudioCodec::~CMceAudioCodec +// ----------------------------------------------------------------------------- +// +CMceAudioCodec::~CMceAudioCodec() + { + } + +// ----------------------------------------------------------------------------- +// CMceAudioCodec::SamplingFreq +// ----------------------------------------------------------------------------- +// +TUint CMceAudioCodec::SamplingFreq() const + { + return iSamplingFreq; + + } + +// ----------------------------------------------------------------------------- +// CMceAudioCodec::VAD +// ----------------------------------------------------------------------------- +// +TBool CMceAudioCodec::VAD() const + { + return iEnableVAD; + } + +// ----------------------------------------------------------------------------- +// CMceAudioCodec::PTime +// ----------------------------------------------------------------------------- +// +TUint CMceAudioCodec::PTime() const + { + return iPTime; + } + +// ----------------------------------------------------------------------------- +// CMceAudioCodec::MaxPTime +// ----------------------------------------------------------------------------- +// +TUint CMceAudioCodec::MaxPTime() const + { + return iMaxPTime; + } + +// ----------------------------------------------------------------------------- +// CMceAudioCodec::CMceAudioCodec +// ----------------------------------------------------------------------------- +// +CMceAudioCodec::CMceAudioCodec() : + CMceCodec() + { + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mceclientstub/src/mceaudiostream.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mceclientstub/src/mceaudiostream.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,155 @@ +/* +* Copyright (c) 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: +* +*/ + + +#include "mceaudiostream.h" +#include "mcemanager.h" +#include "mceaudiocodec.h" +#include "mcesession.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CMceAudioStream::NewL +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceAudioStream* CMceAudioStream::NewL() + { + CMceAudioStream* self = NewLC(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CMceAudioStream::NewLC +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceAudioStream* CMceAudioStream::NewLC() + { + CMceAudioStream* self = new (ELeave) CMceAudioStream(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// ----------------------------------------------------------------------------- +// CMceAudioStream::~CMceAudioStream +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceAudioStream::~CMceAudioStream() + { + iCodecs.ResetAndDestroy(); + } + +// ----------------------------------------------------------------------------- +// CMceAudioStream::Codecs +// ----------------------------------------------------------------------------- +// +EXPORT_C const RPointerArray& CMceAudioStream::Codecs() + { + return iCodecs; + } + +// ----------------------------------------------------------------------------- +// CMceAudioStream::AddCodecL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceAudioStream::AddCodecL(CMceAudioCodec* aCodec) + { + __ASSERT_ALWAYS(aCodec, User::Leave(KErrArgument)); + iCodecs.AppendL(aCodec); + } + +// ----------------------------------------------------------------------------- +// CMceAudioStream::RemoveCodecL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceAudioStream::RemoveCodecL(CMceAudioCodec& aCodec) + { + for(int i = 0; i < iCodecs.Count(); i++ ) + { + if( iCodecs[i] == &aCodec ) + { + delete iCodecs[i]; + iCodecs.Remove( i ); + } + } + } + +// ----------------------------------------------------------------------------- +// CMceAudioStream::CMceAudioStream +// ----------------------------------------------------------------------------- +// +CMceAudioStream::CMceAudioStream() + :CMceMediaStream() + { + iType = KMceAudio; + } + + +// ----------------------------------------------------------------------------- +// CMceAudioStream::ConstructL +// ----------------------------------------------------------------------------- +// +void CMceAudioStream::ConstructL() + { + } + +// ----------------------------------------------------------------------------- +// CMceAudioStream::InitializeL +// ----------------------------------------------------------------------------- +// +void CMceAudioStream::InitializeL( CMceSession& aParent ) + { + + CMceMediaStream::InitializeL( aParent ); + + InitializeL( &aParent.Manager() ); + + for( TInt i = 0; i < iCodecs.Count(); i++ ) + { + iCodecs[i]->InitializeL( *this ); + } + } + + +// ----------------------------------------------------------------------------- +// CMceAudioStream::InitializeL +// ----------------------------------------------------------------------------- +// +void CMceAudioStream::InitializeL( CMceManager* aManager ) + { + CMceMediaStream::InitializeL( aManager ); + if ( aManager && iCodecs.Count() == 0 ) + { + const RPointerArray supportedCodes = + aManager->SupportedAudioCodecs(); + for( TInt i = 0; i < supportedCodes.Count(); i++ ) + { + CMceAudioCodec* codec = supportedCodes[i]->CloneL(); + CleanupStack::PushL( codec ); + iCodecs.AppendL( codec ); + CleanupStack::Pop( codec ); + } + + } + + } + + + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mceclientstub/src/mceavccodec.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mceclientstub/src/mceavccodec.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,286 @@ +/* +* 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: +* +*/ + + +#include "mceavccodec.h" + +// Stub constants +const TReal KMceAvcDefaultFrameRate = 15; +const TInt KMceAvcDefaultFrameSize = 10000; +const TInt KMceAvcDefaultAllowedBitrate = KMceAvcCodecProfileIdBaseline | + KMceAvcCodecProfileIopConstraintSet | + KMceAvcBitrateLevel1; +const TInt KMceAvcLevel1BitrateBps = 64000; + +const TUint KMceAvcDefaultFrameHeight = 176; +const TUint KMceAvcDefaultFrameWidth = 144; + + + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CMceAvcCodec::~CMceAvcCodec +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceAvcCodec::~CMceAvcCodec() + { + } + + +// ----------------------------------------------------------------------------- +// CMceAvcCodec::NewL +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceAvcCodec* CMceAvcCodec::NewL( TBuf8 aSdpName ) + { + CMceAvcCodec* self = NewLC( aSdpName ); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// CMceAvcCodec::NewL +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceAvcCodec* CMceAvcCodec::NewLC( TBuf8 aSdpName ) + { + CMceAvcCodec* self = new (ELeave) CMceAvcCodec(); + CleanupStack::PushL( self ); + self->ConstructL( aSdpName ); + return self; + } + + +// ----------------------------------------------------------------------------- +// CMceAvcCodec::SetBitrate +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceAvcCodec::SetBitrate( TUint aBitrate ) + { + iBitrate = aBitrate; + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// CMceAvcCodec::SetAllowedBitrates +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceAvcCodec::SetAllowedBitrates(TUint aBitrates) + { + iAllowedBitrates = aBitrates; + + delete iConfigKey; + iConfigKey = NULL; + + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// CMceAvcCodec::SetCodecMode +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceAvcCodec::SetCodecMode( TUint aCodecMode ) + { + if ( aCodecMode == KMceAvcModeSingleNal ) + { + iCodecMode = KMceAvcModeSingleNal; + return KErrNone; + } + return KErrNotSupported; + } + + +// ----------------------------------------------------------------------------- +// CMceAvcCodec::SetPayloadType +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceAvcCodec::SetPayloadType(TUint8 aPayloadType) + { + iPayloadType = aPayloadType; + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// CMceAvcCodec::CloneL +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceVideoCodec* CMceAvcCodec::CloneL() const + { + CMceAvcCodec* clone = CMceAvcCodec::NewLC( iSdpName ); + + if ( iFmtpAttr ) + { + clone->iFmtpAttr = iFmtpAttr->AllocL(); + } + clone->iPayloadType = iPayloadType; + + clone->iBitrate = iBitrate; + clone->iAllowedBitrates = iAllowedBitrates; + clone->iCodecMode = iCodecMode; + clone->iFourCC = iFourCC; + clone->iFrameSize = iFrameSize; + + clone->iFrameRate = iFrameRate; + clone->iMaxBitRate = iMaxBitRate; + clone->iAllowedResolutions = iAllowedResolutions; + clone->iResolutionWidth = iResolutionWidth; + clone->iResolutionHeight = iResolutionHeight; + clone->iAllowedFrameRates = iAllowedFrameRates; + clone->iClockRate = iClockRate; + + clone->iPacketizationMode = iPacketizationMode; + clone->iAllowedPacketizationModes = iAllowedPacketizationModes; + + CleanupStack::Pop( clone ); + return clone; + } + + +// ----------------------------------------------------------------------------- +// CMceAvcCodec:: +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceAvcCodec::SetMaxBitrateL( TUint aMaxBitrate ) + { + delete HBufC::NewL( 1 ); // To cause leave in simulation + iMaxBitRate = aMaxBitrate; + } + + +// ----------------------------------------------------------------------------- +// CMceAvcCodec:: +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceAvcCodec::SetAllowedResolutionsL( TUint aResolutions ) + { + delete HBufC::NewL( 1 ); // To cause leave in simulation + iAllowedResolutions = aResolutions; + } + + +// ----------------------------------------------------------------------------- +// CMceAvcCodec:: +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceAvcCodec::SetResolutionL( TSize aResolution ) + { + delete HBufC::NewL( 1 ); // To cause leave in simulation + iResolutionWidth = aResolution.iWidth; + iResolutionHeight = aResolution.iHeight; + } + + +// ----------------------------------------------------------------------------- +// CMceAvcCodec:: +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceAvcCodec::SetAllowedFrameRatesL( TUint aFrameRates ) + { + delete HBufC::NewL( 1 ); // To cause leave in simulation + iAllowedFrameRates = aFrameRates; + } + + +// ----------------------------------------------------------------------------- +// CMceAvcCodec:: +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceAvcCodec::SetFrameRateL( TReal aFrameRate ) + { + delete HBufC::NewL( 1 ); // To cause leave in simulation + iFrameRate = aFrameRate; + } + + +// ----------------------------------------------------------------------------- +// CMceAvcCodec::SetPreferredEncodingDecodingDeviceL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceAvcCodec::SetPreferredEncodingDecodingDeviceL( + TUid aEncodingDecodingDevice ) + { + delete HBufC::NewL( 1 ); // To cause leave in simulation + iEncodingDecodingDevice = aEncodingDecodingDevice; + } + + +// ----------------------------------------------------------------------------- +// CMceAvcCodec::SetEncodingKeyL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceAvcCodec::SetConfigKeyL( const TDesC8& aConfigKey ) + { + HBufC8* configKey = aConfigKey.AllocL(); + delete iConfigKey; + iConfigKey = configKey; + } + + +// ----------------------------------------------------------------------------- +// CMceAvcCodec::SetSdpNameL +// ----------------------------------------------------------------------------- +// +void CMceAvcCodec::SetSdpNameL( const TDesC8& aSdpName ) + { + __ASSERT_ALWAYS( aSdpName.Length() <= KMceMaxSdpNameLength, + User::Leave( KErrArgument ) ); + delete HBufC::NewL( 1 ); // To cause leave in simulation + iSdpName.Copy( aSdpName ); + } + + +// ----------------------------------------------------------------------------- +// CMceAvcCodec::CMceAvcCodec +// ----------------------------------------------------------------------------- +// +CMceAvcCodec::CMceAvcCodec() + :CMceVideoCodec() + { + } + + +// ----------------------------------------------------------------------------- +// CMceAvcCodec::ConstructL +// ----------------------------------------------------------------------------- +// +void CMceAvcCodec::ConstructL( TBuf8 aSdpName ) + { + iSdpName = aSdpName; + iCodecMode = KMceAvcModeSingleNal; + iClockRate = KMceAvcDefaultFrameRate; + iFrameRate = KMceAvcDefaultFrameRate; + iResolutionWidth = KMceAvcDefaultFrameWidth; + iResolutionHeight = KMceAvcDefaultFrameHeight; + iBitrate = KMceAvcLevel1BitrateBps; + iMaxBitRate = KMceAvcLevel1BitrateBps; + iAllowedBitrates = KMceAvcDefaultAllowedBitrate; + iFrameSize = KMceAvcDefaultFrameSize; + // Defaults should be defined in MCE API + const TUint8 KMceDefaultAvcPayloadType = 98; + iPayloadType = KMceDefaultAvcPayloadType; + + } + + + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mceclientstub/src/mcecamerasource.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mceclientstub/src/mcecamerasource.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,356 @@ +/* +* 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: +* +*/ + + +#include "mcecamerasource.h" +#include "mcesession.h" +#include "mcemediastream.h" +#include "mcemanager.h" + + +const TInt KMinDigitalZoom = 0; +const TInt KMinContrast = -100; +const TInt KMaxContrast = 100; +const TInt KMinBrightness = -100; +const TInt KMaxBrightness = 100; + + +const TInt KInitialCameraIndex = 0; +const TInt KInitialZoomFactor = 1; +const TInt KInitialDigitalZoomFactor = 1; +const TInt KInitialContrast = 0; +const TInt KInitialBrightness = 0; +const TInt KInitialExposure = CCamera::EExposureAuto; +const TInt KInitialWhiteBalance = CCamera::EWBAuto; + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceCameraSource* CMceCameraSource::NewL( CMceManager& aManager ) + { + CMceCameraSource* self = CMceCameraSource::NewLC( aManager ); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceCameraSource* CMceCameraSource::NewLC( CMceManager& /*aManager*/ ) + { + CMceCameraSource* self = new( ELeave )CMceCameraSource(); + CleanupStack::PushL( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceCameraSource* CMceCameraSource::NewL() + { + CMceCameraSource* self = CMceCameraSource::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceCameraSource* CMceCameraSource::NewLC() + { + CMceCameraSource* self = new( ELeave )CMceCameraSource(); + CleanupStack::PushL( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceCameraSource::~CMceCameraSource() + { + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceCameraSource::EnableL() + { + CMceMediaSource::DoEnableL(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceCameraSource::DisableL() + { + CMceMediaSource::DoDisableL(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceCameraSource::CamerasAvailable() const + { + return iCameraCount; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceCameraSource::SetCameraIndexL( TInt aCameraIndex ) + { + __ASSERT_ALWAYS( aCameraIndex >= 0 && + aCameraIndex < this->CamerasAvailable(), + User::Leave( KErrArgument ) ); + + + iCameraIndex = aCameraIndex; + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceCameraSource::GetCameraInfo( TCameraInfo& aInfo ) const + { + aInfo = iCameraInfo; + + aInfo.iMaxZoom += iCameraIndex*5; + aInfo.iMaxDigitalZoom += iCameraIndex*5; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceCameraSource::SetZoomFactorL( TInt aZoomFactor ) + { + __ASSERT_ALWAYS( aZoomFactor >= iCameraInfo.iMinZoom && + aZoomFactor <= iCameraInfo.iMaxZoom, + User::Leave( KErrArgument ) ); + + iZoomFactor = aZoomFactor; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceCameraSource::ZoomFactorL() + { + return iZoomFactor; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceCameraSource::SetDigitalZoomFactorL( TInt aDigitalZoomFactor ) + { + __ASSERT_ALWAYS( aDigitalZoomFactor >= KMinDigitalZoom && + aDigitalZoomFactor <= iCameraInfo.iMaxDigitalZoom, + User::Leave( KErrArgument ) ); + + iDigitalZoomFactor = aDigitalZoomFactor; + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceCameraSource::DigitalZoomFactorL() + { + return iDigitalZoomFactor; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceCameraSource::SetContrastL( TInt aContrast ) + { + + __ASSERT_ALWAYS( ( iCameraInfo.iOptionsSupported & + TCameraInfo::EContrastSupported ) == + TCameraInfo::EContrastSupported, + User::Leave( KErrNotSupported ) ); + + __ASSERT_ALWAYS( (( aContrast >= KMinContrast && + aContrast <= KMaxContrast ) || + aContrast == CCamera::EContrastAuto ), + User::Leave( KErrArgument ) ); + + + iContrast = aContrast; + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceCameraSource::ContrastL() + { + return iContrast; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceCameraSource::SetBrightnessL( TInt aBrightness ) + { + + __ASSERT_ALWAYS( ( iCameraInfo.iOptionsSupported & + TCameraInfo::EBrightnessSupported ) == + TCameraInfo::EBrightnessSupported, + User::Leave( KErrNotSupported ) ); + + __ASSERT_ALWAYS( (( aBrightness >= KMinBrightness && + aBrightness <= KMaxBrightness ) || + aBrightness == CCamera::EBrightnessAuto ), + User::Leave( KErrArgument ) ); + + iBrightness = aBrightness; + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceCameraSource::BrightnessL() + { + return iBrightness; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceCameraSource::SetExposureL( CCamera::TExposure aExposure ) + { + + __ASSERT_ALWAYS( ( iCameraInfo.iExposureModesSupported & aExposure ) == + aExposure, + User::Leave( KErrNotSupported ) ); + + iExposure = aExposure; + + } + + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CCamera::TExposure CMceCameraSource::ExposureL() + { + + + return static_cast( iExposure ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceCameraSource::SetWhiteBalanceL( + CCamera::TWhiteBalance aWhiteBalance ) + { + __ASSERT_ALWAYS( + ( iCameraInfo.iWhiteBalanceModesSupported & aWhiteBalance ) == + aWhiteBalance, + User::Leave( KErrNotSupported ) ); + + iWhiteBalance = aWhiteBalance; + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CCamera::TWhiteBalance CMceCameraSource::WhiteBalanceL() + { + + return static_cast( iWhiteBalance ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMceCameraSource::InitializeL( CMceManager* /*aManager*/ ) + { + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMceCameraSource::CMceCameraSource() + :CMceMediaSource(), + iCameraIndex( 0 ), + iZoomFactor( 1 ), + iDigitalZoomFactor( 0 ), + iContrast( 0 ), + iBrightness( 0 ), + iExposure( CCamera::EExposureAuto ), + iWhiteBalance( CCamera::EWBAuto ), + iCameraCount ( 2 ) + { + iType = KMceCameraSource; + iCameraInfo.iMinZoom = 1; + iCameraInfo.iMaxZoom = 3; + iCameraInfo.iMaxDigitalZoom = 10; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mceclientstub/src/mcecodec.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mceclientstub/src/mcecodec.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,304 @@ +/* +* Copyright (c) 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: +* +*/ + + +#include "mcecodec.h" +#include "mcesession.h" +#include "mcemanager.h" +#include "mcemediastream.h" +#include "mcestreamobserver.h" +#include "mcedefs.h" + + + +#define _FLAT_DATA static_cast( iFlatData ) +#define FLAT_DATA( data ) _FLAT_DATA->data + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CMceCodec::~CMceCodec +// ----------------------------------------------------------------------------- +// +CMceCodec::~CMceCodec() + { + } + +// ----------------------------------------------------------------------------- +// CMceCodec::InitializeL +// ----------------------------------------------------------------------------- +// +void CMceCodec::InitializeL( CMceMediaStream& aParent ) + { + iStream = &aParent; + } + +// ----------------------------------------------------------------------------- +// CMceCodec::SetStateL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceCodec::SetStateL( CMceCodec::TState /*aState*/ ) + { + // NOT SUPPORTED YET + User::Leave( KErrNotSupported ); + } + + +// ----------------------------------------------------------------------------- +// CMceCodec::SetStandByTimerL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceCodec::SetStandByTimerL( TUint32 /*aTimerValue*/ ) + { + // NOT SUPPORTED YET + User::Leave( KErrNotSupported ); + } + + +// ----------------------------------------------------------------------------- +// CMceCodec::SetMMFPriorityL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceCodec::SetMMFPriorityL( TInt aPriority ) + { + iMMFPriority = aPriority; + } + + +// ----------------------------------------------------------------------------- +// CMceCodec::SetMMFPriorityPreferenceL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceCodec::SetMMFPriorityPreferenceL( TInt aPriorityPreference ) + { + iMMFPriorityPreference = aPriorityPreference; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceCodec::SetKeepAliveTimerL( TUint8 aTimerValue ) + { + iKeepAliveTimer = aTimerValue; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceCodec::SetKeepAlivePayloadTypeL( TUint8 aKeepAlivePT ) + { + iKeepAlivePayloadType = aKeepAlivePT; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceCodec::SetKeepAliveDataL( const TDesC8& aData ) + { + iKeepAliveData = aData; + } + + +// ----------------------------------------------------------------------------- +// CMceCodec::State +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceCodec::TState CMceCodec::State() const + { + return CMceCodec::EDisabled; + } + + +// ----------------------------------------------------------------------------- +// CMceCodec::Id +// ----------------------------------------------------------------------------- +// +/* +EXPORT_C TMceMediaId CMceCodec::Id() const + { + return; + } +*/ + +// ----------------------------------------------------------------------------- +// CMceCodec::Type +// ----------------------------------------------------------------------------- +// +EXPORT_C TMceCodecType CMceCodec::Type() const + { + return iType; + } + +// ----------------------------------------------------------------------------- +// CMceCodec::FourCC +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint32 CMceCodec::FourCC() const + { + return iFourCC; + } + +// ----------------------------------------------------------------------------- +// CMceCodec::Bitrate +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint CMceCodec::Bitrate() const + { + return iBitrate; + } + +// ----------------------------------------------------------------------------- +// CMceAudioCodec::AllowedBitrates +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint CMceCodec::AllowedBitrates() const + { + return iAllowedBitrates; + } + +// ----------------------------------------------------------------------------- +// CMceCodec::FrameSize +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint CMceCodec::FrameSize() const + { + return iFrameSize; + } + +// ----------------------------------------------------------------------------- +// CMceCodec::CodecMode +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint CMceCodec::CodecMode() const + { + return iCodecMode; + } + +// ----------------------------------------------------------------------------- +// CMceCodec::PayloadType +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint8 CMceCodec::PayloadType() const + { + return iPayloadType; + } + + +// ----------------------------------------------------------------------------- +// CMceCodec::SdpName +// ----------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CMceCodec::SdpName() const + { + return iSdpName; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceCodec::MMFPriority() const + { + return iMMFPriority; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceCodec::MMFPriorityPreference() const + { + return iMMFPriorityPreference; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint8 CMceCodec::KeepAliveTimer() const + { + return iKeepAliveTimer; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint8 CMceCodec::KeepAlivePayloadType() const + { + return iKeepAlivePayloadType; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CMceCodec::KeepAliveData() const + { + return iKeepAliveData; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceCodec::Preference() const + { + return iPreference; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceCodec::SetPreferenceL( TInt aPreference ) + { + iPreference = aPreference; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMceCodec::SetSdpNameL( const TDesC8& aSdpName ) + { + iSdpName = aSdpName; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMceCodec::CMceCodec() + { + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mceclientstub/src/mcedisplaysink.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mceclientstub/src/mcedisplaysink.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,223 @@ +/* +* 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: +* +*/ + + +#include "mcedisplaysink.h" +#include "mcesession.h" +#include "mcemediastream.h" +#include "mcemanager.h" + +//#include + + +#define _FLAT_DATA static_cast( iFlatData ) +#define FLAT_DATA( data ) _FLAT_DATA->data + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceDisplaySink* CMceDisplaySink::NewL( CMceManager& aManager ) + { + CMceDisplaySink* self = CMceDisplaySink::NewLC( aManager ); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceDisplaySink* CMceDisplaySink::NewLC( CMceManager& /*aManager*/ ) + { + CMceDisplaySink* self = new (ELeave) CMceDisplaySink(); + CleanupStack::PushL( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceDisplaySink* CMceDisplaySink::NewL() + { + CMceDisplaySink* self = CMceDisplaySink::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceDisplaySink* CMceDisplaySink::NewLC() + { + CMceDisplaySink* self = new( ELeave )CMceDisplaySink(); + CleanupStack::PushL( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceDisplaySink::~CMceDisplaySink() + { + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceDisplaySink::EnableL() + { + CMceMediaSink::DoEnableL(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceDisplaySink::DisableL() + { + CMceMediaSink::DoDisableL(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceDisplaySink::DisplaysAvailable() const + { + return 1; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceDisplaySink::SetDisplayIndexL( TInt aDisplayIndex ) + { + __ASSERT_ALWAYS( aDisplayIndex >= 0 && + aDisplayIndex < this->DisplaysAvailable(), + User::Leave( KErrArgument ) ); + + iDisplayIndex = aDisplayIndex; + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceDisplaySink::SetDisplay( RWindow& /*aWindow*/, + CWindowGc& /*aGc*/ ) + { + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceDisplaySink::SetDisplayRectL( const TRect& aRect ) + { + iDisplayRect = aRect; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C const TRect CMceDisplaySink::DisplayRectL() + { + return iDisplayRect; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceDisplaySink::SetPriorityL( TUint aPriority ) + { + iDisplayPriority = aPriority; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint CMceDisplaySink::PriorityL() + { + return iDisplayPriority; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceDisplaySink::SetRotationL( TRotation aRotation ) + { + iRotation = aRotation; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceDisplaySink::TRotation CMceDisplaySink::RotationL() + { + return iRotation; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMceDisplaySink::InitializeL( CMceManager* /*aManager*/ ) + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMceDisplaySink::CMceDisplaySink() + :CMceMediaSink(), + iDisplayIndex( 0 ), + iDisplayRect( TRect( 0, 0, 0, 0 ) ), + iDisplayPriority( 0 ), + iRotation( ENone ) + { + iType = KMceDisplaySink; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mceclientstub/src/mcefilesink.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mceclientstub/src/mcefilesink.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,98 @@ +/* +* 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: +* +*/ + + + +#include "mcefilesink.h" + + + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceFileSink* CMceFileSink::NewL( + const TFileName& aFileName ) + { + CMceFileSink* self = CMceFileSink::NewLC( aFileName ); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceFileSink* CMceFileSink::NewLC( + const TFileName& aFileName ) + { + CMceFileSink* self = new (ELeave) CMceFileSink(); + CleanupStack::PushL( self ); + self->ConstructL( aFileName ); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceFileSink::~CMceFileSink() + { + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceFileSink::EnableL() + { + CMceMediaSink::DoEnableL(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceFileSink::DisableL() + { + CMceMediaSink::DoDisableL(); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMceFileSink::CMceFileSink() + { + iType = KMceFileSink; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMceFileSink::ConstructL( const TFileName& aFileName ) + { + iFileName = aFileName; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mceclientstub/src/mcefilesource.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mceclientstub/src/mcefilesource.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,387 @@ +/* +* 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: +* +*/ + + + +#include "mcefilesource.h" +#include "mcevideostream.h" +#include "mceaudiostream.h" +#include "mcemanager.h" +#include "mcesession.h" +#include "utf.h" + + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceFileSource* CMceFileSource::NewL( + CMceManager& aManager, + const TFileName& aFileName ) + { + CMceFileSource* self = CMceFileSource::NewLC( aManager, aFileName ); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceFileSource* CMceFileSource::NewLC( + CMceManager& aManager, + const TFileName& aFileName ) + { + CMceFileSource* self = new (ELeave) CMceFileSource(); + CleanupStack::PushL( self ); + self->ConstructL( &aManager, aFileName ); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceFileSource::~CMceFileSource() + { + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceFileSource::EnableL() + { + CMceMediaSource::DoEnableL(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceFileSource::DisableL() + { + CMceMediaSource::DoDisableL(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceFileSource::UpdateL ( const TFileName& aFileName ) + { + iFileName = aFileName; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceFileSource::MediaElementCountL( TMceMediaType aType ) const + { + if ( aType == KMceAudio ) + { + return iAudioElementCount; + } + else if ( aType == KMceVideo ) + { + return iVideoElementCount; + } + return 0; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceFileSource::SetCurrentMediaElementL( + TMceMediaType aType, + TInt aIndex ) + { + __ASSERT_ALWAYS( aIndex >= 0 && + aIndex < MediaElementCountL( aType ), + User::Leave( KErrArgument ) ); + + if ( aType == KMceAudio ) + { + iCurrentAudioElement = aIndex; + } + else if ( aType == KMceVideo ) + { + iCurrentVideoElement = aIndex; + } + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceFileSource::CurrentMediaElement( TMceMediaType aType ) + { + if ( aType == KMceAudio ) + { + return iCurrentAudioElement; + } + else if ( aType == KMceVideo ) + { + return iCurrentVideoElement; + } + + return 0; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceFileSource::SetPositionL( + const TTimeIntervalMicroSeconds& aPosition ) + { + __ASSERT_ALWAYS( aPosition <= DurationL() && + aPosition >= TTimeIntervalMicroSeconds( 0 ), + User::Leave( KErrArgument ) ); + + iPosition = aPosition; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TTimeIntervalMicroSeconds CMceFileSource::PositionL() const + { + return iPosition; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TTimeIntervalMicroSeconds CMceFileSource::DurationL() const + { + return iDuration; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceFileSource::SetFastForwardL( TBool aUseFFWD ) + { + __ASSERT_ALWAYS( this->MediaElementCountL( KMceVideo ) > 0, + User::Leave( KErrNotSupported ) ); + + + iFastForward = aUseFFWD; + + + if ( iFastForward ) + { + iFastRewind = EFalse; + } + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceFileSource::SetFastRewindL( TBool aUseFRWD ) + { + __ASSERT_ALWAYS( this->MediaElementCountL( KMceVideo ) > 0, + User::Leave( KErrNotSupported ) ); + + iFastRewind = aUseFRWD; + + if ( iFastRewind ) + { + iFastForward = EFalse; + } + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceFileSource::TranscodeL( const TFileName& aFileName ) + { + __ASSERT_ALWAYS( aFileName != KNullDesC, User::Leave( KErrArgument ) ); + + TBool transcodingNeeded = EFalse; + for ( TInt i = 0; i < iStreams.Count(); ++i ) + { + if ( iStreams[i]->State() == CMceMediaStream::ETranscodingRequired ) + { + transcodingNeeded = ETrue; + if ( iStreams[i]->Type() == KMceAudio ) + { + CMceAudioStream* audio = + static_cast(iStreams[i]); + __ASSERT_ALWAYS( audio->Codecs().Count() > 0, + User::Leave( KErrNotReady ) ); + } + else + { + CMceVideoStream* video = + static_cast(iStreams[i]); + __ASSERT_ALWAYS( video->Codecs().Count() > 0, + User::Leave( KErrNotReady ) ); + } + + iStreams[i]->iState = CMceMediaStream::ETranscoding; + } + } + + __ASSERT_ALWAYS( transcodingNeeded, User::Leave( KErrNotReady ) ); + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceFileSource::CancelTranscodeL() + { + TBool transcodingOngoing = EFalse; + + for ( TInt i = 0; i < iStreams.Count(); ++i ) + { + if ( iStreams[i]->State() == CMceMediaStream::ETranscoding ) + { + transcodingOngoing = ETrue; + iStreams[i]->iState = CMceMediaStream::ETranscodingRequired; + } + } + + __ASSERT_ALWAYS( transcodingOngoing, User::Leave( KErrNotReady ) ); + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceFileSource::TranscodingProgressL() const + { + TBool transcodingOngoing = EFalse; + + if ( iFailWithCode != KErrNone ) + { + TInt failCode = iFailWithCode; + iFailWithCode = KErrNone; + User::Leave( failCode ); + } + + for ( TInt i = 0; i < iStreams.Count(); ++i ) + { + if ( iStreams[i]->State() == CMceMediaStream::ETranscoding ) + { + transcodingOngoing = ETrue; + } + } + + __ASSERT_ALWAYS( transcodingOngoing, User::Leave( KErrNotReady ) ); + + return iTranscodingPercentage; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMceFileSource::InitializeL( CMceManager* aManager ) + { + iDuration = TTimeIntervalMicroSeconds( 100000000 ); + + iAudioElementCount = 1; + iVideoElementCount = 1; + + } + +// ----------------------------------------------------------------------------- +// Factory method for inner usage +// ----------------------------------------------------------------------------- +// +CMceFileSource* CMceFileSource::NewL() + { + CMceFileSource* self = CMceFileSource::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// Factory method for inner usage +// ----------------------------------------------------------------------------- +// +CMceFileSource* CMceFileSource::NewLC() + { + CMceFileSource* self = new (ELeave) CMceFileSource(); + CleanupStack::PushL( self ); + self->ConstructL( NULL, KNullDesC() ); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMceFileSource::CMceFileSource() + { + iType = KMceFileSource; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMceFileSource::ConstructL( CMceManager* aManager, + const TFileName& aFileName ) + { + + iFileName = aFileName; + + if ( aManager ) + { + InitializeL( aManager ); + } + + } + + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mceclientstub/src/mceh263codec.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mceclientstub/src/mceh263codec.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,244 @@ +/* +* 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: +* +*/ + + +#include "mceh263codec.h" + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CMceH263Codec::~CMceH263Codec +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceH263Codec::~CMceH263Codec() + { + } + + +// ----------------------------------------------------------------------------- +// CMceH263Codec::NewL +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceH263Codec* CMceH263Codec::NewL( TBuf8 aSdpName ) + { + CMceH263Codec* self = NewLC( aSdpName ); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// CMceH263Codec::NewL +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceH263Codec* CMceH263Codec::NewLC( TBuf8 aSdpName ) + { + CMceH263Codec* self = new (ELeave) CMceH263Codec(); + CleanupStack::PushL( self ); + self->ConstructL( aSdpName ); + return self; + } + + +// ----------------------------------------------------------------------------- +// CMceH263Codec::SetBitrate +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceH263Codec::SetBitrate(TUint aBitrate) + { + iBitrate = aBitrate; + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// CMceH263Codec::SetAllowedBitrates +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceH263Codec::SetAllowedBitrates(TUint aBitrates) + { + iAllowedBitrates = aBitrates; + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// CMceH263Codec::SetCodecMode +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceH263Codec::SetCodecMode(TUint aCodecMode) + { + iCodecMode = aCodecMode; + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// CMceH263Codec::SetPayloadType +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceH263Codec::SetPayloadType(TUint8 aPayloadType) + { + iPayloadType = aPayloadType; + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// CMceH263Codec::CloneL +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceVideoCodec* CMceH263Codec::CloneL() const + { + CMceH263Codec* clone = CMceH263Codec::NewLC( iSdpName ); + + if ( iFmtpAttr ) + { + clone->iFmtpAttr = iFmtpAttr->AllocL(); + } + clone->iPayloadType = iPayloadType; + + clone->iBitrate = iBitrate; + clone->iAllowedBitrates = iAllowedBitrates; + clone->iCodecMode = iCodecMode; + clone->iFourCC = iFourCC; + clone->iFrameSize = iFrameSize; + + clone->iFrameRate = iFrameRate; + clone->iMaxBitRate = iMaxBitRate; + clone->iAllowedResolutions = iAllowedResolutions; + clone->iResolutionWidth = iResolutionWidth; + clone->iResolutionHeight = iResolutionHeight; + clone->iAllowedFrameRates = iAllowedFrameRates; + clone->iClockRate = iClockRate; + + CleanupStack::Pop( clone ); + return clone; + } + + +// ----------------------------------------------------------------------------- +// CMceH263Codec:: +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceH263Codec::SetMaxBitrateL( TUint aMaxBitrate ) + { + iMaxBitRate = aMaxBitrate; + } + + +// ----------------------------------------------------------------------------- +// CMceH263Codec:: +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceH263Codec::SetAllowedResolutionsL( TUint aResolutions ) + { + iAllowedResolutions = aResolutions; + } + + +// ----------------------------------------------------------------------------- +// CMceH263Codec:: +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceH263Codec::SetResolutionL( TSize aResolution ) + { + iResolutionWidth = aResolution.iWidth; + iResolutionHeight = aResolution.iHeight; + } + + +// ----------------------------------------------------------------------------- +// CMceH263Codec:: +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceH263Codec::SetAllowedFrameRatesL( TUint aFrameRates ) + { + iAllowedFrameRates = aFrameRates; + } + + +// ----------------------------------------------------------------------------- +// CMceH263Codec:: +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceH263Codec::SetFrameRateL( TReal aFrameRate ) + { + iFrameRate = aFrameRate; + } + + +// ----------------------------------------------------------------------------- +// CMceH263Codec::SetPreferredEncodingDecodingDeviceL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceH263Codec::SetPreferredEncodingDecodingDeviceL( + TUid /*aEncodingDecodingDevice*/ ) + { + User::Leave( KErrNotSupported ); + } + + +// ----------------------------------------------------------------------------- +// CMceH263Codec::SetConfigKeyL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceH263Codec::SetConfigKeyL( const TDesC8& /*aConfigKey*/ ) + { + User::Leave( KErrNotSupported ); + } + + +// ----------------------------------------------------------------------------- +// CMceH263Codec::SetSdpNameL +// ----------------------------------------------------------------------------- +// +void CMceH263Codec::SetSdpNameL( const TDesC8& aSdpName ) + { + __ASSERT_ALWAYS( aSdpName.Length() <= KMceMaxSdpNameLength, + User::Leave( KErrArgument ) ); + iSdpName.Copy( aSdpName ); + } + + +// ----------------------------------------------------------------------------- +// CMceH263Codec::CMceH263Codec +// ----------------------------------------------------------------------------- +// +CMceH263Codec::CMceH263Codec() + :CMceVideoCodec() + { + } + + +// ----------------------------------------------------------------------------- +// CMceH263Codec::ConstructL +// ----------------------------------------------------------------------------- +// +void CMceH263Codec::ConstructL( TBuf8 aSdpName ) + { + iSdpName = aSdpName; + iClockRate = KMceH263ClockRate; + iFrameRate = KMceH263FrameRate; + iResolutionWidth = KMceH263FrameWidth; + iResolutionHeight = KMceH263FrameHeight; + } + + + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mceclientstub/src/mceinsession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mceclientstub/src/mceinsession.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,202 @@ +/* +* Copyright (c) 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: +* +*/ + + +#include "mceinsession.h" +#include "mcemanager.h" + + + +// CONSTANTS +const TUint32 KMceMinAcceptable = 200; +const TUint32 KMceMaxAcceptable = 299; +const TUint32 KMceMinError = 300; +const TUint32 KMceMaxError = 699; +const TUint32 KMceRinging = 180; +_LIT8( KMcePhraseRinging, "Ringing" ); + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CMceInSession::NewL +// ----------------------------------------------------------------------------- +// +CMceInSession* CMceInSession::NewL( RReadStream& /*aReadStream*/, + CMceManager& aManager, + TUint32 aProfileId ) + { + CMceInSession* self = new (ELeave) CMceInSession( &aManager, aProfileId ); + CleanupStack::PushL( self ); + self->ConstructL( KNullDesC8, KNullDesC8 ); + CleanupStack::Pop(self); + return self; + + } + +// ----------------------------------------------------------------------------- +// CMceInSession::NewL +// ----------------------------------------------------------------------------- +// + +EXPORT_C CMceInSession* CMceInSession::NewL() + { + CMceInSession* self = new (ELeave) CMceInSession( NULL, 0 ); + CleanupStack::PushL( self ); + self->ConstructL( KNullDesC8, KNullDesC8 ); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CMceInSession::~CMceInSession +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceInSession::~CMceInSession() + { + } + +// ----------------------------------------------------------------------------- +// CMceInSession::RingL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceInSession::RingL( CDesC8Array* aHeaders, + HBufC8* aContentType, + HBufC8* aContent ) + { + User::LeaveIfError( + ( aContentType && aContent ) || !( aContentType || aContent ) ? + KErrNone : KErrArgument ); + + delete aHeaders; + delete aContentType; + delete aContent; + + iRingingCalled = ETrue; + } + +// ----------------------------------------------------------------------------- +// CMceInSession::AcceptL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceInSession::AcceptL() + { + iState = CMceSession::EAnswering; + } + +// ----------------------------------------------------------------------------- +// CMceInSession::AcceptL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceInSession::AcceptL( const TDesC8& /*aReason*/, + TUint32 /*aCode*/, + CDesC8Array* aHeaders, + HBufC8* aContentType, + HBufC8* aContent ) + { + iState = CMceSession::EAnswering; + + delete aHeaders; + delete aContentType; + delete aContent; + } + +// ----------------------------------------------------------------------------- +// CMceInSession::RejectL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceInSession::RejectL() + { + if ( iFailWithCode != KErrNone ) + { + TInt failureCode = iFailWithCode; + iFailWithCode = KErrNone; + User::Leave( failureCode ); + } + + iState = CMceSession::ETerminated; + } + +// ----------------------------------------------------------------------------- +// CMceInSession::RejectL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceInSession::RejectL( const TDesC8& aReason, + TUint32 aCode, + CDesC8Array* aHeaders, + HBufC8* aContentType, + HBufC8* aContent ) + { + + User::LeaveIfError( + ( aContentType && aContent ) || !( aContentType || aContent ) ? + KErrNone : KErrArgument ); + User::LeaveIfError( aCode >= KMceMinError && aCode <= KMceMaxError ? + KErrNone : KErrArgument ); + + RejectL(); + + iReasonPhrase = aReason; + iReasonCode = aCode; + + delete aHeaders; + delete aContentType; + delete aContent; + } + +// ----------------------------------------------------------------------------- +// CMceInSession::CMceInSession +// ----------------------------------------------------------------------------- +// +CMceInSession::CMceInSession( CMceManager* aManager, TUint32 aProfileId ) + : CMceSession( aManager, aProfileId ) + { + } + + +// ----------------------------------------------------------------------------- +// CMceInSession::ConstructL +// ----------------------------------------------------------------------------- +// +void CMceInSession::ConstructL( const TDesC8& aOriginator, const TDesC8& aRecipient ) + { + + delete iOriginator; + iOriginator = 0; + iOriginator = aOriginator.AllocL(); + + delete iRecipient; + iRecipient = 0; + iRecipient = aRecipient.AllocL(); + + CMceSession::ConstructL(); + + iState = EIncoming; + } + +// ----------------------------------------------------------------------------- +// Stub constructor +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceInSession* CMceInSession::NewL( CMceManager& aManager, + const TDesC8& aOriginator ) + { + CMceInSession* self = new (ELeave) CMceInSession( &aManager, 0 ); + CleanupStack::PushL( self ); + self->ConstructL( aOriginator, KNullDesC8 ); + CleanupStack::Pop( self ); + return self; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mceclientstub/src/mcemanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mceclientstub/src/mcemanager.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,302 @@ +/* +* Copyright (c) 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: +* +*/ + + +#include "mcemanager.h" +#include "mceinsessionobserver.h" +#include "mcesessionobserver.h" +#include "mcesession.h" +#include "mcetransactiondatacontainer.h" +#include "mceamrcodec.h" +#include "mceh263codec.h" +#include "mceavccodec.h" + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// CMceManager::NewL +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceManager* CMceManager::NewL( + const TUid& aAppUid, + TMceTransactionDataContainer* aContainer ) + { + + CMceManager* self = + new (ELeave) CMceManager( aAppUid, aContainer ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + + } + + +// ----------------------------------------------------------------------------- +// CMceManager::~CMceManager +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceManager::~CMceManager() + { + if (iContainer) + { + iContainer->Clear(); + iContainer = 0; + } + + iSessions.Reset(); + iSessions.Close(); + + iSupportedAudioCodecs.ResetAndDestroy(); + iSupportedVideoCodecs.ResetAndDestroy(); + + } + +// ----------------------------------------------------------------------------- +// CMceManager::SetInSessionObserver +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceManager::SetInSessionObserver( + MMceInSessionObserver* aInSessionObserver ) + { + iInSessionObserver = aInSessionObserver; + } + +// ----------------------------------------------------------------------------- +// CMceManager::SetInEventObserver +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceManager::SetInEventObserver( + MMceInEventObserver* /*aInEventObserver*/ ) + { + // NOP + } + +// ----------------------------------------------------------------------------- +// CMceManager::SetInReferObserver +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceManager::SetInReferObserver( + MMceInReferObserver* /*aInReferObserver*/ ) + { + // NOP + } + +// ----------------------------------------------------------------------------- +// CMceManager::SetSessionObserver +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceManager::SetSessionObserver( + MMceSessionObserver* aSessionObserver ) + { + iSessionObserver = aSessionObserver; + } + +// ----------------------------------------------------------------------------- +// CMceManager::SetEventObserver +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceManager::SetEventObserver( + MMceEventObserver* /*aEventObserver*/ ) + { + // NOP + } + +// ----------------------------------------------------------------------------- +// CMceManager::SetReferObserver +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceManager::SetReferObserver( + MMceReferObserver* /*aReferObserver*/ ) + { + // NOP + } + +// ----------------------------------------------------------------------------- +// CMceManager::SetMediaObserver +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceManager::SetMediaObserver( + MMceStreamObserver* aMediaObserver ) + { + iMediaObserver = aMediaObserver; + } + + +// ----------------------------------------------------------------------------- +// CMceManager::SetRtpObserver +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceManager::SetRtpObserver( + MMceRtpObserver* aRtpObserver ) + { + iRtpObserver = aRtpObserver; + } + + +// ----------------------------------------------------------------------------- +// CMceManager::SupportedAudioCodecs +// ----------------------------------------------------------------------------- +// +EXPORT_C const RPointerArray& + CMceManager::SupportedAudioCodecs() const + { + return iSupportedAudioCodecs; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C const RPointerArray& + CMceManager::SupportedVideoCodecs() const + { + return iSupportedVideoCodecs; + } + + +// ----------------------------------------------------------------------------- +// CMceManager::Sessions +// ----------------------------------------------------------------------------- +// +EXPORT_C const RPointerArray& CMceManager::Sessions() const + { + return iSessions; + } + + +// ----------------------------------------------------------------------------- +// CMceManager::SetDefaultHeadersL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceManager::SetDefaultHeadersL( CDesC8Array* aMethods, + CDesC8Array* aHeaders ) + { + delete aMethods; + delete aHeaders; + } + + +// ----------------------------------------------------------------------------- +// CMceManager::DefaultHeadersL +// ----------------------------------------------------------------------------- +// +EXPORT_C CDesC8Array* CMceManager::DefaultHeadersL( const TDesC8& /*aMethod*/ ) const + { + return NULL; + } + + +// ----------------------------------------------------------------------------- +// CMceManager::InSessionObserver +// ----------------------------------------------------------------------------- +// +MMceInSessionObserver* CMceManager::InSessionObserver() const + { + return iInSessionObserver; + } + + +// ----------------------------------------------------------------------------- +// CMceManager::SessionObserver +// ----------------------------------------------------------------------------- +// +MMceSessionObserver* CMceManager::SessionObserver() const + { + return iSessionObserver; + } + +// ----------------------------------------------------------------------------- +// CMceManager::MediaObserver +// ----------------------------------------------------------------------------- +// +MMceStreamObserver* CMceManager::MediaObserver() const + { + return iMediaObserver; + } + +// ----------------------------------------------------------------------------- +// CMceManager::RtpObserver +// ----------------------------------------------------------------------------- +// +MMceRtpObserver* CMceManager::RtpObserver() const + { + return iRtpObserver; + } + + +// ----------------------------------------------------------------------------- +// CMceManager::TransactionContainer +// ----------------------------------------------------------------------------- +// +TMceTransactionDataContainer* CMceManager::TransactionContainer() const + { + return iContainer; + } + + +// ----------------------------------------------------------------------------- +// CMceManager::CMceManager +// ----------------------------------------------------------------------------- +// +CMceManager::CMceManager( const TUid& /*aAppUid*/, + TMceTransactionDataContainer* aContainer ) + :iContainer( aContainer ) + { + + } + + +// ----------------------------------------------------------------------------- +// CMceManager::ConstructL +// ----------------------------------------------------------------------------- +// +void CMceManager::ConstructL() + { + // Fake having PCMU codec + iSupportedAudioCodecs.AppendL( CMceAmrCodec::NewLC( KMceSDPNamePCMU() ) ); + CleanupStack::Pop(); + + iSupportedAudioCodecs.AppendL( CMceAmrCodec::NewLC( KMceSDPNameAMR() ) ); + CleanupStack::Pop(); + + // Avc codec, level default 1 + iSupportedVideoCodecs.AppendL( CMceAvcCodec::NewLC( KMceSDPNameH264() ) ); + CleanupStack::Pop(); + + // Avc codec, level default 1, no profile id or constraint set defined + CMceVideoCodec* avc_2nd_Level_1 = CMceAvcCodec::NewLC( KMceSDPNameH264() ); + avc_2nd_Level_1->SetAllowedBitrates( KMceAvcBitrateLevel1 ); + iSupportedVideoCodecs.AppendL( avc_2nd_Level_1 ); + CleanupStack::Pop( avc_2nd_Level_1 ); + + // Avc codec, level 1_3 + CMceVideoCodec* avcLevel_1_3 = CMceAvcCodec::NewLC( KMceSDPNameH264() ); + avcLevel_1_3->SetAllowedBitrates( KMceAvcCodecProfileIdBaseline | + KMceAvcCodecProfileIopConstraintSet | + KMceAvcBitrateLevel1_3 ); + iSupportedVideoCodecs.AppendL( avcLevel_1_3 ); + CleanupStack::Pop( avcLevel_1_3 ); + + // H263 codec + iSupportedVideoCodecs.AppendL( CMceH263Codec::NewLC( KMceSDPNameH2632000() ) ); + CleanupStack::Pop(); + } + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mceclientstub/src/mcemediasink.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mceclientstub/src/mcemediasink.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,117 @@ +/* +* Copyright (c) 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: +* +*/ + + +#include "mcemediasink.h" +#include "mcestreamobserver.h" +#include "mcesession.h" +#include "mcemanager.h" + + + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// CMceMediaSink::~CMceMediaSink +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceMediaSink::~CMceMediaSink() + { + } + +// ----------------------------------------------------------------------------- +// CMceMediaSink::Type +// ----------------------------------------------------------------------------- +// +EXPORT_C TMceSinkType CMceMediaSink::Type() const + { + return iType; + } + + + +// ----------------------------------------------------------------------------- +// CMceMediaSink::IsEnabled +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool CMceMediaSink::IsEnabled() const + { + return iIsEnabled; + } + + +// ----------------------------------------------------------------------------- +// CMceMediaSink::CMceMediaSink +// ----------------------------------------------------------------------------- +// +CMceMediaSink::CMceMediaSink() + :iIsEnabled( ETrue ), + iReferenceCount( 0 ) + { + } + + +// ----------------------------------------------------------------------------- +// CMceMediaSink::DoEnableL +// ----------------------------------------------------------------------------- +// +void CMceMediaSink::DoEnableL() + { + iIsEnabled = ETrue; + } + + +// --------------------------------------- -------------------------------------- +// CMceMediaSink::DoDisableL +// ----------------------------------------------------------------------------- +// +void CMceMediaSink::DoDisableL() + { + iIsEnabled = EFalse; + } + + +// ----------------------------------------------------------------------------- +// CMceMediaSink::InitializeL +// ----------------------------------------------------------------------------- +// +void CMceMediaSink::InitializeL( CMceMediaStream& aParent ) + { + iStream = &aParent; + } + + +// ----------------------------------------------------------------------------- +// CMceMediaSink::InitializeL +// ----------------------------------------------------------------------------- +// +void CMceMediaSink::InitializeL( CMceManager* /*aManager*/ ) + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// CMceMediaSink::ReferenceCount +// ----------------------------------------------------------------------------- +// +TInt& CMceMediaSink::ReferenceCount() + { + return iReferenceCount; + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mceclientstub/src/mcemediasource.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mceclientstub/src/mcemediasource.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,118 @@ +/* +* Copyright (c) 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: +* +*/ + + +#include "mcemediasource.h" +#include "mcesession.h" +#include "mcemanager.h" +#include "mcestreamobserver.h" + + + +#define _FLAT_DATA static_cast( iFlatData ) +#define FLAT_DATA( data ) _FLAT_DATA->data + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// CMceMediaSource::~CMceMediaSource +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceMediaSource::~CMceMediaSource() + { + iStreams.Reset(); + } + +// ----------------------------------------------------------------------------- +// CMceMediaSource::Type +// ----------------------------------------------------------------------------- +// +EXPORT_C TMceSourceType CMceMediaSource::Type() const + { + return iType; + } + + +// ----------------------------------------------------------------------------- +// CMceMediaSource::IsEnabled +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool CMceMediaSource::IsEnabled() const + { + return iIsEnabled; + } + +// ----------------------------------------------------------------------------- +// CMceMediaSource::ReferenceCount +// ----------------------------------------------------------------------------- +// +TInt& CMceMediaSource::ReferenceCount() + { + return iReferenceCount; + } + +// ----------------------------------------------------------------------------- +// CMceMediaSource::CMceMediaSource +// ----------------------------------------------------------------------------- +// +CMceMediaSource::CMceMediaSource() + :iIsEnabled( ETrue ) + { + } + + +// ----------------------------------------------------------------------------- +// CMceMediaSource::InitializeL +// ----------------------------------------------------------------------------- +// +void CMceMediaSource::InitializeL( CMceMediaStream& aParent ) + { + iStreams.AppendL( &aParent ); + + } + + +// ----------------------------------------------------------------------------- +// CMceMediaSource::InitializeL +// ----------------------------------------------------------------------------- +// +void CMceMediaSource::InitializeL( CMceManager* /*aManager*/ ) + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// CMceMediaSource::DoEnableL +// ----------------------------------------------------------------------------- +// +void CMceMediaSource::DoEnableL() + { + iIsEnabled = ETrue; + } + +// ----------------------------------------------------------------------------- +// CMceMediaSource::DoDisableL +// ----------------------------------------------------------------------------- +// +void CMceMediaSource::DoDisableL() + { + + iIsEnabled = EFalse; + + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mceclientstub/src/mcemediastream.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mceclientstub/src/mcemediastream.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,401 @@ +/* +* Copyright (c) 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: +* +*/ + + +#include "mcemediastream.h" +#include "mcesession.h" +#include "mcemanager.h" +#include "mcestreamobserver.h" +#include "mcemediasource.h" +#include "mcemediasink.h" + + + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// CMceMediaStream::~CMceMediaStream +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceMediaStream::~CMceMediaStream() + { + delete iMediaSDPLines; + + if ( iSource ) + { + DeleteSource(); + } + + if ( iLinkOwner ) + { + delete iLinkedStream; + } + + while( iSinks.Count() > 0 ) + { + DeleteSink( 0 ); + } + + iSinks.Reset(); + iSinks.Close(); + + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceMediaStream::TState CMceMediaStream::State() const + { + return iState; + } + +// ----------------------------------------------------------------------------- +// CMceMediaStream::Type +// ----------------------------------------------------------------------------- +// +EXPORT_C TMceMediaType CMceMediaStream::Type() const + { + return iType; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceMediaStream::SetMediaAttributeLinesL( + CDesC8Array* aMediaSDPLines ) + { + delete iMediaSDPLines; + iMediaSDPLines = aMediaSDPLines; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C MDesC8Array* CMceMediaStream::MediaAttributeLinesL() + { + if ( iMediaSDPLines ) + { + CDesC8Array* array = new ( ELeave ) CDesC8ArrayFlat( 1 ); + CleanupStack::PushL( array ); + for ( TInt i = 0; i < iMediaSDPLines->Count(); ++i ) + { + array->AppendL( iMediaSDPLines->MdcaPoint(i) ); + } + CleanupStack::Pop( array ); + return array; + } + + return NULL; + } + +// ----------------------------------------------------------------------------- +// CMceMediaStream::SetStartMediaPort +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceMediaStream::SetLocalMediaPortL( TUint aLocalMediaPort ) + { + iLocalMediaPort = aLocalMediaPort; + } + +// ----------------------------------------------------------------------------- +// CMceMediaStream::StartMediaPort +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint CMceMediaStream::LocalMediaPort() const + { + return iLocalMediaPort; + } + +// ----------------------------------------------------------------------------- +// CMceMediaStream::Session +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceSession* CMceMediaStream::Session() const + { + return iSession; + } + +// ----------------------------------------------------------------------------- +// CMceMediaStream::EnableL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceMediaStream::EnableL() + { + iIsEnabled = ETrue; + } + +// ----------------------------------------------------------------------------- +// CMceMediaStream::DisableL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceMediaStream::DisableL() + { + iIsEnabled = EFalse; + } + +// ----------------------------------------------------------------------------- +// CMceMediaStream::IsEnabled +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool CMceMediaStream::IsEnabled() const + { + return iIsEnabled; + } + +// ----------------------------------------------------------------------------- +// CMceMediaStream::SetSourceL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceMediaStream::SetSourceL( CMceMediaSource* aSource ) + { + if ( aSource ) + { + aSource->ReferenceCount()++; + } + + if ( iSource ) + { + DeleteSource(); + } + iSource = aSource; + + } + + +// ----------------------------------------------------------------------------- +// CMceMediaStream::AddSinkL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceMediaStream::AddSinkL( CMceMediaSink* aSink ) + { + __ASSERT_ALWAYS( aSink, User::Leave( KErrArgument ) ); + iSinks.AppendL( aSink ); + aSink->ReferenceCount()++; + } + + +// ----------------------------------------------------------------------------- +// CMceMediaStream::Source +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceMediaSource* CMceMediaStream::Source() const + { + return iSource; + } + + +// ----------------------------------------------------------------------------- +// CMceMediaStream::Sinks +// ----------------------------------------------------------------------------- +// +EXPORT_C const RPointerArray& CMceMediaStream::Sinks() const + { + return iSinks; + } + + +// ----------------------------------------------------------------------------- +// CMceMediaStream::RemoveSinkL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceMediaStream::RemoveSinkL( CMceMediaSink& aSink ) + { + for ( TInt i = 0; i < iSinks.Count(); i++ ) + { + if ( iSinks[i] == &aSink ) + { + DeleteSink( i ); + iSinks.Compress(); + return; + } + } + User::Leave( KErrNotFound ); + } + + + +// ----------------------------------------------------------------------------- +// CMceMediaStream::BindL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceMediaStream::BindL( CMceMediaStream* aStream ) + { + + __ASSERT_ALWAYS( !(! iLinkOwner && + iLinkedStream ), + User::Leave( KErrArgument ) ); + + if ( aStream ) + { + iLinkOwner = ETrue; + aStream->DoBindL( this ); + DoBindL( aStream ); + } + else + { + iLinkOwner = EFalse; + delete iLinkedStream; + iLinkedStream = NULL; + } + + } + + +// ----------------------------------------------------------------------------- +// CMceMediaStream::BoundStreamL +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceMediaStream& CMceMediaStream::BoundStreamL() const + { + __ASSERT_ALWAYS( iLinkedStream , User::Leave( KErrNotFound ) ); + + return *iLinkedStream; + + } + + +// ----------------------------------------------------------------------------- +// CMceMediaStream::BoundStream +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool CMceMediaStream::BoundStream() const + { + return iLinkedStream != NULL; + } + +// ----------------------------------------------------------------------------- +// CMceMediaStream::Binder +// ----------------------------------------------------------------------------- +// +TBool CMceMediaStream::Binder() const + { + return iLinkOwner; + } + + +// ----------------------------------------------------------------------------- +// CMceMediaStream::InitializeL +// ----------------------------------------------------------------------------- +// +void CMceMediaStream::InitializeL( CMceSession& aParent ) + { + iSession = &aParent; + + if ( Binder() && BoundStream() ) + { + iLinkedStream->InitializeL( aParent ); + } + + if ( iSource ) + { + iSource->InitializeL( *this ); + } + + for( TInt i = 0; i < iSinks.Count();i++) + { + iSinks[i]->InitializeL( *this ); + } + + } + + +// ----------------------------------------------------------------------------- +// CMceMediaStream::InitializeL +// ----------------------------------------------------------------------------- +// +void CMceMediaStream::InitializeL( CMceManager* aManager ) + { + if ( Binder() && BoundStream() ) + { + iLinkedStream->InitializeL( aManager ); + } + + if ( iSource ) + { + iSource->InitializeL( aManager ); + } + + for( TInt i = 0; i < iSinks.Count();i++) + { + iSinks[i]->InitializeL( aManager ); + } + } + + +// ----------------------------------------------------------------------------- +// CMceMediaStream::CMceMediaStream +// ----------------------------------------------------------------------------- +// +CMceMediaStream::CMceMediaStream() + :iLinkedStream( NULL ), + iSource( NULL ), + iLinkOwner( EFalse ), + iIsEnabled( ETrue ), + iState( CMceMediaStream::EUninitialized ) + { + } + + +// ----------------------------------------------------------------------------- +// CMceMediaStream::DeleteSink +// ----------------------------------------------------------------------------- +// +void CMceMediaStream::DeleteSink( TInt aIndex ) + { + + iSinks[ aIndex ]->ReferenceCount()--; + if ( iSinks[ aIndex ]->ReferenceCount() == 0 ) + { + delete iSinks[ aIndex ]; + } + iSinks.Remove( aIndex ); + + } + +// ----------------------------------------------------------------------------- +// CMceMediaStream::DeleteSource +// ----------------------------------------------------------------------------- +// +void CMceMediaStream::DeleteSource() + { + iSource->ReferenceCount()--; + if ( iSource->ReferenceCount() == 0 ) + { + delete iSource; + } + iSource = NULL; + } + + + +// ----------------------------------------------------------------------------- +// CMceMediaStream::DoBindL +// ----------------------------------------------------------------------------- +// +void CMceMediaStream::DoBindL( CMceMediaStream* aStream ) + { + if ( Session() ) + { + aStream->InitializeL( *Session() ); + } + delete iLinkedStream; + iLinkedStream = aStream; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mceclientstub/src/mceoutsession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mceclientstub/src/mceoutsession.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,187 @@ +/* +* Copyright (c) 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: +* +*/ + + +#include +#include "mceoutsession.h" +#include "mcemediastream.h" +#include "mcemanager.h" + + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// CMceOutSession::NewL +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceOutSession* CMceOutSession::NewL( + CMceManager& aManager, + CSIPProfile& aProfile, + const TDesC8& aRecipient, + HBufC8* aOriginator ) + { + // Check that profile has been registered + TBool profileRegistered = EFalse; + + aProfile.GetParameter( KSIPProfileRegistered, profileRegistered ); + __ASSERT_ALWAYS( profileRegistered, User::Leave( KErrCouldNotConnect ) ); + + CMceOutSession* self = new (ELeave) CMceOutSession( &aManager, 0 ); + CleanupStack::PushL( self ); + self->ConstructL( aRecipient, aOriginator ); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CMceOutSession::NewL +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceOutSession* CMceOutSession::NewL( CMceEvent& /*aEvent*/ ) + { + return NULL; + } + +// ----------------------------------------------------------------------------- +// CMceOutSession::NewL +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceOutSession* CMceOutSession::NewL( CMceRefer& /*aRefer*/ ) + { + return NULL; + } + +// ----------------------------------------------------------------------------- +// CMceOutSession::NewL +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceOutSession* CMceOutSession::NewL() + { + return new( ELeave )CMceOutSession( NULL, 0 ); + } + +// ----------------------------------------------------------------------------- +// CMceOutSession::~CMceOutSession +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceOutSession::~CMceOutSession() + { + } + + +// ----------------------------------------------------------------------------- +// CMceOutSession::EstablishL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceOutSession::EstablishL( + TUint32 aTimeout, + CDesC8Array* aHeaders, + HBufC8* aContentType, + HBufC8* aContent, + CDesC8Array* aContentHeaders ) + { + User::LeaveIfError( State() == EIdle ? KErrNone : KErrNotReady ); + User::LeaveIfError( + ( aContentType && aContent ) || + !( aContentType || aContent || aContentHeaders ) ? + KErrNone : KErrArgument ); + + if ( iFailWithCode != KErrNone ) + { + TInt failCode = iFailWithCode; + iFailWithCode = KErrNone; + User::Leave( failCode ); + } + + iTimeout = aTimeout; + + //start establishing the session + + delete iHeaders; + iHeaders = aHeaders; + delete aContentType; + delete aContent; + delete aContentHeaders; + + iState = CMceSession::EOffering; + } + + +// ----------------------------------------------------------------------------- +// CMceOutSession::AddStreamL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceOutSession::AddStreamL( CMceMediaStream* aMediaStream ) + { + if ( iManager ) + { + //initialize stream (to get supported codecs) + aMediaStream->InitializeL( iManager ); + } + else + { + //internalizing => no initialize yet + } + + CMceSession::AddStreamL( aMediaStream ); + } + + +// ----------------------------------------------------------------------------- +// CMceOutSession::CancelL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceOutSession::CancelL() + { + User::LeaveIfError( State() != EIdle ? KErrNone : KErrNotReady ); + + iState = CMceSession::ECancelling; + + } + + +// ----------------------------------------------------------------------------- +// CMceOutSession::CMceOutSession +// ----------------------------------------------------------------------------- +// +CMceOutSession::CMceOutSession( CMceManager* aManager, TUint32 aProfileId ) + : CMceSession( aManager, aProfileId ) + { + //NOP + } + +// ----------------------------------------------------------------------------- +// CMceOutSession::ConstructL +// ----------------------------------------------------------------------------- +// +void CMceOutSession::ConstructL( const TDesC8& aRecipient, HBufC8* aOriginator ) + { + delete iRecipient; + iRecipient = NULL; + iRecipient = aRecipient.AllocL(); + + delete iOriginator; + iOriginator = NULL; + if ( aOriginator ) + { + iOriginator = aOriginator->AllocL(); + delete aOriginator; + } + + CMceSession::ConstructL(); + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mceclientstub/src/mcertpsink.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mceclientstub/src/mcertpsink.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,152 @@ +/* +* Copyright (c) 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: +* +*/ + + +#include "mcertpsink.h" +#include "mcemediastream.h" +#include "mcesession.h" + + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// CMceRtpSink::NewL +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceRtpSink* CMceRtpSink::NewL() + { + CMceRtpSink* self = NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// CMceRtpSink::NewLC +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceRtpSink* CMceRtpSink::NewLC() + { + CMceRtpSink* self = new (ELeave) CMceRtpSink(); + CleanupStack::PushL( self ); + self->ConstructL( EFalse ); + return self; + } + +// ----------------------------------------------------------------------------- +// CMceRtpSink::NewL +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceRtpSink* CMceRtpSink::NewL( TBool aSuppressRTCP, + HBufC8* /*aIdentity*/ ) + { + + CMceRtpSink* self = new (ELeave) CMceRtpSink(); + CleanupStack::PushL( self ); + self->ConstructL( aSuppressRTCP ); + CleanupStack::Pop( self ); + return self; + + } + +// ----------------------------------------------------------------------------- +// CMceRtpSink::~CMceRtpSink +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceRtpSink::~CMceRtpSink() + { + } + +// ----------------------------------------------------------------------------- +// CMceRtpSink::EnableL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceRtpSink::EnableL() + { + CMceMediaSink::DoEnableL(); + } + +// ----------------------------------------------------------------------------- +// CMceRtpSink::DisableL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceRtpSink::DisableL() + { + CMceMediaSink::DoDisableL(); + } + +// ----------------------------------------------------------------------------- +// CMceRtpSink::SendSRL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceRtpSink::SendSRL() + { + __ASSERT_ALWAYS( iStream && + iStream->Session() && + iStream->Session()->State() != CMceSession::EIdle && + iStream->Session()->State() != CMceSession::EIncoming, + User::Leave( KErrNotReady ) ); + // NOP + } + +// ----------------------------------------------------------------------------- +// CMceRtpSink::LastPacket +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint32 CMceRtpSink::LastPacket() const + { + return iLastPacket; + } + +// ----------------------------------------------------------------------------- +// CMceRtpSink::Ssrc +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint32 CMceRtpSink::Ssrc() const + { + return iSSRC; + } + +// ----------------------------------------------------------------------------- +// CMceRtpSink::UpdateL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceRtpSink::UpdateL( TBool aSuppressRTCP, + HBufC8* /*aIdentity*/ ) + { + iSuppressRTCP = aSuppressRTCP; + } + +// ----------------------------------------------------------------------------- +// CMceRtpSink::CMceRtpSink +// ----------------------------------------------------------------------------- +// +CMceRtpSink::CMceRtpSink() + : CMceMediaSink() + { + iType = KMceRTPSink; + } + +// ----------------------------------------------------------------------------- +// CMceRtpSink::ConstructL +// ----------------------------------------------------------------------------- +// +void CMceRtpSink::ConstructL( TBool aSuppressRTCP ) + { + iSuppressRTCP = aSuppressRTCP; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mceclientstub/src/mcertpsource.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mceclientstub/src/mcertpsource.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,223 @@ +/* +* Copyright (c) 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: +* +*/ + + +#include "mcertpsource.h" +#include "mcesession.h" +#include "mcemanager.h" +#include "mcemediastream.h" +#include "mcertpobserver.h" + +#define KMceTIMERDISABLED 0 + + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// CMceRtpSource::NewL +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceRtpSource* CMceRtpSource::NewL( + TUint aBufferLength, + TUint aBufferTreshold, + TUint32 aInactivityTimer, + HBufC8* aIdentity ) + { + CMceRtpSource* self = NewLC( aBufferLength, aBufferTreshold, + aInactivityTimer, aIdentity ); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CMceRtpSource::NewLC +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceRtpSource* CMceRtpSource::NewLC( + TUint aBufferLength, + TUint aBufferTreshold, + TUint32 aInactivityTimer, + HBufC8* /*aIdentity*/ ) + { + CMceRtpSource* self = new (ELeave) CMceRtpSource(); + CleanupStack::PushL( self ); + self->ConstructL( aBufferLength, aBufferTreshold, + aInactivityTimer, NULL ); + return self; + } + + +// ----------------------------------------------------------------------------- +// CMceRtpSource::~CMceRtpSource +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceRtpSource::~CMceRtpSource() + { + delete iMediaBurstIndicator; + } + +// ----------------------------------------------------------------------------- +// CMceRtpSource::EnableL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceRtpSource::EnableL() + { + CMceMediaSource::DoEnableL(); + } + +// ----------------------------------------------------------------------------- +// CMceRtpSource::DisableL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceRtpSource::DisableL() + { + CMceMediaSource::DoDisableL(); + } + + +// ----------------------------------------------------------------------------- +// CMceRtpSource::EnableInactivityTimerL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceRtpSource::EnableInactivityTimerL( TUint32 aInactivityTimer ) + { + // Simulate MCE's check + if ( iStreams[0] && + iStreams[0]->Session() && + iStreams[0]->Session()->State() != CMceSession::EIdle && + iStreams[0]->Session()->State() != CMceSession::EIncoming ) + { + iInactivityTimer = aInactivityTimer; + } + } + +// ----------------------------------------------------------------------------- +// CMceRtpSource::DisableInactivityTimer +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceRtpSource::DisableInactivityTimerL() + { + iInactivityTimer = KMceTIMERDISABLED; + } + +// ----------------------------------------------------------------------------- +// CMceRtpSource::UpdateL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceRtpSource::UpdateL ( + TUint aBufferLength, + TUint aBufferTreshold, + TUint32 aInactivityTimer, + HBufC8* /*aIdentity*/ ) + { + iInactivityTimer = aInactivityTimer; + iBufferLength = aBufferLength; + iBufferTreshold = aBufferTreshold; + } + +// ----------------------------------------------------------------------------- +// CMceRtpSource::SendRRL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceRtpSource::SendRRL() + { + __ASSERT_ALWAYS( iStreams[0] && + iStreams[0]->Session() && + iStreams[0]->Session()->State() != CMceSession::EIdle && + iStreams[0]->Session()->State() != CMceSession::EIncoming, + User::Leave( KErrNotReady ) ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint32 CMceRtpSource::Ssrc() const + { + return 0; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C const RArray& CMceRtpSource::Ssrcs() const + { + return iSsrcs; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceRtpSource::EnableSsrcL( TUint /*aSsrc*/ ) + { + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceRtpSource::DisableSsrcL( TUint /*aSsrc*/ ) + { + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool CMceRtpSource::IsSsrcEnabledL( TUint /*aSsrc*/ ) + { + return ETrue; + } + + +// ----------------------------------------------------------------------------- +// CMceRtpSource::CMceRtpSource +// ----------------------------------------------------------------------------- +// +CMceRtpSource::CMceRtpSource() + : CMceMediaSource() + { + iType = KMceRTPSource; + } + + +// ----------------------------------------------------------------------------- +// CMceRtpSource::ConstructL +// ----------------------------------------------------------------------------- +// +void CMceRtpSource::ConstructL( + TUint aBufferLength, + TUint aBufferTreshold, + TUint32 aInactivityTimer, + HBufC8* aMediaBurstIndicator ) + { + + iInactivityTimer = aInactivityTimer; + iBufferLength = aBufferLength; + iBufferTreshold = aBufferTreshold; + iMediaBurstIndicator = aMediaBurstIndicator; + + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mceclientstub/src/mcesession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mceclientstub/src/mcesession.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,397 @@ +/* +* Copyright (c) 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: +* +*/ + + +#include "mcesession.h" +//#include "mceinsession.h" +#include "mcemanager.h" +#include "mcestreambundle.h" +#include "mcemediastream.h" +#include "mceinsessionobserver.h" +#include "mcesessionobserver.h" +#include "mcestreamobserver.h" +#include "mcertpobserver.h" +#include "mcetransactiondatacontainer.h" + + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// CMceSession::~CMceSession +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceSession::~CMceSession() + { + delete iHeaders; + delete iSessionSDPLines; + + delete iOriginator; + delete iRecipient; + iMediaStreams.ResetAndDestroy(); + iBundles.ResetAndDestroy(); + + } + + +// ----------------------------------------------------------------------------- +// CMceSession::State +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceSession::TState CMceSession::State() const + { + return iState; + } + + +// ----------------------------------------------------------------------------- +// CMceSession::ConnectionActive +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool CMceSession::ConnectionActive() const + { + return iIsConnectionActive; + } + + +// ----------------------------------------------------------------------------- +// CMceSession::RemoveStreamL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceSession::RemoveStreamL( CMceMediaStream& aMediaStream ) + { + for ( TInt i = 0; i < iMediaStreams.Count(); ++i ) + { + if ( &aMediaStream == iMediaStreams[i] ) + { + delete iMediaStreams[i]; + iMediaStreams.Remove( i ); + return; + } + } + + User::Leave( KErrNotFound ); + } + + +// ----------------------------------------------------------------------------- +// CMceSession::AddStreamL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceSession::AddStreamL( CMceMediaStream* aMediaStream ) + { + User::LeaveIfError( iMediaStreams.Find( aMediaStream ) != KErrNotFound ? + KErrArgument : KErrNone ); + + aMediaStream->InitializeL( *this ); // Initialize before taking ownership + + iMediaStreams.AppendL( aMediaStream ); + + } + + +// ----------------------------------------------------------------------------- +// CMceSession::UpdateL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceSession::UpdateL( + TUint32 aTimeout, + CDesC8Array* aHeaders, + HBufC8* aContentType, + HBufC8* aContent, + CDesC8Array* aContentHeaders ) + { + User::LeaveIfError( iState != EIdle ? KErrNone : KErrNotReady ); + User::LeaveIfError( + ( aContentType && aContent ) || + !( aContentType || aContent || aContentHeaders ) ? + KErrNone : KErrArgument ); + + // Leave if in incoming state givem too small timeout value + User::LeaveIfError( !( aTimeout > 0 && State() == CMceSession::EIncoming ) || + aTimeout <= SessionTimer() ? KErrNone : KErrArgument ); + + InitializeL(); + + iTimeout = aTimeout; + + delete iHeaders; + iHeaders = aHeaders; + delete aContentType; + delete aContentHeaders; + + if ( iState == EIncoming ) + { + iState = EReserving; + } + else + { + iState = EOffering; + } + } + +// ----------------------------------------------------------------------------- +// CMceSession::InitializeL +// ----------------------------------------------------------------------------- +// +/* +void CMceSession::InitializeL() + { + for(int i=0; iInitializeL( *this ); + } + } + */ + + +// ----------------------------------------------------------------------------- +// CMceSession::TerminateL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceSession::TerminateL( CDesC8Array* aHeaders, + HBufC8* aContentType, + HBufC8* aContent ) + { + __ASSERT_ALWAYS( iState != CMceSession::EIdle, User::Leave( KErrNotReady ) ); + + delete iHeaders; + iHeaders = aHeaders; + delete aContentType; + delete aContent; + + iState = CMceSession::ETerminating; + } + + +// ----------------------------------------------------------------------------- +// CMceSession::Streams +// ----------------------------------------------------------------------------- +// +EXPORT_C const RPointerArray& CMceSession::Streams() const + { + return iMediaStreams; + } + + +// ----------------------------------------------------------------------------- +// CMceSession::Recipient +// ----------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CMceSession::Recipient() const + { + return *iRecipient; + } + +// ----------------------------------------------------------------------------- +// CMceSession::Originator +// ----------------------------------------------------------------------------- +// +EXPORT_C const TDesC8& CMceSession::Originator() const + { + return *iOriginator; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceSession::SetSessionSDPLinesL( CDesC8Array* aSessionSDPLines ) + { + delete iSessionSDPLines; + iSessionSDPLines = aSessionSDPLines; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C MDesC8Array* CMceSession::SessionSDPLinesL() + { + if ( iSessionSDPLines ) + { + CDesC8Array* array = new ( ELeave ) CDesC8ArrayFlat( 1 ); + CleanupStack::PushL( array ); + for ( TInt i = 0; i < iSessionSDPLines->Count(); ++i ) + { + array->AppendL( iSessionSDPLines->MdcaPoint(i) ); + } + CleanupStack::Pop( array ); + return array; + } + + return NULL; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint32 CMceSession::SessionTimer() const + { + return iTimeout; + } + +// ----------------------------------------------------------------------------- +// CMceSession::AddBundleL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceSession::AddBundleL( CMceStreamBundle* aBundle ) + { + iBundles.AppendL( aBundle ); + } + +// ----------------------------------------------------------------------------- +// CMceSession::RemoveBundleL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceSession::RemoveBundleL( CMceStreamBundle& aBundle ) + { + TInt index = iBundles.Find( &aBundle ); + User::LeaveIfError( index ); + iBundles.Remove( index ); + } + +// ----------------------------------------------------------------------------- +// CMceSession::Bundles +// ----------------------------------------------------------------------------- +// +EXPORT_C const RPointerArray< CMceStreamBundle >& CMceSession::Bundles() const + { + return iBundles; + } + +// ----------------------------------------------------------------------------- +// CMceSession::GetModifierL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceSession::GetModifierL( TMceSessionModifier aModifier, + TUint& aValue ) const + { + if ( aModifier == KMcePreconditions ) + { + if ( iForceInternetSignaling ) + { + aValue = KMcePreconditionsNotUsed; + } + else + { + aValue = KMcePreconditionsSupported; + } + return; + } + User::Leave( KErrNotFound ); + } + +// ----------------------------------------------------------------------------- +// CMceSession::SetModifierL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceSession::SetModifierL( TMceSessionModifier aModifier, + TUint aValue ) + { + if ( aModifier == KMcePreconditions ) + { + if ( aValue == KMcePreconditionsNotUsed ) + { + iForceInternetSignaling = ETrue; + } + else + { + iForceInternetSignaling = EFalse; + } + return; + } + else if ( aModifier == KMce100Rel ) + { + if ( aValue >= 0 && aValue <= 2 ) + { + i100RelUsage = aValue; + return; + } + } + User::LeaveIfError( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// CMceSession::Profile +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint32 CMceSession::Profile() const + { + return iProfileId; + } + +// ----------------------------------------------------------------------------- +// CMceSession::CMceSession +// ----------------------------------------------------------------------------- +// +CMceSession::CMceSession( CMceManager* aManager, TUint32 aProfileId ) + : iProfileId( aProfileId ), + iManager( aManager ), + iState( CMceSession::EIdle), + iIsConnectionActive( ETrue ), + iForceInternetSignaling( EFalse ), + i100RelUsage( 1 ), // MCE default + iFailWithCode( KErrNone ), + iReasonPhrase( KNullDesC8() ), + iReasonCode( 0 ) + { + } + + +// ----------------------------------------------------------------------------- +// CMceSession::Manager +// ----------------------------------------------------------------------------- +// +CMceManager& CMceSession::Manager() const + { + return *iManager; + } + + +// ----------------------------------------------------------------------------- +// CMceSession::ConstructL +// ----------------------------------------------------------------------------- +// +void CMceSession::ConstructL() + { + + + } + +// ----------------------------------------------------------------------------- +// CMceSession::InitializeL +// ----------------------------------------------------------------------------- +// +void CMceSession::InitializeL() + { + for (int i=0; iInitializeL( *this ); + } + + /* + for(int i=0; iInitializeL( *this ); + } + */ + } + + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mceclientstub/src/mcespeakersink.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mceclientstub/src/mcespeakersink.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,175 @@ +/* +* Copyright (c) 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: +* +*/ + + +#include "mcespeakersink.h" +#include "mcesession.h" +#include "mcemediastream.h" + + +// ============================ MEMBER FUNCTIONS =============================== + +const TInt KMceMaxVolume = 10; + +// ----------------------------------------------------------------------------- +// CMceSpeakerSink::NewL +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceSpeakerSink* CMceSpeakerSink::NewL() + { + CMceSpeakerSink* self = NewLC(); + CleanupStack::Pop( self ); + return self; + + } + +// ----------------------------------------------------------------------------- +// CMceSpeakerSink::NewLC +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceSpeakerSink* CMceSpeakerSink::NewLC() + { + CMceSpeakerSink* self = new (ELeave) CMceSpeakerSink(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + + } + +// ----------------------------------------------------------------------------- +// CMceSpeakerSink::~CMceSpeakerSink +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceSpeakerSink::~CMceSpeakerSink() + { + } + +// ----------------------------------------------------------------------------- +// CMceSpeakerSink::EnableL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceSpeakerSink::EnableL() + { + CMceMediaSink::DoEnableL(); + } + +// ----------------------------------------------------------------------------- +// CMceSpeakerSink::Disable +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceSpeakerSink::DisableL() + { + CMceMediaSink::DoDisableL(); + } + +// ----------------------------------------------------------------------------- +// CMceSpeakerSink::SetVolumeL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceSpeakerSink::SetVolumeL(TInt aVolume) + { + __ASSERT_ALWAYS( iStream && + iStream->Session() && + iStream->Session()->State() != CMceSession::EIdle && + iStream->Session()->State() != CMceSession::EIncoming, + User::Leave( KErrNotReady ) ); + + __ASSERT_ALWAYS( aVolume <= MaxVolumeL() && + aVolume > 0, + User::Leave( KErrArgument ) ); + iVolume = aVolume; + } + +// ----------------------------------------------------------------------------- +// CMceSpeakerSink::VolumeL +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceSpeakerSink::VolumeL() const + { + __ASSERT_ALWAYS( iStream && + iStream->Session() && + iStream->Session()->State() != CMceSession::EIdle && + iStream->Session()->State() != CMceSession::EIncoming, + User::Leave( KErrNotReady ) ); + + return iVolume; + } + +// ----------------------------------------------------------------------------- +// CMceSpeakerSink::MaxVolumeL +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceSpeakerSink::MaxVolumeL() const + { + __ASSERT_ALWAYS( iStream && + iStream->Session() && + iStream->Session()->State() != CMceSession::EIdle && + iStream->Session()->State() != CMceSession::EIncoming, + User::Leave( KErrNotReady ) ); + + return iMaxVolume; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceSpeakerSink::SetRoutingL( TInt aRoute ) + { + __ASSERT_ALWAYS( iStream && + iStream->Session() && + iStream->Session()->State() != CMceSession::EIdle && + iStream->Session()->State() != CMceSession::EIncoming, + User::Leave( KErrNotReady ) ); + + iAudioRouting = aRoute; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CMceSpeakerSink::RoutingL() const + { + __ASSERT_ALWAYS( iStream && + iStream->Session() && + iStream->Session()->State() != CMceSession::EIdle && + iStream->Session()->State() != CMceSession::EIncoming, + User::Leave( KErrNotReady ) ); + + return iAudioRouting; + } + +// ----------------------------------------------------------------------------- +// CMceSpeakerSink::CMceSpeakerSink +// ----------------------------------------------------------------------------- +// +CMceSpeakerSink::CMceSpeakerSink() + { + iType = KMceSpeakerSink; + iMaxVolume = KMceMaxVolume; + } + +// ----------------------------------------------------------------------------- +// CMceSpeakerSink::ConstructL +// ----------------------------------------------------------------------------- +// +void CMceSpeakerSink::ConstructL() + { + } + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mceclientstub/src/mcestreambundle.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mceclientstub/src/mcestreambundle.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,124 @@ +/* +* Copyright (c) 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: +* +*/ + + +#include "mcestreambundle.h" +#include "mcesession.h" + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CMceStreamBundle::NewL +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceStreamBundle* CMceStreamBundle::NewL( TMceStreamBundleType aType ) + { + CMceStreamBundle* self = NewLC( aType ); + CleanupStack::Pop( self ); + return self; + + } + +// ----------------------------------------------------------------------------- +// CMceStreamBundle::NewLC +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceStreamBundle* CMceStreamBundle::NewLC( TMceStreamBundleType aType ) + { + CMceStreamBundle* self = new (ELeave) CMceStreamBundle(); + CleanupStack::PushL( self ); + self->ConstructL( aType ); + return self; + } + +// ----------------------------------------------------------------------------- +// CMceStreamBundle::~CMceStreamBundle +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceStreamBundle::~CMceStreamBundle() + { + iStreams.Close(); + iTempStreams.Close(); + } + +// ----------------------------------------------------------------------------- +// CMceStreamBundle::Type +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceStreamBundle::TMceStreamBundleType CMceStreamBundle::Type() const + { + return iBundleType; + } + +// ----------------------------------------------------------------------------- +// CMceStreamBundle::AddStreamL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceStreamBundle::AddStreamL( CMceMediaStream& aStream ) + { + iStreams.AppendL( &aStream ); + } + +// ----------------------------------------------------------------------------- +// CMceStreamBundle::RemoveStreamL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceStreamBundle::RemoveStreamL( CMceMediaStream& aStream ) + { + TInt index = iStreams.Find( &aStream ); + User::LeaveIfError( index ); + iStreams.Remove( index ); + } + +// ----------------------------------------------------------------------------- +// CMceStreamBundle::Streams +// ----------------------------------------------------------------------------- +// +EXPORT_C const RPointerArray< CMceMediaStream >& CMceStreamBundle::Streams() + { + return iStreams; + } + + +// ----------------------------------------------------------------------------- +// CMceStreamBundle::InitializeL +// ----------------------------------------------------------------------------- +// +void CMceStreamBundle::InitializeL( CMceSession& aParent ) + { + iSession = &aParent; + } + +// ----------------------------------------------------------------------------- +// CMceStreamBundle::CMceStreamBundle +// ----------------------------------------------------------------------------- +// +CMceStreamBundle::CMceStreamBundle() + { + } + +// ----------------------------------------------------------------------------- +// CMceStreamBundle::ConstructL +// ----------------------------------------------------------------------------- +// +void CMceStreamBundle::ConstructL( CMceStreamBundle::TMceStreamBundleType aType ) + { + iBundleType = aType; + + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mceclientstub/src/mcetransactiondatacontainer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mceclientstub/src/mcetransactiondatacontainer.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,181 @@ +/* +* Copyright (c) 2002-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: +* +*/ + + +#include "mcetransactiondatacontainer.h" + + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// TMceTransactionDataContainer::GetStatusCode +// ----------------------------------------------------------------------------- +// +EXPORT_C TMceTransactionDataContainer::TMceTransactionDataContainer() : + iStatusCode(0), + iReasonPhrase(0), + iHeaders(0), + iContentType(0), + iContentHeaders(0), + iContent(0) + { + } + +// ----------------------------------------------------------------------------- +// TMceTransactionDataContainer::GetStatusCode +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt TMceTransactionDataContainer::GetStatusCode() + { + TInt tmpStatusCode = iStatusCode; + iStatusCode = 0; + return tmpStatusCode; + } + +// ----------------------------------------------------------------------------- +// TMceTransactionDataContainer::GetReasonPhrase +// ----------------------------------------------------------------------------- +// +EXPORT_C HBufC8* TMceTransactionDataContainer::GetReasonPhrase() + { + HBufC8* tmpReasonPhrase = iReasonPhrase; + iReasonPhrase = 0; + return tmpReasonPhrase; + } + +// ----------------------------------------------------------------------------- +// TMceTransactionDataContainer::GetHeaders +// ----------------------------------------------------------------------------- +// +EXPORT_C CDesC8Array* TMceTransactionDataContainer::GetHeaders() + { + CDesC8Array* tmpHeaders = iHeaders; + iHeaders = 0; + return tmpHeaders; + } + +// ----------------------------------------------------------------------------- +// TMceTransactionDataContainer::GetContentType +// ----------------------------------------------------------------------------- +// +EXPORT_C HBufC8* TMceTransactionDataContainer::GetContentType() + { + HBufC8* tmpContentType = iContentType; + iContentType = 0; + return tmpContentType; + } + +// ----------------------------------------------------------------------------- +// TMceTransactionDataContainer::GetHeaders +// ----------------------------------------------------------------------------- +// +EXPORT_C CDesC8Array* TMceTransactionDataContainer::GetContentHeaders() + { + CDesC8Array* tmpHeaders = iContentHeaders; + iContentHeaders = 0; + return tmpHeaders; + } + +// ----------------------------------------------------------------------------- +// TMceTransactionDataContainer::GetContent +// ----------------------------------------------------------------------------- +// +EXPORT_C HBufC8* TMceTransactionDataContainer::GetContent() + { + HBufC8* tmpContent = iContent; + iContent = 0; + return tmpContent; + } + +// ----------------------------------------------------------------------------- +// TMceTransactionDataContainer::SetStatusCode +// ----------------------------------------------------------------------------- +// +EXPORT_C void TMceTransactionDataContainer::SetStatusCode( TInt aStatusCode) + { + iStatusCode = aStatusCode; + } + +// ----------------------------------------------------------------------------- +// TMceTransactionDataContainer::SetReasonPhrase +// ----------------------------------------------------------------------------- +// +EXPORT_C void TMceTransactionDataContainer::SetReasonPhrase( HBufC8* aReasonPhrase ) + { + delete iReasonPhrase; + iReasonPhrase = aReasonPhrase; + } + +// ----------------------------------------------------------------------------- +// TMceTransactionDataContainer::SetHeaders +// ----------------------------------------------------------------------------- +// +EXPORT_C void TMceTransactionDataContainer::SetHeaders( CDesC8Array* aHeaders ) + { + delete iHeaders; + iHeaders = aHeaders; + } + +// ----------------------------------------------------------------------------- +// TMceTransactionDataContainer::SetContentType +// ----------------------------------------------------------------------------- +// +EXPORT_C void TMceTransactionDataContainer::SetContentType( HBufC8* aContentType ) + { + delete iContentType; + iContentType = aContentType; + } + +// ----------------------------------------------------------------------------- +// TMceTransactionDataContainer::SetContent +// ----------------------------------------------------------------------------- +// +EXPORT_C void TMceTransactionDataContainer::SetContent( HBufC8* aContent ) + { + delete iContent; + iContent = aContent; + } + +// ----------------------------------------------------------------------------- +// TMceTransactionDataContainer::SetContentHeaders +// ----------------------------------------------------------------------------- +// +EXPORT_C void TMceTransactionDataContainer::SetContentHeaders( CDesC8Array* aHeaders ) + { + delete iContentHeaders; + iContentHeaders = aHeaders; + } + +// ----------------------------------------------------------------------------- +// TMceTransactionDataContainer::Clear +// ----------------------------------------------------------------------------- +// +EXPORT_C void TMceTransactionDataContainer::Clear() + { + iStatusCode = 0; + delete iReasonPhrase; + iReasonPhrase = 0; + delete iHeaders; + iHeaders = 0; + delete iContentType; + iContentType = 0; + delete iContentHeaders; + iContentHeaders = 0; + delete iContent; + iContent = 0; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mceclientstub/src/mcevideocodec.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mceclientstub/src/mcevideocodec.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,158 @@ +/* +* Copyright (c) 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: +* +*/ + + +#include "mcevideocodec.h" + +// Avc config keys for all the . +// Getter is not virtual so keys must be returned from base class and +// the level values defined in mceavccodec.h are redefined. +_LIT8( KMceStubAvcBitrateLevel1ConfigKey, "TestTextForAvcBrL1Level" ); +_LIT8( KMceStubAvcBitrateLevel1bConfigKey, "TestTextForAvcBrL1bLevel" ); +_LIT8( KMceStubAvcBitrateLevel1_1ConfigKey, "TestTextForAvcBrL1_1Level" ); +_LIT8( KMceStubAvcBitrateLevel1_2ConfigKey, "TestTextForAvcBrL1_2Level" ); +_LIT8( KMceStubAvcBitrateLevel1_3ConfigKey, "TestTextForAvcBrL1_3Level" ); +_LIT8( KMceStubAvcBitrateLevel2ConfigKey, "TestTextForAvcBrL2Level" ); +const TUint KMceStubAvcBitrateLevel1 = 0x0001; +const TUint KMceStubAvcBitrateLevel1b = 0x0002; +const TUint KMceStubAvcBitrateLevel1_1 = 0x0004; +const TUint KMceStubAvcBitrateLevel1_2 = 0x0008; +const TUint KMceStubAvcBitrateLevel1_3 = 0x0010; +const TUint KMceStubAvcBitrateLevel2 = 0x0020; + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// CMceVideoCodec::~CMceVideoCodec +// ----------------------------------------------------------------------------- +// +CMceVideoCodec::~CMceVideoCodec() + { + delete iConfigKey; + } + + +// ----------------------------------------------------------------------------- +// CMceVideoCodec::AllowedFrameRates +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint CMceVideoCodec::AllowedFrameRates() const + { + return iAllowedFrameRates; + } + + +// ----------------------------------------------------------------------------- +// CMceVideoCodec::FrameRate +// ----------------------------------------------------------------------------- +// +EXPORT_C TReal CMceVideoCodec::FrameRate() const + { + return iFrameRate; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C HBufC8* CMceVideoCodec::ConfigKeyL() const + { + HBufC8* configKey = NULL; + + if ( iConfigKey ) + { + configKey = iConfigKey->AllocL(); + } + + if ( !configKey && SdpName() == KMceSDPNameH264() ) + { + if ( AllowedBitrates() & KMceStubAvcBitrateLevel1 ) + { + configKey = KMceStubAvcBitrateLevel1ConfigKey().AllocL(); + } + else if ( AllowedBitrates() & KMceStubAvcBitrateLevel1b ) + { + configKey = KMceStubAvcBitrateLevel1bConfigKey().AllocL(); + } + else if ( AllowedBitrates() & KMceStubAvcBitrateLevel1_1 ) + { + configKey = KMceStubAvcBitrateLevel1_1ConfigKey().AllocL(); + } + else if ( AllowedBitrates() & KMceStubAvcBitrateLevel1_2 ) + { + configKey = KMceStubAvcBitrateLevel1_2ConfigKey().AllocL(); + } + else if ( AllowedBitrates() & KMceStubAvcBitrateLevel1_3 ) + { + configKey = KMceStubAvcBitrateLevel1_3ConfigKey().AllocL(); + } + else if ( AllowedBitrates() & KMceStubAvcBitrateLevel2 ) + { + configKey = KMceStubAvcBitrateLevel2ConfigKey().AllocL(); + } + else + { + User::Leave( KErrNotFound ); + } + } + + return configKey; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint CMceVideoCodec::MaxBitRate() const + { + return iMaxBitRate; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TUint CMceVideoCodec::AllowedResolutions() const + { + return iAllowedResolutions; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TSize CMceVideoCodec::Resolution() const + { + return TSize( iResolutionWidth, + iResolutionHeight ); + } + + +// ----------------------------------------------------------------------------- +// CMceVideoCodec::CMceVideoCodec +// ----------------------------------------------------------------------------- +// +CMceVideoCodec::CMceVideoCodec() + { + iType = KMceVideoCodec; + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mceclientstub/src/mcevideostream.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mceclientstub/src/mcevideostream.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,231 @@ +/* +* 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 "mcevideostream.h" +#include "mcevideocodec.h" +#include "mcesession.h" +#include "mcemanager.h" +#include "mcefilesource.h" +#include "mcemediasink.h" +#include "mcecamerasource.h" +//#include "mcertpsource.h" +#include "mcertpsink.h" +#include "mcedisplaysink.h" +#include "mceh263codec.h" + +#define _FLAT_DATA static_cast( iFlatData ) + + + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// Factory method +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceVideoStream* CMceVideoStream::NewL() + { + CMceVideoStream* self = CMceVideoStream::NewLC(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// Factory method +// Leaves instance on CleanupStack. +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceVideoStream* CMceVideoStream::NewLC() + { + CMceVideoStream* self = new (ELeave) CMceVideoStream(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// ----------------------------------------------------------------------------- +// Destructor. +// ----------------------------------------------------------------------------- +// +EXPORT_C CMceVideoStream::~CMceVideoStream() + { + iCodecs.ResetAndDestroy(); + iSupportedVideoCodecs.ResetAndDestroy(); + } + + +// ----------------------------------------------------------------------------- +// Returns codec. +// Returns the codecs available to the session. +// ----------------------------------------------------------------------------- +// +EXPORT_C const RPointerArray& CMceVideoStream::Codecs() + { + return iCodecs; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceVideoStream::AddCodecL( CMceVideoCodec* aCodec ) + { + __ASSERT_ALWAYS(aCodec, User::Leave(KErrArgument)); + iCodecs.AppendL(aCodec); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceVideoStream::RemoveCodecL( CMceVideoCodec& aCodec ) + { + for(int i = 0; i < iCodecs.Count(); i++ ) + { + if( iCodecs[i] == &aCodec ) + { + delete iCodecs[i]; + iCodecs.Remove( i ); + } + } + } + + +// ----------------------------------------------------------------------------- +// NOT IMPLEMENTED YET +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMceVideoStream::ReplaceCodecsL( RPointerArray* /*aCodecs*/ ) + { + User::Leave( KErrNotSupported ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C const RPointerArray& + CMceVideoStream::SupportedVideoCodecs() const + { + return iSupportedVideoCodecs; + } + + +// ----------------------------------------------------------------------------- +// CMceVideoStream::InitializeL +// ----------------------------------------------------------------------------- +// +void CMceVideoStream::InitializeL( CMceSession& aParent ) + { + CMceMediaStream::InitializeL( aParent ); + + InitializeL( &aParent.Manager() ); + + for( TInt i = 0; i < iCodecs.Count(); i++ ) + { + iCodecs[i]->InitializeL( *this ); + } + } + + +// ----------------------------------------------------------------------------- +// CMceVideoStream::InitializeL +// ----------------------------------------------------------------------------- +// +void CMceVideoStream::InitializeL( CMceManager* aManager ) + { + CMceMediaStream::InitializeL( aManager ); + if ( aManager && iCodecs.Count() == 0 ) + { + const RPointerArray supportedCodecs = + aManager->SupportedVideoCodecs(); + + TBool fileCodecAdded( EFalse ); + for( TInt i = 0; i < supportedCodecs.Count() && !fileCodecAdded; i++ ) + { + if ( iSource && iSource->Type() == KMceFileSource ) + { + // Fake codec using file name + CMceFileSource* fileSource = + static_cast(iSource); + TBuf8<256*2> fileName; + fileName.Copy( fileSource->iFileName ); + const TDesC8& currentCodecName( supportedCodecs[i]->SdpName() ); + + if ( ( fileName.FindF( KMceSDPNameH264() ) >= 0 && + currentCodecName.FindF( KMceSDPNameH264() ) >= 0 || + ( fileName.FindF( KMceSDPNameH263() ) >= 0 && + currentCodecName.FindF( KMceSDPNameH263() ) >= 0 ) ) ) + { + CMceVideoCodec* codec = supportedCodecs[i]->CloneL(); + CleanupStack::PushL( codec ); + iCodecs.AppendL( codec ); + CleanupStack::Pop( codec ); + iState = EInitialized; + fileCodecAdded = ETrue; + } + else + { + iState = ETranscodingRequired; + } + + } + else + { + CMceVideoCodec* codec = supportedCodecs[i]->CloneL(); + CleanupStack::PushL( codec ); + iCodecs.AppendL( codec ); + CleanupStack::Pop( codec ); + } + } + } + } + + +// ----------------------------------------------------------------------------- +// CMceVideoStream::IsAllowedCombination +// ----------------------------------------------------------------------------- +// +TBool CMceVideoStream::IsAllowedCombination() + { + return ETrue; + } + + +// ----------------------------------------------------------------------------- +// Default C++ constructor. +// ----------------------------------------------------------------------------- +// +CMceVideoStream::CMceVideoStream() + :CMceMediaStream() + { + iType = KMceVideo; + } + + +// ----------------------------------------------------------------------------- +// Symbian 2nd phase constructor. +// ----------------------------------------------------------------------------- +// +void CMceVideoStream::ConstructL() + { + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mceclientstub/src/staticdllentry.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mceclientstub/src/staticdllentry.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,37 @@ +/* +* Copyright (c) 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: +* +*/ + + + +#include + + +// Bullseye reguires following entry point +#ifdef _BullseyeCoverage +GLDEF_C int __stdcall __E32Dll(void*, unsigned, void*) + { + return 0; + } +#else +#ifndef EKA2 +// Starting point of the DLL (Removed in EKA2) +GLDEF_C TInt E32Dll(TDllReason) + { + return(KErrNone); + } +#endif +#endif // _BullseyeCoverage diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mmusavasettingsstub/inc/mmusavasettingsstub.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mmusavasettingsstub/inc/mmusavasettingsstub.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,163 @@ +/* +* Copyright (c) 2006-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: Used for unit testing other classes. +* +*/ + + +#ifndef MMUSAVASETTINGSSTUB_H +#define MMUSAVASETTINGSSTUB_H + +#include "musavasettingsimp.h" + +/** + * Stub implementation of MMusAvaSettings class. + * Used in unit tests of other classes. + * + * @since S60 v3.2 + */ +class CMusAvaSettings2 : public CMusAvaSettingsImp + { +public: + + void ConstructL(); + + ~CMusAvaSettings2(); + + +// from baseclass MMusAvaSettings. + + /** + * From MMusAvaSettings. + * Returns telephone number. + * + * @since S60 v3.2 + * @return TDesC reference containing telephone number. + */ + virtual const TDesC& TelNumber() const; + + /** + * Returns the contact name of remote host of active CS call. + * + * @return The contact name. + */ + virtual const TDesC& ContactName() const; + + /** + * From MMusAvaSettings. + * Returns proposal for SIP address. + * + * @since S60 v3.2 + * @return TDesC reference containing proposal for SIP address. + */ + virtual const TDesC& SipAddressProposal() const; + + /** + * From MMusAvaSettings. + * Returns SIP addresses. + * + * @since S60 v3.2 + * @return reference to MDesCArray containing SIP addresses. + */ + const MDesCArray& SipAddresses() const; + + /** + * From MMusAvaSettings. + * Returns contact Id. + * + * @since S60 v3.2 + * @return Contact Id. + */ + virtual TInt ContactId() const; + + /** + * From MMusAvaSettings. + * Returns video codecs. + * + * @since S60 v3.2 + * @return reference to MDesCArray containing video codecs. + */ + const MDesCArray& VideoCodecs() const; + + /** + * From MMusAvaSettings. + * Returns audio codecs. + * + * @since S60 v3.2 + * @return reference to MDesCArray containing audio codecs. + */ + const MDesCArray& AudioCodecs() const; + + /** + * From MMusAvaSettings. + * Returns Id of used SIP profile. + * + * @since S60 v3.2 + * @return SIP profile Id. + */ + virtual TInt SipProfileId() const; + +private: // data + + /** + * Buffer containing telephone number. + * Own. + */ + HBufC* iTelNumber; + + /** + * Buffer containing contact name. + * Own. + */ + HBufC* iContactName; + + /** + * Proposal for SIP address. + * Own. + */ + HBufC* iSipAddressProposal; + + /** + * Id of contact. + */ + TInt iContactId; + + /** + * Id of used SIP profile. + */ + TInt iSipProfileId; + + /** + * Array of SIP addresses. + * Own. + */ + CDesCArrayFlat* iSipAddresses; + + /** + * Array of video codecs. + * Own. + */ + CDesCArrayFlat* iVideoCodecs; + + /** + * Array of audio codecs. + * Own. + */ + CDesCArrayFlat* iAudioCodecs; + + MUS_UNITTEST( UT_CMusAvailabilityPluginManager ) + + }; + +#endif // MMUSAVASETTINGSSTUB_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mmusavasettingsstub/src/mmusavasettingsstub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mmusavasettingsstub/src/mmusavasettingsstub.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,95 @@ +/* +* 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: Used for unit testing other classes. +* +*/ + + +#include "mmusavasettingsstub.h" + +_LIT( KTelNumber, "123" ); +_LIT( KContactName, "Jane Doe" ); +_LIT( KVideoCodec, "H264" ); + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// Initializes setting data. +// --------------------------------------------------------------------------- +// +void CMusAvaSettings2::ConstructL() + { + iTelNumber = KTelNumber().AllocL(); + iContactName = KContactName().AllocL(); + + _LIT( KAddress1, "sip:stadi@hesa.fi" ); + + iSipAddresses = new(ELeave)CDesCArrayFlat( 1 ); + iSipAddresses->AppendL( KAddress1() ); + iVideoCodecs = new(ELeave)CDesCArrayFlat( 1 ); + iVideoCodecs->AppendL( KVideoCodec ); + iAudioCodecs = new(ELeave)CDesCArrayFlat( 1 ); + iSipAddressProposal = KAddress1().AllocL(); + } + +CMusAvaSettings2::~CMusAvaSettings2() + { + delete iContactName; + delete iTelNumber; + + delete iSipAddresses; + delete iVideoCodecs; + delete iAudioCodecs; + delete iSipAddressProposal; + } + +const TDesC& CMusAvaSettings2::TelNumber() const + { + return *iTelNumber; + } + +const TDesC& CMusAvaSettings2::ContactName() const + { + return *iContactName; + } + +const TDesC& CMusAvaSettings2::SipAddressProposal() const + { + return *iSipAddressProposal; + } + +const MDesCArray& CMusAvaSettings2::SipAddresses() const + { + return *iSipAddresses; + } + +TInt CMusAvaSettings2::ContactId() const + { + return iContactId; + } + +const MDesCArray& CMusAvaSettings2::VideoCodecs() const + { + return *iVideoCodecs; + } + +const MDesCArray& CMusAvaSettings2::AudioCodecs() const + { + return *iAudioCodecs; + } + +TInt CMusAvaSettings2::SipProfileId() const + { + return iSipProfileId; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/multimediasharingsettingsstub/inc/mussettings.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/multimediasharingsettingsstub/inc/mussettings.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,56 @@ +/* +* 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: ?Description + +* +*/ + + +#ifndef MUSSETTINGS_H +#define MUSSETTINGS_H + +#include "mussettingskeys.h" + +/** + * A namespace container for MultimediaSharing Settings API constants. + * + * @since S60 v3.2 + */ +class MultimediaSharingSettings + { +public: + + static MusSettingsKeys::TOperatorVariant + MultimediaSharingSettings::OperatorVariantSettingL(); + + static MusSettingsKeys::TAuditoryNotification AuditoryNotificationSettingL(); + + static MusSettingsKeys::TPopupNotification PopupNotificationSettingL(); + static MusSettingsKeys::TAutoRecord AutoRecordSettingL(); + + static TInt VideoLocationSettingL(); + + static HBufC* VideoFolderSettingLC(); + + static MusSettingsKeys::TVideoDirection VideoDirectionL(); + + static HBufC* iVideoFolder; + static MusSettingsKeys::TAutoRecord iAutoRecord; + static TInt iVideoLocation; + static MusSettingsKeys::TVideoDirection iVideoDirection; + + }; + + +#endif // MUSSETTINGS_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/multimediasharingsettingsstub/src/mussettings.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/multimediasharingsettingsstub/src/mussettings.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,70 @@ +/* +* 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: ?Description +* +*/ + + +#include "mussettings.h" +#include "mussettingskeys.h" + + + +HBufC* MultimediaSharingSettings::iVideoFolder = NULL; + +MusSettingsKeys::TAutoRecord MultimediaSharingSettings::iAutoRecord = MusSettingsKeys::TAutoRecord( 0 ); +TInt MultimediaSharingSettings::iVideoLocation = 2; // phone memory C: +MusSettingsKeys::TVideoDirection MultimediaSharingSettings::iVideoDirection = MusSettingsKeys::EOneWayVideo; + +HBufC* MultimediaSharingSettings::VideoFolderSettingLC() + { + HBufC* res = iVideoFolder->AllocLC(); + return res; + + } + +MusSettingsKeys::TAuditoryNotification + MultimediaSharingSettings::AuditoryNotificationSettingL() + { + //EAuditoryNotificationOn, + //EAuditoryNotificationOff + TInt value(MusSettingsKeys::EAuditoryNotificationOn); + return ( MusSettingsKeys::TAuditoryNotification ) value; + } + +MusSettingsKeys::TPopupNotification + MultimediaSharingSettings::PopupNotificationSettingL() + { + //EPopupNotificationOn + //EPopupNotificationOff + TInt value(MusSettingsKeys::EPopupNotificationOn); + return ( MusSettingsKeys::TPopupNotification ) value; + } + +MusSettingsKeys::TAutoRecord MultimediaSharingSettings::AutoRecordSettingL() + { + return iAutoRecord; + } + + +TInt MultimediaSharingSettings::VideoLocationSettingL() + { + return iVideoLocation; + } + +MusSettingsKeys::TVideoDirection MultimediaSharingSettings::VideoDirectionL() + { + return iVideoDirection; + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/musavaailabilitystub/inc/musavaavailabilitystub.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/musavaailabilitystub/inc/musavaavailabilitystub.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,124 @@ +/* +* 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: Provide interface for the client requestin network availability. +* +*/ + + +#ifndef __MUSAVAAVAILABILITYSTUB_H__ +#define __MUSAVAAVAILABILITYSTUB_H__ + +#include "musavaavailability.h" + +#include + +class MMusAvaAvailabilityObserver; +class MMusAvaObserver; +class CMusAvaSharedObject; +class CMusAvaSettingsImp; + +/** + * Implemets register vailability. + * + * Provide interface for the client to availability class. + * + * @lib musavailabilityplugin.lib + * @since S60 v3.2 + */ + + + +class CMusAvaAvailabilityStub : public CMusAvaAvailability + { + public: + + /** + * Two-phased constructor. + * + * @param aObserver Pointer to observer interface. + * @param aSettings Reference to settings object. + * @return Returns pointer to CMusAvaInterface object. + */ + static CMusAvaAvailabilityStub* NewL( + MMusAvaAvailabilityObserver& aObserver, + CMusAvaSettingsImp& aConcreteSettings ); + + /** + * Two-phased constructor. + * + * @param aObserver Pointer to observer interface. + * @param aSettings Reference to settings object. + * @return Returns pointer to CMusAvaInterface object. + */ + static CMusAvaAvailabilityStub* NewLC( + MMusAvaAvailabilityObserver& aObserver, + CMusAvaSettingsImp& aConcreteSettings ); + + /** + * Destructor + */ + ~CMusAvaAvailabilityStub(); + + +protected: + + CMusAvaAvailabilityStub( MMusAvaAvailabilityObserver& aObserver, + CMusAvaSettingsImp& aConcreteSettings ); + + void ConstructL(); + + + +// from base class CMusAvaAvailability + +public: + + /** + * Executes for the availability. + */ + virtual void DoExecuteL(); + + /** + * From CMusAvaAvailability. + * Returns availability name. + * + * @return Name of *this* availability. + */ + virtual MMusAvaObserver::TAvailabilityName Name(); + + virtual void PrepareForReceivedInviteL(); + +public: + + TInt iExecuteError; + TBool iExecuteLeave; + MMusAvaObserver::TAvailabilityStatus iStatusStub; + MMusAvaObserver::TAvailabilityName iNameStub; + TBool iPrepareForInviteCalled; + +private: + + /** + * Pointer to CMusAvaSharedObject object + */ + CMusAvaSharedObject* iSharedObj; + + /** + * Pointer to CMusAvaSettingsImp object + */ + CMusAvaSettingsImp& iSettings; + }; + + +#endif // __MUSAVANETWORKAVAILABILITY_H__ diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/musavaailabilitystub/src/musavaailabilitystub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/musavaailabilitystub/src/musavaailabilitystub.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,134 @@ +/* +* 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: Provide interface for the client requestin availability class. +* +*/ + + +#include "musavaavailabilitystub.h" +#include "musunittesting.h" +#include "musavasettingsimp.h" +#include "musavaobserver.h" +#include "musavaavailability.h" +#include "muslogger.h" + +#include + +// ------------------------------------------------------------------------- +// Two-phased constructor. +// ------------------------------------------------------------------------- +// +CMusAvaAvailabilityStub* CMusAvaAvailabilityStub::NewL( + MMusAvaAvailabilityObserver& aObserver, + CMusAvaSettingsImp& aSettings ) + { + CMusAvaAvailabilityStub* self = + CMusAvaAvailabilityStub::NewLC( + aObserver, + aSettings ); + CleanupStack::Pop( self ); + return self; + } + +// ------------------------------------------------------------------------- +// Two-phased constructor. +// ------------------------------------------------------------------------- +// +CMusAvaAvailabilityStub* CMusAvaAvailabilityStub::NewLC( + MMusAvaAvailabilityObserver& aObserver, + CMusAvaSettingsImp& aSettings ) + { + CMusAvaAvailabilityStub* self = + new( ELeave ) CMusAvaAvailabilityStub( + aObserver, + aSettings ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// ------------------------------------------------------------------------- +// Destructor. +// ------------------------------------------------------------------------- +// +CMusAvaAvailabilityStub::~CMusAvaAvailabilityStub() + { + + } + +// ------------------------------------------------------------------------- +// Starts the loopy execution. +// ------------------------------------------------------------------------- +// +void CMusAvaAvailabilityStub::DoExecuteL() + { + if ( iExecuteLeave != 0 ) + { + User::Leave( iExecuteLeave ); + } + else if ( iExecuteError) + { + iObserver.AvailabilityChanged( + (MMusAvaObserver::TAvailabilityName)iNameStub, + (MMusAvaObserver::TAvailabilityStatus)iStatusStub ); + } + else + { + iObserver.AvailabilityError( + (MMusAvaObserver::TAvailabilityName)iNameStub, + (MMusAvaObserver::TAvailabilityStatus)iStatusStub ); + } + } + + +// ------------------------------------------------------------------------- +// +// ------------------------------------------------------------------------- +// +MMusAvaObserver::TAvailabilityName CMusAvaAvailabilityStub::Name() + { + return iNameStub; + } + +// ------------------------------------------------------------------------- +// +// ------------------------------------------------------------------------- +// +void CMusAvaAvailabilityStub::PrepareForReceivedInviteL() + { + iPrepareForInviteCalled = ETrue; + } + +// ------------------------------------------------------------------------- +// Constructor function. +// ------------------------------------------------------------------------- +// +CMusAvaAvailabilityStub::CMusAvaAvailabilityStub( + MMusAvaAvailabilityObserver& aObserver, + CMusAvaSettingsImp& aSettings) + :CMusAvaAvailability( aObserver ), + iSettings( aSettings ) + { + } + + +// ------------------------------------------------------------------------- +// Second phase constructor. +// ------------------------------------------------------------------------- +// +void CMusAvaAvailabilityStub::ConstructL() + { + + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/musenginestub/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/musenginestub/group/bld.inf Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,23 @@ +/* +* 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 + +PRJ_MMPFILES +musenginepluginstub.mmp + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/musenginestub/group/musenginepluginstub.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/musenginestub/group/musenginepluginstub.mmp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,46 @@ +/* +* 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 + +TARGET musenginepluginstub.dll +TARGETTYPE dll +UID 0x1000008d 0x00000112 // Experimental UID +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + + +SOURCEPATH ../src +SOURCE musengsessionmanager.cpp +SOURCE musengsession.cpp +SOURCE musengmcesession.cpp +SOURCE musengmceoutsession.cpp +SOURCE musenglivesession.cpp +SOURCE musengreceivesession.cpp +SOURCE musengclipsession.cpp + + +USERINCLUDE ../inc +USERINCLUDE ../../../mmsharing/inc +USERINCLUDE ../../../inc + +APP_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/ecom + +LIBRARY euser.lib +LIBRARY cntmodel.lib ecom.lib +DEBUGLIBRARY flogger.lib diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/musenginestub/group/musenginestub.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/musenginestub/group/musenginestub.mmp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,83 @@ +/* +* 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: +* +*/ + +// using relative paths for sourcepath and user includes +// exports are unfrozen + +#include +#include +#include +#include "../../../inc/musuid.hrh" + +// Capability assignment. +CAPABILITY EUNIT_CAPS + +// Vendor ID assignment. +VENDORID VID_DEFAULT + + +TARGET musengine.dll +TARGETTYPE dll +UID 0x1000008d KMusEngineUid // 0x10282392 + +//DOCUMENT Generic_Symbian_DLL_ReadMe.txt + +SOURCEPATH ../src +SOURCE musengsession.cpp +SOURCE musengmcesession.cpp +SOURCE musengmceoutsession.cpp +SOURCE musenglivesession.cpp +SOURCE musengtwowaysession.cpp +SOURCE musengtwowayrecvsession.cpp +SOURCE musengreceivesession.cpp +SOURCE musengtelephoneutils.cpp +SOURCE musengsessiondurationtimer.cpp +SOURCE musengclipsession.cpp +SOURCE musenguriparser.cpp +SOURCE musengmceutils.cpp +SOURCE musengcamerahandler.cpp + +// SIP API +SOURCE mussipprofilehandler.cpp + + +USERINCLUDE ../inc +USERINCLUDE ../../mmshshared/inc +USERINCLUDE ../../inc +USERINCLUDE ../../../inc + +APP_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/ecom + +LIBRARY euser.lib +LIBRARY bafl.lib +LIBRARY inetprotutil.lib +LIBRARY phoneclient.lib +LIBRARY centralrepository.lib + +LIBRARY sipprofilecli.lib +LIBRARY sipclient.lib +LIBRARY sipcodec.lib +LIBRARY mceclient.lib +LIBRARY drmcommon.lib +LIBRARY charconv.lib +LIBRARY telephonyaudiorouting.lib +LIBRARY pbkeng.lib +LIBRARY cntmodel.lib + +DEBUGLIBRARY flogger.lib + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/musenginestub/inc/musengaudioroutingobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/musenginestub/inc/musengaudioroutingobserver.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,53 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef MUSENGAUDIOROUTINGOBSERVER_H +#define MUSENGAUDIOROUTINGOBSERVER_H + + +// CLASS DECLARATION + +/** +* An interface to be implemented by users of Multimedia Sharing Engine if +* they wish to be notified about changes in audio routing. +* +*/ +class MMusEngAudioRoutingObserver + { + + public: + + /** + * Indicates that some other application has changed audio routing. + * @param aShowNote ETrue if notification of current change should be + * shown. + * + */ + virtual void AudioRoutingChanged( TBool aShowNote ) = 0; + + /** + * Observer is required to give information whether audio route change + * is allowed currently. + * @param ETrue if change is allowed, otherwise EFalse + * + */ + virtual TBool AudioRouteChangeAllowed() const = 0; + + }; + +#endif // INCLUDE GUARD \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/musenginestub/inc/musengcamerahandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/musenginestub/inc/musengcamerahandler.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,255 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef MUSHENGCAMERAHANDLER_H +#define MUSHENGCAMERAHANDLER_H + +// USER +#include "musunittesting.h" +#include "mussettings.h" + +// SYSTEM +#include + +// FORWARD DECLARATIONS +class CMceCameraSource; +class CMceSession; + +// CLASS + +class TMusEngCameraHandler + { + MUS_UNITTEST( UT_CMusEngOutSession ) + MUS_UNITTEST( UT_CMusEngLiveSession ) + MUS_UNITTEST( UT_CMusEngTwoWaySession ) + MUS_UNITTEST( UT_CMusEngTwoWayRecvSession ) + MUS_UNITTEST( UT_TMusEngCameraHandler ) + + public: + /* + * Defines current camera to be used + */ + enum TCurrentCamera + { + ENextCamera = -1, + EBackCamera = 0, + EFrontCamera = 1 + }; + + public: + + /** + * Determines the number of cameras on the device. + * + * @param aCurrentCamera returns current camera.. + * + * @return Count of cameras present on the device. + */ + IMPORT_C TInt CamerasAvailableL( TCurrentCamera& aCurrentCamera ); + + /** + * Change current camera to front to back + * + * @param aCurrentCamera Change camera to be used. + */ + IMPORT_C void ChangeCameraL( TCurrentCamera aCurrentCamera ); + + /** + * Gets current zoom factor + * + * @pre Session is established + * @leave KErrNotReady if precondition not fullfilled + */ + IMPORT_C TInt CurrentZoomL() const; + + /** + * Sets new zoom factor + * + * @pre Session is established + * @pre MinZoomL <= aNewZoomFactor <= MaxZoomL + * @leave KErrNotReady if session is not established + */ + IMPORT_C void SetZoomL( TInt aNewZoomFactor ); + + /** + * Gets minimum zoom factor + * + * @pre Session is established + * @leave KErrNotReady if precondition not fullfilled + */ + IMPORT_C TInt MinZoomL() const; + + /** + * Gets maximum zoom factor + * + * @pre Session is established + * @leave KErrNotReady if precondition not fullfilled + */ + IMPORT_C TInt MaxZoomL() const; + + /** + * Increases zoom factor by one. + * + * @pre Session is established + * @leave KErrNotReady if precondition not fullfilled + */ + IMPORT_C void ZoomInL(); + + /** + * Decreases zoom factor by one. + * + * @pre Session is established + * @leave KErrNotReady if precondition not fullfilled + */ + IMPORT_C void ZoomOutL(); + + /** + * Sets zoom factor to default. + * + * @pre Session is established + * @leave KErrNotReady if precondition not fullfilled + */ + IMPORT_C void ZoomDefaultL(); + + /** + * Sets current brightness + * + * @pre Session is established + * @leave KErrNotReady if precondition not fullfilled + */ + IMPORT_C void SetBrightnessL( TInt aBrightness ) const; + + + /** + * Gets current brightness + * + * @pre Session is established + * @leave KErrNotReady if precondition not fullfilled + */ + IMPORT_C TInt CurrentBrightnessL() const; + + /** + * Gets maximum brightness + * + * @pre Session is established + * @leave KErrNotReady if precondition not fullfilled + */ + IMPORT_C TInt MaxBrightnessL() const; + + /** + * Gets minimum brightness + * + * @pre Session is established + * @leave KErrNotReady if precondition not fullfilled + */ + IMPORT_C TInt MinBrightnessL() const; + + /** + * Increases brightness by one. + * + * @pre Session is established + * @leave KErrNotReady if precondition not fullfilled + */ + IMPORT_C void IncreaseBrightnessL(); + + /** + * Decreases brightness by one. + * + * @pre Session is established + * @leave KErrNotReady if precondition not fullfilled + */ + IMPORT_C void DecreaseBrightnessL(); + + /** + * Sets brightness factor to default. + * + * @pre Session is established + * @leave KErrNotReady if precondition not fullfilled + */ + IMPORT_C void BrightnessDefaultL(); + + /** + * Sets brightness to automatic. + * + * @pre Session is established + * @leave KErrNotReady if precondition not fullfilled + */ + IMPORT_C void BrightnessAutoL(); + + /** + * Resumes previously paused session. + * Continues using viewfinder and enables streaming video. + * + */ + IMPORT_C void PlayL(); + + /** + * Pauses session. + * Holds display and disables streaming video to network. + * + */ + IMPORT_C void PauseL(); + + /** + * Tells whether session is paused or not + */ + IMPORT_C TBool IsPlayingL(); + + + public: + + TMusEngCameraHandler(); + + void SetSession( CMceSession* aSession ); + + void InitializeL( CMceCameraSource& aCamera ); + + void InitializeZoomStepSize(); + + void ReadCameraUsageKeyL(); + + TInt ZoomStepSize( TInt64& aTime ); + + void ChangeActiveCameraL( TCurrentCamera aNewCamera ); + + private: + + CMceSession* iSession; // Not owned + + TCameraInfo iCameraInfo; + + TInt iDefaultZoomFactor; + + TInt iDefaultBrightness; + + TInt64 iZoomInTime; + + TInt64 iZoomOutTime; + + TInt iSmallZoomStep; + + TInt iBigZoomStep; + + TCurrentCamera iCurrentCamera; + + MusSettingsKeys::TUseCamera iCameraUsage; + + }; + +#endif + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/musenginestub/inc/musengclipsession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/musenginestub/inc/musengclipsession.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,59 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef MUSHENGCLIPSESSION_H +#define MUSHENGCLIPSESSION_H + +// USER +#include "musengmceoutsession.h" + +class CMusEngClipSession : public CMusEngMceOutSession + { + + public: + + /** + * + */ + static CMusEngClipSession* NewL( + const TRect& aRect ); + + /** + * + */ + ~CMusEngClipSession(); + + + private: + + /** + * + */ + CMusEngClipSession( const TRect& aRect ); + + /** + * @leave KErrPermissionDenied if file is DRM protected + */ + void ConstructL(); + + + + }; + +#endif + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/musenginestub/inc/musengclipsessionobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/musenginestub/inc/musengclipsessionobserver.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,73 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef MUSENGCLIPSESSIONOBSERVER_H +#define MUSENGCLIPSESSIONOBSERVER_H + +// INCLUDES +#include + +// CLASS DECLARATION + +/** +* An interface to be implemented by users of Multimedia Sharing Engine +* if they wish to receive clip sharing specific events. +* +* This observer is set using CMusEngClipSession::SetSessionObserver function. +* +*/ +class MMusEngClipSessionObserver + { + public: + + /** + * Indicates that shared clip has ended. + */ + virtual void EndOfClip() = 0; + + /** + * Indicates that chosen clip must be transcoded before sharing. + */ + virtual void TranscodingNeeded() = 0; + + /** + * Indicates that transcoding has progressed. + * @param aPercentage Percentage of completion + */ + virtual void TranscodingProgressed( TInt aPercentage ) = 0; + + /** + * Indicates that transcoding has successfully complited + * but session establishment is not yet proceeding. + */ + virtual void TranscodingCompletedInit() = 0; + + /** + * Indicates that transcoding has successfully complited + * and session establishment continues. + */ + virtual void TranscodingCompletedFinalize() = 0; + + /** + * Indicates that transcoding has failed. + */ + virtual void TranscodingFailed() = 0; + + }; + +#endif \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/musenginestub/inc/musenglivesession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/musenginestub/inc/musenglivesession.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,210 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef MUSHENGLIVESESSION_H +#define MUSHENGLIVESESSION_H + +// USER +#include "musengmceoutsession.h" +#include "musunittesting.h" +#include "mussettings.h" +#include "musengcamerahandler.h" +#include "lcvideoplayer.h" +#include "lccameracontrol.h" +#include "lcbrightnesscontrol.h" +#include "lczoomcontrol.h" +#include "lcfilecontrol.h" + +// SYSTEM +#include + +// FORWARD DECLARATIONS +class MMusEngLiveSessionObserver; +class MLcValueControl; + + +class CMusEngLiveSession : + public CMusEngMceOutSession, + public MLcVideoPlayer, + public MLcCameraControl, + public MLcBrightnessControl, + public MLcZoomControl, + public MLcFileControl + { + + public: + /** + * Creates new MultimediaSharing Live session. + * + * @param aFileName Media filename + * @param aRect UI drawing area. It is allowed handle from engine + * @param aSessionObserver Interface for session specific callbacks + * @param aOutSessionObserver Interface for outsession specific callbacks + * @param aLiveSessionObserver interface for live session specific + * callbacks + * @return CMusEngLiveSession* New instanse of specified class + */ + static CMusEngLiveSession* NewL( + const TDesC& aFileName, + const TRect& aRect ); + + /** + * Creates new MultimediaSharing Live session. + * + * @param aRect UI drawing area. It is allowed handle from engine + * @param aSessionObserver Interface for session specific callbacks + * @param aOutSessionObserver Interface for outsession specific callbacks + * @param aLiveSessionObserver interface for live session specific + * callbacks + * @return CMusEngLiveSession* New instanse of specified class + */ + static CMusEngLiveSession* NewL( + const TRect& aRect ); + + + public: + + /** + * Destructor + */ + ~CMusEngLiveSession(); + + + public: // from MLcSession + + void EstablishLcSessionL(); + + MLcVideoPlayer* LocalVideoPlayer(); + + const TDesC& RemoteDisplayName(); + + + public: // from MLcVideoPlayer + + TLcVideoPlayerState LcVideoPlayerState() const; + + TBool LcIsPlayingL(); + + void LcPlayL(); + + void LcPauseL(); + + MLcWindow* LcWindow(); + + MLcCameraControl* LcCameraControl(); + + MLcFileControl* LcSourceFile(); + + MLcFileControl* LcDestinationFile(); + + MLcAudioControl* LcAudioControl(); + + MLcZoomControl* LcZoomControl(); + + MLcBrightnessControl* LcBrightnessControl(); + + RPointerArray< MLcValueControl >& LcExtensionControls(); + + public: // from MLcCameraControl + + TInt LcCameraCountL(); + + void ToggleLcCameraL(); + + public: // 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: // from MLcFileControl + + void EnableLcFileL( TBool aEnable ); + + TBool IsLcFileEnabled(); + + void SetLcFileNameL( const TFileName& aFileName ); + + TFileName& LcFileName(); + + protected: + + /** + * Constructor + */ + CMusEngLiveSession( const TRect& aRect, + const TDesC& aRecordedFile = KNullDesC ); + + /** + * Second-phase constructor + */ + void ConstructL(); + + + + protected: + + /** + * File name for recording. If KNullDesC no recording performed. + */ + TFileName iRecordedFile; + + /** + * Dummy member variable to implement MLcVideoPlayer::LcExtensionControls + */ + RPointerArray< MLcValueControl > iValueControls; + + TMusEngCameraHandler iCameraHandler; + + /* + * Remote Display Name + */ + HBufC* iRemoteDisplayName; + + TInt iCurrentZoom; + TInt iDefaultZoomFactor; + TInt iCurrentBrighness; + TInt iPlaying; + TBool iFileEnabled; + + }; + +#endif + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/musenginestub/inc/musenglivesessionobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/musenginestub/inc/musenglivesessionobserver.h Thu Jul 22 16:32:26 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: +* +*/ + + +#ifndef MUSHENGLIVESESSIONOBSERVER_H +#define MUSHENGLIVESESSIONOBSERVER_H + + + +// CLASS DECLARATION + +/** +* An interface to be implemented by clients of Multimedia Sharing Engine if +* they wish to receive events about live sharing specific event. +*/ +class MMusEngLiveSessionObserver + { + + public: + + /** + * Indicates that disk has run out of space during recording. + */ + virtual void DiskFull() = 0; + + }; + +#endif \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/musenginestub/inc/musenglogger.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/musenginestub/inc/musenglogger.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,301 @@ +/* +* 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: ?Description +* +*/ + + +#ifndef MUSENGLOGGER_H +#define MUSENGLOGGER_H + + +#include "muslogger.h" + +#if ( !_DEBUG || UNIT_TESTING ) // release or unit test build; no logs + +#define MUS_ENG_LOG_SESSION_STATE( aSession ) +#define MUS_ENG_LOG_SESSION_STATE_AND_STATUS( aSession, aStatusCode, aReasonPhrase ) +#define MUS_ENG_LOG_STREAM_STATE( aStream ) +#define MUS_ENG_LOG_SINK_STATES( aStream ) +#define MUS_ENG_LOG_SOURCE_STATE( aSource ) +#define MUS_ENG_LOG_SINK_STATE( aSink ) +#define MUS_ENG_LOG_STATUS( aStatusCode, aReasonPhrase ) + +#else // debug build; logs + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define MUS_ENG_LOG_SESSION_STATE( aSession )\ + {\ + TBuf<15> state;\ + switch ( (aSession).State() )\ + {\ + case CMceSession::EIdle:\ + {\ + state = _L("EIdle");\ + break;\ + }\ + case CMceSession::EOffering :\ + {\ + state = _L("EOffering");\ + break;\ + }\ + case CMceSession::EIncoming:\ + {\ + state = _L("EIncoming");\ + break;\ + }\ + case CMceSession::EReserving :\ + {\ + state = _L("EReserving");\ + break;\ + }\ + case CMceSession::EAnswering :\ + {\ + state = _L("EAnswering");\ + break;\ + }\ + case CMceSession::EProceeding :\ + {\ + state = _L("EProceeding");\ + break;\ + }\ + case CMceSession::EEstablished:\ + {\ + state = _L("EEstablished");\ + break;\ + }\ + case CMceSession::ECancelling:\ + {\ + state = _L("ECancelling");\ + break;\ + }\ + case CMceSession::ETerminating:\ + {\ + state = _L("ETerminating");\ + break;\ + }\ + case CMceSession::ETerminated:\ + {\ + state = _L("ETerminated");\ + break;\ + }\ + default:\ + {\ + state = _L("Unknown");\ + break;\ + }\ + }\ + MUS_LOG_TDESC( "mus: [ENGINE] Session state is ", state )\ + } + + +#define MUS_ENG_LOG_SESSION_STATE_AND_STATUS( aSession, aStatusCode, aReasonPhrase )\ + {\ + MUS_ENG_LOG_SESSION_STATE( aSession )\ + MUS_ENG_LOG_STATUS( aStatusCode, aReasonPhrase )\ + } + + +#define MUS_ENG_LOG_STREAM_STATE( aStream )\ + {\ + TBuf<20> streamState;\ + switch ( (aStream).State() )\ + {\ + case CMceMediaStream::EUninitialized:\ + {\ + streamState = _L("EIdle");\ + break;\ + }\ + case CMceMediaStream::EInitialized:\ + {\ + streamState = _L("EInitialized");\ + break;\ + }\ + case CMceMediaStream::EBuffering:\ + {\ + streamState = _L("EBuffering");\ + break;\ + }\ + case CMceMediaStream::EIdle:\ + {\ + streamState = _L("EIdle");\ + break;\ + }\ + case CMceMediaStream::EStreaming:\ + {\ + streamState = _L("EStreaming");\ + break;\ + }\ + case CMceMediaStream::EDisabled:\ + {\ + streamState = _L("EDisabled");\ + break;\ + }\ + case CMceMediaStream::ENoResources:\ + {\ + streamState = _L("ENoResources");\ + break;\ + }\ + case CMceMediaStream::ETranscodingRequired:\ + {\ + streamState = _L("ETranscodingRequired");\ + break;\ + }\ + case CMceMediaStream::ETranscoding:\ + {\ + streamState = _L("ETranscoding");\ + break;\ + }\ + default:\ + {\ + streamState = _L("Unknown");\ + break;\ + }\ + }\ + if ( (aStream).Type() == KMceAudio )\ + {\ + MUS_LOG_TDESC( "mus: [ENGINE] AudioStream state is ", streamState )\ + }\ + else\ + {\ + MUS_LOG_TDESC( "mus: [ENGINE] VideoStream state is ", streamState )\ + }\ + MUS_ENG_LOG_SOURCE_STATE( (aStream).Source() )\ + MUS_ENG_LOG_SINK_STATES( (aStream) )\ + } + + +#define MUS_ENG_LOG_SINK_STATES( aStream )\ + {\ + for ( TInt sinkIndex = 0; sinkIndex < aStream.Sinks().Count(); ++sinkIndex )\ + {\ + MUS_ENG_LOG_SINK_STATE( aStream.Sinks()[ sinkIndex ] )\ + }\ + } + + +#define MUS_ENG_LOG_SOURCE_STATE( aSource )\ + {\ + if ( aSource )\ + {\ + TBuf<10> sourceState;\ + if ( aSource->IsEnabled() )\ + {\ + sourceState = _L("enabled");\ + }\ + else\ + {\ + sourceState = _L("disabled");\ + }\ + switch ( aSource->Type() )\ + {\ + case KMceCameraSource:\ + {\ + MUS_LOG_TDESC( " CameraSource is ", sourceState )\ + break;\ + }\ + case KMceFileSource:\ + {\ + MUS_LOG_TDESC( " FileSource is ", sourceState )\ + break;\ + }\ + case KMceRTPSource:\ + {\ + MUS_LOG_TDESC( " RtpSource is ", sourceState )\ + break;\ + }\ + default:\ + {\ + MUS_LOG_TDESC( " UnknownSource is ", sourceState )\ + break;\ + }\ + }\ + }\ + else\ + {\ + MUS_LOG( " No source in stream" )\ + }\ + } + +#define MUS_ENG_LOG_SINK_STATE( aSink )\ + {\ + if ( aSink )\ + {\ + TBuf<10> sinkState;\ + if ( aSink->IsEnabled() )\ + {\ + sinkState = _L("enabled");\ + }\ + else\ + {\ + sinkState = _L("disabled");\ + }\ + switch ( aSink->Type() )\ + {\ + case KMceDisplaySink:\ + {\ + MUS_LOG_TDESC( " DisplaySink is ", sinkState )\ + break;\ + }\ + case KMceSpeakerSink:\ + {\ + MUS_LOG_TDESC( " SpeakerSink is ", sinkState )\ + break;\ + }\ + case KMceRTPSink:\ + {\ + MUS_LOG_TDESC( " RtpSink is ", sinkState )\ + break;\ + }\ + case KMceFileSink:\ + {\ + MUS_LOG_TDESC( " FileSink is ", sinkState )\ + break;\ + }\ + default:\ + {\ + MUS_LOG_TDESC( " UnknownSink is ", sinkState )\ + break;\ + }\ + }\ + }\ + } + + +#define MUS_ENG_LOG_STATUS( aStatusCode, aReasonPhrase )\ + {\ + MUS_LOG1( " StatusCode is %d", aStatusCode )\ + HBufC16* reasonPhrase = HBufC16::NewLC( aReasonPhrase.Length() );\ + reasonPhrase->Des().Copy( aReasonPhrase );\ + MUS_LOG_TDESC( " ReasonPhrase is ",(*reasonPhrase) )\ + CleanupStack::PopAndDestroy( reasonPhrase );\ + } + + + +#endif // _DEBUG + + +#endif // MUSENGLOGGER_H + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/musenginestub/inc/musengmceoutsession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/musenginestub/inc/musengmceoutsession.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,58 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef MUSHENGMCEOUTSESSION_H +#define MUSHENGMCEOUTSESSION_H + +// USER +#include "musengmcesession.h" + + + +// CLASS DECLARATION +/** +* Class for handling MCE out sessions. Direct inherit classes are +* CMusEngLiveSession and CMusEngClipSession. +* +* @lib musengine.lib +*/ +class CMusEngMceOutSession : public CMusEngMceSession + { + + public: + + /** + * Destructor + */ + ~CMusEngMceOutSession(); + + + protected: + + /** + * Constructor + */ + CMusEngMceOutSession( const TRect& aRect ); + + /** + * Second-phase constructor + */ + void ConstructL(); + + }; +#endif //MUSHENGMCESESSION_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/musenginestub/inc/musengmcesession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/musenginestub/inc/musengmcesession.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,145 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef MUSHENGMCESESSION_H +#define MUSHENGMCESESSION_H + +// USER +#include "musengsession.h" +#include "lcsession.h" +#include "lcwindow.h" +#include "lcaudiocontrol.h" + + +// CLASS DECLARATION + +/** +* Base class for Multimedia Sharing Engine MCE sessions, inherited by +* CMusEngLiveSession CMusEngClipSession and CMusEngReceiveSession. +* +* CMusEngMceSession encapsulates CMCESession and simplifies use of +* MCE Sessions to user interface. Also splits observers messy events +* to simplified function calls. +* +* @lib musengine.lib +*/ +class CMusEngMceSession : public CMusEngSession, + public MLcSession, + public MLcWindow, + public MLcAudioControl + { + + public: + + /** + * Destructor + */ + ~CMusEngMceSession(); + + + public: // from MLcSession + + TLcSessionState LcSessionState() const; + + virtual void EstablishLcSessionL(); + + void TerminateLcSessionL(); + + virtual MLcVideoPlayer* RemoteVideoPlayer(); + + virtual MLcVideoPlayer* LocalVideoPlayer(); + + virtual const TDesC& LocalDisplayName(); + + virtual const TDesC& RemoteDisplayName(); + + TInt SetParameter( TInt aId, TInt aValue ); + + TInt ParameterValue( TInt aId ); + + void UpdateLcSessionL(); + + + public: // from MLcWindow + + void EnableLcWindowL( TBool aEnable ); + + TBool IsLcWindowEnabled(); + + void SetLcWindowRectL( TRect aRect ); + + TRect LcWindowRect(); + + void SetLcWindowOrientationL( + TLcWindowOrientation aOrientation ); + + TLcWindowOrientation LcWindowOrientationL(); + + public: // from MLcAudioControl + + TBool IsLcAudioMutedL(); + + void MuteLcAudioL( TBool aMute ); + + TBool IsLcMicMutedL(); + + void MuteLcMicL( TBool aMute ); + + TBool IsLcLoudspeakerEnabled(); + + void EnableLcLoudspeakerL( TBool aEnabled ); + + TBool IsEnablingLcLoudspeakerAllowed(); + + TInt LcVolumeL(); + + void SetLcVolumeL( TInt aValue ); + + void IncreaseLcVolumeL(); + + void DecreaseLcVolumeL(); + + protected: // CONSTRUCTORS + + /** + * Constructor + * + */ + CMusEngMceSession( const TRect& aRect ); + + /** + * Second-phase constructor + * + */ + void ConstructL(); + + + private: + + MLcWindow::TLcWindowOrientation iOrientation; + TBool iMuted; + TBool iMicMuted; + TBool iLoudspeakerEnabled; + TBool iEnablingLoudspeakerAllowed; + TInt iVolume; + TRect iRect; + TBool iWindowEnabled; + + }; + +#endif //MUSHENGMCESESSION_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/musenginestub/inc/musengmceutils.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/musenginestub/inc/musengmceutils.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,268 @@ +/* +* 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: Utilities to locate and manipulate MCE sessions, streams, +* sources and sinks +* +*/ + + + +#ifndef MUSENGMCEUTILS_H +#define MUSENGMCEUTILS_H + + +#include +#include +#include + + +class CMceSession; +class CMceDisplaySink; +class CMceCameraSource; +class CMceFileSource; +class CMceVideoStream; +class CMceSpeakerSink; + +const TUint KMusEngNoAssociatedSourceType = KMaxTUint; + +/** +* Static class including utility methods to locate and manipulate MCE +* sessions, streams, sources and sinks +* @lib musengine.lib +*/ +class MusEngMceUtils + { + + public: + + /** + * Tells if a stream is a video stream with rtp source. + * + * @param aStream Stream to be investigated + * @return ETrue if parameter is a video stream with a RTP source + */ + static TBool IsVideoInStream( CMceMediaStream& aStream ); + + /** + * Tells if a stream is a video stream with rtp sink. + * + * @param aStream Stream to be investigated + * @return ETrue if parameter is a video stream with a RTP sink + */ + static TBool IsVideoOutStream( CMceMediaStream& aStream ); + + /** + * Tells if a stream is an audio stream with rtp source. + * + * @param aStream Stream to be investigated + * @return ETrue if parameter is an audio stream with a RTP source + */ + static TBool IsAudioInStream( CMceMediaStream& aStream ); + + /** + * Gets handle to video stream with RTP sink. + * Ownership is not transferred. + * + * @return Outgoing video stream + * @leave KErrNotFound if none exists + * @leave KErrOverflow if session contains more than one outgoing + * video stream + */ + static CMceVideoStream* GetVideoOutStreamL( CMceSession& aSession ); + + /** + * Gets handle to video stream with RTP source. + * Ownership is not transferred. + * + * @return Incoming video stream + * @leave KErrNotFound if none exists + * @leave KErrOverflow if session contains more than one incoming + * video stream + */ + static CMceVideoStream* GetVideoInStreamL( CMceSession& aSession ); + + /** + * Gets handle to video stream with file sink. + * Ownership is not transferred. + * + * @return Recording video stream, NULL if none exists + */ + static CMceVideoStream* GetRecordingStream( CMceSession& aSession ); + + /** + * Gets handle to a media sink of spesified type contained by + * a mediastream. If there are several sink instances, first one is + * returned. If associated source type is defined, sink in stream having + * the source is tried to be searched. If no such match, first matching + * sink is returned. Ownership is not transferred. + * + * @return Media sink of the spesified type. NULL if none exists + */ + static CMceMediaSink* GetMediaSink( + CMceMediaStream& aStream, + TMceSinkType aType, + TMceSourceType aAssociatedSourceType = KMusEngNoAssociatedSourceType ); + + /** + * Gets handle to a media sink of spesified type contained by + * a mediastream. If there are several sink instances, first one is + * returned. If associated source type is defined, sink in stream having + * the source is tried to be searched. If no such match, first matching + * sink is returned. Ownership is not transferred. + * + * @return Media sink of the spesified type. + * @leave KErrNotFound if there is no sink of spesified type + */ + static CMceMediaSink* GetMediaSinkL( + CMceMediaStream& aStream, + TMceSinkType aType, + TMceSourceType aAssociatedSourceType = KMusEngNoAssociatedSourceType ); + + /** + * Gets handle to a media sink of spesified type contained by + * a session. If there are several sink instances, first one is + * returned. If associated source type is defined, sink in stream having + * the source is tried to be searched. If no such match, first matching + * sink is returned. Ownership is not transferred. + * + * @return Media sink of the spesified type. NULL if none exists + */ + static CMceMediaSink* GetMediaSink( + CMceSession& aSession, + TMceSinkType aType, + TMceSourceType aAssociatedSourceType = KMusEngNoAssociatedSourceType, + TBool aStrictMatch = EFalse ); + + /** + * Gets handle to a media sink of spesified type contained by + * a session. If there are several sink instances, first one is + * returned. If associated source type is defined, sink in stream having + * the source is tried to be searched. If no such match, first matching + * sink is returned. Ownership is not transferred. + * + * @return Media sink of the spesified type. + * @leave KErrNotFound if there is no sink of spesified type + */ + static CMceMediaSink* GetMediaSinkL( + CMceSession& aSession, + TMceSinkType aType, + TMceSourceType aAssociatedSourceType = KMusEngNoAssociatedSourceType, + TBool aStrictMatch = EFalse ); + + /** + * Gets handle to a speaker sink contained by specified stream + * or its' bound stream. Ownership is not transferred. + * + * @return Speaker sink, NULL if none exists + */ + static CMceSpeakerSink* GetSpeaker( CMceMediaStream& aStream ); + + /** + * Gets handle to a camera source. Ownership is not transferred. + * + * @return Camera source + * @leave KErrNotFound if none exists + */ + static CMceCameraSource* GetCameraL( CMceSession& aSession ); + + /** + * Gets handle to a file source. Ownership is not transferred. + * + * @return File source + * @leave KErrNotFound if none exists + */ + static CMceFileSource* GetFileSourceL( CMceSession& aSession ); + + /** + * Gets handle to a display sink. Ownership is not transferred. + * + * @return Display sink, NULL if none exists + */ + static CMceDisplaySink* GetDisplay( CMceSession& aSession, + TBool aPreferViewFinder = ETrue ); + + /** + * Gets handle to a display sink. If there are several display + * sink instances view finder is preferred with default arguments. + * Ownership is not transferred. + * + * @return Display sink + * @leave KErrNotFound if there is no display + */ + static CMceDisplaySink* GetDisplayL( CMceSession& aSession, + TBool aPreferViewFinder = ETrue ); + + /** + * Gets handle to a display sink. Ownership is not transferred. + * + * @return Display sink, NULL if none exists + */ + static CMceDisplaySink* GetReceivingDisplay( CMceSession& aSession ); + + /** + * Gets handle to a receiving display sink. Ownership is not transferred. + * + * @return Display sink + * @leave KErrNotFound if there is no display + */ + static CMceDisplaySink* GetReceivingDisplayL( CMceSession& aSession ); + + /** + * Gets handle to a viewfinder display sink. Ownership is not transferred. + * + * @return Display sink + * @leave KErrNotFound if there is no display + */ + static CMceDisplaySink* GetVfDisplay( CMceSession& aSession ); + + /** + * Adds display sink to specified stream if one does not exist already. + * Display rect is set in both cases to a specified one. + * Display is disabled by default. + * + * @param aStream is a stream where display is supposed to be added + * @param aManager reference to used MCE manager + * @param aDisplayRect is desired display area + * @leave KErrArgument if offered stream is not a video stream + */ + static void AddDisplayL( CMceMediaStream& aStream, + CMceManager& aManager, + const TRect& aDisplayRect ); + + /** + * Adds speaker sink to specified stream if one does not exist already. + * Speaker is disabled by default. + * + * @param aStream is a stream where speaker is supposed to be added + * @leave KErrArgument if offered stream is not a video stream + */ + static void AddSpeakerL( CMceMediaStream& aStream ); + + /** + * Disables a specified stream, its' source and all the sinks + * + * @param aStream is a stream to be disabled + */ + static void DisableStreamL( CMceMediaStream& aStream ); + + /** + * Enables or disables display sink. If the state is already correct, + * nothing is done. + */ + static void DoEnableDisplayL( CMceDisplaySink& aDisplay, TBool aEnable ); + + }; + + +#endif // MUSENGMCEUTILS_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/musenginestub/inc/musengobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/musenginestub/inc/musengobserver.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,49 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef MUSHENGOBSERVER_H +#define MUSHENGOBSERVER_H + +// INCLUDES +//#include + +// CLASS DECLARATION + +/** +* An interface to be implemented by users of Multimedia Sharing Engine if they wish to receive +* events from session state changes. +* +* This observer is set using CMSSession::SetSessionObserver function. +* +* @lib ???.lib +*/ +class MMusEngObserver + { + + + protected: + /** + * Callback function to indicate that engine state was changed + * @param aState, the new session state + */ + virtual void EngineStateChangedL(/*const TMSEngState& aState*/) = 0; + + + }; + +#endif \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/musenginestub/inc/musengoutsessionobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/musenginestub/inc/musengoutsessionobserver.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,96 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef MUSENGOUTSESSIONOBSERVER_H +#define MUSENGOUTSESSIONOBSERVER_H + +// INCLUDES +#include + +// FORWARD DECLARATIONS +class MMusEngAsyncRetryObserver; + +// CLASS DECLARATION + +/** +* An interface to be implemented by users of Multimedia Sharing Engine if they +* wish to receive feedback from outsent INVITE. All the callback functions +* represent an answer from network to sent INVITE. +*/ +class MMusEngOutSessionObserver + { + public: + + /** + * Indicates that preconditions for sending invitation cannot be met. + */ + virtual void UnableToSendInvitation() = 0; + + /** + * Indicates that no response received to invitation + */ + virtual void NoResponseReceivedToInvitation() = 0; + + /** + * Indicates that MT has rejected session. ( e.g. 603 DECLINE ). + */ + virtual void SessionRejected() = 0; + + /** + * The following functions represent a specific reason in answer + * to sent INVITE. + */ + + virtual void SessionBadRequest() = 0; // 400 + virtual void SessionUnauthorized() = 0; // 401 + virtual void SessionPaymentRequired() = 0; // 402 + virtual void SessionRecipientNotFound() = 0; // 404 + virtual void SessionProxyAuthenticationRequired() = 0; // 407 + virtual void SessionRequestTimeOut() = 0; // 408 + virtual void SessionUnsupportedMediaType() = 0; // 415 + virtual void SessionBusyHere() = 0; // 486 + virtual void SessionRequestCancelled() = 0; // 487 + virtual void SessionTemporarilyNotAvailable() = 0; // 480 + + /** + * Indicates possibility to retry session. Recipient proposal is given + * but implementation can query user for new recipient address. + * Retry address should be filled to aRetryAddress on return. + * @return ETrue if retry should be made + */ + virtual TBool RetrySessionSync( const TDesC& aRecipientProposal, + TDes& aRetryAddress ) = 0; + + /** + * Indicates that retry with given address is proceeding. + */ + virtual void RetryProceeding() = 0; + + /** + * Indicates that there's multiple suitable recipient addresses. + * Client can choose what to use. + * @param aAddressArray, list of suitable recipient addresses + * @param aRecipientAddress, on return should contain recipient + * address to be used + * @return ETrue if recipient was selected, otherwise EFalse + */ + virtual TBool SelectRecipientL( CDesCArray& aAddressArray, + TDes& aRecipientAddress ) = 0; + }; + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/musenginestub/inc/musengpreviewsession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/musenginestub/inc/musengpreviewsession.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,102 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef MUSHENGPREVIEWSESSION_H +#define MUSHENGPREVIEWSESSION_H + +class MMusEngPreviewSessionObserver; + +class CMusEngPreviewSession : public CMusEngSession + { + + private: + // MMusEngPreviewSessionObserver* iSessionObserver; + + public: + /** + * Implements virtual from CMusEngSession + */ + IMPORT_C void Play(); + + + /** + * Implements virtual from CMusEngSession + */ + IMPORT_C void Pause(); + + /** + * Implements virtual from CMusEngSession + */ + IMPORT_C void Close(); + + /** + * Implements virtual from CMusEngSession + */ + IMPORT_C void Mute(); + + /** + * Implements virtual from CMusEngSession + */ + IMPORT_C void Unmute(); + + public: + /** + * Implements 2nd phase constructor from CMusEngSession + */ + void ConstructL( /*const TDesC& aFileName*/ ); + + public: + /** + * Sets callback interface pointer + * + * @param aSessionObserver Pointer to class which implements interface + */ + void SetSessionObserver( MMusEngPreviewSessionObserver* aSessionObserver ); + + + /** + * Creates new MultimediaSharing Preview session. + * + * @param aFileName Media filename + * @param aRect UI drawing area. It is allowed handle from engine + * @param aEngObserver Engine specific callbacks + * @param aSessionObserver Session specific callbacks + * @return CMusEngPreviewSession* New instanse of specified class + */ + IMPORT_C CMusEngPreviewSession* NewL( const TDesC& aFileName, + const TRect& aRect, + MMusEngPreviewSessionObserver* aSessionObserver); + ~CMusEngPreviewSession(); + + public: + //CMusEngPreviewSession(); + CMusEngPreviewSession( MMusEngPreviewSessionObserver* aSessionObserver, const TRect& aRect); + + + + // TODO: FixMe + void SipProfileChanged() + { + }; + + + + + }; + +#endif // diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/musenginestub/inc/musengpreviewsessionobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/musenginestub/inc/musengpreviewsessionobserver.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,40 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef MUSHENGPREVIEWSESSIONOBSERVER_H +#define MUSHENGPREVIEWSESSIONOBSERVER_H + +#include "musengsessionobserver.h" + + +// CLASS DECLARATION + +/** +* An interface to be implemented by users of Multimedia Sharing Engine if they wish to receive +* events from session state changes. +* +* This observer is set using CreateNewPreviewSessionL method +* +* @lib ???.lib +*/ +class MMusEngPreviewSessionObserver : public MMusEngSessionObserver + { + }; + +#endif + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/musenginestub/inc/musengreceivesession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/musenginestub/inc/musengreceivesession.h Thu Jul 22 16:32:26 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: +* +*/ + + +#ifndef MUSHENGREVEIVESESSION_H +#define MUSHENGREVEIVESESSION_H + +// INCLUDES +#include "musengmcesession.h" +#include "musenguriparser.h" +#include "musunittesting.h" +#include "lcvideoplayer.h" +#include + +// FORWARD DECLARATIONS +class MMusEngReceiveSessionObserver; +class CMceInSession; + + +class CMusEngReceiveSession : + public CMusEngMceSession, + public MLcVideoPlayer + { + + public: // Contructors and destructor + + /** + * Creates new MultimediaSharing Receive session. + * + * @param aRect UI drawing area. It is allowed handle from engine + * @param aEngObserver Engine specific callbacks + * @param aSessionObserver Session specific callbacks + * @return CMusEngReceiveSession* New instanse of specified class + */ + static CMusEngReceiveSession* NewL( const TRect& aRect ); + /** + * Destructor + * + * @since S60 v3.2 + */ + ~CMusEngReceiveSession(); + + + public: // from MLcSession + + void EstablishLcSessionL(); + + MLcVideoPlayer* RemoteVideoPlayer(); + + const TDesC& RemoteDisplayName(); + + + public: // from MLcVideoPlayer + + TLcVideoPlayerState LcVideoPlayerState() const; + + TBool LcIsPlayingL(); + + void LcPlayL(); + + void LcPauseL(); + + MLcWindow* LcWindow(); + + MLcCameraControl* LcCameraControl(); + + MLcFileControl* LcSourceFile(); + + MLcFileControl* LcDestinationFile(); + + MLcAudioControl* LcAudioControl(); + + MLcZoomControl* LcZoomControl(); + + MLcBrightnessControl* LcBrightnessControl(); + + RPointerArray< MLcValueControl >& LcExtensionControls(); + + + protected: // CONSTRUCTORS + + CMusEngReceiveSession( const TRect& aRect ); + + void ConstructL(); + + + protected: // DATA + + // identity of originator parsed form P-Asserted-Identity field + TBuf8 iIdentity; + + HBufC8* iOriginator; + + HBufC* iRemoteDisplayName; + + /** + * Dummy member variable to implement MLcVideoPlayer::LcExtensionControls + */ + RPointerArray< MLcValueControl > iValueControls; + }; + +#endif + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/musenginestub/inc/musengreceivesessionobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/musenginestub/inc/musengreceivesessionobserver.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,58 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef MUSHENGRECEIVESESSIONOBSERVER_H +#define MUSHENGRECEIVESESSIONOBSERVER_H + +// INCLUDES + +#include + +// CLASS DECLARATION + +/** +* Observer interface to be implemented by clients interested about notifications +* of receiving (MT) side session specific events. +*/ +class MMusEngReceiveSessionObserver + { + + public: + + /** + * There is new incoming session. + * Session is not yet handled in any way and cannot yet be accepted + * or rejected. User should not be notified at this stage. + */ + virtual void IncomingSessionPreNotification() = 0; + + /** + * There is new incoming session ready to be accepted or rejected. + * User can be notified. + */ + virtual void IncomingSession( const TDesC& aOriginator, + const TDesC& aOriginatorIdentity ) = 0; + + /** + * Current receiving session is buffering received RTP. + */ + virtual void StreamBuffering() = 0; + + }; + +#endif \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/musenginestub/inc/musengsession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/musenginestub/inc/musengsession.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,72 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef MUSENGSESSION_H +#define MUSENGSESSION_H + + +//SYSTEM INCLUDES +#include + + + +// CLASS DECLARATION + +/** +* Base class for Multimedia Sharing Engine sessions, inherited by +* CMusEngMceSession. +* +* CMusEngSession encapsulates all common activities example using +* resources. +* +* @lib musengine.lib +*/ +class CMusEngSession : public CBase + { + + public: + + /** + * Desctructor, finalize session + * + */ + ~CMusEngSession(); + + + + protected: + + /** + * Constructor, private cannot be instantiate + * + * @param aRect reserved drawing area for this session + */ + CMusEngSession(); + + + protected: + + /** + * second-phase constructor, called by those session specific + * constructors + */ + void ConstructL(); + + }; + +#endif //MUSENGSESSION_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/musenginestub/inc/musengsessiondurationtimer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/musenginestub/inc/musengsessiondurationtimer.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,109 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef _MUSENGSESSIONDURATIONTIMER_H_ +#define _MUSENGSESSIONDURATIONTIMER_H_ + + +// USER INCLUDES +#include "musunittesting.h" + +// KERNEL INCLUDES +#include + +// FORWARD DECLERATIONS +class MMusEngSessionDurationTimerObserver; + +class CMusEngSessionDurationTimer : public CActive + { + MUS_UNITTEST( UT_CMusEngSessionDurationTimer ) + + public: + + /** + * + * @since S60 v3.2 + */ + static CMusEngSessionDurationTimer* NewL( + MMusEngSessionDurationTimerObserver& aObserver ); + + /** + * + * @since S60 v3.2 + */ + ~CMusEngSessionDurationTimer(); + + + public: // API + + /** + * + * @since S60 v3.2 + */ + void Start( TInt aDelay ); + + + private: + + /** + * + * @since S60 v3.2 + */ + CMusEngSessionDurationTimer( + MMusEngSessionDurationTimerObserver& aObserver ); + + /** + * + * @since S60 v3.2 + */ + void ConstructL(); + + + private: // inherited from CActive + + /** + * + * @since S60 v3.2 + */ + void RunL(); + + /** + * + * @since S60 v3.2 + */ + void DoCancel(); + + + private: // DATA + + /** + * + * @since S60 v3.2 + */ + RTimer iTimer; + + /** + * + * @since S60 v3.2 + */ + MMusEngSessionDurationTimerObserver& iObserver; + + }; + +#endif // _MUSENGSESSIONDURATIONTIMER_H_ + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/musenginestub/inc/musengsessiondurationtimerobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/musenginestub/inc/musengsessiondurationtimerobserver.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef _MUSENGSESSIONDURATIONTIMEROBSERVER_H_ +#define _MUSENGSESSIONDURATIONTIMEROBSERVER_H_ + + +class MMusEngSessionDurationTimerObserver + { + public: + virtual void UpdateTimerEvent() = 0; + }; + +#endif // _MUSENGSESSIONDURATIONTIMEROBSERVER_H_ \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/musenginestub/inc/musengsessionmanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/musenginestub/inc/musengsessionmanager.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,61 @@ +/* +* 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 CMUSENGSESSIONMANAGER_H +#define CMUSENGSESSIONMANAGER_H + +// INCLUDES +#include "lcengine.h" +#include "musmanagercommon.h" + +// FORWARD DECLARATIONS +class MLcSession; +class CMusEngMceSession; +class MLcUiProvider; + + +class CMusEngSessionManager : + public CLcEngine + { + public: + + static CMusEngSessionManager* NewL( TAny* aInitParams ); + ~CMusEngSessionManager(); + + public: // From CLcEngine + + MLcSession& Session(); + + private: // Constructors + + CMusEngSessionManager( TLcEngineParams& aInitParams ); + void ConstructL(); + + private: // New functions + + CMusEngMceSession* CreateMusSessionL( + MultimediaSharing::TMusUseCase aUseCase ); + + private: // Data + + CMusEngMceSession* iSession; + + }; + +#endif // CMUSENGSESSIONMANAGER_H + +// end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/musenginestub/inc/musengsessionobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/musenginestub/inc/musengsessionobserver.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,102 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef MUSHENGSESSIONOBSERVER_H +#define MUSHENGSESSIONOBSERVER_H + + +#include + +// CLASS DECLARATION + +/** +* An interface to be implemented by users of Multimedia Sharing Engine if +* they wish to receive events from session and streaming state changes. +* +* @lib museng.lib +* @since S60 v3.2 +*/ +class MMusEngSessionObserver + { + + public: + + /** + * Indicates that incoming or outgoing session has been established. + * + * @since S60 v3.2 + */ + virtual void SessionEstablished() = 0; + + /** + * Indicates that session has been terminated. + * After this function call session object must deleted. + * Function is synchronous, use active object which actives + * delete. + * + * @since S60 v3.2 + */ + virtual void SessionTerminated() = 0; + + /** + * Current session has lost network connection. + * + * @since S60 v3.2 + */ + virtual void SessionConnectionLost() = 0; + + /** + * Undefined exception has occurred. Session is useless and must be + * deleted. Function is synchronous, use active object which actives + * delete. + * + * @since S60 v3.2 + */ + virtual void SessionFailed() = 0; + + /** + * Current stream state is changed to idle meaning that + * we are not sending or receiving RTP. + * + * @since S60 v3.2 + */ + virtual void StreamIdle() = 0; + + /** + * Current session state is changed to idle. + * + * @since S60 v3.2 + */ + virtual void StreamStreaming() = 0; + + /** + * Update time information of this session + * + * @since S60 v3.2 + */ + virtual void SessionTimeChanged( const TTimeIntervalSeconds& aSeconds ) = 0; + + /** + * RTCP inactivity timeout has occurred. + * + * @since S60 v3.2 + */ + virtual void InactivityTimeout() = 0; + }; + +#endif \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/musenginestub/inc/musengtelephoneutils.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/musenginestub/inc/musengtelephoneutils.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,203 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef MUSENGTELEPHONEUTILS_H +#define MUSENGTELEPHONEUTILS_H + + +#include "musunittesting.h" + +// SYSTEM +#include +#include +#include +#include + +// FORWARD DECLARATIONS +class CRepository; +class CTelephonyAudioRouting; +class CPhCltCommandHandler; +class MMusEngAudioRoutingObserver; + +/** +* Utility class to handle all phone related requests: +* Audio routing, volume control and microphone muting. +*/ +class CMusEngTelephoneUtils : public CActive, + public MTelephonyAudioRoutingObserver + { + MUS_UNITTEST( UT_CMusEngTelephoneUtils ) + MUS_UNITTEST( UT_CMusEngSession ) + + public: + + /** + * + */ + static CMusEngTelephoneUtils* NewL(); + + /** + * + */ + ~CMusEngTelephoneUtils(); + + + public: // API + + /** + * Checks if audio routing can be changed using LoudspeakerL + * + * @return ETrue if audio routing can be changed using LoudspeakerL + */ + TBool AudioRoutingCanBeChanged(); + + /** + * Changes the audio routing between loudspeaker and handset. + * + * @param aShowDialog if ETrue, user is notified about new audio routing + */ + void LoudspeakerL( TBool aEnable, TBool aShowDialog ); + + /** + * + */ + TBool IsLoudSpeakerEnabled() const; + + /** + * + */ + TInt GetVolumeL() const; + + /** + * + */ + void SetVolumeL( TInt aVolume ); + + /** + * Mutes CS call microphone. + */ + void MuteMicL( TBool aMute ); + + /** + * Returns current CS call mic mute state. + */ + TBool IsMicMutedL(); + + /** + * Sets audio routing observer. Can be set to NULL in order to indicate + * ending of observing changes in audio routing. + */ + void SetAudioRoutingObserver( MMusEngAudioRoutingObserver* aObserver ); + + + private: // inherited from CActive + + /** + * + */ + void RunL(); + + /** + * Cancels outstanding request to phone client + */ + void DoCancel(); + + + private: // MTelephonyAudioRoutingObserver functions + + /** + * Available outputs have changed + */ + void AvailableOutputsChanged( + CTelephonyAudioRouting& aTelephonyAudioRouting ); + + /** + * Some other application has changed audio output routing + */ + void OutputChanged( + CTelephonyAudioRouting& aTelephonyAudioRouting ); + + /** + * Our request to change audio output routing has completed + */ + void SetOutputComplete( + CTelephonyAudioRouting& aTelephonyAudioRouting, + TInt aError ); + + /** + * Set output if setting is currently allowed. Leaves with KErrAccessDenied + * if setting is not allowed. + */ + void DoSetOutputL( CTelephonyAudioRouting::TAudioOutput aAudioOutput ); + + private: + + /** + * Default C++ constructor + */ + CMusEngTelephoneUtils(); + + /** + * 2nd phase constructor + */ + void ConstructL(); + + + private: // HELPER + + /** + * Checks that volume value is between 1 and 10. + * + * @return validated volume value + */ + TInt ValidateVolume( const TInt aVolume ) const; + + + private: // DATA + + /** + * Stores the audio routing state at startup. + */ + CTelephonyAudioRouting::TAudioOutput iAudioOutputAtStartup; + + /** + * Telephony audio routing instance. Owned. + */ + CTelephonyAudioRouting* iTelephonyAudioRouting; + + /** + * Central repository. Owned. + */ + CRepository* iRepository; + + /** + * Command handler for muting the microphone + */ + CPhCltCommandHandler* iPhoneCommandHandler; + + /** + * Not owned. + */ + MMusEngAudioRoutingObserver* iAudioRoutingObserver; + + TBool iShowDialog; + + }; + + +#endif // MUSENGTELEPHONEUTILS_H \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/musenginestub/inc/musengtwowayrecvsession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/musenginestub/inc/musengtwowayrecvsession.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,151 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef MUSHENGTWOWAYRECVSESSION_H +#define MUSHENGTWOWAYRECVSESSION_H + +// USER +#include "musengreceivesession.h" +#include "musunittesting.h" +#include "mussettings.h" +#include "musengcamerahandler.h" + +// SYSTEM +#include + +// FORWARD DECLARATIONS +class MMusEngLiveSessionObserver; +class CMceDisplaySink; +class CMceStreamBundle; + +class CMusEngTwoWayRecvSession : public CMusEngReceiveSession + { + MUS_UNITTEST( UT_CMusEngTwoWayRecvSession ) + + + public: + /** + * Creates new MultimediaSharing two-way receive session. + * + * @param aRemoteRect UI drawing area for received video. + * @param aLocalRect UI drawing area for camera viewfinder. + * @param aSessionObserver Interface for session specific callbacks + * @param aReceiveSessionObserver Interface for receivesession specific callbacks + * @return CMusEngTwoWayRecvSession* New instanse of specified class + */ + IMPORT_C static CMusEngTwoWayRecvSession* NewL( + const TRect& aRemoteRect, + const TRect& aLocalRect, + MMusEngSessionObserver& aSessionObserver, + MMusEngReceiveSessionObserver& aReceiveSessionObserver ); + + + public: + + /** + * Destructor + */ + ~CMusEngTwoWayRecvSession(); + + public: + + void EnableDisplayL( TBool aEnable ); + + CMusEngMceSession::TDisplayOrientation OrientationL(); + + void SetOrientationL( TDisplayOrientation aOrientation ); + + public: + + /** + * Sets both remote (receiving video) and local (viewfinder) rects. + * + */ + IMPORT_C void SetRectsL( const TRect& aRemoteRect, + const TRect& aLocalRect ); + + /** + * Sets local rect (viewfinder). + * + */ + IMPORT_C void SetLocalRectL( const TRect& aLocalRect ); + + /** + * Gets local rect (viewfinder). + * + */ + IMPORT_C TRect LocalRect() const; + + /** + * Gets camera handler (can be used for zooming etc.) + */ + IMPORT_C TMusEngCameraHandler& Camera(); + + protected: // From CMusEngReceiveSession + + void CompleteSessionStructureL(); + + void RectChangedL(); + + + private: // from MMceStreamObserver, + // overrides the functions in ancestor classes + + + void StreamStateChanged( CMceMediaStream& aStream, + CMceMediaSink& aSink ); + + void StreamStateChanged( CMceMediaStream& aStream ); + + private: + + /** + * Constructor + */ + CMusEngTwoWayRecvSession( MMusEngSessionObserver& aSessionObserver, + MMusEngReceiveSessionObserver& aReceiveSessionObserver, + const TRect& aRemoteRect, + const TRect& aLocalRect ); + + /** + * Second-phase constructor + */ + void ConstructL(); + + private: + + void CompleteSessionStructureAudioPartL( + const RPointerArray& aStreams, + CMceStreamBundle& aLocalBundle, + CMceMediaStream* aVideoInStream, + CMceMediaStream* aVideoOutStream ); + + void CompleteSessionStructureInStreamL( CMceMediaStream& aVideoInStream, + CMceStreamBundle& aLocalBundle ); + + void CompleteSessionStructureOutStreamL( CMceMediaStream& aVideoOutStream ); + + private: + + TRect iLocalRect; + + TMusEngCameraHandler iCameraHandler; + }; + +#endif + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/musenginestub/inc/musengtwowaysession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/musenginestub/inc/musengtwowaysession.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,172 @@ +/* +* Copyright (c) 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: +* +*/ + + +#ifndef MUSHENGTWOWAYSESSION_H +#define MUSHENGTWOWAYSESSION_H + +// USER +#include "musenglivesession.h" +#include "musunittesting.h" +#include "mussettings.h" + +// SYSTEM +#include + +// FORWARD DECLARATIONS +class MMusEngLiveSessionObserver; +class CMceDisplaySink; +class MMusEngTwoWaySessionObserver; + +class CMusEngTwoWaySession : public CMusEngLiveSession + { + MUS_UNITTEST( UT_CMusEngOutSession ) + MUS_UNITTEST( UT_CMusEngTwoWaySession ) + + + public: + /** + * Creates new MultimediaSharing Live session. + * + * @param aRect UI drawing area. It is allowed handle from engine + * @param aSessionObserver Interface for session specific callbacks + * @param aOutSessionObserver Interface for outsession specific callbacks + * @param aLiveSessionObserver interface for live session specific + * callbacks + * @return CMusEngTwoWaySession* New instanse of specified class + */ + IMPORT_C static CMusEngTwoWaySession* NewL( + const TRect& aRemoteRect, + const TRect& aLocalRect, + MMusEngSessionObserver& aSessionObserver, + MMusEngOutSessionObserver& aOutSessionObserver, + MMusEngLiveSessionObserver& aLiveSessionObserver, + MMusEngTwoWaySessionObserver& aTwoWayObserver ); + + + public: + + /** + * Destructor + */ + ~CMusEngTwoWaySession(); + + public: + + void EnableDisplayL( TBool aEnable ); + + void SetOrientationL( TDisplayOrientation aOrientation ); + + public: + + /** + * Starts or pauses recording + */ + void RecordL( TBool aRecord ); + + /** + * Tells whether recording is paused or not + */ + TBool IsRecording(); + + /** + * Sets both remote (receiving video) and local (viewfinder) rects. + * + */ + IMPORT_C void SetRectsL( const TRect& aRemoteRect, + const TRect& aLocalRect ); + + /** + * Sets local rect (viewfinder). + * + */ + IMPORT_C void SetLocalRectL( const TRect& aLocalRect ); + + /** + * Gets local rect (viewfinder). + * + */ + IMPORT_C TRect LocalRect() const; + + protected: // inherited from CMusEngMceOutSession + + void RectChangedL(); + + /** + * @param aLocalBundle All local streams are supposed to be added to + * this bundle + */ + void CompleteSessionStructureL( CMceStreamBundle& aLocalBundle ); + + void AddDisplayL( CMceMediaStream& aStream ); + + + protected: // overrides ancestor class versions + + /** + * The state of the session has changed + * @param aSession, the session that has changed. + */ + virtual void HandleSessionStateChanged( CMceSession& aSession, + TInt aStatusCode, + const TDesC8& aReasonPhrase ); + + private: // from MMceStreamObserver, + // overrides the function in CMusEngMceSession + + void StreamStateChanged( CMceMediaStream& aStream ); + + void InactivityTimeout( CMceMediaStream& aStream, + CMceRtpSource& aSource ); + + private: + + /** + * Constructor + */ + CMusEngTwoWaySession( MMusEngSessionObserver& aSessionObserver, + MMusEngOutSessionObserver& aOutSessionObserver, + MMusEngLiveSessionObserver& aLiveSessionObserver, + MMusEngTwoWaySessionObserver& aTwoWayObserver, + const TRect& aRemoteRect, + const TRect& aLocalRect ); + + /** + * Second-phase constructor + */ + void ConstructL(); + + private: + + void ReceivingStarted(); + + void ReceivingStopped(); + + private: + + MMusEngTwoWaySessionObserver& iTwoWayObserver; + + TRect iLocalRect; + + TBool iReceiving; + + TBool iBuffered; + + }; + +#endif + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/musenginestub/inc/musengtwowaysessionobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/musenginestub/inc/musengtwowaysessionobserver.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,43 @@ +/* +* 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: +* +*/ + + +#ifndef MUSHENGTWOWAYSESSIONOBSERVER_H +#define MUSHENGTWOWAYSESSIONOBSERVER_H + + + +// CLASS DECLARATION + +/** +* An interface to be implemented by clients of Multimedia Sharing Engine if +* they wish to receive two-way sharing specific events. +*/ +class MMusEngTwoWaySessionObserver + { + + public: + + /** + * Indicates that video receiving state has changed + * @param aReceivingVideo, ETrue if receiving, EFalse if not receiving + */ + virtual void ReceivingStateChanged( TBool aReceivingVideo ) = 0; + + }; + +#endif \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/musenginestub/inc/musenguriparser.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/musenginestub/inc/musenguriparser.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,101 @@ +/* +* 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: Parser for recipient's address +* +*/ + + +#ifndef MUSENGURIPARSER_H +#define MUSENGURIPARSER_H + +// INCLUDES + +#include "musunittesting.h" +#include + +const TInt KMaxUriLength = 512; +_LIT8( KMusEngAtSign, "@" ); +_LIT8( KMusEngPlusSign, "+" ); +_LIT8( KMusEngSipPrefix, "sip:" ); +_LIT8( KMusEngTelPrefix, "tel:" ); + +// CLASS DECLARATION + +/** +* +*/ +class TMusEngUriParser + { + MUS_UNITTEST( UT_TMusEngUriParser ) + + public: + + enum TMusEngUriType + { + ENotParsed = 0, + ESip, + ETel + }; + + public: + + /** + * Default constructor + */ + IMPORT_C TMusEngUriParser( const TDesC16& aUri ); + + /** + * @returns Uri type + */ + IMPORT_C TMusEngUriType UriType(); + + /** + * @returns Parsed and validated 8-bit version of contained URI + * Ownership is transferred + * @pre UriType() != ENotParsed + * @leave KErrNotReady if precondition is not fulfilled + */ + IMPORT_C HBufC8* GetUri8L(); + + /** + * @param aPrefix if ETrue, also sip: or tel:prefix is returned + * @returns Parsed and validated 16-bit version of contained URI + * Ownership is transferred + * @pre UriType() != ENotParsed + * @leave KErrNotReady if precondition is not fulfilled + */ + IMPORT_C HBufC16* GetUri16L( TBool aPrefix ); + + /** + * Parses and validates contained URI + * @leave KErrCorrupt if URI is not valid SIP or TEL URI + * @post UriType() != ENotParsed + */ + IMPORT_C void ParseUriL(); + + + private: + + void HandleSipUriL(); + void HandleTelUriL(); + void HandleLocalTelUriL(); + + + TBuf8 iUri; + + TMusEngUriType iUriType; + + }; + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/musenginestub/inc/mussipprofilehandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/musenginestub/inc/mussipprofilehandler.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,215 @@ +/* +* 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: +* Version : %version: 1 % << Don't touch! Updated by Synergy at check-out. +* +*/ + + + +#ifndef MUSSIPPROFILEHANDLER_H +#define MUSSIPPROFILEHANDLER_H + + +// INTERNAL INCLUDE +#include "musunittesting.h" + +// SYSTEM INCLUDE +#include +#include +#include +#include +#include + + +class CSIPProfile; +class CSIPProfileRegistry; +class CSipProfileAlrController; +class CUri8; +class MMusSipProfileUser; + +/** +* +* @lib musengine.lib +*/ +class CMusSipProfileHandler : public CBase, + public MSIPProfileRegistryObserver, + public MSIPObserver, + public MSIPConnectionObserver, + public MSipProfileAlrObserver + { + MUS_UNITTEST( UT_CMusEngSipProfileHandler ) + + public: + + /** + * Creates new instance of CMusSipProfileHandler + * @param aSipProfileId profile id of requested profile + */ + static CMusSipProfileHandler* NewL( MMusSipProfileUser& aUser ); + + /** + * Destructor + * + */ + ~CMusSipProfileHandler(); + + + public: // API + + /** + * Creates the SIP profile used. + * @param aSipProfileId profile ID of requested SIP profile + */ + void CreateProfileL( TUint32 aSipProfileId ); + + /** + * Returns the used SIP profile. + * @pre SipProfileL has been called + * @return SIP profile or NULL if the SIP profile cannot be found, + * The ownership is not transferred. + */ + CSIPProfile* Profile(); + + /** + * Returns the registered public user identity of the used SIP profile + * @pre SipProfileL has been called + * @return a pointer to the URI, the ownership is transferred + */ + CUri8* UserFromProfileLC(); + + /** + * Refreshes the availabilities of the access points + * for the used SIP profile. + * Should be called when a MuS session terminates. + */ + void RefreshIapAvailabilities(); + + /** + * @return ETrue if SIP profile returned by Profile() is registered + */ + TBool IsRegistered(); + + + private: + + /** + * Constructor + */ + CMusSipProfileHandler( MMusSipProfileUser& aUser ); + + /** + * Second-phase constructor + */ + void ConstructL(); + + private: // From MSIPProfileRegistryObserver + + /** + * An event related to SIP Profile has accorred + * + * @param aProfileId a profile Id + * @param aEvent an occurred event + **/ + void ProfileRegistryEventOccurred( + TUint32 aProfileId, + MSIPProfileRegistryObserver::TEvent aEvent ); + + /** + * An asynchronous error has occurred related to SIP profile + * Event is send to those observers, who have the + * corresponding profile instantiated. + * + * @param aProfileId the id of failed profile + * @param aError an occurred error + */ + void ProfileRegistryErrorOccurred( + TUint32 aProfileId, + TInt aError ); + + private: // From MSIPObserver + + void IncomingRequest( TUint32 aIapId, + CSIPServerTransaction* aTransaction ); + + void TimedOut( CSIPServerTransaction& aTransaction ); + + private: // MSIPConnectionObserver must be implemented to enable SIP profile + + void IncomingRequest (CSIPServerTransaction* aTransaction ); + + void IncomingRequest (CSIPServerTransaction* aTransaction, + CSIPDialog& aDialog ); + + void IncomingResponse (CSIPClientTransaction& aTransaction ); + + void IncomingResponse ( CSIPClientTransaction& aTransaction, + CSIPDialogAssocBase& aDialogAssoc ); + + void IncomingResponse ( CSIPClientTransaction& aTransaction, + CSIPInviteDialogAssoc* aDialogAssoc ); + + void IncomingResponse( CSIPClientTransaction& aTransaction, + CSIPRegistrationBinding& aRegistration ); + + void ErrorOccured( TInt aError, CSIPTransactionBase& aTransaction ); + + void ErrorOccured( TInt aError, + CSIPClientTransaction& aTransaction, + CSIPRegistrationBinding& aRegistration ); + + void ErrorOccured( TInt aError, + CSIPTransactionBase& aTransaction, + CSIPDialogAssocBase& aDialogAssoc ); + + void ErrorOccured( TInt aError, CSIPRefresh& aSIPRefresh ); + + void ErrorOccured( TInt aError, + CSIPRegistrationBinding& aRegistration ); + + void ErrorOccured( TInt aError, CSIPDialogAssocBase& aDialogAssoc ); + + void InviteCompleted( CSIPClientTransaction& aTransaction ); + + void InviteCanceled( CSIPServerTransaction& aTransaction ); + + void ConnectionStateChanged( CSIPConnection::TState aState ); + + private: // From MSipProfileAlrObserver + + void AlrEvent( MSipProfileAlrObserver::TEvent aEvent, + TUint32 aProfileId, + TUint32 aSnapId, + TUint32 aIapId ); + + void AlrError( TInt aError, + TUint32 aProfileId, + TUint32 aSnapId, + TUint32 aIapId ); + + private: // New functions + + TUint32 ProfileId() const; + + private: // DATA + + MMusSipProfileUser& iUser; + CSIP* iSip; + CSIPProfileRegistry* iProfileRegistry; + CSipProfileAlrController* iProfileAlrController; + CSIPProfile* iSipProfile; + }; + + +#endif // MUSSIPPROFILEHANDLER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/musenginestub/inc/mussipprofileuser.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/musenginestub/inc/mussipprofileuser.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,48 @@ +/* +* 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 MUSSIPPROFILEUSER_H +#define MUSSIPPROFILEUSER_H + +// SYSTEM INCLUDE +#include + +/** +* Callbacks for asking permission to roam between access points +* and notifying client about registering event +* @lib musengine.lib +*/ +class MMusSipProfileUser + { + public: + + /** + * Checks whether roaming between access points is allowed. + * @return ETrue is roaming is allowed, otherwise EFalse. + */ + virtual TBool IsRoamingBetweenAPsAllowed() = 0; + + /** + * Indicates that SIP profile has been registered. + */ + virtual void ProfileRegistered() = 0; + + }; + + +#endif // MUSSIPPROFILEUSER_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/musenginestub/src/musengcamerahandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/musenginestub/src/musengcamerahandler.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,703 @@ +/* +* Copyright (c) 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: +* +*/ + + +// USER +#include "musengcamerahandler.h" +#include "musunittesting.h" +#include "musengmceutils.h" +#include "musenglogger.h" + +// SYSTEM +#include +#include +#include +#include +#include +#include +#include + +const TInt KMaxBrightness = 100; +const TInt KMinBrightness = -100; +const TInt KBrightnessStepSize = 10; + + +//Number of big and small zoom steps on Zoom scale +const TInt KZoomBigStepCount = 15; +const TInt KZoomSmallStepCount = KZoomBigStepCount*2; +const TInt KZoomStepMinSize = 1; + +const TInt64 KZoomFasterTime = 333333; // 1/3 second +const TInt KOneCameraOnly = 1; + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TMusEngCameraHandler::TMusEngCameraHandler() : + iSession( NULL ), + iDefaultZoomFactor( -1 ), + iDefaultBrightness( 0 ), + iZoomInTime(0), + iZoomOutTime(0), + iSmallZoomStep( KZoomStepMinSize ), + iBigZoomStep( KZoomStepMinSize ), + iCameraUsage( MusSettingsKeys::EUseCameraSwapping ) + { + + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void TMusEngCameraHandler::SetSession( CMceSession* aSession ) + { + iSession = aSession; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void TMusEngCameraHandler::InitializeL( CMceCameraSource& aCamera ) + { + aCamera.GetCameraInfo( iCameraInfo ); + iDefaultZoomFactor = aCamera.ZoomFactorL(); + + InitializeZoomStepSize(); + + iCurrentCamera = EBackCamera; + if ( iCameraUsage == MusSettingsKeys::EUseOnlySecondaryCamera ) + { + iCurrentCamera = EFrontCamera; + } + aCamera.SetCameraIndexL( (TInt)iCurrentCamera ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void TMusEngCameraHandler::PlayL() + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::PlayL()" ) + + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + CMceCameraSource* camera = MusEngMceUtils::GetCameraL( *iSession ); + + if ( !camera->IsEnabled() ) + { + camera->EnableL(); + } + else + { + MUS_LOG( "mus: [ENGINE] Camera already enabled, ignore request" ) + } + + MUS_LOG( "mus: [ENGINE] <- TMusEngCameraHandler::PlayL()" ) + } + + +// ----------------------------------------------------------------------------- +// Disable camera if not already disabled +// ----------------------------------------------------------------------------- +// +EXPORT_C void TMusEngCameraHandler::PauseL() + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::PauseL()" ) + + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + CMceCameraSource* camera = MusEngMceUtils::GetCameraL( *iSession ); + + if ( camera->IsEnabled() ) + { + camera->DisableL(); + } + else + { + MUS_LOG( "mus: [ENGINE] Camera already disabled, ignore request" ) + } + + MUS_LOG( "mus: [ENGINE] <- TMusEngCameraHandler::PauseL()" ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool TMusEngCameraHandler::IsPlayingL() + { + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + return ( MusEngMceUtils::GetCameraL( *iSession )->IsEnabled() ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt TMusEngCameraHandler::CamerasAvailableL( + TCurrentCamera& aCurrentCamera ) + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::CamerasAvailableL()" ) + __ASSERT_ALWAYS( iSession != NULL, User::Leave( KErrNotReady ) ); + + CMceCameraSource* camera = MusEngMceUtils::GetCameraL( *iSession ); + __ASSERT_ALWAYS( camera != NULL, User::Leave( KErrNotReady ) ); + aCurrentCamera = iCurrentCamera; + TInt camerasAvailable = camera->CamerasAvailable(); + + if ( camerasAvailable > KOneCameraOnly && + iCameraUsage != MusSettingsKeys::EUseCameraSwapping ) + { + camerasAvailable = KOneCameraOnly; + } + + MUS_LOG( "mus: [ENGINE] <- TMusEngCameraHandler::CamerasAvailable()" ) + return camerasAvailable; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void TMusEngCameraHandler::ChangeCameraL( TCurrentCamera aCurrentCamera ) + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::ChangeCameraL()" ) + __ASSERT_ALWAYS( iSession != NULL, User::Leave( KErrNotReady ) ); + + CMceCameraSource* camera = MusEngMceUtils::GetCameraL( *iSession ); + CMceDisplaySink* display = MusEngMceUtils::GetDisplayL( *iSession ); + + if ( camera->CamerasAvailable() ) + { + if ( TMusEngCameraHandler::EFrontCamera == aCurrentCamera && + TMusEngCameraHandler::EFrontCamera != iCurrentCamera ) + { + MUS_LOG( "mus: [ENGINE] Set Front camera" ) + iCurrentCamera = TMusEngCameraHandler::EFrontCamera; + ChangeActiveCameraL( iCurrentCamera ); + } + else if ( TMusEngCameraHandler::EBackCamera == aCurrentCamera && + TMusEngCameraHandler::EBackCamera != iCurrentCamera ) + { + MUS_LOG( "mus: [ENGINE] Set Back camera " ) + iCurrentCamera = TMusEngCameraHandler::EBackCamera; + ChangeActiveCameraL( iCurrentCamera );; + } + else if ( TMusEngCameraHandler::ENextCamera == aCurrentCamera ) + { + if ( iCurrentCamera == TMusEngCameraHandler::EBackCamera ) + { + iCurrentCamera = TMusEngCameraHandler::EFrontCamera; + } + else + { + iCurrentCamera = TMusEngCameraHandler::EBackCamera; + } + ChangeActiveCameraL( iCurrentCamera ); + } + } + MUS_LOG( "mus: [ENGINE] <- TMusEngCameraHandler::ChangeCameraL()" ) + } +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt TMusEngCameraHandler::CurrentZoomL() const + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::CurrentZoomL()" ) + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + CMceCameraSource* camera = MusEngMceUtils::GetCameraL( *iSession ); + + TInt currentZoom = camera->ZoomFactorL() + camera->DigitalZoomFactorL(); + + MUS_LOG1( "mus: [ENGINE] <- TMusEngCameraHandler::CurrentZoomL( %d )", + currentZoom ) + + return currentZoom; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void TMusEngCameraHandler::SetZoomL( TInt aNewZoomFactor ) + { + MUS_LOG1( "mus: [ENGINE] -> TMusEngCameraHandler::SetZoomL( %d )", + aNewZoomFactor ) + + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + __ASSERT_ALWAYS( aNewZoomFactor <= MaxZoomL() && + aNewZoomFactor >= MinZoomL(), + User::Leave( KErrArgument ) ); + + CMceCameraSource* camera = MusEngMceUtils::GetCameraL( *iSession ); + + if ( aNewZoomFactor <= iCameraInfo.iMaxZoom ) + { + MUS_LOG( "mus: [ENGINE] Optical zoom factor increased" ) + camera->SetZoomFactorL( aNewZoomFactor ); + } + + if ( aNewZoomFactor - iCameraInfo.iMaxZoom > 0 ) + { + camera->SetDigitalZoomFactorL( aNewZoomFactor - iCameraInfo.iMaxZoom ); + MUS_LOG1( "mus: [ENGINE] Digital zoom factor increased to %d", + aNewZoomFactor - iCameraInfo.iMaxZoom ) + } + + MUS_LOG( "mus: [ENGINE] <- TMusEngCameraHandler::SetZoomL()" ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt TMusEngCameraHandler::MinZoomL() const + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::MinZoomL()" ) + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + // Although we do not need camera for return value, we have to have it in + // order to have proper iCameraInfo + MusEngMceUtils::GetCameraL( *iSession ); + + MUS_LOG1( "mus: [ENGINE] <- TMusEngCameraHandler::MinZoomL( %d )", + iCameraInfo.iMinZoom ) + + return iCameraInfo.iMinZoom; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt TMusEngCameraHandler::MaxZoomL() const + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::MaxZoomL()" ) + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + // Although we do not need camera for return value, we have to have it in + // order to have proper iCameraInfo + MusEngMceUtils::GetCameraL( *iSession ); + + TInt maxZoom = iCameraInfo.iMaxZoom + iCameraInfo.iMaxDigitalZoom; + + MUS_LOG1( "mus: [ENGINE] Max optical zoom( %d )", + iCameraInfo.iMaxZoom ) + MUS_LOG1( "mus: [ENGINE] Max digital zoom( %d )", + iCameraInfo.iMaxDigitalZoom ) + MUS_LOG1( "mus: [ENGINE] <- TMusEngCameraHandler::MaxZoomL( %d )", + maxZoom ) + + return maxZoom; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void TMusEngCameraHandler::ZoomInL() + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::ZoomInL()" ) + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + CMceCameraSource* camera = MusEngMceUtils::GetCameraL( *iSession ); + + // First try to increase optical zoom factor. If in maximum value, try to + // increase digital zoom factor. + TInt stepSize = ZoomStepSize( iZoomInTime ); + TInt zoomFactor = camera->ZoomFactorL(); + TInt zoomDigitalFactor = camera->DigitalZoomFactorL(); + + //increate optical zoom factor + if ( zoomFactor + stepSize <= iCameraInfo.iMaxZoom ) + { + //optical zoom factor is enough + camera->SetZoomFactorL( zoomFactor + stepSize ); + stepSize = 0; + } + else if (zoomFactor < iCameraInfo.iMaxZoom) + { + stepSize -= iCameraInfo.iMaxZoom - zoomFactor; + camera->SetZoomFactorL( iCameraInfo.iMaxZoom ); + } + + //increate digital zoom factor + if (stepSize > 0) + { + if ( zoomDigitalFactor + stepSize <= iCameraInfo.iMaxDigitalZoom ) + { + camera->SetDigitalZoomFactorL( zoomDigitalFactor + stepSize ); + } + else + { + camera->SetDigitalZoomFactorL( iCameraInfo.iMaxDigitalZoom ); + MUS_LOG( "mus: [ENGINE] TMusEngCameraHandler::ZoomInL(): Optical \ + and digital zoom factors are in maximum value" ) + } + } + + MUS_LOG( "mus: [ENGINE] <- TMusEngCameraHandler::ZoomInL()" ) + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void TMusEngCameraHandler::ZoomOutL() + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::ZoomOutL()" ) + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + CMceCameraSource* camera = MusEngMceUtils::GetCameraL( *iSession ); + + // First try to decrease digital zoom factor. If already zero, try to + // decrease optical zoom factor. + TInt stepSize = ZoomStepSize( iZoomOutTime ); + TInt zoomFactor = camera->ZoomFactorL(); + TInt zoomDigitalFactor = camera->DigitalZoomFactorL(); + + //decreate digital zoom factor firstly + if ( zoomDigitalFactor - stepSize >= 0 ) + { + //digital zoom factor is enough + camera->SetDigitalZoomFactorL( zoomDigitalFactor - stepSize ); + stepSize = 0; + } + else if ( zoomDigitalFactor > 0 ) + { + stepSize -= zoomDigitalFactor; + camera->SetDigitalZoomFactorL( 0 ); + MUS_LOG("mus: [ENGINE] Digigal Factor to zero") + } + + //decreate optical zoom factor firstly + if ( stepSize > 0 ) + { + if ( zoomFactor - stepSize > iCameraInfo.iMinZoom ) + { + camera->SetZoomFactorL( zoomFactor - stepSize ); + } + else + { + MUS_LOG( "mus: [ENGINE] TMusEngCameraHandler::ZoomOutL(): Optical and \ + digital zoom factors are in minimum value" ) + camera->SetZoomFactorL( iCameraInfo.iMinZoom ); + } + } + + MUS_LOG( "mus: [ENGINE] <- TMusEngCameraHandler::ZoomOutL()" ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void TMusEngCameraHandler::ZoomDefaultL() + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::ZoomDefaultL()" ) + + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + CMceCameraSource* camera = MusEngMceUtils::GetCameraL( *iSession ); + + camera->SetZoomFactorL( iDefaultZoomFactor ); + camera->SetDigitalZoomFactorL( 0 ); + + MUS_LOG( "mus: [ENGINE] <- TMusEngCameraHandler::ZoomDefaultL()" ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void TMusEngCameraHandler::SetBrightnessL( TInt aBrightness ) const + { + MUS_LOG1( "mus: [ENGINE] -> TMusEngCameraHandler::SetBrightnessL( %d )", + aBrightness ) + + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + CMceCameraSource* camera = MusEngMceUtils::GetCameraL( *iSession ); + camera->SetBrightnessL( aBrightness ); + + MUS_LOG( "mus: [ENGINE] <- TMusEngCameraHandler::SetBrightnessL()" ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt TMusEngCameraHandler::CurrentBrightnessL() const + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::CurrentBrightnessL()" ) + + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + CMceCameraSource* camera = MusEngMceUtils::GetCameraL( *iSession ); + TInt currentBrightness = camera->BrightnessL(); + + MUS_LOG1( "mus: [ENGINE] <- TMusEngCameraHandler::CurrentBrightnessL(): %d", + currentBrightness ) + + return currentBrightness; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt TMusEngCameraHandler::MaxBrightnessL() const + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::MaxBrightnessL()" ) + + // maximum brightness is not in camera info, but a constant 100 + + MUS_LOG1( "mus: [ENGINE] <- TMusEngCameraHandler::MaxBrightnessL(): %d", + KMaxBrightness ) + + return KMaxBrightness; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt TMusEngCameraHandler::MinBrightnessL() const + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::MinBrightnessL()" ) + + // maximum brightness is not in camera info, but a constant -100 + + MUS_LOG1( "mus: [ENGINE] <- TMusEngCameraHandler::MinBrightnessL(): %d", + KMinBrightness ) + + return KMinBrightness; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void TMusEngCameraHandler::IncreaseBrightnessL() + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::IncreaseBrightnessL()" ) + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + CMceCameraSource* camera = MusEngMceUtils::GetCameraL( *iSession ); + + TInt newBrightness = camera->BrightnessL() + KBrightnessStepSize; + + if ( newBrightness < KMaxBrightness ) + { + camera->SetBrightnessL( newBrightness ); + } + else + { + camera->SetBrightnessL( KMaxBrightness ); + } + + MUS_LOG( "mus: [ENGINE] <- TMusEngCameraHandler::IncreaseBrightnessL()" ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void TMusEngCameraHandler::DecreaseBrightnessL() + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::DecreaseBrightnessL()" ) + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + CMceCameraSource* camera = MusEngMceUtils::GetCameraL( *iSession ); + + TInt newBrightness = camera->BrightnessL() - KBrightnessStepSize; + + if ( newBrightness > KMinBrightness ) + { + camera->SetBrightnessL( newBrightness ); + } + else + { + camera->SetBrightnessL( KMinBrightness ); + } + + MUS_LOG( "mus: [ENGINE] <- TMusEngCameraHandler::DecreaseBrightnessL()" ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void TMusEngCameraHandler::BrightnessDefaultL() + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::BrightnessDefaultL()" ) + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + CMceCameraSource* camera = MusEngMceUtils::GetCameraL( *iSession ); + + camera->SetBrightnessL( iDefaultBrightness ); + + MUS_LOG( "mus: [ENGINE] <- TMusEngCameraHandler::BrightnessDefaultL()" ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void TMusEngCameraHandler::BrightnessAutoL() + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::BrightnessAutoL()" ) + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + CMceCameraSource* camera = MusEngMceUtils::GetCameraL( *iSession ); + + camera->SetBrightnessL( CCamera::EBrightnessAuto ); + + MUS_LOG( "mus: [ENGINE] <- TMusEngCameraHandler::BrightnessAutoL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void TMusEngCameraHandler::InitializeZoomStepSize() + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::InitializeZoomStepSize()" ) + MUS_LOG2( "iMaxZoom = %d, iMinZoom = %d", iCameraInfo.iMaxZoom, iCameraInfo.iMinZoom); + MUS_LOG2( "iMaxDigitalZoom = %d, iMaxDigitalZoomFactor = %d", + iCameraInfo.iMaxDigitalZoom, iCameraInfo.iMaxDigitalZoomFactor); + + iBigZoomStep = ( iCameraInfo.iMaxZoom + iCameraInfo.iMaxDigitalZoom - + iCameraInfo.iMinZoom ) / KZoomBigStepCount; + + if ( iBigZoomStep < KZoomStepMinSize ) + iBigZoomStep = KZoomStepMinSize; + + iSmallZoomStep = ( iCameraInfo.iMaxZoom + iCameraInfo.iMaxDigitalZoom - + iCameraInfo.iMinZoom ) / KZoomSmallStepCount; + + if ( iSmallZoomStep < KZoomStepMinSize ) + iSmallZoomStep = KZoomStepMinSize; + + MUS_LOG2( "mus: [ENGINE] iSmallZoomStep = %d, iBigZoomStep = %d", + iSmallZoomStep, iBigZoomStep ) + MUS_LOG( "mus: [ENGINE] <- TMusEngCameraHandler::InitializeZoomStepSize()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void TMusEngCameraHandler::ReadCameraUsageKeyL() + { + MUS_LOG( "mus: [ENGINE] -> TMusEngCameraHandler::ReadCameraUsageKeyL()" ) + + // We try to read camera usage. If we do not succeed, we use default + iCameraUsage = MusSettingsKeys::EUseCameraSwapping; + TRAPD( error, + iCameraUsage = MultimediaSharingSettings::CameraUsageL() ) + __ASSERT_ALWAYS( error == KErrNone || error == KErrNotFound, + User::Leave( error ) ); + + MUS_LOG( "mus: [ENGINE] <- TMusEngCameraHandler::ReadCameraUsageKeyL()" ) + + } + +// ----------------------------------------------------------------------------- +// Calculate the zoom step based time escaped +// ----------------------------------------------------------------------------- +TInt TMusEngCameraHandler::ZoomStepSize( TInt64& aTime ) + { + TTime now; + now.HomeTime(); + TInt64 timeNow = now.Int64(); + TInt stepSize = ( ( timeNow - aTime ) <= KZoomFasterTime ) ? iBigZoomStep : iSmallZoomStep; + + aTime = now.Int64(); + + MUS_LOG1( "mus: [ENGINE] stepSize = %d", stepSize ); + + return stepSize; + } + +// ----------------------------------------------------------------------------- +// Disable camera before it changes it. It enables camera after change. +// ----------------------------------------------------------------------------- +void TMusEngCameraHandler::ChangeActiveCameraL( TCurrentCamera aNewCamera ) + { + MUS_LOG( "mus: [ENGINE] -> ChangeActiveCamera()" ) + + CMceCameraSource* camera = MusEngMceUtils::GetCameraL( *iSession ); + CMceDisplaySink* display = MusEngMceUtils::GetDisplayL( *iSession ); + MUS_LOG( "mus: [ENGINE] Camera enabled ?" ) + if ( camera->IsEnabled() ) + { + MUS_LOG( "mus: [ENGINE] Is view finder enabled? " ) + if ( display->IsEnabled() ) + { + MUS_LOG( "mus: [ENGINE] Disable view finder" ) + display->DisableL(); + } + MUS_LOG( "mus: [ENGINE] Disable camera" ) + camera->DisableL(); + camera->SetCameraIndexL( aNewCamera ); + camera->EnableL(); + display->EnableL(); + } + else + { + if ( display->IsEnabled() ) + { + MUS_LOG( "mus: [ENGINE] Disable view finder" ) + display->DisableL(); + } + MUS_LOG( "mus: [ENGINE] set camera index" ) + camera->SetCameraIndexL( aNewCamera ); + MUS_LOG( "mus: [ENGINE] Enable camera" ) + display->EnableL(); + } + + MUS_LOG( "mus: [ENGINE] -> fetching new iCameraInfo..." ) + camera->GetCameraInfo( iCameraInfo ); + iDefaultZoomFactor = camera->ZoomFactorL(); + InitializeZoomStepSize(); + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/musenginestub/src/musengclipsession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/musenginestub/src/musengclipsession.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,67 @@ +/* +* Copyright (c) 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: +* +*/ + + +// USER +#include "musengclipsession.h" + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngClipSession* CMusEngClipSession::NewL( + const TRect& aRect ) + { + CMusEngClipSession* self = new( ELeave ) CMusEngClipSession( aRect ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngClipSession::~CMusEngClipSession() + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngClipSession::CMusEngClipSession( const TRect& aRect ) + : CMusEngMceOutSession( aRect ) + { + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngClipSession::ConstructL() + { + CMusEngMceOutSession::ConstructL(); + } + + +// End of file + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/musenginestub/src/musenginepluginentry.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/musenginestub/src/musenginepluginentry.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,42 @@ +/* +* 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 "musengsessionmanager.h" +#include +#include + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +const TImplementationProxy KMusEnginePluginImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( 0x20021341, CMusEngSessionManager::NewL ) + }; + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount ) + { + aTableCount = sizeof( KMusEnginePluginImplementationTable ) / + sizeof( TImplementationProxy ); + + return KMusEnginePluginImplementationTable; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/musenginestub/src/musenglivesession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/musenginestub/src/musenglivesession.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,425 @@ +/* +* Copyright (c) 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: +* +*/ + + +// USER +#include "musenglivesession.h" +#include "musengsessionobserver.h" +#include "musenglivesessionobserver.h" +#include "musunittesting.h" +#include "musengmceutils.h" +#include "musenglogger.h" +#include "mussessionproperties.h" + +// SYSTEM +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +// Names of AVC levels in string for config keys stored in CenRep +_LIT8( KMusAvcBitrateLevel1, "AvcBrL1=" ); +_LIT8( KMusAvcBitrateLevel1b, "AvcBrL1b=" ); +_LIT8( KMusAvcBitrateLevel1_1, "AvcBrL1_1=" ); +_LIT8( KMusAvcBitrateLevel1_2, "AvcBrL1_2=" ); +_LIT8( KMusAvcBitrateLevel1_3, "AvcBrL1_3=" ); +_LIT8( KMusAvcBitrateLevel2, "AvcBrL2=" ); + +_LIT8( KMusEncoderInfoTokenizer, ";" ); + + +const TInt KMaxDispName = 512; + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngLiveSession* CMusEngLiveSession::NewL( + const TDesC& aFileName, + const TRect& aRect ) + { + CMusEngLiveSession* self = new( ELeave ) CMusEngLiveSession( aRect, + aFileName ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngLiveSession* CMusEngLiveSession::NewL( + const TRect& aRect ) + { + CMusEngLiveSession* self = new( ELeave ) CMusEngLiveSession( aRect ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngLiveSession::~CMusEngLiveSession() + { + delete iRemoteDisplayName; + } + + + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +void CMusEngLiveSession::EstablishLcSessionL() + { + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +MLcVideoPlayer* CMusEngLiveSession::LocalVideoPlayer() + { + return this; + } + + + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// + +const TDesC& CMusEngLiveSession::RemoteDisplayName() + { + return *iRemoteDisplayName; + } + + + + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcVideoPlayer::TLcVideoPlayerState CMusEngLiveSession::LcVideoPlayerState() const + { + TLcVideoPlayerState vidPlayerState = MLcVideoPlayer::EUnavailable; + return vidPlayerState; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +TBool CMusEngLiveSession::LcIsPlayingL() + { + return iPlaying; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +void CMusEngLiveSession::LcPlayL() + { + iPlaying = ETrue; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +void CMusEngLiveSession::LcPauseL() + { + iPlaying = EFalse; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcWindow* CMusEngLiveSession::LcWindow() + { + return this; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcCameraControl* CMusEngLiveSession::LcCameraControl() + { + return this; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcFileControl* CMusEngLiveSession::LcSourceFile() + { + return NULL; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcFileControl* CMusEngLiveSession::LcDestinationFile() + { + return this; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcAudioControl* CMusEngLiveSession::LcAudioControl() + { + return this; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcZoomControl* CMusEngLiveSession::LcZoomControl() + { + return this; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcBrightnessControl* CMusEngLiveSession::LcBrightnessControl() + { + return this; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +RPointerArray< MLcValueControl >& CMusEngLiveSession::LcExtensionControls() + { + return iValueControls; + } + +// ----------------------------------------------------------------------------- +// From MLcCameraControl +// ----------------------------------------------------------------------------- +// +TInt CMusEngLiveSession::LcCameraCountL() + { + return 1; + } + +// ----------------------------------------------------------------------------- +// From MLcCameraControl +// ----------------------------------------------------------------------------- +// +void CMusEngLiveSession::ToggleLcCameraL() + { + } + +// ----------------------------------------------------------------------------- +// From MLcBrightnessControl +// ----------------------------------------------------------------------------- +// +TInt CMusEngLiveSession::MinLcBrightnessL() + { + return iCurrentBrighness; + } + +// ----------------------------------------------------------------------------- +// From MLcBrightnessControl +// ----------------------------------------------------------------------------- +// +TInt CMusEngLiveSession::MaxLcBrightnessL() + { + return iCurrentBrighness; + } + +// ----------------------------------------------------------------------------- +// From MLcBrightnessControl +// ----------------------------------------------------------------------------- +// +TInt CMusEngLiveSession::LcBrightnessL() + { + return iCurrentBrighness; + } + +// ----------------------------------------------------------------------------- +// From MLcBrightnessControl +// ----------------------------------------------------------------------------- +// +void CMusEngLiveSession::SetLcBrightnessL( TInt aValue ) + { + iCurrentBrighness = aValue; + } + +// ----------------------------------------------------------------------------- +// From MLcBrightnessControl +// ----------------------------------------------------------------------------- +// +void CMusEngLiveSession::IncreaseLcBrightnessL() + { + iCurrentBrighness++; + } + +// ----------------------------------------------------------------------------- +// From MLcBrightnessControl +// ----------------------------------------------------------------------------- +// +void CMusEngLiveSession::DecreaseLcBrightnessL() + { + iCurrentBrighness--; + } + +// ----------------------------------------------------------------------------- +// From MLcZoomControl +// ----------------------------------------------------------------------------- +// +TInt CMusEngLiveSession::MinLcZoomL() + { + return iCurrentZoom; + } + +// ----------------------------------------------------------------------------- +// From MLcZoomControl +// ----------------------------------------------------------------------------- +// +TInt CMusEngLiveSession::MaxLcZoomL() + { + return iCurrentZoom; + } + +// ----------------------------------------------------------------------------- +// From MLcZoomControl +// ----------------------------------------------------------------------------- +// +TInt CMusEngLiveSession::LcZoomValueL() + { + return iCurrentZoom; + } + +// ----------------------------------------------------------------------------- +// From MLcZoomControl +// ----------------------------------------------------------------------------- +// +void CMusEngLiveSession::SetLcZoomValueL( TInt aValue ) + { + iCurrentZoom = aValue; + } + +// ----------------------------------------------------------------------------- +// From MLcZoomControl +// ----------------------------------------------------------------------------- +// +void CMusEngLiveSession::LcZoomInL() + { + iCurrentZoom++; + } + +// ----------------------------------------------------------------------------- +// From MLcZoomControl +// ----------------------------------------------------------------------------- +// +void CMusEngLiveSession::LcZoomOutL() + { + iCurrentZoom--; + } + +// ----------------------------------------------------------------------------- +// From MLcFileControl +// ----------------------------------------------------------------------------- +// +void CMusEngLiveSession::EnableLcFileL( TBool aEnable ) + { + iFileEnabled = aEnable; + } + +// ----------------------------------------------------------------------------- +// From MLcFileControl +// ----------------------------------------------------------------------------- +// +TBool CMusEngLiveSession::IsLcFileEnabled() + { + return iFileEnabled; + } + +// ----------------------------------------------------------------------------- +// From MLcFileControl +// ----------------------------------------------------------------------------- +// +void CMusEngLiveSession::SetLcFileNameL( const TFileName& aFileName ) + { + iRecordedFile = aFileName; + } + +// ----------------------------------------------------------------------------- +// From MLcFileControl +// ----------------------------------------------------------------------------- +// +TFileName& CMusEngLiveSession::LcFileName() + { + return iRecordedFile; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngLiveSession::CMusEngLiveSession( + const TRect& aRect, + const TDesC& aRecordedFile ) + : CMusEngMceOutSession( aRect ), + iRecordedFile( aRecordedFile ) + { + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngLiveSession::ConstructL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngLiveSession::ConstructL()" ) + + CMusEngMceOutSession::ConstructL(); + + iRemoteDisplayName = HBufC::NewL( KMaxDispName ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngLiveSession::ConstructL()" ) + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/musenginestub/src/musengmceoutsession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/musenginestub/src/musengmceoutsession.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,49 @@ +/* +* Copyright (c) 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: +* +*/ + + +// USER +#include "musengmceoutsession.h" + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngMceOutSession::~CMusEngMceOutSession() + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngMceOutSession::CMusEngMceOutSession( + const TRect& aRect) + : CMusEngMceSession( aRect ) + { + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceOutSession::ConstructL() + { + } + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/musenginestub/src/musengmcesession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/musenginestub/src/musengmcesession.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,302 @@ +/* +* Copyright (c) 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: +* +*/ + + +// USER +#include "musengmcesession.h" + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngMceSession::CMusEngMceSession( const TRect& aRect ) + : iRect ( aRect ) + { + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::ConstructL() + { + CMusEngSession::ConstructL(); // Base class ConstructL -first + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngMceSession::~CMusEngMceSession() + { + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// + +MLcSession::TLcSessionState CMusEngMceSession::LcSessionState() const + { + TLcSessionState lcSessionState = MLcSession::EUninitialized; + return lcSessionState; + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::EstablishLcSessionL() + { + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::TerminateLcSessionL() + { + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +MLcVideoPlayer* CMusEngMceSession::RemoteVideoPlayer() + { + return NULL; + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +MLcVideoPlayer* CMusEngMceSession::LocalVideoPlayer() + { + return NULL; + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +const TDesC& CMusEngMceSession::LocalDisplayName() + { + return KNullDesC; + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +const TDesC& CMusEngMceSession::RemoteDisplayName() + { + return KNullDesC; + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +TInt CMusEngMceSession::SetParameter( TInt /*aId*/, TInt /*aValue*/ ) + { + return KErrNotSupported; + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +TInt CMusEngMceSession::ParameterValue( TInt /*aId*/ ) + { + return KErrNotSupported; + } + +// ----------------------------------------------------------------------------- +// From MLcWindow +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::EnableLcWindowL( TBool aEnable ) + { + iWindowEnabled = aEnable; + } + +// ----------------------------------------------------------------------------- +// From MLcWindow +// ----------------------------------------------------------------------------- +// +TBool CMusEngMceSession::IsLcWindowEnabled() + { + return iWindowEnabled; + } + +// ----------------------------------------------------------------------------- +// From MLcWindow +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::SetLcWindowRectL( TRect aRect ) + { + iRect = aRect; + } + + +// ----------------------------------------------------------------------------- +// From MLcWindow +// ----------------------------------------------------------------------------- +// +TRect CMusEngMceSession::LcWindowRect() + { + return iRect; + } + +// ----------------------------------------------------------------------------- +// From MLcWindow +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::SetLcWindowOrientationL( + TLcWindowOrientation aOrientation ) + { + iOrientation = aOrientation; + } + +// ----------------------------------------------------------------------------- +// From MLcWindow +// ----------------------------------------------------------------------------- +// +MLcWindow::TLcWindowOrientation CMusEngMceSession::LcWindowOrientationL() + { + MLcWindow::TLcWindowOrientation orientation; + if ( iOrientation == ELandscape ) + { + orientation = MLcWindow::ELandscape; + } + else + { + orientation = MLcWindow::EPortrait; + } + return orientation; + } + +// ----------------------------------------------------------------------------- +// From MLcAudioControl +// ----------------------------------------------------------------------------- +// +TBool CMusEngMceSession::IsLcAudioMutedL() + { + return iMuted; + } + +// ----------------------------------------------------------------------------- +// From MLcAudioControl +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::MuteLcAudioL( TBool aMute ) + { + iMuted = aMute; + } + +// ----------------------------------------------------------------------------- +// From MLcAudioControl +// ----------------------------------------------------------------------------- +// +TBool CMusEngMceSession::IsEnablingLcLoudspeakerAllowed() + { + return iEnablingLoudspeakerAllowed; + } + +// ----------------------------------------------------------------------------- +// From MLcAudioControl +// ----------------------------------------------------------------------------- +// +TBool CMusEngMceSession::IsLcMicMutedL() + { + return iMicMuted; + } + +// ----------------------------------------------------------------------------- +// From MLcAudioControl +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::MuteLcMicL( TBool aMute ) + { + iMicMuted = aMute; + } + +// ----------------------------------------------------------------------------- +// From MLcAudioControl +// ----------------------------------------------------------------------------- +// +TBool CMusEngMceSession::IsLcLoudspeakerEnabled() + { + return iLoudspeakerEnabled; + } + +// ----------------------------------------------------------------------------- +// From MLcAudioControl +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::EnableLcLoudspeakerL( TBool aEnabled ) + { + iLoudspeakerEnabled = aEnabled; + } + +// ----------------------------------------------------------------------------- +// From MLcAudioControl +// ----------------------------------------------------------------------------- +// +TInt CMusEngMceSession::LcVolumeL() + { + return iVolume; + } + +// ----------------------------------------------------------------------------- +// From MLcAudioControl +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::SetLcVolumeL( TInt aValue ) + { + iVolume = aValue; + } + +// ----------------------------------------------------------------------------- +// From MLcAudioControl +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::IncreaseLcVolumeL() + { + iVolume++; + } + +// ----------------------------------------------------------------------------- +// From MLcAudioControl +// ----------------------------------------------------------------------------- +// +void CMusEngMceSession::DecreaseLcVolumeL() + { + iVolume--; + } + +void CMusEngMceSession::UpdateLcSessionL() + { + } + + + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/musenginestub/src/musengmceutils.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/musenginestub/src/musengmceutils.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,571 @@ +/* +* 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: Utilities to get and set profile used with SWIS. +* +*/ + + + +// USER + +#include "musengmceutils.h" +#include "muslogger.h" + +// SYSTEM + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + + + +// ----------------------------------------------------------------------------- +// Tells if parameter stream is a video stream with RTP source +// ----------------------------------------------------------------------------- +// +TBool MusEngMceUtils::IsVideoInStream( CMceMediaStream& aStream ) + { + return ( aStream.Type() == KMceVideo && + aStream.Source() && + aStream.Source()->Type() == KMceRTPSource ); + } + +// ----------------------------------------------------------------------------- +// Tells if parameter stream is a video stream with RTP sink +// ----------------------------------------------------------------------------- +// +TBool MusEngMceUtils::IsVideoOutStream( CMceMediaStream& aStream ) + { + TBool isOutStream( EFalse ); + if ( aStream.Type() == KMceVideo ) + { + CMceMediaSink* rtpSink = MusEngMceUtils::GetMediaSink( + aStream, + KMceRTPSink ); + + isOutStream = ( rtpSink != NULL ); + } + return isOutStream; + } + +// ----------------------------------------------------------------------------- +// Tells if parameter stream is an audio stream with RTP source +// ----------------------------------------------------------------------------- +// +TBool MusEngMceUtils::IsAudioInStream( CMceMediaStream& aStream ) + { + return ( aStream.Type() == KMceAudio && + aStream.Source() && + aStream.Source()->Type() == KMceRTPSource ); + } + + +// ----------------------------------------------------------------------------- +// Gets handle to video stream with RTP sink. +// ----------------------------------------------------------------------------- +// +CMceVideoStream* MusEngMceUtils::GetVideoOutStreamL( CMceSession& aSession ) + { + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::GetVideoOutStreamL()" ) + + const RPointerArray& streams = aSession.Streams(); + + CMceVideoStream* videoOut = NULL; + + for ( TInt i = 0; i < streams.Count(); ++i ) + { + if ( MusEngMceUtils::IsVideoOutStream( *streams[i] ) ) + { + __ASSERT_ALWAYS( !videoOut, User::Leave( KErrOverflow ) ); + + videoOut = static_cast( streams[i] ); + } + + // Check if bound stream is a video stream with RTP sink. + if ( streams[i]->BoundStream() && + MusEngMceUtils::IsVideoOutStream( streams[i]->BoundStreamL() ) ) + { + __ASSERT_ALWAYS( !videoOut, User::Leave( KErrOverflow ) ); + + videoOut = static_cast( + &streams[i]->BoundStreamL() ); + } + } + + __ASSERT_ALWAYS( videoOut, User::Leave( KErrNotFound ) ); + + MUS_LOG( "mus: [ENGINE] <- MusEngMceUtils::GetVideoOutStreamL()" ) + + return videoOut; + } + + +// ----------------------------------------------------------------------------- +// Gets handle to video stream with RTP source. +// ----------------------------------------------------------------------------- +// +CMceVideoStream* MusEngMceUtils::GetVideoInStreamL( CMceSession& aSession ) + { + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::GetVideoInStreamL()" ) + + const RPointerArray& streams = aSession.Streams(); + + CMceVideoStream* videoIn = NULL; + + for ( TInt i = 0; i < streams.Count(); ++i ) + { + if ( MusEngMceUtils::IsVideoInStream( *streams[i] ) ) + + { + __ASSERT_ALWAYS( !videoIn, User::Leave( KErrOverflow ) ); + + videoIn = static_cast( streams[i] ); + } + + // Check if bound stream is a video stream with RTP souce. + if ( streams[i]->BoundStream() && + MusEngMceUtils::IsVideoInStream( streams[i]->BoundStreamL() ) ) + { + __ASSERT_ALWAYS( !videoIn, User::Leave( KErrOverflow ) ); + + videoIn = static_cast( + &streams[i]->BoundStreamL() ); + } + } + + __ASSERT_ALWAYS( videoIn, User::Leave( KErrNotFound ) ); + + MUS_LOG( "mus: [ENGINE] <- MusEngMceUtils::GetVideoInStreamL()" ) + + return videoIn; + } + + +// ----------------------------------------------------------------------------- +// Gets handle to video stream with file sink +// ----------------------------------------------------------------------------- +// +CMceVideoStream* MusEngMceUtils::GetRecordingStream( CMceSession& aSession ) + { + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::GetRecordingStreamL()" ) + + const RPointerArray& streams = aSession.Streams(); + + CMceVideoStream* recordingStream = NULL; + + for ( TInt i = 0; i < streams.Count(); ++i ) + { + if ( streams[i]->Type() == KMceVideo ) + { + if ( MusEngMceUtils::GetMediaSink( *streams[i], KMceFileSink ) ) + { + recordingStream = static_cast( streams[i] ); + } + } + } + + MUS_LOG( "mus: [ENGINE] <- MusEngMceUtils::GetRecordingStreamL()" ) + + return recordingStream; + } + + +// ----------------------------------------------------------------------------- +// Gets handle to a media sink of spesified type contained by a mediastream. +// ----------------------------------------------------------------------------- +// +CMceMediaSink* MusEngMceUtils::GetMediaSink( CMceMediaStream& aStream, + TMceSinkType aType, + TMceSourceType aAssociatedSourceType ) + { + const RPointerArray& sinks = aStream.Sinks(); + for ( TInt i = 0; i < sinks.Count(); ++i ) + { + if ( sinks[i]->Type() == aType && + ( aAssociatedSourceType == KMusEngNoAssociatedSourceType || + aStream.Source()->Type() == aAssociatedSourceType ) ) + { + return sinks[i]; + } + } + + return NULL; + } + + +// ----------------------------------------------------------------------------- +// Gets handle to a media sink of spesified type contained by a mediastream. +// ----------------------------------------------------------------------------- +// +CMceMediaSink* MusEngMceUtils::GetMediaSinkL( CMceMediaStream& aStream, + TMceSinkType aType, + TMceSourceType aAssociatedSourceType ) + { + + CMceMediaSink* sink = MusEngMceUtils::GetMediaSink( aStream, aType, aAssociatedSourceType ); + + __ASSERT_ALWAYS( sink, User::Leave( KErrNotFound ) ); + + return sink; + } + + +// ----------------------------------------------------------------------------- +// Gets handle to a media sink of spesified type contained by a session. +// ----------------------------------------------------------------------------- +// +CMceMediaSink* MusEngMceUtils::GetMediaSink( CMceSession& aSession, + TMceSinkType aType, + TMceSourceType aAssociatedSourceType, + TBool aStrictMatch ) + { + CMceMediaSink* sink = NULL; + + TRAP_IGNORE( sink = MusEngMceUtils::GetMediaSinkL( + aSession, aType, aAssociatedSourceType, aStrictMatch ) ) + + return sink; + } + + +// ----------------------------------------------------------------------------- +// Gets handle to a media sink of spesified type contained by a session. +// ----------------------------------------------------------------------------- +// +CMceMediaSink* MusEngMceUtils::GetMediaSinkL( CMceSession& aSession, + TMceSinkType aType, + TMceSourceType aAssociatedSourceType, + TBool aStrictMatch ) + { + CMceMediaSink* sink = NULL; + + const RPointerArray& streams = aSession.Streams(); + + for ( TInt i = 0; i < streams.Count(); ++i ) + { + sink = MusEngMceUtils::GetMediaSink( *streams[i], aType, aAssociatedSourceType ); + if ( sink ) + { + return sink; + } + + if ( streams[i]->BoundStream() ) + { + sink = MusEngMceUtils::GetMediaSink( streams[i]->BoundStreamL(), + aType, + aAssociatedSourceType ); + if ( sink ) + { + return sink; + } + } + } + + if ( !sink && aAssociatedSourceType != KMusEngNoAssociatedSourceType && !aStrictMatch ) + { + // No preferred match, try without source preference + sink = GetMediaSinkL( aSession, aType ); + } + + __ASSERT_ALWAYS( sink, User::Leave( KErrNotFound ) ); + + return sink; + } + + +// ----------------------------------------------------------------------------- +// Gets handle to a speaker sink contained by specified stream or bound stream. +// ----------------------------------------------------------------------------- +// +CMceSpeakerSink* MusEngMceUtils::GetSpeaker( CMceMediaStream& aStream ) + { + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::GetSpeaker()" ) + + CMceSpeakerSink* speaker = NULL; + + if ( aStream.Type() == KMceAudio ) + { + speaker = static_cast( + MusEngMceUtils::GetMediaSink( aStream, KMceSpeakerSink ) ); + + if ( !speaker && aStream.BoundStream() ) + { + CMceMediaStream* boundStream = NULL; + TRAPD( error, boundStream = &aStream.BoundStreamL() ) + + if ( error == KErrNone ) + { + speaker = static_cast( + MusEngMceUtils::GetMediaSink( *boundStream, + KMceSpeakerSink ) ); + } + } + } + + MUS_LOG( "mus: [ENGINE] <- MusEngMceUtils::GetSpeaker()" ) + + return speaker; + } + + +// ----------------------------------------------------------------------------- +// Gets handle to a camera source. +// ----------------------------------------------------------------------------- +// +CMceCameraSource* MusEngMceUtils::GetCameraL( CMceSession& aSession ) + { + // Camera can be only in out stream + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::GetCameraL()" ) + + CMceVideoStream* videoOut = MusEngMceUtils::GetVideoOutStreamL( aSession ); + + if ( !( videoOut->Source() && + videoOut->Source()->Type() == KMceCameraSource ) ) + { + User::Leave( KErrNotFound ); + } + + MUS_LOG( "mus: [ENGINE] <- MusEngMceUtils::GetCameraL()" ) + return static_cast( videoOut->Source() ); + } + + +// ----------------------------------------------------------------------------- +// Gets handle to a file source. +// ----------------------------------------------------------------------------- +// +CMceFileSource* MusEngMceUtils::GetFileSourceL( CMceSession& aSession ) + { + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::GetFileSourceL()" ) + + CMceVideoStream* videoOut = MusEngMceUtils::GetVideoOutStreamL( aSession ); + + if ( !( videoOut->Source() && + videoOut->Source()->Type() == KMceFileSource ) ) + { + User::Leave( KErrNotFound ); + } + + MUS_LOG( "mus: [ENGINE] <- MusEngMceUtils::GetFileSourceL()" ) + return static_cast( videoOut->Source() ); + } + + +// ----------------------------------------------------------------------------- +// Gets handle to a display sink. +// ----------------------------------------------------------------------------- +// +CMceDisplaySink* MusEngMceUtils::GetDisplay( + CMceSession& aSession, TBool aPreferViewFinder ) + { + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::GetDisplay()" ) + MUS_LOG( "mus: [ENGINE] <- MusEngMceUtils::GetDisplay()" ) + TMceSourceType preferredSource = + aPreferViewFinder ? KMceCameraSource : KMusEngNoAssociatedSourceType; + return static_cast( + MusEngMceUtils::GetMediaSink( aSession, KMceDisplaySink, preferredSource ) ); + + } + + +// ----------------------------------------------------------------------------- +// Gets handle to a display sink. +// ----------------------------------------------------------------------------- +// +CMceDisplaySink* MusEngMceUtils::GetDisplayL( + CMceSession& aSession, TBool aPreferViewFinder ) + { + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::GetDisplayL()" ) + + CMceDisplaySink* display = MusEngMceUtils::GetDisplay( aSession, aPreferViewFinder ); + + __ASSERT_ALWAYS( display, User::Leave( KErrNotFound ) ); + + MUS_LOG( "mus: [ENGINE] <- MusEngMceUtils::GetDisplayL()" ) + return display; + } + +// ----------------------------------------------------------------------------- +// Gets handle to a display sink displaying received video. +// ----------------------------------------------------------------------------- +// +CMceDisplaySink* MusEngMceUtils::GetReceivingDisplay( CMceSession& aSession ) + { + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::GetReceivingDisplay()" ) + MUS_LOG( "mus: [ENGINE] <- MusEngMceUtils::GetReceivingDisplay()" ) + + // Search display which is connected with rtp source + TMceSourceType preferredSource = KMceRTPSource; + return static_cast( MusEngMceUtils::GetMediaSink( + aSession, KMceDisplaySink, preferredSource, ETrue ) ); + } + +// ----------------------------------------------------------------------------- +// Gets handle to a display sink displaying received video. +// ----------------------------------------------------------------------------- +// +CMceDisplaySink* MusEngMceUtils::GetReceivingDisplayL( CMceSession& aSession ) + { + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::GetReceivingDisplayL()" ) + + CMceDisplaySink* display = GetReceivingDisplay( aSession ); + __ASSERT_ALWAYS( display != NULL, User::Leave( KErrNotFound ) ); + + MUS_LOG( "mus: [ENGINE] <- MusEngMceUtils::GetReceivingDisplay()" ) + + return display; + } + +// ----------------------------------------------------------------------------- +// Gets handle to a display sink displaying viewfinder content. +// ----------------------------------------------------------------------------- +// +CMceDisplaySink* MusEngMceUtils::GetVfDisplay( CMceSession& aSession ) + { + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::GetVfDisplay()" ) + MUS_LOG( "mus: [ENGINE] <- MusEngMceUtils::GetVfDisplay()" ) + + // Search display which is connected with camera + TMceSourceType preferredSource = KMceCameraSource; + return static_cast( MusEngMceUtils::GetMediaSink( + aSession, KMceDisplaySink, preferredSource, ETrue ) ); + } + +// ----------------------------------------------------------------------------- +// Adds display sink to specified stream if one does not exist already. +// Display rect is set in both cases. +// ----------------------------------------------------------------------------- +// +void MusEngMceUtils::AddDisplayL( CMceMediaStream& aStream, + CMceManager& aManager, + const TRect& aDisplayRect ) + { + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::AddDisplayL()" ) + + __ASSERT_ALWAYS( aStream.Type() == KMceVideo, User::Leave( KErrArgument ) ); + + CMceDisplaySink* display = static_cast( + MusEngMceUtils::GetMediaSink( + aStream, + KMceDisplaySink ) ); + + if ( !display ) + { + display = CMceDisplaySink::NewLC( aManager ); + aStream.AddSinkL( display ); + CleanupStack::Pop( display ); + } + + display->SetDisplayRectL( aDisplayRect ); + + MUS_LOG( "mus: [ENGINE] <- MusEngMceUtils::AddDisplayL()" ) + } + + +// ----------------------------------------------------------------------------- +// Adds display sink to specified stream if one does not exist already. +// ----------------------------------------------------------------------------- +// +void MusEngMceUtils::AddSpeakerL( CMceMediaStream& aStream ) + { + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::AddSpeakerL()" ) + + __ASSERT_ALWAYS( aStream.Type() == KMceAudio, User::Leave( KErrArgument ) ); + + CMceSpeakerSink* speaker = static_cast( + MusEngMceUtils::GetMediaSink( + aStream, + KMceSpeakerSink ) ); + + if ( !speaker ) + { + speaker = CMceSpeakerSink::NewLC(); + aStream.AddSinkL( speaker ); + CleanupStack::Pop( speaker ); + } + + MUS_LOG( "mus: [ENGINE] <- MusEngMceUtils::AddSpeakerL()" ) + } + + +// ----------------------------------------------------------------------------- +// Disables parameter stream, its' source and all the sinks. +// ----------------------------------------------------------------------------- +// +void MusEngMceUtils::DisableStreamL( CMceMediaStream& aStream ) + { + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::DisableStreamL()" ) + + aStream.DisableL(); + + if ( aStream.Source() ) + { + aStream.Source()->DisableL(); + } + + for ( TInt sinkIndex = 0; sinkIndex < aStream.Sinks().Count(); ++sinkIndex ) + { + aStream.Sinks()[ sinkIndex ]->DisableL(); + } + + MUS_LOG( "mus: [ENGINE] -> MusEngMceUtils::DisableStreamL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void MusEngMceUtils::DoEnableDisplayL( CMceDisplaySink& aDisplay, TBool aEnable ) + { + MUS_LOG1( "mus: [ENGINE] -> MusEngMceUtils::DoEnableDisplayL() %d", + aEnable ) + + if ( aEnable ) + { + if ( !aDisplay.IsEnabled() ) + { + aDisplay.EnableL(); + MUS_LOG( " Display enabled" ) + } + else + { + MUS_LOG( " Display already enabled, ignore" ) + } + } + else + { + if ( aDisplay.IsEnabled() ) + { + aDisplay.DisableL(); + MUS_LOG( " Display disabled" ) + } + else + { + MUS_LOG( " Display already disabled, ignore" ) + } + } + + MUS_LOG( "mus: [ENGINE] <- MusEngMceUtils::DoEnableDisplayL()") + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/musenginestub/src/musengpreviewsession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/musenginestub/src/musengpreviewsession.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,118 @@ +/* +* Copyright (c) 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: +* +*/ + + +#include "musengsession.h" +#include "musengpreviewsession.h" + +#include "musengpreviewsessionobserver.h" + +// ----------------------------------------------------------------------------- +// CMusEngPreviewSession::CMusEngPreviewSession +// ----------------------------------------------------------------------------- +// +CMusEngPreviewSession::CMusEngPreviewSession( MMusEngPreviewSessionObserver* aSessionObserver, + const TRect& aRect ) + : CMusEngSession( aRect ) + { + iSessionObserver = aSessionObserver; + } + +// ----------------------------------------------------------------------------- +// CMusEngPreviewSession::~CMusEngPreviewSession +// ----------------------------------------------------------------------------- +// +CMusEngPreviewSession::~CMusEngPreviewSession() + { + } + +// ----------------------------------------------------------------------------- +// CMusEngPreviewSession::~CMusEngPreviewSession +// ----------------------------------------------------------------------------- +// +EXPORT_C CMusEngPreviewSession* CMusEngPreviewSession::NewL( const TDesC& aFileName, + const TRect& aRect, + MMusEngPreviewSessionObserver* aSessionObserver) + { + CMusEngPreviewSession* self = NULL; + self = new( ELeave ) CMusEngPreviewSession( aSessionObserver, aRect); + CleanupStack::PushL( self ); + self->ConstructL(/*aFileName*/); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CMusEngPreviewSession::ConstructL +// ----------------------------------------------------------------------------- +// +void CMusEngPreviewSession::ConstructL( /*const TDesC& aFileName*/ ) + { + } + +// ----------------------------------------------------------------------------- +// CMusEngPreviewSession::SetClipSessionObserver +// ----------------------------------------------------------------------------- +// +void CMusEngPreviewSession::SetSessionObserver(MMusEngPreviewSessionObserver* aSessionObserver) + { + iSessionObserver = aSessionObserver; + } + +// ----------------------------------------------------------------------------- +// CMusEngPreviewSession::Play +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMusEngPreviewSession::Play() + { + } + +// ----------------------------------------------------------------------------- +// CMusEngPreviewSession::Pause +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMusEngPreviewSession::Pause() + { + } + +// ----------------------------------------------------------------------------- +// CMusEngPreviewSession::Close +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMusEngPreviewSession::Close() + { + } + +// ----------------------------------------------------------------------------- +// CMusEngPreviewSession::Mute +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMusEngPreviewSession::Mute() + { + } + +// ----------------------------------------------------------------------------- +// CMusEngPreviewSession::Unmute +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMusEngPreviewSession::Unmute() + { + } + + + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/musenginestub/src/musengreceivesession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/musenginestub/src/musengreceivesession.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,235 @@ +/* +* 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: +* +*/ + + + +// USER INCLUDES + +#include "musengreceivesession.h" +#include "musengsessionobserver.h" +#include "musengreceivesessionobserver.h" +#include "musengmceutils.h" +#include "musenglogger.h" +#include "mussipprofilehandler.h" +#include "mussessionproperties.h" + +// SYSTEM INCLUDES +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + +const TUint8 KMusEngRtpKeepAliveTimer = 5; // this should be 30 sec, this a temporary fix +const TUint8 KMusEngKeepAlivePayloadTypeVideoH263 = 96; +const TUint8 KMusEngKeepAlivePayloadTypeAudio = 97; +const TUint8 KMusEngKeepAlivePayloadTypeVideoAvc = 98; + +const TInt KMusEngJitterBufferLength = 51; //Must be bigger than treshold +// Using following value increases treshold buffer to 1 second from +// default 100 ms +const TInt KMusEngJitterBufferTreshold = 50; +const TInt KMusEngTresholdToSecondsFactor = 20; +const TInt KMusEngOneSecondInMilliSeconds = 1000; +// Use inactivity timer value that is a little bigger than treshold in seconds +const TUint KMusEngInactivityTimer = KMusEngTresholdToSecondsFactor * + KMusEngJitterBufferTreshold + + KMusEngOneSecondInMilliSeconds; + +_LIT8( KMusEngSwisIdentifier, "Require: precondition" ); +_LIT8( KMusEngAssertedIdentity, "P-Asserted-Identity" ); +_LIT8( KMusEngBiggerSign, ">" ); + +const TInt KMusEngSipReasonCodeBusyHere = 486; +_LIT8( KMusEngSipReasonPhraseBusy, "Busy" ); + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngReceiveSession::~CMusEngReceiveSession() + { + delete iRemoteDisplayName; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngReceiveSession* CMusEngReceiveSession::NewL( const TRect& aRect ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngReceiveSession::NewL(...)" ) + + CMusEngReceiveSession* self = new( ELeave ) CMusEngReceiveSession( aRect ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngReceiveSession::NewL(...)" ) + return self; + } + + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +void CMusEngReceiveSession::EstablishLcSessionL() + { + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// +MLcVideoPlayer* CMusEngReceiveSession::RemoteVideoPlayer() + { + return this; + } + +// ----------------------------------------------------------------------------- +// From MLcSession +// ----------------------------------------------------------------------------- +// + +const TDesC& CMusEngReceiveSession::RemoteDisplayName() + { + return *iRemoteDisplayName; + } + + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcVideoPlayer::TLcVideoPlayerState CMusEngReceiveSession::LcVideoPlayerState() const + { + TLcVideoPlayerState vidPlayerState = MLcVideoPlayer::EUnavailable; + + return vidPlayerState; + } +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +TBool CMusEngReceiveSession::LcIsPlayingL() + { + return EFalse; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +void CMusEngReceiveSession::LcPlayL() + { + // NOP + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +void CMusEngReceiveSession::LcPauseL() + { + // NOP + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcWindow* CMusEngReceiveSession::LcWindow() + { + return this; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcCameraControl* CMusEngReceiveSession::LcCameraControl() + { + return NULL; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcFileControl* CMusEngReceiveSession::LcSourceFile() + { + return NULL; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcFileControl* CMusEngReceiveSession::LcDestinationFile() + { + return NULL; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcAudioControl* CMusEngReceiveSession::LcAudioControl() + { + return this; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcZoomControl* CMusEngReceiveSession::LcZoomControl() + { + return NULL; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +MLcBrightnessControl* CMusEngReceiveSession::LcBrightnessControl() + { + return NULL; + } + +// ----------------------------------------------------------------------------- +// From MLcVideoPlayer +// ----------------------------------------------------------------------------- +// +RPointerArray< MLcValueControl >& CMusEngReceiveSession::LcExtensionControls() + { + return iValueControls; + } + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/musenginestub/src/musengsession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/musenginestub/src/musengsession.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,51 @@ +/* +* Copyright (c) 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: +* +*/ + + +// USER INCLUDES +#include "musengsession.h" +#include "musengtelephoneutils.h" +#include "muslogger.h" + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngSession::~CMusEngSession() // destruct - virtual, so no export + { + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngSession::CMusEngSession() + { + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngSession::ConstructL() // second-phase constructor + { + } + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/musenginestub/src/musengsessiondurationtimer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/musenginestub/src/musengsessiondurationtimer.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,112 @@ +/* +* Copyright (c) 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: +* +*/ + + +// USER INCLUDES +#include "musengsessiondurationtimer.h" +#include "musengsessiondurationtimerobserver.h" + + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngSessionDurationTimer* CMusEngSessionDurationTimer::NewL( + MMusEngSessionDurationTimerObserver& aObserver ) + { + CMusEngSessionDurationTimer* self = + new (ELeave) CMusEngSessionDurationTimer( aObserver ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self) ; + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngSessionDurationTimer::~CMusEngSessionDurationTimer() + { + Cancel(); + iTimer.Close(); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngSessionDurationTimer::Start(TInt aDelay ) + { + if ( !IsActive() ) + { + iTimer.After( iStatus, aDelay ); + SetActive(); + } + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngSessionDurationTimer::CMusEngSessionDurationTimer( + MMusEngSessionDurationTimerObserver& aObserver ) + : CActive( CActive::EPriorityStandard ), + iObserver( aObserver) + { + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngSessionDurationTimer::ConstructL() + { + CActiveScheduler::Add( this ); + User::LeaveIfError( iTimer.CreateLocal() ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngSessionDurationTimer::RunL() + { + if ( iStatus.Int() == KErrNone ) + { + iObserver.UpdateTimerEvent(); + } + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngSessionDurationTimer::DoCancel() + { + iTimer.Cancel(); + } + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/musenginestub/src/musengsessionmanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/musenginestub/src/musengsessionmanager.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,113 @@ +/* +* 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 "musengsessionmanager.h" +#include +#include "musenglivesession.h" +#include "musengreceivesession.h" +#include "lcsession.h" +#include "mussessionproperties.h" +#include "lcsessionobserver.h" +#include "lcuiprovider.h" + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngSessionManager* CMusEngSessionManager::NewL( TAny* aInitParams ) + { + __ASSERT_ALWAYS( aInitParams != NULL, User::Leave( KErrArgument ) ); + + CMusEngSessionManager* self = + new( ELeave )CMusEngSessionManager( + *reinterpret_cast< TLcEngineParams* >( aInitParams ) ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngSessionManager::~CMusEngSessionManager() + { + delete iSession; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngSessionManager::CMusEngSessionManager( + TLcEngineParams& aInitParams ) + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngSessionManager::ConstructL() + { + TInt useCase; + User::LeaveIfError( RProperty::Get( NMusSessionApi::KCategoryUid, + NMusSessionApi::KUseCase, + useCase ) ); + iSession = CreateMusSessionL( + static_cast< MultimediaSharing::TMusUseCase >( useCase ) ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +MLcSession& CMusEngSessionManager::Session() + { + return *iSession; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngMceSession* CMusEngSessionManager::CreateMusSessionL( + MultimediaSharing::TMusUseCase aUseCase ) + { + CMusEngMceSession* session = NULL; + switch ( aUseCase ) + { + case MultimediaSharing::EMusLiveVideo: + { + session = CMusEngLiveSession::NewL( TRect() ); + break; + } + case MultimediaSharing::EMusReceive: + { + session = CMusEngReceiveSession::NewL( TRect() ); + break; + } + default: + User::Leave( KErrNotSupported ); + break; + } + return session; + } + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/musenginestub/src/musengtelephoneutils.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/musenginestub/src/musengtelephoneutils.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,445 @@ +/* +* Copyright (c) 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: +* +*/ + + +// USER +#include "musengtelephoneutils.h" +#include "musengaudioroutingobserver.h" +#include "muslogger.h" + +// SYSTEM +#include +#include +#include +#include +#include // for CPhCltCommandHandler + +// Constants +const TInt KMusEngMaxVolume = 10; +const TInt KMusEngMinVolume = 0; + + + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngTelephoneUtils* CMusEngTelephoneUtils::NewL() + { + CMusEngTelephoneUtils* self = new( ELeave ) CMusEngTelephoneUtils(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngTelephoneUtils::~CMusEngTelephoneUtils() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTelephoneUtils::~CMusEngTelephoneUtils()" ) + + Cancel(); + + delete iPhoneCommandHandler; + + if( iTelephonyAudioRouting ) // If 2nd phase construction has succeeded + { + CTelephonyAudioRouting::TAudioOutput currentMode = + iTelephonyAudioRouting->Output(); + if( currentMode != iAudioOutputAtStartup ) + { + // As going down, let audiorouting api to show notification + iTelephonyAudioRouting->SetShowNote( ETrue ); + TRAPD( err, DoSetOutputL( iAudioOutputAtStartup ) ); + MUS_LOG1( "mus: [ENGINE] final route change completed: %d", err ) + err++; + } + } + + delete iRepository; + delete iTelephonyAudioRouting; + MUS_LOG( "mus: [ENGINE] <- CMusEngTelephoneUtils::~CMusEngTelephoneUtils()" ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMusEngTelephoneUtils::AudioRoutingCanBeChanged() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTelephoneUtils::AudioRoutingCanBeChanged" ) + + TBool retValue = ( iTelephonyAudioRouting->Output() != + CTelephonyAudioRouting::EWiredAudioAccessory && + iTelephonyAudioRouting->Output() != + CTelephonyAudioRouting::EBTAudioAccessory && + iTelephonyAudioRouting->Output() != + CTelephonyAudioRouting::ETTY ); + + MUS_LOG1( "mus: [ENGINE] <- CMusEngTelephoneUtils::AudioRoutingCanBeChanged: %d", + retValue ) + + return retValue; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTelephoneUtils::LoudspeakerL( TBool aEnable, TBool aShowDialog ) + { + MUS_LOG1( "mus: [ENGINE] -> CMusEngTelephoneUtils::LoudspeakerL(%d)", + aEnable ) + + if ( aEnable ) + { + if ( iTelephonyAudioRouting->Output() == + CTelephonyAudioRouting::EHandset ) + { + // Disable note shown by audiorouting api as it causes + // application going to background for a while. Instead, display + // note by ourselves once setting output completes. This mechanism + // is needed only for loudspeaker enabling as going to background + // causes problems only at beginning of sharing session. + if ( aShowDialog ) + { + iTelephonyAudioRouting->SetShowNote( EFalse ); + + iShowDialog = aShowDialog; + } + + DoSetOutputL( CTelephonyAudioRouting::ELoudspeaker ); + } + } + else + { + iTelephonyAudioRouting->SetShowNote( aShowDialog ); + + if ( iAudioOutputAtStartup == CTelephonyAudioRouting::ELoudspeaker ) + { + DoSetOutputL( CTelephonyAudioRouting::EHandset ); + } + else + { + DoSetOutputL( iAudioOutputAtStartup ); + } + } + + + + MUS_LOG( "mus: [ENGINE] <- CMusEngTelephoneUtils::LoudspeakerL(...)" ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMusEngTelephoneUtils::IsLoudSpeakerEnabled() const + { + return ( iTelephonyAudioRouting->Output() == + CTelephonyAudioRouting::ELoudspeaker ); + } + + +// ----------------------------------------------------------------------------- +// Gets the CS call volume level. +// Leaves if error occurs when accessing central repository. +// ----------------------------------------------------------------------------- +// +TInt CMusEngTelephoneUtils::GetVolumeL() const + { + TInt currentVolume = 0; + if ( IsLoudSpeakerEnabled() ) + { + User::LeaveIfError( iRepository->Get( KTelIncallLoudspeakerVolume, + currentVolume ) ); + } + else + { + User::LeaveIfError( iRepository->Get( KTelIncallEarVolume, + currentVolume ) ); + } + + return ValidateVolume( currentVolume ); + } + + +// ----------------------------------------------------------------------------- +// Sets the CS call volume level. +// Leaves if error occurs when accessing central repository. +// ----------------------------------------------------------------------------- +// +void CMusEngTelephoneUtils::SetVolumeL( TInt aVolume ) + { + TInt newVolume = ValidateVolume( aVolume ); + + if ( GetVolumeL() != newVolume ) + { + if ( IsLoudSpeakerEnabled() ) + { + User::LeaveIfError( iRepository->Set( KTelIncallLoudspeakerVolume, + newVolume ) ); + } + else + { + User::LeaveIfError( iRepository->Set( KTelIncallEarVolume, + newVolume ) ); + } + } + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTelephoneUtils::MuteMicL( TBool aMute ) + { + MUS_LOG1( "mus: [ENGINE] -> CMusEngTelephoneUtils::MuteMicL(%d)", aMute ) + + if ( IsActive() ) + { + MUS_LOG( "mus: [ENGINE] Cancel pending request" ) + Cancel(); + } + + iPhoneCommandHandler->MuteMicrophone( iStatus, aMute ); + SetActive(); + + MUS_LOG( "mus: [ENGINE] <- CMusEngTelephoneUtils::MuteMicL()" ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMusEngTelephoneUtils::IsMicMutedL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTelephoneUtils::IsMicMutedL()" ) + + TInt psVal; + User::LeaveIfError( RProperty::Get( KPSUidTelMicrophoneMuteStatus, + KTelMicrophoneMuteState, + psVal ) ); + + MUS_LOG1( "mus: [ENGINE] Mute status in PS is (%d)", psVal ) + MUS_LOG( "mus: [ENGINE] <- CMusEngTelephoneUtils::IsMicMutedL()" ) + + return ( psVal == EPSTelMicMuteOn ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTelephoneUtils::SetAudioRoutingObserver( + MMusEngAudioRoutingObserver* aObserver ) + { + iAudioRoutingObserver = aObserver; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTelephoneUtils::RunL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTelephoneUtils::RunL()" ) + + // NOP, since we really cannot do anything but log the result + MUS_LOG1( "mus: [ENGINE] Asynchronous call completed with code %d", + iStatus.Int() ) + + MUS_LOG( "mus: [ENGINE] <- CMusEngTelephoneUtils::RunL()" ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTelephoneUtils::DoCancel() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTelephoneUtils::DoCancel()" ) + + if ( iPhoneCommandHandler ) + { + iPhoneCommandHandler->CancelAsyncRequest( EPhCltCommandMuteMic ); + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngTelephoneUtils::DoCancel()" ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTelephoneUtils::AvailableOutputsChanged( + CTelephonyAudioRouting& /*aTelephonyAudioRouting*/ ) + { + // NOP + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTelephoneUtils::OutputChanged( + CTelephonyAudioRouting& aTelephonyAudioRouting ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTelephoneUtils::OutputChanged()" ) + + // Some other application has changed audio output routing. We consider + // this as a last will of a user and return to this state after sharing + + iAudioOutputAtStartup = aTelephonyAudioRouting.Output(); + + MUS_LOG1( "mus: [ENGINE] New audio routing is %d", iAudioOutputAtStartup ) + + if ( iAudioRoutingObserver ) + { + iAudioRoutingObserver->AudioRoutingChanged( EFalse ); + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngTelephoneUtils::OutputChanged()" ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTelephoneUtils::SetOutputComplete( + CTelephonyAudioRouting& /*aTelephonyAudioRouting*/, + TInt aError ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTelephoneUtils::SetOutputComplete()" ) + + if ( aError == KErrNone && iAudioRoutingObserver ) + { + // If audio routing api didn't shown note and show dialog mode is on, + // we know that this completion is for such setoutput call for which + // we need to show the note. Show note mode is turned off only in that + // case. + TBool dialogShownByUs( EFalse ); + TBool dialogShownByAudioRouting( EFalse ); + aError = iTelephonyAudioRouting->GetShowNote( dialogShownByAudioRouting ); + if ( aError == KErrNone && !dialogShownByAudioRouting && iShowDialog ) + { + dialogShownByUs = iShowDialog; + iShowDialog = EFalse; + } + + iAudioRoutingObserver->AudioRoutingChanged( dialogShownByUs ); + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngTelephoneUtils::SetOutputComplete()" ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngTelephoneUtils::CMusEngTelephoneUtils() + : CActive( CActive::EPriorityStandard ) + { + iAudioOutputAtStartup = CTelephonyAudioRouting::ENotActive; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTelephoneUtils::ConstructL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTelephoneUtils::ConstructL()" ) + + // Volume control + iRepository = CRepository::NewL( KCRUidInCallVolume ); + + // Audio routing control + iTelephonyAudioRouting = CTelephonyAudioRouting::NewL( *this ); + + iAudioOutputAtStartup = iTelephonyAudioRouting->Output(); + + // Phone + MUS_LOG( "mus: [ENGINE] Use static DLL" ) + iPhoneCommandHandler = CPhCltCommandHandler::NewL(); + + CActiveScheduler::Add( this ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngTelephoneUtils::ConstructL()" ) + } + + +// ----------------------------------------------------------------------------- +// Validates that requested volume level is valid (between 1-10) and if it is +// not, modifies requested volume level to be valid. Returns validated volume. +// ----------------------------------------------------------------------------- +// +TInt CMusEngTelephoneUtils::ValidateVolume( const TInt aVolume ) const + { + if ( aVolume < KMusEngMinVolume ) + { + return KMusEngMinVolume; + } + else if ( aVolume > KMusEngMaxVolume ) + { + return KMusEngMaxVolume; + } + else + { + // NOP, to keep PC-Lint happy + } + + return aVolume; + } + + +// ----------------------------------------------------------------------------- +// Set output if setting is currently allowed. +// ----------------------------------------------------------------------------- +// +void CMusEngTelephoneUtils::DoSetOutputL( + CTelephonyAudioRouting::TAudioOutput aAudioOutput ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTelephoneUtils::DoSetOutputL()" ) + if ( iAudioRoutingObserver && !iAudioRoutingObserver->AudioRouteChangeAllowed() ) + { + MUS_LOG( "mus: [ENGINE] change not allowed!" ) + User::Leave( KErrAccessDenied ); + } + iTelephonyAudioRouting->SetOutputL( aAudioOutput ); + MUS_LOG( "mus: [ENGINE] <- CMusEngTelephoneUtils::DoSetOutputL()" ) + } + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/musenginestub/src/musengtwowayrecvsession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/musenginestub/src/musengtwowayrecvsession.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,540 @@ +/* +* Copyright (c) 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: +* +*/ + + +// USER +#include "musengtwowayrecvsession.h" +#include "musengsessionobserver.h" +#include "musengreceivesessionobserver.h" +#include "musunittesting.h" +#include "musengmceutils.h" +#include "musenglogger.h" +#include "mussipprofilehandler.h" + +// SYSTEM +#include +#include +#include +#include +#include +#include +#include +#include + +const TInt KMusEngJitterBufferLength = 51; //Must be bigger than treshold +// Using following value increases treshold buffer to 1 second from +// default 100 ms +const TInt KMusEngJitterBufferTreshold = 50; + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CMusEngTwoWayRecvSession* CMusEngTwoWayRecvSession::NewL( + const TRect& aRemoteRect, + const TRect& aLocalRect, + MMusEngSessionObserver& aSessionObserver, + MMusEngReceiveSessionObserver& aReceiveSessionObserver ) + { + CMusEngTwoWayRecvSession* self = new( ELeave ) CMusEngTwoWayRecvSession( + aSessionObserver, + aReceiveSessionObserver, + aRemoteRect, + aLocalRect ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngTwoWayRecvSession::~CMusEngTwoWayRecvSession() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWayRecvSession::~CMusEngTwoWayRecvSession()" ) + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWayRecvSession::~CMusEngTwoWayRecvSession()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWayRecvSession::EnableDisplayL( TBool aEnable ) + { + MUS_LOG1( "mus: [ENGINE] -> CMusEngTwoWayRecvSession::EnableDisplayL() %d", + aEnable ) + + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + CMceDisplaySink* display = MusEngMceUtils::GetReceivingDisplayL( *iSession ); + MusEngMceUtils::DoEnableDisplayL( *display, aEnable ); + + CMceDisplaySink* vfDisplay = MusEngMceUtils::GetVfDisplay( *iSession ); + if ( vfDisplay ) + { + MusEngMceUtils::DoEnableDisplayL( *vfDisplay, aEnable ); + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWayRecvSession::EnableDisplayL()") + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngMceSession::TDisplayOrientation CMusEngTwoWayRecvSession::OrientationL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWayRecvSession::RotationL()" ) + + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + CMceDisplaySink* display = MusEngMceUtils::GetReceivingDisplayL( *iSession ); + + TDisplayOrientation displayOrientation; + CMceDisplaySink::TRotation rotation( display->RotationL() ); + + MUS_LOG1( "mus: [ENGINE] MCE rotation is %d", rotation ) + + if ( rotation == CMceDisplaySink::ENone ) + { + displayOrientation = CMusEngMceSession::EPortrait; + } + else + { + displayOrientation = CMusEngMceSession::ELandscape; + } + + MUS_LOG1( "mus: [ENGINE] <- CMusEngTwoWayRecvSession::RotationL() %d", + displayOrientation ) + + return displayOrientation; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWayRecvSession::SetOrientationL( TDisplayOrientation aOrientation ) + { + MUS_LOG1( "mus: [ENGINE] -> CMusEngTwoWayRecvSession::SetOrientationL() %d", + aOrientation ) + + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + CMceDisplaySink* display = MusEngMceUtils::GetReceivingDisplayL( *iSession ); + + CMceDisplaySink* vfDisplay = MusEngMceUtils::GetVfDisplay( *iSession ); + + CMceDisplaySink::TRotation rotation = ( aOrientation == EPortrait ) ? + CMceDisplaySink::ENone : CMceDisplaySink::EClockwise90Degree; + + display->SetRotationL( rotation ); + if ( vfDisplay ) + { + vfDisplay->SetRotationL( rotation ); + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWayRecvSession::SetOrientationL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMusEngTwoWayRecvSession::SetRectsL( + const TRect& aRemoteRect, + const TRect& aLocalRect ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWayRecvSession::SetRectsL()" ) + + iLocalRect = aLocalRect; + iRect = aRemoteRect; + RectChangedL(); + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWayRecvSession::SetRectsL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMusEngTwoWayRecvSession::SetLocalRectL( const TRect& aLocalRect ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWayRecvSession::SetLocalRectL()" ) + + iLocalRect = aLocalRect; + RectChangedL(); + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWayRecvSession::SetLocalRectL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TRect CMusEngTwoWayRecvSession::LocalRect() const + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWayRecvSession::LocalRect()" ) + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWayRecvSession::LocalRect()" ) + return iLocalRect; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TMusEngCameraHandler& CMusEngTwoWayRecvSession::Camera() + { + return iCameraHandler; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// + +void CMusEngTwoWayRecvSession::RectChangedL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWayRecvSession::RectChangedL()" ) + + + // If session is not yet created, do nothing + if ( iSession && iSession->State() != CMceSession::ETerminated ) + { + TRect remoteRect( Rect() ); + MUS_LOG2( "mus: [ENGINE] remote tl.ix=%d tl.iy=%d", + remoteRect.iTl.iX, remoteRect.iTl.iY ) + MUS_LOG2( "mus: [ENGINE] remote brc%d br.iy=%d", + remoteRect.iBr.iX, remoteRect.iBr.iY ) + MUS_LOG2( "mus: [ENGINE] local tl.ix=%d tl.iy=%d", + iLocalRect.iTl.iX, iLocalRect.iTl.iY ) + MUS_LOG2( "mus: [ENGINE] local br.ix=%d br.iy=%d", + iLocalRect.iBr.iX, iLocalRect.iBr.iY ) + + CMceDisplaySink* display = MusEngMceUtils::GetReceivingDisplayL( *iSession ); + display->SetDisplayRectL( remoteRect ); + + CMceDisplaySink* vfDisplay = MusEngMceUtils::GetVfDisplay( *iSession ); + if ( vfDisplay ) + { + vfDisplay->SetDisplayRectL( iLocalRect ); + } + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWayRecvSession::RectChangedL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWayRecvSession::CompleteSessionStructureL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWayRecvSession::CompleteSessionStructureL()" ) + + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + iCameraHandler.SetSession( iSession ); + + // Force bandwidth line usage in sdp as it is mandatory + // at MT side based on GSMA VS specification IR.74. Bandwidth is set to + // session or to media level based on sender's way of usage. If other end + // is not using bandwidth attribute at all, media level is preferred. + SetSessionSdpLinesL( *iSession, ETrue ); + + CMceStreamBundle* localBundle = + CMceStreamBundle::NewLC( CMceStreamBundle::ELS ); + + const RPointerArray& streams = iSession->Streams(); + + CMceMediaStream* videoInStream = NULL; + CMceMediaStream* videoOutStream = NULL; + + // Search interesting video streams, sendrecv is preferred + TBool sendRecvVideoFound( EFalse ); + for( TInt i = 0; i < streams.Count(); ++i ) + { + if ( MusEngMceUtils::IsVideoInStream( *streams[i] ) && + !sendRecvVideoFound ) + { + videoInStream = streams[i]; + + if ( streams[i]->BoundStream() ) + { + videoOutStream = &streams[i]->BoundStreamL(); + } + } + else if ( streams[i]->BoundStream() && + MusEngMceUtils::IsVideoInStream( streams[i]->BoundStreamL() ) && + !sendRecvVideoFound ) + { + videoInStream = &streams[i]->BoundStreamL(); + + videoOutStream = streams[i]; + } + else + { + // NOP + } + + sendRecvVideoFound = ( videoInStream && videoOutStream ); + } + + CompleteSessionStructureAudioPartL( streams, *localBundle, videoInStream, videoOutStream ); + + if ( videoInStream ) + { + CompleteSessionStructureInStreamL( *videoInStream, *localBundle ); + } + else + { + // At least receiving video stream is required + User::Leave( KErrCorrupt ); + } + + if ( videoOutStream ) + { + CompleteSessionStructureOutStreamL( *videoOutStream ); + } + + // Destroy bundle if it is not needed or transfer ownership + if ( localBundle->Streams().Count() > 1 ) + { + iSession->AddBundleL( localBundle ); + CleanupStack::Pop( localBundle ); + } + else + { + CleanupStack::PopAndDestroy( localBundle ); + } + + AdjustStreamsAndCodecsL(); + + iSession->UpdateL(); + + // Now session state is right to adjust volume + SetSpeakerVolumeL( VolumeL() ); + + iSipProfileHandler->CreateProfileL( iSession->Profile() ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWayRecvSession::CompleteSessionStructureL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWayRecvSession::StreamStateChanged( CMceMediaStream& aStream, + CMceMediaSink& aSink ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWayRecvSession::StreamStateChanged( sink )" ) + if ( !iSession ) + { + return; + } + + MUS_ENG_LOG_STREAM_STATE( aStream ) + + // TODO: if display sink buffers, inform ui with some callback + // so that it can modify display rects accordingly + + CMusEngMceSession::StreamStateChanged( aStream, aSink ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWayRecvSession::StreamStateChanged( sink )" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWayRecvSession::StreamStateChanged( CMceMediaStream& aStream ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWayRecvSession::StreamStateChanged()" ) + if ( !iSession ) + { + return; + } + + MUS_ENG_LOG_STREAM_STATE( aStream ) + + // TODO: if receiving video stream buffers, inform ui with some callback + // so that it can modify display rects accordingly + + CMusEngReceiveSession::StreamStateChanged( aStream ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWayRecvSession::StreamStateChanged()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngTwoWayRecvSession::CMusEngTwoWayRecvSession( + MMusEngSessionObserver& aSessionObserver, + MMusEngReceiveSessionObserver& aReceiveSessionObserver, + const TRect& aRemoteRect, + const TRect& aLocalRect ) : + CMusEngReceiveSession( aSessionObserver, + aReceiveSessionObserver, + aRemoteRect ), + iLocalRect( aLocalRect ) + { + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWayRecvSession::ConstructL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWayRecvSession::ConstructL()" ) + + iCameraHandler.ReadCameraUsageKeyL(); + CMusEngReceiveSession::ConstructL(); + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWayRecvSession::ConstructL()" ) + } + +// ----------------------------------------------------------------------------- +// When checking audio streams also not interesting streams are removed from +// session. Stream if removed if one of following apply: +// 1. Is not and does not contain incoming video or audio +// 2. We already have one incoming video stream +// 3. Stream is audio and we run operator variant where audio is +// not allowed. +// 4. Two-way video exists and this one is audio +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWayRecvSession::CompleteSessionStructureAudioPartL( + const RPointerArray& aStreams, + CMceStreamBundle& aLocalBundle, + CMceMediaStream* aVideoInStream, + CMceMediaStream* aVideoOutStream ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWayRecvSession::CompleteSessionStructureAudioPartL()" ) + + // Audio streams not allowed in two-way session or in operator variant + TBool audioAllowed( !( aVideoInStream && aVideoOutStream ) && !iOperatorVariant ); + + for( TInt i = 0; i < aStreams.Count(); ++i ) + { + // Audio supported currently only in recvonly case + if ( audioAllowed && + MusEngMceUtils::IsAudioInStream( *aStreams[i] ) ) + { + MusEngMceUtils::AddSpeakerL( *aStreams[i] ); + + aLocalBundle.AddStreamL( *aStreams[i] ); + + // Disable possible opposite stream to indicate that sendrecv audio is + // not allowed. + if ( aStreams[i]->BoundStream() ) + { + MusEngMceUtils::DisableStreamL( aStreams[i]->BoundStreamL() ); + } + } + else if ( audioAllowed && + aStreams[i]->BoundStream() && + MusEngMceUtils::IsAudioInStream( aStreams[i]->BoundStreamL() ) ) + { + MusEngMceUtils::AddSpeakerL( aStreams[i]->BoundStreamL() ); + + aLocalBundle.AddStreamL( aStreams[i]->BoundStreamL() ); + + // Disable opposite stream to indicate that sendrecv audio is not allowed. + MusEngMceUtils::DisableStreamL( *aStreams[i] ); + } + else if ( aStreams[ i ] != aVideoInStream && aStreams[ i ] != aVideoOutStream ) + { + iSession->RemoveStreamL( *aStreams[i] ); + + // Since succesfull removal of a stream has decreased the amount + // of streams in array by one, we have to modify the index + --i; + } + else + { + // NOP + } + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWayRecvSession::CompleteSessionStructureAudioPartL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWayRecvSession::CompleteSessionStructureInStreamL( + CMceMediaStream& aVideoInStream, CMceStreamBundle& aLocalBundle ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWayRecvSession::CompleteSessionStructureInStreamL()" ) + + SetMediaSdpLinesL( aVideoInStream, ETrue ); + + MusEngMceUtils::AddDisplayL( aVideoInStream, *iManager, Rect() ); + + static_cast(aVideoInStream.Source())->UpdateL( + KMusEngJitterBufferLength, + KMusEngJitterBufferTreshold ); + + aLocalBundle.AddStreamL( aVideoInStream ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWayRecvSession::CompleteSessionStructureInStreamL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWayRecvSession::CompleteSessionStructureOutStreamL( + CMceMediaStream& aVideoOutStream ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWayRecvSession::CompleteSessionStructureOutStreamL()" ) + + SetMediaSdpLinesL( aVideoOutStream, ETrue ); + + CMceCameraSource* camera = NULL; + TRAP_IGNORE( camera = MusEngMceUtils::GetCameraL( *iSession ) ) + if ( !camera ) + { + camera = CMceCameraSource::NewLC( *iManager ); + aVideoOutStream.SetSourceL( camera ); + CleanupStack::Pop( camera ); + } + + camera->DisableL(); // Start session in pause mode. + + iCameraHandler.InitializeL( *camera ); + + CMceVideoStream* vfStream = CMceVideoStream::NewLC(); + + vfStream->SetSourceL( aVideoOutStream.Source() ); + + // Complete stream + MusEngMceUtils::AddDisplayL( *vfStream, *iManager, LocalRect() ); + + iSession->AddStreamL( vfStream ); + CleanupStack::Pop( vfStream ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWayRecvSession::CompleteSessionStructureOutStreamL()" ) + } + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/musenginestub/src/musengtwowaysession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/musenginestub/src/musengtwowaysession.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,476 @@ +/* +* Copyright (c) 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: +* +*/ + + +// USER +#include "musengtwowaysession.h" +#include "musengsessionobserver.h" +#include "musenglivesessionobserver.h" +#include "musunittesting.h" +#include "musengmceutils.h" +#include "musenglogger.h" +#include "musengtwowaysessionobserver.h" + +// SYSTEM +#include +#include +#include +#include +#include +#include +#include + +const TInt KMusEngJitterBufferLength = 51; //Must be bigger than treshold +// Using following value increases treshold buffer to 1 second from +// default 100 ms +const TInt KMusEngJitterBufferTreshold = 50; + +const TUint32 KMusEngTwoWayReceivingActivityTimeout = 3000; // 3 seconds + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CMusEngTwoWaySession* CMusEngTwoWaySession::NewL( + const TRect& aRemoteRect, + const TRect& aLocalRect, + MMusEngSessionObserver& aSessionObserver, + MMusEngOutSessionObserver& aOutSessionObserver, + MMusEngLiveSessionObserver& aLiveSessionObserver, + MMusEngTwoWaySessionObserver& aTwoWayObserver ) + { + CMusEngTwoWaySession* self = new( ELeave ) CMusEngTwoWaySession( + aSessionObserver, + aOutSessionObserver, + aLiveSessionObserver, + aTwoWayObserver, + aRemoteRect, + aLocalRect ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngTwoWaySession::~CMusEngTwoWaySession() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWaySession::~CMusEngTwoWaySession()" ) + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWaySession::~CMusEngTwoWaySession()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWaySession::EnableDisplayL( TBool aEnable ) + { + MUS_LOG1( "mus: [ENGINE] -> CMusEngTwoWaySession::EnableDisplayL() %d", + aEnable ) + + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + CMceDisplaySink* display = MusEngMceUtils::GetReceivingDisplay( *iSession ); + if ( display ) + { + MusEngMceUtils::DoEnableDisplayL( *display, aEnable ); + } + CMceDisplaySink* vfDisplay = MusEngMceUtils::GetDisplayL( *iSession, ETrue ); + MusEngMceUtils::DoEnableDisplayL( *vfDisplay, aEnable ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWaySession::EnableDisplayL()") + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWaySession::SetOrientationL( TDisplayOrientation aOrientation ) + { + MUS_LOG1( "mus: [ENGINE] -> CMusEngTwoWaySession::SetOrientationL() %d", + aOrientation ) + + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + CMceDisplaySink* display = MusEngMceUtils::GetReceivingDisplay( *iSession ); + CMceDisplaySink* vfDisplay = MusEngMceUtils::GetDisplayL( *iSession, ETrue ); + + CMceDisplaySink::TRotation rotation = ( aOrientation == EPortrait ) ? + CMceDisplaySink::ENone : CMceDisplaySink::EClockwise90Degree; + + vfDisplay->SetRotationL( rotation ); + if ( display ) + { + display->SetRotationL( rotation ); + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWaySession::SetOrientationL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWaySession::RecordL( TBool aRecord ) + { + MUS_LOG1( "mus: [ENGINE] -> CMusEngTwoWaySession::RecordL( %d )", aRecord ) + + User::Leave( KErrNotSupported ); + + MUS_LOG1( "mus: [ENGINE] <- CMusEngTwoWaySession::RecordL( %d )", aRecord ) + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool CMusEngTwoWaySession::IsRecording() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWaySession::IsRecording()" ) + + return EFalse; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMusEngTwoWaySession::SetRectsL( + const TRect& aRemoteRect, + const TRect& aLocalRect ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWaySession::SetRectsL()" ) + + iLocalRect = aLocalRect; + iRect = aRemoteRect; + RectChangedL(); + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWaySession::SetRectsL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CMusEngTwoWaySession::SetLocalRectL( const TRect& aLocalRect ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWaySession::SetLocalRectL()" ) + + iLocalRect = aLocalRect; + RectChangedL(); + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWaySession::SetLocalRectL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TRect CMusEngTwoWaySession::LocalRect() const + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWaySession::LocalRect()" ) + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWaySession::LocalRect()" ) + return iLocalRect; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWaySession::RectChangedL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWaySession::RectChangedL()" ) + + // If session is not yet created, do nothing + if ( iSession && iSession->State() != CMceSession::ETerminated ) + { + TRect remoteRect( Rect() ); + MUS_LOG2( "mus: [ENGINE] remote tl.ix=%d tl.iy=%d", + remoteRect.iTl.iX, remoteRect.iTl.iY ) + MUS_LOG2( "mus: [ENGINE] remote br.ix=%d br.iy=%d", + remoteRect.iBr.iX, remoteRect.iBr.iY ) + MUS_LOG2( "mus: [ENGINE] local tl.ix=%d tl.iy=%d", + iLocalRect.iTl.iX, iLocalRect.iTl.iY ) + MUS_LOG2( "mus: [ENGINE] local br.ix=%d br.iy=%d", + iLocalRect.iBr.iX, iLocalRect.iBr.iY ) + + CMceDisplaySink* display = MusEngMceUtils::GetReceivingDisplay( *iSession ); + if ( display ) + { + display->SetDisplayRectL( remoteRect ); + } + CMceDisplaySink* vfDisplay = MusEngMceUtils::GetDisplayL( *iSession, ETrue ); + vfDisplay->SetDisplayRectL( iLocalRect ); + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWaySession::RectChangedL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWaySession::CompleteSessionStructureL( + CMceStreamBundle& /*aLocalBundle*/ ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWaySession::CompleteSessionStructureL()" ) + + __ASSERT_ALWAYS( iSession, User::Leave( KErrNotReady ) ); + + iCameraHandler.SetSession( iSession ); + + // Create outgoing video stream + CMceVideoStream* videoStream = CMceVideoStream::NewLC(); + + CMceRtpSink* rtpsink = CMceRtpSink::NewLC(); + videoStream->AddSinkL( rtpsink ); + CleanupStack::Pop( rtpsink ); + + CMceCameraSource* camera = CMceCameraSource::NewLC( *iManager ); + camera->DisableL(); // Start session in pause mode. + + iCameraHandler.InitializeL( *camera ); + + videoStream->SetSourceL( camera ); + CleanupStack::Pop( camera ); + + // Create incoming video stream + CMceVideoStream* videoInStream = CMceVideoStream::NewL(); + CleanupStack::PushL( videoInStream ); + + MusEngMceUtils::AddDisplayL( *videoInStream, *iManager, Rect() ); + + CMceRtpSource* rtpSource = CMceRtpSource::NewLC( KMusEngJitterBufferLength, + KMusEngJitterBufferTreshold ); + videoInStream->SetSourceL( rtpSource ); + CleanupStack::Pop( rtpSource ); + + videoStream->BindL( videoInStream ); + CleanupStack::Pop( videoInStream ); + + iSession->AddStreamL( videoStream ); + CleanupStack::Pop( videoStream ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWaySession::CompleteSessionStructureL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWaySession::AddDisplayL( CMceMediaStream& aStream ) + { + MusEngMceUtils::AddDisplayL( aStream, + *iManager, + iLocalRect ); + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWaySession::StreamStateChanged( CMceMediaStream& aStream ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWaySession::StreamStateChanged()" ) + if ( !iSession ) + { + return; + } + + MUS_ENG_LOG_STREAM_STATE( aStream ) + + if ( aStream.Type() == KMceVideo && + aStream.Source() && + aStream.Source()->Type() == KMceRTPSource ) + { + if ( aStream.State() == CMceMediaStream::EStreaming ) + { + ReceivingStarted(); + } + else if ( aStream.State() == CMceMediaStream::EBuffering ) + { + iBuffered = ETrue; + } + } + + CMusEngMceSession::StreamStateChanged( aStream ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWaySession::StreamStateChanged()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWaySession::InactivityTimeout( CMceMediaStream& aStream, + CMceRtpSource& /*aSource*/ ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWaySession::InactivityTimeout()" ) + + if ( aStream.Type() == KMceVideo ) + { + ReceivingStopped(); + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWaySession::InactivityTimeout()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWaySession::HandleSessionStateChanged( + CMceSession& aSession, + TInt aStatusCode, + const TDesC8& aReasonPhrase ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWaySession::HandleSessionStateChanged" ) + + MUS_ENG_LOG_SESSION_STATE_AND_STATUS( aSession, aStatusCode, aReasonPhrase ) + + TBool consumed( EFalse ); + if ( iSession && + iSession == &aSession && + aSession.State() == CMceSession::EEstablished ) + { + // TODO: if receiving stream is disabled, inform ui with some callback + // that it can modify display rects accordingly and continue with + // session. + CMceVideoStream* stream = NULL; + CMceVideoStream* streamout = NULL; + TRAPD( err, stream = MusEngMceUtils::GetVideoInStreamL( *iSession ) ); + TRAPD( errout, streamout = MusEngMceUtils::GetVideoOutStreamL( *iSession ) ); + if ( err == KErrNone && stream && stream->IsEnabled() ) + { + if ( errout != KErrNone || !streamout || !streamout->IsEnabled() ) + { + MUS_LOG( "mus: [ENGINE] sendrecv downgraded to recvonly, terminate!" ) + consumed = ETrue; + iSessionObserver.SessionFailed(); + } + } + else + { + if ( errout == KErrNone && streamout && streamout->IsEnabled() ) + { + MUS_LOG( "mus: [ENGINE] sendrecv downgraded to sendonly, continue!" ) + } + } + } + + if ( !consumed ) + { + CMusEngLiveSession::HandleSessionStateChanged( aSession, + aStatusCode, + aReasonPhrase ); + } + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWaySession::HandleSessionStateChanged" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusEngTwoWaySession::CMusEngTwoWaySession( + MMusEngSessionObserver& aSessionObserver, + MMusEngOutSessionObserver& aOutSessionObserver, + MMusEngLiveSessionObserver& aLiveSessionObserver, + MMusEngTwoWaySessionObserver& aTwoWayObserver, + const TRect& aRemoteRect, + const TRect& aLocalRect ) : + CMusEngLiveSession( aSessionObserver, + aOutSessionObserver, + aLiveSessionObserver, + aRemoteRect, + KNullDesC ), + iTwoWayObserver( aTwoWayObserver ), + iLocalRect( aLocalRect ) + { + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWaySession::ConstructL() + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWaySession::ConstructL()" ) + + CMusEngLiveSession::ConstructL(); + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWaySession::ConstructL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWaySession::ReceivingStarted() + { + if ( iSession && !iReceiving && iBuffered ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWaySession::ReceivingStarted()" ) + + TInt err( KErrNone ); + CMceMediaSource* source = NULL; + TRAP( err, source = + MusEngMceUtils::GetVideoInStreamL( *iSession )->Source() ); + if ( source && source->Type() == KMceRTPSource ) + { + CMceRtpSource* rtpSource = static_cast( source ); + TRAP( err, rtpSource->EnableInactivityTimerL( + KMusEngTwoWayReceivingActivityTimeout ) ) + } + + if ( err != KErrNone ) + { + MUS_LOG1("mus: [ENGINE] ReceivingStarted failed %d", err) + iSessionObserver.SessionFailed(); + } + else + { + iReceiving = ETrue; + iTwoWayObserver.ReceivingStateChanged( ETrue ); + } + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWaySession::ReceivingStarted()" ) + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusEngTwoWaySession::ReceivingStopped() + { + if ( iReceiving ) + { + MUS_LOG( "mus: [ENGINE] -> CMusEngTwoWaySession::ReceivingStopped()" ) + + iReceiving = EFalse; + iTwoWayObserver.ReceivingStateChanged( EFalse ); + + MUS_LOG( "mus: [ENGINE] <- CMusEngTwoWaySession::ReceivingStopped()" ) + } + } + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/musenginestub/src/musenguriparser.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/musenginestub/src/musenguriparser.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,281 @@ +/* +* 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: Parser for recipient's address +* +*/ + + +#include "musenguriparser.h" +#include "mussettings.h" +#include "muslogger.h" + +#include +#include +//#include +#include +#include + + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// UTF7 is not working, since it converts + as +- +// ----------------------------------------------------------------------------- +// +EXPORT_C TMusEngUriParser::TMusEngUriParser( const TDesC16& aUri ) + :iUriType( ENotParsed ) + { + TBuf8 buf; + + if ( CnvUtfConverter::ConvertFromUnicodeToUtf8( buf, aUri ) == 0 ) + { + iUri = buf; + } + else + { + iUri = KNullDesC8(); + } + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C TMusEngUriParser::TMusEngUriType TMusEngUriParser::UriType() + { + return iUriType; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C HBufC8* TMusEngUriParser::GetUri8L() + { + MUS_LOG( "mus: [ENGINE] -> TMusEngUriParser::GetUri8L()" ) + + __ASSERT_ALWAYS( UriType() != TMusEngUriParser::ENotParsed, + User::Leave( KErrNotReady ) ); + + HBufC8* uri8 = iUri.AllocL(); + + MUS_LOG( "mus: [ENGINE] <- TMusEngUriParser::GetUri8L()" ) + + return uri8; + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C HBufC16* TMusEngUriParser::GetUri16L( TBool aPrefix ) + { + MUS_LOG( "mus: [ENGINE] -> TMusEngUriParser::GetUri16L()" ) + + __ASSERT_ALWAYS( UriType() != TMusEngUriParser::ENotParsed, + User::Leave( KErrNotReady ) ); + + HBufC16* uri16 = NULL; + + if ( aPrefix ) + { + uri16 = CnvUtfConverter::ConvertToUnicodeFromUtf8L( iUri ); + } + else + { + uri16 = CnvUtfConverter::ConvertToUnicodeFromUtf8L( + iUri.Mid( KMusEngTelPrefix().Length() ) ); + } + + MUS_LOG( "mus: [ENGINE] <- TMusEngUriParser::GetUri16L()" ) + + return uri16; + + } + + +// ----------------------------------------------------------------------------- +// +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void TMusEngUriParser::ParseUriL() + { + MUS_LOG( "mus: [ENGINE] -> TMusEngUriParser::ParseUriL()" ) + + if ( iUri.Find( KMusEngAtSign ) >= 0 ) // Sip uri + { + HandleSipUriL(); + } + else if ( iUri.Find( KMusEngPlusSign ) >= 0 ) // Tel uri + { + HandleTelUriL(); + } + else + { + // check for variant + if ( MultimediaSharingSettings::OperatorVariantSettingL() + != MusSettingsKeys::EOperatorSpecific ) + {// basic behaviour + MUS_LOG( "mus: [ENGINE] -> TMusEngUriParser::ParseUriL() \ + normal behaviour" ) + User::Leave( KErrCorrupt ); + } + else + { // variant behaviour(local tel uri) + HandleLocalTelUriL(); + } + } + } + + +// ----------------------------------------------------------------------------- +// +// +// ----------------------------------------------------------------------------- +// +void TMusEngUriParser::HandleSipUriL() + { + if ( iUri.FindF( KMusEngTelPrefix() ) == 0 ) + { + // SIP uri with prefix "tel:" + User::Leave( KErrCorrupt ); + } + else if ( iUri.FindF( KMusEngSipPrefix() ) != 0 ) + { + // SIP uri without prefix + if ( iUri.Length() + KMusEngSipPrefix().Length() <= + KMaxUriLength ) + { + iUri.Insert( 0, KMusEngSipPrefix() ); + } + else + { + User::Leave( KErrCorrupt ); + } + } + else + { + // SIP uri with prefix + iUri.Replace( 0, KMusEngSipPrefix().Length(), KMusEngSipPrefix() ); + } + + TUriParser8 parser; + + User::LeaveIfError( parser.Parse( iUri ) ); + + User::LeaveIfError( parser.Validate() ); + + iUriType = TMusEngUriParser::ESip; + } + + + + +// ----------------------------------------------------------------------------- +// +// +// ----------------------------------------------------------------------------- +// +void TMusEngUriParser::HandleTelUriL() + { + if ( iUri.FindF( KMusEngTelPrefix() ) != 0 ) + { + // Tel uri without prefix + if ( iUri.Length() + KMusEngTelPrefix().Length() <= + KMaxUriLength ) + { + iUri.Insert( 0, KMusEngTelPrefix() ); + } + else + { + User::Leave( KErrCorrupt ); + } + } + else + { + //Tel uri with prefix + iUri.Replace( 0, KMusEngTelPrefix().Length(), KMusEngTelPrefix() ); + } + + TInt index = KMusEngTelPrefix().Length() + KMusEngPlusSign().Length(); + + while ( index < iUri.Length() ) + { + TChar character = iUri[ index ]; + if ( !character.IsDigit() ) + { + User::Leave( KErrCorrupt ); + } + ++index; + } + + iUriType = TMusEngUriParser::ETel; + } + + +// ----------------------------------------------------------------------------- +// +// +// ----------------------------------------------------------------------------- +// +void TMusEngUriParser::HandleLocalTelUriL() + { + MUS_LOG( "mus: [ENGINE] -> TMusEngUriParser::ParseUriL() \ + variant behaviour" ) + if ( iUri.FindF( KMusEngTelPrefix() ) != 0 ) + { + // local tel uri without prefix + if ( iUri.Length() + KMusEngTelPrefix().Length() <= + KMaxUriLength ) + { + iUri.Insert( 0, KMusEngTelPrefix() ); + } + else + { + User::Leave( KErrCorrupt ); + } + } + else + { + //Tel uri with prefix + iUri.Replace( + 0, + KMusEngTelPrefix().Length(), + KMusEngTelPrefix() ); + } + + TInt index = KMusEngTelPrefix().Length(); + + // check if all chars are digits + while ( index < iUri.Length() ) + { + TChar character = iUri[ index ]; + if ( !character.IsDigit() ) + { + User::Leave( KErrCorrupt ); + } + ++index; + } + + iUriType = TMusEngUriParser::ETel; + } + + +// End of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/musenginestub/src/mussipprofilehandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/musenginestub/src/mussipprofilehandler.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,448 @@ +/* +* 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: Utilities to get and set profile used with SWIS. +* Part of : Mus For S60 v3.2 +* Description : Utilities to get and set profile used with SWIS. +* Version : %version: 1 % << Don't touch! Updated by Synergy at check-out. +* +*/ + + +// USER +#include "mussipprofilehandler.h" +#include "musuid.hrh" +#include "muslogger.h" +#include "mussipprofileuser.h" + +// SYSTEM +#include +#include +#include +#include +#include +#include +#include + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusSipProfileHandler* CMusSipProfileHandler::NewL( MMusSipProfileUser& aUser ) + { + CMusSipProfileHandler* self = + new (ELeave) CMusSipProfileHandler( aUser ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self); + return self; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusSipProfileHandler::CMusSipProfileHandler( MMusSipProfileUser& aUser ) + : iUser( aUser ) + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusSipProfileHandler::ConstructL() + { + MUS_LOG( "mus: [ENGINE] -> CMusSipProfileHandler::ConstructL()" ) + + // Use NULL Uid since we do not want to receive any requests. + // All requests should be handled by MCE. + iSip = CSIP::NewL( TUid::Null(), *this ); + iProfileRegistry = CSIPProfileRegistry::NewL( *iSip, *this ); + iProfileAlrController = + CSipProfileAlrController::NewL( *iProfileRegistry , *this ); + + MUS_LOG( "mus: [ENGINE] <- CMusSipProfileHandler::ConstructL()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CMusSipProfileHandler::~CMusSipProfileHandler() + { + delete iProfileAlrController; + delete iSipProfile; + delete iProfileRegistry; + delete iSip; + MUS_LOG( "mus: [ENGINE] CMusSipProfileHandler::~CMusSipProfileHandler()" ) + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusSipProfileHandler::CreateProfileL( TUint32 aSipProfileId ) + { + CSIPProfile* profile( NULL ); + if ( aSipProfileId != 0 ) + { + profile = iProfileRegistry->ProfileL( aSipProfileId ); + } + else + { + profile = iProfileRegistry->DefaultProfileL(); + } + + delete iSipProfile; + iSipProfile = profile; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CSIPProfile* CMusSipProfileHandler::Profile() + { + return iSipProfile; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +CUri8* CMusSipProfileHandler::UserFromProfileLC() + { + MUS_LOG( "mus: [ENGINE] -> CMusSipProfileHandler::UserFromProfileLC()" ); + + __ASSERT_ALWAYS( iSipProfile != NULL, User::Leave( KErrNotReady ) ); + + const MDesC8Array* aors = NULL; + User::LeaveIfError( iSipProfile->GetParameter( KSIPRegisteredAors, aors ) ); + __ASSERT_ALWAYS( aors && aors->MdcaCount() > 0, + User::Leave( KErrArgument ) ); + + TUriParser8 parser; + User::LeaveIfError( parser.Parse( aors->MdcaPoint( 0 ) ) ); + MUS_LOG( "mus: [ENGINE] <- CMusSipProfileHandler::UserFromProfileLC()" ) + + return CUri8::NewLC( parser ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusSipProfileHandler::RefreshIapAvailabilities() + { + TRAP_IGNORE( iProfileAlrController->RefreshIapAvailabilityL( ProfileId() ) ) + } + + +// ----------------------------------------------------------------------------- +// This function should never be called before creating a profile, but such +// a situation will be considered as pending registration. +// ----------------------------------------------------------------------------- +// +TBool CMusSipProfileHandler::IsRegistered() + { + MUS_LOG( "mus: [ENGINE] -> CMusSipProfileHandler::IsRegistered()" ) + + TBool profileRegistered = EFalse; + if ( iSipProfile ) + { + iSipProfile->GetParameter( KSIPProfileRegistered, profileRegistered ); + } + + MUS_LOG1( "mus: [ENGINE] <- CMusSipProfileHandler::IsRegistered( %d )", + profileRegistered ) + + return profileRegistered; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusSipProfileHandler::ProfileRegistryEventOccurred( + TUint32 aProfileId, + MSIPProfileRegistryObserver::TEvent aEvent ) + { + if ( iSipProfile && aProfileId == ProfileId() ) + { + switch ( aEvent ) + { + case MSIPProfileRegistryObserver::EProfileRegistered: + { + iUser.ProfileRegistered(); + break; + } + default: + { + break; + } + } + } + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusSipProfileHandler::ProfileRegistryErrorOccurred( + TUint32 /*aProfileId*/, + TInt /*aError*/) + { + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusSipProfileHandler::IncomingRequest( + TUint32 /*aIapId*/, + CSIPServerTransaction* aTransaction ) + { + // Ownership transferred, should not ever be called by SIP though + delete aTransaction; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusSipProfileHandler::TimedOut( + CSIPServerTransaction& /*aTransaction*/ ) + { + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusSipProfileHandler::IncomingRequest( + CSIPServerTransaction* aTransaction ) + { + // Ownership transferred, should not ever be called by SIP though + delete aTransaction; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusSipProfileHandler::IncomingRequest( + CSIPServerTransaction* aTransaction, + CSIPDialog& /*aDialog*/) + { + // Ownership transferred, should not ever be called by SIP though + delete aTransaction; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusSipProfileHandler::IncomingResponse( + CSIPClientTransaction& /*aTransaction*/) + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusSipProfileHandler::IncomingResponse( + CSIPClientTransaction& /*aTransaction*/, + CSIPDialogAssocBase& /*aDialogAssoc*/) + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusSipProfileHandler::IncomingResponse( + CSIPClientTransaction& /*aTransaction*/, + CSIPInviteDialogAssoc* aDialogAssoc) + { + // Ownership transferred, should not ever be called by SIP though + delete aDialogAssoc; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusSipProfileHandler::IncomingResponse( + CSIPClientTransaction& /*aTransaction*/, + CSIPRegistrationBinding& /*aRegistration*/ ) + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusSipProfileHandler::ErrorOccured( + TInt /*aError*/, + CSIPTransactionBase& /*aTransaction*/ ) + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusSipProfileHandler::ErrorOccured( + TInt /*aError*/, + CSIPClientTransaction& /*aTransaction*/, + CSIPRegistrationBinding& /*aRegistration*/ ) + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusSipProfileHandler::ErrorOccured( + TInt /*aError*/, + CSIPTransactionBase& /*aTransaction*/, + CSIPDialogAssocBase& /*aDialogAssoc*/ ) + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusSipProfileHandler::ErrorOccured( + TInt /*aError*/, + CSIPRefresh& /*aSIPRefresh*/ ) + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusSipProfileHandler::ErrorOccured( + TInt /*aError*/, + CSIPRegistrationBinding& /*aRegistration*/ ) + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusSipProfileHandler::ErrorOccured( + TInt /*aError*/, + CSIPDialogAssocBase& /*aDialogAssoc*/ ) + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusSipProfileHandler::InviteCompleted( + CSIPClientTransaction& /*aTransaction*/ ) + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusSipProfileHandler::InviteCanceled( + CSIPServerTransaction& /*aTransaction*/ ) + { + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CMusSipProfileHandler::ConnectionStateChanged( + CSIPConnection::TState /*aState*/ ) + { + } + +// ----------------------------------------------------------------------------- +// CMusSipProfileHandler::AlrEvent +// From MSipProfileAlrObserver +// ----------------------------------------------------------------------------- +// +void CMusSipProfileHandler::AlrEvent( + MSipProfileAlrObserver::TEvent aEvent, + TUint32 aProfileId, + TUint32 /*aSnapId*/, + TUint32 aIapId ) + { + if ( aEvent == MSipProfileAlrObserver::EIapAvailable ) + { + if ( iSipProfile && + aProfileId == ProfileId() && + !iUser.IsRoamingBetweenAPsAllowed() ) + { + // Disallow roaming only if the profile is used by MuS and + // the MuS has an ongoing session + TRAP_IGNORE( + iProfileAlrController->DisallowMigrationL( aProfileId, aIapId ) ) + } + else + { + // In all other cases allow roaming + TRAP_IGNORE( + iProfileAlrController->AllowMigrationL( aProfileId, aIapId ) ) + } + } + } + +// ----------------------------------------------------------------------------- +// CMusSipProfileHandler::AlrError +// From MSipProfileAlrObserver +// ----------------------------------------------------------------------------- +// +void CMusSipProfileHandler::AlrError( + TInt /*aError*/, + TUint32 /*aProfileId*/, + TUint32 /*aSnapId*/, + TUint32 /*aIapId*/ ) + { + // Ignore ALR related errors as they should not happen + // as migration is not allowed when + // the instance of CMusSipProfileHandler exists + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TUint32 CMusSipProfileHandler::ProfileId() const + { + TUint32 sipProfileId( 0 ); + if ( iSipProfile ) + { + iSipProfile->GetParameter( KSIPProfileId, sipProfileId ); + } + return sipProfileId; + } diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/musmanagerstub/group/musmanagerstub.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/musmanagerstub/group/musmanagerstub.mmp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,43 @@ +/* +* Copyright (c) 2006-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: Definition of project MultimediaSharing for S60 3.2 +* +*/ + + +// To get the APP_LAYER_SYSTEMINCLUDE-definition +#include +#include +#include + +TARGET musmanagerstub.dll +TARGETTYPE dll +UID 0x1000008d 0x101fbfef + +CAPABILITY EUNIT_CAPS +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE musmanagerstub.cpp + +USERINCLUDE ../src +USERINCLUDE ../../../../common/inc + +// Default system include paths for application layer modules. +APP_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib + + +//EXPORTUNFROZEN \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/musmanagerstub/inc/musmanagerstub.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/musmanagerstub/inc/musmanagerstub.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,192 @@ +/* +* 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: ?Description +* +*/ + + +#ifndef MUSMANAGER_H +#define MUSMANAGER_H + + +#include "musmanagercommon.h" + +#include +#include + + + +class CMusManagerImpl; + +#undef IMPORT_C +#define IMPORT_C +/** + * ?one_line_short_description + * + * ?more_complete_description + * + * @lib ?library + * @since S60 ?S60_version *** for example, S60 v3.0 + */ +class CMusManager : public CBase + { +public: + enum TRequestType + { + ESipOptions = 0x1028238D, + ESipInviteDesired = 0x10282391, + ESipInviteDesired2WayVideo = 0x10282392, + ESipInviteNotDesired = 0x1028238D + }; + +public: // first phase constructors + + IMPORT_C static CMusManager* NewL(); + + IMPORT_C static CMusManager* NewLC(); + + virtual ~CMusManager(); + + +public: // new functions + /** + * This function causes following things: + * - MS manager starts to monitor call and network state + * - In case of active call, MS manager + * - resolves the SIP address of the remote host + * - makes a capability query (SIP OPTIONS) + * + * This function must be called before a MultimediaSharing + * session is tried to be established. Otherwise, the internal state of + * MultimediaSharing will remain as undefined. In that state, + * MultimediaSharing Manager will not start the application. + * + * @since S60 v3.2 + */ + IMPORT_C void ExamineAvailabilityL(); + + /** + * This function allows clients to monitor the availability + * status of MultimediaSharing. + * + * The request will return when the availability status changes. + * + * @since S60 v3.2 + * @param aStatus TRequestStatus object of the listener. + * @param aAvailabilityStatus Contains the new status, when request complete. + */ + IMPORT_C void MonitorAvailabilityL( + TRequestStatus& aRequestStatus, + MultimediaSharing::TMusAvailabilityStatus& aAvailabilityStatus ); + + /** + * Cancels the currently active availability monitoring. + * + * @since S60 v3.2 + */ + IMPORT_C void CancelMonitoring(); + + /** + * Returns the current availability status. + * + * @since S60 v3.2 + * @return The current availability status. + */ + IMPORT_C MultimediaSharing::TMusAvailabilityStatus AvailabilityL(); + + +public: // functions related to application start-up + + /** + * This function allows clients to request coomand's to be executed by + * the MUS manager server. + * + * In erroneous cases, this function will leave + * with an error code that describes the error. Positive leave codes + * are defined in MultimediaSharing::TMusAvailabilityStatus. + * + * @param aRequest Defines the coomand type. + * + */ + IMPORT_C void HandleCommandL( MultimediaSharing::TCommandType aCommandType ); + + + /** + * Orders MultimediaSharing subsystem to handle a SIP request. + * In some cases, this function call starts the application. + * + * In erroneous cases, this function will leave + * with an error code that describes the error. Positive leave codes + * are defined in MultimediaSharing::TMusAvailabilityStatus. + * + * @param aRequest Defines the request type. + * Must be SipStrConsts::EOptions or SipStrConsts::EInvite + */ + IMPORT_C void HandleSipRequestL( TRequestType aRequestType ); + + /** + * Starts the MultimediaSharing application + * + * If the application can't be started, this function will leave + * with an error code that describes the error. Positive leave codes + * are defined in MultimediaSharing::TMusAvailabilityStatus. + * + * @param aUseCase Describes the desired use case and + affects the default view. + */ + IMPORT_C void StartApplicationL( MultimediaSharing::TMusUseCase aUseCase ); + + +public: // functions to related application closing + + /** + * This function causes the application to get a stop signal. + * Application will close itself smoothly. + * + * @since S60 v3.2 + */ + IMPORT_C void StopApplicationL(); + +private: // second phase constructors + + CMusManager(); + + void ConstructL(); + + +public: // new functions for testing purposes + + IMPORT_C static void SetStartError( TInt aError ); + + IMPORT_C static void SetAvailability( TInt aAvailability ); + + IMPORT_C static void SetUseCase( MultimediaSharing::TMusUseCase aUseCase ); + + IMPORT_C static MultimediaSharing::TMusUseCase UseCase(); + +public: // data + + MultimediaSharing::TMusAvailabilityStatus iAvailability; + + TInt iExamineLeaveCode; + + TInt iStartError; + + TRequestStatus* iStatus; + + TRequestType iHandleSipRequestLCalledWithParam; + + }; + +#endif // ? C_CLASSNAME_H diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/musmanagerstub/src/musmanagerstub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/musmanagerstub/src/musmanagerstub.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,158 @@ +/* +* 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: ?Description +* +*/ + + +#include "musmanagerstub.h" +#include + +#include + +static TInt StartError = KErrNone; +static TInt Availability = KErrNone; +static MultimediaSharing::TMusUseCase useCase = MultimediaSharing::EMusContinue; + +EXPORT_C void CMusManager::SetStartError( TInt aError ) + { + StartError = aError; + } + +EXPORT_C void CMusManager::SetAvailability( TInt aAvailability ) + { + Availability = aAvailability; + } + +EXPORT_C void CMusManager::SetUseCase( MultimediaSharing::TMusUseCase aUseCase ) + { + useCase = aUseCase; + } + +EXPORT_C MultimediaSharing::TMusUseCase CMusManager::UseCase() + { + return useCase; + } + +// ----------------------------------------------------------------------------- +// ?description_if_needed +// ----------------------------------------------------------------------------- +// +CMusManager::CMusManager() + :iStartError(KErrNone), + iExamineLeaveCode(KErrNone), + iAvailability( ( MultimediaSharing::TMusAvailabilityStatus ) KErrGeneral) + { + + + + } + +// ----------------------------------------------------------------------------- +// ?description_if_needed +// ----------------------------------------------------------------------------- +// +void CMusManager::ConstructL() + { + } + + +// ----------------------------------------------------------------------------- +// ?description_if_needed +// ----------------------------------------------------------------------------- +// +EXPORT_C CMusManager* CMusManager::NewL() + { + CMusManager* self = CMusManager::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// --------------------------------------------------------------------------- +// ?description_if_needed +// --------------------------------------------------------------------------- +// +EXPORT_C CMusManager* CMusManager::NewLC() + { + CMusManager* self = new( ELeave ) CMusManager; + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// --------------------------------------------------------------------------- +// ?description_if_needed +// --------------------------------------------------------------------------- +// +CMusManager::~CMusManager() + { + } + +EXPORT_C void CMusManager::ExamineAvailabilityL() + { + if( iExamineLeaveCode != KErrNone ) + { + User::Leave( iExamineLeaveCode ); + } + } + +EXPORT_C MultimediaSharing::TMusAvailabilityStatus CMusManager::AvailabilityL() + { + return ( MultimediaSharing::TMusAvailabilityStatus ) Availability; + } + +EXPORT_C void CMusManager::HandleSipRequestL( TRequestType aChannelId ) + { + iHandleSipRequestLCalledWithParam = aChannelId; + } + +EXPORT_C void CMusManager::StartApplicationL( MultimediaSharing::TMusUseCase aUseCase ) + { + if( StartError != KErrNone ) + { + User::Leave( StartError ); + } + + useCase = aUseCase; + } + +EXPORT_C void CMusManager::StopApplicationL() + { + } + +EXPORT_C void CMusManager::MonitorAvailabilityL( + TRequestStatus& aRequestStatus, + MultimediaSharing::TMusAvailabilityStatus& /*aAvailabilityStatus*/ ) + { + iStatus = &aRequestStatus; + } + +EXPORT_C void CMusManager::CancelMonitoring() + { + RThread thread; + + thread.RequestComplete( iStatus, KErrNone ); + + thread.Close(); + } + + +EXPORT_C void CMusManager::HandleCommandL( MultimediaSharing::TCommandType /*aCommandType*/ ) + { + + } + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mustestapp/data/mustestapp.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mustestapp/data/mustestapp.rss Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,218 @@ +/* +* Copyright (c) 2002-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: This file contains all the resources for the AiwTestApp. +* Initial content was generated by Series 60 AppWizard. +* +*/ + +// RESOURCE IDENTIFIER +NAME AIWT // 4 letter ID + +// INCLUDES +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "aiwtestapp.hrh" +#include "aiwtestapp.loc" + +// RESOURCE DEFINITIONS +RESOURCE RSS_SIGNATURE { } +RESOURCE TBUF { buf = "MusTestApp"; } + +//---------------------------------------------------- +// +// eik_app_info +// +//---------------------------------------------------- +// +RESOURCE EIK_APP_INFO + { + hotkeys = r_aiwtest_hotkeys; + menubar = r_aiwtest_menubar; + cba = R_AVKON_SOFTKEYS_OPTIONS_BACK; + } + +//---------------------------------------------------- +// +// r_aiwtest_hotkeys +// +//---------------------------------------------------- +// +RESOURCE HOTKEYS r_aiwtest_hotkeys + { + control = + { + HOTKEY { command = EAknCmdExit; key='e'; } + }; + } + +//---------------------------------------------------- +// +// r_aiwtest_menubar +// +//---------------------------------------------------- +// +RESOURCE MENU_BAR r_aiwtest_menubar + { + titles = + { + MENU_TITLE { menu_pane = r_aiwtest_menu; txt = "File"; } + //MENU_TITLE { menu_pane = r_umasettings_main_menu; txt = "File"; } + }; + } + +//---------------------------------------------------- +// +// r_aiwtest_menu +// +//---------------------------------------------------- +// +RESOURCE MENU_PANE r_aiwtest_menu + { + items = + { + MENU_ITEM { command = 1000; txt = "Manager: Availability inv."; }, + MENU_ITEM { command = 1001; txt = "Manager: Start live"; }, + MENU_ITEM { command = 1002; txt = "Direct: Availability inv."; }, + MENU_ITEM { command = 100000; txt = "Video Sharing"; cascade = AIW_INTELLIGENT_CASCADE_ID; }, + //MENU_ITEM { command = 100001; txt = "Video Sharing"; cascade = AIW_INTELLIGENT_CASCADE_ID| AIW_LOCK_SUBMENU_TITLE; }, + MENU_ITEM { command = EAknCmdExit; txt = qtn_options_exit; } + }; + } + +// ----------------------------------------------------------------------------- +// +// r_core_info_message_query +// +// ----------------------------------------------------------------------------- +// +RESOURCE DIALOG r_core_info_message_query + { + flags = EGeneralQueryFlags | EEikDialogFlagNoBorder | EEikDialogFlagNoShadow; + buttons = R_AVKON_SOFTKEYS_OK_CANCEL; + items= + { + DLG_LINE + { + type = EAknCtPopupHeadingPane; + id = EAknMessageQueryHeaderId; + control = AVKON_HEADING + { + label = "Core info"; + headinglayout = R_AVKON_WML_SIGN_QUERY_HEADING_PANE; + }; + }, + DLG_LINE + { + type = EAknCtMessageQuery; + id = EAknMessageQueryContentId; + control = AVKON_MESSAGE_QUERY + { + message = "a"; + }; + } + }; + } + +// ----------------------------------------------------------------------------- +// +// r_aiwtest_localisable_app_info +// +// ----------------------------------------------------------------------------- +// +RESOURCE LOCALISABLE_APP_INFO r_aiwtest_localisable_app_info + { + short_caption = "MusTestApp"; + caption_and_icon = + CAPTION_AND_ICON_INFO + { + caption = "MusTestApp"; +#ifdef __SCALABLE_ICONS + number_of_icons = 1; +#else + number_of_icons = 2; +#endif + }; + } + +// ----------------------------------------------------------------------------- +// +// r_aiwtestapp_submenu +// +// ----------------------------------------------------------------------------- +// +RESOURCE MENU_PANE r_aiwtestapp_submenu + { + items = + { + MENU_ITEM { command = 100000; txt = ""; } + }; + } + +// ----------------------------------------------------------------------------- +// +// r_aiwtestapp_interest +// +// ----------------------------------------------------------------------------- +// +RESOURCE AIW_INTEREST r_aiwtestapp_interest + { + items = + { + // This application is interested in printing jpeg images + // from menu. + AIW_CRITERIA_ITEM + { + id = 100000; + serviceCmd = KAiwCmdShare; + serviceClass = KAiwClassMenu; + contentType = "*"; + defaultProvider = 0x10282389; + maxProviders = 1; + } + }; + } + +// ----------------------------------------------------------------------------- +// +// r_aiwtestapp_baseinterest +// +// ----------------------------------------------------------------------------- +// +RESOURCE AIW_INTEREST r_aiwtestapp_baseinterest + { + items = + { + // This application is interested in printing jpeg images + // from menu. + AIW_CRITERIA_ITEM + { + id = 100000; + serviceCmd = KAiwCmdShare; + serviceClass = KAiwClassMenu; + contentType = "*"; + defaultProvider = 0x10282389; + maxProviders = 1; + } + }; + } + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mustestapp/data/mustestapp_reg.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mustestapp/data/mustestapp_reg.rss Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,32 @@ +/* +* Copyright (c) 2002-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: +* +*/ + +#include +#include +#include + +UID2 KUidAppRegistrationResourceFile +UID3 0x1028239B // Define your application UID here + +RESOURCE APP_REGISTRATION_INFO + { + app_file = "mustestapp"; + localisable_resource_file = APP_RESOURCE_DIR"\\MusTestApp"; + localisable_resource_id = R_AIWTEST_LOCALISABLE_APP_INFO; + } + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mustestapp/group/AiwTestApp.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mustestapp/group/AiwTestApp.mmp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,92 @@ +/* +* Copyright (c) 2002-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: +* +*/ + +// To get the APP_LAYER_SYSTEMINCLUDE-definition +#include + +#include +#include + +TARGET musTestApp.exe +TARGETTYPE exe + +UID 0x100039CE 0x1028239B +VENDORID VID_DEFAULT +CAPABILITY CAP_APPLICATION + +EPOCSTACKSIZE 0xF000 + + + +SOURCEPATH ../../../common/src +SOURCE muscallmonitor.cpp +SOURCE muscalleventmonitor.cpp +SOURCE musconferencecallmonitor.cpp + +SOURCEPATH ../src +SOURCE AiwTestAppApp.cpp +SOURCE AiwTestAppAppUi.cpp +SOURCE AiwTestAppContainer.cpp +SOURCE AiwTestAppDocument.cpp + + +START RESOURCE ../data/musTestApp.rss +HEADER +TARGETPATH APP_RESOURCE_DIR +END + +START RESOURCE ../data/musTestApp_reg.rss +DEPENDS mustestapp.rsg +TARGETPATH /private/10003a3f/apps +END + + + +LANG SC + +USERINCLUDE ../inc +USERINCLUDE ../../../common/inc + +// Default system include paths for application layer modules. +APP_LAYER_SYSTEMINCLUDE SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/ecom + +//SOURCEPATH ../data +//DOCUMENT AIWTestApp.rss +//DOCUMENT AIWTestApp_caption.rss + +LIBRARY apparc.lib +LIBRARY avkon.lib +LIBRARY bafl.lib +LIBRARY cone.lib +LIBRARY ecom.lib +LIBRARY eikcoctl.lib +LIBRARY eikcore.lib +LIBRARY euser.lib +LIBRARY fbscli.lib +LIBRARY efsrv.lib +LIBRARY aknskins.lib // for skin background +LIBRARY CdlEngine.lib // for scalable ui +LIBRARY ServiceHandler.lib +LIBRARY flogger.lib +LIBRARY centralrepository.lib +LIBRARY etel.lib +LIBRARY etelmm.lib + +LIBRARY musmanagerclient.lib + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mustestapp/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mustestapp/group/bld.inf Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,44 @@ +/* +* Copyright (c) 2002-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: +* +*/ + +PRJ_PLATFORMS +// Specify the platforms your component needs to be built for here +DEFAULT + +PRJ_EXPORTS +// Specify the source file followed by its destination here +// copy will be used to copy the source file to its destination +// If there's no destination then the source file will be copied +// to the same name in /epoc32/include + +PRJ_MMPFILES +// Specify the .mmp files required for building the important component +// releasables. +// +// Specify "tidy" if the component you need to build doesn't need to be +// released. Specify "ignore" if the MMP file exists but should be +// ignored. +AiwTestApp.mmp + +PRJ_TESTMMPFILES +// specify the .mmp files required for building any test programs here + +PRJ_TESTEXPORTS +// specify the files to be copied from the source directories to the releasables' +// directories for use with test programs. + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mustestapp/group/mce.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mustestapp/group/mce.pkg Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,56 @@ +; +; 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: +; +; A package file for creating an installation file for MCE + + +; Supported languages +&en + +#{"MMcomms"},(0x1020286C),2,0,0,TYPE=SA + + +%{"Vendor-EN"} +:"Nokia" + +(0x101F6F88), 0, 0, 0, {"Series60ProductID"} + + + +; ----------------------------------------------------------------------------------- + +;MCE DLLs +; for S60 3.x +"\epoc32\release\armv5\udeb\mceserver.exe"-"!:\sys\bin\mceserver.exe" +"\epoc32\release\armv5\udeb\mceclient.dll"-"!:\sys\bin\mceclient.dll" +"\epoc32\release\armv5\udeb\fcpluginengine.dll"-"!:\sys\bin\fcpluginengine.dll" +"\epoc32\release\armv5\udeb\MMCCInterface.dll"-"!:\sys\bin\MMCCInterface.dll" +"\epoc32\release\armv5\udeb\MMCCJitterBuffer.dll"-"!:\sys\bin\MMCCJitterBuffer.dll" +"\epoc32\release\armv5\udeb\MMCCSubthreads.dll"-"!:\sys\bin\MMCCSubthreads.dll" +"\epoc32\release\armv5\udeb\FCTBCP.dll"-"!:\sys\bin\FCTBCP.dll" +"\EPOC32\DATA\Z\Resource\Plugins\FCTBCP.RSC"-"!:\resource\plugins\FCTBCP.RSC" + +"\epoc32\release\armv5\udeb\MMCCController.dll"-"!:\sys\bin\MMCCController.dll" +"\EPOC32\DATA\Z\Resource\Plugins\MMCCController.RSC"-"!:\resource\plugins\MMCCController.RSC" +"\epoc32\release\armv5\udeb\MMCCRtpSourceSink.dll"-"!:\sys\bin\MMCCRtpSourceSink.dll" +"\EPOC32\DATA\Z\Resource\Plugins\MMCCRtpSourceSink.RSC"-"!:\resource\plugins\MMCCRtpSourceSink.RSC" +"\epoc32\release\armv5\udeb\MMCCAmrPlFormat.dll"-"!:\sys\bin\MMCCAmrPlFormat.dll" +"\EPOC32\DATA\Z\Resource\Plugins\MMCCAmrPlFormat.RSC"-"!:\resource\plugins\MMCCAmrPlFormat.RSC" +"\epoc32\release\armv5\udeb\MMCCRedPlFormat.dll"-"!:\sys\bin\MMCCRedPlFormat.dll" +"\EPOC32\DATA\Z\Resource\Plugins\MMCCRedPlFormat.RSC"-"!:\resource\plugins\MMCCRedPlFormat.RSC" +"\epoc32\release\armv5\udeb\MMCCDtmfPlFormat.dll"-"!:\sys\bin\MMCCDtmfPlFormat.dll" +"\EPOC32\DATA\Z\Resource\Plugins\MMCCDtmfPlFormat.RSC"-"!:\resource\plugins\MMCCDtmfPlFormat.RSC" +"\epoc32\release\armv5\udeb\MMCCG711PlFormat.dll"-"!:\sys\bin\MMCCG711PlFormat.dll" +"\EPOC32\DATA\Z\Resource\Plugins\MMCCG711PlFormat.RSC"-"!:\resource\plugins\MMCCG711PlFormat.RSC" diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mustestapp/inc/AiwTestApp.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mustestapp/inc/AiwTestApp.hrh Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,33 @@ +/* +* Copyright (c) 2002-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: This file contains declarations for constants of AiwTestApp. +* The file can be included in C++ or resource file. +* Initial content was generated by Series 60 AppWizard. +* +*/ + +#ifndef AIWTESTAPP_HRH +#define AIWTESTAPP_HRH + +enum TAiwTestAppCommandIds + { + EAiwTestAppCmdBATTest = 1, + EAiwTestAppCmdSetLanguage, + EAiwTestAppCmdSetInputMode, + EAiwTestAppCmdCoreInfo, + EAiwTestAppCmdChangeCore, + EAiwTestAppCmdEngineInfo + }; + +#endif // AIWTESTAPP_HRH diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mustestapp/inc/AiwTestApp.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mustestapp/inc/AiwTestApp.loc Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,38 @@ +/* +* Copyright (c) 2002-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: This is a localisation file for AiwTestApp. +* A loc file is the one and only place where the logical strings +* to be localised are defined. +* Initial content was generated by Series 60 AppWizard. +* +*/ + + +// LOCALISATION STRINGS + +// d:Command in options menu. +// d:Example application spesific command. +// l:list_single_popup_submenu_pane_1 +// +#define qtn_appl_test "Test" + +// d:Example caption string for app. +// +#define qtn_app_caption_string "" + +// d:Example short caption string for app. +// +#define qtn_app_short_caption_string "" + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mustestapp/inc/AiwTestAppApp.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mustestapp/inc/AiwTestAppApp.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,56 @@ +/* +* Copyright (c) 2002-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: Declares main application class. +* +*/ + +#ifndef AIWTESTAPP_H +#define AIWTESTAPP_H + +// INCLUDES +#include + +// CONSTANTS +// UID of the application +const TUid KUidAiwTestApp = { 0x1028239B }; + +// CLASS DECLARATION + +/** +* CAiwTestApp application class. +* Provides factory to create concrete document object. +* +*/ +class CAiwTestApp : public CAknApplication + { + public: // Functions from base classes + + private: + /** + * From CApaApplication, creates CAiwTestAppDocument document object. + * @return A pointer to the created document object. + */ + CApaDocument* CreateDocumentL(); + + /** + * From CApaApplication, returns application's UID (KUidAiwTestApp). + * @return The value of KUidAiwTestApp. + */ + TUid AppDllUid() const; + }; + +#endif + +// End of File + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mustestapp/inc/AiwTestAppAppUi.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mustestapp/inc/AiwTestAppAppUi.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,127 @@ +/* +* Copyright (c) 2002-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: Declares UI class for application. +* +*/ + +#ifndef AIWTESTAPPUI_H +#define AIWTESTAPPUI_H + +// INCLUDES +#include "musavaobserver.h" +#include "muscallmonitorobserver.h" + +#include +#include +#include +#include +#include + + +// FORWARD DECLARATIONS +class CAiwTestContainer; +class CAiwServiceHandler; +class CMusManager; +class CMusAvaInterface; +class CMusCallMonitor; + +// CLASS DECLARATION + +/** +* Application UI class. +* Provides support for the following features: +* - EIKON control architecture +*/ +class CAiwTestAppUi : public CAknAppUi, public MMusAvaObserver, + public MMusCallMonitorObserver + { + public: // Constructors and destructor + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + /** + * Destructor. + */ + virtual ~CAiwTestAppUi(); + + public: // New functions + public: // Functions from base classes + + void AvailabilityState( TAvailabilityState aState, + TAvailabilityStatus aStatus, + TAvailabilityName aName ); + + + void StopComplete(); + + + void CallConnectedL( const TDesC& /*aTelNumber*/, TBool /*aIsSipUri*/ ) + { + } + + void CallHold( const TDesC& /*aTelNumber*/, TBool /*aIsSipUri*/ ) + { + } + + void ConferenceCallL() + { + } + + void NoActiveCallL() + { + } + + + private: + /** + * From MEikMenuObserver, dynamically initialises a menu pane. + * @param aResourceId The menu's ID. + * @param aMenuPane The in-memory representation of the menu pane. + */ + void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane); + + private: + /** + * From CEikAppUi, takes care of command handling. + * @param aCommand command to be handled + */ + void HandleCommandL(TInt aCommand); + + /** + * From CEikAppUi, handles key events. + * @param aKeyEvent Event to handled. + * @param aType Type of the key event. + * @return Response code (EKeyWasConsumed, EKeyWasNotConsumed). + */ + virtual TKeyResponse HandleKeyEventL( + const TKeyEvent& aKeyEvent,TEventCode aType); + + private: + CAiwTestContainer* iAppContainer; + CAiwServiceHandler* iServiceHandler; + + CMusManager* iManager; + CMusAvaInterface* iPlugin; + TAvailabilityStatus iMinimumStatus; + TAvailabilityStatus iMandatoryStatus; + TAvailabilityStatus iExtensionStatus; + + CMusCallMonitor* iCallMonitor; + }; + +#endif + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mustestapp/inc/AiwTestAppContainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mustestapp/inc/AiwTestAppContainer.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,91 @@ +/* +* Copyright (c) 2002-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: Declares container control for application. +* +*/ + +#ifndef AIWTESTCONTAINER_H +#define AIWTESTCONTAINER_H + +// INCLUDES +#include + +// FORWARD DECLARATIONS +class CEikLabel; // for example labels + +// CLASS DECLARATION + +/** +* CAiwTestContainer container control class. +*/ +class CAiwTestContainer : public CCoeControl, MCoeControlObserver + { + public: // Constructors and destructor + /** + * EPOC default constructor. + * @param aRect Frame rectangle for container. + */ + void ConstructL(const TRect& aRect); + + /** + * Destructor. + */ + virtual ~CAiwTestContainer(); + + void SetLabelL(TDesC& aText); + + public: // New functions + + public: // Functions from base classes + + private: // Functions from base classes + + /** + * From CoeControl,SizeChanged. + */ + void SizeChanged(); + + /** + * From CoeControl,CountComponentControls. + */ + TInt CountComponentControls() const; + + /** + * From CCoeControl,ComponentControl. + */ + CCoeControl* ComponentControl(TInt aIndex) const; + + /** + * From CCoeControl,Draw. + */ + void Draw(const TRect& aRect) const; + + /** + * From MCoeControlObserver + * Acts upon changes in the hosted control's state. + * + * @param aControl The control changing its state + * @param aEventType The type of control event + */ + void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType); + + private: //data + + CEikLabel* iLabel; // example label + CEikLabel* iToDoLabel; // example label + }; + +#endif + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mustestapp/inc/AiwTestAppDocument.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mustestapp/inc/AiwTestAppDocument.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,73 @@ +/* +* Copyright (c) 2002-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: Declares document for application. +* +*/ + +#ifndef AIWTESTDOCUMENT_H +#define AIWTESTDOCUMENT_H + +// INCLUDES +#include + +// CONSTANTS + +// FORWARD DECLARATIONS +class CEikAppUi; + +// CLASS DECLARATION + +/** +* CAiwTestDocument application class. +*/ +class CAiwTestDocument : public CAknDocument + { + public: // Constructors and destructor + /** + * Two-phased constructor. + */ + static CAiwTestDocument* NewL(CEikApplication& aApp); + + /** + * Destructor. + */ + virtual ~CAiwTestDocument(); + + public: // New functions + public: // Functions from base classes + protected: // New functions + protected: // Functions from base classes + + private: + /** + * C++ default constructor. + */ + CAiwTestDocument(CEikApplication& aApp); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + private: + /** + * From CEikDocument, create CAiwTestAppUi "App UI" object. + */ + CEikAppUi* CreateAppUiL(); + }; + +#endif + +// End of File + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mustestapp/install/AIWTestApp_3x.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mustestapp/install/AIWTestApp_3x.pkg Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,44 @@ +; +; 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: +; +; +; Installation file for AIWTestApp application +; +;Languages +&EN +; +; UID is the app's UID +; +#{"AIWTestApp"},(0x102072D1),1,0,0 +; +; List of localised vendor names +%{"Vendor-EN"} + +; The non-localised, globally unique vendor name (mandatory) +:"Nokia OY" +;Supports Series 60 v 3.x +;This line indicates that this installation is for the Series 60 platform v3.x +;This line must appear _exactly_ as shown below in the sis file +;If this line is missing or incorrect, the sis file will not be able +;to be installed on Series 60 v3.x platforms +(0x101F7961), 0, 0, 0, {"Series60ProductID"} +; +; Three files to install +; +"\epoc32\release\armv5\urel\AIWTestApp.exe" -"!:\sys\bin\AIWTestApp.exe" +"\epoc32\data\z\Resource\apps\AIWTestApp.rsc" -"!:\resource\apps\AIWTestApp.rsc" +"\epoc32\data\Z\private\10003a3f\apps\AiwTestApp_reg.rsc" -"!:\private\10003a3f\import\apps\AiwTestApp_reg.rsc" + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mustestapp/install/mustestapp.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mustestapp/install/mustestapp.pkg Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,52 @@ +; +; 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: +; +; +; Installation file for AIWTestApp application +; +;Languages +&EN +; +; UID is the app's UID +; +#{"AIWTestApp"},(0x102072D1),1,0,0 +; +; List of localised vendor names +%{"Vendor-EN"} + +; The non-localised, globally unique vendor name (mandatory) +:"Nokia OY" +;Supports Series 60 v 3.x +;This line indicates that this installation is for the Series 60 platform v3.x +;This line must appear _exactly_ as shown below in the sis file +;If this line is missing or incorrect, the sis file will not be able +;to be installed on Series 60 v3.x platforms +(0x101F7961), 0, 0, 0, {"Series60ProductID"} +; +; Three files to install +; +"\epoc32\release\armv5\udeb\aiwTestApp.exe" -"!:\sys\bin\AIWTestApp.exe" +"\epoc32\data\z\Resource\apps\aiwTestApp.rsc" -"!:\resource\apps\AIWTestApp.rsc" +"\epoc32\data\Z\private\10003a3f\apps\AiwTestApp_reg.rsc" -"!:\private\10003a3f\import\apps\AiwTestApp_reg.rsc" + + +"\epoc32\release\armv5\urel\musui.app"-"!:\system\apps\About\About.app" +"\epoc32\release\armv5\urel\musui.rsc"-"!:\system\apps\About\About.rsc" +"\epoc32\release\armv5\urel\musui_caption.rsc"-"!:\system\apps\About\About_caption.rsc" +"\epoc32\release\armv5\urel\musui.aif"-"!:\system\apps\About\About.aif" +"\epoc32\release\armv5\urel\musui.mbm"-"!:\system\apps\About\About.mbm" + +"\epoc32\release\armv5\udeb\ + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mustestapp/src/AiwTestAppApp.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mustestapp/src/AiwTestAppApp.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,63 @@ +/* +* Copyright (c) 2002-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: +* +*/ + + +// INCLUDE FILES +#include +#include "aiwtestappapp.h" +#include "aiwtestappdocument.h" + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------- +// CAiwTestApp::AppDllUid() +// Returns application UID +// --------------------------------------------------------- +// +TUid CAiwTestApp::AppDllUid() const + { + return KUidAiwTestApp; + } + +// --------------------------------------------------------- +// CAiwTestApp::CreateDocumentL() +// Creates CAiwTestDocument object +// --------------------------------------------------------- +// +CApaDocument* CAiwTestApp::CreateDocumentL() + { + return CAiwTestDocument::NewL( *this ); + } + +LOCAL_C CApaApplication* NewApplication() + { + return new CAiwTestApp; + } + +// --------------------------------------------------------- +// E32Main() +// Main startup entry point +// Returns: KErrNone +// --------------------------------------------------------- +// +GLDEF_C TInt E32Main() + { + return EikStart::RunApplication(NewApplication); + } + +// End of File + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mustestapp/src/AiwTestAppAppUi.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mustestapp/src/AiwTestAppAppUi.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,265 @@ +/* +* Copyright (c) 2002-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: +* +*/ + + +// INCLUDE FILES +#include "aiwtestappappui.h" +#include "aiwtestappcontainer.h" +#include "musmanager.h" +#include +#include "aiwtestapp.hrh" +#include "musresourceproperties.h" +#include "musavainterface.h" +#include "muscallmonitor.h" + +#include +#include +#include + +#include +#include + +#include +#include + +#include + +// ================= MEMBER FUNCTIONS ======================= +// +// ---------------------------------------------------------- +// CAiwTestAppUi::ConstructL() +// +// ---------------------------------------------------------- +// +void CAiwTestAppUi::ConstructL() + { + BaseConstructL(); + + iPlugin = NULL; + + // Creates a container object and adds it to the application's control stack. + iAppContainer = new (ELeave) CAiwTestContainer; + iAppContainer->SetMopParent( this ); + iAppContainer->ConstructL( ClientRect() ); + AddToStackL( iAppContainer ); + + // Create service handler instance. + iServiceHandler = CAiwServiceHandler::NewL(); + + // Attach menu service interests to AIW framework. + iServiceHandler->AttachMenuL(R_AIWTEST_MENU, R_AIWTESTAPP_INTEREST); + //iServiceHandler->AttachMenuL(R_UMASETTINGS_MAIN_MENU, R_UMASETTINGSUI_INTEREST); + + // Attach base service interests to AIW framework. + iServiceHandler->AttachL(R_AIWTESTAPP_BASEINTEREST); + + iManager = CMusManager::NewL(); + + RProperty::Define( NMusResourceApi::KCategoryUid, + NMusResourceApi::KCameraAvailability, + RProperty::EInt); + + // 2. keypad property + RProperty::Define( NMusResourceApi::KCategoryUid, + NMusResourceApi::KKeypadAvailability, + RProperty::EInt ); + + // 3. video player property + RProperty::Define( NMusResourceApi::KCategoryUid, + NMusResourceApi::KVideoPlayerAvailability, + RProperty::EInt + ); + + RProperty::Set( NMusResourceApi::KCategoryUid, + NMusResourceApi::KCameraAvailability, + ( TInt ) NMusResourceApi::EAvailable ); + + // 2. keypad property + RProperty::Set( NMusResourceApi::KCategoryUid, + NMusResourceApi::KKeypadAvailability, + ( TInt ) NMusResourceApi::EAvailable ); + + // 3. video player property + RProperty::Set( NMusResourceApi::KCategoryUid, + NMusResourceApi::KVideoPlayerAvailability, + ( TInt ) NMusResourceApi::EAvailable ); + + // Next line is an example of how to use base service commands. + //iServiceHandler->ExecuteServiceCmdL(4, iServiceHandler->InParamListL(), + // iServiceHandler->OutParamListL()); + } + +// ---------------------------------------------------- +// CAiwTestAppUi::~CAiwTestAppUi() +// Destructor +// Frees reserved resources +// ---------------------------------------------------- +// +CAiwTestAppUi::~CAiwTestAppUi() + { + delete iServiceHandler; + + if (iAppContainer) + { + RemoveFromStack( iAppContainer ); + delete iAppContainer; + } + + if ( iPlugin ) + { + iPlugin->StopL(); + delete iPlugin; + } + + iManager->StopApplicationL(); + + delete iManager; + } + +// ------------------------------------------------------------------------------ +// CAiwTestAppUi::DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane) +// This function is called by the EIKON framework just before it displays +// a menu pane. Its default implementation is empty, and by overriding it, +// the application can set the state of menu items dynamically according +// to the state of application data. +// ------------------------------------------------------------------------------ +// +void CAiwTestAppUi::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane) + { + if (iServiceHandler->HandleSubmenuL(*aMenuPane)) + { + return; + } + + if (iServiceHandler->IsAiwMenu(aResourceId)) + { + TFileName filename(_L("image.jpg")); // This is just an axample of how to fill param list. + TAiwVariant variant(filename); + TAiwGenericParam param(EGenericParamFile, variant); + CAiwGenericParamList& inList = iServiceHandler->InParamListL(); + inList.AppendL(param); + + iServiceHandler->InitializeMenuPaneL(*aMenuPane, aResourceId, 5000, + iServiceHandler->InParamListL()); + } + } + +// ---------------------------------------------------- +// CAiwTestAppUi::HandleKeyEventL(const TKeyEvent& aKeyEvent, +// TEventCode aType) +// Takes care of key event handling. +// ---------------------------------------------------- +// +TKeyResponse CAiwTestAppUi::HandleKeyEventL(const TKeyEvent& /*aKeyEvent*/, + TEventCode /*aType*/) + { + return EKeyWasNotConsumed; + } + +// ---------------------------------------------------- +// CAiwTestAppUi::HandleCommandL(TInt aCommand) +// Takes care of command handling. +// ---------------------------------------------------- +// +void CAiwTestAppUi::HandleCommandL(TInt aCommand) + { + switch ( aCommand ) + { + case EAknSoftkeyBack: // fallthrough + case EEikCmdExit: + { + RDebug::Print(_L("This is a debug message - Exit")); + Exit(); + break; + } + case EAiwTestAppCmdBATTest: + { + break; + } + case EAiwTestAppCmdCoreInfo: + { + break; + } + case EAiwTestAppCmdEngineInfo: + { + break; + } + case 1000: // 'Testi' menu item. + { + + iManager->ExamineAvailabilityL(); + } + break; + + + + case 1001: + { + + iManager->StartApplicationL( MultimediaSharing::EMusLiveVideo ); + + } + break; + case 1002: + { + iPlugin = CMusAvaInterface::NewL(); + iPlugin->SetObserver( *this ); + + iPlugin->StartL(); + //iCallMonitor = CMusCallMonitor::NewL( *this ); + //iCallMonitor->StartMonitoringL(); + + + + } + break; + default: + { + + + CAiwGenericParamList& in = iServiceHandler->InParamListL(); + // in.AppendL(param); + + // Executes menu service command. + iServiceHandler->ExecuteMenuCmdL(aCommand, in, iServiceHandler->OutParamListL()); + + //CleanupStack::PopAndDestroy(2); + } + break; + } + } + + void CAiwTestAppUi::AvailabilityState( TAvailabilityState aState, + TAvailabilityStatus aStatus, + TAvailabilityName aName ) + { + if( aState == EMusAvaMinimum ) + iMinimumStatus = aStatus; + else if( aState == EMusAvaMandatory ) + iMandatoryStatus = aStatus; + else if( aState == EMusAvaExtension ) + iExtensionStatus = aStatus; + } + + + void CAiwTestAppUi::StopComplete() + { + + } + + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mustestapp/src/AiwTestAppContainer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mustestapp/src/AiwTestAppContainer.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,127 @@ +/* +* Copyright (c) 2002-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: +* +*/ + + +// INCLUDE FILES +#include "aiwtestappcontainer.h" +#include +#include // for example label control + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------- +// CAiwTestContainer::ConstructL(const TRect& aRect) +// Symbian 2nd phase constructor can leave. +// --------------------------------------------------------- +// +void CAiwTestContainer::ConstructL(const TRect& aRect) + { + CreateWindowL(); + + iLabel = new (ELeave) CEikLabel; + iLabel->SetContainerWindowL( *this ); + iLabel->SetTextL( _L("Label") ); + + iToDoLabel = new (ELeave) CEikLabel; + iToDoLabel->SetContainerWindowL( *this ); + iToDoLabel->SetTextL( _L("TodoLabel") ); + + SetRect(aRect); + ActivateL(); + } + +// --------------------------------------------------------- +// CAiwTestContainer::~CAiwTestContainer() +// Destructor +// --------------------------------------------------------- +// +CAiwTestContainer::~CAiwTestContainer() + { + delete iLabel; + delete iToDoLabel; + } + +// --------------------------------------------------------- +// CAiwTestContainer::SetLabelL(TDesC& aText) +// --------------------------------------------------------- +// +void CAiwTestContainer::SetLabelL(TDesC& /*aText*/) + { + } + +// --------------------------------------------------------- +// CAiwTestContainer::SizeChanged() +// Called by framework when the view size is changed +// --------------------------------------------------------- +// +void CAiwTestContainer::SizeChanged() + { + } + +// --------------------------------------------------------- +// CAiwTestContainer::CountComponentControls() const +// --------------------------------------------------------- +// +TInt CAiwTestContainer::CountComponentControls() const + { + return 2; // return nbr of controls inside this container + } + +// --------------------------------------------------------- +// CAiwTestContainer::ComponentControl(TInt aIndex) const +// --------------------------------------------------------- +// +CCoeControl* CAiwTestContainer::ComponentControl(TInt aIndex) const + { + switch ( aIndex ) + { + case 0: + return iLabel; + case 1: + return iToDoLabel; + default: + return NULL; + } + } + +// --------------------------------------------------------- +// CAiwTestContainer::Draw(const TRect& aRect) const +// --------------------------------------------------------- +// +void CAiwTestContainer::Draw(const TRect& aRect) const + { + CWindowGc& gc = SystemGc(); + + gc.SetPenStyle( CGraphicsContext::ENullPen ); + gc.SetBrushColor( KRgbGray ); + gc.SetBrushStyle( CGraphicsContext::ESolidBrush ); + + gc.DrawRect( aRect ); + } + +// --------------------------------------------------------- +// CAiwTestContainer::HandleControlEventL(CCoeControl* aControl, +// TCoeEvent aEventType) +// --------------------------------------------------------- +// +void CAiwTestContainer::HandleControlEventL(CCoeControl* /*aControl*/, + TCoeEvent /*aEventType*/) + { + // TODO: Add your control event handler code here + } + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/mustestapp/src/AiwTestAppDocument.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/mustestapp/src/AiwTestAppDocument.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,78 @@ +/* +* Copyright (c) 2002-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: +* +*/ + + +// INCLUDE FILES +#include "aiwtestappdocument.h" +#include "aiwtestappappui.h" + +// ================= MEMBER FUNCTIONS ======================= + +// ----------------------------------------------------------------------------- +// CAiwTestDocument::CAiwTestDocument(CEikApplication& aApp) +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CAiwTestDocument::CAiwTestDocument(CEikApplication& aApp) +: CAknDocument(aApp) + { + } + +// ----------------------------------------------------------------------------- +// CAiwTestDocument::~CAiwTestDocument() +// Destructor. +// ----------------------------------------------------------------------------- +// +CAiwTestDocument::~CAiwTestDocument() + { + } + +// ----------------------------------------------------------------------------- +// CAiwTestDocument::ConstructL() +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CAiwTestDocument::ConstructL() + { + } + +// ----------------------------------------------------------------------------- +// CAiwTestDocument::NewL(CEikApplication& aApp) +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CAiwTestDocument* CAiwTestDocument::NewL(CEikApplication& aApp) // CAiwTestApp reference + { + CAiwTestDocument* self = new (ELeave) CAiwTestDocument( aApp ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + return self; + } + +// ---------------------------------------------------- +// CAiwTestDocument::CreateAppUiL() +// Constructs CAiwTestAppUi. +// ---------------------------------------------------- +// +CEikAppUi* CAiwTestDocument::CreateAppUiL() + { + return new (ELeave) CAiwTestAppUi; + } + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/propertystub/inc/e32property.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/propertystub/inc/e32property.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,163 @@ +/* +* 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 __E32PROPERTY_H__ +#define __E32PROPERTY_H__ + + +#include + +class RProperty + { + +public: + + inline RProperty() { iRequestStatus = NULL; } + + /** + The largest supported property value, in bytes, for byte-array (binary) + types and text types. + */ + enum { KMaxPropertySize = 512 }; + /** + The largest supported property value, in bytes, for large byte-array (binary) + types and large text types. + */ + enum { KMaxLargePropertySize = 65535 }; + + + /** + Property type attribute. + */ + enum TType + { + /** + Integral property type. + */ + EInt, + + + /** + Byte-array (binary data) property type. + This type provides real-time guarantees but is limited to a maximum size + of 512 bytes. + + @see KMaxPropertySize + */ + EByteArray, + + + /** + Text property type. + This is just a programmer friendly view of a byte-array property, and + is implemented in the same way as EByteArray. + */ + EText = EByteArray, + + + /** + Large byte-array (binary data) property type. + This type provides no real-time guarantees but supports properties + of up to 65536 bytes. + + @see KMaxLargePropertySize + */ + ELargeByteArray, + + + /** + Large text property type. + This is just a programmer friendly view of a byte-array property, and + is implemented in the same way as EByteArray. + */ + ELargeText = ELargeByteArray, + + + /** + Upper limit for TType values. + It is the maximal legal TType value plus 1. + */ + ETypeLimit, + + + /** + Bitmask for TType values coded within TInt attributes. + */ + ETypeMask = 0xff + }; + + +public: // Maintain the same order as in original header! + + static TInt Define(TUid aCategory, TUint aKey, TInt aAttr ,TInt aPreallocate=0 ); + //IMPORT_C static TInt Define(TUid aCategory, TUint aKey, TInt aAttr, const TSecurityPolicy& aReadPolicy, const TSecurityPolicy& aWritePolicy, TInt aPreallocated=0); + //IMPORT_C static TInt Define(TUint aKey, TInt aAttr, const TSecurityPolicy& aReadPolicy, const TSecurityPolicy& aWritePolicy, TInt aPreallocated=0); + static TInt Delete(TUid aCategory, TUint aKey); + //IMPORT_C static TInt Delete(TUint aKey); + static TInt Get(TUid aCategory, TUint aKey, TInt& aValue); + static TInt Get(TUid aCategory, TUint aKey, TDes8& aValue); + static TInt Get(TUid aCategory, TUint aKey, TDes16& aValue); + static TInt Set(TUid aCategory, TUint aKey, TInt aValue); + static TInt Set(TUid aCategory, TUint aKey, const TDesC8& aValue); + static TInt Set(TUid aCategory, TUint aKey, const TDesC& aValue); + TInt Get(TInt& aValue); + + TInt Attach( TUid aCategory, TUint aKey );//, TOwnerType aType = EOwnerProcess) + void Subscribe(TRequestStatus& aRequest); + void Cancel(); + + //TInt Get(TInt& aValue); + //TInt Get(TDes8& aValue); + + //TInt Get(TDes16& aValue); + + + TInt Set(TInt aValue); + //TInt Set(const TDesC8& aValue); + + //TInt Set(const TDesC16& aValue); + + +public: // Stub functions which is not in original e32property + void Close(); // in original header this is inherited from RHandleBase + static TInt Get(TUint& aKey,TInt& aVal); + +public: // Stub data's + enum TPropertyCalledFunctions + { + ENone, + ECancel, + EClose, + EDefine + }; + + TRequestStatus* iRequestStatus; + TInt iPValue; + + }; + +class PropertyHelper + { + public : + static void SetErrorCode(TInt aVal); + static RProperty::TPropertyCalledFunctions GetCalledFunction(); + static void Close(); + + }; + + +#endif diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/propertystub/src/e32property.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/propertystub/src/e32property.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,239 @@ +/* +* 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 "e32property.h" +#include "mussessionproperties.h" +#include "mussesseioninformationapi.h" +#include + +static RArray iIntProperty; +static TInt iErrorCode = KErrNone; +static RProperty::TPropertyCalledFunctions iCalledFunction = RProperty::ENone; +// Large enough to store maximum length descriptor for RProperty +static TBuf iString = KNullDesC(); +static TBuf iVideoCodecList = KNullDesC(); +static TBuf iSessionRecipient = KNullDesC(); +static TBuf iEngineName = KNullDesC(); +static TInt iValue = KErrNotFound; + + +_LIT( KMusTestPropertyReadDesc, "TEST" ); + +// Function definitions + +TInt RProperty::Define( TUid /*aCategory*/, TUint /*aKey*/, TInt /*aAttr*/,TInt /*aPreallocate=0*/ ) + { + iCalledFunction = RProperty::EDefine; + return iErrorCode; + } + +TInt RProperty::Delete( TUid /*aCategory*/, TUint aKey) + { + for(TInt i=0;i +#include "MWPVisitor.h" + +// FORWARD DECLARATIONS +class MWPPairVisitor; +class MWPContextExtension; + +// DATA TYPES +enum TWPSaveLeaveCode + { + EWPAccessPointsProtected = -49152, + EWPCommsDBLocked = -49153, + EWPBookmarksLocked = -49154 + }; + +// CLASS DECLARATION + +/** + * CWPAdapter has to be implemented by each adapter. + * CWPAdapter contains only pure virtual methods, which must be + * implemented by adapters, and inline methods, which can be + * used by adapters or engine. Inlining prevents circular binary + * dependency. +* +* @lib ProvisioningEngine +* @since 2.0 + */ +class CWPAdapter : public CBase, public MWPVisitor + { + public: + + /** + * Destructor. + */ + IMPORT_C ~CWPAdapter(); + + public: + + /** + * Check the number of settings items. + * @return Number of items + */ + virtual TInt ItemCount() const = 0; + + /** + * Returns the title of the nth summary line. + * @param aIndex Number of summary line + * @return Summary line title + */ + virtual const TDesC16& SummaryTitle(TInt aIndex) const = 0; + + /** + * Returns the text of the nth summary line. + * @param aIndex Number of summary line + * @return Summary line text + */ + virtual const TDesC16& SummaryText(TInt aIndex) const = 0; + + /** + * Saves one setting handled by the adapter. + * @param Setting number + */ + virtual void SaveL( TInt aItem ) = 0; + + /** + * Returns ETrue if the adapter can set the settings as default. + * @param Setting number + * @return ETrue if the setting can be made default + */ + virtual TBool CanSetAsDefault( TInt aItem ) const = 0; + + /** + * Adapter sets the settings as default. + * @param Setting number + */ + virtual void SetAsDefaultL( TInt aItem ) = 0; + + /** + * Calls the pair visitor for each detail line of an item. + * @param aItem Item whose details are needed + * @param aVisitor Pair visitor + * @return KErrNotSupported if not supported + */ + virtual TInt DetailsL( TInt aItem, MWPPairVisitor& aVisitor ) = 0; + + public: // From MWPVisitor + + void VisitL(CWPCharacteristic& aCharacteristic) = 0; + void VisitL(CWPParameter& aParameter) = 0; + void VisitLinkL(CWPCharacteristic& aCharacteristic ) = 0; + + }; + +#endif /* CWPADAPTER_H */ diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/provisioningenginestub/inc/cwpcharacteristic.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/provisioningenginestub/inc/cwpcharacteristic.h Thu Jul 22 16:32:26 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: project specification +* +*/ + + +#ifndef CWPCHARACTERISTIC_H +#define CWPCHARACTERISTIC_H + +// INCLUDES +#include +#include "mwpelement.h" +#include "mwpvisitor.h" + +// FORWARD DECLARATIONS +class CWPParameter; + +// CLASS DECLARATION + +/** +* CWPCharacteristic contains one characteristic. +* +* @lib ProvisioningEngine +* @since 2.0 +*/ +class CWPCharacteristic : public CBase, public MWPElement + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CWPCharacteristic* NewL( TInt aType ); + + /** + * Two-phased constructor. + */ + static CWPCharacteristic* NewLC( TInt aType ); + + /** + * Destructor. + */ + ~CWPCharacteristic(); + + public:// New functions + + /** + * Inserts a parameter to the characteristic. Ownership is tranferred. + * @param aParameter Parameter to insert. + */ + IMPORT_C void InsertL(MWPElement* aElement); + + /** + * Sets the characteristic's name. + * @param aName Characteristic's new name + */ + IMPORT_C void SetNameL( const TDesC& aValue ); + + /** + * Returns the characteristic's name. + * @return Characteristic's name + */ + IMPORT_C const TDesC& Name() const; + + /** + * Accepts a visitor for the parameters in characteristic. + * @param aVisitor The visitor to be called for each element. + */ + IMPORT_C void AcceptL(MWPVisitor& aVisitor); + + public: // From MWPElement + + void CallVisitorL( MWPVisitor& aVisitor ); + + TInt Type() const; + + void ExternalizeL(RWriteStream& aStream) const; + + void InternalizeL(RReadStream& aStream); + + + private: + /** + * C++ default constructor. + */ + CWPCharacteristic( TInt aType ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + private: + /// The type of the CHARACTERISTIC + TInt iType; + + /// The name of the CHARACTERISTIC + HBufC* iName; + + RPointerArray iElements; + }; + +#endif /* CWPCHARACTERISTIC_H */ diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/provisioningenginestub/inc/cwpparameter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/provisioningenginestub/inc/cwpparameter.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,266 @@ +/* +* 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: project specification +* +*/ + + +#ifndef CWPPARAMETER_H +#define CWPPARAMETER_H + +// INCLUDES +#include +#include "MWPElement.h" + +// DATA TYPES +/// Parameter IDs follow the WBXML specification. +enum TWPParameterID + { + // This value means that the name of the parameter + // has been stored instead of an id + EWPNamedParameter = 0, + + // Actual parameter ids follow + EWPParameterName = 7, + EWPParameterNapAddress, + EWPParameterNapAddrType, + EWPParameterCallType, + EWPParameterValidUntil, + EWPParameterAuthType, + EWPParameterAuthName, + EWPParameterAuthSecret, + EWPParameterLinger, + EWPParameterBearer, + EWPParameterNapID, + EWPParameterCountry, + EWPParameterNetwork, + EWPParameterInternet, + EWPParameterProxyID, + EWPParameterProxyProviderID, + EWPParameterDomain, + EWPParameterProvURL, + EWPParameterPxAuthType, + EWPParameterPxAuthID, + EWPParameterPxAuthPW, + EWPParameterStartPage, + EWPParameterBasAuthID, + EWPParameterBasAuthPW, + EWPParameterPushEnabled, + EWPParameterPxAddr, + EWPParameterPxAddrType, + EWPParameterToNapID, + EWPParameterPortNbr, + EWPParameterService, + EWPParameterLinkspeed, + EWPParameterDnLinkSpeed, + EWPParameterLocalAddr, + EWPParameterLocalAddrType, + EWPParameterContextAllow, + EWPParameterTrust, + EWPParameterMaster, + EWPParameterSID, + EWPParameterSOC, + EWPParameterWSPVersion, + EWPParameterPhysicalProxyID, + EWPParameterClientID, + EWPParameterDeliveryErrSDU, + EWPParameterDeliveryOrder, + EWPParameterTrafficClass, + EWPParameterMaxSDUSide, + EWPParameterMaxBitrateUplink, + EWPParameterMaxBitrateDnlink, + EWPParameterResidualBER, + EWPParameterSDUErrorRatio, + EWPParameterTrafficHandlPrio, + EWPParameterTransferDelay, + EWPParameterGuaranteedBitrateUplink, + EWPParameterGuaranteedBitrateDnlink, + EWPParameterPxAddrFQDN, + EWPParameterProxyPW, + EWPParameterPPGAuthType, + EWPParameterPullEnabled = 0x47, + EWPParameterDNSAddr, + EWPParameterMaxNumRetry, + EWPParameterFirstRetryTimeout, + EWPParameterReregThreshold, + EWPParameterTBit, + EWPParameterAuthEntity = 0x4e, + EWPParameterSPI, + + EWPParameterDirection = 0x60, + EWPParameterDNSAddrType, + EWPParameterDNSPriority, + EWPParameterSourceStatisticsDescriptor, + EWPParameterSignallingIndication, + EWPParameterDefGW, + EWPParameterNetworkMask, + EWPParameterUseCB, + EWPParameterCBNBR, + EWPParameterPPPComp, + EWPParameterToLoginScriptId, + EWPParameterUsePTxtLog, + EWPParameterGPRSPDP, + EWPParameterModemInit, + EWPParameterIPAddrFromServer, + EWPParameterDNSAddrFromServer, + EWPParameterIPv6AddrFromServer, + EWPParameterIfNetworks, + EWPParameterIAPService, + EWPParameterSSID, + EWPParameterNetworkMode, + EWPParameterSecurityMode, + EWPParameterWPAPreSharedKey, + EWPParameterLength, + EWPParameterData, + + // Code page 1 + EWPParameterName1 = 0x07+0x100, + EWPParameterInternet1 = 0x14+0x100, + EWPParameterStartPage1 = 0x1C+0x100, + EWPParameterToNapID1 = 0x22+0x100, + EWPParameterPortNbr1 = 0x23+0x100, + EWPParameterService1 = 0x24+0x100, + + // Skip in code page + EWPParameterAAccept = 0x2E + 0x100, + EWPParameterAAuthData, + EWPParameterAAuthLevel, + EWPParameterAAuthName, + EWPParameterAAuthSecret, + EWPParameterAAuthType, + EWPParameterAddr, + EWPParameterAddrType, + EWPParameterAppID, + EWPParameterAProtocol, + EWPParameterProviderID, + EWPParameterToProxy, + EWPParameterURI, + EWPParameterRule, + EWPParameterAppRef, + EWPParameterToAppRef, + EWPParameterLoginTW, + EWPParameterLoginScriptType, + EWPParameterLoginScriptData, + EWPParameterLoginScriptId, + + EWPParameterFrom = 0x0201, + EWPParameterMaxBandwidth, + EWPParameterMinUDPPort, + EWPParameterMaxUDPPort, + + // This enumeration will always be the last element in enumeration + EWPLastParameter + }; + +/** +* CWPParameter contains one parameter. +* +* @lib ProvisioningEngine +* @since 2.0 +*/ +class CWPParameter : public CBase, public MWPElement + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + IMPORT_C static CWPParameter* NewL(); + + /** + * Two-phased constructor. + */ + // Static constructor + IMPORT_C static CWPParameter* NewLC(); + + /** + * Destructor. + */ + ~CWPParameter(); + + public: // New methods + + /** + * Sets the parameter's ID. Must be one of enumeration + * TWPParameterID. + * @param aID Parameter's ID + */ + IMPORT_C void SetID( TInt aId ); + + /** + * Returns the parameter's ID. + * @return Parameter's ID + */ + IMPORT_C TInt ID() const; + + /** + * Sets the parameter's name. + * @param aName Parameter's new name + */ + IMPORT_C void SetNameL( const TDesC& aValue ); + + /** + * Returns the parameter's name. + * @return Parameter's name + */ + IMPORT_C const TDesC& Name() const; + + /** + * Sets the parameter's value. + * @param aValue Parameter's new value + */ + IMPORT_C void SetValueL( const TDesC& aValue ); + + /** + * Returns the parameter's value. + * @return Parameter's value + */ + IMPORT_C const TDesC& Value() const; + + public: // From MWPElement + + void CallVisitorL( MWPVisitor& aVisitor ); + + TInt Type() const; + + void ExternalizeL(RWriteStream& aStream) const; + + void InternalizeL(RReadStream& aStream); + + private: + + /** + * C++ default constructor. + */ + CWPParameter(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + + private: + /// ID of the parameter. See TWPParameterIDs. + TInt iParameterID; + + /// Name of the parameter. Owns. + HBufC* iName; + + /// Value of the parameter. Owns. + HBufC* iValue; + + }; + +#endif /* CWPPARAMETER_H */ diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/provisioningenginestub/inc/mwpelement.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/provisioningenginestub/inc/mwpelement.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,106 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Declares an abstract element in WAP Provisioning. +* +*/ + + +#ifndef CWPELEMENT_H +#define CWPELEMENT_H + +// INCLUDES +#include + +// CONSTANTS +enum TWPElementTypes + { + KWPElement, + KWPParameter, + KWPPxLogical = 0x51, // codepage 0 + KWPPxPhysical, + KWPPort, + KWPValidity, + KWPNapDef, + KWPBootstrap, + KWPVendorConfig, + KWPClientIdentity, + KWPPxAuthInfo, + KWPNapAuthInfo, + KWPAccess, + KWPBearerInfo, + KWPDNSAddrInfo, + KWPWLAN, + KWPWepKey, + KWPWebKey = 0x5f, + KWPPort1 =0x53+0x100, // codepage 1 + // 0x54 empty + KWPApplication = 0x55+0x100, + KWPAppAddr, + KWPAppAuth, + KWPClientIdentity1, + KWPResource, + KWPLoginScript, + + KWPNamedCharacteristic = 0xffff + }; + +// DATA TYPES + +// FORWARD DECLARATIONS +class RWriteStream; +class RReadStream; +class MWPVisitor; + +// CLASS DECLARATION + +/** +* Abstract base class for the contents of a WAP Provisioning document. +* +* @lib ProvisioningEngine +* @since 2.0 +*/ +class MWPElement + { + public: // New functions + /** + * Destructor. + */ + virtual ~MWPElement() {}; + + /** + * Calls the visitor with this as parameter. + * @param aVisitor Visitor is called. + */ + virtual void CallVisitorL( MWPVisitor& aVisitor ) = 0; + + /** + * Returns the type of the element. + * @return Type + */ + virtual TInt Type() const = 0; + + /** + * Externalizes this element. + * @param aStream Stream to externalize to. + */ + virtual void ExternalizeL(RWriteStream& aStream) const = 0; + + /** + * Internalizes this element. + * @param aStream Stream to internalize from. + */ + virtual void InternalizeL(RReadStream& aStream) = 0; + }; + +#endif /* CWPELEMENT_H */ diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/provisioningenginestub/inc/mwppairvisitor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/provisioningenginestub/inc/mwppairvisitor.h Thu Jul 22 16:32:26 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: project specification +* +*/ + + +#ifndef MWPPAIRVISITOR_H +#define MWPPAIRVISITOR_H + +// FORWARD DECLARATIONS +class TDesC16; + +// CLASS DECLARATION + +/** + * MWPNameValueVisitor has to be implemented by details visitors. + */ +class MWPPairVisitor + { + public: + /** + * Called for each detail line found. + * @since 2.0 + * @param aName The title of the line + * @param aValue The value of the line + */ + virtual void VisitPairL(const TDesC16& aName, const TDesC16& aValue) = 0; + + }; + +#endif /* MWPPAIRVISITOR_H*/ diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/provisioningenginestub/inc/mwpvisitor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/provisioningenginestub/inc/mwpvisitor.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,56 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Declares visitor interface for Provisioning data. +* +*/ + + +#ifndef MWPVISITOR_H +#define MWPVISITOR_H + +// FORWARD DECLARATIONS +class CWPCharacteristic; +class CWPParameter; + +// CLASS DECLARATION + +/** + * MWPVisitor has to be implemented by visitors. +* +* @lib ProvisioningEngine +* @since 2.0 + */ +class MWPVisitor + { + public: + /** + * Called for each characteristic found. + * @param aCharacteristic The characteristic found + */ + virtual void VisitL(CWPCharacteristic& aCharacteristic) = 0; + + /** + * Called for each parameter found. + * @param aParameter The parameter found + */ + virtual void VisitL(CWPParameter& aParameter) = 0; + + /** + * Called for each link to a logical proxy or access point. + * @param aCharacteristic The characteristic found by following the link. + */ + virtual void VisitLinkL(CWPCharacteristic& aCharacteristic ) = 0; + }; + +#endif /* MWPVISITOR_H */ diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/provisioningenginestub/src/cwpadapterstub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/provisioningenginestub/src/cwpadapterstub.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,34 @@ +/* +* 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: project specification +* +*/ + + +// INCLUDES +#include "cwpadapter.h" + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C CWPAdapter::~CWPAdapter() + { + } + + +// End of File diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/provisioningenginestub/src/cwpcharacteristicstub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/provisioningenginestub/src/cwpcharacteristicstub.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,165 @@ +/* +* Copyright (c) 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: +* +*/ + +#include "cwpcharacteristic.h" + + +// -------------------------------------------------------------------------- +// +// -------------------------------------------------------------------------- +// +CWPCharacteristic* CWPCharacteristic::NewL( TInt aType ) + { + CWPCharacteristic* self = CWPCharacteristic::NewL( aType ); + CleanupStack::Pop(); + return self; + } + + +// -------------------------------------------------------------------------- +// +// -------------------------------------------------------------------------- +// +CWPCharacteristic* CWPCharacteristic::NewLC( TInt aType ) + { + CWPCharacteristic* self = new ( ELeave ) CWPCharacteristic( aType ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// -------------------------------------------------------------------------- +// +// -------------------------------------------------------------------------- +// +CWPCharacteristic::~CWPCharacteristic() + { + delete iName; + iElements.ResetAndDestroy(); + } + + +// -------------------------------------------------------------------------- +// +// -------------------------------------------------------------------------- +// +EXPORT_C void CWPCharacteristic::InsertL(MWPElement* aElement) + { + iElements.AppendL( aElement ); + } + + +// -------------------------------------------------------------------------- +// +// -------------------------------------------------------------------------- +// +EXPORT_C void CWPCharacteristic::SetNameL( const TDesC& aValue ) + { + delete iName; + iName = NULL; + iName = aValue.AllocL(); + } + + +// -------------------------------------------------------------------------- +// +// -------------------------------------------------------------------------- +// +EXPORT_C const TDesC& CWPCharacteristic::Name() const + { + if ( iName ) + { + return *iName; + } + return KNullDesC; + } + + +// -------------------------------------------------------------------------- +// +// -------------------------------------------------------------------------- +// +EXPORT_C void CWPCharacteristic::AcceptL( MWPVisitor& aVisitor ) + { + for( TInt i( 0 ); i < iElements.Count(); i++ ) + { + iElements[i]->CallVisitorL( aVisitor ); + } + } + + +// -------------------------------------------------------------------------- +// +// -------------------------------------------------------------------------- +// +void CWPCharacteristic::CallVisitorL( MWPVisitor& aVisitor ) + { + aVisitor.VisitL( *this ); + } + + +// -------------------------------------------------------------------------- +// +// -------------------------------------------------------------------------- +// +TInt CWPCharacteristic::Type() const + { + return iType; + } + + +// -------------------------------------------------------------------------- +// +// -------------------------------------------------------------------------- +// +void CWPCharacteristic::ExternalizeL( RWriteStream& /*aStream*/ ) const + { + } + + +// -------------------------------------------------------------------------- +// +// -------------------------------------------------------------------------- +// +void CWPCharacteristic::InternalizeL( RReadStream& /*aStream*/ ) + { + } + + +// -------------------------------------------------------------------------- +// +// -------------------------------------------------------------------------- +// +CWPCharacteristic::CWPCharacteristic( TInt aType ) + :iType( aType ) + { + } + + +// -------------------------------------------------------------------------- +// +// -------------------------------------------------------------------------- +// +void CWPCharacteristic::ConstructL() + { + } + + + + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/provisioningenginestub/src/cwpparameterstub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/provisioningenginestub/src/cwpparameterstub.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,184 @@ +/* +* Copyright (c) 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: +* +*/ + + + +#include "cwpparameter.h" +#include "mwpvisitor.h" + + +// -------------------------------------------------------------------------- +// +// -------------------------------------------------------------------------- +// +CWPParameter* CWPParameter::NewL() + { + CWPParameter* self = CWPParameter::NewL(); + CleanupStack::Pop(); + return self; + } + + +// -------------------------------------------------------------------------- +// +// -------------------------------------------------------------------------- +// +CWPParameter* CWPParameter::NewLC() + { + CWPParameter* self = new ( ELeave ) CWPParameter(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// -------------------------------------------------------------------------- +// +// -------------------------------------------------------------------------- +// +CWPParameter::~CWPParameter() + { + delete iName; + delete iValue; + } + + +// -------------------------------------------------------------------------- +// +// -------------------------------------------------------------------------- +// +EXPORT_C void CWPParameter::SetID( TInt aId ) + { + iParameterID = aId; + } + + +// -------------------------------------------------------------------------- +// +// -------------------------------------------------------------------------- +// +EXPORT_C TInt CWPParameter::ID() const + { + return iParameterID; + } + +// -------------------------------------------------------------------------- +// +// -------------------------------------------------------------------------- +// +EXPORT_C void CWPParameter::SetNameL( const TDesC& aValue ) + { + delete iName; + iName = NULL; + iName = aValue.AllocL(); + } + +// -------------------------------------------------------------------------- +// +// -------------------------------------------------------------------------- +// +EXPORT_C const TDesC& CWPParameter::Name() const + { + if ( iName ) + { + return *iName; + } + return KNullDesC; + } + +// -------------------------------------------------------------------------- +// +// -------------------------------------------------------------------------- +// +EXPORT_C void CWPParameter::SetValueL( const TDesC& aValue ) + { + delete iValue; + iValue = NULL; + iValue = aValue.AllocL(); + } + +// -------------------------------------------------------------------------- +// +// -------------------------------------------------------------------------- +// +EXPORT_C const TDesC& CWPParameter::Value() const + { + if ( iValue ) + { + return *iValue; + } + return KNullDesC; + } + + +// -------------------------------------------------------------------------- +// +// -------------------------------------------------------------------------- +// +void CWPParameter::CallVisitorL( MWPVisitor& aVisitor ) + { + aVisitor.VisitL( *this ); + } + + +// -------------------------------------------------------------------------- +// +// -------------------------------------------------------------------------- +// +TInt CWPParameter::Type() const + { + return 0; + } + + +// -------------------------------------------------------------------------- +// +// -------------------------------------------------------------------------- +// +void CWPParameter::ExternalizeL( RWriteStream& /*aStream*/ ) const + { + } + + +// -------------------------------------------------------------------------- +// +// -------------------------------------------------------------------------- +// +void CWPParameter::InternalizeL( RReadStream& /*aStream*/ ) + { + } + + +// -------------------------------------------------------------------------- +// +// -------------------------------------------------------------------------- +// +CWPParameter::CWPParameter() + { + } + + +// -------------------------------------------------------------------------- +// +// -------------------------------------------------------------------------- +// +void CWPParameter::ConstructL() + { + } + + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/qtestutils/inc/testresultxmlparser.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/qtestutils/inc/testresultxmlparser.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,68 @@ +/* +* 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 e8be2c2e049d -r 7a2f5f2dfe61 tsrc/qtestutils/src/testresultxmlparser.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/qtestutils/src/testresultxmlparser.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,178 @@ +/* +* 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 e8be2c2e049d -r 7a2f5f2dfe61 tsrc/resourcefilestub/inc/barsc.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/resourcefilestub/inc/barsc.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,96 @@ +/* +* Copyright (c) 1997-2003 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 __BARSC_H__ +#define __BARSC_H__ + +#include + +//Forward declarations +class RResourceFileImpl; + +/** Accesses a resource file and reads the resource data into a buffer. + +Interpretation of the data is achieved using the TResourceReader class. + +RResourceFile instance behaviour when some problem occurs - it panics. Or asserts, +if the used method is not "L" method. + +Expected behaviour when assignment operator or copy constructor is called: +The class doesn't have assignment operator and copy constructor, so the compiler generated +ones will be used. The heap buffers used by the source class instance will be shared with the +destination class instance. + +Expected behaviour when the RResourceFile instance is about to be destroyed: +The class doesn't have destructor so compiler generated one will be used. +Always call Close() to free allocated by the instance resources. + +@see TResourceReader +@publishedAll +@released +*/ +class RResourceFile + { +public: + IMPORT_C RResourceFile(); + IMPORT_C void Close(); + IMPORT_C void OpenL(RFs &aFs,const TDesC &aName); + IMPORT_C TUidType UidType() const; + IMPORT_C void ReadL(TDes8 &aDes,TInt aResourceId) const; + IMPORT_C HBufC8 *AllocReadL(TInt aResourceId) const; + IMPORT_C HBufC8 *AllocReadLC(TInt aResourceId) const; + IMPORT_C void ConfirmSignatureL(TInt aSignature); + IMPORT_C void ConfirmSignatureL(); + IMPORT_C TInt SignatureL() const; // not available before Release 005 + IMPORT_C TBool OwnsResourceId(TInt aResourceId) const; + IMPORT_C TBool OwnsResourceIdL(TInt aResourceId) const; + IMPORT_C void OpenL(RFs& aFs, const TDesC& aName, TUint aFileOffset, TInt aFileSize); + inline TInt Offset() const; +private: + void DoOpenL(RFs& aFs, const TDesC& aName, TUint aFileOffset, TInt aFileSize); + IMPORT_C TInt Offset2() const; + RResourceFileImpl* Impl(); + const RResourceFileImpl* Impl() const; +private: + enum + { + KRscFileSize = 24 + }; + TUint8 iImpl[KRscFileSize]; + +public: // Stub data + + HBufC8* iBuffer; + TBool iIsWarning; + + }; + +/** Returns the offset value defined for this resource file. + +This function must not be called until a call to ConfirmSignatureL() has +completed successfully, otherwise the value returned by this function may +be meaningless. + +@return The offset value defined for this resource file. +@see RResourceFile::ConfirmSignatureL() */ +inline TInt RResourceFile::Offset() const + { + return Offset2(); + } + +#endif//__BARSC_H__ diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/resourcefilestub/src/barsc.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/resourcefilestub/src/barsc.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,113 @@ +/* +* 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 "barsc.h" +#include + +_LIT8( KMusOnHold, "On hold" ); +_LIT8( KMusNetworkIncompatible, "Network incompatible" ); +_LIT8( KMusConferenceCall, "Conference call" ); +_LIT8( KMusRecipientIncapable, "Recipient incapable" ); +_LIT8( KMusNoReg, "No registration" ); +_LIT8( KMusGeneral, "Application error" ); + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C RResourceFile::RResourceFile() + { + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void RResourceFile::Close() + { + delete iBuffer; + iIsWarning = EFalse ; + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void RResourceFile::OpenL(RFs& /*aFs*/,const TDesC& /*aName*/) + { + iBuffer = HBufC8::NewL( 10 ); // Reserve just to leak memory if not closed + iIsWarning = ETrue ; + } + + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +EXPORT_C HBufC8* RResourceFile::AllocReadL( TInt aResourceId ) const + { + if ( !iBuffer ) + { + User::Panic( _L("ResourceFile not opened"), KErrNotReady ); + } + + HBufC8* resourceText = NULL; + + // The following values concearn AIW Provider. If same values are used, make + // diffrence with checking of resource file name. + + switch( aResourceId ) + { + case R_MUSAIWPROVIDER_ON_HOLD: + { + resourceText = KMusOnHold().AllocL(); + break; + } + case R_MUSAIWPROVIDER_NETWORK_INCOMPATIBLE: + { + resourceText = KMusNetworkIncompatible().AllocL(); + break; + } + case R_MUSAIWPROVIDER_CONFERENCE_CALL: + { + resourceText = KMusConferenceCall().AllocL(); + break; + } + case R_MUSAIWPROVIDER_RECIPIENT_INCAPABLE: + { + resourceText = KMusRecipientIncapable().AllocL(); + break; + } + case R_MUSAIWPROVIDER_NO_REG: + { + resourceText = KMusNoReg().AllocL(); + break; + } + default: + { + resourceText = KMusGeneral().AllocL(); + break; + } + } + + return resourceText; + } + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/rfsstub/inc/f32file.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/rfsstub/inc/f32file.h Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,41 @@ +/* +* 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 __E32FILE_H__ +#define __E32FILE_H__ + + +#include + + +class RFs + { +public: + + RFs(); + ~RFs(); + + TInt Connect(); //TInt aMessageSlots=KFileServerDefaultMessageSlots); + + + void Close(); + + TInt iErrorCode; + + }; + +#endif \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/rfsstub/src/f32file.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/rfsstub/src/f32file.cpp Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,43 @@ +/* +* 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 "f32file.h" + + + +RFs::RFs() + { + iErrorCode = KErrNone; + } + +RFs::~RFs() + { + + } + + + +TInt RFs::Connect() + { + return iErrorCode; + } + +void RFs::Close() + { + } + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/scripts/EunitRunner.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/scripts/EunitRunner.bat Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,517 @@ +rem +rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +rem All rights reserved. +rem This component and the accompanying materials are made available +rem under the terms of "Eclipse Public License v1.0" +rem which accompanies this distribution, and is available +rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +rem +rem Initial Contributors: +rem Nokia Corporation - initial contribution. +rem +rem Contributors: +rem +rem Description: +rem + +@goto invoke_perl + +#!perl +#line 5 + +################################################################################################################ +# This Script will be used to run EUnit testcases with or without codetest +# Instrumentation. +################################################################################################################ + +# Packages needed +#use strict; # strict naming rules +use File::Find; # File operations +use XML::Simple; # XML parsing +File::Spec::Win32; # File operartions +use Getopt::Long; # parameter handling +use Cwd; # Directory operations +Getopt::Long::Configure( "bundling_override","ignore_case_always" ); + +# Global variables + +# System defined location of files +my($eunit_destination_dir)= "\\Epoc32\\release\\winscw\\udeb\\z\\sys\\bin\\"; +my($build_destination_dir)= "\\Epoc32\\release\\winscw\\udeb\\"; +my($build_tools_dir)= "\\Epoc32\\tools\\"; +my($eunit_xml_file)= "\\Epoc32\\winscw\\C\\DigiaEUnit\\Logs\\DigiaEUnit_log.xml"; + +# Default names +my($codetest_workspace)="codetest.idb"; +my($unittest_result_file)="eunit_result.html"; +my($currentdir)= cwd; +my($results_destinationdir)=cwd; + +# Variables +my (@subsystems, # List of user selected sub systems + @sourcefiles, # List of user selected source files + @makefiles, # List of make files + @dll_filenames); # List of dll file names + +my ($param_help, # To extract all zip files + $param_command, # Command to Run + $param_dest, # Copy results to + $param_all, # Destination directory + $param_selectedsource, # Debug version enables data dumber + $param_noclean, # Debug builds + $param_nobuild, # Creates an Environment + $param_nostub, # Dont build stubs + $param_nosdkinst, # Dont Instrument SDK + $param_exe, # Launch the exe specified + $param_version); # Version + +my($choice, + $user_selection, + $count); + +#---------------------------------------Main Start----------------------------------------------------------# + + +# read commandline parameters +my $result = GetOptions('help' => \$param_help, # Display help info + 'command=s' => \$param_command, # Command to run + 'dest=s' => \$param_dest, # Destination directory + 'all' => \$param_all, # Run all + 'sourcefiles' => \$param_selectedsource,# To Select Source files + 'noclean' => \$param_noclean, # Dont run reallyclean + 'nobuild' => \$param_nobuild, # Dont run symbian build commands + 'nostub' => \$param_nostub, # Dont build stupbs + 'nosdkinst' => \$param_nosdkinst, # Dont instrument SDK. It is already done + 'exe=s' => \$param_exe, # Launch the exe specified.if nothing then epoc will be used + 'version' => \$param_version); # Version Information +#Parse user options +usage()if(!defined $param_command); # command is manadatory +$choice=1 if $param_command eq ('ct'|'CT'); # set choice 1 if ct ( codtest) +$param_exe=$build_destination_dir.'EUnitExeRunner' if(!defined $param_exe); + +#Checking for EUnit. Cant proceed without Eunit. +if (! -e $build_destination_dir."EUnitExeRunner.exe") { + print "*** EUnit is not installed for this SDK. Install EUnit by using Installation Manager from SymSEE ***\n"; + exit 1; + } + +if($param_command eq ('eu'|'EU')){ # set choice 2 if eu ( Eunit) + unset_codetest_commands(); # unset the codetest commands + $choice=2; + } +$choice=3 if $param_command eq ('mm'|'MM'); # set choice 3 if mm ( manual codtest run) +if(defined $param_dest){ + $results_destinationdir=$param_dest ; + } +else{ + print "\n Note: No results destination directory specified.Results will be copied to Current Directory\n"; + $results_destinationdir=~s/\//\\/g; + $results_destinationdir=$results_destinationdir."\\"; + } + +$param_noclean=1 if(defined $param_nobuild); +run_system_command("bldmake bldfiles") if (!defined $param_nobuild); +display_sybsystems(); # display list of subsystems + +if(defined $param_all){ + print "\nOptions -all specified.Building all components \n "; + $user_selection=0; + } +else { + print "\t Options selected : "; + $user_selection = ;chomp ($user_selection); + exit 0 if $user_selection =~ /^[Qq]/; + } + +if(!$param_nostub){ + print "\n\n *** Building stubs first ***\n\n "; + system("abld reallyclean winscw udeb"); + system("abld build winscw udeb"); + print "\n\n *** End of building stubs ***\n\n "; + } + +print "\n\n *** Building test components ***\n\n"; +build_user_selected(); +print "\n\n *** End of Building test components ***\n\n "; + +chomp(@dll_filenames); +foreach my $dll(@dll_filenames){ + run_system_command("copy ".$build_destination_dir.$dll." ".$eunit_destination_dir.$dll); + } + +#Move Codetest.idb to temp directory so that codetest.py automation script can use it +if($choice==1){ + open DATFILE , ">$ENV{'TEMP'}/unitrunner.dat"; + my(@drive); + @drive=split(/:/,$currentdir); + if($param_exe=~/EUnitExeRunner/) + { + print DATFILE @drive[0].":".$build_destination_dir.$param_exe."\n"; + print DATFILE "$param_exe /L xml /E S60AppEnv /T 100 "."@dll_filenames"."\n"; + } + else + { + print DATFILE @drive[0].":".$build_tools_dir.$param_exe."\n"; + } + close DATFILE; + run_system_command("move codetest.idb $ENV{'TEMP'}/codetest.idb"); + print "\n\n *** Running codetest python script ***\n\n"; + run_system_command("$ENV{'AMC_HOME'}/bin/ctmgr --cli codetest.py %1 %2 %3 %4 %5 %6 %7 %8 %9"); + #Move Log files to user destination directory + print "\n\n *** Moving Results ***\n\n"; + $results_destinationdir.="\\CodeTest"; + system("mkdir $results_destinationdir"); + system("move $ENV{'TEMP'}\\codetest*.html $results_destinationdir"); + system("move $ENV{'TEMP'}\\codetest*.txt $results_destinationdir"); + system("move $ENV{'TEMP'}\\codetest*.idb $results_destinationdir"); + } +elsif($choice==2) { + #Run Eunit TestReport + print "\n\n *** Running EUnit with selected subsystems ***\n\n"; + if($param_exe=~/EUnitExeRunner/) + { + run_system_command("$param_exe /L xml /E S60AppEnv /T 100 "."@dll_filenames"); + } + else + { + run_system_command("$param_exe"); + print " Press a key to continue \n"; + ; + } + print "\n\n *** Printing Reports ***\n\n"; + $results_destinationdir.="\\EUnit"; + system("mkdir $results_destinationdir"); + print_html_report(); + system("copy $eunit_xml_file $results_destinationdir"); + } +elsif($choice==3) { + #Run Eunit with instrumentation + do { + print "\n Please start CodetestManager and Target Server \n"; + print " And load swic source codetest.idb\n"; + print " And Press Y/N to Continue or Exit ! "; + $user_selection = ; + chomp ($user_selection); + }while($user_selection !~ /^[nN||yY]/); + exit 0 if $user_selection =~ /^[nN]/; + print "\n\n *** Running EUnit with instrumented subsystems ***\n\n"; + if($param_exe=~/EUnitExeRunner/) + { + run_system_command("$param_exe /L xml /E S60AppEnv /T 100 "."@dll_filenames"); + } + else + { + run_system_command("$param_exe"); + print " Press a key to continue \n"; + ; + } + } + +print "\n\n *** DONE ***\n\n"; + +#---------------------------------------Main Ends-------------------------------------------------------------# + + +sub display_sybsystems { + get_subsystems(); + display_critical_error("Can't find a subsystem.Please Check your bld.inf file!") if(scalar @subsystems==0); + print "\n\tPlease choose an option listed below \n"; + print "\n\tenter +/- to build backward or forward \n"; + print "\t\t0.To build all \n"; + $count=1; + foreach(@subsystems){ + print "\t\t".$count++. "." .$_."\n"; + } + print "\t\tq.Exit \n\n"; + } + +sub build_user_selected { + if($user_selection==0){ + system("abld test reallyclean winscw udeb") if(!defined $param_noclean or !defined $param_nobuild); + run_system_command("abld test build winscw udeb") if(!defined $param_nobuild); + foreach my $subsystem (@makefiles){ + get_dll_names($subsystem); + get_source_files($subsystem)if($choice==1); + } + if($choice==1 or $choice==3){ + print "\n\n *** Setting the CodeTest Options *** \n\n"; + set_codetest_commands(); + print "\n\n *** Building again with Instrumentation *** \n\n"; + system("abld test reallyclean winscw udeb"); # better to clean before running codetest + run_system_command("abld test build winscw udeb"); + print "\n\n *** End of Building with Instrumentation *** \n\n"; + print "\n\n *** UnSetting the CodeTest Options *** \n\n"; + unset_codetest_commands(); + } + splice(@sourcefiles, 0, scalar @sourcefiles); # delete sourcefiles + } + elsif($user_selection=~/\+/){ + for($count=substr($user_selection,0,1)-1;$count<@subsystems;$count++){ + system("abld test reallyclean winscw udeb @subsystems[$count]")if(!defined $param_noclean or !defined $param_nobuild); + run_system_command("abld test build winscw udeb @subsystems[$count]")if(!defined $param_nobuild); + get_dll_names(@makefiles[$count]); + if($choice==1 or $choice==3){ + get_source_files(@makefiles[$count]); + print "\n\n *** Setting the CodeTest Options *** \n\n"; + set_codetest_commands(); + print "\n\n *** Building again with Instrumentation *** \n\n"; + system("abld test reallyclean winscw udeb @subsystems[$count]"); + run_system_command("abld test build winscw udeb @subsystems[$count]"); + print "\n\n *** End of Building with Instrumentation *** \n\n"; + } + print "\n\n *** UnSetting the CodeTest Options *** \n\n" if(!defined $param_nobuild); ; + unset_codetest_commands() if(!defined $param_nobuild); + splice(@sourcefiles, 0, scalar @sourcefiles); # delete sourcefiles + } + } + elsif($user_selection=~/\-/) { + for($count=0;$countError Occured : ".$?."\n" if(!@_[0]); + print "\n->Error Occured : ".@_[0]."\n" if(@_[0]); + exit 1; + } + +sub run_system_command { + system(@_[0]); + display_critical_error() if($?!=0); + } + +sub usage { +print< To run Codetest. + -eu -> To run EunitTestcases. + -mm -> To run Manual Mode.Useful if you want to find the coverage inside your code. + -resultdir->In where results will be copied. + + Also you can specify some optional flags to change the behaviour of the script. + -all -> To run all subsystems. + -sourcefiles -> To Select Source files for instrumentation + -noclean -> Don't run reallyclean + -nobuild -> Dont run symbian build commands + -nostub -> Dont build stubs + -nosdkinst-> Dont instrument sdk + + Some miscellaneous Commands + -version -> Version Information. + -help -> Usage information. + + Examples : + eunitrunner -command=ct + eunitrunner -command=eu C:/temp/results + eunitrunner -command=eu C:/temp/results -all + eunitrunner -command=ct C:/temp/results\ -sourcefiles -nobuild -noclean -nostub + + Note:This script should be run from where bld.inf file available + Note:Also you must specify TEMP environmental variable.(By default this exists in All windows system) +ENDOFUSAGE + exit 0; + } + +sub get_subsystems(){ + open WHATCMD, "abld test makefile winscw -w |"; + my @temparray; + while(){ + chomp; + my $makeFile = $_; + if( $makeFile =~ /winscw$/i ) { + @temparray=split(/\./,$makeFile); + @temparray=split(/\\/,@temparray[0]); + push @subsystems,pop(@temparray); + push @makefiles,$makeFile; + } + } + close WHATCMD; + } + +sub get_source_files($) { + open MAKE, @_[0] or die "Cant open $!"; + my @temparray; + while (){ + my($line)=$_; + if($line=~/(EPOCBLDUREL).*.\.o.*.:.*.\.cpp/){ + if($line!~/INTERNAL|internal/){ + @temparray=split(/:/,$line); + @temparray=split(/\\/,@temparray[1]); + push @sourcefiles,pop @temparray; + } + } + } + close MAKE; + } + + sub get_dll_names($){ + open MAKE, @_[0] or die "Cant open $_ $!"; + my @temparray; + my $dll_name; + while (){ + my($line)=$_; + chomp($line); + if($line=~/Target.*.\.dll/) { + @temparray=split(/\s+/,$line); + $dll_name=pop @temparray; + chomp($dll_name); + push @dll_filenames,$dll_name; + last; + } + } + close MAKE; + } + +sub print_html_report { + my $simple = XML::Simple->new(); + my($total)=0; + my($pass_count)=0; + my($fail_count)=0; + my($passPercent)=0.00; + my $struct = $simple->XMLin($eunit_xml_file, forcearray => 1,keyattr => []); + open(HTML_FILE, ">$results_destinationdir/$unittest_result_file") || die "Can't open file: $!\n"; + # Print initial HTML tags + print HTML_FILE "\n"; + print HTML_FILE "\n"; + print HTML_FILE "\n"; + print HTML_FILE "\n"; + print HTML_FILE "\n"; + print HTML_FILE "\n"; + print HTML_FILE "\n"; + print HTML_FILE "\n"; + print HTML_FILE "\n"; + print HTML_FILE "\n"; + print HTML_FILE "\n"; + print HTML_FILE "\n"; + print HTML_FILE "

Overall Result: Passed

Total TestCasesTotal PassedTotal Failed

\n"; + print HTML_FILE "
"; + + foreach my $dll(@{$struct->{dll}}){ + foreach my $mtestsuite(@{$dll->{testsuite}}){ + #if($mtestsuite->{name} eq "Wizard generated"){ + # next; + # } + foreach my $testsuite(@{$mtestsuite->{testsuite}}){ + my($testcount)=1; + print HTML_FILE "\n"; + print HTML_FILE "\n"; + print HTML_FILE "\n"; + print HTML_FILE "\n"; + print HTML_FILE "\n"; + print HTML_FILE "\n"; + print HTML_FILE "\n"; + print HTML_FILE "\n"; + print HTML_FILE "\n"; + print HTML_FILE "\n"; + foreach my $testcase(@{$testsuite->{testcase}}){ + print HTML_FILE "\n"; + print HTML_FILE "\n"; + print HTML_FILE "\n"; + print HTML_FILE "\n"; + print HTML_FILE "\n"; + print HTML_FILE "\n"; + if($testcase->{result}->[0]->{status} eq "OK"){ + print HTML_FILE "\n"; + $pass_count++; + } + else{ + print HTML_FILE "\n"; + $fail_count++; + } + print HTML_FILE "\n"; + $testcount++; + } + print HTML_FILE "

$testsuite->{name}

NoNameClassMethodTypeResult

$testcount

$testcase->{name}

$testcase->{class}

$testcase->{method}

$testcase->{type}

PASS

FAIL

\n"; + print HTML_FILE "
\n"; + } + } + } + + # Print ending HTML tags + print HTML_FILE "
"; + $total=$fail_count+$pass_count; + seek HTML_FILE,301,0; + print HTML_FILE "$total"; + seek HTML_FILE,334,0; + print HTML_FILE "$pass_count"; + seek HTML_FILE,367,0; + print HTML_FILE "$fail_count"; + if($pass_count>0 && $total>0){ + $passPercent=sprintf "%.2f", (($pass_count/$total)*100); + } + else{ + $passPercent=sprintf "%.2f","0.00"; + } + seek HTML_FILE,103,0; + print HTML_FILE "$passPercent%"; + close (HTML_FILE); # Close html + } + +__END__ + +:invoke_perl +@perl -x -S EunitRunner.bat %1 %2 %3 %4 %5 %6 %7 %8 %9 diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/scripts/EunitRunner.pl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/scripts/EunitRunner.pl Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,721 @@ +# +# 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: +# +#!perl +#line 5 + +#-------------------------------------------------------------------------------------------------- +# This Script will be used to run EUnit testcases +# Example Usage in Nightly build script +# my $currentdir = cwd; +# chdir "$ProjLocation\\mmsharing\\internal\\group"; +# system ("EunitRunner.pl -command=eu -all -dest=$Plog -summary=$Plog\\scanlog.html 2>&1 >> $Plog\\EUnit.log"); +# system ("EunitRunner.pl -command=ctc -all -dest=$Plog -summary=$Plog\\scanlog.html 2>&1 >> $Plog\\CTC.log"); +# chdir $currentdir; +# Version : 1.0 +#-------------------------------------------------------------------------------------------------- + +# Perl packages used. +use File::Find; # File operations +use XML::Simple; # XML parsing +use File::Spec::Win32; # File operartions +use Getopt::Long; # parameter handling +use Cwd; # Directory operations + +# Parameters related to Epoc. +my($build_destination_dir)= "\\Epoc32\\release\\winscw\\udeb\\"; +my($build_tools_dir)= "\\Epoc32\\tools\\"; + +# Parameters related to Digia Eunit. +my($eunit_xml_file_name)= "EUnit_Log.xml"; +my($eunit_xml_file)= "\\Epoc32\\winscw\\C\\shared\\EUnit\\Logs\\".$eunit_xml_file_name; +my($eunitParams) = "/l xml /e S60AppEnv /w 40 /p All /t 50"; +my($eunitParams2) = " /d alloc"; +my($eunitApp) = "/epoc32/release/winscw/udeb/EUnitExeRunner.exe"; +my($eunit_destination_dir)= "\\Epoc32\\release\\winscw\\udeb\\z\\sys\\bin\\"; +my($unittest_result_file)="eunit_result.html"; + +# Parameters related to Codetest(ctc). +$coverageSymbols = "MON.sym"; +$ctcCommandPart1 = "ctc-abld-winscw -i d -n"; +$ctcCommandPart2 = "-- test build winscw udeb"; +$ctcIgnoredPart1 = " -C \"EXCLUDE+*/internal/*.cpp"; +$ctcIgnoredPart2 = "\""; +$coverageProfile = "profile.txt"; +my($ctc_result_file)="./\CTCHTML/\indexF.html"; + +# Parameters related to filenames. +#my($overal_summary_file)="Overall_Summary.html"; +my($overal_summary_file)="scanlog.html"; + +# Hack : This will be used if dll names are not retrived from build environment. +my(@default_subsystems)=("UT_AVAILABILITY", + "UT_AOPLUGIN", + "UT_SIPCRPLUGIN", + "UT_MUSAIWPROVIDER", + "UT_MUSWPADAPTER", + "UT_MUSMANAGERCLIENT", + "UT_MUSMANAGERSERVER", + "UT_MUSENGINE" ); +my(@default_dll_filenames)=("UT_AVAILABILITY.DLL", + "UT_AOPLUGIN.DLL", + "UT_SIPCRPLUGIN.DLL", + "UT_MUSAIWPROVIDER.DLL", + "UT_MUSWPADAPTER.DLL", + "UT_MUSMANAGERCLIENT.DLL", + "UT_MUSMANAGERSERVER.DLL", + "UT_MUSENGINE.DLL" ); + + +my @uncompiled_sub_systems;# Holds list of uncompiled subsystems . Will be printed in report later. +my($currentdir)= cwd; # Current working directory. +my($results_destinationdir)=cwd; # Results will be stored here. +my($results_destinationdir_log)=cwd; # Log prints will be stored here. +my ($unittest_log_file) = "EUnit.log"; # Eunit build process logs will be in this file. + +# Parameters related to result prints +my($eunit_passpercent, + $eunit_failpercent, + $eunit_total_pass_count, + $eunit_total_fail_count, + $eunit_total_count, + $eunit_total_pass_percent); +my(@eunit_testsuite_name, + @eunit_testsuite_total_testcase, + @eunit_testsuite_pass_count); + +# Parameters related to globally used variables. +my (@subsystems, # List of user selected sub systems + @sourcefiles, # List of user selected source files + @exclude_sourcefiles, # List of test source files. + @makefiles, # List of make files + @dll_filenames); # List of dll file names + +my ($param_help, # To view help + $param_command, # Command to Run + $param_dest, # Copy results to + $param_all, # Build all + $param_noclean, # Do not run abld clean + $param_nobuild, # Do not run abld build + $param_nostub, # Do not build stub + $param_exe, # Specify exe file to be run instead Eunirexerunner.exe + $param_overall_summay, # Overall Summary + $param_version); # Version +my @gloabl_errors; + +# Parameters for user choice. +my($choice, + $user_selection, + $count); + +#-------------------------------------------------------------------------------------------------- +# Main +#-------------------------------------------------------------------------------------------------- + +#************************************************************************************************** +# Read commandline options. +#************************************************************************************************** +my $result = GetOptions('help' => \$param_help, # Display help info + 'command=s' => \$param_command, # Command to run + 'dest=s' => \$param_dest, # Destination directory + 'all' => \$param_all, # Run all + 'noclean' => \$param_noclean, # Dont run reallyclean + 'nobuild' => \$param_nobuild, # Dont run symbian build commands + 'nostub' => \$param_nostub, # Dont build stupbs + 'exe=s' => \$param_exe, # Launch the exe specified.if nothing then epoc will be used + 'summary=s' => \$param_overall_summay, # Launch the exe specified.if nothing then epoc will be used + 'version' => \$param_version); # Version Information + +#Test +#my $mapped_drive = "\\\\Vagrp006\\groups5\\SP_IDO\\IPASDo_MSDo"; +#$results_destinationdir = "$mapped_drive\\Builds\\multimediasharing\\3.2\\NightlyBuilds\\2008-wk8\\18-Monday\\Log\\EUnitAndCTC"; +#exit 1; + +#************************************************************************************************** +# Step 1 : Pre Cleanup. +#************************************************************************************************** + run_system_command("del "."$eunit_destination_dir"."*.dll"); + run_system_command("del "."$eunit_xml_file"); + +#************************************************************************************************** +# Step 2 : Check pre-conditions. +#************************************************************************************************** + if (! -e $build_destination_dir."EUnitExeRunner.exe") + { + print "*** EUnit is not installed for this SDK ***\n"; + exit 1; + } + +#************************************************************************************************** +# Step 2 : Check command line parameters and configure if not present to default. +#************************************************************************************************** + if(defined $param_overall_summay) + { + $overal_summary_file = $param_overall_summay ; + } + if ($param_command eq ('ctc'|'CTC'|'Ctc') ) + { + $choice=1; + } + elsif ($param_command eq ('eu'|'EU')) + { + $choice=2; + } + else + { + usage(); + } + $param_exe=$eunitApp if(!defined $param_exe); + if(defined $param_dest) + { + $results_destinationdir=$param_dest ; + } + else + { + print "\n Note: No results destination directory specified. Results will be copied to $currentdir/\Eunit\n"; + } + $results_destinationdir=~s/\//\\/g; + $results_destinationdir_log = "$results_destinationdir";# This is were logs are stored in nightly build env. + run_system_command("mkdir $results_destinationdir\\EUnitAndCTC") if (! -e "$results_destinationdir\\EUnitAndCTC"); + $results_destinationdir="$results_destinationdir\\EUnitAndCTC"; + $param_noclean=1 if(defined $param_nobuild); + $ENV{'CTC_DATA_PATH'}= ""; + run_system_command("bldmake bldfiles") if (!defined $param_nobuild); + +#************************************************************************************************** +# Step 3 : Display subsystems to user. So he can make a choice for which one to compile +# if command line parameter -all specified then it will not be shown. +#************************************************************************************************** + display_sybsystems(); + if(defined $param_all) + { + print "\nOptions -all specified.Building all components \n "; + $user_selection=0; + } + else + { + print "\t Options selected : "; + $user_selection = ; + chomp ($user_selection); + exit 0 if $user_selection =~ /^[Qq]/; + } + +#************************************************************************************************** +# Step 4 : Build subsystems. +#************************************************************************************************** + if(!$param_nostub) + { + print "\n *** Building unittest stubs ***\n "; + run_system_command("abld reallyclean winscw udeb"); + run_system_command("abld build winscw udeb"); + print "\n *** End of building stubs ***\n "; + } + if (!defined $param_nobuild) + { + print "\n *** Building test components ***\n"; + if($choice==1) + { + $ENV{'CTC_DATA_PATH'}= $currentdir; + build_user_selected("$ctcCommandPart1 $coverageSymbols $ctcIgnoredPart1 $ctcIgnoredPart2 $ctcCommandPart2"); + } + elsif($choice==2) + { + build_user_selected("abld test build winscw udeb"); + } + print "\n *** End of Building test components ***\n "; + } + +#************************************************************************************************** +# Step 5 : Run EunitRunner.exe . +#************************************************************************************************** + print "\n *** Running EUnit with selected subsystems ***\n"; + chomp(@dll_filenames); + if( scalar @dll_filenames eq 0 ) + { + print "Can not find dll names automatically.Using default configured values\n"; + @dll_filenames = @default_dll_filenames; + } + copy_dlls(); # copy dlls to eunit directory + if($choice==1) + { + run_system_command("$param_exe "."$eunitParams");# Run without alloc failure + #run_system_command("$param_exe "."$eunitParams"."$eunitParams2");# Run with alloc failure + } + elsif ($choice==2) + { + run_system_command("$param_exe "."$eunitParams"); + } + +#************************************************************************************************** +# Step 6 : Print Results. +#************************************************************************************************** + print "\n *** Printing Reports ***\n"; + if($choice==1) + { + run_system_command("ctcpost $coverageSymbols $coverageDat -p $coverageProfile -T 70"); + run_system_command("ctc2html -i $coverageProfile -t 70 -nsb"); + run_system_command("xcopy /R/F/Y/I CTCHTML $results_destinationdir\\CTCHTML"); + print_overall_summary_ctc(); + } + elsif($choice==2) + { + print_overall_summary_error();# Mainly needed for nightly build env and for eunit. + print_eunit_html_report(); + print_overall_summary_eunit(); + run_system_command("copy $eunit_xml_file $results_destinationdir\\$eunit_xml_file_name"); + run_system_command("copy $unittest_result_file $results_destinationdir\\$unittest_result_file"); + } +#This reports other script errors which might have harmed the flow of execution. +print_overall_summary_script_error(); + +#************************************************************************************************** +# Step 7 : Post Cleanup. +#************************************************************************************************** + $ENV{'CTC_DATA_PATH'}= ""; + run_system_command("del "."$eunit_destination_dir"."*.dll"); + run_system_command("del "."$eunit_xml_file"); + print "\n *** DONE ***\n"; + +#---------------------------------------Main Ends-------------------------------------------------- + +#-------------------------------------------------------------------------------------------------- +# This sub routine displays all the subsystems to the user. +#-------------------------------------------------------------------------------------------------- +sub display_sybsystems + { + get_subsystems(); + if(scalar @subsystems==0) + { + print "Can't find subsystem name automatically.Using default configured values\n" ; + @subsystems = @default_subsystems; + } + print "\n\tPlease choose an option listed below \n"; + print "\n\tenter +/- to build backward or forward \n"; + print "\t\t0.To build all \n"; + $count=1; + foreach(@subsystems) + { + print "\t\t".$count++. "." .$_."\n"; + } + print "\t\tq.Exit \n"; + } + +#-------------------------------------------------------------------------------------------------- +# Runs abld commands for the user selected choice. +#-------------------------------------------------------------------------------------------------- +sub build_user_selected + { + if($user_selection==0) + { + for($count=0;$count<@subsystems;$count++) + { + run_system_command("abld test reallyclean winscw udeb @subsystems[$count]"); + run_system_command("@_[0] @subsystems[$count]"); + get_dll_names(@makefiles[$count]); + } + } + elsif($user_selection=~/\+/) + { + for($count=substr($user_selection,0,1)-1;$count<@subsystems;$count++) + { + run_system_command("abld test reallyclean winscw udeb @subsystems[$count]"); + run_system_command("@_[0] @subsystems[$count]"); + get_dll_names(@makefiles[$count]); + } + } + elsif($user_selection=~/\-/) + { + for($count=0;$countERROR OCCURED : "."$?"."\n" if(!@_[0]); + print "\n ->ERROR OCCURED : ".@_[0]."\n" if(@_[0]); + #exit 1; + } + +#-------------------------------------------------------------------------------------------------- +# Calls system command and displays error in case. +#-------------------------------------------------------------------------------------------------- +sub run_system_command + { + print " \n -> Command : " .@_[0] ."\n"; + system(@_[0]); + push @gloabl_errors,"Error Occured for Command : @_[0] Error : $?" if($?!=0); + display_critical_error() if($?!=0); + return $?; + } + +#-------------------------------------------------------------------------------------------------- +# Prints Usage. +#-------------------------------------------------------------------------------------------------- +sub usage + { +print< To run CTC. + -eu -> To run EunitTestcases. + -mm -> To run Manual Mode.Useful if you want to find the coverage inside your code. + -resultdir->In where results will be copied. + + Also you can specify some optional flags to change the behaviour of the script. + -all -> To run all subsystems. + -sourcefiles -> To Select Source files for instrumentation + -noclean -> Don't run reallyclean + -nobuild -> Dont run symbian build commands + -nostub -> Dont build stubs + -nosdkinst-> Dont instrument sdk + + Some miscellaneous Commands + -version -> Version Information. + -help -> Usage information. + + Examples : + eunitrunner -command=ctc + eunitrunner -command=eu C:/temp/results + eunitrunner -command=eu C:/temp/results -all + eunitrunner -command=ctc C:/temp/results\ -sourcefiles -nobuild -noclean -nostub + + Note:This script should be run from where bld.inf file available + Note:Also you must specify TEMP environmental variable.(By default this exists in All windows system) +ENDOFUSAGE + exit 0; + } + +#-------------------------------------------------------------------------------------------------- +# Runs abld to make makefile and parse makefile to get subsystems. +#-------------------------------------------------------------------------------------------------- +sub get_subsystems() + { + #Testing prupose to check how abld test makefile command runs. + run_system_command("abld test makefile winscw -w"); + + open WHATCMD, "abld test makefile winscw -w |"; + my @temparray; + while() + { + chomp; + my $makeFile = $_; + if( $makeFile =~ /winscw$/i ) + { + @temparray=split(/\.WINSCW/,$makeFile); + @temparray=split(/\\/,@temparray[0]); + push @subsystems,pop(@temparray); + push @makefiles,$makeFile; + } + } + print "\n Makefiles = @makefiles\n"; + print "\n Subsystems = @subsystems\n"; + close WHATCMD; + } + +#-------------------------------------------------------------------------------------------------- +# Parses makefile to get source files. Useful if you want to run coverage for particular source file. +#-------------------------------------------------------------------------------------------------- +sub get_source_files($) + { + open MAKE, @_[0] or die "Cant open $!"; + my @temparray; + while () + { + my($line)=$_; + if($line=~/(EPOCBLDUREL).*.\.o.*.:.*.\.cpp/) + { + if($line!~/INTERNAL|internal/) + { + @temparray=split(/:/,$line); + @temparray=split(/\\/,@temparray[1]); + push @sourcefiles,pop @temparray; + } + } + } + close MAKE; + } + +#-------------------------------------------------------------------------------------------------- +# Parses makefile to get dll names. +#-------------------------------------------------------------------------------------------------- + sub get_dll_names($) + { + open MAKE, @_[0] or die "Cant open $_ $!"; + my @temparray; + my $dll_name; + while () + { + my($line)=$_; + chomp($line); + if($line=~/Target.*.\.dll/) + { + @temparray=split(/\s+/,$line); + $dll_name=pop @temparray; + chomp($dll_name); + push @dll_filenames,$dll_name; + last; + } + } + close MAKE; + } + +#-------------------------------------------------------------------------------------------------- +# Parses eunit result xml file and prints it as html file. +#-------------------------------------------------------------------------------------------------- +sub print_eunit_html_report + { + my $simple = XML::Simple->new(); + my $struct = eval {$simple->XMLin($eunit_xml_file, forcearray => 1,keyattr => [])}; + push @gloabl_errors,"Invalid XML document Error : $@" if($@); + open(HTML_FILE, ">$unittest_result_file") ||(push @gloabl_errors,"Can not open $unittest_result_file for Eunit" and return); + print HTML_FILE "\n"; + print HTML_FILE "\n"; + print HTML_FILE "\n"; + print HTML_FILE "\n"; + print HTML_FILE "\n"; + print HTML_FILE "\n"; + print HTML_FILE "\n"; + print HTML_FILE "\n"; + print HTML_FILE "\n"; + print HTML_FILE "\n"; + print HTML_FILE "\n"; + print HTML_FILE "\n"; + print HTML_FILE "

Overall Result: Passed

Total TestCasesTotal PassedTotal Failed

\n"; + print HTML_FILE "
"; + + foreach my $dll(@{$struct->{dll}}) + { + my $dll_pass_count = 0; + foreach my $mtestsuite(@{$dll->{testsuite}}) + { + foreach my $testsuite(@{$mtestsuite->{testsuite}}) + { + my($testcount)=1; + print HTML_FILE "\n"; + print HTML_FILE "\n"; + print HTML_FILE "\n"; + print HTML_FILE "\n"; + print HTML_FILE "\n"; + print HTML_FILE "\n"; + print HTML_FILE "\n"; + print HTML_FILE "\n"; + print HTML_FILE "\n"; + print HTML_FILE "\n"; + foreach my $testcase(@{$testsuite->{testcase}}) + { + print HTML_FILE "\n"; + print HTML_FILE "\n"; + print HTML_FILE "\n"; + print HTML_FILE "\n"; + print HTML_FILE "\n"; + print HTML_FILE "\n"; + if($testcase->{result}->[0]->{status} eq "OK") + { + print HTML_FILE "\n"; + $eunit_total_pass_count++; + $dll_pass_count++ ; + } + else + { + print HTML_FILE "\n"; + $eunit_total_fail_count++; + } + print HTML_FILE "\n"; + $testcount++; + } + print HTML_FILE "

$testsuite->{name}

NoNameClassMethodTypeResult

$testcount

$testcase->{name}

$testcase->{class}

$testcase->{method}

$testcase->{type}

PASS

FAIL

\n"; + print HTML_FILE "
\n"; + } + push @eunit_testsuite_name,$mtestsuite->{name}; + push @eunit_testsuite_total_testcase,$mtestsuite->{size}; + push @eunit_testsuite_pass_count,$dll_pass_count; + } + } + print HTML_FILE "
"; + $eunit_total_count=$eunit_total_fail_count+$eunit_total_pass_count; + seek HTML_FILE,301,0; + print HTML_FILE "$eunit_total_count"; + seek HTML_FILE,334,0; + print HTML_FILE "$eunit_total_pass_count"; + seek HTML_FILE,367,0; + print HTML_FILE "$eunit_total_fail_count"; + if($eunit_total_pass_count>0 && $eunit_total_count>0) + { + $eunit_total_pass_percent=sprintf "%.2f", (($eunit_total_pass_count/$eunit_total_count)*100); + } + else + { + $eunit_total_pass_percent=sprintf "%.2f","0.00"; + } + seek HTML_FILE,103,0; + print HTML_FILE "$eunit_total_pass_percent%"; + close (HTML_FILE); + } + + #-------------------------------------------------------------------------------------------------- + # Prints overall summary in file specified in command line argument. + #-------------------------------------------------------------------------------------------------- + sub print_overall_summary_eunit + { + open OVER_ALL_SUMMARY, ">>$overal_summary_file" or (push @gloabl_errors,"Can not open $overal_summary_file for Eunit" and return); + print OVER_ALL_SUMMARY "

Eunit Summary

\n "; + print OVER_ALL_SUMMARY " \n "; + print OVER_ALL_SUMMARY " \n "; + print OVER_ALL_SUMMARY " \n "; + print OVER_ALL_SUMMARY " \n "; + print OVER_ALL_SUMMARY " \n "; + my($count)= 0; + foreach $_(@eunit_testsuite_name) + { + my $dll_pass_percent = 0; + my $dll_fail_percent = 0; + my $dll_name = @eunit_testsuite_name[$count]; + my $dll_total = @eunit_testsuite_total_testcase[$count]; + my $dll_pass = @eunit_testsuite_pass_count[$count]; + if($dll_total>0 && $dll_pass>0) + { + $dll_pass_percent=sprintf "%.2f", (($dll_pass/$dll_total)*100); + } + else + { + $dll_pass_percent=sprintf "%.2f","0.00 \n "; + } + $dll_fail_percent = 100 - $dll_pass_percent; + print OVER_ALL_SUMMARY " \n "; + print OVER_ALL_SUMMARY " \n "; + print OVER_ALL_SUMMARY " \n "; + print OVER_ALL_SUMMARY " \n "; + print OVER_ALL_SUMMARY " \n "; + print OVER_ALL_SUMMARY " \n "; + $count ++; + } + print OVER_ALL_SUMMARY " \n "; + print OVER_ALL_SUMMARY " \n "; + print OVER_ALL_SUMMARY " \n "; + print OVER_ALL_SUMMARY " \n "; + my $total_eunit_fail_percent = 100 - $eunit_total_pass_percent; + print OVER_ALL_SUMMARY " \n "; + print OVER_ALL_SUMMARY " \n "; + print OVER_ALL_SUMMARY "
PassRate % - Pass/ all  Subsystem

$dll_pass_percent %   $dll_pass/$dll_total \"\"\"\"$dll_name

$eunit_total_pass_percent %   $eunit_total_pass_count/$eunit_total_count \"\"\"\"OVERALL

\n "; + print OVER_ALL_SUMMARY "View compleate results : $results_destinationdir\\$unittest_result_file \n "; + close OVER_ALL_SUMMARY; + } + +#-------------------------------------------------------------------------------------------------- +#Prints overall summary of CTC in file specified in command line argument. +#-------------------------------------------------------------------------------------------------- +sub print_overall_summary_ctc + { + + open OVER_ALL_SUMMARY, ">>$overal_summary_file" or (push @gloabl_errors,"Can not open $overal_summary_file for CTC \n " and return ); + open CTC_RESULT,"$ctc_result_file"; + @lines = ; + print OVER_ALL_SUMMARY "

CTC Summary

\n "; + print OVER_ALL_SUMMARY " \n"; + print OVER_ALL_SUMMARY "\n"; + print OVER_ALL_SUMMARY "\n"; + print OVER_ALL_SUMMARY "\n"; + foreach $_(@lines) + { + if ($_=~/hr width=/) + { + print OVER_ALL_SUMMARY $_; + } + if ($_=~/img border=/) + { + print OVER_ALL_SUMMARY $_; + } + } + print OVER_ALL_SUMMARY "
TER % - covered/ all  Directory

\n"; + print OVER_ALL_SUMMARY "View compleate results : $results_destinationdir\\CTCHTML\\index.html \n "; + close CTC_RESULT; + close OVER_ALL_SUMMARY; +} + +#-------------------------------------------------------------------------------------------------- +#Check uncompiled subsystems by checking the dll names. +#-------------------------------------------------------------------------------------------------- +sub copy_dlls + { + my $error = 0; + foreach my $dll(@dll_filenames) + { + $error = run_system_command("copy ".$build_destination_dir.$dll." ".$eunit_destination_dir.$dll); + push @uncompiled_sub_systems,$dll if($error!=0) + } + } + +#-------------------------------------------------------------------------------------------------- +# Prints overall error summary if any compilation errors happen. +#-------------------------------------------------------------------------------------------------- + sub print_overall_summary_error + { + open OVER_ALL_SUMMARY, ">>$overal_summary_file" or (push @gloabl_errors,"Can not open $overal_summary_file for Eunit" and return) ; + if (scalar @uncompiled_sub_systems != 0) + { + print OVER_ALL_SUMMARY "

Compilation Errors

\n "; + my $count = 1; + print OVER_ALL_SUMMARY "

Following dll's were not found. Possibly because of build errors! \n

"; + foreach $_(@uncompiled_sub_systems) + { + print OVER_ALL_SUMMARY "

$count. $_

\n"; + $count++; + } + print OVER_ALL_SUMMARY "View Error details : $results_destinationdir_log\\$unittest_log_file \n "; + } + close OVER_ALL_SUMMARY; + } + + #-------------------------------------------------------------------------------------------------- +# Prints overall error summary if any compilation errors happen. +#-------------------------------------------------------------------------------------------------- + sub print_overall_summary_script_error + { + open OVER_ALL_SUMMARY, ">>$overal_summary_file" or return ; + if(scalar @gloabl_errors) + { + print OVER_ALL_SUMMARY "

Execution Errors

\n "; + my $count = 1; + foreach $_(@gloabl_errors) + { + print OVER_ALL_SUMMARY "

$count.$_

\n"; + $count++; + } + print OVER_ALL_SUMMARY "View Error details : $results_destinationdir_log\\$unittest_log_file \n "; + } + close OVER_ALL_SUMMARY; + } + +# End of file. diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/scripts/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/scripts/bld.inf Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,42 @@ +/* +* 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: project specification +* +*/ + + + +PRJ_PLATFORMS +DEFAULT + +PRJ_MMPFILES +../../src/internal/stubs/mceclientstub/group/mceclientstub.mmp +../../src/internal/stubs/musmanagerstub/group/musmanagerstub.mmp + +PRJ_TESTMMPFILES + +../../src/availability/internal/test/group/ut_availability.mmp +../../src/plugins/aoplugin/internal/test/group/ut_aoplugin.mmp +../../src/plugins/sipcrplugin/internal/test/group/ut_sipcrplugin.mmp +../../src/plugins/aiwplugin/internal/test/group/ut_musaiwprovider.mmp +../../src/plugins/wpadapterplugin/internal/test/group/ut_muswpadapter.mmp +../../src/manager/client/internal/test/group/ut_musmanagerclient.mmp +../../src/manager/server/internal/test/group/ut_musmanagerserver.mmp +../../src/engine/internal/test/group/ut_musengine.mmp +../../src/common/internal/test/group/ut_muscommon.mmp +../../src/manager/indicator/internal/test/group/ut_musindicator.mmp + + + + diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/scripts/buildcheck.cmd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/scripts/buildcheck.cmd Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,106 @@ +rem +rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +rem All rights reserved. +rem This component and the accompanying materials are made available +rem under the terms of "Eclipse Public License v1.0" +rem which accompanies this distribution, and is available +rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +rem +rem Initial Contributors: +rem Nokia Corporation - initial contribution. +rem +rem Contributors: +rem +rem Description: +rem + +@goto invoke_perl + +#!perl +#line 5 + +################################################################################################################ +# This Script will be used to count errors and warnings in abld +################################################################################################################ + +# Packages needed +use strict; # strict naming rules +use Getopt::Long; # parameter handling +use Cwd; # Directory operations +Getopt::Long::Configure( "bundling_override","ignore_case_always" ); + +my($param_help, + $param_dest); +my($ecount)=0; +my($wcount)=0; +my($destination)=cwd; + +# read commandline parameters +my $result = GetOptions('help' => \$param_help, # Display help info + 'dest=s' => \$param_dest); # Destination directory +if(defined $param_dest){ + $destination=$param_dest ; + } +else{ + print "\n Note: No results destination directory specified.\n"; + $destination=~s/\//\\/g; + $destination=$destination."\\"; + } + +$destination.="\Build"; +mkdir($destination); +print " Note: Results will be copied to $destination\n"; +open SUMMARY,">$destination\\summary.txt" or die "Can't Open $!"; +system("bldmake bldfiles"); +display_critical_error() if($?!=0); +system("abld reallyclean winscw urel"); +print "\n *** Building for winscw urel and logging in file $destination\\winscw_log.txt *** \n"; +system("abld build winscw urel >$destination\\winscw_log.txt"); +display_critical_error() if($?!=0); +print "\n *** End of Building for winscw urel *** \n"; +open LOGFILE,"$destination\\winscw_log.txt" or die "Can't Open $!"; +print "\n *** Writing summary for winscw *** \n"; +while(){ + if($_=~/error/){ + $ecount++; + } + if($_=~/warning/){ + $wcount++; + } +} +close LOGFILE; +print SUMMARY "WINSCW build Errors\t=$ecount \n"; +print SUMMARY "WINSCW build Warnings\t=$wcount \n"; +$ecount=0; +$wcount=0; +print "\n *** Building for armv5 urel and logging in $destination\\armv5_log.txt *** \n"; +system("abld reallyclean armv5 urel"); +system("abld build armv5 urel >$destination\\armv5_log.txt"); +display_critical_error() if($?!=0); +print "\n *** End of Building for armv5 urel *** \n"; +open LOGFILE,"$destination\\armv5_log.txt" or die "Can't Open $!"; +print "\n *** Writing summary for armv5 *** \n "; +while(){ + if($_=~/error/){ + $ecount++; + } + if($_=~/warning/){ + $wcount++; + } +} +close LOGFILE; +print SUMMARY "ARMV5 build Errors\t=$ecount \n"; +print SUMMARY "ARMV5 build Warnings\t=$wcount \n"; +close LOGFILE; +close SUMMARY; +print "\n *** DONE *** \n"; + +sub display_critical_error { + print "\n-> Critical Error Occured : ".$?."\n" if(!@_[0]); + print "\n-> Critical Error Occured : ".@_[0]."\n" if(@_[0]); + exit 1; + } +__END__ + +:invoke_perl +@perl -x -S buildcheck.cmd %1 %2 %3 %4 %5 %6 %7 %8 %9 diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/scripts/codetest.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/scripts/codetest.py Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,119 @@ +# +# 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: +# +# codetest.py +# Start EUnitExeRunner and collect relevent data's. + +#Import relevent modules +import time,os,sys,re +from ctest.DataObjM import CovObjDef +from ctest import CTCommonDef +from ctest.DataObjM import TaskObjDef + +try: + + #Close Existing Workspace if any + ctob.closeWorkspace() + + #port is hardcored to 3020 which is default for codetest + port = int('3020') + + #Start CT Server + ctserverDir=os.environ.get("AMC_HOME")+'/bin/ctserver.exe' + os.spawnv(os.P_NOWAIT,ctserverDir,['ctserver']) + + # Create a SWIC/Native Data Source with a 30 second comm timeout. + ds = ctob.createCtSWIC('localhost', port, 30) + print ds.getName(), 'data source created...' + + # Set data source configuration information. + ds.setIDB('$TEMP/codetest.idb') + + # Connect to the data source. + ds.connect() + + # Put the data source into continuous mode. + ds.setContinuousMode() + + # Start data collection. + ds.start() + + #start EUnitExeRunner + print 'Starting application...' + myfile = open(os.environ.get("TEMP")+'\unitrunner.dat', 'r') + commandList = myfile.readlines() + myfile.close() + parser = re.compile(r'\s') + options=parser.split(commandList[1]) + eUnitExeRunner = commandList[0].rstrip() + os.spawnv(os.P_WAIT,eUnitExeRunner,options) + + print 'wait 5 seconds for data collection...' + # Wait for 10 seconds to allow data collection. + time.sleep(5) + + # Collect continuous mode data. + ds.collectData() + + # Stop data collection. + ds.stop() + + # At this point both continuous and trace data should appear in GUI. + # Save to a datafile + fileName ='$TEMP/codetest_result.dat' + retv = ds.saveData(fileName) + if retv: + print '%s: data saved to %s.'%(ds.getName(), fileName) + else: + print 'Error saving datafile!' + + ds.shutdown() + +except: + ds.shutdown() + sys.exit() + +try : + # generate result + print 'Now generating results file......' + df = ctob.createCtDataFile(fileName) + print df.dataFileName(), ' data file loaded to workspace...' + + #Get data set objects + coverageObj0 = df.getCoverageObjs()[0] + print "Got dataset objects" + + coverageObj0.sortData('coverage',1) + coverageObj0.setViewFuncNameLong() + + coverageObj0.setFileCoverageMode() + cov_view_one = '$TEMP/codetest_file_coverage.html' + coverageObj0.exportView(cov_view_one, CTCommonDef.HTML_FORMAT,' ',' ' ) + print 'Coverage details are saved in '+cov_view_one; + covReportFile = '$TEMP/codetest_summary.txt' + coverageObj0.writeCoverageReport(covReportFile, CovObjDef.OVERALL_SUMMARY) + print 'Overall coverage summary saved in '+covReportFile; + + covFunctionReportFile = '$TEMP/codetest_function_coverage.txt' + coverageObj0.writeCoverageReport(covFunctionReportFile, CovObjDef.FUNCTION_SUMMARY) + print 'Function coverage summary saved in '+covFunctionReportFile; + + covUnCoveredReportFile = '$TEMP/codetest_function_uncovered_statements.txt' + coverageObj0.writeCoverageReport(covUnCoveredReportFile, CovObjDef.UNCOVERED_ONLY) + print 'Uncovered coverage summary saved in '+covUnCoveredReportFile; + +except: + print 'Unable to write reports' + sys.exit() \ No newline at end of file diff -r e8be2c2e049d -r 7a2f5f2dfe61 tsrc/scripts/runLint.cmd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/scripts/runLint.cmd Thu Jul 22 16:32:26 2010 +0100 @@ -0,0 +1,208 @@ +rem +rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +rem All rights reserved. +rem This component and the accompanying materials are made available +rem under the terms of "Eclipse Public License v1.0" +rem which accompanies this distribution, and is available +rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +rem +rem Initial Contributors: +rem Nokia Corporation - initial contribution. +rem +rem Contributors: +rem +rem Description: +rem + +@goto Invoke + +#!perl +# +# This Script Runs PCLint Static Code Analysis tool . +# +# runLint.cmd + + +# Run from a directory containing a bld.inf + +use strict; +use Cwd; + +my($pclintDir)= "pclint"; +mkdir $pclintDir; + +# Get Code Type. The value for this is blank for production code and test for test code +my $type = ""; +my $filterFile = "normal.lnt"; +my $filterFileDir = "C:\\APPS\\pclint_8.0q"; +my $destination; +if($#ARGV >= 0 ) { +$destination = $ARGV[0] ; +} +else{ +$destination= cwd ; +} +$destination.="\\".'PCLint'; +system("mkdir $destination") ; +$filterFileDir=$ARGV[1] if($#ARGV >= 1 ); +$filterFile=$ARGV[2] if($#ARGV >= 2 ); +$type = $ARGV[3] if($#ARGV >= 3 ); +if($ARGV[0]=~m/-h|-H/) + { + usage(); + exit 0; + } + +# Re generate winscw makefile +#system( "bldmake -k bldfiles" ); +#system( "abld -k $type makefile winscw" ); + +#copy .lnt file to local folder +system( "copy $filterFileDir\\*.lnt . " ); + +# Run Lint over each of the requested makefiles +# The make file is used to determine source, include paths; and #defines to use +open WHATCMD, "abld $type makefile winscw -w |"; + +open(SUMMARY,">$destination\\summary.txt") || die " Can't Open Summary FileName \n"; + +while( ) +{ + chomp; + my $makeFile = $_; + my @temparray; + if( $makeFile =~ /winscw$/i ) + { + @temparray=split(/\./,$makeFile); + @temparray=split(/\\/,$temparray[0]); + my $fileName = pop(@temparray); + $fileName = $fileName."\.txt"; + print "\nRunning PCLint for Module $fileName \n"; + my $optionFile = "current.lnt"; + unlink( $optionFile ) if( -f $optionFile ); + GenerateOptions( $makeFile, $optionFile ); + system( "lint-nt.exe -i $filterFile current.lnt >$destination\\$fileName"); + unlink( $optionFile ) if( -f $optionFile ); + print SUMMARY "Module Name\t: $fileName \n"; + print SUMMARY " Total Errors\t: ".countError($fileName,'error')."\n"; + print SUMMARY " Total Warnings\t: ".countError($fileName,'Warning')."\n"; + } +} +close SUMMARY; +system( "del *.lnt" ); + +sub GenerateOptions($$) +# generate PC-LINT options file from winscw makefile +{ + my ($makeFile, $optionFile) = @_; + + open INP, $makeFile or die "Can't open $makeFile"; + my $line; + my $cwd; + while(defined($line = )) + { + chomp $line; + if($line =~ /^# CWD (.+)/) + { + $cwd = $1; + last; + } + } + + my $inc = ""; + my $defs = ""; + my $src = ""; + my $totLine = ""; + while(defined($line = )) + { + chomp $line; + if($line =~ /(.*)\\$/) + { + $totLine .= $1; + } + else + { + $totLine .= $line; + if($inc eq "" && $totLine =~ /^\s*INCDIR\s*=(.+)/) + { + my @dirs = split /\s+-i\s+/, $1; + foreach my $dir (@dirs) + { + $dir =~ s/-cwd source/ /g; + $dir =~ s/-i-/ /g; + $dir =~ s/^\s*//; + $dir =~ s/\s*$//; + + my @forceIncList = split /\s+-include\s+/, $dir; + my $isInc = 1; + foreach my $force (@forceIncList) + { + $force =~ s/\"//g; + if( $force ) + { + $inc .= $isInc? "-i$force\n" : "-header($force)\n"; + $isInc = 0; + } + } + } + } + elsif($defs eq "" && $totLine =~ /^\s*CWDEFS\s*=\s*(.+)/) + { + my @macs = split /\s*-d/, $1; + foreach my $mac (@macs) + { + $mac =~ s/\"//g; + $mac =~ s/^ //; + $mac =~ s/\s.+$//g; + $defs .= "-d$mac\n"; + } + } + elsif($totLine =~ /^\$\(EPOCBLDUREL\)\\.+\.o : (\S+)/) # NB! this presumes that source file paths never include whitespace! if they do then (\S+) has to change to allow for dbl-quote packaging + { + $src .= "$1\n" if( $1 !~ /\.uid\.cpp$/i ); + } + $totLine = ""; + } + } + + open OUT, ">$optionFile" or die "can't create lint options file $optionFile"; + + print OUT "$inc$defs-d_DEBUG\n-d_UNICODE\n$src\n"; + + close OUT; +} + +sub usage + { + print "\n\t Usage : \n"; + print "\t\t runLint